diff --git a/CHANGELOG.md b/CHANGELOG.md
index 10322d070..639aef70c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,6 +4,9 @@
## v1.13.0
+**v1.13.0.9** *(2016-10-09)* - [[Userscript](https://raw.githubusercontent.com/ccd0/4chan-x/1.13.0.9/builds/4chan-X-noupdate.user.js)] [[Chrome extension](https://raw.githubusercontent.com/ccd0/4chan-x/1.13.0.9/builds/4chan-X-noupdate.crx)]
+- Fix bug from v1.13.0.0 that broke Quote Inlining / Previewing of OPs on /f/.
+
**v1.13.0.8** *(2016-10-08)* - [[Userscript](https://raw.githubusercontent.com/ccd0/4chan-x/1.13.0.8/builds/4chan-X-noupdate.user.js)] [[Chrome extension](https://raw.githubusercontent.com/ccd0/4chan-x/1.13.0.8/builds/4chan-X-noupdate.crx)]
- (AchtBit) Add keybind for toggling custom cooldown (default: `Alt+Comma`).
- Add keybind to post file from URL (default: `Alt+l`).
diff --git a/builds/4chan-X-beta.crx b/builds/4chan-X-beta.crx
index b04d4f195..08a92bc91 100644
Binary files a/builds/4chan-X-beta.crx and b/builds/4chan-X-beta.crx differ
diff --git a/builds/4chan-X-beta.meta.js b/builds/4chan-X-beta.meta.js
index edd0618e3..937f7a75e 100644
--- a/builds/4chan-X-beta.meta.js
+++ b/builds/4chan-X-beta.meta.js
@@ -1,6 +1,6 @@
// ==UserScript==
// @name 4chan X beta
-// @version 1.13.0.8
+// @version 1.13.0.9
// @minGMVer 1.14
// @minFFVer 26
// @namespace 4chan-X
diff --git a/builds/4chan-X-beta.user.js b/builds/4chan-X-beta.user.js
index 411aa3ad3..dee3f3aec 100644
--- a/builds/4chan-X-beta.user.js
+++ b/builds/4chan-X-beta.user.js
@@ -1,6 +1,6 @@
// ==UserScript==
// @name 4chan X beta
-// @version 1.13.0.8
+// @version 1.13.0.9
// @minGMVer 1.14
// @minFFVer 26
// @namespace 4chan-X
@@ -136,7 +136,7 @@ docSet = function() {
};
g = {
- VERSION: '1.13.0.8',
+ VERSION: '1.13.0.9',
NAMESPACE: '4chan X.',
boards: {}
};
@@ -6128,7 +6128,7 @@ Post = (function() {
_Class.prototype.isClone = true;
function _Class(origin, context, contractThumb) {
- var base, fileRoot, i, inline, inlined, j, k, key, l, len, len1, len2, len3, node, nodes, ref, ref1, ref2, ref3, ref4, root, val;
+ var base, fileRoot, i, inline, inlined, j, k, key, l, len, len1, len2, len3, node, nodes, ref, ref1, ref2, ref3, ref4, ref5, root, val;
this.origin = origin;
this.context = context;
ref = ['ID', 'fullID', 'board', 'thread', 'info', 'quotes', 'isReply'];
@@ -6178,7 +6178,7 @@ Post = (function() {
this.file.text = fileRoot.firstElementChild;
this.file.link = $('.fileText > a, .fileText-original', fileRoot);
this.file.thumb = $('a.fileThumb > [data-md5]', fileRoot);
- this.file.thumbLink = this.file.thumb.parentNode;
+ this.file.thumbLink = (ref5 = this.file.thumb) != null ? ref5.parentNode : void 0;
this.file.fullImage = $('.full-image', fileRoot);
this.file.videoControls = $('.video-controls', this.file.text);
if (this.file.videoThumb) {
diff --git a/builds/4chan-X-noupdate.crx b/builds/4chan-X-noupdate.crx
index 468ac3483..a39e425f3 100644
Binary files a/builds/4chan-X-noupdate.crx and b/builds/4chan-X-noupdate.crx differ
diff --git a/builds/4chan-X-noupdate.user.js b/builds/4chan-X-noupdate.user.js
index 0aebea983..f9415d42f 100644
--- a/builds/4chan-X-noupdate.user.js
+++ b/builds/4chan-X-noupdate.user.js
@@ -1,6 +1,6 @@
// ==UserScript==
// @name 4chan X
-// @version 1.13.0.8
+// @version 1.13.0.9
// @minGMVer 1.14
// @minFFVer 26
// @namespace 4chan-X
@@ -136,7 +136,7 @@ docSet = function() {
};
g = {
- VERSION: '1.13.0.8',
+ VERSION: '1.13.0.9',
NAMESPACE: '4chan X.',
boards: {}
};
@@ -6128,7 +6128,7 @@ Post = (function() {
_Class.prototype.isClone = true;
function _Class(origin, context, contractThumb) {
- var base, fileRoot, i, inline, inlined, j, k, key, l, len, len1, len2, len3, node, nodes, ref, ref1, ref2, ref3, ref4, root, val;
+ var base, fileRoot, i, inline, inlined, j, k, key, l, len, len1, len2, len3, node, nodes, ref, ref1, ref2, ref3, ref4, ref5, root, val;
this.origin = origin;
this.context = context;
ref = ['ID', 'fullID', 'board', 'thread', 'info', 'quotes', 'isReply'];
@@ -6178,7 +6178,7 @@ Post = (function() {
this.file.text = fileRoot.firstElementChild;
this.file.link = $('.fileText > a, .fileText-original', fileRoot);
this.file.thumb = $('a.fileThumb > [data-md5]', fileRoot);
- this.file.thumbLink = this.file.thumb.parentNode;
+ this.file.thumbLink = (ref5 = this.file.thumb) != null ? ref5.parentNode : void 0;
this.file.fullImage = $('.full-image', fileRoot);
this.file.videoControls = $('.video-controls', this.file.text);
if (this.file.videoThumb) {
diff --git a/builds/4chan-X.crx b/builds/4chan-X.crx
index 540cf3925..1aeef2bd6 100644
Binary files a/builds/4chan-X.crx and b/builds/4chan-X.crx differ
diff --git a/builds/4chan-X.meta.js b/builds/4chan-X.meta.js
index 536df84d9..84ce3806a 100644
--- a/builds/4chan-X.meta.js
+++ b/builds/4chan-X.meta.js
@@ -1,6 +1,6 @@
// ==UserScript==
// @name 4chan X
-// @version 1.13.0.8
+// @version 1.13.0.9
// @minGMVer 1.14
// @minFFVer 26
// @namespace 4chan-X
diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js
index 5cccd7cc4..21ef907b8 100644
--- a/builds/4chan-X.user.js
+++ b/builds/4chan-X.user.js
@@ -1,6 +1,6 @@
// ==UserScript==
// @name 4chan X
-// @version 1.13.0.8
+// @version 1.13.0.9
// @minGMVer 1.14
// @minFFVer 26
// @namespace 4chan-X
@@ -136,7 +136,7 @@ docSet = function() {
};
g = {
- VERSION: '1.13.0.8',
+ VERSION: '1.13.0.9',
NAMESPACE: '4chan X.',
boards: {}
};
@@ -6128,7 +6128,7 @@ Post = (function() {
_Class.prototype.isClone = true;
function _Class(origin, context, contractThumb) {
- var base, fileRoot, i, inline, inlined, j, k, key, l, len, len1, len2, len3, node, nodes, ref, ref1, ref2, ref3, ref4, root, val;
+ var base, fileRoot, i, inline, inlined, j, k, key, l, len, len1, len2, len3, node, nodes, ref, ref1, ref2, ref3, ref4, ref5, root, val;
this.origin = origin;
this.context = context;
ref = ['ID', 'fullID', 'board', 'thread', 'info', 'quotes', 'isReply'];
@@ -6178,7 +6178,7 @@ Post = (function() {
this.file.text = fileRoot.firstElementChild;
this.file.link = $('.fileText > a, .fileText-original', fileRoot);
this.file.thumb = $('a.fileThumb > [data-md5]', fileRoot);
- this.file.thumbLink = this.file.thumb.parentNode;
+ this.file.thumbLink = (ref5 = this.file.thumb) != null ? ref5.parentNode : void 0;
this.file.fullImage = $('.full-image', fileRoot);
this.file.videoControls = $('.video-controls', this.file.text);
if (this.file.videoThumb) {
diff --git a/builds/4chan-X.zip b/builds/4chan-X.zip
index f5b5152ad..353e5f857 100644
Binary files a/builds/4chan-X.zip and b/builds/4chan-X.zip differ
diff --git a/builds/updates-beta.xml b/builds/updates-beta.xml
index 7482dc03b..cc18cb073 100644
--- a/builds/updates-beta.xml
+++ b/builds/updates-beta.xml
@@ -1,7 +1,7 @@
-
+
diff --git a/builds/updates.xml b/builds/updates.xml
index 80ff8fb34..9e07d01d8 100644
--- a/builds/updates.xml
+++ b/builds/updates.xml
@@ -1,7 +1,7 @@
-
+
diff --git a/src/General/Build.coffee b/src/General/Build.coffee
index bf7dbb308..0a1c6e123 100644
--- a/src/General/Build.coffee
+++ b/src/General/Build.coffee
@@ -83,8 +83,6 @@ Build =
html = html
.replace(/
/gi, '\n')
.replace(/\n\nRolled [^<]*<\/b>/i, '') # Rolls (/tg/)
- .replace(/]*>/g, '')
Build.unescape html
@@ -93,6 +91,9 @@ Build =
unless Conf['Remove Spoilers'] or Conf['Reveal Spoilers']
while (html2 = html.replace /(?:(?!<\/?s>).)*<\/s>/g, '[spoiler]') isnt html
html = html2
+ html = html
+ .replace(/^Rolled [^<]*<\/b>/i, '') # Rolls (/tg/, /qst/)
+ .replace(/ 73
excerpt
threadFromRoot: (root) ->
diff --git a/src/Miscellaneous/IDColor.coffee b/src/Miscellaneous/IDColor.coffee
index 9d956c3fe..bb4046c3c 100644
--- a/src/Miscellaneous/IDColor.coffee
+++ b/src/Miscellaneous/IDColor.coffee
@@ -10,7 +10,7 @@ IDColor =
cb: @node
node: ->
- return if @isClone or !((uid = @info.uniqueID) and (span = $ 'span.hand', @nodes.uniqueID))
+ return if @isClone or !((uid = @info.uniqueID) and (span = @nodes.uniqueID))
rgb = IDColor.ids[uid] or IDColor.compute uid
diff --git a/src/Miscellaneous/IDHighlight.coffee b/src/Miscellaneous/IDHighlight.coffee
index 759a8b607..bf8aaa933 100644
--- a/src/Miscellaneous/IDHighlight.coffee
+++ b/src/Miscellaneous/IDHighlight.coffee
@@ -9,8 +9,8 @@ IDHighlight =
uniqueID: null
node: ->
- $.on @nodes.uniqueID, 'click', IDHighlight.click @ if @nodes.uniqueID
- $.on @nodes.capcode, 'click', IDHighlight.click @ if @nodes.capcode
+ $.on @nodes.uniqueIDRoot, 'click', IDHighlight.click @ if @nodes.uniqueIDRoot
+ $.on @nodes.capcode, 'click', IDHighlight.click @ if @nodes.capcode
IDHighlight.set @ unless @isClone
set: (post) ->
diff --git a/src/Miscellaneous/IDPostCount.coffee b/src/Miscellaneous/IDPostCount.coffee
index cca9d1abb..5e8896c70 100644
--- a/src/Miscellaneous/IDPostCount.coffee
+++ b/src/Miscellaneous/IDPostCount.coffee
@@ -10,7 +10,7 @@ IDPostCount =
node: ->
if @nodes.uniqueID and @thread is IDPostCount.thread
- $.on $('span.hand', @nodes.uniqueID), 'mouseover', IDPostCount.count
+ $.on @nodes.uniqueID, 'mouseover', IDPostCount.count
count: ->
{uniqueID} = Get.postFromNode(@).info
diff --git a/src/Monitoring/Unread.coffee b/src/Monitoring/Unread.coffee
index d2b801cc8..f7784e592 100644
--- a/src/Monitoring/Unread.coffee
+++ b/src/Monitoring/Unread.coffee
@@ -132,7 +132,7 @@ Unread =
openNotification: (post) ->
return unless Header.areNotificationsEnabled
notif = new Notification "#{post.info.nameBlock} replied to you",
- body: post.info.commentDisplay
+ body: post.commentDisplay()
icon: Favicon.logo
notif.onclick = ->
Header.scrollToIfNeeded post.nodes.root, true
diff --git a/src/classes/Post.Clone.coffee b/src/classes/Post.Clone.coffee
index b627ad81d..9eafe6422 100644
--- a/src/classes/Post.Clone.coffee
+++ b/src/classes/Post.Clone.coffee
@@ -48,7 +48,7 @@ Post.Clone = class extends Post
@file.text = fileRoot.firstElementChild
@file.link = $ '.fileText > a, .fileText-original', fileRoot
@file.thumb = $ 'a.fileThumb > [data-md5]', fileRoot
- @file.thumbLink = @file.thumb.parentNode
+ @file.thumbLink = @file.thumb?.parentNode
@file.fullImage = $ '.full-image', fileRoot
@file.videoControls = $ '.video-controls', @file.text
diff --git a/src/classes/Post.coffee b/src/classes/Post.coffee
index 968b7d950..ebf66201e 100644
--- a/src/classes/Post.coffee
+++ b/src/classes/Post.coffee
@@ -24,17 +24,23 @@ class Post
@thread.kill() if @thread.isArchived
@info =
- nameBlock: if Conf['Anonymize'] then 'Anonymous' else @nodes.nameBlock.textContent.trim()
subject: @nodes.subject?.textContent or undefined
name: @nodes.name?.textContent
tripcode: @nodes.tripcode?.textContent
- uniqueID: @nodes.uniqueID?.firstElementChild.textContent
+ uniqueID: @nodes.uniqueID?.textContent
capcode: @nodes.capcode?.textContent.replace '## ', ''
pass: @nodes.pass?.title.match(/\d*$/)[0]
flagCode: @nodes.flag?.className.match(/flag-(\w+)/)?[1].toUpperCase()
flag: @nodes.flag?.title
date: if @nodes.date then new Date(@nodes.date.dataset.utc * 1000)
+ if Conf['Anonymize']
+ @info.nameBlock = 'Anonymous'
+ else
+ @info.nameBlock = "#{@info.name or ''} #{@info.tripcode or ''}".trim()
+ @info.nameBlock += " ## #{@info.capcode}" if @info.capcode
+ @info.nameBlock += " (ID: #{@info.uniqueID})" if @info.uniqueID
+
@parseComment()
@parseQuotes()
@parseFile()
@@ -59,25 +65,25 @@ class Post
post = $ '.post', root
info = $ '.postInfo', post
nodes =
- root: root
- post: post
- info: info
- subject: $ '.subject', info
- name: $ '.name', info
- email: $ '.useremail', info
- tripcode: $ '.postertrip', info
- uniqueID: $ '.posteruid', info
- capcode: $ '.capcode.hand', info
- pass: $ '.n-pu', info
- flag: $ '.flag, .countryFlag', info
- date: $ '.dateTime', info
- nameBlock: $ '.nameBlock', info
- quote: $ '.postNum > a:nth-of-type(2)', info
- reply: $ '.replylink', info
- fileRoot: $ '.file', post
- comment: $ '.postMessage', post
- links: []
- quotelinks: []
+ root: root
+ post: post
+ info: info
+ subject: $ '.subject', info
+ name: $ '.name', info
+ email: $ '.useremail', info
+ tripcode: $ '.postertrip', info
+ uniqueIDRoot: $ '.posteruid', info
+ uniqueID: $ '.posteruid > .hand', info
+ capcode: $ '.capcode.hand', info
+ pass: $ '.n-pu', info
+ flag: $ '.flag, .countryFlag', info
+ date: $ '.dateTime', info
+ nameBlock: $ '.nameBlock', info
+ quote: $ '.postNum > a:nth-of-type(2)', info
+ reply: $ '.replylink', info
+ fileRoot: $ '.file', post
+ comment: $ '.postMessage', post
+ quotelinks: []
archivelinks: []
# XXX Edge invalidates HTMLCollections when an ancestor node is inserted into another node.
@@ -101,29 +107,22 @@ class Post
# Remove:
# 'Comment too long'...
# EXIF data. (/p/)
- # Rolls. (/tg/)
- # Fortunes. (/s4s/)
- bq = @nodes.comment.cloneNode true
- for node in $$ '.abbr + br, .exif, b, .fortune', bq
- $.rm node
- if abbr = $ '.abbr', bq
- $.rm abbr
+ @nodes.commentClean = bq = @nodes.comment.cloneNode true
+ @cleanComment bq
@info.comment = @nodesToText bq
- if abbr
- @info.comment = @info.comment.replace /\n\n$/, ''
- # Hide spoilers.
- # Remove:
+ commentDisplay: ->
+ # Get the comment's text for display purposes (e.g. notifications, excerpts).
+ # In addition to what's done in generating `@info.comment`, remove:
+ # Spoilers. (filter to '[spoiler]')
+ # Rolls. (/tg/, /qst/)
+ # Fortunes. (/s4s/)
# Preceding and following new lines.
# Trailing spaces.
- commentDisplay = @info.comment
- unless Conf['Remove Spoilers'] or Conf['Reveal Spoilers']
- spoilers = $$ 's', bq
- if spoilers.length
- for node in spoilers
- $.replace node, $.tn '[spoiler]'
- commentDisplay = @nodesToText bq
- @info.commentDisplay = commentDisplay.trim().replace /\s+$/gm, ''
+ bq = @nodes.commentClean.cloneNode true
+ @cleanSpoilers bq unless Conf['Remove Spoilers'] or Conf['Reveal Spoilers']
+ @cleanCommentDisplay bq
+ @nodesToText(bq).trim().replace(/\s+$/gm, '')
nodesToText: (bq) ->
text = ""
@@ -133,6 +132,24 @@ class Post
text += node.data or '\n'
text
+ cleanComment: (bq) ->
+ if (abbr = $ '.abbr', bq) # 'Comment too long' or 'EXIF data available'
+ for node in $$ '.abbr + br, .exif', bq
+ $.rm node
+ for i in [0...2]
+ $.rm br if (br = abbr.previousSibling) and br.nodeName is 'BR'
+ $.rm abbr
+
+ cleanSpoilers: (bq) ->
+ spoilers = $$ 's', bq
+ for node in spoilers
+ $.replace node, $.tn '[spoiler]'
+ return
+
+ cleanCommentDisplay: (bq) ->
+ $.rm b if (b = $ 'b', bq) and /^Rolled /.test(b.textContent)
+ $.rm $('.fortune', bq)
+
parseQuotes: ->
@quotes = []
# XXX https://github.com/4chan/4chan-JS/issues/77
diff --git a/version.json b/version.json
index cde521001..c503c4162 100644
--- a/version.json
+++ b/version.json
@@ -1,4 +1,4 @@
{
- "version": "1.13.0.8",
- "date": "2016-10-08T19:18:35.432Z"
+ "version": "1.13.0.9",
+ "date": "2016-10-09T10:48:46.406Z"
}
\ No newline at end of file