Merge branch 'bstable'

This commit is contained in:
ccd0 2015-04-17 20:11:49 -07:00
commit a0aabf6be3
15 changed files with 166 additions and 79 deletions

View File

@ -4,6 +4,9 @@ The links to individual versions below are to copies of the script with the upda
### v1.10.9 ### v1.10.9
**v1.10.9.3** *(2015-04-17)* - [[Firefox](https://raw.githubusercontent.com/ccd0/4chan-x/1.10.9.3/builds/4chan-X-noupdate.user.js "Firefox version")] [[Chromium](https://raw.githubusercontent.com/ccd0/4chan-x/1.10.9.3/builds/4chan-X-noupdate.crx "Chromium version")]
- Resize report window as needed instead of opening it huge at beginning.
**v1.10.9.2** *(2015-04-16)* - [[Firefox](https://raw.githubusercontent.com/ccd0/4chan-x/1.10.9.2/builds/4chan-X-noupdate.user.js "Firefox version")] [[Chromium](https://raw.githubusercontent.com/ccd0/4chan-x/1.10.9.2/builds/4chan-X-noupdate.crx "Chromium version")] **v1.10.9.2** *(2015-04-16)* - [[Firefox](https://raw.githubusercontent.com/ccd0/4chan-x/1.10.9.2/builds/4chan-X-noupdate.user.js "Firefox version")] [[Chromium](https://raw.githubusercontent.com/ccd0/4chan-x/1.10.9.2/builds/4chan-X-noupdate.crx "Chromium version")]
- (aCarbon) Normal report size box if pass is logged in. - (aCarbon) Normal report size box if pass is logged in.
- Clean up leftover Recaptcha iframes to prevent memory leak. - Clean up leftover Recaptcha iframes to prevent memory leak.

Binary file not shown.

View File

@ -1,6 +1,6 @@
// ==UserScript== // ==UserScript==
// @name 4chan X beta // @name 4chan X beta
// @version 1.10.9.2 // @version 1.10.9.3
// @minGMVer 1.14 // @minGMVer 1.14
// @minFFVer 26 // @minFFVer 26
// @namespace 4chan-X // @namespace 4chan-X

View File

@ -1,7 +1,7 @@
// Generated by CoffeeScript // Generated by CoffeeScript
// ==UserScript== // ==UserScript==
// @name 4chan X beta // @name 4chan X beta
// @version 1.10.9.2 // @version 1.10.9.3
// @minGMVer 1.14 // @minGMVer 1.14
// @minFFVer 26 // @minFFVer 26
// @namespace 4chan-X // @namespace 4chan-X
@ -397,7 +397,7 @@
doc = d.documentElement; doc = d.documentElement;
g = { g = {
VERSION: '1.10.9.2', VERSION: '1.10.9.3',
NAMESPACE: '4chan X.', NAMESPACE: '4chan X.',
boards: {} boards: {}
}; };
@ -11698,11 +11698,10 @@
}); });
}, },
report: function() { report: function() {
var height, id, set, url; var id, set, url;
url = ReportLink.url; url = ReportLink.url;
id = Date.now(); id = Date.now();
height = d.cookie.indexOf('pass_enabled=1') >= 0 ? 200 : 675; set = "toolbar=0,scrollbars=1,location=0,status=1,menubar=0,resizable=1,width=685,height=200";
set = "toolbar=0,scrollbars=1,location=0,status=1,menubar=0,resizable=1,width=685,height=" + height;
return window.open(url, id, set); return window.open(url, id, set);
} }
}; };
@ -15228,33 +15227,57 @@
Report = { Report = {
init: function() { init: function() {
var match, postID; var match;
if (!(Conf['Archive Report'] && /\bmode=report\b/.test(location.search))) { if (!(/\bmode=report\b/.test(location.search) && (match = location.search.match(/\bno=(\d+)/)))) {
return; return;
} }
if (!(match = location.search.match(/\bno=(\d+)/))) { this.postID = +match[1];
return; return $.ready(this.ready);
}
postID = +match[1];
Redirect.init();
if (this.archive = Redirect.to('report', {
boardID: g.BOARD.ID,
postID: postID
})) {
return $.ready(this.ready);
}
}, },
ready: function() { ready: function() {
var link, message; new MutationObserver(Report.resize).observe(d.body, {
childList: true,
attributes: true,
subtree: true
});
if (Conf['Archive Report']) {
return Report.archive();
}
},
resize: function() {
var bubble, dy;
if (!(bubble = $('.gc-bubbleDefault'))) {
return;
}
dy = bubble.getBoundingClientRect().bottom - doc.clientHeight;
if (dy > 0) {
return window.resizeBy(0, dy);
}
},
archive: function() {
var link, message, url;
Redirect.init();
if (!(url = Redirect.to('report', {
boardID: g.BOARD.ID,
postID: Report.postID
}))) {
return;
}
if ((message = $('h3')) && /Report submitted!/.test(message.textContent)) { if ((message = $('h3')) && /Report submitted!/.test(message.textContent)) {
$.globalEval('self.close = function(){};'); $.globalEval('self.close = function(){};');
location.replace(Report.archive); window.resizeTo(685, 320);
location.replace(url);
return; return;
} }
link = $.el('a', { link = $.el('a', {
href: Report.archive, href: url,
textContent: 'Report to fgts' textContent: 'Report to fgts'
}); });
$.on(link, 'click', function(e) {
if (!(e.shiftKey || e.altKey || e.ctrlKey || e.metaKey || e.button !== 0)) {
return window.resizeTo(685, 320);
}
});
return $.add(d.body, [$.tn(' ['), link, $.tn(']')]); return $.add(d.body, [$.tn(' ['), link, $.tn(']')]);
} }
}; };

Binary file not shown.

View File

@ -1,7 +1,7 @@
// Generated by CoffeeScript // Generated by CoffeeScript
// ==UserScript== // ==UserScript==
// @name 4chan X // @name 4chan X
// @version 1.10.9.2 // @version 1.10.9.3
// @minGMVer 1.14 // @minGMVer 1.14
// @minFFVer 26 // @minFFVer 26
// @namespace 4chan-X // @namespace 4chan-X
@ -396,7 +396,7 @@
doc = d.documentElement; doc = d.documentElement;
g = { g = {
VERSION: '1.10.9.2', VERSION: '1.10.9.3',
NAMESPACE: '4chan X.', NAMESPACE: '4chan X.',
boards: {} boards: {}
}; };
@ -11697,11 +11697,10 @@
}); });
}, },
report: function() { report: function() {
var height, id, set, url; var id, set, url;
url = ReportLink.url; url = ReportLink.url;
id = Date.now(); id = Date.now();
height = d.cookie.indexOf('pass_enabled=1') >= 0 ? 200 : 675; set = "toolbar=0,scrollbars=1,location=0,status=1,menubar=0,resizable=1,width=685,height=200";
set = "toolbar=0,scrollbars=1,location=0,status=1,menubar=0,resizable=1,width=685,height=" + height;
return window.open(url, id, set); return window.open(url, id, set);
} }
}; };
@ -15227,33 +15226,57 @@
Report = { Report = {
init: function() { init: function() {
var match, postID; var match;
if (!(Conf['Archive Report'] && /\bmode=report\b/.test(location.search))) { if (!(/\bmode=report\b/.test(location.search) && (match = location.search.match(/\bno=(\d+)/)))) {
return; return;
} }
if (!(match = location.search.match(/\bno=(\d+)/))) { this.postID = +match[1];
return; return $.ready(this.ready);
}
postID = +match[1];
Redirect.init();
if (this.archive = Redirect.to('report', {
boardID: g.BOARD.ID,
postID: postID
})) {
return $.ready(this.ready);
}
}, },
ready: function() { ready: function() {
var link, message; new MutationObserver(Report.resize).observe(d.body, {
childList: true,
attributes: true,
subtree: true
});
if (Conf['Archive Report']) {
return Report.archive();
}
},
resize: function() {
var bubble, dy;
if (!(bubble = $('.gc-bubbleDefault'))) {
return;
}
dy = bubble.getBoundingClientRect().bottom - doc.clientHeight;
if (dy > 0) {
return window.resizeBy(0, dy);
}
},
archive: function() {
var link, message, url;
Redirect.init();
if (!(url = Redirect.to('report', {
boardID: g.BOARD.ID,
postID: Report.postID
}))) {
return;
}
if ((message = $('h3')) && /Report submitted!/.test(message.textContent)) { if ((message = $('h3')) && /Report submitted!/.test(message.textContent)) {
$.globalEval('self.close = function(){};'); $.globalEval('self.close = function(){};');
location.replace(Report.archive); window.resizeTo(685, 320);
location.replace(url);
return; return;
} }
link = $.el('a', { link = $.el('a', {
href: Report.archive, href: url,
textContent: 'Report to fgts' textContent: 'Report to fgts'
}); });
$.on(link, 'click', function(e) {
if (!(e.shiftKey || e.altKey || e.ctrlKey || e.metaKey || e.button !== 0)) {
return window.resizeTo(685, 320);
}
});
return $.add(d.body, [$.tn(' ['), link, $.tn(']')]); return $.add(d.body, [$.tn(' ['), link, $.tn(']')]);
} }
}; };

Binary file not shown.

View File

@ -1,6 +1,6 @@
// ==UserScript== // ==UserScript==
// @name 4chan X // @name 4chan X
// @version 1.10.9.2 // @version 1.10.9.3
// @minGMVer 1.14 // @minGMVer 1.14
// @minFFVer 26 // @minFFVer 26
// @namespace 4chan-X // @namespace 4chan-X

View File

@ -1,7 +1,7 @@
// Generated by CoffeeScript // Generated by CoffeeScript
// ==UserScript== // ==UserScript==
// @name 4chan X // @name 4chan X
// @version 1.10.9.2 // @version 1.10.9.3
// @minGMVer 1.14 // @minGMVer 1.14
// @minFFVer 26 // @minFFVer 26
// @namespace 4chan-X // @namespace 4chan-X
@ -397,7 +397,7 @@
doc = d.documentElement; doc = d.documentElement;
g = { g = {
VERSION: '1.10.9.2', VERSION: '1.10.9.3',
NAMESPACE: '4chan X.', NAMESPACE: '4chan X.',
boards: {} boards: {}
}; };
@ -11698,11 +11698,10 @@
}); });
}, },
report: function() { report: function() {
var height, id, set, url; var id, set, url;
url = ReportLink.url; url = ReportLink.url;
id = Date.now(); id = Date.now();
height = d.cookie.indexOf('pass_enabled=1') >= 0 ? 200 : 675; set = "toolbar=0,scrollbars=1,location=0,status=1,menubar=0,resizable=1,width=685,height=200";
set = "toolbar=0,scrollbars=1,location=0,status=1,menubar=0,resizable=1,width=685,height=" + height;
return window.open(url, id, set); return window.open(url, id, set);
} }
}; };
@ -15228,33 +15227,57 @@
Report = { Report = {
init: function() { init: function() {
var match, postID; var match;
if (!(Conf['Archive Report'] && /\bmode=report\b/.test(location.search))) { if (!(/\bmode=report\b/.test(location.search) && (match = location.search.match(/\bno=(\d+)/)))) {
return; return;
} }
if (!(match = location.search.match(/\bno=(\d+)/))) { this.postID = +match[1];
return; return $.ready(this.ready);
}
postID = +match[1];
Redirect.init();
if (this.archive = Redirect.to('report', {
boardID: g.BOARD.ID,
postID: postID
})) {
return $.ready(this.ready);
}
}, },
ready: function() { ready: function() {
var link, message; new MutationObserver(Report.resize).observe(d.body, {
childList: true,
attributes: true,
subtree: true
});
if (Conf['Archive Report']) {
return Report.archive();
}
},
resize: function() {
var bubble, dy;
if (!(bubble = $('.gc-bubbleDefault'))) {
return;
}
dy = bubble.getBoundingClientRect().bottom - doc.clientHeight;
if (dy > 0) {
return window.resizeBy(0, dy);
}
},
archive: function() {
var link, message, url;
Redirect.init();
if (!(url = Redirect.to('report', {
boardID: g.BOARD.ID,
postID: Report.postID
}))) {
return;
}
if ((message = $('h3')) && /Report submitted!/.test(message.textContent)) { if ((message = $('h3')) && /Report submitted!/.test(message.textContent)) {
$.globalEval('self.close = function(){};'); $.globalEval('self.close = function(){};');
location.replace(Report.archive); window.resizeTo(685, 320);
location.replace(url);
return; return;
} }
link = $.el('a', { link = $.el('a', {
href: Report.archive, href: url,
textContent: 'Report to fgts' textContent: 'Report to fgts'
}); });
$.on(link, 'click', function(e) {
if (!(e.shiftKey || e.altKey || e.ctrlKey || e.metaKey || e.button !== 0)) {
return window.resizeTo(685, 320);
}
});
return $.add(d.body, [$.tn(' ['), link, $.tn(']')]); return $.add(d.body, [$.tn(' ['), link, $.tn(']')]);
} }
}; };

Binary file not shown.

View File

@ -1,7 +1,7 @@
<?xml version='1.0' encoding='UTF-8'?> <?xml version='1.0' encoding='UTF-8'?>
<gupdate xmlns='http://www.google.com/update2/response' protocol='2.0'> <gupdate xmlns='http://www.google.com/update2/response' protocol='2.0'>
<app appid='lacclbnghgdicfifcamcmcnilckjamag'> <app appid='lacclbnghgdicfifcamcmcnilckjamag'>
<updatecheck codebase='https://ccd0.github.io/4chan-x/builds/4chan-X-beta.crx' version='1.10.9.2' /> <updatecheck codebase='https://ccd0.github.io/4chan-x/builds/4chan-X-beta.crx' version='1.10.9.3' />
</app> </app>
</gupdate> </gupdate>

View File

@ -1,7 +1,7 @@
<?xml version='1.0' encoding='UTF-8'?> <?xml version='1.0' encoding='UTF-8'?>
<gupdate xmlns='http://www.google.com/update2/response' protocol='2.0'> <gupdate xmlns='http://www.google.com/update2/response' protocol='2.0'>
<app appid='lacclbnghgdicfifcamcmcnilckjamag'> <app appid='lacclbnghgdicfifcamcmcnilckjamag'>
<updatecheck codebase='https://ccd0.github.io/4chan-x/builds/4chan-X.crx' version='1.10.9.2' /> <updatecheck codebase='https://ccd0.github.io/4chan-x/builds/4chan-X.crx' version='1.10.9.3' />
</app> </app>
</gupdate> </gupdate>

View File

@ -3,8 +3,8 @@
"description": "Cross-browser userscript for maximum lurking on 4chan.", "description": "Cross-browser userscript for maximum lurking on 4chan.",
"meta": { "meta": {
"name": "4chan X", "name": "4chan X",
"version": "1.10.9.2", "version": "1.10.9.3",
"date": "2015-04-16T23:44:25.631Z", "date": "2015-04-18T03:10:25.048Z",
"repo": "https://github.com/ccd0/4chan-x/", "repo": "https://github.com/ccd0/4chan-x/",
"page": "https://github.com/ccd0/4chan-x", "page": "https://github.com/ccd0/4chan-x",
"downloads": "https://ccd0.github.io/4chan-x/builds/", "downloads": "https://ccd0.github.io/4chan-x/builds/",

View File

@ -20,6 +20,5 @@ ReportLink =
report: -> report: ->
{url} = ReportLink {url} = ReportLink
id = Date.now() id = Date.now()
height = if d.cookie.indexOf('pass_enabled=1') >= 0 then 200 else 675 set = "toolbar=0,scrollbars=1,location=0,status=1,menubar=0,resizable=1,width=685,height=200"
set = "toolbar=0,scrollbars=1,location=0,status=1,menubar=0,resizable=1,width=685,height=#{height}"
window.open url, id, set window.open url, id, set

View File

@ -1,18 +1,34 @@
Report = Report =
init: -> init: ->
return unless Conf['Archive Report'] and /\bmode=report\b/.test(location.search) return unless /\bmode=report\b/.test(location.search) and match = location.search.match /\bno=(\d+)/
return unless match = location.search.match /\bno=(\d+)/ @postID = +match[1]
postID = +match[1] $.ready @ready
Redirect.init()
if @archive = Redirect.to 'report', {boardID: g.BOARD.ID, postID}
$.ready @ready
ready: -> ready: ->
new MutationObserver(Report.resize).observe d.body,
childList: true
attributes: true
subtree: true
Report.archive() if Conf['Archive Report']
resize: ->
return unless bubble = $ '.gc-bubbleDefault'
dy = bubble.getBoundingClientRect().bottom - doc.clientHeight
window.resizeBy 0, dy if dy > 0
archive: ->
Redirect.init()
return unless url = Redirect.to 'report', {boardID: g.BOARD.ID, postID: Report.postID}
if (message = $ 'h3') and /Report submitted!/.test(message.textContent) if (message = $ 'h3') and /Report submitted!/.test(message.textContent)
$.globalEval 'self.close = function(){};' $.globalEval 'self.close = function(){};'
location.replace Report.archive window.resizeTo 685, 320
location.replace url
return return
link = $.el 'a', link = $.el 'a',
href: Report.archive href: url
textContent: 'Report to fgts' textContent: 'Report to fgts'
$.on link, 'click', (e) ->
unless e.shiftKey or e.altKey or e.ctrlKey or e.metaKey or e.button isnt 0
window.resizeTo 685, 320
$.add d.body, [$.tn(' ['), link, $.tn(']')] $.add d.body, [$.tn(' ['), link, $.tn(']')]