This commit is contained in:
Nicolas Stepien 2011-12-11 00:33:02 +01:00
parent cfccab22b0
commit 19703e047d
3 changed files with 56 additions and 46 deletions

View File

@ -118,7 +118,8 @@
'Quote Inline': [true, 'Show quoted post inline on quote click'],
'Quote Preview': [true, 'Show quote content on hover'],
'Indicate OP quote': [true, 'Add \'(OP)\' to OP quotes'],
'Indicate Cross-thread Quotes': [true, 'Add \'(Cross-thread)\' to cross-threads quotes']
'Indicate Cross-thread Quotes': [true, 'Add \'(Cross-thread)\' to cross-threads quotes'],
'Forward Hiding': [true, 'Hide original posts of inlined backlinks']
}
},
filter: {
@ -2446,7 +2447,7 @@
e.preventDefault();
id = this.hash.slice(1);
if (/\binlined\b/.test(this.className)) {
$.rm($.x("following::*[@id='i" + id + "']", this));
quoteInline.rm(this, id);
} else {
if ($.x("ancestor::*[@id='" + id + "']", this)) return;
quoteInline.add(this, id);
@ -2460,6 +2461,9 @@
inline = quoteInline.table(id, el.innerHTML);
if (/\bbacklink\b/.test(q.className)) {
$.after(q.parentNode, inline);
if (conf['Forward Hiding']) {
$.addClass($.x('ancestor::table', el), 'forwarded');
}
return;
}
return $.after(root, inline);
@ -2477,6 +2481,20 @@
}));
}
},
rm: function(q, id) {
var inlined, table, _i, _len, _ref;
table = $.x("following::*[@id='i" + id + "']", q);
$.rm(table);
if (!conf['Forward Hiding']) return;
_ref = $$('.backlink.inlined', table);
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
inlined = _ref[_i];
$.removeClass($.x('ancestor::table', $.id(inlined.hash.slice(1))), 'forwarded');
}
if (/\bbacklink\b/.test(q.className)) {
return $.removeClass($.x('ancestor::table', $.id(id)), 'forwarded');
}
},
parse: function(req, pathname, id, threadID, inline) {
var body, href, html, link, newInline, op, quote, reply, _i, _j, _len, _len2, _ref, _ref2;
if (!inline.parentNode) return;
@ -3166,9 +3184,6 @@
},
css: '\
/* dialog styling */\
a[href="javascript:;"] {\
text-decoration: none;\
}\
div.dialog {\
border: 1px solid;\
}\
@ -3178,6 +3193,17 @@
label, a, .favicon, #qr img {\
cursor: pointer;\
}\
a[href="javascript:;"] {\
text-decoration: none;\
}\
\
[hidden], /* Firefox bug: hidden tables are not hidden. fixed in 9.0 */\
.thread.stub > :not(.block),\
#content > [name=tab]:not(:checked) + div,\
#updater:not(:hover) > :not(.move),\
#qp > input, #qp .inline, .forwarded {\
display: none;\
}\
\
.new {\
background: lime;\
@ -3194,10 +3220,6 @@
td.replyhider {\
vertical-align: top;\
}\
\
div.thread.stub > *:not(.block) {\
display: none;\
}\
\
.filesize + br + a {\
float: left;\
@ -3261,9 +3283,6 @@
#options label {\
text-decoration: underline;\
}\
#options [name=tab]:not(:checked) + * {\
display: none;\
}\
#content > div {\
height: 450px;\
overflow: auto;\
@ -3330,9 +3349,6 @@
border: none;\
background: transparent;\
}\
#updater:not(:hover) > div:not(.move) {\
display: none;\
}\
\
#stats {\
border: none;\
@ -3362,9 +3378,6 @@
border: 1px solid;\
padding-bottom: 5px;\
}\
#qp input, #qp .inline {\
display: none;\
}\
.qphl {\
outline: 2px solid rgba(216, 94, 49, .7);\
}\
@ -3381,11 +3394,6 @@
.filtered {\
text-decoration: line-through;\
}\
\
/* Firefox bug: hidden tables are not hidden. fixed in 9.0 */\
[hidden] {\
display: none;\
}\
\
#files > input {\
display: block;\

View File

@ -1,5 +1,6 @@
master
- mayhem
hide original posts from inlined backlinks - optional
enable autoposting when submitting a captcha while on cooldown
fix caret position when quoting on Opera

View File

@ -46,6 +46,7 @@ config =
'Quote Preview': [true, 'Show quote content on hover']
'Indicate OP quote': [true, 'Add \'(OP)\' to OP quotes']
'Indicate Cross-thread Quotes': [true, 'Add \'(Cross-thread)\' to cross-threads quotes']
'Forward Hiding': [true, 'Hide original posts of inlined backlinks']
filter:
name: ''
tripcode: ''
@ -1929,8 +1930,7 @@ quoteInline =
e.preventDefault()
id = @hash[1..]
if /\binlined\b/.test @className
# remove the corresponding table or loading td
$.rm $.x "following::*[@id='i#{id}']", @
quoteInline.rm @, id
else
return if $.x "ancestor::*[@id='#{id}']", @
quoteInline.add @, id
@ -1942,6 +1942,7 @@ quoteInline =
inline = quoteInline.table id, el.innerHTML
if /\bbacklink\b/.test q.className
$.after q.parentNode, inline
$.addClass $.x('ancestor::table', el), 'forwarded' if conf['Forward Hiding']
return
$.after root, inline
else
@ -1954,6 +1955,16 @@ quoteInline =
threadID = pathname.split('/').pop()
$.cache pathname, (-> quoteInline.parse @, pathname, id, threadID, inline)
rm: (q, id) ->
#select the corresponding table or loading td
table = $.x "following::*[@id='i#{id}']", q
$.rm table
return unless conf['Forward Hiding']
for inlined in $$ '.backlink.inlined', table
$.removeClass $.x('ancestor::table', $.id inlined.hash[1..]), 'forwarded'
if /\bbacklink\b/.test q.className
$.removeClass $.x('ancestor::table', $.id id), 'forwarded'
parse: (req, pathname, id, threadID, inline) ->
return unless inline.parentNode
@ -2526,9 +2537,6 @@ Main =
css: '
/* dialog styling */
a[href="javascript:;"] {
text-decoration: none;
}
div.dialog {
border: 1px solid;
}
@ -2538,6 +2546,17 @@ Main =
label, a, .favicon, #qr img {
cursor: pointer;
}
a[href="javascript:;"] {
text-decoration: none;
}
[hidden], /* Firefox bug: hidden tables are not hidden. fixed in 9.0 */
.thread.stub > :not(.block),
#content > [name=tab]:not(:checked) + div,
#updater:not(:hover) > :not(.move),
#qp > input, #qp .inline, .forwarded {
display: none;
}
.new {
background: lime;
@ -2555,10 +2574,6 @@ Main =
vertical-align: top;
}
div.thread.stub > *:not(.block) {
display: none;
}
.filesize + br + a {
float: left;
pointer-events: none;
@ -2621,9 +2636,6 @@ Main =
#options label {
text-decoration: underline;
}
#options [name=tab]:not(:checked) + * {
display: none;
}
#content > div {
height: 450px;
overflow: auto;
@ -2690,9 +2702,6 @@ Main =
border: none;
background: transparent;
}
#updater:not(:hover) > div:not(.move) {
display: none;
}
#stats {
border: none;
@ -2722,9 +2731,6 @@ Main =
border: 1px solid;
padding-bottom: 5px;
}
#qp input, #qp .inline {
display: none;
}
.qphl {
outline: 2px solid rgba(216, 94, 49, .7);
}
@ -2742,11 +2748,6 @@ Main =
text-decoration: line-through;
}
/* Firefox bug: hidden tables are not hidden. fixed in 9.0 */
[hidden] {
display: none;
}
#files > input {
display: block;
}