*** Dollchan_Extension_Tools_(2010-06-10).user.js 2010-07-02 20:32:32.404562026 +0400
--- Dollchan_Extension_Tools_(2010-06-21).user.js 2010-06-29 10:29:10.897690330 +0400
***************
*** 3,9 ****
// copyright (C) 2084, Bender Bending Rodrguez
// ==UserScript==
// @name Dollchan Extension Tools
! // @version 2010-06-10
// @description Doing some extended profit for russian AIB
// @namespace http://freedollchan.org/scripts
// @include *0chan.ru*
--- 3,9 ----
// copyright (C) 2084, Bender Bending Rodrguez
// ==UserScript==
// @name Dollchan Extension Tools
! // @version 2010-06-21
// @description Doing some extended profit for russian AIB
// @namespace http://freedollchan.org/scripts
// @include *0chan.ru*
***************
*** 18,24 ****
(function() {
var defaultCfg = [
! 1, // 0 anti-wipe detectors
0, // 1 hide posts with sage
0, // 2 hide posts with theme
0, // 3 hide posts without text
--- 18,24 ----
(function() {
var defaultCfg = [
! 1, // 0 antiwipe detectors
0, // 1 hide posts with sage
0, // 2 hide posts with theme
0, // 3 hide posts without text
***************
*** 41,47 ****
2, // 20 2-ch captchas (0,1,2)
1, // 21 hide board rules
1, // 22 hide 'goto' field
! 1, // 23 expand imgs by click
1, // 24 expand shorted posts
1, // 25 hide scrollers in posts
1, // 26 >>links preview
--- 41,47 ----
2, // 20 2-ch captchas (0,1,2)
1, // 21 hide board rules
1, // 22 hide 'goto' field
! 2, // 23 expand images (0=no, 1=simple, 2=+preview)
1, // 24 expand shorted posts
1, // 25 hide scrollers in posts
1, // 26 >>links preview
***************
*** 59,65 ****
1, // 38 reply without reload (verify on submit)
1, // 39 open spoilers
1, // 40 hide password field
! 1 // 41 email field -> sage btn
],
Cfg = [],
--- 59,73 ----
1, // 38 reply without reload (verify on submit)
1, // 39 open spoilers
1, // 40 hide password field
! 1, // 41 email field -> sage btn
! // antiwipe:
! 1, // 42 Same lines
! 1, // 43 Same words
! 1, // 44 Specsymbols
! 1, // 45 Long columns
! 1, // 46 Long words
! 1, // 47 Numbers
! 1 // 48 CaSe/CAPS
],
Cfg = [],
***************
*** 386,392 ****
for(var i = 0; i < arr.length/4; i++)
if(arr[i*4] == key[0] && arr[i*4 + 1].split('/')[0] == key[1] && arr[i*4 + 2] == key[2])
arr.splice(i*4, 4);
! $del($up(node));
if(arr.length == 0) $id('favorities_div').firstChild.innerHTML = ' ...';
setStored('DESU_Favorities', arr.join('|'));
}
--- 394,400 ----
for(var i = 0; i < arr.length/4; i++)
if(arr[i*4] == key[0] && arr[i*4 + 1].split('/')[0] == key[1] && arr[i*4 + 2] == key[2])
arr.splice(i*4, 4);
! $del($up(node, 2));
if(arr.length == 0) $id('favorities_div').firstChild.innerHTML = ' ...';
setStored('DESU_Favorities', arr.join('|'));
}
***************
*** 407,416 ****
trBox = function(num, txt, fn, id) {
return $New('tr', [chkBox(num, fn, id), $txt(' ' + txt)]);
},
! optSel = function(id, arr, fn) {
for(var i = 0; i < arr.length; i++)
arr[i] = '';
! return $new('select', {'id': id, 'html': arr.join('')}, {'change': fn});
};
var postarea = $x('.//div[@class="postarea" or @align="center"]') || delform;
--- 415,426 ----
trBox = function(num, txt, fn, id) {
return $New('tr', [chkBox(num, fn, id), $txt(' ' + txt)]);
},
! optSel = function(id, arr, num, fn) {
for(var i = 0; i < arr.length; i++)
arr[i] = '';
! var x = $new('select', {'id': id, 'html': arr.join('')}, {'change': fn});
! x.selectedIndex = Cfg[num];
! return x;
};
var postarea = $x('.//div[@class="postarea" or @align="center"]') || delform;
***************
*** 438,444 ****
$append($x('.//tbody', tools), [
$new('tr', {'text': 'Dollchan Extension Tools', 'style': 'width:100%; text-align:center; font-weight:bold; font-family:sans-serif'}),
! trBox(0, '- '),
$if(!(ch.iich || ch.sib), trBox(1, ' sage ', toggleSage, 'sage_hider')),
$if(!ch.sib, trBox(2, ' ""', toggleTitle)),
trBox(3, ' ', toggleNotext, 'notext_hider'),
--- 448,473 ----
$append($x('.//tbody', tools), [
$new('tr', {'text': 'Dollchan Extension Tools', 'style': 'width:100%; text-align:center; font-weight:bold; font-family:sans-serif'}),
! $New('tr', [
! chkBox(0),
! $txt('- '),
! $new('span', {
! 'html': '[>>]',
! 'style': 'cursor:pointer'}, {
! 'click': function() {toggleDisp($id('antiwipecfg'))}})
! ]),
! $New('div', [
! trBox(42, 'Same lines'),
! trBox(43, 'Same words'),
! trBox(44, 'Specsymbols'),
! trBox(45, 'Long columns'),
! trBox(46, 'Long words'),
! trBox(47, 'Numbers'),
! trBox(48, 'CaSe/CAPS')
! ], {
! 'id': 'antiwipecfg',
! 'style': 'display:none; padding-left:15px'
! }),
$if(!(ch.iich || ch.sib), trBox(1, ' sage ', toggleSage, 'sage_hider')),
$if(!ch.sib, trBox(2, ' ""', toggleTitle)),
trBox(3, ' ', toggleNotext, 'notext_hider'),
***************
*** 474,480 ****
'cols': nav.Opera ? 47 : 41})
]),
$New('tr', [
! optSel('prochidden_sel', [' ', '', ''],
function() {processHidden(this.selectedIndex, Cfg[12])}),
$txt(' ')
]),
--- 503,509 ----
'cols': nav.Opera ? 47 : 41})
]),
$New('tr', [
! optSel('prochidden_sel', [' ', '', ''], 12,
function() {processHidden(this.selectedIndex, Cfg[12])}),
$txt(' ')
]),
***************
*** 483,489 ****
trBox(13, ' '),
$new('hr'),
$New('tr', [
! optSel('upload_sel', ['', ' ', ''],
function() {saveCfg(37, this.selectedIndex)}),
$txt(' *')
]),
--- 512,518 ----
trBox(13, ' '),
$new('hr'),
$New('tr', [
! optSel('upload_sel', ['', ' ', ''], 37,
function() {saveCfg(37, this.selectedIndex)}),
$txt(' *')
]),
***************
*** 499,505 ****
toggleCfg(7);
$each($X('.//span[@id="txt_btns"]'), function(div) {toggleDisp(div)});
}),
! $if(wk, trBox(23, ' *')),
$if(wk, trBox(24, ' *')),
$if(ch._2ch, trBox(25, ' ', function() {toggleCfg(25); scriptStyles()})),
trBox(6, ' ', function() {toggleCfg(6); scriptStyles()}),
--- 528,538 ----
toggleCfg(7);
$each($X('.//span[@id="txt_btns"]'), function(div) {toggleDisp(div)});
}),
! $if(wk, $New('tr', [
! optSel('imgexpand_sel', ['', '', ' '], 23,
! function() {saveCfg(23, this.selectedIndex)}),
! $txt(' ')
! ])),
$if(wk, trBox(24, ' *')),
$if(ch._2ch, trBox(25, ' ', function() {toggleCfg(25); scriptStyles()})),
trBox(6, ' ', function() {toggleCfg(6); scriptStyles()}),
***************
*** 537,549 ****
]),
$if(ch._2ch, $New('tr', [
$txt(' * '),
! optSel('capnum_sel', [0, 1, 2], function() {saveCfg(20, this.selectedIndex)})
])),
$new('hr'),
$New('tr', [
$new('span', {
'id': 'process_time',
! 'title': 'v.2010-06-10, storage: ' + (sav.GM ? 'greasemonkey' : (sav.local ? 'localstorage' : 'cookies')),
'style': 'font-style:italic; cursor:pointer'}, {
'click': function() {alert(timeLog)}}),
$new('input', {
--- 570,582 ----
]),
$if(ch._2ch, $New('tr', [
$txt(' * '),
! optSel('capnum_sel', [0, 1, 2], 20, function() {saveCfg(20, this.selectedIndex)})
])),
$new('hr'),
$New('tr', [
$new('span', {
'id': 'process_time',
! 'title': 'v.2010-06-21, storage: ' + (sav.GM ? 'greasemonkey' : (sav.local ? 'localstorage' : 'cookies')),
'style': 'font-style:italic; cursor:pointer'}, {
'click': function() {alert(timeLog)}}),
$new('input', {
***************
*** 553,561 ****
'click': function() {setDefaultCfg(); window.location.reload()}})
])
]);
- $id('upload_sel').selectedIndex = Cfg[37];
- $id('prochidden_sel').selectedIndex = Cfg[12];
- if(ch._2ch) $id('capnum_sel').selectedIndex = Cfg[20];
}
function hiddenPostsPreview() {
--- 586,591 ----
***************
*** 563,569 ****
$id('controls_div').style.display = 'none';
var div = $id('hiddenposts_div');
if(div.hasChildNodes()) {delChilds(div); return}
! div.innerHTML = '
'
var table = $x('.//tbody', div);
var clones = [], tcnt = 0, pcnt = 0;
forAll(function(post) {if(post.Vis == HIDE) {
--- 593,599 ----
$id('controls_div').style.display = 'none';
var div = $id('hiddenposts_div');
if(div.hasChildNodes()) {delChilds(div); return}
! div.innerHTML = '';
var table = $x('.//tbody', div);
var clones = [], tcnt = 0, pcnt = 0;
forAll(function(post) {if(post.Vis == HIDE) {
***************
*** 593,607 ****
}}(clone)
});
$append(table, [
! $if(!pp && tcnt == 0, $new('tr', {'html': ' :'})),
! $if(pp && pcnt == 0, $new('tr', {'html': ' :'})),
$New('tr', [clone, $if(!pp, $attr(post.cloneNode(true), {'class': 'reply', 'style': 'display:none'}))])
]);
if(!pp) {modPostDisp($next(clone), UNHIDE); tcnt++}
else pcnt++;
! refPrewiev(clone);
}});
! if(!table.hasChildNodes()) {table.innerHTML = ' ...'; return}
$append(table.insertRow(-1), [
$new('input', {
'type': 'button',
--- 623,637 ----
}}(clone)
});
$append(table, [
! $if(!pp && tcnt == 0, $new('tr', {'html': ' : | '})),
! $if(pp && pcnt == 0, $new('tr', {'html': ' : | '})),
$New('tr', [clone, $if(!pp, $attr(post.cloneNode(true), {'class': 'reply', 'style': 'display:none'}))])
]);
if(!pp) {modPostDisp($next(clone), UNHIDE); tcnt++}
else pcnt++;
! refPreview(clone);
}});
! if(!table.hasChildNodes()) {table.innerHTML = '| ... |
'; return}
$append(table.insertRow(-1), [
$new('input', {
'type': 'button',
***************
*** 634,657 ****
$id('controls_div').style.display = 'none';
var div = $id('favorities_div');
if(div.hasChildNodes()) {delChilds(div); return}
var data = getStored('DESU_Favorities');
! var table = $new('table', {'style': 'margin:5px 0px 5px 20px'});
! div.appendChild(table);
! if(!data) {table.innerHTML = ' ...'; return}
! else table.insertRow(-1).appendChild($new('b', {'text': ' :'}));
! table = table.firstChild;
var arr = data.split('|');
for(var i = 0; i < arr.length/4; i++) {
! var url = arr[i*4] + '/' + arr[i*4 + 1] + '/res/' + arr[i*4 + 2];
var title = arr[i*4 + 3];
if((!sav.cookie && title.length >= 70) || (sav.cookie && title.length >= 25)) title += '..';
! $append(table, [$new('tr', {
! 'class': 'reply',
! 'id': 'favnote_' + i,
! 'style': 'cursor:default',
! 'html': ' ' : '.xhtml">') + url + ' - ' + title})]);
! $event($x('.//tr[@id="favnote_' + i + '"]/span'), {'click': function() {removeFavorities($next(this))}});
}
}
/*-----------------------------Dropdown select menus-------------------------*/
--- 664,714 ----
$id('controls_div').style.display = 'none';
var div = $id('favorities_div');
if(div.hasChildNodes()) {delChilds(div); return}
+ div.innerHTML = '';
+ var table = $x('.//tbody', div);
var data = getStored('DESU_Favorities');
! if(!data) {table.innerHTML = '| ... |
'; return}
! else $append(table, [$new('tr', {'html': ' : | '})]);
var arr = data.split('|');
for(var i = 0; i < arr.length/4; i++) {
! var dm = arr[i*4];
! var b = arr[i*4 + 1];
! var tNum = arr[i*4 + 2];
var title = arr[i*4 + 3];
+ var url = dm + '/' + b + '/res/' + tNum;
if((!sav.cookie && title.length >= 70) || (sav.cookie && title.length >= 25)) title += '..';
! $append(table, [$New('tr', [
! $New('div', [
! $new('span', {
! 'class': 'hide_icn'}, {
! 'click': function() {removeFavorities($next($next(this)))}}),
! $new('span', {
! 'class': 'expthr_icn'}, {
! 'click': function(b, tNum) {return function() {
! var tr = $up(this, 2);
! var thread = $x('.//div[@class="thread"]', tr);
! if(thread) {$del(thread); return}
! ajaxGetThread(tr.appendChild(
! $new('div', {
! 'class': 'thread',
! 'id': tNum,
! 'style': 'padding-left:15px',
! 'text': '...'})
! ), b, tNum, 5);
! }}(b, tNum)}),
! $new('a', {
! 'href': 'http://' + url + (dm != 'dobrochan.ru' ? '.html' : '.xhtml'),
! 'html': dm + '/' + b + '/' + tNum}),
! $txt(' - ' + title)
! ], {
! 'class': 'reply',
! 'style': 'cursor:default',
! 'html': ' '
! })], {
! 'id': 'favnote_' + i
! })]);
}
+ refPreview(div);
}
/*-----------------------------Dropdown select menus-------------------------*/
***************
*** 676,688 ****
function selectPostHider(post) {
if(Cfg[11] == 0 || (Cfg[13] == 0 && post.isOp)) return;
! var a = addSelMenu('phide_' + post.Num, 0, 14, [' ', ' ', ' ', ' .']);
$event(a.snapshotItem(0), {
'mouseover': function() {quotetxt = txtSelection().trim()},
'click': function() {applyRegExp(quotetxt)}});
$event(a.snapshotItem(1), {'click': function() {regExpImage(post)}});
$event(a.snapshotItem(2), {'click': function() {hideBySameText(post)}});
- $event(a.snapshotItem(3), {'click': function() {hideBySameImage(post)}});
}
function selectExpandThread(post) {
--- 733,744 ----
function selectPostHider(post) {
if(Cfg[11] == 0 || (Cfg[13] == 0 && post.isOp)) return;
! var a = addSelMenu('phide_' + post.Num, 0, 14, [' ', ' ', ' ']);
$event(a.snapshotItem(0), {
'mouseover': function() {quotetxt = txtSelection().trim()},
'click': function() {applyRegExp(quotetxt)}});
$event(a.snapshotItem(1), {'click': function() {regExpImage(post)}});
$event(a.snapshotItem(2), {'click': function() {hideBySameText(post)}});
}
function selectExpandThread(post) {
***************
*** 712,718 ****
return $new('img', {
'id': 'imgcaptcha',
'style': 'display:block',
! 'alt': '..',
'src': (!isMain
? '/' + board + '/captcha.pl?key=res' + tNum + '&dummy=' + rand10()
: '/' + board + '/captcha.pl?key=mainpage&dummy=' + rand10())}, {
--- 768,774 ----
return $new('img', {
'id': 'imgcaptcha',
'style': 'display:block',
! 'alt': '...',
'src': (!isMain
? '/' + board + '/captcha.pl?key=res' + tNum + '&dummy=' + rand10()
: '/' + board + '/captcha.pl?key=mainpage&dummy=' + rand10())}, {
***************
*** 739,756 ****
}
function sageBtnFunc(mail, form) {
var sage = $x('.//span[@id="sage_btn"]', form);
! if(Cfg[32] == 0) {
! sage.innerHTML = '( )';
! sage.style.color = '';
! if(mail.type == 'text') mail.value = '';
! else mail.checked = false;
! } else {
! sage.innerHTML = ' SAGE';
! sage.style.color = 'red';
! if(mail.type == 'text') mail.value = 'sage';
! else mail.checked = true;
! }
}
function sageBtnEvent(e) {
--- 795,806 ----
}
function sageBtnFunc(mail, form) {
+ var s = Cfg[32] == 1;
var sage = $x('.//span[@id="sage_btn"]', form);
! sage.innerHTML = s ? ' SAGE' : '( )';
! sage.style.color = s ? 'red' : '';
! if(mail.type == 'text') mail.value = s ? 'sage' : '';
! else mail.checked = s ? true : false;
}
function sageBtnEvent(e) {
***************
*** 792,798 ****
function toggleUserName() {
toggleCfg(35);
! saveCfg(36, $id('usrname_field').value);
var val = ($id('usrname_box').checked) ? Cfg[36] : '';
Rname.value = val;
if(QR) ($x('.//input[@name="nya1" or @name="akane" or @name="field1"]', QR) || $x('.//input[@name="name"]', QR)).value = val;
--- 842,848 ----
function toggleUserName() {
toggleCfg(35);
! saveCfg(36, $id('usrname_field').value.replace(/\|/g, ''));
var val = ($id('usrname_box').checked) ? Cfg[36] : '';
Rname.value = val;
if(QR) ($x('.//input[@name="nya1" or @name="akane" or @name="field1"]', QR) || $x('.//input[@name="name"]', QR)).value = val;
***************
*** 800,806 ****
function toggleUserPassw() {
toggleCfg(33);
! saveCfg(34, $id('usrpass_field').value);
var val = $id('usrpass_box').checked ? Cfg[34] : rand10().substring(0, 8);
Rpass.value = val;
del_passw.value = val;
--- 850,856 ----
function toggleUserPassw() {
toggleCfg(33);
! saveCfg(34, $id('usrpass_field').value.replace(/\|/g, ''));
var val = $id('usrpass_box').checked ? Cfg[34] : rand10().substring(0, 8);
Rpass.value = val;
del_passw.value = val;
***************
*** 953,962 ****
if(captcha && (ch._0ch || ks)) {
captcha.value = ' ';
var a = $up($x('.//img[@id="captchaimage" or @id="faptchaimage"]', QR));
! $before(a, [$new('img', {
! 'src': 'http://' + domain + (!ch._410 ? '/captcha.php?' + Math.random() : '/faptcha.php?board=' + board),
! 'style': 'cursor:pointer'}, {
! 'click': function(e) {this.src = this.src.replace(/\?[^?]+$|$/, (!ch._410 ? '?' : '?board=' + board + '&') + Math.random())}})]);
$del(a);
}
}
--- 1003,1009 ----
if(captcha && (ch._0ch || ks)) {
captcha.value = ' ';
var a = $up($x('.//img[@id="captchaimage" or @id="faptchaimage"]', QR));
! $before(a, [$new('img', {'src': 'http://' + domain + (!ch._410 ? '/captcha.php?' + Math.random() : '/faptcha.php?board=' + board), 'style': 'cursor:pointer'}, {'click': function(e) {this.src = this.src.replace(/\?[^?]+$|$/, (!ch._410 ? '?' : '?board=' + board + '&') + Math.random())}})]);
$del(a);
}
}
***************
*** 1027,1033 ****
/*---------------------------Append styles for elements----------------------*/
function scriptStyles() {
! var icn = function(nm, src) {return nm + ' {padding-left:18px; cursor:pointer; background:url(data:image/gif;base64,' + src + ') no-repeat} '};
var pre = 'R0lGODlhDgAPALMAAP//////AP8A//8AAAD//wD/AAAA/wAAAN3d3cDAwJmZmYCAgGBgYEtLS////wAAACH5BAEAAA4ALAAAAAAOAA8AAAR';
var txt =
icn('.hide_icn', pre + 'U0MlJq7o4X7dQ+mCILAuohOdHfgpQJguQLowSA+7tKkxt4wgEbnHpkWhCAIJxNJIYyWWTSQMmqUYGDtBobJmMxhOAJZO6LM3l0/WE3oiGo0uv0x0RADs=') +
--- 1074,1080 ----
/*---------------------------Append styles for elements----------------------*/
function scriptStyles() {
! var icn = function(nm, src) {return nm + ' {vertical-align:middle; padding-left:18px; cursor:pointer; background:url(data:image/gif;base64,' + src + ') no-repeat} '};
var pre = 'R0lGODlhDgAPALMAAP//////AP8A//8AAAD//wD/AAAA/wAAAN3d3cDAwJmZmYCAgGBgYEtLS////wAAACH5BAEAAA4ALAAAAAAOAA8AAAR';
var txt =
icn('.hide_icn', pre + 'U0MlJq7o4X7dQ+mCILAuohOdHfgpQJguQLowSA+7tKkxt4wgEbnHpkWhCAIJxNJIYyWWTSQMmqUYGDtBobJmMxhOAJZO6LM3l0/WE3oiGo0uv0x0RADs=') +
***************
*** 1037,1044 ****
icn('.expthr_icn', pre + 'P0MlJq7o4X7dQ+gsALF+CLCSIiGeJqiKbLkzGIEiNMfp15zYGCtXANYY04bCIOA55SKYTBV0akQxnMQZoEhulbRf8aRTDIrKp4TC7325HBAA7') +
icn('.fav_icn', pre + 'T0MlJq7o4X7dQ+skFJsiyjAqCKKOJAgALLoxpInBpMzUM4D8frcbwGQHEGi1hTCh5puLxWWswAY0GLNGgdbVYE/hr5ZY/WXTDM2ojGo6sfC53RAAAOw==') +
'td.reply {width:auto} .pcount {font-size:13px;font-weight:bold;cursor:default;color:#4f7942} .pcountb {font-size:13px;font-weight:bold;cursor:default;color:#c41e3a} ';
! if((ch._2ch && getCookie('wakabastyle') != 'Futaba') || ch._0ch)
! txt += '.postblock {background:#bbb} '; // gray postform color
if(Cfg[39] == 1) txt += '.spoiler {background:#888 !important; color:#CCC !important} '; // open spoilers
if(Cfg[25] == 1) txt += 'blockquote {max-height:100% !important; overflow:visible !important} '; // no scroller
if(Cfg[6] == 1) txt += '.commentpostername, .postername, .postertrip {display:none}'; // no post names
--- 1084,1090 ----
icn('.expthr_icn', pre + 'P0MlJq7o4X7dQ+gsALF+CLCSIiGeJqiKbLkzGIEiNMfp15zYGCtXANYY04bCIOA55SKYTBV0akQxnMQZoEhulbRf8aRTDIrKp4TC7325HBAA7') +
icn('.fav_icn', pre + 'T0MlJq7o4X7dQ+skFJsiyjAqCKKOJAgALLoxpInBpMzUM4D8frcbwGQHEGi1hTCh5puLxWWswAY0GLNGgdbVYE/hr5ZY/WXTDM2ojGo6sfC53RAAAOw==') +
'td.reply {width:auto} .pcount {font-size:13px;font-weight:bold;cursor:default;color:#4f7942} .pcountb {font-size:13px;font-weight:bold;cursor:default;color:#c41e3a} ';
! if((ch._2ch && getCookie('wakabastyle') != 'Futaba') || ch._0ch) txt += '.postblock {background:#bbb} '; // gray postform color
if(Cfg[39] == 1) txt += '.spoiler {background:#888 !important; color:#CCC !important} '; // open spoilers
if(Cfg[25] == 1) txt += 'blockquote {max-height:100% !important; overflow:visible !important} '; // no scroller
if(Cfg[6] == 1) txt += '.commentpostername, .postername, .postertrip {display:none}'; // no post names
***************
*** 1073,1079 ****
function getPost(node) {
return !ch._0ch
! ? $x('./ancestor::table', node)
: $x('./ancestor::div[@class="postnode"]|./ancestor::table[@class="replypost"]', node);
}
--- 1119,1125 ----
function getPost(node) {
return !ch._0ch
! ? $x('./ancestor::table[@class="replypost"]', node)
: $x('./ancestor::div[@class="postnode"]|./ancestor::table[@class="replypost"]', node);
}
***************
*** 1271,1309 ****
var w = sz[0] < maxw ? sz[0] : maxw;
var h = w/r;
$append(a, [
! $attr(img.cloneNode(false), {
'id': 'pre_img',
'width': w,
'height': h,
! 'style': 'display:block'}),
$new('img', {
'class': 'thumb',
'id': 'full_img',
'src': a.href,
'width': w,
'height': h,
! 'style': 'display:none'}, {
'load': function() {
! $del($prev(this));
! if(img.style.display == 'none') toggleDisp(this);
}})
]);
}
function expandHandleImg(post) {
! if(post.Img) $event($up(post.Img, (ks ? 2 : 1)), {'click': function(e) {e.preventDefault(); expandImg(this, post)}});
}
function allImgExpander() {
if($X('.//img[@class="thumb"]', delform).snapshotLength <= 1) return;
oPosts[0].appendChild($new('div', {
'id': 'expimgs_btn',
'style': 'cursor:pointer',
! 'html': '[ ]'}, {
'click': function() {
forPosts(function(post) {if(post.Img && post.Vis != HIDE) expandImg($up(post.Img), post)});
var btn = $id('expimgs_btn');
! btn.innerHTML = //.test(btn.innerHTML) ? '[ ]' : '[ ]';
}}));
}
--- 1317,1359 ----
var w = sz[0] < maxw ? sz[0] : maxw;
var h = w/r;
$append(a, [
! $if(Cfg[23] == 2, $attr(img.cloneNode(false), {
'id': 'pre_img',
'width': w,
'height': h,
! 'style': 'display:block'})),
$new('img', {
'class': 'thumb',
'id': 'full_img',
+ 'alt': '...',
'src': a.href,
'width': w,
'height': h,
! 'style': 'display:' + (Cfg[23] == 2 ? 'none' : 'block')}, {
'load': function() {
! $del($x('.//img[@id="pre_img"]', $up(this)));
! if(img.style.display == 'none') this.style.display = 'block';
}})
]);
}
function expandHandleImg(post) {
! if(post.Img) $event($up(post.Img, (ks ? 2 : 1)), {'click': function(e) {
! if(Cfg[23] != 0) {e.preventDefault(); expandImg(this, post);
! }}});
}
function allImgExpander() {
if($X('.//img[@class="thumb"]', delform).snapshotLength <= 1) return;
+ var txt = '[ ]';
oPosts[0].appendChild($new('div', {
'id': 'expimgs_btn',
'style': 'cursor:pointer',
! 'html': txt}, {
'click': function() {
forPosts(function(post) {if(post.Img && post.Vis != HIDE) expandImg($up(post.Img), post)});
var btn = $id('expimgs_btn');
! btn.innerHTML = //.test(btn.innerHTML) ? '[ ]' : txt;
}}));
}
***************
*** 1327,1336 ****
var map = post ? $id('rfmap_' + rNum) : undefined;
if(!map) {
map = $new('small', {'id': 'rfmap_' + rNum, 'html': '
: ' + ref + ''});
! refPrewiev(map);
var msg = postByNum[rNum].Msg;
if(msg) $up(msg).appendChild(map);
! } else refPrewiev($html(map.firstChild, map.firstChild.innerHTML + ', ' + ref));
}
}
--- 1377,1386 ----
var map = post ? $id('rfmap_' + rNum) : undefined;
if(!map) {
map = $new('small', {'id': 'rfmap_' + rNum, 'html': '
: ' + ref + ''});
! refPreview(map);
var msg = postByNum[rNum].Msg;
if(msg) $up(msg).appendChild(map);
! } else refPreview($html(map.firstChild, map.firstChild.innerHTML + ', ' + ref));
}
}
***************
*** 1356,1368 ****
' top:' + y + 'px;'}, {
'mouseout': function(e) {
var el = $x('ancestor-or-self::*[starts-with(@id,"pstprew")]', e.relatedTarget);
! if(!el) delPrewievClones();
else while(/pstprew/.test($next(el).id)) $del($next(el));
}});
var functor = function(clone, html) {
clone.innerHTML = html;
clone.Img = $x('.//img[@class="thumb"]', clone);
! refPrewiev(clone);
expandHandleImg(clone);
};
if(b == board) var post = postByNum[pNum];
--- 1406,1418 ----
' top:' + y + 'px;'}, {
'mouseout': function(e) {
var el = $x('ancestor-or-self::*[starts-with(@id,"pstprew")]', e.relatedTarget);
! if(!el) delPreviewClones();
else while(/pstprew/.test($next(el).id)) $del($next(el));
}});
var functor = function(clone, html) {
clone.innerHTML = html;
clone.Img = $x('.//img[@class="thumb"]', clone);
! refPreview(clone);
expandHandleImg(clone);
};
if(b == board) var post = postByNum[pNum];
***************
*** 1382,1388 ****
$before(ndelform, [clone]);
}
! function refPrewiev(node) {
$each($X('.//a[starts-with(text(),">>")]', node || delform), function(link) {
if(ch.dc) {
if(!nav.Opera) {if(link.getAttribute('onmouseover')) link.removeAttribute('onmouseover')}
--- 1432,1438 ----
$before(ndelform, [clone]);
}
! function refPreview(node) {
$each($X('.//a[starts-with(text(),">>")]', node || delform), function(link) {
if(ch.dc) {
if(!nav.Opera) {if(link.getAttribute('onmouseover')) link.removeAttribute('onmouseover')}
***************
*** 1392,1403 ****
'mouseover': doPostPreview,
'mouseout': function(e) {
if(!$x('ancestor-or-self::*[starts-with(@id,"pstprew")]', e.relatedTarget))
! delPrewievClones();
}});
});
}
! function delPrewievClones() {
$each($X('.//div[starts-with(@id,"pstprew")]'), function(clone) {$del(clone)});
}
--- 1442,1453 ----
'mouseover': doPostPreview,
'mouseout': function(e) {
if(!$x('ancestor-or-self::*[starts-with(@id,"pstprew")]', e.relatedTarget))
! delPreviewClones();
}});
});
}
! function delPreviewClones() {
$each($X('.//div[starts-with(@id,"pstprew")]'), function(clone) {$del(clone)});
}
***************
*** 1489,1496 ****
if(post.Vis == HIDE) setPostVisib(post, HIDE);
if(Cfg[12] == 1) mergeHidden(post);
if(Cfg[15] == 1) refMap(post);
! if(Cfg[23] == 1 && wk) expandHandleImg(post);
! if(Cfg[26] == 1) refPrewiev(post.Msg);
if(Cfg[27] == 1) addYouTube(post);
if(Cfg[28] == 1) addMP3(post);
}
--- 1539,1546 ----
if(post.Vis == HIDE) setPostVisib(post, HIDE);
if(Cfg[12] == 1) mergeHidden(post);
if(Cfg[15] == 1) refMap(post);
! if(Cfg[23] != 0 && wk) expandHandleImg(post);
! if(Cfg[26] == 1) refPreview(post.Msg);
if(Cfg[27] == 1) addYouTube(post);
if(Cfg[28] == 1) addMP3(post);
}
***************
*** 1502,1508 ****
var txt = ajaxPosts[tNum][post.Num];
post.Msg = $html(post.Msg, txt.substring(txt.indexOf('')));
post.Text = getText(post.Msg);
! if(Cfg[26] == 1) refPrewiev(post.Msg);
if(Cfg[27] == 1) addYouTube(post);
if(Cfg[28] == 1) addMP3(post);
});
--- 1552,1558 ----
var txt = ajaxPosts[tNum][post.Num];
post.Msg = $html(post.Msg, txt.substring(txt.indexOf('')));
post.Text = getText(post.Msg);
! if(Cfg[26] == 1) refPreview(post.Msg);
if(Cfg[27] == 1) addYouTube(post);
if(Cfg[28] == 1) addMP3(post);
});
***************
*** 1527,1532 ****
--- 1577,1598 ----
});
}
+ function ajaxGetThread(parent, b, tNum, last) {
+ AJAX('thr', b, tNum, function() {
+ delChilds(parent);
+ if(!ajaxPosts[tNum]) {alert(' '); return}
+ addPostFunc(parent.appendChild(getNewPost(tNum, ajaxPosts[tNum][tNum], i)), tNum, 0, true);
+ var len = ajaxPosts[tNum].keys.length;
+ if(last != 1) last = len - last;
+ if(last <= 0) last = 1;
+ for(var i = last; i < len; i++) {
+ var pNum = ajaxPosts[tNum].keys[i];
+ addPostFunc(parent.appendChild(getNewPost(pNum, ajaxPosts[tNum][pNum], i)), pNum, i + 1, true);
+ }
+ if(!sav.cookie) storeHiddenPosts();
+ });
+ }
+
function ajaxNewPosts() {
var thread = $x('.//div[@class="thread"]');
var tNum = oPosts[0].Num;
***************
*** 1661,1673 ****
} else if(Cfg[13] == 1) unhideThread(post);
}
- function toggleSamePost(post, vis, expr, note) {
- if(!expr) return;
- $del($id('note_' + post.Num));
- if(vis == UNHIDE) hidePost(post, note);
- else unhidePost(post);
- }
-
function storeHiddenPosts() {
forPosts(function(post) {if(post.Vis == HIDE) setPostVisib(post, HIDE)});
storePostsVisib();
--- 1727,1732 ----
***************
*** 1977,2029 ****
var j = words.length;
while (j--) if((words[j] == origWords[i]) || (origWords[i].substring(0, 2) == '>>' && words[j].substring(0, 2) == '>>')) matchCount++;
}
! toggleSamePost(post, origVis, matchCount >= origLen*0.5 && words.length < origLen*2.5, ' same text as >>' + origPost.Num);
! }
!
! /*-------------------------Hide posts with similar images----------------------*/
!
! function getPix(img, iw, ih) {
! var cn = $new('canvas', {'width': iw, 'height': ih}).getContext('2d');
! cn.drawImage(img, 0, 0);
! return cn.getImageData(0, 0, iw, ih).data;
! }
!
! function hideBySameImage(post) {
! var img = post.Img;
! if(!img) {
! toggleNoimage();
! toggleChk($id('noimage_hider'));
! return;
! }
! var iw = img.width, ih = img.height;
! var iData = getPix(img, iw, ih);
! for(var i = 0; i < ih; i += 10)
! for(var j = 0; j < iw; j += 10) {
! var n = (i*4)*iw + (j*4);
! var mix = Math.round((iData[n] + iData[n + 1] + iData[n + 2])*0.3333);
! iData[n] = mix;
! iData[n + 1] = mix;
! iData[n + 2] = mix;
! }
! var vis = post.Vis;
! forAll(function(target) {findSameImages(target, post, vis, iData)});
! storeHiddenPosts();
! }
!
! function findSameImages(post, origPost, origVis, iData) {
! var img = post.Img;
! if(!img) return;
! var matchCount = 0, count = 0;
! var iw = img.width, ih = img.height;
! var sData = getPix(img, iw, ih);
! for(var i = 0; i < ih; i += 10)
! for(var j = 0; j < iw; j += 10) {
! var n = (i*4)*iw + (j*4);
! var mix = Math.round((sData[n] + sData[n + 1] + sData[n + 2])*0.3333);
! if(iData[n] <= mix + 10 && iData[n] >= mix - 10) matchCount++;
! count++;
! }
! toggleSamePost(post, origVis, matchCount/count >= 0.5, ' image as >>' + origPost.Num + ' (' + parseInt(matchCount/count*100) + '%)');
}
--- 2036,2045 ----
var j = words.length;
while (j--) if((words[j] == origWords[i]) || (origWords[i].substring(0, 2) == '>>' && words[j].substring(0, 2) == '>>')) matchCount++;
}
! if(!(matchCount >= origLen*0.5 && words.length < origLen*2.5)) return;
! $del($id('note_' + post.Num));
! if(origVis != HIDE) hidePost(post, ' same text as >>' + origPost.Num);
! else unhidePost(post);
}
***************
*** 2055,2074 ****
else applyPostVisib(post, UNHIDE);
}
- function detectWipe_longColumn(txt) {
- var n = 0;
- var rows = txt.split('\n');
- var len = rows.length;
- for(var i = 0; i < len; i++) {
- if(rows[i].length < 9) n++;
- else return null;
- }
- if(len > 45) return 'long text x' + len;
- if(n > 5) return 'columns x' + n;
- return null;
- }
-
function detectWipe_sameLines(txt) {
var lines = txt.replace(/(> )/g, '').split('\n');
var len = lines.length;
if(len < 5) return null;
--- 2071,2078 ----
else applyPostVisib(post, UNHIDE);
}
function detectWipe_sameLines(txt) {
+ if(Cfg[42] == 0) return null;
var lines = txt.replace(/(> )/g, '').split('\n');
var len = lines.length;
if(len < 5) return null;
***************
*** 2082,2087 ****
--- 2086,2092 ----
}
function detectWipe_sameWords(txt) {
+ if(Cfg[43] == 0) return null;
txt = txt.replace(/[\.\?\!,>]/g, ' ').replace(/\s+/g, ' ').toUpperCase();
var words = txt.split(' ');
var len = words.length;
***************
*** 2103,2109 ****
--- 2108,2140 ----
return null;
}
+ function detectWipe_specSymbols(txt) {
+ if(Cfg[44] == 0) return null;
+ txt = txt.replace(/\s+/g, '');
+ var all = txt;
+ txt = txt.replace(/[0-9A-Za-z--\.\?!,]/g, '');
+ var proc = txt.length/all.length;
+ if(all.length > 30 && proc > 0.40)
+ return 'specsymbols: ' + parseInt(proc*100) + '%';
+ return null;
+ }
+
+ function detectWipe_longColumn(txt) {
+ if(Cfg[45] == 0) return null;
+ var n = 0;
+ var rows = txt.split('\n');
+ var len = rows.length;
+ for(var i = 0; i < len; i++) {
+ if(rows[i].length < 9) n++;
+ else return null;
+ }
+ if(len > 45) return 'long text x' + len;
+ if(n > 5) return 'columns x' + n;
+ return null;
+ }
+
function detectWipe_longWords(txt) {
+ if(Cfg[46] == 0) return null;
txt = txt.replace(/http:\/\/.*?(\s|$)/g, '').replace(/[\.\?!,>:;-]/g, ' ').replace(/\s+/g, ' ');
var words = txt.split(' ');
var n = 0, all = '', lng = '';
***************
*** 2118,2124 ****
--- 2149,2165 ----
return null;
}
+ function detectWipe_numbers(txt) {
+ if(Cfg[47] == 0) return null;
+ txt = txt.replace(/\s+/g, ' ').replace(/(>>)(\d+)/g, '').replace(/http:\/\/.*?(\s|$)/g, '');
+ var len = txt.length;
+ var proc = (len - txt.replace(/[0-9]/g, '').length)/len;
+ if(len > 30 && proc > 0.4) return 'numbers: ' + parseInt(proc*100) + '%';
+ return null;
+ }
+
function detectWipe_caseWords(txt) {
+ if(Cfg[48] == 0) return null;
txt = txt.replace(/[\.\?!,-]/g, ' ').replace(/\s+/g, ' ');
var words = txt.split(' ');
var len = words.length;
***************
*** 2149,2172 ****
return null;
}
- function detectWipe_specSymbols(txt) {
- txt = txt.replace(/\s+/g, '');
- var all = txt;
- txt = txt.replace(/[0-9A-Za-z--\.\?!,]/g, '');
- var proc = txt.length/all.length;
- if(all.length > 30 && proc > 0.40)
- return 'specsymbols: ' + parseInt(proc*100) + '%';
- return null;
- }
-
- function detectWipe_numbers(txt) {
- txt = txt.replace(/\s+/g, ' ').replace(/(>>)(\d+)/g, '').replace(/http:\/\/.*?(\s|$)/g, '');
- var len = txt.length;
- var proc = (len - txt.replace(/[0-9]/g, '').length)/len;
- if(len > 30 && proc > 0.4) return 'numbers: ' + parseInt(proc*100) + '%';
- return null;
- }
-
/*=============================================================================
INITIALIZATION
--- 2190,2195 ----
***************
*** 2348,2354 ****
addControls(); Log('addControls');
forAll(addPostButtons); Log('addPostButtons');
if(Cfg[26] == 1) {
! refPrewiev(); Log('refPrewiev')}
if(Cfg[15] == 1) {
refMap(); Log('refMap')}
forAll(doPostFilters); Log('doPostFilters');
--- 2371,2377 ----
addControls(); Log('addControls');
forAll(addPostButtons); Log('addPostButtons');
if(Cfg[26] == 1) {
! refPreview(); Log('refPreview')}
if(Cfg[15] == 1) {
refMap(); Log('refMap')}
forAll(doPostFilters); Log('doPostFilters');
***************
*** 2358,2364 ****
initNewPosts(); Log('initNewPosts')}
if(Cfg[12] == 1) {
forPosts(mergeHidden); Log('mergeHidden')}
! if(Cfg[23] == 1 && wk) {
forAll(expandHandleImg); Log('expandHandleImg')}
if(Cfg[24] == 1 && main && wk) {
forAll(ajaxExpandPost); Log('ajaxExpandPost')}
--- 2381,2387 ----
initNewPosts(); Log('initNewPosts')}
if(Cfg[12] == 1) {
forPosts(mergeHidden); Log('mergeHidden')}
! if(Cfg[23] != 0 && wk) {
forAll(expandHandleImg); Log('expandHandleImg')}
if(Cfg[24] == 1 && main && wk) {
forAll(ajaxExpandPost); Log('ajaxExpandPost')}