This commit is contained in:
Jordan Bates 2013-05-04 16:38:11 -07:00
commit bea9b6caf2
7 changed files with 41 additions and 45 deletions

View File

@ -1,3 +1,6 @@
MayhemYDG:
- Fix whitespaces not being preserved in code tags in /g/.
### 1.1.11 - 2013-05-04 ### 1.1.11 - 2013-05-04
seaweedchan: seaweedchan:
- Add `Highlight Posts Quoting You` option - Add `Highlight Posts Quoting You` option
@ -67,18 +70,6 @@ seaweedchan:
- Toggle keybind for header auto-hiding - Toggle keybind for header auto-hiding
MayhemYDG: MayhemYDG:
=======
- Access it in the `QR` tab of the Settings window.
- Updated archive redirection for /h/, /v/ and /vg/.
### 3.2.3 - *2013-04-30*
- Update archive redirection for /c/, /d/, /v/, /vg/, /w/ and /wg/.
- Minor fixes.
### 3.2.2 - *2013-04-27*
>>>>>>> b74e0c92fdf2d755d996cb574dddb3c8d964e91a
- Fix Unread Count taking into account hidden posts. - Fix Unread Count taking into account hidden posts.
### 1.1.2 - 2013-04-26 ### 1.1.2 - 2013-04-26

View File

@ -7338,7 +7338,10 @@
}); });
$.on(d, '4chanXInitFinished', Unread.ready); $.on(d, '4chanXInitFinished', Unread.ready);
$.on(d, 'ThreadUpdate', Unread.onUpdate); $.on(d, 'ThreadUpdate', Unread.onUpdate);
return $.on(d, 'scroll visibilitychange', Unread.read); $.on(d, 'scroll visibilitychange', Unread.read);
if (Conf['Unread Line']) {
return $.on(d, 'visibilitychange', Unread.setLine);
}
}, },
ready: function() { ready: function() {
var ID, post, posts, _ref; var ID, post, posts, _ref;
@ -7353,12 +7356,7 @@
} }
} }
Unread.addPosts(posts); Unread.addPosts(posts);
if (Conf['Unread Line']) { return Unread.scroll();
Unread.setLine();
}
if (Conf['Scroll to Last Read Post']) {
return Unread.scroll();
}
}, },
scroll: function() { scroll: function() {
var hash, post, posts, prevID, root; var hash, post, posts, prevID, root;
@ -8347,7 +8345,7 @@
} }
board = g.BOARD.ID; board = g.BOARD.ID;
if (board === 'g') { if (board === 'g') {
$.globalEval("window.addEventListener('prettyprint', function(e) {\n var pre = e.detail;\n pre.innerHTML = prettyPrintOne(pre.innerHTML);\n}, false);"); $.globalEval("window.addEventListener('prettyprint', function(e) {\n var pre = e.detail;\n pre.innerHTML = prettyPrintOne(pre.innerHTML.replace(/\\s/g, ' '));\n}, false);");
Post.prototype.callbacks.push({ Post.prototype.callbacks.push({
name: 'Parse /g/ code', name: 'Parse /g/ code',
cb: this.code cb: this.code
@ -8370,7 +8368,9 @@
_ref = $$('.prettyprint', this.nodes.comment); _ref = $$('.prettyprint', this.nodes.comment);
for (_i = 0, _len = _ref.length; _i < _len; _i++) { for (_i = 0, _len = _ref.length; _i < _len; _i++) {
pre = _ref[_i]; pre = _ref[_i];
$.event('prettyprint', pre, window); if (!$('.pln', pre)) {
$.event('prettyprint', pre, window);
}
} }
}, },
math: function() { math: function() {

View File

@ -7359,7 +7359,10 @@
}); });
$.on(d, '4chanXInitFinished', Unread.ready); $.on(d, '4chanXInitFinished', Unread.ready);
$.on(d, 'ThreadUpdate', Unread.onUpdate); $.on(d, 'ThreadUpdate', Unread.onUpdate);
return $.on(d, 'scroll visibilitychange', Unread.read); $.on(d, 'scroll visibilitychange', Unread.read);
if (Conf['Unread Line']) {
return $.on(d, 'visibilitychange', Unread.setLine);
}
}, },
ready: function() { ready: function() {
var ID, post, posts, _ref; var ID, post, posts, _ref;
@ -7374,12 +7377,7 @@
} }
} }
Unread.addPosts(posts); Unread.addPosts(posts);
if (Conf['Unread Line']) { return Unread.scroll();
Unread.setLine();
}
if (Conf['Scroll to Last Read Post']) {
return Unread.scroll();
}
}, },
scroll: function() { scroll: function() {
var hash, post, posts, prevID, root; var hash, post, posts, prevID, root;
@ -8368,7 +8366,7 @@
} }
board = g.BOARD.ID; board = g.BOARD.ID;
if (board === 'g') { if (board === 'g') {
$.globalEval("window.addEventListener('prettyprint', function(e) {\n var pre = e.detail;\n pre.innerHTML = prettyPrintOne(pre.innerHTML);\n}, false);"); $.globalEval("window.addEventListener('prettyprint', function(e) {\n var pre = e.detail;\n pre.innerHTML = prettyPrintOne(pre.innerHTML.replace(/\\s/g, '&nbsp;'));\n}, false);");
Post.prototype.callbacks.push({ Post.prototype.callbacks.push({
name: 'Parse /g/ code', name: 'Parse /g/ code',
cb: this.code cb: this.code
@ -8391,7 +8389,9 @@
_ref = $$('.prettyprint', this.nodes.comment); _ref = $$('.prettyprint', this.nodes.comment);
for (_i = 0, _len = _ref.length; _i < _len; _i++) { for (_i = 0, _len = _ref.length; _i < _len; _i++) {
pre = _ref[_i]; pre = _ref[_i];
$.event('prettyprint', pre, window); if (!$('.pln', pre)) {
$.event('prettyprint', pre, window);
}
} }
}, },
math: function() { math: function() {

View File

@ -7337,7 +7337,10 @@
}); });
$.on(d, '4chanXInitFinished', Unread.ready); $.on(d, '4chanXInitFinished', Unread.ready);
$.on(d, 'ThreadUpdate', Unread.onUpdate); $.on(d, 'ThreadUpdate', Unread.onUpdate);
return $.on(d, 'scroll visibilitychange', Unread.read); $.on(d, 'scroll visibilitychange', Unread.read);
if (Conf['Unread Line']) {
return $.on(d, 'visibilitychange', Unread.setLine);
}
}, },
ready: function() { ready: function() {
var ID, post, posts, _ref; var ID, post, posts, _ref;
@ -7352,12 +7355,7 @@
} }
} }
Unread.addPosts(posts); Unread.addPosts(posts);
if (Conf['Unread Line']) { return Unread.scroll();
Unread.setLine();
}
if (Conf['Scroll to Last Read Post']) {
return Unread.scroll();
}
}, },
scroll: function() { scroll: function() {
var hash, post, posts, prevID, root; var hash, post, posts, prevID, root;
@ -8351,7 +8349,7 @@
} }
board = g.BOARD.ID; board = g.BOARD.ID;
if (board === 'g') { if (board === 'g') {
$.globalEval("window.addEventListener('prettyprint', function(e) {\n var pre = e.detail;\n pre.innerHTML = prettyPrintOne(pre.innerHTML);\n}, false);"); $.globalEval("window.addEventListener('prettyprint', function(e) {\n var pre = e.detail;\n pre.innerHTML = prettyPrintOne(pre.innerHTML.replace(/\\s/g, '&nbsp;'));\n}, false);");
Post.prototype.callbacks.push({ Post.prototype.callbacks.push({
name: 'Parse /g/ code', name: 'Parse /g/ code',
cb: this.code cb: this.code
@ -8374,7 +8372,9 @@
_ref = $$('.prettyprint', this.nodes.comment); _ref = $$('.prettyprint', this.nodes.comment);
for (_i = 0, _len = _ref.length; _i < _len; _i++) { for (_i = 0, _len = _ref.length; _i < _len; _i++) {
pre = _ref[_i]; pre = _ref[_i];
$.event('prettyprint', pre, window); if (!$('.pln', pre)) {
$.event('prettyprint', pre, window);
}
} }
}, },
math: function() { math: function() {

View File

@ -28,7 +28,7 @@
"grunt-contrib-compress": "~0.5.0", "grunt-contrib-compress": "~0.5.0",
"grunt-contrib-concat": "~0.3.0", "grunt-contrib-concat": "~0.3.0",
"grunt-contrib-copy": "~0.4.1", "grunt-contrib-copy": "~0.4.1",
"grunt-contrib-watch": "~0.3.1", "grunt-contrib-watch": "~0.4.0",
"grunt-shell": "~0.2.2" "grunt-shell": "~0.2.2"
}, },
"repository": { "repository": {

View File

@ -7,7 +7,7 @@ Fourchan =
$.globalEval """ $.globalEval """
window.addEventListener('prettyprint', function(e) { window.addEventListener('prettyprint', function(e) {
var pre = e.detail; var pre = e.detail;
pre.innerHTML = prettyPrintOne(pre.innerHTML); pre.innerHTML = prettyPrintOne(pre.innerHTML.replace(/\\s/g, '&nbsp;'));
}, false); }, false);
""" """
Post::callbacks.push Post::callbacks.push
@ -33,7 +33,12 @@ Fourchan =
code: -> code: ->
return if @isClone return if @isClone
for pre in $$ '.prettyprint', @nodes.comment for pre in $$ '.prettyprint', @nodes.comment
$.event 'prettyprint', pre, window # Don't pretty print twice:
# Might need a better way to detect if a .prettyprint
# is already pretty-printed. We can't just look for spans
# since 4chan inserts its quotes and whatnot inside.
unless $ '.pln', pre
$.event 'prettyprint', pre, window
return return
math: -> math: ->
return if @isClone or !$ '.math', @nodes.comment return if @isClone or !$ '.math', @nodes.comment
@ -44,4 +49,4 @@ Fourchan =
$.event '4chanParsingDone', $.event '4chanParsingDone',
threadId: threadID threadId: threadID
offset: offset offset: offset
limit: limit limit: limit

View File

@ -22,6 +22,7 @@ Unread =
$.on d, '4chanXInitFinished', Unread.ready $.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']
ready: -> ready: ->
$.off d, '4chanXInitFinished', Unread.ready $.off d, '4chanXInitFinished', Unread.ready
@ -29,8 +30,7 @@ Unread =
for ID, post of Unread.thread.posts for ID, post of Unread.thread.posts
posts.push post if post.isReply posts.push post if post.isReply
Unread.addPosts posts Unread.addPosts posts
Unread.setLine() if Conf['Unread Line'] Unread.scroll()
Unread.scroll() if Conf['Scroll to Last Read Post']
scroll: -> scroll: ->
# Let the header's onload callback handle it. # Let the header's onload callback handle it.