From d6e5a0f72079f837fea548bae42c92268a994aca Mon Sep 17 00:00:00 2001 From: 8chan Date: Sat, 13 Sep 2014 16:37:33 +0000 Subject: [PATCH 01/12] ?/bans: fix pagination - can now see all bans on all boards if > $config[mod][banlist_page] Conflicts: inc/bans.php --- inc/bans.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/inc/bans.php b/inc/bans.php index d860c02c..d5225e95 100644 --- a/inc/bans.php +++ b/inc/bans.php @@ -165,8 +165,14 @@ class Bans { return $bans; } - static public function count() { - $query = query("SELECT COUNT(*) FROM ``bans``") or error(db_error()); + static public function count($board = false) { + if (!$board) { + $query = prepare("SELECT COUNT(*) FROM ``bans``"); + } else { + $query = prepare("SELECT COUNT(*) FROM ``bans`` WHERE `board` = :board"); + } + $query->bindValue(':board', $board); + $query->execute() or error(db_error()); return (int)$query->fetchColumn(); } From 8641a739a609c09ac78b4fb298bafa902381fd58 Mon Sep 17 00:00:00 2001 From: Ian Bradley Date: Mon, 15 Sep 2014 16:33:37 -0700 Subject: [PATCH 02/12] Added support for BSD md5 incase md5sum isn't available. --- inc/config.php | 15 +++++++++++++++ post.php | 5 +++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/inc/config.php b/inc/config.php index 1525b8bb..3dd8eb6c 100644 --- a/inc/config.php +++ b/inc/config.php @@ -751,6 +751,13 @@ // Display the file's original filename. $config['show_filename'] = true; + // WebM Settings + $config['webm']['use_ffmpeg'] = false; + $config['webm']['allow_audio'] = false; + $config['webm']['max_length'] = 120; + $config['webm']['ffmpeg_path'] = 'ffmpeg'; + $config['webm']['ffprobe_path'] = 'ffprobe'; + // Display image identification links for ImgOps, regex.info/exif, Google Images and iqdb. $config['image_identification'] = false; // Which of the identification links to display. Only works if $config['image_identification'] is true. @@ -760,6 +767,9 @@ // Anime/manga search engine. $config['image_identification_iqdb'] = false; + // Set this to true if you're using a BSD + $config['bsd_md5'] = false; + // Number of posts in a "View Last X Posts" page $config['noko50_count'] = 50; // Number of posts a thread needs before it gets a "View Last X Posts" page. @@ -1032,6 +1042,10 @@ $config['error']['unknownext'] = _('Unknown file extension.'); $config['error']['filesize'] = _('Maximum file size: %maxsz% bytes
Your file\'s size: %filesz% bytes'); $config['error']['maxsize'] = _('The file was too big.'); + $config['error']['webmerror'] = _('There was a problem processing your webm.'); + $config['error']['invalidwebm'] = _('Invalid webm uploaded.'); + $config['error']['webmhasaudio'] = _('The uploaded webm contains an audio or another type of additional stream.'); + $config['error']['webmtoolong'] = _('The uploaded webm is longer than ' . $config['webm']['max_length'] . ' seconds.'); $config['error']['fileexists'] = _('That file already exists!'); $config['error']['fileexistsinthread'] = _('That file already exists in this thread!'); $config['error']['delete_too_soon'] = _('You\'ll have to wait another %s before deleting that.'); @@ -1039,6 +1053,7 @@ $config['error']['invalid_embed'] = _('Couldn\'t make sense of the URL of the video you tried to embed.'); $config['error']['captcha'] = _('You seem to have mistyped the verification.'); + // Moderator errors $config['error']['toomanyunban'] = _('You are only allowed to unban %s users at a time. You tried to unban %u users.'); $config['error']['invalid'] = _('Invalid username and/or password.'); diff --git a/post.php b/post.php index d6dfdaa1..033e5ab5 100644 --- a/post.php +++ b/post.php @@ -566,7 +566,9 @@ if (isset($_POST['delete'])) { error($config['error']['nomove']); } - if ($output = shell_exec_error("cat $filenames | md5sum")) { + $md5cmd = $config['bsd_md5'] ? 'md5 -r' : 'md5sum'; + + if ($output = shell_exec_error("cat $filenames | $md5cmd")) { $explodedvar = explode(' ', $output); $hash = $explodedvar[0]; $post['filehash'] = $hash; @@ -925,4 +927,3 @@ if (isset($_POST['delete'])) { error($config['error']['nopost']); } } - From c91915f1211e5808429dfeeec843a46a3273a32d Mon Sep 17 00:00:00 2001 From: Ian Bradley Date: Mon, 15 Sep 2014 16:34:36 -0700 Subject: [PATCH 03/12] FFmpeg support for WebMs. Fixes threads with large amounts of WebM's causing crashes for some users. --- inc/lib/webm/README.md | 10 +++++ inc/lib/webm/ffmpeg.php | 58 +++++++++++++++++++++++++++++ inc/lib/webm/posthandler.php | 72 ++++++++++++++++++++++++++++++------ 3 files changed, 128 insertions(+), 12 deletions(-) create mode 100644 inc/lib/webm/ffmpeg.php diff --git a/inc/lib/webm/README.md b/inc/lib/webm/README.md index baa7a641..dc3394c9 100644 --- a/inc/lib/webm/README.md +++ b/inc/lib/webm/README.md @@ -20,6 +20,16 @@ Add these lines to inc/instance-config.php: $config['additional_javascript'][] = 'js/webm-settings.js'; $config['additional_javascript'][] = 'js/expand-video.js'; +If you have an [FFmpeg](https://www.ffmpeg.org/) binary on your server and you wish to generate real thumbnails (the webm thumbnails created with the original implementation reportedly cause users' browsers to crash), add the following to inc/instance-config.php as well: + + $config['webm']['use_ffmpeg'] = true; + + // If your ffmpeg binary isn't in your path you need to set these options + // as well. + + $config['webm']['ffmpeg_path'] = '/path/to/ffmeg'; + $config['webm']['ffprobe_path'] = '/path/to/ffprobe'; + License ------- diff --git a/inc/lib/webm/ffmpeg.php b/inc/lib/webm/ffmpeg.php new file mode 100644 index 00000000..7b635b5c --- /dev/null +++ b/inc/lib/webm/ffmpeg.php @@ -0,0 +1,58 @@ + 1, 'msg' => $config['error']['genwebmerror']); + + if ($ffprobe_out['format']['format_name'] != 'matroska,webm') + return array('code' => 2, 'msg' => $config['error']['invalidwebm']); + + if ((count($ffprobe_out['streams']) > 1) && (!$config['webm']['allow_audio'])) + return array('code' => 3, 'msg' => $config['error']['webmhasaudio']); + + if ($ffprobe_out['streams'][0]['codec_name'] != 'vp8') + return array('code' => 2, 'msg' => $config['error']['invalidwebm']); + + if (empty($ffprobe_out['streams'][0]['width']) || (empty($ffprobe_out['streams'][0]['height']))) + return array('code' => 2, 'msg' => $config['error']['invalidwebm']); + + if ($ffprobe_out['format']['duration'] > $config['webm']['max_length']) + return array('code' => 4, 'msg' => $config['error']['webmtoolong']); +} + +function make_webm_thumbnail($filename, $thumbnail, $width, $height) { + global $board, $config; + + $ffmpeg = $config['webm']['ffmpeg_path']; + $ffmpeg_out = array(); + + exec("$ffmpeg -i $filename -v quiet -ss 00:00:00 -an -vframes 1 -f mjpeg -vf scale=$width:$height $thumbnail 2>&1"); + + return count($ffmpeg_out); +} diff --git a/inc/lib/webm/posthandler.php b/inc/lib/webm/posthandler.php index 1f831f5a..308c7507 100644 --- a/inc/lib/webm/posthandler.php +++ b/inc/lib/webm/posthandler.php @@ -6,6 +6,34 @@ function postHandler($post) { global $board, $config; if ($post->has_file) foreach ($post->files as &$file) if ($file->extension == 'webm') { + if ($config['webm']['use_ffmpeg']) { + require_once dirname(__FILE__) . '/ffmpeg.php'; + $webminfo = get_webm_info($file->file_path); + + if (empty($webminfo['error'])) { + $file->width = $webminfo['width']; + $file->height = $webminfo['height']; + + if ($config['spoiler_images'] && isset($_POST['spoiler'])) { + $file = webm_set_spoiler($file); + } + else { + $file = set_thumbnail_dimensions($post, $file); + $tn_path = $board['dir'] . $config['dir']['thumb'] . $file->file_id . '.jpg'; + + if(empty(make_webm_thumbnail($file->file_path, $tn_path, $file->thumbwidth, $file->thumbheight))) { + $file->thumb = $file->file_id . '.jpg'; + } + else { + $file->thumb = 'file'; + } + } + } + else { + return $webminfo['error']['msg']; + } + } + else { require_once dirname(__FILE__) . '/videodata.php'; $videoDetails = videoData($file->file_path); if (!isset($videoDetails['container']) || $videoDetails['container'] != 'webm') return "not a WebM file"; @@ -14,10 +42,7 @@ function postHandler($post) { $thumbName = $board['dir'] . $config['dir']['thumb'] . $file->file_id . '.webm'; if ($config['spoiler_images'] && isset($_POST['spoiler'])) { // Use spoiler thumbnail - $file->thumb = 'spoiler'; - $size = @getimagesize($config['spoiler_image']); - $file->thumbwidth = $size[0]; - $file->thumbheight = $size[1]; + $file = webm_set_spoiler($file); } elseif (isset($videoDetails['frame']) && $thumbFile = fopen($thumbName, 'wb')) { // Use single frame from video as pseudo-thumbnail fwrite($thumbFile, $videoDetails['frame']); @@ -33,17 +58,40 @@ function postHandler($post) { if (isset($videoDetails['width']) && isset($videoDetails['height'])) { $file->width = $videoDetails['width']; $file->height = $videoDetails['height']; + if ($file->thumb != 'file' && $file->thumb != 'spoiler') { - $thumbMaxWidth = $post->op ? $config['thumb_op_width'] : $config['thumb_width']; - $thumbMaxHeight = $post->op ? $config['thumb_op_height'] : $config['thumb_height']; - if ($videoDetails['width'] > $thumbMaxWidth || $videoDetails['height'] > $thumbMaxHeight) { - $file->thumbwidth = min($thumbMaxWidth, intval(round($videoDetails['width'] * $thumbMaxHeight / $videoDetails['height']))); - $file->thumbheight = min($thumbMaxHeight, intval(round($videoDetails['height'] * $thumbMaxWidth / $videoDetails['width']))); - } else { - $file->thumbwidth = $videoDetails['width']; - $file->thumbheight = $videoDetails['height']; + $file = set_thumbnail_dimensions($post, $file); } } } } } + +function set_thumbnail_dimensions($post,$file) { + global $board, $config; + + $tn_dimensions = array(); + $tn_maxw = $post->op ? $config['thumb_op_width'] : $config['thumb_width']; + $tn_maxh = $post->op ? $config['thumb_op_height'] : $config['thumb_height']; + + if ($file->width > $tn_maxw || $file->height > $tn_maxh) { + $file->thumbwidth = min($tn_maxw, intval(round($file->width * $tn_maxh / $file->height))); + $file->thumbheight = min($tn_maxh, intval(round($file->height * $tn_maxw / $file->width))); + } else { + $file->thumbwidth = $file->width; + $file->thumbheight = $file->height; + } + + return $file; +} + +function webm_set_spoiler($file) { + global $board, $config; + + $file->thumb = 'spoiler'; + $size = @getimagesize($config['spoiler_image']); + $file->thumbwidth = $size[0]; + $file->thumbheight = $size[1]; + + return $file; +} From 41c8628e19d1173d7505617541b762a62f513b74 Mon Sep 17 00:00:00 2001 From: Ian Bradley Date: Mon, 15 Sep 2014 16:57:06 -0700 Subject: [PATCH 04/12] Added escapeshellarg() for WebM thumbnail generation. --- inc/lib/webm/ffmpeg.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/inc/lib/webm/ffmpeg.php b/inc/lib/webm/ffmpeg.php index 7b635b5c..edd2c73a 100644 --- a/inc/lib/webm/ffmpeg.php +++ b/inc/lib/webm/ffmpeg.php @@ -49,6 +49,10 @@ function is_valid_webm($ffprobe_out) { function make_webm_thumbnail($filename, $thumbnail, $width, $height) { global $board, $config; + $filename = escapeshellarg($filename); + $thumbnail = escapeshellarg($thumbnail); // Should be safe by default but you + // can never be too safe. + $ffmpeg = $config['webm']['ffmpeg_path']; $ffmpeg_out = array(); From b4619db814e6140f197efa92b3ae0ae3ed9897de Mon Sep 17 00:00:00 2001 From: Ian Bradley Date: Tue, 16 Sep 2014 13:10:54 -0700 Subject: [PATCH 05/12] Fixed blank catalog image count when zero image replies and threads with deleted files from being excluded --- templates/themes/catalog/theme.php | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/templates/themes/catalog/theme.php b/templates/themes/catalog/theme.php index f6c4d8e5..78c70d90 100644 --- a/templates/themes/catalog/theme.php +++ b/templates/themes/catalog/theme.php @@ -51,10 +51,26 @@ if (isset($post['files'])) { $files = json_decode($post['files']); - if ($files[0]->file == 'deleted') continue; + + if ($files[0]->file == 'deleted') { + if (count($files) > 1) { + foreach ($files as $file) { + if (($file == $files[0]) || ($file->file == 'deleted')) continue; + $post['file'] = $config['uri_thumb'] . $file->thumb; + } + + if (empty($post['file'])) $post['file'] = $config['image_deleted']; + } + else { + $post['file'] = $config['image_deleted']; + } + } + else { $post['file'] = $config['uri_thumb'] . $files[0]->thumb; } + } + if (empty($post['image_count'])) $post['image_count'] = 0; $recent_posts[] = $post; } From a194b142abb05e32459b93521300ae55c41c8081 Mon Sep 17 00:00:00 2001 From: marlencrabapple Date: Wed, 17 Sep 2014 15:55:16 -0700 Subject: [PATCH 06/12] Fixed spoiler thumbnails not showing up in the recent theme --- templates/themes/recent/theme.php | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/templates/themes/recent/theme.php b/templates/themes/recent/theme.php index 842ab9ac..a25ff6a9 100644 --- a/templates/themes/recent/theme.php +++ b/templates/themes/recent/theme.php @@ -54,14 +54,27 @@ while ($post = $query->fetch(PDO::FETCH_ASSOC)) { openBoard($post['board']); + if (isset($post['files'])) $files = json_decode($post['files']); if ($files[0]->file == 'deleted') continue; // board settings won't be available in the template file, so generate links now - $post['link'] = $config['root'] . $board['dir'] . $config['dir']['res'] . sprintf($config['file_page'], ($post['thread'] ? $post['thread'] : $post['id'])) . '#' . $post['id']; - if ($files) $post['src'] = $config['uri_thumb'] . $files[0]->thumb; + $post['link'] = $config['root'] . $board['dir'] . $config['dir']['res'] + . sprintf($config['file_page'], ($post['thread'] ? $post['thread'] : $post['id'])) . '#' . $post['id']; + + if ($files) { + if ($files[0]->thumb == 'spoiler') { + $tn_size = @getimagesize($config['spoiler_image']); + $post['src'] = $config['spoiler_image']; + $post['thumbwidth'] = $tn_size[0]; + $post['thumbheight'] = $tn_size[1]; + } + else { + $post['src'] = $config['uri_thumb'] . $files[0]->thumb; + } + } $recent_images[] = $post; } From 836374dc96b9cb63cc3ba9a855cc3649b001c606 Mon Sep 17 00:00:00 2001 From: marlencrabapple Date: Wed, 17 Sep 2014 16:15:18 -0700 Subject: [PATCH 07/12] Fixed spoiler images in the catalog theme. --- templates/themes/catalog/theme.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/templates/themes/catalog/theme.php b/templates/themes/catalog/theme.php index 78c70d90..357870e4 100644 --- a/templates/themes/catalog/theme.php +++ b/templates/themes/catalog/theme.php @@ -65,6 +65,9 @@ $post['file'] = $config['image_deleted']; } } + else if($files[0]->thumb == 'spoiler') { + $post['file'] = '/' . $config['spoiler_image']; + } else { $post['file'] = $config['uri_thumb'] . $files[0]->thumb; } From 1709a75f6644f086be399d35886569e168cce10b Mon Sep 17 00:00:00 2001 From: czaks Date: Sat, 20 Sep 2014 06:08:14 +0200 Subject: [PATCH 08/12] fix an issue with watch.js on android chrome --- js/watch.js | 1 + 1 file changed, 1 insertion(+) diff --git a/js/watch.js b/js/watch.js index 4c36dbc4..a202130f 100644 --- a/js/watch.js +++ b/js/watch.js @@ -107,6 +107,7 @@ $(function(){ var list = $("
"); list.attr("data-board", board); + if (storage()[board] && storage()[board].threads) for (var tid in storage()[board].threads) { var newposts = "(0)"; if (status && status[board] && status[board].threads && status[board].threads[tid]) { From 1d3de77293a65d1f0e842b1dc379e67c68ee312b Mon Sep 17 00:00:00 2001 From: czaks Date: Sat, 20 Sep 2014 06:18:37 +0200 Subject: [PATCH 09/12] add user-options dialog functionality; port webm-settings to it; make a basic general settings applet; make it work on mobiles --- js/expand-video.js | 3 +- js/options.js | 126 ++++++++++++++++++++++++++++++++++++++++++ js/options/general.js | 44 +++++++++++++++ js/webm-settings.js | 22 ++++++-- stylesheets/style.css | 73 ++++++++++++++++++++++++ 5 files changed, 261 insertions(+), 7 deletions(-) create mode 100644 js/options.js create mode 100644 js/options/general.js diff --git a/js/expand-video.js b/js/expand-video.js index 76a2018e..79872510 100644 --- a/js/expand-video.js +++ b/js/expand-video.js @@ -218,7 +218,8 @@ function setupVideosIn(element) { onready(function(){ // Insert menu from settings.js - if (typeof settingsMenu != "undefined") document.body.insertBefore(settingsMenu, document.getElementsByTagName("hr")[0]); + if (typeof settingsMenu != "undefined" && typeof Options == "undefined") + document.body.insertBefore(settingsMenu, document.getElementsByTagName("hr")[0]); // Setup Javascript events for videos in document now setupVideosIn(document); diff --git a/js/options.js b/js/options.js new file mode 100644 index 00000000..4a7f3ce9 --- /dev/null +++ b/js/options.js @@ -0,0 +1,126 @@ +/* + * options.js - allow users choose board options as they wish + * + * Copyright (c) 2014 Marcin Łabanowski + * + * Usage: + * $config['additional_javascript'][] = 'js/jquery.min.js'; + * $config['additional_javascript'][] = 'js/options.js'; + */ + ++function(){ + +var options_button, options_handler, options_background, options_div + , options_close, options_tablist, options_tabs, options_current_tab; + +var Options = {}; +window.Options = Options; + +var first_tab = function() { + for (var i in options_tabs) { + return i; + } + return false; +}; + +Options.show = function() { + if (!options_current_tab) { + Options.select_tab(first_tab(), true); + } + options_handler.fadeIn(); +}; +Options.hide = function() { + options_handler.fadeOut(); +}; + +options_tabs = {}; + +Options.add_tab = function(id, icon, name, content) { + var tab = {}; + + if (typeof content == "string") { + content = $("
"+content+"
"); + } + + tab.id = id; + tab.name = name; + tab.icon = $("
"+name+"
"); + tab.content = $("
").css("display", "none"); + + tab.content.appendTo(options_div); + + tab.icon.on("click", function() { + Options.select_tab(id); + }).appendTo(options_tablist); + + $("

"+name+"

").appendTo(tab.content); + + if (content) { + content.appendTo(tab.content); + } + + options_tabs[id] = tab; + + return tab; +}; + +Options.get_tab = function(id) { + return options_tabs[id]; +}; + +Options.extend_tab = function(id, content) { + if (typeof content == "string") { + content = $("
"+content+"
"); + } + + content.appendTo(options_tabs[id].content); + + return options_tabs[id]; +}; + +Options.select_tab = function(id, quick) { + if (options_current_tab) { + if (options_current_tab.id == id) { + return false; + } + options_current_tab.content.fadeOut(); + options_current_tab.icon.removeClass("active"); + } + var tab = options_tabs[id]; + options_current_tab = tab; + options_current_tab.icon.addClass("active"); + tab.content[quick? "show" : "fadeIn"](); + + return tab; +}; + +options_handler = $("
").css("display", "none"); +options_background = $("
").on("click", Options.hide).appendTo(options_handler); +options_div = $("
").appendTo(options_handler); +options_close = $("") + .on("click", Options.hide).appendTo(options_div); +options_tablist = $("
").appendTo(options_div); + + +$(function(){ + options_button = $("
["+_("Options")+"]").css("float", "right"); + + if ($(".boardlist.compact-boardlist").length) { + options_button.addClass("cb-item cb-fa").html(""); + } + + if ($(".boardlist:first").length) { + options_button.appendTo($(".boardlist:first")); + } + else { + options_button.prependTo($(document.body)); + } + + options_button.on("click", Options.show); + + options_handler.appendTo($(document.body)); +}); + + + +}(); diff --git a/js/options/general.js b/js/options/general.js new file mode 100644 index 00000000..f95ba04f --- /dev/null +++ b/js/options/general.js @@ -0,0 +1,44 @@ +/* + * options/general.js - general settings tab for options panel + * + * Copyright (c) 2014 Marcin Łabanowski + * + * Usage: + * $config['additional_javascript'][] = 'js/jquery.min.js'; + * $config['additional_javascript'][] = 'js/options.js'; + * $config['additional_javascript'][] = 'js/style-select.js'; + * $config['additional_javascript'][] = 'js/options/general.js'; + */ + ++function(){ + +var tab = Options.add_tab("general", "home", _("General")); + +$(function(){ + var stor = $("
"+_("Storage: ")+"
"); + stor.appendTo(tab.content); + + $("").appendTo(stor).on("click", function() { + var str = JSON.stringify(localStorage); + + $(".output").remove(); + $("").appendTo(stor).val(str); + }); + $("").appendTo(stor).on("click", function() { + var str = prompt(_("Paste your storage data")); + if (!str) return false; + var obj = JSON.parse(str); + if (!obj) return false; + + localStorage.clear(); + for (var i in obj) { + localStorage[i] = obj[i]; + } + + document.location.reload(); + }); + + $("#style-select").detach().css({float:"none","margin-bottom":0}).appendTo(tab.content); +}); + +}(); diff --git a/js/webm-settings.js b/js/webm-settings.js index 3e792741..bd3c6f0f 100644 --- a/js/webm-settings.js +++ b/js/webm-settings.js @@ -36,15 +36,25 @@ function changeSetting(name, value) { // Create settings menu var settingsMenu = document.createElement("div"); -settingsMenu.style.textAlign = "right"; -settingsMenu.style.background = "inherit"; +var prefix = "", suffix = "", style = ""; +if (window.Options) { + var tab = Options.add_tab("webm", "video-camera", _("WebM")); + $(settingsMenu).appendTo(tab.content); +} +else { + prefix = ''+_('WebM Settings')+''; + settingsMenu.style.textAlign = "right"; + settingsMenu.style.background = "inherit"; + suffix = ''; + style = 'display: none; text-align: left; position: absolute; right: 1em; margin-left: -999em; margin-top: -1px; padding-top: 1px; background: inherit;'; +} -settingsMenu.innerHTML = ''+_('WebM Settings')+'' - + '
' +settingsMenu.innerHTML = prefix + + '
' + '
' + '
' + '
' - + '
'; + + suffix; function refreshSettings() { var settingsItems = settingsMenu.getElementsByTagName("input"); @@ -74,7 +84,7 @@ for (var i = 0; i < settingsItems.length; i++) { setupControl(settingsItems[i]); } -if (settingsMenu.addEventListener) { +if (settingsMenu.addEventListener && !window.Options) { settingsMenu.addEventListener("mouseover", function(e) { refreshSettings(); settingsMenu.getElementsByTagName("a")[0].style.fontWeight = "bold"; diff --git a/stylesheets/style.css b/stylesheets/style.css index 3688b939..66f6cb91 100644 --- a/stylesheets/style.css +++ b/stylesheets/style.css @@ -636,3 +636,76 @@ form.ban-appeal textarea { .new-threads { text-align: center; } + +/* options.js */ +#options_handler { + position: fixed; + top: 0px; left: 0px; right: 0px; bottom: 0px; + width: 100%; height: 100%; + text-align: center; + z-index: 9900; +} +#options_background { + background: black; + opacity: 0.5; + position: absolute; + top: 0px; left: 0px; right: 0px; bottom: 0px; + width: 100%; height: 100%; + z-index: -1; +} +#options_div { + background-color: #d6daf0; + border: 1px solid black; + display: inline-block; + position: relative; + margin-top: 20px; + width: 600px; + height: 300px; +} +#options_close { + top: 0px; right: 0px; + position: absolute; + margin-right: 3px; + font-size: 20px; z-index: 100; +} +#options_tablist { + padding: 0px 5px; + left: 0px; + width: 70px; + top: 0px; + bottom: 0px; + height: 100%; + border-right: 1px solid black; +} +.options_tab_icon { + padding: 5px; + color: black; +} +.options_tab_icon.active { + color: red; +} +.options_tab_icon i { + font-size: 20px; +} +.options_tab_icon div { + font-size: 11px; +} +.options_tab { + padding: 10px; + position: absolute; + top: 0px; bottom: 0px; + left: 81px; right: 0px; + text-align: left; + font-size: 12px; +} +.options_tab h2 { + text-align: center; + margin-bottom: 5px; +} + +.mobile-style #options_div { + display: block; + width: 100%; + height: 100%; + margin-top: 0px; +} From 840425a2cdf40170e536ad66d69117efa30eaa5a Mon Sep 17 00:00:00 2001 From: czaks Date: Sat, 20 Sep 2014 06:36:39 +0200 Subject: [PATCH 10/12] remove a special containerchan stylesheet; it added some extra space for webms --- stylesheets/style.css | 6 ------ 1 file changed, 6 deletions(-) diff --git a/stylesheets/style.css b/stylesheets/style.css index 66f6cb91..6128ead3 100644 --- a/stylesheets/style.css +++ b/stylesheets/style.css @@ -622,12 +622,6 @@ form.ban-appeal textarea { vertical-align: middle; } -/* Containerchan */ - div.post video.post-image { - padding: 0; - margin: 5px 25px 5px 5px; - } - /* live-index.js */ .new-posts { opacity: 0.6; From 5fe3ceb5e0260f3af450e5fcdc6685685c62691d Mon Sep 17 00:00:00 2001 From: czaks Date: Sat, 20 Sep 2014 06:40:43 +0200 Subject: [PATCH 11/12] add a very small image size for catalog --- js/catalog.js | 9 +++------ stylesheets/style.css | 10 ++++++++++ templates/themes/catalog/catalog.html | 1 + 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/js/catalog.js b/js/catalog.js index 4a4eae37..768845f6 100644 --- a/js/catalog.js +++ b/js/catalog.js @@ -7,12 +7,9 @@ if (active_page == 'catalog') $(function(){ $("#image_size").change(function(){ var value = this.value, old; - if (value == "small") { - old = "large"; - } else { - old = "small"; - } - $(".grid-li").removeClass("grid-size-"+old); + $(".grid-li").removeClass("grid-size-vsmall"); + $(".grid-li").removeClass("grid-size-small"); + $(".grid-li").removeClass("grid-size-large"); $(".grid-li").addClass("grid-size-"+value); }); diff --git a/stylesheets/style.css b/stylesheets/style.css index 6128ead3..0dcd7388 100644 --- a/stylesheets/style.css +++ b/stylesheets/style.css @@ -533,6 +533,16 @@ form.ban-appeal textarea { margin-left: -20px; } +.theme-catalog div.grid-size-vsmall img { + max-width: 100%; +} + +.theme-catalog div.grid-size-vsmall { + width: 100px; + max-width: 100px; + max-height: 150px; +} + .theme-catalog div.grid-size-small { width: 200px; max-width: 200px; diff --git a/templates/themes/catalog/catalog.html b/templates/themes/catalog/catalog.html index a4cb3933..441e3a0a 100644 --- a/templates/themes/catalog/catalog.html +++ b/templates/themes/catalog/catalog.html @@ -33,6 +33,7 @@ {% trans 'Image size' %}: From f7f9845c285894c1d3618b5171212f6a68f8184f Mon Sep 17 00:00:00 2001 From: czaks Date: Sat, 20 Sep 2014 06:43:02 +0200 Subject: [PATCH 12/12] fix previous commit --- stylesheets/style.css | 1 + 1 file changed, 1 insertion(+) diff --git a/stylesheets/style.css b/stylesheets/style.css index 0dcd7388..eea2fb0d 100644 --- a/stylesheets/style.css +++ b/stylesheets/style.css @@ -535,6 +535,7 @@ form.ban-appeal textarea { .theme-catalog div.grid-size-vsmall img { max-width: 100%; + max-height: 100px; } .theme-catalog div.grid-size-vsmall {