Merge branch 'master' into getarchivedquotes

This commit is contained in:
Nicolas Stepien 2012-06-16 18:00:48 +02:00
commit 0b4cfe7009
2 changed files with 155 additions and 75 deletions

View File

@ -2227,7 +2227,7 @@
}
},
dialog: function() {
var arr, back, checked, description, dialog, favicon, fileInfo, hiddenNum, hiddenThreads, indicator, indicators, input, key, li, obj, overlay, ta, time, tr, ul, _i, _j, _len, _len1, _ref, _ref1, _ref2, _ref3;
var arr, back, checked, description, dialog, favicon, fileInfo, filter, hiddenNum, hiddenThreads, indicator, indicators, input, key, li, obj, overlay, sauce, time, tr, ul, _i, _len, _ref, _ref1, _ref2;
dialog = $.el('div', {
id: 'options',
className: 'reply dialog',
@ -2260,32 +2260,25 @@
<li>$3: MD5 hash.</li>\
<li>$4: Current board.</li>\
</ul>\
<textarea name=sauces id=sauces></textarea>\
<textarea name=sauces id=sauces class=field></textarea>\
</div>\
<input type=radio name=tab hidden id=filter_tab>\
<div>\
<div class=warning><code>Filter</code> is disabled.</div>\
Use <a href=https://developer.mozilla.org/en/JavaScript/Guide/Regular_Expressions>regular expressions</a>, one per line.<br>\
Lines starting with a <code>#</code> will be ignored.<br>\
For example, <code>/weeaboo/i</code> will filter posts containing `weeaboo` case-insensitive.\
<ul>You can use these settings with each regular expression, separate them with semicolons:\
<li>Per boards, separate them with commas. It is global if not specified.<br>For example: <code>boards:a,jp;</code>.</li>\
<li>Filter OPs only along with their threads (`only`), replies only (`no`, this is default), or both (`yes`).<br>For example: <code>op:only;</code>, <code>op:no;</code> or <code>op:yes;</code>.</li>\
<li>Overrule the `Show Stubs` setting if specified: create a stub (`yes`) or not (`no`).<br>For example: <code>stub:yes;</code> or <code>stub:no;</code></li>\
<li>Highlight instead of hiding. You can specify a class name to use with a userstyle.<br>For example: <code>highlight;</code> or <code>highlight:wallpaper;</code>.</li>\
<li>Highlighted OPs will have their threads put on top of board pages by default.<br>For example: <code>top:yes</code> or <code>top:no</code>.</li>\
</ul>\
<p>Name:<br><textarea name=name></textarea></p>\
<p>Unique ID:<br><textarea name=uniqueid></textarea></p>\
<p>Tripcode:<br><textarea name=tripcode></textarea></p>\
<p>Admin/Mod:<br><textarea name=mod></textarea></p>\
<p>E-mail:<br><textarea name=email></textarea></p>\
<p>Subject:<br><textarea name=subject></textarea></p>\
<p>Comment:<br><textarea name=comment></textarea></p>\
<p>Filename:<br><textarea name=filename></textarea></p>\
<p>Image dimensions:<br><textarea name=dimensions></textarea></p>\
<p>Filesize:<br><textarea name=filesize></textarea></p>\
<p>Image MD5 (uses exact string matching, not regular expressions):<br><textarea name=md5></textarea></p>\
<select name=filter>\
<option value=guide>Guide</option>\
<option value=name>Name</option>\
<option value=uniqueid>Unique ID</option>\
<option value=tripcode>Tripcode</option>\
<option value=mod>Admin/Mod</option>\
<option value=email>E-mail</option>\
<option value=subject>Subject</option>\
<option value=comment>Comment</option>\
<option value=filename>Filename</option>\
<option value=dimensions>Image dimensions</option>\
<option value=filesize>Filesize</option>\
<option value=md5>Image MD5 (uses exact string matching, not regular expressions)</option>\
</select>\
</div>\
<input type=radio name=tab hidden id=rice_tab>\
<div>\
@ -2361,13 +2354,11 @@
});
$.on($('button', li), 'click', Options.clearHidden);
$.add($('ul:nth-child(2)', dialog), li);
_ref1 = $$('textarea', dialog);
for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
ta = _ref1[_i];
ta.textContent = $.get(ta.name, Conf[ta.name]);
ta.className = 'field';
$.on(ta, 'change', $.cb.value);
}
filter = $('select[name=filter]', dialog);
$.on(filter, 'change', Options.filter);
sauce = $('#sauces', dialog);
sauce.value = $.get(sauce.name, Conf[sauce.name]);
$.on(sauce, 'change', $.cb.value);
(back = $('[name=backlink]', dialog)).value = $.get('backlink', Conf['backlink']);
(time = $('[name=time]', dialog)).value = $.get('time', Conf['time']);
(fileInfo = $('[name=fileInfo]', dialog)).value = $.get('fileInfo', Conf['fileInfo']);
@ -2377,13 +2368,13 @@
$.on(time, 'input', Options.time);
$.on(fileInfo, 'input', $.cb.value);
$.on(fileInfo, 'input', Options.fileInfo);
favicon = $('select', dialog);
favicon = $('select[name=favicon]', dialog);
favicon.value = $.get('favicon', Conf['favicon']);
$.on(favicon, 'change', $.cb.value);
$.on(favicon, 'change', Options.favicon);
_ref2 = Config.hotkeys;
for (key in _ref2) {
arr = _ref2[key];
_ref1 = Config.hotkeys;
for (key in _ref1) {
arr = _ref1[key];
tr = $.el('tr', {
innerHTML: "<td>" + arr[1] + "</td><td><input name=" + key + " class=field></td>"
});
@ -2393,9 +2384,9 @@
$.add($('#keybinds_tab + div tbody', dialog), tr);
}
indicators = {};
_ref3 = $$('.warning', dialog);
for (_j = 0, _len1 = _ref3.length; _j < _len1; _j++) {
indicator = _ref3[_j];
_ref2 = $$('.warning', dialog);
for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
indicator = _ref2[_i];
key = indicator.firstChild.textContent;
indicator.hidden = $.get(key, Conf[key]);
indicators[key] = indicator;
@ -2414,6 +2405,7 @@
$.add(d.body, overlay);
d.body.style.setProperty('width', "" + d.body.clientWidth + "px", null);
$.addClass(d.body, 'unscroll');
Options.filter.call(filter);
Options.backlink.call(back);
Options.time.call(time);
Options.fileInfo.call(fileInfo);
@ -2443,6 +2435,50 @@
this.value = key;
return $.cb.value.call(this);
},
filter: function() {
var el, name, ta;
el = this.nextSibling;
if ((name = this.value) !== 'guide') {
ta = $.el('textarea', {
name: name,
className: 'field',
value: $.get(name, Conf[name])
});
$.on(ta, 'change', $.cb.value);
$.replace(el, ta);
return;
}
if (el) {
$.rm(el);
}
return $.after(this, $.el('article', {
innerHTML: '<p>Use <a href=https://developer.mozilla.org/en/JavaScript/Guide/Regular_Expressions>regular expressions</a>, one per line.<br>\
Lines starting with a <code>#</code> will be ignored.<br>\
For example, <code>/weeaboo/i</code> will filter posts containing the string `<code>weeaboo</code>`, case-insensitive.</p>\
<ul>You can use these settings with each regular expression, separate them with semicolons:\
<li>\
Per boards, separate them with commas. It is global if not specified.<br>\
For example: <code>boards:a,jp;</code>.\
</li>\
<li>\
Filter OPs only along with their threads (`only`), replies only (`no`, this is default), or both (`yes`).<br>\
For example: <code>op:only;</code>, <code>op:no;</code> or <code>op:yes;</code>.\
</li>\
<li>\
Overrule the `Show Stubs` setting if specified: create a stub (`yes`) or not (`no`).<br>\
For example: <code>stub:yes;</code> or <code>stub:no;</code>\
</li>\
<li>\
Highlight instead of hiding. You can specify a class name to use with a userstyle.<br>\
For example: <code>highlight;</code> or <code>highlight:wallpaper;</code>.\
</li>\
<li>\
Highlighted OPs will have their threads put on top of board pages by default.<br>\
For example: <code>top:yes;</code> or <code>top:no;</code>.\
</li>\
</ul>'
}));
},
time: function() {
Time.foo();
Time.date = new Date();
@ -4895,9 +4931,16 @@ body.unscroll {\
float: right;\
}\
#options ul {\
list-style: none;\
padding: 0;\
}\
#options article li {\
margin: 10px 0 10px 2em;\
}\
#options code {\
background: hsla(0, 0%, 100%, .5);\
color: #000;\
padding: 0 1px;\
}\
#options label {\
text-decoration: underline;\
}\
@ -4907,13 +4950,10 @@ body.unscroll {\
}\
#content textarea {\
font-family: monospace;\
min-height: 100px;\
min-height: 350px;\
resize: vertical;\
width: 100%;\
}\
#sauces {\
height: 300px;\
}\
\
#updater {\
text-align: right;\

View File

@ -1731,32 +1731,25 @@ Options =
<li>$3: MD5 hash.</li>
<li>$4: Current board.</li>
</ul>
<textarea name=sauces id=sauces></textarea>
<textarea name=sauces id=sauces class=field></textarea>
</div>
<input type=radio name=tab hidden id=filter_tab>
<div>
<div class=warning><code>Filter</code> is disabled.</div>
Use <a href=https://developer.mozilla.org/en/JavaScript/Guide/Regular_Expressions>regular expressions</a>, one per line.<br>
Lines starting with a <code>#</code> will be ignored.<br>
For example, <code>/weeaboo/i</code> will filter posts containing `weeaboo` case-insensitive.
<ul>You can use these settings with each regular expression, separate them with semicolons:
<li>Per boards, separate them with commas. It is global if not specified.<br>For example: <code>boards:a,jp;</code>.</li>
<li>Filter OPs only along with their threads (`only`), replies only (`no`, this is default), or both (`yes`).<br>For example: <code>op:only;</code>, <code>op:no;</code> or <code>op:yes;</code>.</li>
<li>Overrule the `Show Stubs` setting if specified: create a stub (`yes`) or not (`no`).<br>For example: <code>stub:yes;</code> or <code>stub:no;</code></li>
<li>Highlight instead of hiding. You can specify a class name to use with a userstyle.<br>For example: <code>highlight;</code> or <code>highlight:wallpaper;</code>.</li>
<li>Highlighted OPs will have their threads put on top of board pages by default.<br>For example: <code>top:yes</code> or <code>top:no</code>.</li>
</ul>
<p>Name:<br><textarea name=name></textarea></p>
<p>Unique ID:<br><textarea name=uniqueid></textarea></p>
<p>Tripcode:<br><textarea name=tripcode></textarea></p>
<p>Admin/Mod:<br><textarea name=mod></textarea></p>
<p>E-mail:<br><textarea name=email></textarea></p>
<p>Subject:<br><textarea name=subject></textarea></p>
<p>Comment:<br><textarea name=comment></textarea></p>
<p>Filename:<br><textarea name=filename></textarea></p>
<p>Image dimensions:<br><textarea name=dimensions></textarea></p>
<p>Filesize:<br><textarea name=filesize></textarea></p>
<p>Image MD5 (uses exact string matching, not regular expressions):<br><textarea name=md5></textarea></p>
<select name=filter>
<option value=guide>Guide</option>
<option value=name>Name</option>
<option value=uniqueid>Unique ID</option>
<option value=tripcode>Tripcode</option>
<option value=mod>Admin/Mod</option>
<option value=email>E-mail</option>
<option value=subject>Subject</option>
<option value=comment>Comment</option>
<option value=filename>Filename</option>
<option value=dimensions>Image dimensions</option>
<option value=filesize>Filesize</option>
<option value=md5>Image MD5 (uses exact string matching, not regular expressions)</option>
</select>
</div>
<input type=radio name=tab hidden id=rice_tab>
<div>
@ -1827,11 +1820,14 @@ Options =
$.on $('button', li), 'click', Options.clearHidden
$.add $('ul:nth-child(2)', dialog), li
#filter & sauce
for ta in $$ 'textarea', dialog
ta.textContent = $.get ta.name, Conf[ta.name]
ta.className = 'field'
$.on ta, 'change', $.cb.value
#filter
filter = $ 'select[name=filter]', dialog
$.on filter, 'change', Options.filter
#sauce
sauce = $ '#sauces', dialog
sauce.value = $.get sauce.name, Conf[sauce.name]
$.on sauce, 'change', $.cb.value
#rice
(back = $ '[name=backlink]', dialog).value = $.get 'backlink', Conf['backlink']
@ -1843,7 +1839,7 @@ Options =
$.on time, 'input', Options.time
$.on fileInfo, 'input', $.cb.value
$.on fileInfo, 'input', Options.fileInfo
favicon = $ 'select', dialog
favicon = $ 'select[name=favicon]', dialog
favicon.value = $.get 'favicon', Conf['favicon']
$.on favicon, 'change', $.cb.value
$.on favicon, 'change', Options.favicon
@ -1874,6 +1870,7 @@ Options =
d.body.style.setProperty 'width', "#{d.body.clientWidth}px", null
$.addClass d.body, 'unscroll'
Options.filter.call filter
Options.backlink.call back
Options.time.call time
Options.fileInfo.call fileInfo
@ -1898,6 +1895,45 @@ Options =
return unless (key = Keybinds.keyCode e)?
@value = key
$.cb.value.call @
filter: ->
el = @nextSibling
if (name = @value) isnt 'guide'
ta = $.el 'textarea',
name: name
className: 'field'
value: $.get name, Conf[name]
$.on ta, 'change', $.cb.value
$.replace el, ta
return
$.rm el if el
$.after @, $.el 'article',
innerHTML: '<p>Use <a href=https://developer.mozilla.org/en/JavaScript/Guide/Regular_Expressions>regular expressions</a>, one per line.<br>
Lines starting with a <code>#</code> will be ignored.<br>
For example, <code>/weeaboo/i</code> will filter posts containing the string `<code>weeaboo</code>`, case-insensitive.</p>
<ul>You can use these settings with each regular expression, separate them with semicolons:
<li>
Per boards, separate them with commas. It is global if not specified.<br>
For example: <code>boards:a,jp;</code>.
</li>
<li>
Filter OPs only along with their threads (`only`), replies only (`no`, this is default), or both (`yes`).<br>
For example: <code>op:only;</code>, <code>op:no;</code> or <code>op:yes;</code>.
</li>
<li>
Overrule the `Show Stubs` setting if specified: create a stub (`yes`) or not (`no`).<br>
For example: <code>stub:yes;</code> or <code>stub:no;</code>
</li>
<li>
Highlight instead of hiding. You can specify a class name to use with a userstyle.<br>
For example: <code>highlight;</code> or <code>highlight:wallpaper;</code>.
</li>
<li>
Highlighted OPs will have their threads put on top of board pages by default.<br>
For example: <code>top:yes;</code> or <code>top:no;</code>.
</li>
</ul>'
time: ->
Time.foo()
Time.date = new Date()
@ -3846,9 +3882,16 @@ body.unscroll {
float: right;
}
#options ul {
list-style: none;
padding: 0;
}
#options article li {
margin: 10px 0 10px 2em;
}
#options code {
background: hsla(0, 0%, 100%, .5);
color: #000;
padding: 0 1px;
}
#options label {
text-decoration: underline;
}
@ -3858,13 +3901,10 @@ body.unscroll {
}
#content textarea {
font-family: monospace;
min-height: 100px;
min-height: 350px;
resize: vertical;
width: 100%;
}
#sauces {
height: 300px;
}
#updater {
text-align: right;