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
// @namespace aeosynth
// @description Adds various features.
// @version 2.2.1
// @version 2.2.2
// @copyright 2009-2011 James Campos <james.r.campos@gmail.com>
// @license MIT; http://en.wikipedia.org/wiki/Mit_license
// @include http://boards.4chan.org/*
// @include http://sys.4chan.org/*
// @include file://*
// @updateURL http://userscripts.org/scripts/source/51412.meta.js
// ==/UserScript==
@ -387,10 +388,12 @@
if (typeof GM_deleteValue !== "undefined" && GM_deleteValue !== null) {
$.extend($, {
deleteValue: function(name) {
name = NAMESPACE + name;
return GM_deleteValue(name);
},
getValue: function(name, defaultValue) {
var value;
name = NAMESPACE + name;
if (value = GM_getValue(name)) {
return JSON.parse(value);
} else {
@ -401,6 +404,7 @@
return GM_openInTab(url);
},
setValue: function(name, value) {
name = NAMESPACE + name;
return GM_setValue(name, JSON.stringify(value));
}
});
@ -1138,13 +1142,18 @@
},
dialog: function(link) {
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', {
top: '0px',
left: '0px'
}, html);
el = $('input[title=autohide]', dialog);
$.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);
_ref = $$('script', clone);
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
@ -2287,11 +2296,19 @@
#qr > div.move {\
text-align: right;\
}\
#qr > form > div, /* ad */\
#qr #recaptcha_table td:nth-of-type(3), /* captcha logos */\
#qr td.rules {\
#qr #recaptcha_table td:nth-of-type(3) {/* captcha logos */\
display: none;\
}\
#qr textarea {\
width: 300px;\
height: 100px;\
}\
#qr form {\
margin: 0px;\
}\
#qr * {\
padding: 0px !important;\
}\
#qr.auto:not(:hover) form {\
display: none;\
}\

View File

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

3
header
View File

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

View File

@ -264,8 +264,10 @@ $.extend $,
if GM_deleteValue?
$.extend $,
deleteValue: (name) ->
name = NAMESPACE + name
GM_deleteValue name
getValue: (name, defaultValue) ->
name = NAMESPACE + name
if value = GM_getValue name
JSON.parse value
else
@ -273,6 +275,7 @@ if GM_deleteValue?
openInTab: (url) ->
GM_openInTab url
setValue: (name, value) ->
name = NAMESPACE + name
GM_setValue name, JSON.stringify value
else
$.extend $,
@ -872,11 +875,29 @@ qr =
clearInterval qr.cooldownIntervalID
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
el = $ 'input[title=autohide]', dialog
$.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)
for script in $$ 'script', clone
$.remove script
@ -934,6 +955,7 @@ threading =
# don't thread image controls
node = $ 'form[name=delform] > *:not([id])'
# don't confuse other scripts *cough*/b/ackwash*cough*
# gotta have a named function to unbind.
$.bind d, 'DOMNodeInserted', threading.stopPropagation
threading.thread node
$.unbind d, 'DOMNodeInserted', threading.stopPropagation
@ -1228,6 +1250,8 @@ watcher =
watch: (thread) ->
favicon = $ 'img.favicon', thread
#this happens if we try to auto-watch an already watched thread.
return if favicon.src is Favicon.default
favicon.src = Favicon.default
@ -1785,11 +1809,19 @@ main =
#qr > div.move {
text-align: right;
}
#qr > form > div, /* ad */
#qr #recaptcha_table td:nth-of-type(3), /* captcha logos */
#qr td.rules {
#qr #recaptcha_table td:nth-of-type(3) {/* captcha logos */
display: none;
}
#qr textarea {
width: 300px;
height: 100px;
}
#qr form {
margin: 0px;
}
#qr * {
padding: 0px !important;
}
#qr.auto:not(:hover) form {
display: none;
}