Merge branch 'master' into quotify
This commit is contained in:
commit
0fc9c5dea1
@ -1,6 +1,6 @@
|
|||||||
// ==UserScript==
|
// ==UserScript==
|
||||||
// @name 4chan x
|
// @name 4chan x
|
||||||
// @version 2.28.0
|
// @version 2.28.1
|
||||||
// @namespace aeosynth
|
// @namespace aeosynth
|
||||||
// @description Adds various features.
|
// @description Adds various features.
|
||||||
// @copyright 2009-2011 James Campos <james.r.campos@gmail.com>
|
// @copyright 2009-2011 James Campos <james.r.campos@gmail.com>
|
||||||
@ -20,7 +20,7 @@
|
|||||||
* Copyright (c) 2009-2011 James Campos <james.r.campos@gmail.com>
|
* Copyright (c) 2009-2011 James Campos <james.r.campos@gmail.com>
|
||||||
* Copyright (c) 2012 Nicolas Stepien <stepien.nicolas@gmail.com>
|
* Copyright (c) 2012 Nicolas Stepien <stepien.nicolas@gmail.com>
|
||||||
* http://mayhemydg.github.com/4chan-x/
|
* http://mayhemydg.github.com/4chan-x/
|
||||||
* 4chan X 2.28.0
|
* 4chan X 2.28.1
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person
|
* Permission is hereby granted, free of charge, to any person
|
||||||
* obtaining a copy of this software and associated documentation
|
* obtaining a copy of this software and associated documentation
|
||||||
@ -212,7 +212,7 @@
|
|||||||
|
|
||||||
NAMESPACE = '4chan_x.';
|
NAMESPACE = '4chan_x.';
|
||||||
|
|
||||||
VERSION = '2.28.0';
|
VERSION = '2.28.1';
|
||||||
|
|
||||||
SECOND = 1000;
|
SECOND = 1000;
|
||||||
|
|
||||||
@ -676,8 +676,9 @@
|
|||||||
return text.join('');
|
return text.join('');
|
||||||
},
|
},
|
||||||
filename: function(post) {
|
filename: function(post) {
|
||||||
var file;
|
var file, filesize;
|
||||||
if (file = $('span', post.filesize)) return file.title;
|
filesize = post.filesize;
|
||||||
|
if (filesize && (file = $('span', filesize))) return file.title;
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
dimensions: function(post) {
|
dimensions: function(post) {
|
||||||
@ -889,22 +890,21 @@
|
|||||||
|
|
||||||
ReplyHiding = {
|
ReplyHiding = {
|
||||||
init: function() {
|
init: function() {
|
||||||
return g.callbacks.push(this.node);
|
this.a = $.el('a', {
|
||||||
},
|
|
||||||
node: function(post) {
|
|
||||||
var a, dd, id, reply;
|
|
||||||
if (post["class"]) return;
|
|
||||||
dd = $('.doubledash', post.root);
|
|
||||||
dd.className = 'replyhider';
|
|
||||||
a = $.el('a', {
|
|
||||||
textContent: '[ - ]',
|
textContent: '[ - ]',
|
||||||
href: 'javascript:;'
|
href: 'javascript:;'
|
||||||
});
|
});
|
||||||
|
return g.callbacks.push(this.node);
|
||||||
|
},
|
||||||
|
node: function(post) {
|
||||||
|
var a, dd;
|
||||||
|
if (post["class"]) return;
|
||||||
|
dd = post.el.previousSibling;
|
||||||
|
dd.className = 'replyhider';
|
||||||
|
a = ReplyHiding.a.cloneNode(true);
|
||||||
$.on(a, 'click', ReplyHiding.cb.hide);
|
$.on(a, 'click', ReplyHiding.cb.hide);
|
||||||
$.replace(dd.firstChild, a);
|
$.replace(dd.firstChild, a);
|
||||||
reply = dd.nextSibling;
|
if (post.id in g.hiddenReplies) return ReplyHiding.hide(post.el);
|
||||||
id = reply.id;
|
|
||||||
if (id in g.hiddenReplies) return ReplyHiding.hide(reply);
|
|
||||||
},
|
},
|
||||||
cb: {
|
cb: {
|
||||||
hide: function() {
|
hide: function() {
|
||||||
@ -1315,8 +1315,10 @@
|
|||||||
return $.rm(script);
|
return $.rm(script);
|
||||||
});
|
});
|
||||||
if (conf['Persistent QR']) {
|
if (conf['Persistent QR']) {
|
||||||
qr.dialog();
|
setTimeout(function() {
|
||||||
if (conf['Auto Hide QR']) qr.hide();
|
qr.dialog();
|
||||||
|
if (conf['Auto Hide QR']) return qr.hide();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
$.on(d, 'dragover', qr.dragOver);
|
$.on(d, 'dragover', qr.dragOver);
|
||||||
$.on(d, 'drop', qr.dropFile);
|
$.on(d, 'drop', qr.dropFile);
|
||||||
@ -2813,6 +2815,7 @@
|
|||||||
},
|
},
|
||||||
node: function(post) {
|
node: function(post) {
|
||||||
var name, node;
|
var name, node;
|
||||||
|
if (post["class"] === 'inline') return;
|
||||||
name = $('.commentpostername, .postername', post.el);
|
name = $('.commentpostername, .postername', post.el);
|
||||||
name.textContent = 'Anonymous';
|
name.textContent = 'Anonymous';
|
||||||
node = name.nextElementSibling;
|
node = name.nextElementSibling;
|
||||||
@ -3536,11 +3539,22 @@
|
|||||||
Unread.replies = Unread.replies.slice(i);
|
Unread.replies = Unread.replies.slice(i);
|
||||||
return Unread.update();
|
return Unread.update();
|
||||||
},
|
},
|
||||||
|
setTitle: function(count) {
|
||||||
|
if (this.scheduled) {
|
||||||
|
clearTimeout(this.scheduled);
|
||||||
|
delete Unread.scheduled;
|
||||||
|
this.setTitle(count);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
return this.scheduled = setTimeout((function() {
|
||||||
|
return d.title = "(" + count + ") " + Unread.title;
|
||||||
|
}), 5);
|
||||||
|
},
|
||||||
update: function(forceUpdate) {
|
update: function(forceUpdate) {
|
||||||
var count;
|
var count;
|
||||||
if (!g.REPLY) return;
|
if (!g.REPLY) return;
|
||||||
count = this.replies.length;
|
count = this.replies.length;
|
||||||
if (conf['Unread Count']) d.title = "(" + count + ") " + this.title;
|
if (conf['Unread Count']) this.setTitle(count);
|
||||||
if (!(conf['Unread Favicon'] && (count < 2 || forceUpdate))) return;
|
if (!(conf['Unread Favicon'] && (count < 2 || forceUpdate))) return;
|
||||||
Favicon.el.href = g.dead ? count ? Favicon.unreadDead : Favicon.dead : count ? Favicon.unread : Favicon["default"];
|
Favicon.el.href = g.dead ? count ? Favicon.unreadDead : Favicon.dead : count ? Favicon.unread : Favicon["default"];
|
||||||
return $.add(d.head, Favicon.el);
|
return $.add(d.head, Favicon.el);
|
||||||
|
|||||||
2
Cakefile
2
Cakefile
@ -2,7 +2,7 @@
|
|||||||
{exec} = require 'child_process'
|
{exec} = require 'child_process'
|
||||||
fs = require 'fs'
|
fs = require 'fs'
|
||||||
|
|
||||||
VERSION = '2.28.0'
|
VERSION = '2.28.1'
|
||||||
|
|
||||||
HEADER = """
|
HEADER = """
|
||||||
// ==UserScript==
|
// ==UserScript==
|
||||||
|
|||||||
@ -1,4 +1,6 @@
|
|||||||
master
|
master
|
||||||
|
|
||||||
|
2.28.1
|
||||||
- Mayhem
|
- Mayhem
|
||||||
General performance improvements.
|
General performance improvements.
|
||||||
Threads will now be updated instantly after posting through the QR.
|
Threads will now be updated instantly after posting through the QR.
|
||||||
|
|||||||
@ -1 +1 @@
|
|||||||
postMessage({version:'2.28.0'},'*')
|
postMessage({version:'2.28.1'},'*')
|
||||||
@ -172,7 +172,7 @@ conf = {}
|
|||||||
) null, config
|
) null, config
|
||||||
|
|
||||||
NAMESPACE = '4chan_x.'
|
NAMESPACE = '4chan_x.'
|
||||||
VERSION = '2.28.0'
|
VERSION = '2.28.1'
|
||||||
SECOND = 1000
|
SECOND = 1000
|
||||||
MINUTE = 60*SECOND
|
MINUTE = 60*SECOND
|
||||||
HOUR = 60*MINUTE
|
HOUR = 60*MINUTE
|
||||||
@ -594,7 +594,8 @@ Filter =
|
|||||||
text.push if data = nodes.snapshotItem(i).data then data else '\n'
|
text.push if data = nodes.snapshotItem(i).data then data else '\n'
|
||||||
text.join ''
|
text.join ''
|
||||||
filename: (post) ->
|
filename: (post) ->
|
||||||
if file = $ 'span', post.filesize
|
{filesize} = post
|
||||||
|
if filesize and file = $ 'span', filesize
|
||||||
return file.title
|
return file.title
|
||||||
false
|
false
|
||||||
dimensions: (post) ->
|
dimensions: (post) ->
|
||||||
@ -748,22 +749,21 @@ ExpandThread =
|
|||||||
|
|
||||||
ReplyHiding =
|
ReplyHiding =
|
||||||
init: ->
|
init: ->
|
||||||
|
@a = $.el 'a',
|
||||||
|
textContent: '[ - ]'
|
||||||
|
href: 'javascript:;'
|
||||||
g.callbacks.push @node
|
g.callbacks.push @node
|
||||||
|
|
||||||
node: (post) ->
|
node: (post) ->
|
||||||
return if post.class
|
return if post.class
|
||||||
dd = $ '.doubledash', post.root
|
dd = post.el.previousSibling
|
||||||
dd.className = 'replyhider'
|
dd.className = 'replyhider'
|
||||||
a = $.el 'a',
|
a = ReplyHiding.a.cloneNode true
|
||||||
textContent: '[ - ]'
|
|
||||||
href: 'javascript:;'
|
|
||||||
$.on a, 'click', ReplyHiding.cb.hide
|
$.on a, 'click', ReplyHiding.cb.hide
|
||||||
$.replace dd.firstChild, a
|
$.replace dd.firstChild, a
|
||||||
|
|
||||||
reply = dd.nextSibling
|
if post.id of g.hiddenReplies
|
||||||
id = reply.id
|
ReplyHiding.hide post.el
|
||||||
if id of g.hiddenReplies
|
|
||||||
ReplyHiding.hide reply
|
|
||||||
|
|
||||||
cb:
|
cb:
|
||||||
hide: ->
|
hide: ->
|
||||||
@ -1071,8 +1071,9 @@ qr =
|
|||||||
$.rm script
|
$.rm script
|
||||||
|
|
||||||
if conf['Persistent QR']
|
if conf['Persistent QR']
|
||||||
qr.dialog()
|
setTimeout ->
|
||||||
qr.hide() if conf['Auto Hide QR']
|
qr.dialog()
|
||||||
|
qr.hide() if conf['Auto Hide QR']
|
||||||
$.on d, 'dragover', qr.dragOver
|
$.on d, 'dragover', qr.dragOver
|
||||||
$.on d, 'drop', qr.dropFile
|
$.on d, 'drop', qr.dropFile
|
||||||
$.on d, 'dragstart', qr.drag
|
$.on d, 'dragstart', qr.drag
|
||||||
@ -2368,6 +2369,7 @@ Anonymize =
|
|||||||
init: ->
|
init: ->
|
||||||
g.callbacks.push @node
|
g.callbacks.push @node
|
||||||
node: (post) ->
|
node: (post) ->
|
||||||
|
return if post.class is 'inline'
|
||||||
name = $ '.commentpostername, .postername', post.el
|
name = $ '.commentpostername, .postername', post.el
|
||||||
name.textContent = 'Anonymous'
|
name.textContent = 'Anonymous'
|
||||||
node = name.nextElementSibling
|
node = name.nextElementSibling
|
||||||
@ -2909,13 +2911,23 @@ Unread =
|
|||||||
Unread.replies = Unread.replies[i..]
|
Unread.replies = Unread.replies[i..]
|
||||||
Unread.update()
|
Unread.update()
|
||||||
|
|
||||||
|
setTitle: (count) ->
|
||||||
|
if @scheduled
|
||||||
|
clearTimeout @scheduled
|
||||||
|
delete Unread.scheduled
|
||||||
|
@setTitle count
|
||||||
|
return
|
||||||
|
@scheduled = setTimeout (->
|
||||||
|
d.title = "(#{count}) #{Unread.title}"
|
||||||
|
), 5
|
||||||
|
|
||||||
update: (forceUpdate) ->
|
update: (forceUpdate) ->
|
||||||
return unless g.REPLY
|
return unless g.REPLY
|
||||||
|
|
||||||
count = @replies.length
|
count = @replies.length
|
||||||
|
|
||||||
if conf['Unread Count']
|
if conf['Unread Count']
|
||||||
d.title = "(#{count}) #{@title}"
|
@setTitle count
|
||||||
|
|
||||||
unless conf['Unread Favicon'] and (count < 2 or forceUpdate)
|
unless conf['Unread Favicon'] and (count < 2 or forceUpdate)
|
||||||
return
|
return
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user