From f453fa1ee3498433476031bbb2b8b9bedde83947 Mon Sep 17 00:00:00 2001 From: Benjamin Southall Date: Tue, 25 Apr 2017 00:49:34 +0900 Subject: [PATCH] Add aditional overboard themes that are similar to ukko but only include certain boards instead of excluding certain boards. In order for them to work ['overboards'] needs to be configured correctly. --- templates/themes/ukko2/info.php | 55 ++++++++++++++ templates/themes/ukko2/theme.php | 155 +++++++++++++++++++++++++++++++++++++++ templates/themes/ukko2/thumb.png | Bin 0 -> 13085 bytes templates/themes/ukko2/ukko.js | 116 +++++++++++++++++++++++++++++ templates/themes/ukko3/info.php | 55 ++++++++++++++ templates/themes/ukko3/theme.php | 155 +++++++++++++++++++++++++++++++++++++++ templates/themes/ukko3/thumb.png | Bin 0 -> 13085 bytes templates/themes/ukko3/ukko.js | 116 +++++++++++++++++++++++++++++ 8 files changed, 652 insertions(+) create mode 100644 templates/themes/ukko2/info.php create mode 100644 templates/themes/ukko2/theme.php create mode 100644 templates/themes/ukko2/thumb.png create mode 100644 templates/themes/ukko2/ukko.js create mode 100644 templates/themes/ukko3/info.php create mode 100644 templates/themes/ukko3/theme.php create mode 100644 templates/themes/ukko3/thumb.png create mode 100644 templates/themes/ukko3/ukko.js diff --git a/templates/themes/ukko2/info.php b/templates/themes/ukko2/info.php new file mode 100644 index 00000000..f7094697 --- /dev/null +++ b/templates/themes/ukko2/info.php @@ -0,0 +1,55 @@ + 'Board name', + 'name' => 'title', + 'type' => 'text', + 'default' => 'Ukko' + ); + $theme['config'][] = array( + 'title' => 'Board URI', + 'name' => 'uri', + 'type' => 'text', + 'default' => '*', + 'comment' => '(ukko for example)' + ); + $theme['config'][] = array( + 'title' => 'Subtitle', + 'name' => 'subtitle', + 'type' => 'text', + 'comment' => '(%s = thread limit. for example "%s freshly bumped threads")' + ); + $theme['config'][] = array( + 'title' => 'included boards', + 'name' => 'include', + 'type' => 'text', + 'comment' => '(space seperated)' + ); + $theme['config'][] = array( + 'title' => 'Number of threads', + 'name' => 'thread_limit', + 'type' => 'text', + 'default' => '15', + ); + // Unique function name for building everything + $theme['build_function'] = 'ukko2_build'; + $theme['install_callback'] = 'ukko2_install'; + + if(!function_exists('ukko2_install')) { + function ukko2_install($settings) { + if (!file_exists($settings['uri'])) + @mkdir($settings['uri'], 0777) or error("Couldn't create " . $settings['uri'] . ". Check permissions.", true); + file_write($settings['uri'] . '/ukko.js', Element('themes/ukko/ukko.js', array())); + } + } + diff --git a/templates/themes/ukko2/theme.php b/templates/themes/ukko2/theme.php new file mode 100644 index 00000000..42074d69 --- /dev/null +++ b/templates/themes/ukko2/theme.php @@ -0,0 +1,155 @@ +settings = $settings; + + if (! ($action == 'all' || $action == 'post' || $action == 'post-thread' || $action == 'post-delete')) { + return; + } + + $action = generation_strategy('sb_ukko2', array()); + + if ($action == 'delete') { + file_unlink($settings['uri'] . '/index.html'); + if ($config['api']['enabled']) { + $jsonFilename = $settings['uri'] . '/0.json'; + file_unlink($jsonFilename); + $jsonFilename = $settings['uri'] . '/catalog.json'; + file_unlink($jsonFilename); + $jsonFilename = $settings['uri'] . '/threads.json'; + file_unlink($jsonFilename); + } + } + elseif ($action == 'rebuild') { + file_write($settings['uri'] . '/index.html', $ukko2->build()); + } + } + + class ukko2 { + public $settings; + public function build($mod = false) { + global $config; + $boards = listBoards(); + + $body = ''; + $overflow = array(); + $board = array( + 'dir' => $this->settings['uri'] . "/", + 'url' => $this->settings['uri'], + 'uri' => $this->settings['uri'], + 'name' => $this->settings['title'], + 'title' => sprintf($this->settings['subtitle'], $this->settings['thread_limit']) + ); + + $boardsforukko2 = array(); + $query = ''; + foreach($boards as &$_board) { + if(in_array($_board['uri'], explode(' ', $this->settings['include']))){ + $query .= sprintf("SELECT *, '%s' AS `board` FROM ``posts_%s`` WHERE `thread` IS NULL UNION ALL ", $_board['uri'], $_board['uri']); + array_push($boardsforukko2,$_board); + } + } + $query = preg_replace('/UNION ALL $/', 'ORDER BY `bump` DESC', $query); + $query = query($query) or error(db_error()); + + $count = 0; + $threads = array(); + if ($config['api']['enabled']) { + $apithreads = array(); + } + while($post = $query->fetch()) { + + if(!isset($threads[$post['board']])) { + $threads[$post['board']] = 1; + } else { + $threads[$post['board']] += 1; + } + + if($count < $this->settings['thread_limit']) { + openBoard($post['board']); + $thread = new Thread($post, $mod ? '?/' : $config['root'], $mod); + + $posts = prepare(sprintf("SELECT * FROM ``posts_%s`` WHERE `thread` = :id ORDER BY `id` DESC LIMIT :limit", $post['board'])); + $posts->bindValue(':id', $post['id']); + $posts->bindValue(':limit', ($post['sticky'] ? $config['threads_preview_sticky'] : $config['threads_preview']), PDO::PARAM_INT); + $posts->execute() or error(db_error($posts)); + + $num_images = 0; + while ($po = $posts->fetch()) { + if ($po['files']) + $num_images++; + $post2 = new Post($po, $mod ? '?/' : $config['root'], $mod); + $thread->add($post2); + + } + if ($posts->rowCount() == ($post['sticky'] ? $config['threads_preview_sticky'] : $config['threads_preview'])) { + $ct = prepare(sprintf("SELECT COUNT(`id`) as `num` FROM ``posts_%s`` WHERE `thread` = :thread UNION ALL SELECT COUNT(`id`) FROM ``posts_%s`` WHERE `files` IS NOT NULL AND `thread` = :thread", $post['board'], $post['board'])); + $ct->bindValue(':thread', $post['id'], PDO::PARAM_INT); + $ct->execute() or error(db_error($count)); + + $c = $ct->fetch(); + $thread->omitted = $c['num'] - ($post['sticky'] ? $config['threads_preview_sticky'] : $config['threads_preview']); + + $c = $ct->fetch(); + $thread->omitted_images = $c['num'] - $num_images; + } + + + $thread->posts = array_reverse($thread->posts); + $body .= '

/' . $post['board'] . '/

'; + $body .= $thread->build(true); + if ($config['api']['enabled']) { + array_push($apithreads,$thread); + } + } else { + $page = 'index'; + if(floor($threads[$post['board']] / $config['threads_per_page']) > 0) { + $page = floor($threads[$post['board']] / $config['threads_per_page']) + 1; + } + $overflow[] = array('id' => $post['id'], 'board' => $post['board'], 'page' => $page . '.html'); + } + + $count += 1; + } + + $body .= ''; + $body .= ''; + + // json api + if ($config['api']['enabled']) { + require_once __DIR__. '/../../../inc/api.php'; + $api = new Api(); + $jsonFilename = $board['dir'] . '0.json'; + $json = json_encode($api->translatePage($apithreads)); + file_write($jsonFilename, $json); + + + $catalog = array(); + $catalog[0] = $apithreads; + + $json = json_encode($api->translateCatalog($catalog)); + $jsonFilename = $board['dir'] . 'catalog.json'; + file_write($jsonFilename, $json); + + $json = json_encode($api->translateCatalog($catalog, true)); + $jsonFilename = $board['dir'] . 'threads.json'; + file_write($jsonFilename, $json); + } + return Element('index.html', array( + 'config' => $config, + 'board' => $board, + 'no_post_form' => $config['overboard_post_form'] ? false : true, + 'body' => $body, + 'mod' => $mod, + 'boardlist' => createBoardlist($mod), + 'boards' => $boardsforukko2 ) + ); + } + + }; + +?> diff --git a/templates/themes/ukko2/thumb.png b/templates/themes/ukko2/thumb.png new file mode 100644 index 0000000000000000000000000000000000000000..eb616ef7d662bddc7b4fec8311ee52df55772aab GIT binary patch literal 13085 zcmV+&GvdsNP)$TuqcCM2ML5E&^DvdXhyU3EWLNX_xi1OJLmjq-Fy2@3lU?50wMML z-mP2TJ$>hO*Z<#tKkp4b@{vDYK6!HcD>k3J`_PWpUtXK3z3eys+5GYIhKZ%|{s;f& z8=28kz`F=Q~h%|G^Zke!^|Th5gVq!g^72c*+?0U#(1f`e4RnReZ!#k#@6 z{J=1?4A2S)K`;mvFb1T(>XL7k+@*6v6B8gf`92~8WMDAu1&qZ!x?eB=23mn3APB1S zi^ah~(i+y#1L|Yn{0XZF1PG)75Plp4$bd95rnN>u_@{w@7&1*i{!e-e_!hiy=s^HO zcp=eK0KTva=qX@>d*q%1dNF{(3x*zgF`%b_UJPLH^Fj|j3+O4J2l8uZ7g2DMga!j3 z2o)IIoo!i8T>vupd7=m1nH7D5NB;ElV{ad;eC=2(v%Pr3mZksvEgE?FW$y@o?iSDk z8u{6~?oVC3({Hk&*IaSpe;qc|_~6ysJY`|FjC%S9@QXqZ1i);Qyr8>+dgcLm;m`yB z@bAA55Tkk+pD)3mne+&AgHUR!HQMWlluB3Y7l;?gFec%%N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z6W0>1 z3?KdwVtKX1?|gS{K}L%F;2KB*0PK0^ub&(}2QXNIdw5jpf2{XA=DvFwQD>k;I^HmJ z+323(>)q(BST@{1_D+#YBCB0rE2E+3Waj|D!i5VdrArns&M7Di3G`Rdn+6*N5lXM@ zdNSy$xfL$TH?ucfXFog|4RDZM=% zpe^70)|!P27x6rQB`$8|isc8lfAR91$q4=4o{lD%rJa`_2(ZK;qG511mExi4kA#JW zjT$v7B_+kRieZ#2)7q-Ne0)!9RWV_>^0dTF=gEHMB0PAuQsck)*_Hl&9u9%5TDc;$ zSC|_-B_JR`rh*F%4hr*D6Tuj)5(o9}^ZNSNX3d(VQmMSXy=Tvwy=BYCp@W71APK>} z3zF;taIV#)Qb7R&{*?@XLdjx`T>N0N0CJk`l#disLMh8&t=@n!9x$N4$zo+$R^#O< zqoSNRa(LN8qvOvV8NdGfnP1GxSx|t0C-|zUep{{Px@@0{qz7=fD4;nH4VDV+M zg;dlv$6U+t3F$TYlTGpq`10dCdHH!KPMkP;^k_mtLPSJF-qlO!&rd1-8*>oDIvVPm zYbydCm|Afna>R2p3_8)<>sPTEhZx+xAq;>iLIe)@7?v|v@H#+t=t-4 zXbnisxKXdwv4Cr;Z%?20(9t8`_YNB{fBt+yl&UJLtQJdVM*7kv&;Iu)g{g?2{9z-w zE+0TMKq5ftuVgorP8ii%5HjihT! zTg|`_tw%tgggmh76iOv;=hMonErRg$=wN1`%EEPD9_F_w;r90q$4B5ubke*RkVd z^qP6|<^s^d+x4eJX|~QZWa8kWu%K{*_1V<=fn2Zma|@n%y>iANFJCp0yzqrxmp#2a reY*FKkWdGc{auBjf~V9BzajY#Mi|@$;@7mp00000NkvXXu0mjfP;YH% literal 0 HcmV?d00001 diff --git a/templates/themes/ukko2/ukko.js b/templates/themes/ukko2/ukko.js new file mode 100644 index 00000000..deeccfd0 --- /dev/null +++ b/templates/themes/ukko2/ukko.js @@ -0,0 +1,116 @@ +(function(){ + +var cache = new Array(), + thread = false, + loading = false, + ukkotimer = false; + +if (localStorage.hiddenboards === undefined) { + localStorage.hiddenboards = "{}"; +} + +// Load data from HTML5 localStorage +var hiddenboards = JSON.parse(localStorage.hiddenboards); + +var storeboards = function() { + localStorage.hiddenboards = JSON.stringify(hiddenboards); +}; + +$(document).ready(function() { + var addukkohide = function() { + var ukkohide = $(''); + var board = $(this).next().data("board"); + var hr = $("
"); + + $(this).append(ukkohide); + $(this).append(hr); + + if (hiddenboards[board] !== true) { + ukkohide.html(_("(hide threads from this board)")); + hr.hide(); + } + else { + ukkohide.html(_("(show threads from this board)")); + $(this).next().hide(); + } + ukkohide.click(function() { + hiddenboards[board] = (hiddenboards[board] !== true); + if (hiddenboards[board] !== true) { + $('[data-board="'+board+'"]:not([data-cached="yes"])').show().prev(). + find('.ukkohide').html(_("(hide threads from this board)")). + parent().find('hr').hide(); + } + else { + $('[data-board="'+board+'"]:not([data-cached="yes"])').hide().prev(). + find('.ukkohide').html(_("(show threads from this board)")) + .parent().find('hr').show(); + } + storeboards(); + return false; + }); + + }; + $("h2").each(addukkohide); + + $('.pages').hide(); + var loadnext = function() { + if (overflow.length == 0) { + $('.pages').show().html(_("No more threads to display")); + } + while($(window).scrollTop() + $(window).height() + 1000 > $(document).height() && !loading && overflow.length > 0) { + var page = modRoot + overflow[0].board + '/' + overflow[0].page; + thread = $('div#thread_' + overflow[0].id + '[data-board="' + overflow[0].board + '"]'); + if (thread.length > 0 && thread.attr("data-cached") !== 'yes') { // already present + overflow.shift(); + continue; + } + + var boardheader = $('

/' + overflow[0].board + '/

'); + + if($.inArray(page, cache) != -1) { + if (thread.length > 0) { + $('div[id*="thread_"]').last().after(thread.attr('data-board', overflow[0].board).attr("data-cached", "no").css('display', 'block')); + boardheader.insertBefore(thread); + addukkohide.call(boardheader); + $(document).trigger('new_post', thread); + } + overflow.shift(); + } else { + loading = true; + $('.pages').show().html(_("Loading...")); + $.get(page, function(data) { + cache.push(page); + + $(data).find('div[id*="thread_"]').each(function() { + var checkout = $(this).attr('id').replace('thread_', ''); + if ($('div#thread_' + checkout + '[data-board="' + overflow[0].board + '"]').length == 0) { + $('form[name="postcontrols"]').prepend($(this).css('display', 'block').attr("data-cached", "yes").attr('data-board', overflow[0].board)); + } + }); + + thread = $('div#thread_' + overflow[0].id + '[data-board="' + overflow[0].board + '"][data-cached="yes"]'); + + if(thread.length > 0) { + $('div[id*="thread_"]').last().after(thread.attr('data-board', overflow[0].board).attr("data-cached", "no").css('display', 'block')); + boardheader.insertBefore(thread); + addukkohide.call(boardheader); + $(document).trigger('new_post', thread); + } + overflow.shift(); + + loading = false; + $('.pages').hide().html(""); + }); + break; + } + } + clearTimeout(ukkotimer); + ukkotimer = setTimeout(loadnext, 1000); + }; + + $(window).on('scroll', loadnext); + + ukkotimer = setTimeout(loadnext, 1000); +}); + +})(); diff --git a/templates/themes/ukko3/info.php b/templates/themes/ukko3/info.php new file mode 100644 index 00000000..375995f4 --- /dev/null +++ b/templates/themes/ukko3/info.php @@ -0,0 +1,55 @@ + 'Board name', + 'name' => 'title', + 'type' => 'text', + 'default' => 'Ukko' + ); + $theme['config'][] = array( + 'title' => 'Board URI', + 'name' => 'uri', + 'type' => 'text', + 'default' => '*', + 'comment' => '(ukko for example)' + ); + $theme['config'][] = array( + 'title' => 'Subtitle', + 'name' => 'subtitle', + 'type' => 'text', + 'comment' => '(%s = thread limit. for example "%s freshly bumped threads")' + ); + $theme['config'][] = array( + 'title' => 'included boards', + 'name' => 'include', + 'type' => 'text', + 'comment' => '(space seperated)' + ); + $theme['config'][] = array( + 'title' => 'Number of threads', + 'name' => 'thread_limit', + 'type' => 'text', + 'default' => '15', + ); + // Unique function name for building everything + $theme['build_function'] = 'ukko3_build'; + $theme['install_callback'] = 'ukko3_install'; + + if(!function_exists('ukko3_install')) { + function ukko3_install($settings) { + if (!file_exists($settings['uri'])) + @mkdir($settings['uri'], 0777) or error("Couldn't create " . $settings['uri'] . ". Check permissions.", true); + file_write($settings['uri'] . '/ukko.js', Element('themes/ukko/ukko.js', array())); + } + } + diff --git a/templates/themes/ukko3/theme.php b/templates/themes/ukko3/theme.php new file mode 100644 index 00000000..650dfc37 --- /dev/null +++ b/templates/themes/ukko3/theme.php @@ -0,0 +1,155 @@ +settings = $settings; + + if (! ($action == 'all' || $action == 'post' || $action == 'post-thread' || $action == 'post-delete')) { + return; + } + + $action = generation_strategy('sb_ukko3', array()); + + if ($action == 'delete') { + file_unlink($settings['uri'] . '/index.html'); + if ($config['api']['enabled']) { + $jsonFilename = $settings['uri'] . '/0.json'; + file_unlink($jsonFilename); + $jsonFilename = $settings['uri'] . '/catalog.json'; + file_unlink($jsonFilename); + $jsonFilename = $settings['uri'] . '/threads.json'; + file_unlink($jsonFilename); + } + } + elseif ($action == 'rebuild') { + file_write($settings['uri'] . '/index.html', $ukko3->build()); + } + } + + class ukko3 { + public $settings; + public function build($mod = false) { + global $config; + $boards = listBoards(); + + $body = ''; + $overflow = array(); + $board = array( + 'dir' => $this->settings['uri'] . "/", + 'url' => $this->settings['uri'], + 'uri' => $this->settings['uri'], + 'name' => $this->settings['title'], + 'title' => sprintf($this->settings['subtitle'], $this->settings['thread_limit']) + ); + + $boardsforukko3 = array(); + $query = ''; + foreach($boards as &$_board) { + if(in_array($_board['uri'], explode(' ', $this->settings['include']))){ + $query .= sprintf("SELECT *, '%s' AS `board` FROM ``posts_%s`` WHERE `thread` IS NULL UNION ALL ", $_board['uri'], $_board['uri']); + array_push($boardsforukko3,$_board); + } + } + $query = preg_replace('/UNION ALL $/', 'ORDER BY `bump` DESC', $query); + $query = query($query) or error(db_error()); + + $count = 0; + $threads = array(); + if ($config['api']['enabled']) { + $apithreads = array(); + } + while($post = $query->fetch()) { + + if(!isset($threads[$post['board']])) { + $threads[$post['board']] = 1; + } else { + $threads[$post['board']] += 1; + } + + if($count < $this->settings['thread_limit']) { + openBoard($post['board']); + $thread = new Thread($post, $mod ? '?/' : $config['root'], $mod); + + $posts = prepare(sprintf("SELECT * FROM ``posts_%s`` WHERE `thread` = :id ORDER BY `id` DESC LIMIT :limit", $post['board'])); + $posts->bindValue(':id', $post['id']); + $posts->bindValue(':limit', ($post['sticky'] ? $config['threads_preview_sticky'] : $config['threads_preview']), PDO::PARAM_INT); + $posts->execute() or error(db_error($posts)); + + $num_images = 0; + while ($po = $posts->fetch()) { + if ($po['files']) + $num_images++; + $post2 = new Post($po, $mod ? '?/' : $config['root'], $mod); + $thread->add($post2); + + } + if ($posts->rowCount() == ($post['sticky'] ? $config['threads_preview_sticky'] : $config['threads_preview'])) { + $ct = prepare(sprintf("SELECT COUNT(`id`) as `num` FROM ``posts_%s`` WHERE `thread` = :thread UNION ALL SELECT COUNT(`id`) FROM ``posts_%s`` WHERE `files` IS NOT NULL AND `thread` = :thread", $post['board'], $post['board'])); + $ct->bindValue(':thread', $post['id'], PDO::PARAM_INT); + $ct->execute() or error(db_error($count)); + + $c = $ct->fetch(); + $thread->omitted = $c['num'] - ($post['sticky'] ? $config['threads_preview_sticky'] : $config['threads_preview']); + + $c = $ct->fetch(); + $thread->omitted_images = $c['num'] - $num_images; + } + + + $thread->posts = array_reverse($thread->posts); + $body .= '

/' . $post['board'] . '/

'; + $body .= $thread->build(true); + if ($config['api']['enabled']) { + array_push($apithreads,$thread); + } + } else { + $page = 'index'; + if(floor($threads[$post['board']] / $config['threads_per_page']) > 0) { + $page = floor($threads[$post['board']] / $config['threads_per_page']) + 1; + } + $overflow[] = array('id' => $post['id'], 'board' => $post['board'], 'page' => $page . '.html'); + } + + $count += 1; + } + + $body .= ''; + $body .= ''; + + // json api + if ($config['api']['enabled']) { + require_once __DIR__. '/../../../inc/api.php'; + $api = new Api(); + $jsonFilename = $board['dir'] . '0.json'; + $json = json_encode($api->translatePage($apithreads)); + file_write($jsonFilename, $json); + + + $catalog = array(); + $catalog[0] = $apithreads; + + $json = json_encode($api->translateCatalog($catalog)); + $jsonFilename = $board['dir'] . 'catalog.json'; + file_write($jsonFilename, $json); + + $json = json_encode($api->translateCatalog($catalog, true)); + $jsonFilename = $board['dir'] . 'threads.json'; + file_write($jsonFilename, $json); + } + return Element('index.html', array( + 'config' => $config, + 'board' => $board, + 'no_post_form' => $config['overboard_post_form'] ? false : true, + 'body' => $body, + 'mod' => $mod, + 'boardlist' => createBoardlist($mod), + 'boards' => $boardsforukko3 ) + ); + } + + }; + +?> diff --git a/templates/themes/ukko3/thumb.png b/templates/themes/ukko3/thumb.png new file mode 100644 index 0000000000000000000000000000000000000000..eb616ef7d662bddc7b4fec8311ee52df55772aab GIT binary patch literal 13085 zcmV+&GvdsNP)$TuqcCM2ML5E&^DvdXhyU3EWLNX_xi1OJLmjq-Fy2@3lU?50wMML z-mP2TJ$>hO*Z<#tKkp4b@{vDYK6!HcD>k3J`_PWpUtXK3z3eys+5GYIhKZ%|{s;f& z8=28kz`F=Q~h%|G^Zke!^|Th5gVq!g^72c*+?0U#(1f`e4RnReZ!#k#@6 z{J=1?4A2S)K`;mvFb1T(>XL7k+@*6v6B8gf`92~8WMDAu1&qZ!x?eB=23mn3APB1S zi^ah~(i+y#1L|Yn{0XZF1PG)75Plp4$bd95rnN>u_@{w@7&1*i{!e-e_!hiy=s^HO zcp=eK0KTva=qX@>d*q%1dNF{(3x*zgF`%b_UJPLH^Fj|j3+O4J2l8uZ7g2DMga!j3 z2o)IIoo!i8T>vupd7=m1nH7D5NB;ElV{ad;eC=2(v%Pr3mZksvEgE?FW$y@o?iSDk z8u{6~?oVC3({Hk&*IaSpe;qc|_~6ysJY`|FjC%S9@QXqZ1i);Qyr8>+dgcLm;m`yB z@bAA55Tkk+pD)3mne+&AgHUR!HQMWlluB3Y7l;?gFec%%NM#-IL-pfCs!%2*kb1e^ z4t_FG%PXxw>6nB+iTL5Oh}6#|w4N-jBkCCrqJn4~*ord-bu^t3&a0}>JKyM(!i3rzK3SABuU2_73@oJYR_p#`b z5kyFC;{+0)Icoq!(*M}Vtp_o6?_+~I2dsgS`t+i1)$-f7wQDWg5msOJsrxguqxI_G>Hgc|Ej`~-Q=|dHL_|eQ8ZfxE6 zko}5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2(ZK;qG511mExi4kA#JW zjT$v7B_+kRieZ#2)7q-Ne0)!9RWV_>^0dTF=gEHMB0PAuQsck)*_Hl&9u9%5TDc;$ zSC|_-B_JR`rh*F%4hr*D6Tuj)5(o9}^ZNSNX3d(VQmMSXy=Tvwy=BYCp@W71APK>} z3zF;taIV#)Qb7R&{*?@XLdjx`T>N0N0CJk`l#disLMh8&t=@n!9x$N4$zo+$R^#O< zqoSNRa(LN8qvOvV8NdGfnP1GxSx|t0C-|zUep{{Px@@0{qz7=fD4;nH4VDV+M zg;dlv$6U+t3F$TYlTGpq`10dCdHH!KPMkP;^k_mtLPSJF-qlO!&rd1-8*>oDIvVPm zYbydCm|Afna>R2p3_8)<>sPTEhZx+xAq;>iLIe)@7?v|v@H#+t=t-4 zXbnisxKXdwv4Cr;Z%?20(9t8`_YNB{fBt+yl&UJLtQJdVM*7kv&;Iu)g{g?2{9z-w zE+0TMKq5ftuVgorP8ii%5HjihT! zTg|`_tw%tgggmh76iOv;=hMonErRg$=wN1`%EEPD9_F_w;r90q$4B5ubke*RkVd z^qP6|<^s^d+x4eJX|~QZWa8kWu%K{*_1V<=fn2Zma|@n%y>iANFJCp0yzqrxmp#2a reY*FKkWdGc{auBjf~V9BzajY#Mi|@$;@7mp00000NkvXXu0mjfP;YH% literal 0 HcmV?d00001 diff --git a/templates/themes/ukko3/ukko.js b/templates/themes/ukko3/ukko.js new file mode 100644 index 00000000..deeccfd0 --- /dev/null +++ b/templates/themes/ukko3/ukko.js @@ -0,0 +1,116 @@ +(function(){ + +var cache = new Array(), + thread = false, + loading = false, + ukkotimer = false; + +if (localStorage.hiddenboards === undefined) { + localStorage.hiddenboards = "{}"; +} + +// Load data from HTML5 localStorage +var hiddenboards = JSON.parse(localStorage.hiddenboards); + +var storeboards = function() { + localStorage.hiddenboards = JSON.stringify(hiddenboards); +}; + +$(document).ready(function() { + var addukkohide = function() { + var ukkohide = $(''); + var board = $(this).next().data("board"); + var hr = $("
"); + + $(this).append(ukkohide); + $(this).append(hr); + + if (hiddenboards[board] !== true) { + ukkohide.html(_("(hide threads from this board)")); + hr.hide(); + } + else { + ukkohide.html(_("(show threads from this board)")); + $(this).next().hide(); + } + ukkohide.click(function() { + hiddenboards[board] = (hiddenboards[board] !== true); + if (hiddenboards[board] !== true) { + $('[data-board="'+board+'"]:not([data-cached="yes"])').show().prev(). + find('.ukkohide').html(_("(hide threads from this board)")). + parent().find('hr').hide(); + } + else { + $('[data-board="'+board+'"]:not([data-cached="yes"])').hide().prev(). + find('.ukkohide').html(_("(show threads from this board)")) + .parent().find('hr').show(); + } + storeboards(); + return false; + }); + + }; + $("h2").each(addukkohide); + + $('.pages').hide(); + var loadnext = function() { + if (overflow.length == 0) { + $('.pages').show().html(_("No more threads to display")); + } + while($(window).scrollTop() + $(window).height() + 1000 > $(document).height() && !loading && overflow.length > 0) { + var page = modRoot + overflow[0].board + '/' + overflow[0].page; + thread = $('div#thread_' + overflow[0].id + '[data-board="' + overflow[0].board + '"]'); + if (thread.length > 0 && thread.attr("data-cached") !== 'yes') { // already present + overflow.shift(); + continue; + } + + var boardheader = $('

/' + overflow[0].board + '/

'); + + if($.inArray(page, cache) != -1) { + if (thread.length > 0) { + $('div[id*="thread_"]').last().after(thread.attr('data-board', overflow[0].board).attr("data-cached", "no").css('display', 'block')); + boardheader.insertBefore(thread); + addukkohide.call(boardheader); + $(document).trigger('new_post', thread); + } + overflow.shift(); + } else { + loading = true; + $('.pages').show().html(_("Loading...")); + $.get(page, function(data) { + cache.push(page); + + $(data).find('div[id*="thread_"]').each(function() { + var checkout = $(this).attr('id').replace('thread_', ''); + if ($('div#thread_' + checkout + '[data-board="' + overflow[0].board + '"]').length == 0) { + $('form[name="postcontrols"]').prepend($(this).css('display', 'block').attr("data-cached", "yes").attr('data-board', overflow[0].board)); + } + }); + + thread = $('div#thread_' + overflow[0].id + '[data-board="' + overflow[0].board + '"][data-cached="yes"]'); + + if(thread.length > 0) { + $('div[id*="thread_"]').last().after(thread.attr('data-board', overflow[0].board).attr("data-cached", "no").css('display', 'block')); + boardheader.insertBefore(thread); + addukkohide.call(boardheader); + $(document).trigger('new_post', thread); + } + overflow.shift(); + + loading = false; + $('.pages').hide().html(""); + }); + break; + } + } + clearTimeout(ukkotimer); + ukkotimer = setTimeout(loadnext, 1000); + }; + + $(window).on('scroll', loadnext); + + ukkotimer = setTimeout(loadnext, 1000); +}); + +})();