Merge branch 'dev' of git://github.com/aeosynth/4chan-x into dev

This commit is contained in:
Nicolas Stepien 2011-05-04 20:19:51 +02:00
commit f32271208f
4 changed files with 63 additions and 10 deletions

View File

@ -2,11 +2,12 @@
// @name 4chan x // @name 4chan x
// @namespace aeosynth // @namespace aeosynth
// @description Adds various features. // @description Adds various features.
// @version 2.2.1 // @version 2.2.2
// @copyright 2009-2011 James Campos <james.r.campos@gmail.com> // @copyright 2009-2011 James Campos <james.r.campos@gmail.com>
// @license MIT; http://en.wikipedia.org/wiki/Mit_license // @license MIT; http://en.wikipedia.org/wiki/Mit_license
// @include http://boards.4chan.org/* // @include http://boards.4chan.org/*
// @include http://sys.4chan.org/* // @include http://sys.4chan.org/*
// @include file://*
// @updateURL http://userscripts.org/scripts/source/51412.meta.js // @updateURL http://userscripts.org/scripts/source/51412.meta.js
// ==/UserScript== // ==/UserScript==
@ -387,10 +388,12 @@
if (typeof GM_deleteValue !== "undefined" && GM_deleteValue !== null) { if (typeof GM_deleteValue !== "undefined" && GM_deleteValue !== null) {
$.extend($, { $.extend($, {
deleteValue: function(name) { deleteValue: function(name) {
name = NAMESPACE + name;
return GM_deleteValue(name); return GM_deleteValue(name);
}, },
getValue: function(name, defaultValue) { getValue: function(name, defaultValue) {
var value; var value;
name = NAMESPACE + name;
if (value = GM_getValue(name)) { if (value = GM_getValue(name)) {
return JSON.parse(value); return JSON.parse(value);
} else { } else {
@ -401,6 +404,7 @@
return GM_openInTab(url); return GM_openInTab(url);
}, },
setValue: function(name, value) { setValue: function(name, value) {
name = NAMESPACE + name;
return GM_setValue(name, JSON.stringify(value)); return GM_setValue(name, JSON.stringify(value));
} }
}); });
@ -1138,13 +1142,18 @@
}, },
dialog: function(link) { dialog: function(link) {
var clone, dialog, el, html, resto, script, xpath, _i, _len, _ref; var clone, dialog, el, html, resto, script, xpath, _i, _len, _ref;
html = "<div class=move>Quick Reply <input type=checkbox title=autohide> <a name=close title=close>X</a></div>"; html = " <div class=move>Quick Reply <input type=checkbox title=autohide> <a name=close title=close>X</a></div> <form> <div><input name=name placeholder=name></div> <div><input name=email placeholder=email> <label><input type=checkbox>Spoiler Image?</label></div> <div><input name=sub placeholder=subject> <input value=submit type=submit></div> <div><textarea name=com placeholder=comment></textarea></div> <div id=qr_captcha></div> <div><input name=upfile type=file></div> <div><input name=pwd type=password maxlength=8 placeholder=password></div> </form> ";
dialog = ui.dialog('qr', { dialog = ui.dialog('qr', {
top: '0px', top: '0px',
left: '0px' left: '0px'
}, html); }, html);
el = $('input[title=autohide]', dialog); el = $('input[title=autohide]', dialog);
$.bind(el, 'click', qr.cb.autohide); $.bind(el, 'click', qr.cb.autohide);
clone = $('#recaptcha_widget_div').cloneNode(true);
$.append($('#qr_captcha', dialog), clone);
$('input[name=recaptcha_response_field]', clone).placeholder = 'verification';
$.append(d.body, dialog);
return;
clone = $('form[name=post]').cloneNode(true); clone = $('form[name=post]').cloneNode(true);
_ref = $$('script', clone); _ref = $$('script', clone);
for (_i = 0, _len = _ref.length; _i < _len; _i++) { for (_i = 0, _len = _ref.length; _i < _len; _i++) {
@ -2287,11 +2296,19 @@
#qr > div.move {\ #qr > div.move {\
text-align: right;\ text-align: right;\
}\ }\
#qr > form > div, /* ad */\ #qr #recaptcha_table td:nth-of-type(3) {/* captcha logos */\
#qr #recaptcha_table td:nth-of-type(3), /* captcha logos */\
#qr td.rules {\
display: none;\ display: none;\
}\ }\
#qr textarea {\
width: 300px;\
height: 100px;\
}\
#qr form {\
margin: 0px;\
}\
#qr * {\
padding: 0px !important;\
}\
#qr.auto:not(:hover) form {\ #qr.auto:not(:hover) form {\
display: none;\ display: none;\
}\ }\

View File

@ -1,3 +1,6 @@
2.2.2
- hopefully fix upgrading issues
2.2.1 2.2.1
- mayhem: - mayhem:
fix op image expansion bug fix op image expansion bug

3
header
View File

@ -2,11 +2,12 @@
// @name 4chan x // @name 4chan x
// @namespace aeosynth // @namespace aeosynth
// @description Adds various features. // @description Adds various features.
// @version 2.2.1 // @version 2.2.2
// @copyright 2009-2011 James Campos <james.r.campos@gmail.com> // @copyright 2009-2011 James Campos <james.r.campos@gmail.com>
// @license MIT; http://en.wikipedia.org/wiki/Mit_license // @license MIT; http://en.wikipedia.org/wiki/Mit_license
// @include http://boards.4chan.org/* // @include http://boards.4chan.org/*
// @include http://sys.4chan.org/* // @include http://sys.4chan.org/*
// @include file://*
// @updateURL http://userscripts.org/scripts/source/51412.meta.js // @updateURL http://userscripts.org/scripts/source/51412.meta.js
// ==/UserScript== // ==/UserScript==

View File

@ -264,8 +264,10 @@ $.extend $,
if GM_deleteValue? if GM_deleteValue?
$.extend $, $.extend $,
deleteValue: (name) -> deleteValue: (name) ->
name = NAMESPACE + name
GM_deleteValue name GM_deleteValue name
getValue: (name, defaultValue) -> getValue: (name, defaultValue) ->
name = NAMESPACE + name
if value = GM_getValue name if value = GM_getValue name
JSON.parse value JSON.parse value
else else
@ -273,6 +275,7 @@ if GM_deleteValue?
openInTab: (url) -> openInTab: (url) ->
GM_openInTab url GM_openInTab url
setValue: (name, value) -> setValue: (name, value) ->
name = NAMESPACE + name
GM_setValue name, JSON.stringify value GM_setValue name, JSON.stringify value
else else
$.extend $, $.extend $,
@ -872,11 +875,29 @@ qr =
clearInterval qr.cooldownIntervalID clearInterval qr.cooldownIntervalID
dialog: (link) -> dialog: (link) ->
html = "<div class=move>Quick Reply <input type=checkbox title=autohide> <a name=close title=close>X</a></div>" html = "
<div class=move>Quick Reply <input type=checkbox title=autohide> <a name=close title=close>X</a></div>
<form>
<div><input name=name placeholder=name></div>
<div><input name=email placeholder=email> <label><input type=checkbox>Spoiler Image?</label></div>
<div><input name=sub placeholder=subject> <input value=submit type=submit></div>
<div><textarea name=com placeholder=comment></textarea></div>
<div id=qr_captcha></div>
<div><input name=upfile type=file></div>
<div><input name=pwd type=password maxlength=8 placeholder=password></div>
</form>
"
dialog = ui.dialog 'qr', top: '0px', left: '0px', html dialog = ui.dialog 'qr', top: '0px', left: '0px', html
el = $ 'input[title=autohide]', dialog el = $ 'input[title=autohide]', dialog
$.bind el, 'click', qr.cb.autohide $.bind el, 'click', qr.cb.autohide
clone = $('#recaptcha_widget_div').cloneNode(true)
$.append $('#qr_captcha', dialog), clone
$('input[name=recaptcha_response_field]', clone).placeholder = 'verification'
$.append d.body, dialog
return
clone = $('form[name=post]').cloneNode(true) clone = $('form[name=post]').cloneNode(true)
for script in $$ 'script', clone for script in $$ 'script', clone
$.remove script $.remove script
@ -934,6 +955,7 @@ threading =
# don't thread image controls # don't thread image controls
node = $ 'form[name=delform] > *:not([id])' node = $ 'form[name=delform] > *:not([id])'
# don't confuse other scripts *cough*/b/ackwash*cough* # don't confuse other scripts *cough*/b/ackwash*cough*
# gotta have a named function to unbind.
$.bind d, 'DOMNodeInserted', threading.stopPropagation $.bind d, 'DOMNodeInserted', threading.stopPropagation
threading.thread node threading.thread node
$.unbind d, 'DOMNodeInserted', threading.stopPropagation $.unbind d, 'DOMNodeInserted', threading.stopPropagation
@ -1228,6 +1250,8 @@ watcher =
watch: (thread) -> watch: (thread) ->
favicon = $ 'img.favicon', thread favicon = $ 'img.favicon', thread
#this happens if we try to auto-watch an already watched thread.
return if favicon.src is Favicon.default return if favicon.src is Favicon.default
favicon.src = Favicon.default favicon.src = Favicon.default
@ -1785,11 +1809,19 @@ main =
#qr > div.move { #qr > div.move {
text-align: right; text-align: right;
} }
#qr > form > div, /* ad */ #qr #recaptcha_table td:nth-of-type(3) {/* captcha logos */
#qr #recaptcha_table td:nth-of-type(3), /* captcha logos */
#qr td.rules {
display: none; display: none;
} }
#qr textarea {
width: 300px;
height: 100px;
}
#qr form {
margin: 0px;
}
#qr * {
padding: 0px !important;
}
#qr.auto:not(:hover) form { #qr.auto:not(:hover) form {
display: none; display: none;
} }