This commit is contained in:
Zixaphir 2013-05-20 16:59:06 -07:00
commit dd4520fecf
24 changed files with 261 additions and 8066 deletions

View File

@ -1,20 +0,0 @@
// ==UserScript==
// @name 4chan x
// @namespace aeosynth
// @version 1.0.11
// @description Cross-browser userscript for maximum lurking on 4chan.
// @copyright 2013-2013 Zixaphir <zixaphirmoxphar@gmail.com>
// @copyright 2013-2013 Jordan Bates <saudrapsmann@gmail.com>
// @copyright 2009-2011 James Campos <james.r.campos@gmail.com>
// @copyright 2012-2013 Nicolas Stepien <stepien.nicolas@gmail.com>
// @license MIT; http://en.wikipedia.org/wiki/Mit_license
// @match *://*.4chan.org/*
// @grant GM_getValue
// @grant GM_setValue
// @grant GM_deleteValue
// @grant GM_openInTab
// @run-at document-start
// @updateURL https://github.com/seaweedchan/4chan-x/raw/stable/4chan_x.meta.js
// @downloadURL https://github.com/seaweedchan/4chan-x/raw/stable/4chan_x.user.js
// @icon data:image/gif;base64,R0lGODlhYAAQAJEAAGbMM////wAAAP///yH5BAEAAAMALAAAAABgABAAAAL8nI+py+0Po5y02ruEFmh7PnxbJ3KecR4pqoWr2iajIgR2AIb3bu43WPPhdENiLmg7Jn25EODZFDwBTSIPJRwir1tuElvshrNf1RR4lv2QPZzmG9zA16c4uO3+WeVl55Qq9RdVZlc4p3VYdcfXBpSo0ufyJ1gVx2j0huhmWKSW1Xhpd0czSZVBhucl1Hj6acVkBNnZIcggdgh7y0qTFIoaOypTqoiZCTpjiRwp66jp8RhsVmrq2bzbsbz3AcxpDfztBxUIVT0qij0LtsoN3c1MSx5eSQiNTqzL7mzed+4khfZPBrIRL1jEoFHCRYw6A1usKGiiQwgMFCtalFAAADs=
// ==/UserScript==

File diff suppressed because one or more lines are too long

View File

@ -1,3 +1,40 @@
### v1.2.8
*2013-05-20*
**MayhemYDG**:
- Tiny fixes
**seaweedchan**:
- New image expansion option: `Advance on contract`. Advances to next post unless Fappe Tyme is enabled (temporary)
- Change `.qr-link` to `.qr-link-container` and `.qr-link>a` to `.qr-link`
**Wohlfe**:
- Add /pol/ archiving for FoolzaShit
### v1.2.7
*2013-05-18*
**seaweedchan**:
- Update /q/'s posting cooldown
- Make "___ omitted. Click here to view." text change when thread is expanded.
- Restrict "Reply to Thread" click event to the link itself
- Fix Nyafuu being undefined
### v1.2.6
*2013-05-16*
**seaweedchan**:
- Fix bug with theme switching
### v1.2.5
*2013-05-15*
**seaweedchan**:
- New option `Captcha Warning Notifications`
- When disabled, shows a red border around the captcha to indicate captcha errors. Goes back to normal when any key is pressed.
- Color Quick Reply's inputs in Tomorrow to match the theme
- Revert some of Mayhem's changes that caused new bugs
### v1.2.4
*2013-05-14*

View File

@ -1,5 +1,5 @@
/*
* 4chan X - Version 1.2.4 - 2013-05-15
* 4chan X - Version 1.2.8 - 2013-05-20
*
* Licensed under the MIT license.
* https://github.com/seaweedchan/4chan-x/blob/master/LICENSE

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
// ==UserScript==
// @name 4chan X
// @version 1.2.4
// @version 1.2.8
// @namespace 4chan-X
// @description Cross-browser userscript for maximum lurking on 4chan.
// @license MIT; https://github.com/seaweedchan/4chan-x/blob/master/LICENSE

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
{
"name": "4chan X",
"version": "1.2.4",
"version": "1.2.8",
"manifest_version": 2,
"description": "Cross-browser userscript for maximum lurking on 4chan.",
"icons": {

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
postMessage({version:'1.2.4'},'*')
postMessage({version:'1.2.8'},'*')

View File

@ -1,6 +1,6 @@
{
"name": "4chan-X",
"version": "1.2.4",
"version": "1.2.8",
"description": "Cross-browser userscript for maximum lurking on 4chan.",
"meta": {
"name": "4chan X",
@ -28,7 +28,7 @@
"grunt-contrib-compress": "~0.5.0",
"grunt-contrib-concat": "~0.3.0",
"grunt-contrib-copy": "~0.4.1",
"grunt-contrib-watch": "~0.4.2",
"grunt-contrib-watch": "~0.4.3",
"grunt-shell": "~0.2.2"
},
"repository": {

View File

@ -56,6 +56,7 @@ Redirect =
'files': ['hr', 'tg', 'tv', 'x']
'Nyafuu':
'domain': 'archive.nyafuu.org'
'http': true
'https': true
'software': 'foolfuuka'
@ -82,7 +83,7 @@ Redirect =
'http': true
'https': true
'software': 'foolfuuka'
'boards': ['adv', 'asp', 'cm', 'e', 'i', 'lgbt', 'n', 'o', 'p', 's', 's4s', 't', 'trv', 'y']
'boards': ['adv', 'asp', 'cm', 'e', 'i', 'lgbt', 'n', 'o', 'p', 'pol', 's', 's4s', 't', 'trv', 'y']
'files': ['adv', 'asp', 'cm', 'e', 'i', 'lgbt', 'n', 'o', 'p', 's', 's4s', 't', 'trv', 'y']
'Install Gentoo':
@ -105,8 +106,8 @@ Redirect =
'domain': 'archive.heinessen.com'
'http': true
'software': 'fuuka'
'boards': ['an', 'fit', 'k', 'mlp', 'r9k', 'toy', 'x']
'files': ['an', 'k', 'toy', 'x']
'boards': ['an', 'fit', 'k', 'mlp', 'r9k', 'toy']
'files': ['an', 'k', 'toy']
'warosu':
'domain': 'fuuka.warosu.org'

View File

@ -377,7 +377,11 @@ Config =
true
'Expand all images only from current position to thread end.'
]
'Advance on contract': [
false
'Advance to next post when contracting an expanded image.'
]
filter:
name: """
# Filter any namefags:

View File

@ -78,7 +78,7 @@ Get =
# Stop here if the container has been removed while loading.
return unless root.parentNode
clone = post.addClone context
Main.callbackNodes Post, [clone]
Main.callbackNodes Clone, [clone]
# Get rid of the side arrows.
{nodes} = clone

View File

@ -19,7 +19,7 @@ Main =
$.get Conf, Main.initFeatures
$.on d, '4chanMainInit', Main.initStyle
$.asap (-> d.head and $('title', d.head) or d.readyState in ['interactive', 'complete']),
$.asap (-> d.head and $('link[rel="shortcut icon"]', d.head) or d.readyState in ['interactive', 'complete']),
Main.initStyle
initFeatures: (items) ->
@ -27,7 +27,7 @@ Main =
pathname = location.pathname.split '/'
g.BOARD = new Board pathname[1]
return if g.BOARD.ID is 'z'
return if g.BOARD.ID in ['z', 'fk']
g.VIEW =
switch pathname[2]
when 'res'

View File

@ -692,7 +692,7 @@ a.hide-announcement {
border-width: 1px;
border-style: solid;
}
.qr-link {
.qr-link-container {
text-align: center;
}
.persona {

View File

@ -3,9 +3,6 @@
background-color: #282A2E;
border-color: #111;
}
:root.tomorrow .field:focus {
border-color: #000;
}
/* Header */
:root.tomorrow #header-bar, :root.tomorrow #notifications {
@ -38,6 +35,15 @@
:root.tomorrow .qr-preview {
background-color: rgba(255, 255, 255, .15);
}
:root.tomorrow #qr .field {
background-color: rgb(26, 27, 29);
color: rgb(197,200,198);
border-color: rgb(40, 41, 42);
}
:root.tomorrow #qr .field:focus {
border-color: rgb(129, 162, 190) !important;
background-color: rgb(30,32,36);
}
/* Menu */
:root.tomorrow #menu {

View File

@ -81,7 +81,14 @@ $.ajax = (url, callbacks, opts={}) ->
r.setRequestHeader key, val
$.extend r, callbacks
$.extend r.upload, upCallbacks
r.withCredentials = cred
try
# Firefox throws an error if you try
# to set this on a synchronous XHR.
# Only cookies from the remote domain
# are used in a request withCredentials.
r.withCredentials = cred
catch err
# do nothing
r.send form
r
@ -90,17 +97,21 @@ $.cache = do ->
(url, cb) ->
if req = reqs[url]
if req.readyState is 4
cb.call req
cb.call req, req.evt
else
req.callbacks.push cb
return
rm = -> delete reqs[url]
req = $.ajax url,
onload: (e) ->
cb.call @, e for cb in @callbacks
delete @callbacks
onabort: rm
onerror: rm
try
req = $.ajax url,
onload: (e) ->
cb.call @, e for cb in @callbacks
@evt = e
delete @callbacks
onabort: rm
onerror: rm
catch err
return
req.callbacks = [cb]
reqs[url] = req

View File

@ -62,7 +62,7 @@ class DataBoard
for boardID, val of @data.boards
# XXX tmp fix for users that had the `null`
# value for a board with the Unread features:
unless val
if typeof @data.boards[boardID] isnt 'object'
delete @data.boards[boardID]
else
@deleteIfEmpty {boardID}

View File

@ -68,7 +68,10 @@ ImageExpand =
ImageExpand.expand post
return
ImageExpand.contract post
rect = post.nodes.root.getBoundingClientRect()
rect = if Conf['Advance on contract'] and !($.hasClass doc, 'fappeTyme')
post.nodes.root.nextSibling.getBoundingClientRect()
else
post.nodes.root.getBoundingClientRect()
return unless rect.top <= 0 or rect.left <= 0
{top} = rect

View File

@ -31,7 +31,7 @@ DeleteLink =
el: div
order: 40
open: (post) ->
return false if post.isDead
return false if post.isDead or post.board.ID is 'q'
DeleteLink.post = post
node = div.firstChild
node.textContent = 'Delete'
@ -86,10 +86,7 @@ DeleteLink =
delete DeleteLink.cooldown.counting
return
DeleteLink.cooldown.counting = post
length = if post.board.ID is 'q'
600
else
30
length = 30
seconds = Math.ceil (length * $.SECOND - (Date.now() - post.info.date)) / $.SECOND
DeleteLink.cooldown.count post, seconds, length, node
count: (post, seconds, length, node) ->

View File

@ -31,19 +31,19 @@ ExpandThread =
thread.isExpanded = true
return
thread.isExpanded = 'loading'
a.textContent = a.textContent.replace '+', '× Loading...'
a.textContent = a.textContent.replace '+', '...'
$.cache "//api.4chan.org/#{thread.board}/res/#{thread}.json", ->
ExpandThread.parse @, thread, a
when 'loading'
thread.isExpanded = false
return unless a
a.textContent = a.textContent.replace '× Loading...', '+'
a.textContent = a.textContent.replace '...', '+'
when true
thread.isExpanded = false
if a
a.textContent = a.textContent.replace '-', '+'
a.textContent = a.textContent.replace('-', '+').replace('hide', 'view').replace('expanded', 'omitted')
#goddamit moot
num = if thread.isSticky
1
@ -71,7 +71,7 @@ ExpandThread =
return
thread.isExpanded = true
a.textContent = a.textContent.replace '× Loading...', '-'
a.textContent = a.textContent.replace('...', '-').replace('view', 'hide').replace('omitted', 'expanded')
posts = JSON.parse(req.response).posts
if spoilerRange = posts[0].custom_spoiler

View File

@ -131,7 +131,7 @@ Unread =
Unread.db.set
boardID: Unread.thread.board.ID
threadID: Unread.thread.ID
val: Unread.lastReadPost
val: Unread.lastReadPost
setLine: (force) ->
return unless d.hidden or force is true

View File

@ -37,10 +37,9 @@ QR =
return unless QR.postingIsEnabled
link = $.el 'h1',
innerHTML: "<a href=javascript:;>#{title = if g.VIEW is 'thread' then 'Reply to Thread' else 'Start a Thread'}</a>"
title: title
className: "qr-link"
$.on link, 'click', ->
innerHTML: "<a href=javascript:; class='qr-link'>#{if g.VIEW is 'thread' then 'Reply to Thread' else 'Start a Thread'}</a>"
className: "qr-link-container"
$.on link.firstChild, 'click', ->
$.event 'CloseMenu'
QR.open()
QR.nodes.com.focus()
@ -248,7 +247,7 @@ QR =
else 300
sage: if board is 'q' then 600 else 60
file: if board is 'q' then 300 else 30
post: if board is 'q' then 60 else 30
post: if board is 'q' then 150 else 30
QR.cooldown.upSpd = 0
QR.cooldown.upSpdAccuracy = .5
$.get "cooldown.#{board}", {}, (item) ->