Conflicts:
	CHANGELOG.md
	Gruntfile.coffee
	LICENSE
	builds/4chan-X.user.js
	builds/crx/script.js
	json/archives.json
	package.json
	src/Archive/Redirect.coffee
	src/General/Build.coffee
	src/General/Config.coffee
	src/General/html/Build/post.html
	src/Monitoring/ThreadUpdater.coffee
	src/Posting/QuickReply.coffee
This commit is contained in:
Zixaphir 2013-10-13 14:29:52 -07:00
commit 0415de74c1
17 changed files with 157 additions and 185 deletions

View File

@ -1,3 +1,4 @@
<<<<<<< HEAD
**MayhemYDG**: **MayhemYDG**:
- Tiny posting cooldown adjustment: - Tiny posting cooldown adjustment:
* You can post an image reply immediately after a non-image reply. * You can post an image reply immediately after a non-image reply.
@ -12,6 +13,28 @@
### v1.2.39 ### v1.2.39
*2013-09-19* *2013-09-19*
=======
### v1.2.41
*2013-10-03*
**MayhemYDG**:
- Minor Chrome 30 fix
### v1.2.40
*2013-09-22*
**MayhemYDG**:
- /pol/ flag selector
**seaweedchan**:
- Delete cooldown update
- Small bug fixes
- Don't show warnings AND desktop notifications at the same time, and prefer QR warnings unless the document is hidden
### v1.2.39
*2013-09-19*
>>>>>>> 26a0c27ac304d70bc296de9294b7fd4bc6e52048
**seaweedchan**: **seaweedchan**:
- Fix thread updater bug introduced in last version - Fix thread updater bug introduced in last version

View File

@ -91,11 +91,11 @@ module.exports = (grunt) ->
stderr: true stderr: true
failOnError: true failOnError: true
commit: commit:
command: [ command: """
'git commit -am "Release <%= pkg.meta.name %> v<%= pkg.version %>."' git commit -am "Release <%= pkg.meta.name %> v<%= pkg.version %>."
'git tag -a <%= pkg.version %> -m "<%= pkg.meta.name %> v<%= pkg.version %>."' git tag -a <%= pkg.version %> -m "<%= pkg.meta.name %> v<%= pkg.version %>."
'git tag -af stable -m "<%= pkg.meta.name %> v<%= pkg.version %>."' git tag -af stable -m "<%= pkg.meta.name %> v<%= pkg.version %>."
].join ' && ' """
push: push:
command: 'git push origin --tags -f && git push origin --all' command: 'git push origin --tags -f && git push origin --all'

View File

@ -1,5 +1,5 @@
/* /*
* 4chan X - Version 1.2.39 - 2013-10-13 * 4chan X - Version 1.2.41 - 2013-10-13
* *
* Licensed under the MIT license. * Licensed under the MIT license.
* https://github.com/seaweedchan/4chan-x/blob/master/LICENSE * https://github.com/seaweedchan/4chan-x/blob/master/LICENSE

View File

@ -1,6 +1,6 @@
// ==UserScript== // ==UserScript==
// @name 4chan X // @name 4chan X
// @version 1.2.39 // @version 1.2.41
// @minGMVer 1.13 // @minGMVer 1.13
// @minFFVer 22 // @minFFVer 22
// @namespace 4chan-X // @namespace 4chan-X

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
{ {
"name": "4chan X", "name": "4chan X",
"version": "1.2.39", "version": "1.2.41",
"manifest_version": 2, "manifest_version": 2,
"description": "Cross-browser userscript for maximum lurking on 4chan.", "description": "Cross-browser userscript for maximum lurking on 4chan.",
"icons": { "icons": {
@ -15,7 +15,7 @@
"run_at": "document_start" "run_at": "document_start"
}], }],
"homepage_url": "http://seaweedchan.github.io/4chan-x/", "homepage_url": "http://seaweedchan.github.io/4chan-x/",
"minimum_chrome_version": "29", "minimum_chrome_version": "27",
"permissions": [ "permissions": [
"storage" "storage"
] ]

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
postMessage({version:'1.2.39'},'*') postMessage({version:'1.2.41'},'*')

View File

@ -1,6 +1,6 @@
{ {
"name": "4chan-X", "name": "4chan-X",
"version": "1.2.39", "version": "1.2.41",
"description": "Cross-browser userscript for maximum lurking on 4chan.", "description": "Cross-browser userscript for maximum lurking on 4chan.",
"meta": { "meta": {
"name": "4chan X", "name": "4chan X",

View File

@ -35,7 +35,7 @@ Redirect =
http: true http: true
https: true https: true
software: 'foolfuuka' software: 'foolfuuka'
boards: ['b', 'e', 'h', 'hc', 'p', 's', 'u'] boards: ['b', 'e', 'h', 'hc', 'p', 's', 'soc', 'sp', 'u']
files: ['b', 'e', 'h', 'hc', 'p', 's', 'soc', 'sp', 'u'] files: ['b', 'e', 'h', 'hc', 'p', 's', 'soc', 'sp', 'u']
'Foolz': 'Foolz':
@ -46,14 +46,6 @@ Redirect =
boards: ['a', 'co', 'gd', 'jp', 'm', 'q', 'sp', 'tg', 'tv', 'v', 'vg', 'vp', 'vr', 'wsg'] boards: ['a', 'co', 'gd', 'jp', 'm', 'q', 'sp', 'tg', 'tv', 'v', 'vg', 'vp', 'vr', 'wsg']
files: ['a', 'gd', 'jp', 'm', 'q', 'tg', 'vg', 'vp', 'vr', 'wsg'] files: ['a', 'gd', 'jp', 'm', 'q', 'tg', 'vg', 'vp', 'vr', 'wsg']
'Foolz a Shit':
domain: 'archive.foolzashit.com'
http: true
https: true
software: 'foolfuuka'
boards: ['adv', 'asp', 'cm', 'd', 'e', 'i', 'lgbt', 'n', 'o', 'p', 'pol', 's', 's4s', 't', 'trv', 'y']
files: ['cm', 'd', 'e', 'i', 'n', 'o', 'p', 's', 'trv', 'y']
'Foolz Beta': 'Foolz Beta':
domain: 'beta.foolz.us' domain: 'beta.foolz.us'
http: true http: true

View File

@ -453,8 +453,10 @@ Config =
#/Mod$/;highlight:mod;op:yes #/Mod$/;highlight:mod;op:yes
# Set a custom class for moot: # Set a custom class for moot:
#/Admin$/;highlight:moot;op:yes #/Admin$/;highlight:moot;op:yes
""" """
email: "" email: ""
subject: """ subject: """
# Filter Generals on /v/: # Filter Generals on /v/:
#/general/i;boards:v;op:only #/general/i;boards:v;op:only
@ -524,7 +526,6 @@ mu-replace
sp-replace sp-replace
tv-replace tv-replace
vp-replace vp-replace
q-replace
[external-text:"FAQ","https://github.com/seaweedchan/4chan-x/wiki/Frequently-Asked-Questions"] [external-text:"FAQ","https://github.com/seaweedchan/4chan-x/wiki/Frequently-Asked-Questions"]
""" """

View File

@ -269,7 +269,7 @@ Main =
errors = null errors = null
func = (node, i) -> func = (node, i) ->
for callback in klass::callbacks for callback in klass.callbacks
try try
callback.cb.call node callback.cb.call node
catch err catch err

View File

@ -675,7 +675,7 @@ a.hide-announcement {
:root.hide-original-post-form .postingMode, :root.hide-original-post-form .postingMode,
:root.hide-original-post-form #togglePostForm, :root.hide-original-post-form #togglePostForm,
#qr.autohide:not(.has-focus):not(:hover) > form, #qr.autohide:not(.has-focus):not(:hover) > form,
.postingMode ~ #qr select, .postingMode ~ #qr select[data-name=thread],
#file-n-submit:not(.has-file) #qr-filerm { #file-n-submit:not(.has-file) #qr-filerm {
display: none; display: none;
} }
@ -837,7 +837,7 @@ input#qr-filename:not(.edit) {
position: absolute; position: absolute;
} }
/* Thread Select / Spoiler Label */ /* Thread Select / Spoiler Label */
#qr select { #qr select[data-name=thread] {
float: right; float: right;
} }
#qr.has-spoiler .has-file #qr-spoiler-label { #qr.has-spoiler .has-file #qr-spoiler-label {

View File

@ -15,7 +15,7 @@
"run_at": "document_start" "run_at": "document_start"
}], }],
"homepage_url": "<%= meta.page %>", "homepage_url": "<%= meta.page %>",
"minimum_chrome_version": "29", "minimum_chrome_version": "27",
"permissions": [ "permissions": [
"storage" "storage"
] ]

View File

@ -62,6 +62,7 @@ ThreadUpdater =
ThreadUpdater.thread = @ ThreadUpdater.thread = @
ThreadUpdater.root = @OP.nodes.root.parentNode ThreadUpdater.root = @OP.nodes.root.parentNode
ThreadUpdater.lastPost = +ThreadUpdater.root.lastElementChild.id.match(/\d+/)[0] ThreadUpdater.lastPost = +ThreadUpdater.root.lastElementChild.id.match(/\d+/)[0]
ThreadUpdater.outdateCount = 0
ThreadUpdater.cb.interval.call $.el 'input', value: Conf['Interval'] ThreadUpdater.cb.interval.call $.el 'input', value: Conf['Interval']
@ -79,14 +80,14 @@ ThreadUpdater =
cb: cb:
online: -> online: ->
if navigator.onLine if ThreadUpdater.online = navigator.onLine
ThreadUpdater.outdateCount = 0 ThreadUpdater.outdateCount = 0
ThreadUpdater.setInterval() ThreadUpdater.setInterval()
ThreadUpdater.set 'status', null, null ThreadUpdater.set 'status', null, null
else else
ThreadUpdater.set 'timer', null ThreadUpdater.set 'timer', null
ThreadUpdater.set 'status', 'Offline', 'warning' ThreadUpdater.set 'status', 'Offline', 'warning'
ThreadUpdater.count true ThreadUpdater.cb.autoUpdate()
post: (e) -> post: (e) ->
return unless ThreadUpdater.isUpdating and e.detail.threadID is ThreadUpdater.thread.ID return unless ThreadUpdater.isUpdating and e.detail.threadID is ThreadUpdater.thread.ID
ThreadUpdater.outdateCount = 0 ThreadUpdater.outdateCount = 0
@ -107,7 +108,8 @@ ThreadUpdater =
return if d.hidden return if d.hidden
# Reset the counter when we focus this tab. # Reset the counter when we focus this tab.
ThreadUpdater.outdateCount = 0 ThreadUpdater.outdateCount = 0
ThreadUpdater.seconds = Math.min ThreadUpdater.seconds, ThreadUpdater.interval if ThreadUpdater.seconds > ThreadUpdater.interval
ThreadUpdater.set 'timer', ThreadUpdater.getInterval()
scrollBG: -> scrollBG: ->
ThreadUpdater.scrollBG = if Conf['Scroll BG'] ThreadUpdater.scrollBG = if Conf['Scroll BG']
-> true -> true
@ -120,29 +122,23 @@ ThreadUpdater =
$.cb.value.call @ $.cb.value.call @
load: (e) -> load: (e) ->
{req} = ThreadUpdater {req} = ThreadUpdater
delete ThreadUpdater.req
if e.type isnt 'loadend' # timeout or abort
req.onloadend = null
if e.type is 'timeout'
ThreadUpdater.set 'status', 'Retrying', null
ThreadUpdater.update()
return
switch req.status switch req.status
when 200 when 200
g.DEAD = false g.DEAD = false
ThreadUpdater.parse JSON.parse(req.response).posts ThreadUpdater.parse JSON.parse(req.response).posts
ThreadUpdater.setInterval() ThreadUpdater.set 'timer', ThreadUpdater.getInterval()
when 404 when 404
g.DEAD = true g.DEAD = true
ThreadUpdater.set 'timer', null ThreadUpdater.set 'timer', null
ThreadUpdater.set 'status', '404', 'warning' ThreadUpdater.set 'status', '404', 'warning'
clearTimeout ThreadUpdater.timeoutID
ThreadUpdater.thread.kill() ThreadUpdater.thread.kill()
$.event 'ThreadUpdate', $.event 'ThreadUpdate',
404: true 404: true
thread: ThreadUpdater.thread thread: ThreadUpdater.thread
else else
ThreadUpdater.outdateCount++ ThreadUpdater.outdateCount++
ThreadUpdater.setInterval() ThreadUpdater.set 'timer', ThreadUpdater.getInterval()
[text, klass] = if req.status is 304 [text, klass] = if req.status is 304
[null, null] [null, null]
else else
@ -182,15 +178,15 @@ ThreadUpdater =
el.textContent = text el.textContent = text
el.className = klass if klass isnt undefined el.className = klass if klass isnt undefined
count: (start) ->
clearTimeout ThreadUpdater.timeoutID
ThreadUpdater.timeout() if start and ThreadUpdater.isUpdating and navigator.onLine
timeout: -> timeout: ->
ThreadUpdater.timeoutID = setTimeout ThreadUpdater.timeout, 1000 ThreadUpdater.timeoutID = setTimeout ThreadUpdater.timeout, 1000
sec = ThreadUpdater.seconds-- unless n = --ThreadUpdater.seconds
ThreadUpdater.set 'timer', sec ThreadUpdater.update()
ThreadUpdater.update() if sec <= 0 else if n <= -60
ThreadUpdater.set 'status', 'Retrying', null
ThreadUpdater.update()
else if n > 0
ThreadUpdater.set 'timer', n
update: -> update: ->
return unless navigator.onLine return unless navigator.onLine
@ -201,12 +197,7 @@ ThreadUpdater =
ThreadUpdater.set 'timer', 'Update' ThreadUpdater.set 'timer', 'Update'
ThreadUpdater.req.abort() if ThreadUpdater.req ThreadUpdater.req.abort() if ThreadUpdater.req
url = "//api.4chan.org/#{ThreadUpdater.thread.board}/res/#{ThreadUpdater.thread}.json" url = "//api.4chan.org/#{ThreadUpdater.thread.board}/res/#{ThreadUpdater.thread}.json"
ThreadUpdater.req = $.ajax url, ThreadUpdater.req = $.ajax url, onloadend: ThreadUpdater.cb.load,
onabort: ThreadUpdater.cb.load
onloadend: ThreadUpdater.cb.load
ontimeout: ThreadUpdater.cb.load
timeout: $.MINUTE
,
whenModified: true whenModified: true
updateThreadStatus: (title, OP) -> updateThreadStatus: (title, OP) ->

View File

@ -141,7 +141,7 @@ QR =
if QR.captcha.isEnabled and /captcha|verification/i.test el.textContent if QR.captcha.isEnabled and /captcha|verification/i.test el.textContent
# Focus the captcha input on captcha error. # Focus the captcha input on captcha error.
QR.captcha.nodes.input.focus() QR.captcha.nodes.input.focus()
if Conf['Captcha Warning Notifications'] if Conf['Captcha Warning Notifications'] and !d.hidden
QR.notify el QR.notify el
else else
$.addClass QR.captcha.nodes.input, 'error' $.addClass QR.captcha.nodes.input, 'error'
@ -153,22 +153,23 @@ QR =
notify: (el) -> notify: (el) ->
notice = new Notice 'warning', el notice = new Notice 'warning', el
QR.notifications.push notice unless Header.areNotificationsEnabled and d.hidden
return unless Header.areNotificationsEnabled QR.notifications.push notice
notif = new Notification el.textContent, else
body: el.textContent notif = new Notification el.textContent,
icon: Favicon.logo body: el.textContent
notif.onclick = -> window.focus() icon: Favicon.logo
<% if (type === 'crx') { %> notif.onclick = -> window.focus()
# Firefox automatically closes notifications <% if (type === 'crx') { %>
# so we can't control the onclose properly. # Firefox automatically closes notifications
notif.onclose = -> notice.close() # so we can't control the onclose properly.
notif.onshow = -> notif.onclose = -> notice.close()
setTimeout -> notif.onshow = ->
notif.onclose = null setTimeout ->
notif.close() notif.onclose = null
, 7 * $.SECOND notif.close()
<% } %> , 7 * $.SECOND
<% } %>
notifications: [] notifications: []
cleanNotifications: -> cleanNotifications: ->
@ -1216,6 +1217,8 @@ QR =
ThreadUpdater.postID = postID ThreadUpdater.postID = postID
# Post/upload confirmed as successful. # Post/upload confirmed as successful.
$.event 'QRPostSuccessful', { $.event 'QRPostSuccessful', {
board: g.BOARD board: g.BOARD