Whitespace purge

This commit is contained in:
Juribiyan 2018-05-02 17:36:50 +05:00
parent 277e17f688
commit 42ec5028f6
8 changed files with 211 additions and 211 deletions

View File

@ -517,7 +517,7 @@ pre {
.closebox, .delete { .closebox, .delete {
background-position: -16px 0px; background-position: -16px 0px;
} }
.ban { .ban {
background-position: 0px -32px; background-position: 0px -32px;
@ -627,16 +627,16 @@ border-radius: 5px;
} }
/* Node insertion detection #snivystuff */ /* Node insertion detection #snivystuff */
@-o-keyframes nodeInserted { @-o-keyframes nodeInserted {
from { clip: rect(1px, auto, auto, auto); } from { clip: rect(1px, auto, auto, auto); }
to { clip: rect(0px, auto, auto, auto); } to { clip: rect(0px, auto, auto, auto); }
} }
@keyframes nodeInserted { @keyframes nodeInserted {
from { clip: rect(1px, auto, auto, auto); } from { clip: rect(1px, auto, auto, auto); }
to { clip: rect(0px, auto, auto, auto); } to { clip: rect(0px, auto, auto, auto); }
} }
@-webkit-keyframes nodeInserted { @-webkit-keyframes nodeInserted {
from { clip: rect(1px, auto, auto, auto); } from { clip: rect(1px, auto, auto, auto); }
to { clip: rect(0px, auto, auto, auto); } to { clip: rect(0px, auto, auto, auto); }
} }
@ -649,7 +649,7 @@ border-radius: 5px;
-webkit-animation-duration: 0.001s; -webkit-animation-duration: 0.001s;
animation-name: nodeInserted; animation-name: nodeInserted;
-o-animation-name: nodeInserted; -o-animation-name: nodeInserted;
-ms-animation-name: nodeInserted; -ms-animation-name: nodeInserted;
-moz-animation-name: nodeInserted; -moz-animation-name: nodeInserted;
-webkit-animation-name: nodeInserted; -webkit-animation-name: nodeInserted;
} }
@ -909,7 +909,7 @@ border: none;
} }
@media (min-width: 600px) { @media (min-width: 600px) {
.replymode, .passvalid, .catalogmode { .replymode, .passvalid, .catalogmode {
margin-top: -20px; margin-top: -20px;
} }
} }
.spin-around { .spin-around {
@ -972,7 +972,7 @@ border: none;
.expand-on-hover-enabled .cat-entry:not(.thumbExpanded):hover .cat-card { .expand-on-hover-enabled .cat-entry:not(.thumbExpanded):hover .cat-card {
position: absolute; position: absolute;
height: auto; height: auto;
top: 0px; top: 0px;
} }
.expand-on-hover-enabled .ce-text.cat-entry:not(.thumbExpanded):hover .cat-card { .expand-on-hover-enabled .ce-text.cat-entry:not(.thumbExpanded):hover .cat-card {
@ -1160,7 +1160,7 @@ border: none;
} }
.cat-entry:not(.thumbExpanded):hover:after { .cat-entry:not(.thumbExpanded):hover:after {
opacity: 0; opacity: 0;
}/* }/*
.bigThumb .icon { .bigThumb .icon {
position: absolute; position: absolute;
bottom: 3px; bottom: 3px;
@ -1252,16 +1252,16 @@ border: none;
} }
/* cat-bt-embed insertion detection */ /* cat-bt-embed insertion detection */
@-o-keyframes embed-image-insert { @-o-keyframes embed-image-insert {
from { clip: rect(1px, auto, auto, auto); } from { clip: rect(1px, auto, auto, auto); }
to { clip: rect(0px, auto, auto, auto); } to { clip: rect(0px, auto, auto, auto); }
} }
@keyframes embed-image-insert { @keyframes embed-image-insert {
from { clip: rect(1px, auto, auto, auto); } from { clip: rect(1px, auto, auto, auto); }
to { clip: rect(0px, auto, auto, auto); } to { clip: rect(0px, auto, auto, auto); }
} }
@-webkit-keyframes embed-image-insert { @-webkit-keyframes embed-image-insert {
from { clip: rect(1px, auto, auto, auto); } from { clip: rect(1px, auto, auto, auto); }
to { clip: rect(0px, auto, auto, auto); } to { clip: rect(0px, auto, auto, auto); }
} }
@ -1273,7 +1273,7 @@ border: none;
-webkit-animation-duration: 0.001s; -webkit-animation-duration: 0.001s;
animation-name: embed-image-insert; animation-name: embed-image-insert;
-o-animation-name: embed-image-insert; -o-animation-name: embed-image-insert;
-ms-animation-name: embed-image-insert; -ms-animation-name: embed-image-insert;
-moz-animation-name: embed-image-insert; -moz-animation-name: embed-image-insert;
-webkit-animation-name: embed-image-insert; -webkit-animation-name: embed-image-insert;
} }
@ -1352,7 +1352,7 @@ border: none;
pointer-events: none; pointer-events: none;
} }
input::-webkit-input-placeholder {opacity: 0; } input::-webkit-input-placeholder {opacity: 0; }
input:-moz-placeholder {opacity: 0; } input:-moz-placeholder {opacity: 0; }
.onsmall-show { .onsmall-show {
@ -1442,7 +1442,7 @@ input:-moz-placeholder {opacity: 0; }
.maintable hr { .maintable hr {
margin:0; margin:0;
} }
input::-webkit-input-placeholder {opacity: 1; } input::-webkit-input-placeholder {opacity: 1; }
input:-moz-placeholder {opacity: 1; } input:-moz-placeholder {opacity: 1; }
hr { hr {
margin: 0!important; margin: 0!important;
@ -1608,8 +1608,8 @@ input[readonly] {
padding: 0 10px; padding: 0 10px;
} }
.pmsg-form button { .pmsg-form button {
width: 40%; width: 40%;
margin: 0 5%; margin: 0 5%;
max-width: 150px; max-width: 150px;
} }
input:disabled { input:disabled {
@ -1648,7 +1648,7 @@ td > .bubble {
width: 0; width: 0;
z-index: 0; z-index: 0;
border-width: 7px 12px 7px 0; border-width: 7px 12px 7px 0;
} }
.bubble:not(.thought-bubble):after, .bubble:not(.thought-bubble):before { .bubble:not(.thought-bubble):after, .bubble:not(.thought-bubble):before {
border-style: solid; border-style: solid;
} }
@ -1686,7 +1686,7 @@ td > .bubble {
} }
.bubble:not(.thought-bubble):before { .bubble:not(.thought-bubble):before {
content: none; content: none;
} }
.emoji { .emoji {
vertical-align: middle; vertical-align: middle;
@ -1698,7 +1698,7 @@ i .emoji {
transform: skewX(-20deg); transform: skewX(-20deg);
} }
.postbody::-webkit-scrollbar, .postbody::-webkit-scrollbar,
.prettyprint::-webkit-scrollbar, .prettyprint::-webkit-scrollbar,
.code_part::-webkit-scrollbar { .code_part::-webkit-scrollbar {
width: 8px; width: 8px;
@ -2042,7 +2042,7 @@ blockquote {
display: none; display: none;
} }
.add-embed:not(:checked) + label + br + .multiembedwrap, .add-embed:not(:checked) + label + br + .multiembedwrap,
.add-embed:not(:checked) + label + br + .multiembedwrap + .add-embed, .add-embed:not(:checked) + label + br + .multiembedwrap + .add-embed,
.add-embed:not(:checked) + label + br + .multiembedwrap + .add-embed + label, .add-embed:not(:checked) + label + br + .multiembedwrap + .add-embed + label,
.add-embed:not(:checked) + label + br + .multiembedwrap + .add-embed + label + br { .add-embed:not(:checked) + label + br + .multiembedwrap + .add-embed + label + br {
display: none; display: none;
@ -2056,7 +2056,7 @@ blockquote {
box-shadow: 0 0 3px 4px red; box-shadow: 0 0 3px 4px red;
} }
/*New embeds*/ /*New embeds*/
.embed-wrap { .embed-wrap {
position: relative; position: relative;
font-size: 0; font-size: 0;
@ -2108,7 +2108,7 @@ blockquote {
opacity: 0.8; opacity: 0.8;
-webkit-transition: opacity 0.4s; -webkit-transition: opacity 0.4s;
-o-transition: opacity 0.4s; -o-transition: opacity 0.4s;
transition: transition:
opacity 0.4s; opacity 0.4s;
z-index: 3; z-index: 3;
/* height: 5.3rem; */ /* height: 5.3rem; */

View File

@ -16,7 +16,7 @@ a:visited {
} }
a:hover { a:hover {
color: rgb(23, 53, 85); color: rgb(23, 53, 85);
} }
.adminbar { .adminbar {
clear:both; clear:both;
float:right; float:right;
@ -314,7 +314,7 @@ color: #000;
} }
.bg-button:hover { .bg-button:hover {
background-color: rgb(255, 255, 255); background-color: rgb(255, 255, 255);
color: black;; color: black;;
} }
.bgb-selected, .bgb-selected:hover { .bgb-selected, .bgb-selected:hover {
background: #BDD4EC; background: #BDD4EC;

View File

@ -12,7 +12,7 @@ a:visited {
} }
a:hover { a:hover {
color: rgb(54, 171, 133); color: rgb(54, 171, 133);
} }
.adminbar { .adminbar {
clear:both; clear:both;
float:right; float:right;
@ -122,7 +122,7 @@ a:visited {
} }
.reply { .reply {
background: #363F4C; background: #363F4C;
padding-right: 3px; padding-right: 3px;
padding: 1px 3px 1px 1px; padding: 1px 3px 1px 1px;
border: 1px solid rgb(31, 37, 44); border: 1px solid rgb(31, 37, 44);
} }
@ -352,7 +352,7 @@ color: rgb(55, 201, 153);
} }
.bg-button:hover { .bg-button:hover {
background-color: rgba(255, 255, 255, 0.12); background-color: rgba(255, 255, 255, 0.12);
color: #fff; color: #fff;
} }
.bgb-selected, .bgb-selected:hover { .bgb-selected, .bgb-selected:hover {
background: #167355; background: #167355;

View File

@ -78,20 +78,20 @@
<div id="overlay_menu" class="content-background overlay-menu"> <div id="overlay_menu" class="content-background overlay-menu">
<span style="display: none" class="olm-link mgoback">[<a href="{%KU_CGIPATH}/{$board.name}/"> &lt; </a>]</span> <span style="display: none" class="olm-link mgoback">[<a href="{%KU_CGIPATH}/{$board.name}/"> &lt; </a>]</span>
<span class="olm-link">[<a href="{%KU_BOARDSFOLDER}">home</a>]</span> <span class="olm-link">[<a href="{%KU_BOARDSFOLDER}">home</a>]</span>
<span class="mobile-nav" id="mn-normalboards" style="display:none"> <span class="mobile-nav" id="mn-normalboards" style="display:none">
<select onchange="javascript:if(selectedIndex != 0) location.href='{%KU_WEBPATH}/' + this.options[this.selectedIndex].value;"> <select onchange="javascript:if(selectedIndex != 0) location.href='{%KU_WEBPATH}/' + this.options[this.selectedIndex].value;">
<option><b>{t}Boards{/t}</b></option> <option><b>{t}Boards{/t}</b></option>
{foreach name=sections item=sect from=$boardlist} {foreach name=sections item=sect from=$boardlist}
{if $sect.abbreviation neq '20'} {if $sect.abbreviation neq '20'}
{foreach name=brds item=brd from=$sect} {foreach name=brds item=brd from=$sect}
{if $brd.name neq $board.name} {if $brd.name neq $board.name}
{if isset($brd.desc) and is_array($brd)} {if isset($brd.desc) and is_array($brd)}
<option value="{$brd.name}">/{$brd.name}/ - {$brd.desc}</option> <option value="{$brd.name}">/{$brd.name}/ - {$brd.desc}</option>
{/if} {/if}
{/if} {/if}
{/foreach} {/foreach}
{/if} {/if}
{/foreach} {/foreach}
</select> </select>
<select class="boardsel20" onchange="javascript:if(selectedIndex != 0) location.href='{%KU_WEBPATH}/' + this.options[this.selectedIndex].value;"> <select class="boardsel20" onchange="javascript:if(selectedIndex != 0) location.href='{%KU_WEBPATH}/' + this.options[this.selectedIndex].value;">
<option><b>2.0 {t}Boards{/t}</b></option> <option><b>2.0 {t}Boards{/t}</b></option>
@ -113,15 +113,15 @@
<input type="text" id="boardselect" placeholder="{t}Filter{/t}" /> <input type="text" id="boardselect" placeholder="{t}Filter{/t}" />
<div id="boards20"> <div id="boards20">
</div> </div>
{/if} {/if}
</div> </div>
{/foreach} {/foreach}
<div class="menu-sect" id="ms-_options"> <div class="menu-sect" id="ms-_options">
{t}Styles{/t}: {t}Styles{/t}:
{loop $ku_styles} {loop $ku_styles}
[<a href="#" onclick="javascript:Styles.change('{$|capitalize}');return false;">{if $__.customstyle eq $}Custom{else}{$|capitalize}{/if}</a>] [<a href="#" onclick="javascript:Styles.change('{$|capitalize}');return false;">{if $__.customstyle eq $}Custom{else}{$|capitalize}{/if}</a>]
{/loop}<br /> {/loop}<br />
<a href="#" onclick="javascript:menu_pin();return false;">{t}Pin/Unpin{/t}</a> | <a href="#" onclick="javascript:menu_pin();return false;">{t}Pin/Unpin{/t}</a> |
<a href="#" onclick="javascript:set_oldmenu(true);return false;">{t}Simple list{/t}</a> <a href="#" onclick="javascript:set_oldmenu(true);return false;">{t}Simple list{/t}</a>
<div id="js_settings"></div> <div id="js_settings"></div>
</div> </div>

View File

@ -14,7 +14,7 @@ class="reflinkpreview content-background qreplyform" style="display:none">
<hr /> <hr />
{if $topads neq ''} {if $topads neq ''}
<div class="content ads"> <div class="content ads">
<center> <center>
{$topads} {$topads}
</center> </center>
</div> </div>

View File

@ -7,7 +7,7 @@
$img = imagecreatetruecolor($width, $height); $img = imagecreatetruecolor($width, $height);
imagealphablending($img, false); imagealphablending($img, false);
imagesavealpha($img, true); imagesavealpha($img, true);
// Apply the transparent background // Apply the transparent background
$trans = imagecolorallocatealpha($img, 0, 0, 0, 127); $trans = imagecolorallocatealpha($img, 0, 0, 0, 127);
for ($x = 0; $x < $width; $x++) for ($x = 0; $x < $width; $x++)
@ -17,58 +17,58 @@
imagesetpixel($img, $x, $y, $trans); imagesetpixel($img, $x, $y, $trans);
} }
} }
return $img; return $img;
} }
function rainbow ($ip, $threadno) function rainbow ($ip, $threadno)
{ {
$size=16; $size=16;
$steps=2; $steps=2;
$step=$size/$steps; $step=$size/$steps;
$string = $ip . $threadno; $string = $ip . $threadno;
$image = image_create_alpha($size, $size); $image = image_create_alpha($size, $size);
$n = 0; $n = 0;
$prev = 0; $prev = 0;
$len = strlen($string); $len = strlen($string);
$sum = 0; $sum = 0;
for ($i=0;$i<$len;$i++) $sum += ord($string[$i]); for ($i=0;$i<$len;$i++) $sum += ord($string[$i]);
for ($i=0;$i<$steps;$i++) { for ($i=0;$i<$steps;$i++) {
for ($j=0;$j<$steps;$j++) { for ($j=0;$j<$steps;$j++) {
$letter = $string[$n++ % $len]; $letter = $string[$n++ % $len];
$u = ($n % (ord($letter)+$sum)) + ($prev % (ord($letter)+$len)) + (($sum-1) % ord($letter)); $u = ($n % (ord($letter)+$sum)) + ($prev % (ord($letter)+$len)) + (($sum-1) % ord($letter));
$color = imagecolorallocate($image, pow($u*$prev+$u+$prev+5,2)%256, pow($u*$prev+$u+$prev+3,2)%256, pow($u*$prev+$u+$prev+1,2)%256); $color = imagecolorallocate($image, pow($u*$prev+$u+$prev+5,2)%256, pow($u*$prev+$u+$prev+3,2)%256, pow($u*$prev+$u+$prev+1,2)%256);
if (($u%2)==0) if (($u%2)==0)
imagefilledpolygon($image, array($i*$step, $j*$step, $i*$step+$step, $j*$step, $i*$step, $j*$step+$step), 3, $color); imagefilledpolygon($image, array($i*$step, $j*$step, $i*$step+$step, $j*$step, $i*$step, $j*$step+$step), 3, $color);
$prev = $u; $prev = $u;
$u = ($n % (ord($letter)+$len)) + ($prev % (ord($letter)+$sum)) + (($sum-1) % ord($letter)); $u = ($n % (ord($letter)+$len)) + ($prev % (ord($letter)+$sum)) + (($sum-1) % ord($letter));
if (($u%2)==0) if (($u%2)==0)
imagefilledpolygon($image, array($i*$step, $j*$step+$step, $i*$step+$step, $j*$step+$step, $i*$step+$step, $j*$step), 3, $color); imagefilledpolygon($image, array($i*$step, $j*$step+$step, $i*$step+$step, $j*$step+$step, $i*$step+$step, $j*$step), 3, $color);
$prev = $u; $prev = $u;
} }
} }
ob_start (); ob_start ();
imagepng ($image); imagepng ($image);
$image_data = ob_get_contents (); $image_data = ob_get_contents ();
ob_end_clean (); ob_end_clean ();
return base64_encode ($image_data); return base64_encode ($image_data);
} }
function omitted_syntax($posts, $images) { function omitted_syntax($posts, $images) {
$pd = declense($posts); $id = declense($images); $pd = declense($posts); $id = declense($images);
if($pd == 0) $pw = 'постов'; if($pd == 0) $pw = 'постов';
elseif($pd == 1) $pw = 'пост'; elseif($pd == 1) $pw = 'пост';
else $pw = 'поста'; else $pw = 'поста';

View File

@ -18,7 +18,7 @@ var _messages = {
NewThread: "New thread", NewThread: "New thread",
replyTo: "reply to", replyTo: "reply to",
cancel: "Cancel", cancel: "Cancel",
update: "Update", update: "Update",
updatingCounts: "Updating...", updatingCounts: "Updating...",
couldntFetch: "Cold not fetch this post", couldntFetch: "Cold not fetch this post",
noNewPosts: "No new posts", noNewPosts: "No new posts",
@ -28,7 +28,7 @@ var _messages = {
settings_sfwMode: "NSFW mode", settings_sfwMode: "NSFW mode",
settings_expandImgFull: "Expand images to full size", settings_expandImgFull: "Expand images to full size",
settings_constrainWidth: "Constrain content width", settings_constrainWidth: "Constrain content width",
delete: "Delete post", delete: "Delete post",
deleteAndBan: "Delete post and ban poster", deleteAndBan: "Delete post and ban poster",
enterCaptcha: "Please enter captcha.", enterCaptcha: "Please enter captcha.",
selectText: "Select some text", selectText: "Select some text",
@ -103,7 +103,7 @@ var _messages = {
NewThread: "Создать тред", NewThread: "Создать тред",
replyTo: "ответ на", replyTo: "ответ на",
cancel: "Отмена", cancel: "Отмена",
update: "Обновить", update: "Обновить",
updatingCounts: "Ищем новые посты...", updatingCounts: "Ищем новые посты...",
couldntFetch: "Не удалось загрузить этот пост", couldntFetch: "Не удалось загрузить этот пост",
noNewPosts: "Нет новых постов", noNewPosts: "Нет новых постов",
@ -113,13 +113,13 @@ var _messages = {
settings_sfwMode: "Мамка в комнате", settings_sfwMode: "Мамка в комнате",
settings_expandImgFull: "Разворачивать картинки до исходного размера", settings_expandImgFull: "Разворачивать картинки до исходного размера",
settings_constrainWidth: "Ограничивать ширину контента", settings_constrainWidth: "Ограничивать ширину контента",
delete: "Удалить пост", delete: "Удалить пост",
deleteAndBan: "Удалить пост и забанить постера", deleteAndBan: "Удалить пост и забанить постера",
enterCaptcha: "Пожалуйста, введите капчу.", enterCaptcha: "Пожалуйста, введите капчу.",
selectText: "Текст не выделен", selectText: "Текст не выделен",
dcls: "Double click to show source", dcls: "Double click to show source",
watchOn: "Смотреть на", watchOn: "Смотреть на",
odc: "javascript:LatexIT.replaceWithSrc(this);", odc: "javascript:LatexIT.replaceWithSrc(this);",
captcharot: "Капча протухла", captcharot: "Капча протухла",
threadUpdationAutomatically: "Тред обновляется автоматически", threadUpdationAutomatically: "Тред обновляется автоматически",
stopFuckingDolls: "<b>Отключите AJAX-отправку постов и AJAX-обновление треда.</b><br />(Кликните, чтобы закрыть)", stopFuckingDolls: "<b>Отключите AJAX-отправку постов и AJAX-обновление треда.</b><br />(Кликните, чтобы закрыть)",
@ -184,18 +184,18 @@ var _l = (typeof locale !== 'undefined' && _messages.hasOwnProperty(locale)) ? _
function trace() { function trace() {
if (!console.log) return; if (!console.log) return;
var f = arguments.callee.caller; var f = arguments.callee.caller;
var path = arguments[0]; var path = arguments[0];
if (path == '') path += "trace()"; if (path == '') path += "trace()";
while (f != null) { while (f != null) {
var re = /function ([^\(]+)/; var re = /function ([^\(]+)/;
var fname = re.exec(f.toString()); var fname = re.exec(f.toString());
if (fname == null) fname = ''; else fname = fname[1]; if (fname == null) fname = ''; else fname = fname[1];
var args = []; var args = [];
for (var i = 0; i < f.arguments.length; i++) args.push(f.arguments[i]); for (var i = 0; i < f.arguments.length; i++) args.push(f.arguments[i]);
fname += "(" + args.join(', ') + ")"; fname += "(" + args.join(', ') + ")";
path += ' <- ' + fname; path += ' <- ' + fname;
f = f.caller; f = f.caller;
} }
@ -222,7 +222,7 @@ if (!Array.prototype.indexOf) {
return -1; return -1;
}; };
} }
/* Utf8 strings de-/encoder */ /* Utf8 strings de-/encoder */
var Utf8 = { var Utf8 = {
// public method for url encoding // public method for url encoding
@ -291,7 +291,7 @@ function Cookie(name) {
document.cookie=name+"="+value+expires+"; path=/"; document.cookie=name+"="+value+expires+"; path=/";
} }
} }
function replaceAll(str, from, to) { function replaceAll(str, from, to) {
var idx = str.indexOf( from ); var idx = str.indexOf( from );
@ -306,10 +306,10 @@ function replaceAll(str, from, to) {
function insert(text) { function insert(text) {
var textarea = (($('#postclone').length && $('#postclone').css('display') !== 'none') ? $('#postclone') : $('#postform')).find('textarea')[0]; var textarea = (($('#postclone').length && $('#postclone').css('display') !== 'none') ? $('#postclone') : $('#postform')).find('textarea')[0];
if(textarea) { if(textarea) {
if(textarea.createTextRange && textarea.caretPos) { // IE if(textarea.createTextRange && textarea.caretPos) { // IE
var caretPos=textarea.caretPos; var caretPos=textarea.caretPos;
caretPos.text=caretPos.text.charAt(caretPos.text.length-1)==" "?text+" ":text; caretPos.text=caretPos.text.charAt(caretPos.text.length-1)==" "?text+" ":text;
} else if(textarea.setSelectionRange) { // Firefox } else if(textarea.setSelectionRange) { // Firefox
var start=textarea.selectionStart; var start=textarea.selectionStart;
var end=textarea.selectionEnd; var end=textarea.selectionEnd;
textarea.value=textarea.value.substr(0,start)+text+textarea.value.substr(end); textarea.value=textarea.value.substr(0,start)+text+textarea.value.substr(end);
@ -355,14 +355,14 @@ function bullets($target, bullet, istart, iend) {
if(i < (selected.length - 1)) newtxt += '\n'; if(i < (selected.length - 1)) newtxt += '\n';
} }
$area.val( $area.val(
$area.val().substring(0, startPos) $area.val().substring(0, startPos)
+ newtxt + + newtxt +
$area.val().substring(endPos) $area.val().substring(endPos)
); );
} }
} }
function quote(b, a) { function quote(b, a) {
var v = eval("document." + a + ".message"); var v = eval("document." + a + ".message");
v.value += ">>" + b + "\n"; v.value += ">>" + b + "\n";
v.focus(); v.focus();
@ -394,8 +394,8 @@ function highlight(id, offTimeout=0) {
, spaceAround = docHeight - bcr.height , spaceAround = docHeight - bcr.height
window.scrollTo(0, postX - (spaceAround ? Math.ceil(spaceAround/2) : 0)) window.scrollTo(0, postX - (spaceAround ? Math.ceil(spaceAround/2) : 0))
} }
} }
function get_password(name) { function get_password(name) {
var pass = getCookie(name); var pass = getCookie(name);
if(pass) return pass; if(pass) return pass;
@ -425,8 +425,8 @@ function togglePassword() {
function toggleOptions(D,C,B){ trace('deprecated!') } function toggleOptions(D,C,B){ trace('deprecated!') }
// proxied functions // proxied functions
function getCookie(name) { return Cookie(name) } function getCookie(name) { return Cookie(name) }
function set_cookie(name,value,days) { return Cookie(name,value,days) } function set_cookie(name,value,days) { return Cookie(name,value,days) }
var Styles = { var Styles = {
all: [], titles: [], all: [], titles: [],
@ -462,8 +462,8 @@ var Styles = {
}) })
this.$cancelLink = $('<div style="font-weight: bold"></div>').append($clink) this.$cancelLink = $('<div style="font-weight: bold"></div>').append($clink)
return return
} }
if(this.hasOwnProperty('custom') && !this.customBypass) if(this.hasOwnProperty('custom') && !this.customBypass)
return this.setCustom(); return this.setCustom();
var sc = getCookie(style_cookie); var sc = getCookie(style_cookie);
if(sc && in_array(sc, this.titles)) if(sc && in_array(sc, this.titles))
@ -471,7 +471,7 @@ var Styles = {
else { else {
this.setDefault(); this.setDefault();
set_cookie("kustyle_site",this._default,365); set_cookie("kustyle_site",this._default,365);
set_cookie("kustyle",this._default,365); set_cookie("kustyle",this._default,365);
} }
}, },
change: function(stylename) { change: function(stylename) {
@ -484,7 +484,7 @@ var Styles = {
if(this.hasOwnProperty('custom')) if(this.hasOwnProperty('custom'))
this.addBypass(); this.addBypass();
set_cookie("kustyle_site",stylename,365); set_cookie("kustyle_site",stylename,365);
set_cookie("kustyle",stylename,365); set_cookie("kustyle",stylename,365);
} }
}, },
removeBypass: function() { removeBypass: function() {
@ -575,13 +575,13 @@ function delandbanlinks($scope=$('body')) {
let dnbinfo = $(this).attr('id').split('-') let dnbinfo = $(this).attr('id').split('-')
/*, newhtml = ` /*, newhtml = `
<span class="btngroup"> <span class="btngroup">
<a href="${ku_cgipath}/manage_page.php?action=delposts&amp;boarddir=${dnbinfo[1]}&amp;del${dnbinfo[3] == 'y' ? 'thread' : 'post'}id=${dnbinfo[2]}" title="${_l.del}" <a href="${ku_cgipath}/manage_page.php?action=delposts&amp;boarddir=${dnbinfo[1]}&amp;del${dnbinfo[3] == 'y' ? 'thread' : 'post'}id=${dnbinfo[2]}" title="${_l.del}"
onclick="return confirm('${_l.delPost}?');"> onclick="return confirm('${_l.delPost}?');">
<svg class="icon b-icon sb-l"> <svg class="icon b-icon sb-l">
<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#i-x"></use> <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#i-x"></use>
</svg> </svg>
</a> </a>
<a href="${ku_cgipath}/manage_page.php?action=delposts&amp;boarddir=${dnbinfo[1]}&amp;del${dnbinfo[3] == 'y' ? 'thread' : 'post'}id=${dnbinfo[2]}&amp;postid=${dnbinfo[2]}" <a href="${ku_cgipath}/manage_page.php?action=delposts&amp;boarddir=${dnbinfo[1]}&amp;del${dnbinfo[3] == 'y' ? 'thread' : 'post'}id=${dnbinfo[2]}&amp;postid=${dnbinfo[2]}"
title="Удалить и забанить" onclick="return confirm('${_l.delAndBan}?');"> title="Удалить и забанить" onclick="return confirm('${_l.delAndBan}?');">
<svg class="icon b-icon sb-c"> <svg class="icon b-icon sb-c">
<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#i-and"></use> <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#i-and"></use>
@ -604,25 +604,25 @@ function delandbanlinks($scope=$('body')) {
if (dnbinfo[3] == 'y') { if (dnbinfo[3] == 'y') {
newhtml += ` newhtml += `
<a class="stickypost-btn" onclick="Ajax.modThread(this, 'stickypost'); return false" <a class="stickypost-btn" onclick="Ajax.modThread(this, 'stickypost'); return false"
href="${ku_cgipath}/manage_page.php?action=stickypost&amp;board=${dnbinfo[1]}&amp;postid=${dnbinfo[2]}" title="${_l.stickthread}"> href="${ku_cgipath}/manage_page.php?action=stickypost&amp;board=${dnbinfo[1]}&amp;postid=${dnbinfo[2]}" title="${_l.stickthread}">
<svg class="icon b-icon"> <svg class="icon b-icon">
<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#i-pin"></use> <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#i-pin"></use>
</svg> </svg>
</a> </a>
<a class="unstickypost-btn" onclick="Ajax.modThread(this, 'unstickypost'); return false" <a class="unstickypost-btn" onclick="Ajax.modThread(this, 'unstickypost'); return false"
href="${ku_cgipath}/manage_page.php?action=unstickypost&amp;board=${dnbinfo[1]}&amp;postid=${dnbinfo[2]}" title="${_l.unstickthread}"> href="${ku_cgipath}/manage_page.php?action=unstickypost&amp;board=${dnbinfo[1]}&amp;postid=${dnbinfo[2]}" title="${_l.unstickthread}">
<svg class="icon b-icon"> <svg class="icon b-icon">
<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#i-unpin"></use> <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#i-unpin"></use>
</svg> </svg>
</a> </a>
<a class="lockpost-btn" onclick="Ajax.modThread(this, 'lockpost'); return false" <a class="lockpost-btn" onclick="Ajax.modThread(this, 'lockpost'); return false"
href="${ku_cgipath}/manage_page.php?action=lockpost&amp;board=${dnbinfo[1]}&amp;postid=${dnbinfo[2]}" title="${_l.lockthread}"> href="${ku_cgipath}/manage_page.php?action=lockpost&amp;board=${dnbinfo[1]}&amp;postid=${dnbinfo[2]}" title="${_l.lockthread}">
<svg class="icon b-icon"> <svg class="icon b-icon">
<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#i-lock"></use> <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#i-lock"></use>
</svg> </svg>
</a> </a>
<a class="unlockpost-btn" onclick="Ajax.modThread(this, 'unlockpost'); return false" <a class="unlockpost-btn" onclick="Ajax.modThread(this, 'unlockpost'); return false"
href="${ku_cgipath}/manage_page.php?action=unlockpost&amp;board=${dnbinfo[1]}&amp;postid=${dnbinfo[2]}" title="${_l.unlockthread}"> href="${ku_cgipath}/manage_page.php?action=unlockpost&amp;board=${dnbinfo[1]}&amp;postid=${dnbinfo[2]}" title="${_l.unlockthread}">
<svg class="icon b-icon"> <svg class="icon b-icon">
<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#i-unlock"></use> <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#i-unlock"></use>
@ -646,7 +646,7 @@ var HiddenThreads = {
return list.split(','); return list.split(',');
}, },
isHidden: function(threadid) { return HiddenThreads.list().indexOf(threadid) != -1 }, isHidden: function(threadid) { return HiddenThreads.list().indexOf(threadid) != -1 },
hide: function(threadid) { hide: function(threadid) {
if (localStorage == null) alert(_l.noLocalStorage); if (localStorage == null) alert(_l.noLocalStorage);
else { else {
var newlist = HiddenThreads.list(); var newlist = HiddenThreads.list();
@ -654,7 +654,7 @@ var HiddenThreads = {
localStorage.setItem('hiddenThreads.' + this_board_dir, newlist.join(',')); localStorage.setItem('hiddenThreads.' + this_board_dir, newlist.join(','));
} }
}, },
unhide: function(threadid) { unhide: function(threadid) {
if (localStorage == null) alert(_l.noLocalStorage); if (localStorage == null) alert(_l.noLocalStorage);
else { else {
var list = HiddenThreads.list(); var list = HiddenThreads.list();
@ -666,7 +666,7 @@ var HiddenThreads = {
} }
} }
} }
function togglethread(threadid) { function togglethread(threadid) {
if (HiddenThreads.isHidden(threadid)) { if (HiddenThreads.isHidden(threadid)) {
$('#unhidethread' + threadid + this_board_dir).slideUp(); $('#unhidethread' + threadid + this_board_dir).slideUp();
@ -679,7 +679,7 @@ function togglethread(threadid) {
} }
return false; return false;
} }
function toggleblotter() { function toggleblotter() {
$('.blotter-entries').each(function(index,element) { $('.blotter-entries').each(function(index,element) {
$(this).slideToggle(function() { $(this).slideToggle(function() {
@ -723,7 +723,7 @@ function expandthread(threadid, board, ev) {
}) })
} }
return false; return false;
} }
function getnewposts(threadid=null, scrollToID=null, onError = () => 'error') { function getnewposts(threadid=null, scrollToID=null, onError = () => 'error') {
if(threadid===null) { if(threadid===null) {
@ -751,8 +751,8 @@ function getnewposts(threadid=null, scrollToID=null, onError = () => 'error') {
replies_container.insertAdjacentHTML('beforeend', posts) replies_container.insertAdjacentHTML('beforeend', posts)
if (scrollToID) { if (scrollToID) {
let allPosts = replies_container.querySelectorAll('.reply') let allPosts = replies_container.querySelectorAll('.reply')
, targetReply = scrollToID=='last' , targetReply = scrollToID=='last'
? allPosts[allPosts.length-1] ? allPosts[allPosts.length-1]
: Array.prototype.find.call(allPosts, post => post.querySelector(`a[name="${scrollToID}"]`)) : Array.prototype.find.call(allPosts, post => post.querySelector(`a[name="${scrollToID}"]`))
if (! targetReply) { if (! targetReply) {
return onError(); return onError();
@ -780,7 +780,7 @@ function showLinks(ev) {
left: $(this).offset().left left: $(this).offset().left
}).fadeIn('fast'); }).fadeIn('fast');
return false; return false;
} }
if(localStorage['pinPreference'] === 'pinned') if(localStorage['pinPreference'] === 'pinned')
localStorage['pinForm'] = 0; localStorage['pinForm'] = 0;
if(localStorage['pinPreference'] === 'unpinned') if(localStorage['pinPreference'] === 'unpinned')
@ -829,8 +829,8 @@ function quickreply(ev) {
} }
insert('>>'+current+'\n'); insert('>>'+current+'\n');
return false; return false;
} }
function getwatchedthreads(threadid, board) { function getwatchedthreads(threadid, board) {
if ($('#watchedthreadlist').get()!='') { if ($('#watchedthreadlist').get()!='') {
$('#watchedthreadlist').html(_l.loading + '...'); $('#watchedthreadlist').html(_l.loading + '...');
@ -844,7 +844,7 @@ function getwatchedthreads(threadid, board) {
} }
}); });
} }
} }
function popupMessage(content, delay=1000) { function popupMessage(content, delay=1000) {
if ($('#popupMessage').get() == '') { if ($('#popupMessage').get() == '') {
@ -874,7 +874,7 @@ function addtowatchedthreads(threadid, board) {
}); });
} }
} }
function removefromwatchedthreads(threadid, board) { function removefromwatchedthreads(threadid, board) {
if ($('#watchedthreadlist').get()!='') { if ($('#watchedthreadlist').get()!='') {
$.ajax({ $.ajax({
@ -889,12 +889,12 @@ function removefromwatchedthreads(threadid, board) {
}); });
} }
} }
function hidewatchedthreads() { function hidewatchedthreads() {
Cookie('showwatchedthreads','0',30); Cookie('showwatchedthreads','0',30);
$("#watchedthreads").fadeOut(); $("#watchedthreads").fadeOut();
} }
function showwatchedthreads() { function showwatchedthreads() {
Cookie('showwatchedthreads','1',30); Cookie('showwatchedthreads','1',30);
window.location.reload(true); window.location.reload(true);
@ -909,7 +909,7 @@ var Captcha = {
-o-animation-duration: ${captchaTimeout}s; -o-animation-duration: ${captchaTimeout}s;
animation-duration: ${captchaTimeout}s; animation-duration: ${captchaTimeout}s;
} }
.cw-running .captchaimage, .cw-running .captchaimage,
.cw-running .rotten-msg { .cw-running .rotten-msg {
-webkit-animation-delay: ${captchaTimeout}s; -webkit-animation-delay: ${captchaTimeout}s;
-o-animation-delay: ${captchaTimeout}s; -o-animation-delay: ${captchaTimeout}s;
@ -954,7 +954,7 @@ function handleSubmit(form) {
let captchafield = form.querySelector('input[name=captcha]') let captchafield = form.querySelector('input[name=captcha]')
if (captchafield && !captchafield.value.length) if (captchafield && !captchafield.value.length)
return popupMessage(_l.enterCaptcha) return popupMessage(_l.enterCaptcha)
if (form.id === 'postclone') if (form.id === 'postclone')
ffdata.save() ffdata.save()
Ajax.submitPost(form) Ajax.submitPost(form)
} }
@ -1032,7 +1032,7 @@ const Ajax = {
} }
xr.send(fd) xr.send(fd)
}, },
deletePost: function(form) { deletePost: function(form) {
let fd = new FormData(form) let fd = new FormData(form)
, xr = new XMLHttpRequest() , xr = new XMLHttpRequest()
fd.append('AJAX', 1) fd.append('AJAX', 1)
@ -1099,7 +1099,7 @@ const Ajax = {
} }
xr.send(fd) xr.send(fd)
}, },
reportPost: function(form) { reportPost: function(form) {
let fd = new FormData(form) let fd = new FormData(form)
, xr = new XMLHttpRequest() , xr = new XMLHttpRequest()
fd.append('AJAX', 1) fd.append('AJAX', 1)
@ -1259,7 +1259,7 @@ const Ajax = {
function inspectFormData(formData) { function inspectFormData(formData) {
for (var pair of formData.entries()) { for (var pair of formData.entries()) {
console.log(pair[0]+ ', ' + pair[1]); console.log(pair[0]+ ', ' + pair[1]);
} }
} }
@ -1272,7 +1272,7 @@ function expandimg(postnum, imgurl, thumburl, imgw, imgh, thumbw, thumbh) {
, fc_width , fc_width
if(typeof event !== 'undefined' && event.which === 2) return true; if(typeof event !== 'undefined' && event.which === 2) return true;
if (element.getElementsByTagName('img')[0].getAttribute('alt').substring(0,4)!='full') { if (element.getElementsByTagName('img')[0].getAttribute('alt').substring(0,4)!='full') {
$element.html('<img src="'+imgurl+'" alt="full'+postnum+'" class="thumb" height="'+imgh+'" width="'+imgw+'">'); $element.html('<img src="'+imgurl+'" alt="full'+postnum+'" class="thumb" height="'+imgh+'" width="'+imgw+'">');
if (! Settings.expandImgFull()) { if (! Settings.expandImgFull()) {
let img = element.getElementsByTagName('img')[0] let img = element.getElementsByTagName('img')[0]
, max_w = document.documentElement?document.documentElement.clientWidth : document.body.clientWidth , max_w = document.documentElement?document.documentElement.clientWidth : document.body.clientWidth
@ -1290,9 +1290,9 @@ function expandimg(postnum, imgurl, thumburl, imgw, imgh, thumbw, thumbh) {
var new_h = new_w / ratio; var new_h = new_w / ratio;
var notice = document.createElement('div'); var notice = document.createElement('div');
notice.setAttribute('class', 'filesize'); notice.setAttribute('class', 'filesize');
notice.style.textDecoration = 'underline'; notice.style.textDecoration = 'underline';
var textNode = document.createTextNode(_l.imageDownscaledBy + " " + Math.round(zoom*100) + "% "+_l.toFit); var textNode = document.createTextNode(_l.imageDownscaledBy + " " + Math.round(zoom*100) + "% "+_l.toFit);
notice.appendChild(textNode); notice.appendChild(textNode);
element.insertBefore(notice, img); element.insertBefore(notice, img);
$(img).width(new_w); $(img).width(new_w);
$(img).height(new_h); $(img).height(new_h);
@ -1302,7 +1302,7 @@ function expandimg(postnum, imgurl, thumburl, imgw, imgh, thumbw, thumbh) {
else else
fc_width = imgw fc_width = imgw
if ($postbody) $postbody.addClass('postbody-expanded') if ($postbody) $postbody.addClass('postbody-expanded')
} }
else { else {
element.innerHTML = '<img src="' + thumburl + '" alt="' + postnum + '" class="thumb" height="' + thumbh + '" width="' + thumbw + '">'; element.innerHTML = '<img src="' + thumburl + '" alt="' + postnum + '" class="thumb" height="' + thumbh + '" width="' + thumbw + '">';
fc_width = thumbw fc_width = thumbw
@ -1342,7 +1342,7 @@ var PostPreviews = {
if (preview.length == 0) { if (preview.length == 0) {
$('body').children().first().before('<div id="'+previewid+'"></div>'); $('body').children().first().before('<div id="'+previewid+'"></div>');
preview = $('#' + previewid); preview = $('#' + previewid);
preview.addClass('reflinkpreview content-background pre-hidden actual-reflinkpreview'); preview.addClass('reflinkpreview content-background pre-hidden actual-reflinkpreview');
preview.mouseleave(PostPreviews._mouseout); preview.mouseleave(PostPreviews._mouseout);
preview.mouseover(PostPreviews.onMouseOver); preview.mouseover(PostPreviews.onMouseOver);
} }
@ -1351,23 +1351,23 @@ var PostPreviews = {
if (previewid == parent.attr('id')) return; // anti-recursion if (previewid == parent.attr('id')) return; // anti-recursion
for (var id in PostPreviews.parent) { if (id == previewid || PostPreviews.parent[id] == previewid) return } for (var id in PostPreviews.parent) { if (id == previewid || PostPreviews.parent[id] == previewid) return }
PostPreviews.parent[previewid] = parent.attr('id'); PostPreviews.parent[previewid] = parent.attr('id');
} }
else { else {
PostPreviews.parent = []; PostPreviews.parent = [];
} }
let transformOrigin; let transformOrigin;
if(e.clientY < ($(window).height() / 1.5)) { if(e.clientY < ($(window).height() / 1.5)) {
preview.css({top:e.pageY+5}); preview.css({top:e.pageY+5});
transformOrigin = "top " transformOrigin = "top "
} else { } else {
preview.css({bottom:$(window).height()-e.pageY+5}); preview.css({bottom:$(window).height()-e.pageY+5});
transformOrigin = "bottom " transformOrigin = "bottom "
} }
if(e.clientX < ($(window).width() / 1.5)) { if(e.clientX < ($(window).width() / 1.5)) {
preview.css({left:e.pageX+15}); preview.css({left:e.pageX+15});
transformOrigin += "left" transformOrigin += "left"
} else { } else {
preview.css({right:$(window).width()-e.pageX+15}); preview.css({right:$(window).width()-e.pageX+15});
transformOrigin += "right" transformOrigin += "right"
} }
preview.css({zIndex: PostPreviews.zindex++, "transform-origin": transformOrigin}); preview.css({zIndex: PostPreviews.zindex++, "transform-origin": transformOrigin});
@ -1419,7 +1419,7 @@ var PostPreviews = {
pre.remove(); pre.remove();
}, PostPreviews._timings.transition) }, PostPreviews._timings.transition)
}, PostPreviews._timings.fade) }, PostPreviews._timings.fade)
preview = $('#' + PostPreviews.parent[preview.attr('id')]); preview = $('#' + PostPreviews.parent[preview.attr('id')]);
} }
}, },
@ -1432,7 +1432,7 @@ var PostPreviews = {
/* txt only. deleted. src in clean */ /* txt only. deleted. src in clean */
function postpreview(D,A,C,B){} function postpreview(D,A,C,B){}
function set_inputs(id) { function set_inputs(id) {
let form = document.getElementById(id) let form = document.getElementById(id)
if (form) { if (form) {
@ -1442,7 +1442,7 @@ function set_inputs(id) {
if(!form.postpassword.value) form.postpassword.value = get_password("postpassword"); if(!form.postpassword.value) form.postpassword.value = get_password("postpassword");
} }
} }
function set_delpass(id) { function set_delpass(id) {
let form = document.getElementById(id) let form = document.getElementById(id)
if (! form) return; if (! form) return;
@ -1450,7 +1450,7 @@ function set_delpass(id) {
if (postpassword && !postpassword.value) { if (postpassword && !postpassword.value) {
postpassword.value = get_password("postpassword"); postpassword.value = get_password("postpassword");
} }
} }
(function ($) { (function ($) {
$.event.special.load = { $.event.special.load = {
@ -1487,20 +1487,20 @@ var Settings = {
// update checkbox (called on load) // update checkbox (called on load)
if (localStorage[settingName] == 'true') if (localStorage[settingName] == 'true')
$('#settings_' + settingName).attr("checked","checked"); $('#settings_' + settingName).attr("checked","checked");
else else
$('#settings_' + settingName).removeAttr("checked"); $('#settings_' + settingName).removeAttr("checked");
} }
return (localStorage[settingName] == 'true') || (localStorage[settingName] == true) ; return (localStorage[settingName] == 'true') || (localStorage[settingName] == true) ;
}, },
fxEnabled: function(changed) { fxEnabled: function(changed) {
var enabled = Settings._checkbox(changed, 'fxEnabled', true); var enabled = Settings._checkbox(changed, 'fxEnabled', true);
if (changed != null) { if (changed != null) {
$.fx.off = !enabled; $.fx.off = !enabled;
} }
return enabled; return enabled;
}, },
showReplies: function(changed) { showReplies: function(changed) {
var enabled = Settings._checkbox(changed, 'showReplies', true); var enabled = Settings._checkbox(changed, 'showReplies', true);
if (changed != null) { if (changed != null) {
@ -1516,7 +1516,7 @@ var Settings = {
} }
return enabled; return enabled;
}, },
sfwMode: function(changed) { sfwMode: function(changed) {
var enabled = Settings._checkbox(changed, 'sfwMode', false); var enabled = Settings._checkbox(changed, 'sfwMode', false);
if (enabled) { if (enabled) {
@ -1527,7 +1527,7 @@ var Settings = {
} }
return enabled; return enabled;
}, },
expandImgFull: function(changed) { expandImgFull: function(changed) {
return Settings._checkbox(changed, 'expandImgFull', false); return Settings._checkbox(changed, 'expandImgFull', false);
}, },
@ -1587,7 +1587,7 @@ function readyset() {
if(Styles.$cancelLink) if(Styles.$cancelLink)
$('#js_settings').prepend(Styles.$cancelLink) $('#js_settings').prepend(Styles.$cancelLink)
LatexIT.init(); LatexIT.init();
checkhighlight(); checkhighlight();
checkgotothread(); checkgotothread();
@ -1640,15 +1640,15 @@ function readyset() {
return false; return false;
}); });
$('body').click(function(event) { $('body').click(function(event) {
menu_show('_off_'); menu_show('_off_');
$('[id^=preview]').addClass('pre-hidden') $('[id^=preview]').addClass('pre-hidden')
setTimeout(() => { setTimeout(() => {
$('[id^=preview]').remove(); $('[id^=preview]').remove();
}, PostPreviews._timings.transition) }, PostPreviews._timings.transition)
}); });
$('.mobile-nav').show(); $('.mobile-nav').show();
$('body').on('click', "a[class^='ref']", PostPreviews._mouseover); $('body').on('click', "a[class^='ref']", PostPreviews._mouseover);
injector.inject('mb', 'body {margin-bottom: 350px;}') injector.inject('mb', 'body {margin-bottom: 350px;}')
} }
@ -1710,17 +1710,17 @@ function readyset() {
'</span>').appendTo('#postclone'); '</span>').appendTo('#postclone');
//Dollscript rape begins //Dollscript rape begins
//Switch captcha language //Switch captcha language
/*dcxt.addTask(function() { /*dcxt.addTask(function() {
dcxt.openSettings(); dcxt.openSettings();
//Switch to "form" tab //Switch to "form" tab
$('.de-cfg-tab[info=form]')[0].click(); $('.de-cfg-tab[info=form]')[0].click();
//Switch language if it's set wrong //Switch language if it's set wrong
if(captchalang == 'ru' && $('select[info=captchaLang] option:selected').val() !== $('select[info=captchaLang] option:contains(Rus)').val()) { if(captchalang == 'ru' && $('select[info=captchaLang] option:selected').val() !== $('select[info=captchaLang] option:contains(Rus)').val()) {
$('select[info=captchaLang]').val($('select[info=captchaLang] option:contains(Rus)').val()).triggerNative('change'); $('select[info=captchaLang]').val($('select[info=captchaLang] option:contains(Rus)').val()).triggerNative('change');
} }
if(captchalang == 'en' && $('select[info=captchaLang] option:selected').val() !== $('select[info=captchaLang] option:contains(Eng)').val()) { if(captchalang == 'en' && $('select[info=captchaLang] option:selected').val() !== $('select[info=captchaLang] option:contains(Eng)').val()) {
$('select[info=captchaLang]').val($('select[info=captchaLang] option:contains(Eng)').val()).triggerNative('change'); $('select[info=captchaLang]').val($('select[info=captchaLang] option:contains(Eng)').val()).triggerNative('change');
} }
dcxt.closeSettings(); dcxt.closeSettings();
});*/ });*/
@ -1733,7 +1733,7 @@ function readyset() {
var socket = io.connect(liveupd_api); var socket = io.connect(liveupd_api);
if(ispage) { if(ispage) {
var subscribeTo = [liveupd_sitename+this_board_dir+':newthreads']; var subscribeTo = [liveupd_sitename+this_board_dir+':newthreads'];
$('.op .reflink').children(':last-child').each(function() { $('.op .reflink').children(':last-child').each(function() {
subscribeTo.push(liveupd_sitename+this_board_dir+':'+$(this).text()); subscribeTo.push(liveupd_sitename+this_board_dir+':'+$(this).text());
}); });
socket.on('update', updater.bpageNotify) socket.on('update', updater.bpageNotify)
@ -1819,7 +1819,7 @@ function readyset() {
} }
$('body').on('click', '.posttypeindicator a', function() { $('body').on('click', '.posttypeindicator a', function() {
var xl = $(this); var xl = $(this);
var offset = $('[name="' + xl.attr('href').substr(1) + '"]').offset() || $('[name="' + xl.text().split('>>')[1] + '"]').offset() || false; var offset = $('[name="' + xl.attr('href').substr(1) + '"]').offset() || $('[name="' + xl.text().split('>>')[1] + '"]').offset() || false;
if(offset) { if(offset) {
$('html, body').animate({ $('html, body').animate({
@ -1845,19 +1845,19 @@ function readyset() {
$('#directLink, #quoteLink').on("click", function() { $(this).select(); }); $('#directLink, #quoteLink').on("click", function() { $(this).select(); });
//Ultimate YOBA Youtube embeds //Ultimate YOBA Youtube embeds
$('body').on('click','.embed-play-button', function(ev) { $('body').on('click','.embed-play-button', function(ev) {
ev.preventDefault() ev.preventDefault()
unwrapEmbed($(this).parents('figure')) unwrapEmbed($(this).parents('figure'))
}); });
$('body').on('click','.collapse-video', function(ev) { $('body').on('click','.collapse-video', function(ev) {
ev.preventDefault() ev.preventDefault()
wrapEmbed($(this).parents('figure')) wrapEmbed($(this).parents('figure'))
}); });
// $('body').on('click','.embed', function() {$(this).unwrap() }); // $('body').on('click','.embed', function() {$(this).unwrap() });
//detect node insertions and process them //detect node insertions and process them
$(document).on('animationstart webkitAnimationStart MSAnimationStart oanimationstart', function(event) { $(document).on('animationstart webkitAnimationStart MSAnimationStart oanimationstart', function(event) {
var $target = $(event.target); var $target = $(event.target);
if (event.originalEvent.animationName == "nodeInserted" && !$target.hasClass('_inserted_')) if (event.originalEvent.animationName == "nodeInserted" && !$target.hasClass('_inserted_'))
processNodeInsertion($target); processNodeInsertion($target);
}); });
$('body').on('mouseenter', '._country_', function() { $('body').on('mouseenter', '._country_', function() {
@ -1967,13 +1967,13 @@ function readyset() {
// this will be applied to every new inserted node (post) // this will be applied to every new inserted node (post)
function processNodeInsertion($node) { function processNodeInsertion($node) {
if(typeof $node === 'undefined') if(typeof $node === 'undefined')
$node = $('body'); $node = $('body');
else { else {
$node.addClass('_inserted_'); $node.addClass('_inserted_');
$node = $node.parents(":eq(1)"); $node = $node.parents(":eq(1)");
} }
if($node.find('.prettyprint').length) if($node.find('.prettyprint').length)
prettyPrint.apply(window); prettyPrint.apply(window);
LatexIT.render($node); LatexIT.render($node);
processEmbeds($node); processEmbeds($node);
@ -2070,7 +2070,7 @@ var updater = {
if (data) { if (data) {
$target.append($(data)); $target.append($(data));
replyMap.showReplies() replyMap.showReplies()
} else { } else {
popupMessage(_l.noNewPosts); popupMessage(_l.noNewPosts);
} }
@ -2081,7 +2081,7 @@ var updater = {
} }
}); });
}); });
} }
}, },
send: function($form) { send: function($form) {
if(!this.ajaxPosting) { if(!this.ajaxPosting) {
@ -2095,10 +2095,10 @@ function processEmbeds($scope) {
$scope.find('.embed:not(.title-given)').each(function() { $scope.find('.embed:not(.title-given)').each(function() {
var container = $(this); var container = $(this);
var vidID = container.data('id'); var vidID = container.data('id');
if(container.data('site') === 'youtube') { if(container.data('site') === 'youtube') {
$.get('https://www.googleapis.com/youtube/v3/videos?part=id%2Csnippet&id='+vidID+'&key='+ku_youtube_apikey, function(res) { $.get('https://www.googleapis.com/youtube/v3/videos?part=id%2Csnippet&id='+vidID+'&key='+ku_youtube_apikey, function(res) {
if(!res.error && res.items.length) { if(!res.error && res.items.length) {
var videotitle = res.items[0].snippet.title; var videotitle = res.items[0].snippet.title;
container.append($('<a target="_blank" title="'+_l.watchOn+' Youtube"></a>').addClass('yt-title-overlay').text(videotitle).attr('href', 'http://www.youtube.com/watch?v='+vidID) container.append($('<a target="_blank" title="'+_l.watchOn+' Youtube"></a>').addClass('yt-title-overlay').text(videotitle).attr('href', 'http://www.youtube.com/watch?v='+vidID)
.click(function(ev) { ev.stopPropagation(); })); .click(function(ev) { ev.stopPropagation(); }));
} }
@ -2132,9 +2132,9 @@ if (+localStorage['localmod']) {
else { else {
let kumod = getCookie('kumod'); let kumod = getCookie('kumod');
if (kumod !== '') { if (kumod !== '') {
if (kumod === 'allboards') if (kumod === 'allboards')
kumod_set = true kumod_set = true
else else
kumod_set = in_array(this_board_dir, kumod.split('|')); kumod_set = in_array(this_board_dir, kumod.split('|'));
} }
} }
@ -2186,7 +2186,7 @@ function expandwebm($mov, ev) {
//good luck understanding this shitcode :^) //good luck understanding this shitcode :^)
let $reply = $mov.parents('.reply') let $reply = $mov.parents('.reply')
if($mov.data('expanded') !== '1') { if($mov.data('expanded') !== '1') {
ev.preventDefault(); ev.preventDefault();
var movieurl = $mov.attr('href'), imgh = $mov.data('height'), imgw = $mov.data('width'), dt = $mov.data('thumb'), postnum = $mov.data('id'); var movieurl = $mov.attr('href'), imgh = $mov.data('height'), imgw = $mov.data('width'), dt = $mov.data('thumb'), postnum = $mov.data('id');
var uid = '_vframe_'+makeid()+(new Date().getTime()); var uid = '_vframe_'+makeid()+(new Date().getTime());
$mov.replaceWith(function() { $mov.replaceWith(function() {
@ -2270,7 +2270,7 @@ function checknamesave(){
if (doc != null) doc.checked = checkd; if (doc != null) doc.checked = checkd;
} }
function checkgotothread(){ function checkgotothread(){
var checkd; var checkd;
if(getCookie('tothread') == 'on') { if(getCookie('tothread') == 'on') {
checkd = true; checkd = true;
} else { } else {
@ -2359,7 +2359,7 @@ function navigatepages (event)
} }
} }
} }
if (window.document.addEventListener) { if (window.document.addEventListener) {
window.document.addEventListener("keydown", navigatepages, false); window.document.addEventListener("keydown", navigatepages, false);
@ -2388,7 +2388,7 @@ var replyMap = {
if (links.length) links.forEach(link => { if (links.length) links.forEach(link => {
let linkData = link.className.split(' ')[0].split('|') let linkData = link.className.split(' ')[0].split('|')
, linkN = linkData[3] , linkN = linkData[3]
, href = linkData[2] !== '' , href = linkData[2] !== ''
? `/${linkData[1]}/res/${linkData[2]}.html#${n}` ? `/${linkData[1]}/res/${linkData[2]}.html#${n}`
: `${ku_boardspath}/postbynumber.php?b=${linkData[1]}&p=${linkData[3]}` : `${ku_boardspath}/postbynumber.php?b=${linkData[1]}&p=${linkData[3]}`
, htm = `<a class="ref-reply" href="${href}">&gt;&gt;${n}</a>` , htm = `<a class="ref-reply" href="${href}">&gt;&gt;${n}</a>`
@ -2421,8 +2421,8 @@ var scrollAnchor = {
dimensions = dimensions || 'vh' dimensions = dimensions || 'vh'
let mid = [window.innerWidth / 2, window.innerHeight / 2] let mid = [window.innerWidth / 2, window.innerHeight / 2]
, elMap = [] , elMap = []
, parentBCR = (parent != window) , parentBCR = (parent != window)
? parent.getBoundingClientRect() ? parent.getBoundingClientRect()
: { : {
left: 0, left: 0,
top: 0, top: 0,
@ -2432,9 +2432,9 @@ var scrollAnchor = {
if ( if (
parent != window parent != window
&& &&
( (
(parentBCR.left <= 0 && parentBCR.right <= 0) (parentBCR.left <= 0 && parentBCR.right <= 0)
|| ||
(parentBCR.top <= 0 && parentBCR.bottom <= 0) (parentBCR.top <= 0 && parentBCR.bottom <= 0)
|| ||
parentBCR.left >= window.innerWidth parentBCR.left >= window.innerWidth
@ -2504,7 +2504,7 @@ Math.pos = x => x >= 0 ? x : 0;
window.requestAnimationFrame = window[vendors[x]+'RequestAnimationFrame']; window.requestAnimationFrame = window[vendors[x]+'RequestAnimationFrame'];
window.cancelAnimationFrame = window[vendors[x]+'CancelAnimationFrame'] || window[vendors[x]+'CancelRequestAnimationFrame']; window.cancelAnimationFrame = window[vendors[x]+'CancelAnimationFrame'] || window[vendors[x]+'CancelRequestAnimationFrame'];
} }
if (!window.requestAnimationFrame) if (!window.requestAnimationFrame)
window.requestAnimationFrame = function(callback, element) { window.requestAnimationFrame = function(callback, element) {
var currTime = new Date().getTime(); var currTime = new Date().getTime();
@ -2513,7 +2513,7 @@ Math.pos = x => x >= 0 ? x : 0;
lastTime = currTime + timeToCall; lastTime = currTime + timeToCall;
return id; return id;
}; };
if (!window.cancelAnimationFrame) if (!window.cancelAnimationFrame)
window.cancelAnimationFrame = function(id) { window.cancelAnimationFrame = function(id) {
clearTimeout(id); clearTimeout(id);
@ -2544,7 +2544,7 @@ function menu_pin(){
if(document.getElementById('overlay_menu').style.position == 'absolute') { if(document.getElementById('overlay_menu').style.position == 'absolute') {
document.getElementById('overlay_menu').style.position = 'fixed'; document.getElementById('overlay_menu').style.position = 'fixed';
Cookie('ku_menutype', 'fixed', 365); Cookie('ku_menutype', 'fixed', 365);
} else { } else {
document.getElementById('overlay_menu').style.position = 'absolute'; document.getElementById('overlay_menu').style.position = 'absolute';
Cookie('ku_menutype', 'absolute', 365); Cookie('ku_menutype', 'absolute', 365);
} }
@ -2568,7 +2568,7 @@ var LatexIT = {
this.mode='svg'; this.mode='svg';
}, },
odc: "javascript:LatexIT.replaceWithSrc(this);", odc: "javascript:LatexIT.replaceWithSrc(this);",
dcls: "Double click to show source", dcls: "Double click to show source",
pre : function(eqn) { pre : function(eqn) {
var txt=eqn.innerHTML; var txt=eqn.innerHTML;
@ -2576,7 +2576,7 @@ var LatexIT = {
{ {
//Clean code //Clean code
txt=txt.replace(/<br>/gi,"").replace(/<br \/>/gi,"").replace(/&amp;/mg,'&'); txt=txt.replace(/<br>/gi,"").replace(/<br \/>/gi,"").replace(/&amp;/mg,'&');
var atxt = "[tex]"+txt+"[/tex]"; var atxt = "[tex]"+txt+"[/tex]";
txt=escape(txt.replace(/\\/mg,'\\')); txt=escape(txt.replace(/\\/mg,'\\'));
// Add coloring according to style of text // Add coloring according to style of text
var c = eval("LatexIT.normalize"+$(eqn).parent().css('color')); var c = eval("LatexIT.normalize"+$(eqn).parent().css('color'));
@ -2585,7 +2585,7 @@ var LatexIT = {
} }
return txt; return txt;
}, },
replaceWithSrc: function(eqn) { replaceWithSrc: function(eqn) {
var txt = $(eqn).attr('alt'); var txt = $(eqn).attr('alt');
$(eqn).parent().html(txt); $(eqn).parent().html(txt);
@ -2597,7 +2597,7 @@ var LatexIT = {
for (var i=0; i<eqn.length; i++) { for (var i=0; i<eqn.length; i++) {
if(eqn[i].getAttribute("lang") == "latex" || eqn[i].getAttribute("xml:lang") == "latex") if(eqn[i].getAttribute("lang") == "latex" || eqn[i].getAttribute("xml:lang") == "latex")
eqn[i].innerHTML = this.pre(eqn[i]); eqn[i].innerHTML = this.pre(eqn[i]);
} }
}, },
normalizergb : function(r, g, b) { normalizergb : function(r, g, b) {
@ -2763,8 +2763,8 @@ function xsend(formid) {
popupMessage(resp.find('.big-shit').text()); popupMessage(resp.find('.big-shit').text());
clearfields($(formid), true); clearfields($(formid), true);
} }
} }
}); });
return false; return false;
} }
@ -3120,7 +3120,7 @@ var countries = {
var bnrs = { var bnrs = {
initiated: false, initiated: false,
init: function() { init: function() {
$.getJSON(ku_boardspath+'/bnrs.json', function(data) { $.getJSON(ku_boardspath+'/bnrs.json', function(data) {
var reduced = []; var reduced = [];
if(data.length > 1) { if(data.length > 1) {
_.each(data, function(bnr) { _.each(data, function(bnr) {
@ -3193,7 +3193,7 @@ var ffdata = {
$('#postclone').show(); $('#postclone').show();
} }
else localStorage.removeItem(key); else localStorage.removeItem(key);
} }
catch(e) { catch(e) {
localStorage.removeItem(key); localStorage.removeItem(key);
@ -3320,7 +3320,7 @@ var catalog = {
$(this).toggleClass('date-on name-on'); $(this).toggleClass('date-on name-on');
}) })
.on('click', '.ce-text .bigThumb', function(ev) { .on('click', '.ce-text .bigThumb', function(ev) {
ev.stopPropagation(); ev.preventDefault(); ev.stopPropagation(); ev.preventDefault();
var $card = $(this).parents('.cat-entry'); var $card = $(this).parents('.cat-entry');
$card.toggleClass('thumbExpanded'); $card.toggleClass('thumbExpanded');
}) })
@ -3329,7 +3329,7 @@ var catalog = {
}) })
.on('animationstart webkitAnimationStart MSAnimationStart oanimationstart', (function(event) { .on('animationstart webkitAnimationStart MSAnimationStart oanimationstart', (function(event) {
var $target = $(event.target); var $target = $(event.target);
if (event.originalEvent.animationName == "embed-image-insert" && !$target.hasClass('_inserted_')) if (event.originalEvent.animationName == "embed-image-insert" && !$target.hasClass('_inserted_'))
this.getEmbedThumb($target); this.getEmbedThumb($target);
}).bind(this)) }).bind(this))
.on('mousedown', '.cat-prv', function(ev) { .on('mousedown', '.cat-prv', function(ev) {
@ -3356,7 +3356,7 @@ var catalog = {
$target.html('<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#i-unhide"></use>'); $target.html('<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#i-unhide"></use>');
HiddenThreads.hide(threadID); HiddenThreads.hide(threadID);
$card.addClass('thread-hidden') $card.addClass('thread-hidden')
} }
else { else {
$target[0].classList.remove('hidden-on'); $target[0].classList.remove('hidden-on');
$target.html('<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#i-hide"></use>'); $target.html('<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#i-hide"></use>');
@ -3438,7 +3438,7 @@ var catalog = {
? ( (locale === 'ru') ? ( (locale === 'ru')
? (dd+'.'+mo+'.'+yy+' в ') ? (dd+'.'+mo+'.'+yy+' в ')
: (mo+'/'+dd+'/'+yy+' @ ') ) : (mo+'/'+dd+'/'+yy+' @ ') )
: ( (locale === 'ru') : ( (locale === 'ru')
? (Dow+' '+dd+' '+Mon+''+yy+' в ') ? (Dow+' '+dd+' '+Mon+''+yy+' в ')
: (mo+'/'+dd+'/'+yy+' ('+Dow+') @ ') ) : (mo+'/'+dd+'/'+yy+' ('+Dow+') @ ') )
) + hh+':'+mm+':'+ss; ) + hh+':'+mm+':'+ss;
@ -3510,7 +3510,7 @@ var catalog = {
let embed = thread.embeds ? (thread.embeds.find(e => e.file != 'removed') || 'removed') : null let embed = thread.embeds ? (thread.embeds.find(e => e.file != 'removed') || 'removed') : null
// for images // for images
if(!embed || embed === 'removed') { if(!embed || embed === 'removed') {
thread.smallThumb = thread.smallThumb =
'<a href="'+thread.url+'" class="smallThumb">\ '<a href="'+thread.url+'" class="smallThumb">\
<div class="nofile-removed ctx">'+(embed === 'removed' ? 'Удалён' : 'No File')+'</div>' <div class="nofile-removed ctx">'+(embed === 'removed' ? 'Удалён' : 'No File')+'</div>'
+'</a>'; +'</a>';
@ -3536,20 +3536,20 @@ var catalog = {
? `${embed.file_type}-${embed.file}-` ? `${embed.file_type}-${embed.file}-`
: embed.file : embed.file
, vartype = embed.file_type == 'mp3' ? ' onerror="switchFileType(this)" extset="jpg,png,gif"' : '' , vartype = embed.file_type == 'mp3' ? ' onerror="switchFileType(this)" extset="jpg,png,gif"' : ''
thread.smallThumb = thread.smallThumb =
'<a href="'+thread.url+'" class="smallThumb">\ '<a href="'+thread.url+'" class="smallThumb">\
<img src="thumb/'+thumbURL+'c.'+ftype+'"'+vartype+'>' <img src="thumb/'+thumbURL+'c.'+ftype+'"'+vartype+'>'
+'</a>'; +'</a>';
thread.bigThumb = thread.bigThumb =
'<img src="thumb/'+thumbURL+'s.'+ftype+'"'+vartype+'>'; '<img src="thumb/'+thumbURL+'s.'+ftype+'"'+vartype+'>';
} }
/*if(_.includes(this.fileTypes.image, thread.file_type)) { /*if(_.includes(this.fileTypes.image, thread.file_type)) {
thread.fileTypeClass = 'image'; thread.fileTypeClass = 'image';
thread.smallThumb = thread.smallThumb =
'<a href="'+thread.url+'" class="smallThumb">\ '<a href="'+thread.url+'" class="smallThumb">\
<img src="thumb/'+thread.file+'c.'+(thread.file_type === 'webm' ? 'jpg' : thread.file_type)+'">' <img src="thumb/'+thread.file+'c.'+(thread.file_type === 'webm' ? 'jpg' : thread.file_type)+'">'
+'</a>'; +'</a>';
thread.bigThumb = thread.bigThumb =
'<img src="thumb/'+thread.file+'s.'+(thread.file_type === 'webm' ? 'jpg' : thread.file_type)+'">'; '<img src="thumb/'+thread.file+'s.'+(thread.file_type === 'webm' ? 'jpg' : thread.file_type)+'">';
}*/ }*/
// small thumbnail for embeds and generic files // small thumbnail for embeds and generic files
@ -3558,14 +3558,14 @@ var catalog = {
? '/inc/filetypes/'+embed.file_type+'.png' ? '/inc/filetypes/'+embed.file_type+'.png'
: '/inc/filetypes/generic'+(_.includes(this.fileTypes.embed, embed.file_type) ? '-embed' : '')+'.png'; : '/inc/filetypes/generic'+(_.includes(this.fileTypes.embed, embed.file_type) ? '-embed' : '')+'.png';
var expandable = _.includes(this.fileTypes.embed, embed.file_type) || _.includes(this.fileTypes.audio, embed.file_type); var expandable = _.includes(this.fileTypes.embed, embed.file_type) || _.includes(this.fileTypes.audio, embed.file_type);
thread.smallThumb = thread.smallThumb =
'<a href="'+thread.url+'" class="smallThumb">\ '<a href="'+thread.url+'" class="smallThumb">\
<img src="'+smallSrc+'">' + <img src="'+smallSrc+'">' +
/*+ ''+(expandable ? playerBtn : '') +*/ /*+ ''+(expandable ? playerBtn : '') +*/
'</a>'; '</a>';
// for audios // for audios
if(_.includes(this.fileTypes.audio, embed.file_type)) { if(_.includes(this.fileTypes.audio, embed.file_type)) {
thread.bigThumb = thread.bigThumb =
'<audio src="src/'+embed.file+'.'+embed.file_type+'" controls></audio>'; '<audio src="src/'+embed.file+'.'+embed.file_type+'" controls></audio>';
} }
} }
@ -3577,7 +3577,7 @@ var catalog = {
} }
// for audios // for audios
if(_.includes(this.fileTypes.audio, thread.file_type)) { if(_.includes(this.fileTypes.audio, thread.file_type)) {
thread.bigThumb = thread.bigThumb =
'<audio src="src/'+thread.file+'.'+thread.file_type+'" controls></audio>'; '<audio src="src/'+thread.file+'.'+thread.file_type+'" controls></audio>';
}*/ }*/
thread.bigThumb = '<a target="_blank" href="'+thread.url+'" class="bigThumb">'+thread.bigThumb+'</a>'; thread.bigThumb = '<a target="_blank" href="'+thread.url+'" class="bigThumb">'+thread.bigThumb+'</a>';
@ -3587,27 +3587,27 @@ var catalog = {
//OP //OP
thread.op = '<a target="_blank" title="'+_l.goToThread+'" target="_blank" href="'+thread.url+'" class="op-number ctx">#'+thread.id+'</a>'; thread.op = '<a target="_blank" title="'+_l.goToThread+'" target="_blank" href="'+thread.url+'" class="op-number ctx">#'+thread.id+'</a>';
//preview //preview
thread.preview = thread.preview =
'<a href="'+thread.url+'#'+thread.id+'" class="actor cat-prv">\ '<a href="'+thread.url+'#'+thread.id+'" class="actor cat-prv">\
<svg class="icon"><use xlink:href="#i-eye"></use></svg>\ <svg class="icon"><use xlink:href="#i-eye"></use></svg>\
</a>'; </a>';
//counters //counters
var repliesLabel = var repliesLabel =
'<svg class="icon"><use xlink:href="#i-reply"></use></svg>\ '<svg class="icon"><use xlink:href="#i-reply"></use></svg>\
<span class="ctx reply-count">'+thread.reply_count+'</span>'; <span class="ctx reply-count">'+thread.reply_count+'</span>';
if(thread.last_reply) if(thread.last_reply)
repliesLabel = '<a href="'+thread.url+'#'+thread.last_reply+'" class="actor cat-prv">'+repliesLabel+'</a>'; repliesLabel = '<a href="'+thread.url+'#'+thread.last_reply+'" class="actor cat-prv">'+repliesLabel+'</a>';
var replies = var replies =
'<div class="infolabel">'+repliesLabel+'</div>', '<div class="infolabel">'+repliesLabel+'</div>',
images = images =
'<div class="infolabel">\ '<div class="infolabel">\
<svg class="icon"><use xlink:href="#i-picture"></use></svg>\ <svg class="icon"><use xlink:href="#i-picture"></use></svg>\
<span class="ctx image-count">'+thread.images+'</span>\ <span class="ctx image-count">'+thread.images+'</span>\
</div>', </div>',
page = page =
'<div class="infolabel il-page">\ '<div class="infolabel il-page">\
<a title="'+_l.threadOnPage+' '+thread.page+'" target="_blank" href="/'+this_board_dir+'/' + ((thread.page > 0) ? thread.page+'.html' : '')+'#'+thread.id+'" class="actor">\ <a title="'+_l.threadOnPage+' '+thread.page+'" target="_blank" href="/'+this_board_dir+'/' + ((thread.page > 0) ? thread.page+'.html' : '')+'#'+thread.id+'" class="actor">\
<svg class="icon"><use xlink:href="#i-page"></use></svg>\ <svg class="icon"><use xlink:href="#i-page"></use></svg>\
@ -3619,16 +3619,16 @@ var catalog = {
//Poster name+date //Poster name+date
thread.posterauthority = +thread.posterauthority; thread.posterauthority = +thread.posterauthority;
thread.nameDatePriority = 'date'; thread.nameDatePriority = 'date';
if(localStorage['cat_nameDatePriority'] == 'name' || if(localStorage['cat_nameDatePriority'] == 'name' ||
(localStorage['cat_nameDatePriority'] != 'date' && (localStorage['cat_nameDatePriority'] != 'date' &&
(thread.name || thread.tripcode || thread.posterauthority) (thread.name || thread.tripcode || thread.posterauthority)
) )
) thread.nameDatePriority = 'name'; ) thread.nameDatePriority = 'name';
// Poster name // Poster name
var poster = var poster =
(thread.name ? '<span class="ctx postername">'+thread.name+'</span>' : '') + (thread.name ? '<span class="ctx postername">'+thread.name+'</span>' : '') +
(thread.tripcode ? '<span class="ctx postertrip">!'+thread.tripcode+'</span>' : '') + (thread.tripcode ? '<span class="ctx postertrip">!'+thread.tripcode+'</span>' : '') +
(thread.posterauthority ? '<span class="ctx admin">&nbsp;##'+this.authorities[thread.posterauthority]+'##</span>' : ''); (thread.posterauthority ? '<span class="ctx admin">&nbsp;##'+this.authorities[thread.posterauthority]+'##</span>' : '');
thread.poster = '<div class="cat-poster"><span class="ctx">by&nbsp;</span>'+ (poster || '<span class="ctx c-postername">'+(this_board_defaultName || _l.anonymous)+'</span>')+'</div>'; thread.poster = '<div class="cat-poster"><span class="ctx">by&nbsp;</span>'+ (poster || '<span class="ctx c-postername">'+(this_board_defaultName || _l.anonymous)+'</span>')+'</div>';
@ -3647,13 +3647,13 @@ var catalog = {
} }
//indicators //indicators
thread = this.buildIndicators(thread); thread = this.buildIndicators(thread);
var html = this.layouts[this.conf.layout].bind(this)(thread); var html = this.layouts[this.conf.layout].bind(this)(thread);
this.rendered[this.conf.layout][thread.id] = html; this.rendered[this.conf.layout][thread.id] = html;
return html return html
}, },
buildIndicators: function(thread) { buildIndicators: function(thread) {
// if(!thread.hasOwnProperty('hidden')) // if(!thread.hasOwnProperty('hidden'))
thread.hidden = _.includes((localStorage['hiddenThreads.'+this_board_dir] || '').split(','), ''+thread.id); thread.hidden = _.includes((localStorage['hiddenThreads.'+this_board_dir] || '').split(','), ''+thread.id);
var pin = thread.stickied ? '<svg class="foradmin-act icon i-layer-1 i-pin"><use xlink:href="#i-pin"></use></svg>' : '', var pin = thread.stickied ? '<svg class="foradmin-act icon i-layer-1 i-pin"><use xlink:href="#i-pin"></use></svg>' : '',
lock = thread.locked ? '<svg class="foradmin-act icon i-layer-1 i-lock"><use xlink:href="#i-lock"></use></svg>' : '', lock = thread.locked ? '<svg class="foradmin-act icon i-layer-1 i-lock"><use xlink:href="#i-lock"></use></svg>' : '',
@ -3768,17 +3768,17 @@ var unreadCounter = {
var HTMLoader = { var HTMLoader = {
loadThread: function(boardID, threadID, done, postID) { loadThread: function(boardID, threadID, done, postID) {
$.get(threadID === '?' $.get(threadID === '?'
? `${ku_boardspath}/postbynumber.php?b=${boardID}&p=${postID}` ? `${ku_boardspath}/postbynumber.php?b=${boardID}&p=${postID}`
: `${ku_boardspath}/${boardID}/res/${threadID}.html?${force_html_nocache ? Math.random() : ''}`) : `${ku_boardspath}/${boardID}/res/${threadID}.html?${force_html_nocache ? Math.random() : ''}`)
.then(data => { .then(data => {
let posts = data.match(/<div\s*?class\s*?=\s*?"[^"]*?i0svcel[^"]*?"\s*?>!i0-pd:[0-9]+\s*?<\/div\s*?>[\s\S]+?<div\s*?class\s*?=\s*?"[^"]*?i0svcel[^"]*?"\s*?>!i0-pd-end\s*?<\/div\s*?>/gi) let posts = data.match(/<div\s*?class\s*?=\s*?"[^"]*?i0svcel[^"]*?"\s*?>!i0-pd:[0-9]+\s*?<\/div\s*?>[\s\S]+?<div\s*?class\s*?=\s*?"[^"]*?i0svcel[^"]*?"\s*?>!i0-pd-end\s*?<\/div\s*?>/gi)
.map(match => { .map(match => {
let res = match.match(/<div\s*?class\s*?=\s*?"[^"]*?i0svcel[^"]*?"\s*?>!i0-pd:([0-9]+)\s*?<\/div\s*?>([\s\S]+?)<div\s*?class\s*?=\s*?"[^"]*?i0svcel[^"]*?"\s*?>!i0-pd-end\s*?<\/div\s*?>/i); let res = match.match(/<div\s*?class\s*?=\s*?"[^"]*?i0svcel[^"]*?"\s*?>!i0-pd:([0-9]+)\s*?<\/div\s*?>([\s\S]+?)<div\s*?class\s*?=\s*?"[^"]*?i0svcel[^"]*?"\s*?>!i0-pd-end\s*?<\/div\s*?>/i);
return { return {
id: +res[1], id: +res[1],
body: res[2] body: res[2]
} }
}) })
if (threadID === '?') { if (threadID === '?') {
let thrno = data.match(/<!--i0:thrno=([0-9]+)-->/) //wtf let thrno = data.match(/<!--i0:thrno=([0-9]+)-->/) //wtf

View File

@ -3,7 +3,7 @@ require 'config.php';
if (!isset($_GET['b']) || !isset($_GET['p'])) { if (!isset($_GET['b']) || !isset($_GET['p'])) {
http_response_code(404); http_response_code(404);
} }
else { else {
$board = $_GET['b']; $board = $_GET['b'];
$post = $_GET['p']; $post = $_GET['p'];