Merge branch 'master' of https://github.com/seaweedchan/4chan-x into v3
This commit is contained in:
commit
096b90bd30
@ -1,6 +1,9 @@
|
|||||||
seaweedchan:
|
seaweedchan:
|
||||||
- Fix emoji and favicon previews not updating on change.
|
- Fix emoji and favicon previews not updating on change.
|
||||||
|
|
||||||
|
MayhemYDG:
|
||||||
|
- Fix bug where a thread would freeze on load.
|
||||||
|
|
||||||
### 1.1.1 - 2013-04-26
|
### 1.1.1 - 2013-04-26
|
||||||
zixaphir:
|
zixaphir:
|
||||||
- Fix script on Opera
|
- Fix script on Opera
|
||||||
|
|||||||
@ -188,7 +188,7 @@
|
|||||||
'Remember Subject': [false, 'Remember the subject field, instead of resetting after posting.'],
|
'Remember Subject': [false, 'Remember the subject field, instead of resetting after posting.'],
|
||||||
'Remember Spoiler': [false, 'Remember the spoiler state, instead of resetting after posting.'],
|
'Remember Spoiler': [false, 'Remember the spoiler state, instead of resetting after posting.'],
|
||||||
'Hide Original Post Form': [true, 'Hide the normal post form.'],
|
'Hide Original Post Form': [true, 'Hide the normal post form.'],
|
||||||
'Cooldown': [true, 'Prevent "flood detected" errors.'],
|
'Cooldown': [true, 'Indicate the remaining time before posting again.'],
|
||||||
'Cooldown Prediction': [true, 'Decrease the cooldown time by taking into account upload speed. Disable it if it\'s inaccurate for you.']
|
'Cooldown Prediction': [true, 'Decrease the cooldown time by taking into account upload speed. Disable it if it\'s inaccurate for you.']
|
||||||
},
|
},
|
||||||
'Quote Links': {
|
'Quote Links': {
|
||||||
@ -4305,7 +4305,7 @@
|
|||||||
|
|
||||||
psa = $.id('globalMessage');
|
psa = $.id('globalMessage');
|
||||||
psa.hidden = PSAHiding.btn.hidden = (_ref = PSAHiding.trim(psa), __indexOf.call(hiddenPSAs, _ref) >= 0) ? true : false;
|
psa.hidden = PSAHiding.btn.hidden = (_ref = PSAHiding.trim(psa), __indexOf.call(hiddenPSAs, _ref) >= 0) ? true : false;
|
||||||
if (hr = $.x('following-sibling::hr', psa)) {
|
if ((hr = psa.nextElementSibling) && hr.nodeName === 'HR') {
|
||||||
return hr.hidden = psa.hidden;
|
return hr.hidden = psa.hidden;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -6758,24 +6758,14 @@
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
node: function() {
|
node: function() {
|
||||||
var ID, post, posts, _ref;
|
|
||||||
|
|
||||||
Unread.thread = this;
|
Unread.thread = this;
|
||||||
Unread.title = d.title;
|
Unread.title = d.title;
|
||||||
posts = [];
|
|
||||||
_ref = this.posts;
|
|
||||||
for (ID in _ref) {
|
|
||||||
post = _ref[ID];
|
|
||||||
if (post.isReply) {
|
|
||||||
posts.push(post);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Unread.lastReadPost = Unread.db.get({
|
Unread.lastReadPost = Unread.db.get({
|
||||||
boardID: this.board.ID,
|
boardID: this.board.ID,
|
||||||
threadID: this.ID,
|
threadID: this.ID,
|
||||||
defaultValue: 0
|
defaultValue: 0
|
||||||
});
|
});
|
||||||
Unread.addPosts(posts);
|
$.on(d, '4chanXInitFinished', Unread.ready);
|
||||||
$.on(d, 'ThreadUpdate', Unread.onUpdate);
|
$.on(d, 'ThreadUpdate', Unread.onUpdate);
|
||||||
$.on(d, 'scroll visibilitychange', Unread.read);
|
$.on(d, 'scroll visibilitychange', Unread.read);
|
||||||
if (Conf['Unread Line']) {
|
if (Conf['Unread Line']) {
|
||||||
@ -6785,15 +6775,35 @@
|
|||||||
return $.on(window, 'load', Unread.scroll);
|
return $.on(window, 'load', Unread.scroll);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
ready: function() {
|
||||||
|
var ID, post, posts, _ref;
|
||||||
|
|
||||||
|
$.off(d, '4chanXInitFinished', Unread.ready);
|
||||||
|
posts = [];
|
||||||
|
_ref = Unread.thread.posts;
|
||||||
|
for (ID in _ref) {
|
||||||
|
post = _ref[ID];
|
||||||
|
if (post.isReply) {
|
||||||
|
posts.push(post);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return Unread.addPosts(posts);
|
||||||
|
},
|
||||||
scroll: function() {
|
scroll: function() {
|
||||||
var hash, posts, root;
|
var hash, post, posts, prevID, root;
|
||||||
|
|
||||||
if ((hash = location.hash.match(/\d+/)) && hash[0] in Unread.thread.posts) {
|
if ((hash = location.hash.match(/\d+/)) && hash[0] in Unread.thread.posts) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (Unread.posts.length) {
|
if (Unread.posts.length) {
|
||||||
|
prevID = 0;
|
||||||
while (root = $.x('preceding-sibling::div[contains(@class,"postContainer")][1]', Unread.posts[0].nodes.root)) {
|
while (root = $.x('preceding-sibling::div[contains(@class,"postContainer")][1]', Unread.posts[0].nodes.root)) {
|
||||||
if (!(Get.postFromRoot(root)).isHidden) {
|
post = Get.postFromRoot(root);
|
||||||
|
if (prevID === post.ID) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
prevID = post.ID;
|
||||||
|
if (!post.isHidden) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -9389,7 +9399,7 @@
|
|||||||
Settings[key].call(input);
|
Settings[key].call(input);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
$.on($('input[name=Interval]', section), 'input', ThreadUpdater.cb.interval);
|
$.on($('input[name=Interval]', section), 'change', ThreadUpdater.cb.interval);
|
||||||
$.on($('input[name="Custom CSS"]', section), 'change', Settings.togglecss);
|
$.on($('input[name="Custom CSS"]', section), 'change', Settings.togglecss);
|
||||||
return $.on($.id('apply-css'), 'click', Settings.usercss);
|
return $.on($.id('apply-css'), 'click', Settings.usercss);
|
||||||
},
|
},
|
||||||
|
|||||||
@ -189,7 +189,7 @@
|
|||||||
'Remember QR Size': [false, 'Remember the size of the Quick reply.'],
|
'Remember QR Size': [false, 'Remember the size of the Quick reply.'],
|
||||||
'Remember Spoiler': [false, 'Remember the spoiler state, instead of resetting after posting.'],
|
'Remember Spoiler': [false, 'Remember the spoiler state, instead of resetting after posting.'],
|
||||||
'Hide Original Post Form': [true, 'Hide the normal post form.'],
|
'Hide Original Post Form': [true, 'Hide the normal post form.'],
|
||||||
'Cooldown': [true, 'Prevent "flood detected" errors.'],
|
'Cooldown': [true, 'Indicate the remaining time before posting again.'],
|
||||||
'Cooldown Prediction': [true, 'Decrease the cooldown time by taking into account upload speed. Disable it if it\'s inaccurate for you.']
|
'Cooldown Prediction': [true, 'Decrease the cooldown time by taking into account upload speed. Disable it if it\'s inaccurate for you.']
|
||||||
},
|
},
|
||||||
'Quote Links': {
|
'Quote Links': {
|
||||||
@ -4301,7 +4301,7 @@
|
|||||||
|
|
||||||
psa = $.id('globalMessage');
|
psa = $.id('globalMessage');
|
||||||
psa.hidden = PSAHiding.btn.hidden = (_ref = PSAHiding.trim(psa), __indexOf.call(hiddenPSAs, _ref) >= 0) ? true : false;
|
psa.hidden = PSAHiding.btn.hidden = (_ref = PSAHiding.trim(psa), __indexOf.call(hiddenPSAs, _ref) >= 0) ? true : false;
|
||||||
if (hr = $.x('following-sibling::hr', psa)) {
|
if ((hr = psa.nextElementSibling) && hr.nodeName === 'HR') {
|
||||||
return hr.hidden = psa.hidden;
|
return hr.hidden = psa.hidden;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -6754,24 +6754,14 @@
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
node: function() {
|
node: function() {
|
||||||
var ID, post, posts, _ref;
|
|
||||||
|
|
||||||
Unread.thread = this;
|
Unread.thread = this;
|
||||||
Unread.title = d.title;
|
Unread.title = d.title;
|
||||||
posts = [];
|
|
||||||
_ref = this.posts;
|
|
||||||
for (ID in _ref) {
|
|
||||||
post = _ref[ID];
|
|
||||||
if (post.isReply) {
|
|
||||||
posts.push(post);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Unread.lastReadPost = Unread.db.get({
|
Unread.lastReadPost = Unread.db.get({
|
||||||
boardID: this.board.ID,
|
boardID: this.board.ID,
|
||||||
threadID: this.ID,
|
threadID: this.ID,
|
||||||
defaultValue: 0
|
defaultValue: 0
|
||||||
});
|
});
|
||||||
Unread.addPosts(posts);
|
$.on(d, '4chanXInitFinished', Unread.ready);
|
||||||
$.on(d, 'ThreadUpdate', Unread.onUpdate);
|
$.on(d, 'ThreadUpdate', Unread.onUpdate);
|
||||||
$.on(d, 'scroll visibilitychange', Unread.read);
|
$.on(d, 'scroll visibilitychange', Unread.read);
|
||||||
if (Conf['Unread Line']) {
|
if (Conf['Unread Line']) {
|
||||||
@ -6781,15 +6771,35 @@
|
|||||||
return $.on(window, 'load', Unread.scroll);
|
return $.on(window, 'load', Unread.scroll);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
ready: function() {
|
||||||
|
var ID, post, posts, _ref;
|
||||||
|
|
||||||
|
$.off(d, '4chanXInitFinished', Unread.ready);
|
||||||
|
posts = [];
|
||||||
|
_ref = Unread.thread.posts;
|
||||||
|
for (ID in _ref) {
|
||||||
|
post = _ref[ID];
|
||||||
|
if (post.isReply) {
|
||||||
|
posts.push(post);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return Unread.addPosts(posts);
|
||||||
|
},
|
||||||
scroll: function() {
|
scroll: function() {
|
||||||
var hash, posts, root;
|
var hash, post, posts, prevID, root;
|
||||||
|
|
||||||
if ((hash = location.hash.match(/\d+/)) && hash[0] in Unread.thread.posts) {
|
if ((hash = location.hash.match(/\d+/)) && hash[0] in Unread.thread.posts) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (Unread.posts.length) {
|
if (Unread.posts.length) {
|
||||||
|
prevID = 0;
|
||||||
while (root = $.x('preceding-sibling::div[contains(@class,"postContainer")][1]', Unread.posts[0].nodes.root)) {
|
while (root = $.x('preceding-sibling::div[contains(@class,"postContainer")][1]', Unread.posts[0].nodes.root)) {
|
||||||
if (!(Get.postFromRoot(root)).isHidden) {
|
post = Get.postFromRoot(root);
|
||||||
|
if (prevID === post.ID) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
prevID = post.ID;
|
||||||
|
if (!post.isHidden) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -9412,7 +9422,7 @@
|
|||||||
Settings[key].call(input);
|
Settings[key].call(input);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
$.on($('input[name=Interval]', section), 'input', ThreadUpdater.cb.interval);
|
$.on($('input[name=Interval]', section), 'change', ThreadUpdater.cb.interval);
|
||||||
$.on($('input[name="Custom CSS"]', section), 'change', Settings.togglecss);
|
$.on($('input[name="Custom CSS"]', section), 'change', Settings.togglecss);
|
||||||
return $.on($.id('apply-css'), 'click', Settings.usercss);
|
return $.on($.id('apply-css'), 'click', Settings.usercss);
|
||||||
},
|
},
|
||||||
|
|||||||
@ -81,7 +81,7 @@
|
|||||||
'Remember Subject': [false, 'Remember the subject field, instead of resetting after posting.'],
|
'Remember Subject': [false, 'Remember the subject field, instead of resetting after posting.'],
|
||||||
'Remember Spoiler': [false, 'Remember the spoiler state, instead of resetting after posting.'],
|
'Remember Spoiler': [false, 'Remember the spoiler state, instead of resetting after posting.'],
|
||||||
'Hide Original Post Form': [true, 'Hide the normal post form.'],
|
'Hide Original Post Form': [true, 'Hide the normal post form.'],
|
||||||
'Cooldown': [true, 'Prevent "flood detected" errors.'],
|
'Cooldown': [true, 'Indicate the remaining time before posting again.'],
|
||||||
'Cooldown Prediction': [true, 'Decrease the cooldown time by taking into account upload speed. Disable it if it\'s inaccurate for you.']
|
'Cooldown Prediction': [true, 'Decrease the cooldown time by taking into account upload speed. Disable it if it\'s inaccurate for you.']
|
||||||
},
|
},
|
||||||
'Quote Links': {
|
'Quote Links': {
|
||||||
@ -4214,7 +4214,7 @@
|
|||||||
|
|
||||||
psa = $.id('globalMessage');
|
psa = $.id('globalMessage');
|
||||||
psa.hidden = PSAHiding.btn.hidden = (_ref = PSAHiding.trim(psa), __indexOf.call(hiddenPSAs, _ref) >= 0) ? true : false;
|
psa.hidden = PSAHiding.btn.hidden = (_ref = PSAHiding.trim(psa), __indexOf.call(hiddenPSAs, _ref) >= 0) ? true : false;
|
||||||
if (hr = $.x('following-sibling::hr', psa)) {
|
if ((hr = psa.nextElementSibling) && hr.nodeName === 'HR') {
|
||||||
return hr.hidden = psa.hidden;
|
return hr.hidden = psa.hidden;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -6667,24 +6667,14 @@
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
node: function() {
|
node: function() {
|
||||||
var ID, post, posts, _ref;
|
|
||||||
|
|
||||||
Unread.thread = this;
|
Unread.thread = this;
|
||||||
Unread.title = d.title;
|
Unread.title = d.title;
|
||||||
posts = [];
|
|
||||||
_ref = this.posts;
|
|
||||||
for (ID in _ref) {
|
|
||||||
post = _ref[ID];
|
|
||||||
if (post.isReply) {
|
|
||||||
posts.push(post);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Unread.lastReadPost = Unread.db.get({
|
Unread.lastReadPost = Unread.db.get({
|
||||||
boardID: this.board.ID,
|
boardID: this.board.ID,
|
||||||
threadID: this.ID,
|
threadID: this.ID,
|
||||||
defaultValue: 0
|
defaultValue: 0
|
||||||
});
|
});
|
||||||
Unread.addPosts(posts);
|
$.on(d, '4chanXInitFinished', Unread.ready);
|
||||||
$.on(d, 'ThreadUpdate', Unread.onUpdate);
|
$.on(d, 'ThreadUpdate', Unread.onUpdate);
|
||||||
$.on(d, 'scroll visibilitychange', Unread.read);
|
$.on(d, 'scroll visibilitychange', Unread.read);
|
||||||
if (Conf['Unread Line']) {
|
if (Conf['Unread Line']) {
|
||||||
@ -6694,15 +6684,35 @@
|
|||||||
return $.on(window, 'load', Unread.scroll);
|
return $.on(window, 'load', Unread.scroll);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
ready: function() {
|
||||||
|
var ID, post, posts, _ref;
|
||||||
|
|
||||||
|
$.off(d, '4chanXInitFinished', Unread.ready);
|
||||||
|
posts = [];
|
||||||
|
_ref = Unread.thread.posts;
|
||||||
|
for (ID in _ref) {
|
||||||
|
post = _ref[ID];
|
||||||
|
if (post.isReply) {
|
||||||
|
posts.push(post);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return Unread.addPosts(posts);
|
||||||
|
},
|
||||||
scroll: function() {
|
scroll: function() {
|
||||||
var hash, posts, root;
|
var hash, post, posts, prevID, root;
|
||||||
|
|
||||||
if ((hash = location.hash.match(/\d+/)) && hash[0] in Unread.thread.posts) {
|
if ((hash = location.hash.match(/\d+/)) && hash[0] in Unread.thread.posts) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (Unread.posts.length) {
|
if (Unread.posts.length) {
|
||||||
|
prevID = 0;
|
||||||
while (root = $.x('preceding-sibling::div[contains(@class,"postContainer")][1]', Unread.posts[0].nodes.root)) {
|
while (root = $.x('preceding-sibling::div[contains(@class,"postContainer")][1]', Unread.posts[0].nodes.root)) {
|
||||||
if (!(Get.postFromRoot(root)).isHidden) {
|
post = Get.postFromRoot(root);
|
||||||
|
if (prevID === post.ID) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
prevID = post.ID;
|
||||||
|
if (!post.isHidden) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -9304,7 +9314,7 @@
|
|||||||
Settings[key].call(input);
|
Settings[key].call(input);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
$.on($('input[name=Interval]', section), 'input', ThreadUpdater.cb.interval);
|
$.on($('input[name=Interval]', section), 'change', ThreadUpdater.cb.interval);
|
||||||
$.on($('input[name="Custom CSS"]', section), 'change', Settings.togglecss);
|
$.on($('input[name="Custom CSS"]', section), 'change', Settings.togglecss);
|
||||||
return $.on($.id('apply-css'), 'click', Settings.usercss);
|
return $.on($.id('apply-css'), 'click', Settings.usercss);
|
||||||
},
|
},
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 13 KiB |
@ -267,7 +267,7 @@ Config =
|
|||||||
]
|
]
|
||||||
'Cooldown': [
|
'Cooldown': [
|
||||||
true
|
true
|
||||||
'Prevent "flood detected" errors.'
|
'Indicate the remaining time before posting again.'
|
||||||
]
|
]
|
||||||
'Cooldown Prediction': [
|
'Cooldown Prediction': [
|
||||||
true
|
true
|
||||||
|
|||||||
@ -61,7 +61,7 @@ PSAHiding =
|
|||||||
true
|
true
|
||||||
else
|
else
|
||||||
false
|
false
|
||||||
if hr = $.x 'following-sibling::hr', psa
|
if (hr = psa.nextElementSibling) and hr.nodeName is 'HR'
|
||||||
hr.hidden = psa.hidden
|
hr.hidden = psa.hidden
|
||||||
trim: (psa) ->
|
trim: (psa) ->
|
||||||
psa.textContent.replace(/\W+/g, '').toLowerCase()
|
psa.textContent.replace(/\W+/g, '').toLowerCase()
|
||||||
@ -15,26 +15,34 @@ Unread =
|
|||||||
node: ->
|
node: ->
|
||||||
Unread.thread = @
|
Unread.thread = @
|
||||||
Unread.title = d.title
|
Unread.title = d.title
|
||||||
posts = []
|
|
||||||
for ID, post of @posts
|
|
||||||
posts.push post if post.isReply
|
|
||||||
Unread.lastReadPost = Unread.db.get
|
Unread.lastReadPost = Unread.db.get
|
||||||
boardID: @board.ID
|
boardID: @board.ID
|
||||||
threadID: @ID
|
threadID: @ID
|
||||||
defaultValue: 0
|
defaultValue: 0
|
||||||
Unread.addPosts posts
|
$.on d, '4chanXInitFinished', Unread.ready
|
||||||
$.on d, 'ThreadUpdate', Unread.onUpdate
|
$.on d, 'ThreadUpdate', Unread.onUpdate
|
||||||
$.on d, 'scroll visibilitychange', Unread.read
|
$.on d, 'scroll visibilitychange', Unread.read
|
||||||
$.on d, 'visibilitychange', Unread.setLine if Conf['Unread Line']
|
$.on d, 'visibilitychange', Unread.setLine if Conf['Unread Line']
|
||||||
$.on window, 'load', Unread.scroll if Conf['Scroll to Last Read Post']
|
$.on window, 'load', Unread.scroll if Conf['Scroll to Last Read Post']
|
||||||
|
|
||||||
|
ready: ->
|
||||||
|
$.off d, '4chanXInitFinished', Unread.ready
|
||||||
|
posts = []
|
||||||
|
for ID, post of Unread.thread.posts
|
||||||
|
posts.push post if post.isReply
|
||||||
|
Unread.addPosts posts
|
||||||
|
|
||||||
scroll: ->
|
scroll: ->
|
||||||
# Let the header's onload callback handle it.
|
# Let the header's onload callback handle it.
|
||||||
return if (hash = location.hash.match /\d+/) and hash[0] of Unread.thread.posts
|
return if (hash = location.hash.match /\d+/) and hash[0] of Unread.thread.posts
|
||||||
if Unread.posts.length
|
if Unread.posts.length
|
||||||
# Scroll to before the first unread post.
|
# Scroll to before the first unread post.
|
||||||
|
prevID = 0
|
||||||
while root = $.x 'preceding-sibling::div[contains(@class,"postContainer")][1]', Unread.posts[0].nodes.root
|
while root = $.x 'preceding-sibling::div[contains(@class,"postContainer")][1]', Unread.posts[0].nodes.root
|
||||||
break unless (Get.postFromRoot root).isHidden
|
post = Get.postFromRoot root
|
||||||
|
break if prevID is post.ID
|
||||||
|
prevID = post.ID
|
||||||
|
break unless post.isHidden
|
||||||
root.scrollIntoView false
|
root.scrollIntoView false
|
||||||
return
|
return
|
||||||
# Scroll to the last read post.
|
# Scroll to the last read post.
|
||||||
|
|||||||
@ -508,7 +508,7 @@ Settings =
|
|||||||
Settings[key].call input
|
Settings[key].call input
|
||||||
return
|
return
|
||||||
|
|
||||||
$.on $('input[name=Interval]', section), 'input', ThreadUpdater.cb.interval
|
$.on $('input[name=Interval]', section), 'change', ThreadUpdater.cb.interval
|
||||||
$.on $('input[name="Custom CSS"]', section), 'change', Settings.togglecss
|
$.on $('input[name="Custom CSS"]', section), 'change', Settings.togglecss
|
||||||
$.on $.id('apply-css'), 'click', Settings.usercss
|
$.on $.id('apply-css'), 'click', Settings.usercss
|
||||||
boardnav: ->
|
boardnav: ->
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user