From a723ff8e66e88f0e98b893275b8f7b1bbc990514 Mon Sep 17 00:00:00 2001 From: Markerov Date: Mon, 27 Oct 2014 16:49:17 +0800 Subject: Display inline image when it starts loading, Rewrote inline-expanding.js to display full image as soon as it starts loading. Modified expand-all-images.js to work with the new change Moved max-width to style.css --- stylesheets/style.css | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'stylesheets/style.css') diff --git a/stylesheets/style.css b/stylesheets/style.css index 9925ccaa..ec07fe0a 100644 --- a/stylesheets/style.css +++ b/stylesheets/style.css @@ -194,6 +194,10 @@ img.banner,img.board_image { border: none; } +.full-image { + max-width: 98%; +} + div.post .post-image { padding: 5px; margin: 0 20px 0 0; -- cgit v1.3 From 1b0f5fd24cf363d88460b0483f5b3d26c763b8ed Mon Sep 17 00:00:00 2001 From: Fredrick Brennan Date: Sun, 2 Nov 2014 07:08:01 +0800 Subject: Revert "Comment toolbar update and Thread stats addition" --- js/comment-toolbar.js | 538 +++++++++++++++++++------------------------------- stylesheets/style.css | 1 - 2 files changed, 206 insertions(+), 333 deletions(-) (limited to 'stylesheets/style.css') diff --git a/js/comment-toolbar.js b/js/comment-toolbar.js index 74654868..7ae11a73 100644 --- a/js/comment-toolbar.js +++ b/js/comment-toolbar.js @@ -8,379 +8,253 @@ * $config['additional_javascript'][] = 'js/comment-toolbar.js'; */ if (active_page == 'thread' || active_page == 'index') { - var formatText = (function($){ - "use strict"; - var self = {}; - self.rules = { - spoiler: { - text: 'Spoiler', - key: 's', - multiline: false, - exclusiveline: false, - prefix:'**', - suffix:'**' + $(document).ready(function () { + 'use strict'; + var formats = { + bold: { + displayText: 'B', + altText: 'bold', + styleCSS: 'font-weight: bold;', + options: { + prefix: "'''", + suffix: "'''" + }, + edit: function (box, options) { + wrapSelection(box, options); + }, + shortcutKey: 'b' }, italics: { - text: 'Italics', - key: 'i', - multiline: false, - exclusiveline: false, - prefix: "''", - suffix: "''" + displayText: 'i', + altText: 'italics', + styleCSS: 'font-style: italic;', + options: { + prefix: "''", + suffix: "''" + }, + edit: function (box, options) { + wrapSelection(box, options); + }, + shortcutKey: 'i' }, - bold: { - text: 'Bold', - key: 'b', - multiline: false, - exclusiveline: false, - prefix: "'''", - suffix: "'''" + under: { + displayText: 'U', + altText: 'underline', + styleCSS: 'text-decoration: underline;', + options: { + prefix: '__', + suffix: '__' + }, + edit: function (box, options) { + wrapSelection(box, options); + }, + shortcutKey: 'u' }, - underline: { - text: 'Underline', - key: 'u', - multiline: false, - exclusiveline: false, - prefix:'__', - suffix:'__' + spoiler: { + displayText: 'spoiler', + altText: 'mark as spoiler', + styleCSS: '', + options: { + prefix: '[spoiler]', + suffix: '[/spoiler]' + }, + edit: function (box, options) { + wrapSelection(box, options); + }, + shortcutKey: 's' }, code: { - text: 'Code', - key: 'f', - multiline: true, - exclusiveline: false, - prefix: '[code]', - suffix: '[/code]' + displayText: 'code', + altText: "code formatting", + styleCSS: 'font-family: "Courier New", Courier, monospace;', + options: { + prefix: '[code]', + suffix: '[/code]', + multiline: true + }, + edit: function (box, options) { + wrapSelection(box, options); + }, + shortcutKey: 'd' }, strike: { - text: 'Strike', - key: 'd', - multiline:false, - exclusiveline:false, - prefix:'~~', - suffix:'~~' + displayText: 'strike', + altText: 'strikethrough', + styleCSS: 'text-decoration: line-through;', + options: { + prefix: '~~', + suffix: '~~' + }, + edit: function (box, options) { + wrapSelection(box, options); + } }, heading: { - text: 'Heading', - key: 'r', - multiline:false, - exclusiveline:true, - prefix:'==', - suffix:'==' + displayText: 'heading', + altText: 'redtext', + styleCSS: 'color: #AF0A0F; font-weight: bold;', + options: { + prefix: '==', + suffix: '==', + exclusiveLine: true + }, + edit: function (box, options) { + wrapSelection(box, options); + } } }; - - self.toolbar_wrap = function(node) { - if (!localStorage.formatText_enable || localStorage.formatText_enable == 'false') return; - var parent = $(node).parents('form[name="post"]'); - self.wrap(parent.find('#body')[0],'textarea[name="body"]', parent.find('.format-text > select')[0].value, false); - }; - - self.wrap = function(ref, target, option, expandedwrap) { - if (!localStorage.formatText_enable || localStorage.formatText_enable == 'false') return; - // clean and validate arguments - if (ref == null) return; - var settings = {multiline: false, exclusiveline: false, prefix:'', suffix: null}; - $.extend(settings,JSON.parse(localStorage.formatText_rules)[option]); - - // resolve targets into array of proper node elements - // yea, this is overly verbose, oh well. - var res = []; - if (target instanceof Array) { - for (var indexa in target) { - if (target.hasOwnProperty(indexa)) { - if (typeof target[indexa] == 'string') { - var nodes = $(target[indexa]); - for (var indexb in nodes) { - if (indexa.hasOwnProperty(indexb)) res.push(nodes[indexb]); - } - } else { - res.push(target[indexa]); - } - } - } - } else { - if (typeof target == 'string') { - var nodes = $(target); - for (var index in nodes) { - if (nodes.hasOwnProperty(index)) res.push(nodes[index]); - } - } else { - res.push(target); - } + + var key, name, altText, ele; + var strBuilder = []; + var subStr = ''; + var styleRules = ''; + + //not exactly mine + var wrapSelection = function (box, options) { + if (box == null) { + return; } - target = res; - //record scroll top to restore it later. - var scrollTop = ref.scrollTop; + var prefix = options.prefix; + var suffix = options.suffix; + var multiline = options.multiline || false; + var exclusiveLine = options.exclusiveLine || false; - //We will restore the selection later, so record the current selection - var selectionStart = ref.selectionStart; - var selectionEnd = ref.selectionEnd; + //record scroll top to restore it later. + var scrollTop = box.scrollTop; + var selectionStart = box.selectionStart; + var selectionEnd = box.selectionEnd; + var text = box.value; + var beforeSelection = text.substring(0, selectionStart); + var selectedText = text.substring(selectionStart, selectionEnd); + var afterSelection = text.substring(selectionEnd); - var text = ref.value; - var before = text.substring(0, selectionStart); - var selected = text.substring(selectionStart, selectionEnd); - var after = text.substring(selectionEnd); - var whiteSpace = [" ","\t"]; var breakSpace = ["\r","\n"]; - var cursor; - - // handles multiline selections on formatting that doesn't support spanning over multiple lines - if (!settings.multiline) selected = selected.replace(/(\r|\n|\r\n)/g,settings.suffix +"$1"+ settings.prefix); - - // handles formatting that requires it to be on it's own line OR if the user wishes to expand the wrap to the nearest linebreak - if (settings.exclusiveline || expandedwrap) { + var trailingSpace = ""; + var cursor = selectedText.length - 1; + + //remove trailing space + while (cursor > 0 && selectedText[cursor] === " ") { + trailingSpace += " "; + cursor--; + } + selectedText = selectedText.substring(0, cursor + 1); + + if (!multiline) + selectedText = selectedText.replace(/(\r|\n|\r\n)/g, suffix +"$1"+ prefix); + + if (exclusiveLine) { // buffer the begining of the selection until a linebreak - cursor = before.length -1; - while (cursor >= 0 && breakSpace.indexOf(before.charAt(cursor)) == -1) { + cursor = beforeSelection.length -1; + while (cursor >= 0 && breakSpace.indexOf(beforeSelection.charAt(cursor)) == -1) { cursor--; } - selected = before.substring(cursor +1) + selected; - before = before.substring(0, cursor +1); + selectedText = beforeSelection.substring(cursor +1) + selectedText; + beforeSelection = beforeSelection.substring(0, cursor +1); // buffer the end of the selection until a linebreak cursor = 0; - while (cursor < after.length && breakSpace.indexOf(after.charAt(cursor)) == -1) { + while (cursor < afterSelection.length && breakSpace.indexOf(afterSelection.charAt(cursor)) == -1) { cursor++; } - selected += after.substring(0, cursor); - after = after.substring(cursor); + selectedText += afterSelection.substring(0, cursor); + afterSelection = afterSelection.substring(cursor); } - - // set values - var res = before + settings.prefix + selected + settings.suffix + after; - $(target).val(res); - - // restore the selection area and scroll of the reference - ref.selectionEnd = before.length + settings.prefix.length + selected.length; + + box.value = beforeSelection + prefix + selectedText + suffix + trailingSpace + afterSelection; + + box.selectionEnd = beforeSelection.length + prefix.length + selectedText.length; if (selectionStart === selectionEnd) { - ref.selectionStart = ref.selectionEnd; + box.selectionStart = box.selectionEnd; } else { - ref.selectionStart = before.length + settings.prefix.length; + box.selectionStart = beforeSelection.length + prefix.length; } - ref.scrollTop = scrollTop; + box.scrollTop = scrollTop; }; - - self.build_toolbars = function(){ - if (!localStorage.formatText_enable || localStorage.formatText_enable == 'false') return; - if (localStorage.formatText_toolbar == 'true'){ - // remove existing toolbars - if ($('.format-text').length > 0) $('.format-text').remove(); - - // Place toolbar above each textarea input - var name, options = '', rules = JSON.parse(localStorage.formatText_rules); - for (var index in rules) { - if (!rules.hasOwnProperty(index)) continue; - name = rules[index].text; - //add hint if key exists - if (rules[index].key) { - name += ' (CTRL + '+ rules[index].key.toUpperCase() +')'; + /* Generate the HTML for the toolbar + */ + for (ele in formats) { + if (formats.hasOwnProperty(ele) && formats[ele].displayText != null) { + name = formats[ele].displayText; + altText = formats[ele].altText || ''; + key = formats[ele].shortcutKey; + + //add tooltip text + if (altText) { + if (key) { + altText += ' (ctrl+'+ key +')'; } - options += ''; - } - $('[name="body"]').before('
Wrap
'); - $('body').append(''); - } - }; - - self.add_rule = function(rule, index){ - if (rule === undefined) rule = { - text: 'New Rule', - key: '', - multiline:false, - exclusiveline:false, - prefix:'', - suffix:'' - } - - // generate an id for the rule - if (index === undefined) { - var rules = JSON.parse(localStorage.formatText_rules); - while (rules[index] || index === undefined) { - index = '' - index +='abcdefghijklmnopqrstuvwxyz'.substr(Math.floor(Math.random()*26),1); - index +='abcdefghijklmnopqrstuvwxyz'.substr(Math.floor(Math.random()*26),1); - index +='abcdefghijklmnopqrstuvwxyz'.substr(Math.floor(Math.random()*26),1); + altText = 'title="'+ altText +'"'; } + + subStr = ''+ name +''; + strBuilder.push(subStr); + } else { + continue; } - if (window.Options && Options.get_tab('formatting')){ - var html = $('
').html('\ - \ - \ - \ - \ - \ - \ - \ - '); - - if ($('.format_rule').length > 0) { - $('.format_rule').last().after(html); - } else { - Options.extend_tab('formatting', html); + } + + $( 'textarea[name="body"]' ).before( '
' ); + $( '.tf-toolbar' ).html( strBuilder.join(' | ') ); + + /* Sets the CSS style + */ + styleRules = '\n/* generated by 8chan Formatting Tools */'+ + '\n.tf-toolbar {padding: 0px 5px 1px 5px;}'+ + '\n.tf-toolbar :link {text-decoration: none;}'; + for (ele in formats) { + if (formats.hasOwnProperty(ele) && formats[ele].styleCSS) { + styleRules += ' \n#tf-' + ele + ' {' + formats[ele].styleCSS + '}'; } } - }; - - self.save_rules = function(){ - var newrules = {}, rules = $('.format_rule'); - for (var index=0;rules[index];index++) { - newrules[$(rules[index]).attr('name')] = { - text: $(rules[index]).find('[name="text"]').val(), - key: $(rules[index]).find('[name="key"]').val(), - prefix: $(rules[index]).find('[name="prefix"]').val(), - suffix: $(rules[index]).find('[name="suffix"]').val(), - multiline: $(rules[index]).find('[name="multiline"]').is(':checked'), - exclusiveline: $(rules[index]).find('[name="exclusiveline"]').is(':checked') - }; - } - localStorage.formatText_rules = JSON.stringify(newrules); - self.build_toolbars(); - }; - - self.reset_rules = function() { - localStorage.formatText_rules = JSON.stringify(self.rules); - }; - - // store default rules for customizing - if (!localStorage.formatText_rules) self.reset_rules(); - - // Add settings to Options panel general tab - if (window.Options && Options.get_tab('general')) { - var s1 = '#formatText_enable>input', s2 = '#formatText_keybinds>input', s3 = '#formatText_toolbar>input', e = 'change'; - Options.extend_tab('general', '\ -
\ - Formatting Options\ - \ - \ - \ -
\ - '); - } else { - var s1 = '#formatText_enable', s2 = '#formatText_keybinds', s3 = '#formatText_toolbar', e = 'click'; - $('hr:first').before(''); - $('hr:first').before(''); - $('hr:first').before(''); - } - - // setting for enableing text formatting - $(s1).on(e, function(e) { - if (!localStorage.formatText_enable || localStorage.formatText_enable == 'false') { - localStorage.formatText_enable = 'true'; - if (window.Options && Options.get_tab('general')) e.target.checked = true; + //add CSS rule to user's custom CSS if it exist + if ($( '.user-css' ).length !== 0) { + $( '.user-css' ).append( styleRules ); } else { - localStorage.formatText_enable = 'false'; - if (window.Options && Options.get_tab('general')) e.target.checked = false; + $( 'body' ).append( '' ); } - }); - - // setting for enableing formatting keybinds - $(s2).on(e, function(e) { - if (!localStorage.formatText_keybinds || localStorage.formatText_keybinds == 'false') { - localStorage.formatText_keybinds = 'true'; - if (window.Options && Options.get_tab('general')) e.target.checked = true; - } else { - localStorage.formatText_keybinds = 'false'; - if (window.Options && Options.get_tab('general')) e.target.checked = false; + + /* Attach event listeners + */ + $( 'body' ).on( 'keydown', 'textarea[name="body"]', {formats: formats}, function (e) { + //shortcuts + if (e.ctrlKey) { + var ch = String.fromCharCode(e.which).toLowerCase(); + var box = e.target; + var formats = e.data.formats; + for (var ele in formats) { + if (formats.hasOwnProperty(ele) && (ch === formats[ele].shortcutKey)) { + formats[ele].edit(box, formats[ele].options); + e.preventDefault(); + } + } } }); - - // setting for toolbar injection - $(s3).on(e, function(e) { - if (!localStorage.formatText_toolbar || localStorage.formatText_toolbar == 'false') { - localStorage.formatText_toolbar = 'true'; - if (window.Options && Options.get_tab('general')) e.target.checked = true; - formatText.build_toolbars(); - } else { - localStorage.formatText_toolbar = 'false'; - if (window.Options && Options.get_tab('general')) e.target.checked = false; - $('.format-text').remove(); + $( 'body' ).on( 'keydown', '#quick-reply textarea[name="body"]', {formats: formats}, function (e) { + //close quick reply when esc is prssed + if (e.which === 27) { + $( '.close-btn' ).trigger( 'click' ); } }); - - // make sure the tab settings are switch properly at loadup - if (window.Options && Options.get_tab('general')) { - if (localStorage.formatText_enable == 'true') $(s1)[0].checked = true; - else $(s1)[0].checked = false; - if (localStorage.formatText_keybinds == 'true') $(s2)[0].checked = true; - else $(s2)[0].checked = false; - if (localStorage.formatText_toolbar == 'true') $(s2)[0].checked = true; - else $(s3)[0].checked = false; - } - - // add the tab for customizing the format settings - if (window.Options && !Options.get_tab('formatting')) { - Options.add_tab('formatting', 'angle-right', 'Customize Formatting'); - Options.extend_tab('formatting', '\ - \ - '); - - // Data control row - Options.extend_tab('formatting', '\ - \ - \ - \ - '); - - // Descriptor row - Options.extend_tab('formatting', '\ - Name\ - ML\ - EL\ - Prefix\ - Suffix\ - Key\ - '); - - // Rule rows - var rules = JSON.parse(localStorage.formatText_rules); - for (var index in rules){ - if (!rules.hasOwnProperty(index)) continue; - self.add_rule(rules[index], index); - } - } - - return self; - })(jQuery); - - // run initial toolbar injection - formatText.build_toolbars(); - - //attach listeners to so it also works on quick-reply box - $('body').on('keydown', '#body, #quick-reply #body', function(e) { - if (!localStorage.formatText_enable || localStorage.formatText_enable == 'false') return; - if (!localStorage.formatText_keybinds || localStorage.formatText_keybinds == 'false') return; - var key = String.fromCharCode(e.which).toLowerCase(); - var rules = JSON.parse(localStorage.formatText_rules); - for (var index in rules) { - if (!rules.hasOwnProperty(index)) continue; - if (key === rules[index].key && e.ctrlKey) { - e.preventDefault(); - if (e.shiftKey) { - formatText.wrap(e.target, 'textarea[name="body"]', index, true); - } else { - formatText.wrap(e.target, 'textarea[name="body"]', index, false); + $( 'body' ).on( 'click', '.tf-toolbar a[id]', {formats: formats}, function (e) { + //toolbar buttons + var formats = e.data.formats; + var box = $(e.target).parent().next()[0]; + + for (var ele in formats) { + if (formats.hasOwnProperty(ele) && (e.target.id === 'tf-' + ele)) { + formats[ele].edit(box, formats[ele].options); } } - } + }); + // $( 'body' ).on( 'keydown', function (e) { + // if (e.which === 67 && + // e.target.nodeName !== 'INPUT' && //The C, the whole C, and nothing but the C + // e.target.nodeName !== 'TEXTAREA' && + // !(e.ctrlKey || e.altKey || e.shiftKey)) { + // document.location.href = '//'+ document.location.host +'/'+ board_name +'/catalog.html'; + // } + // }); + }); - $(document).trigger('formatText'); -} \ No newline at end of file +} diff --git a/stylesheets/style.css b/stylesheets/style.css index ec07fe0a..0e56f442 100644 --- a/stylesheets/style.css +++ b/stylesheets/style.css @@ -896,7 +896,6 @@ div.thread:hover { right: 0px; text-align: left; font-size: 12px; - overflow-y: auto; } .options_tab h2 { -- cgit v1.3 From f02226449a542b846f12b687b27415f9e11d557e Mon Sep 17 00:00:00 2001 From: 8chan Date: Tue, 21 Oct 2014 21:08:17 -0700 Subject: Fix own post (You) --- js/show-own-posts.js | 2 +- stylesheets/style.css | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) (limited to 'stylesheets/style.css') diff --git a/js/show-own-posts.js b/js/show-own-posts.js index 8b83f4cd..e26f5abd 100644 --- a/js/show-own-posts.js +++ b/js/show-own-posts.js @@ -33,7 +33,7 @@ var update_own = function() { if (posts[board] && posts[board].indexOf(id) !== -1) { // Own post! $(this).addClass('you'); - $(this).find('span.name').first().append(' '+_('(You)')); + $(this).find('span.name').first().append(' '+_('(You)')+''); } // Update references diff --git a/stylesheets/style.css b/stylesheets/style.css index 0e56f442..6a9f1a9a 100644 --- a/stylesheets/style.css +++ b/stylesheets/style.css @@ -966,6 +966,7 @@ span.pln { #watchlist-toggle, .watchThread, .watchlist-remove, #clearList, #clearGhosts { cursor: pointer; } +<<<<<<< HEAD #youtube-size input { width: 50px; @@ -1118,3 +1119,11 @@ table.fileboard .intro a { max-height: 100%; position: absolute; } +.own_post { + font-style: italic; + font-weight: normal; + opacity: .666; +} +div.mix { + display: inline-block; +} -- cgit v1.3 From e64b01b6903c5b1f1498627db919a50c4e0ff88c Mon Sep 17 00:00:00 2001 From: 8n-tech <8n-tech@users.noreply.github.com> Date: Tue, 21 Apr 2015 01:39:44 +1000 Subject: Javascript ammendments, dio_ on Windows. Signed-off-by: 8n-tech <8n-tech@users.noreply.github.com> --- js/fix-report-delete-submit.js | 12 ++++-- js/infinite-scroll.js | 89 +++++++++++++++++++++--------------------- js/post-filter.js | 9 ++++- js/post-menu.js | 6 ++- stylesheets/style.css | 13 +++--- 5 files changed, 72 insertions(+), 57 deletions(-) (limited to 'stylesheets/style.css') diff --git a/js/fix-report-delete-submit.js b/js/fix-report-delete-submit.js index 47a04f16..01785974 100644 --- a/js/fix-report-delete-submit.js +++ b/js/fix-report-delete-submit.js @@ -9,9 +9,10 @@ */ if (active_page == 'thread' || active_page == 'index') { -$(document).ready(function(){ - +$(document).on('menu_ready', function(){ + if ($('#delete-fields #password').length) { + var Menu = window.Menu; Menu.add_item("delete_post_menu", _("Delete post")); Menu.add_item("delete_file_menu", _("Delete file")); Menu.onclick(function(e, $buf) { @@ -57,4 +58,9 @@ $(document).on('new_post', function(){ }); $('input.delete').hide(); $('#post-moderation-fields').hide(); -})} +}); + +if (typeof window.Menu !== "undefined") { + $(document).trigger('menu_ready'); +} +} diff --git a/js/infinite-scroll.js b/js/infinite-scroll.js index e212f9d6..b3c5c7ae 100644 --- a/js/infinite-scroll.js +++ b/js/infinite-scroll.js @@ -21,7 +21,7 @@ var activate = function() { if (document.location.hash != '#all') return false; $(window).on("scroll", function() { - scrolltest(); + scrolltest(); }); scrolltest(); @@ -30,53 +30,54 @@ var activate = function() { var scrolltest = function() { if ($(window).scrollTop() + $(window).height() + 1000 > $(document).height() && !loading) { - load_next_page(); + load_next_page(); } }; var load_next_page = function() { - if (loading) return; - loading = true; - - var this_page = $(".pages a.selected:last"); - var next_page = this_page.next(); - - var href = next_page.prop("href"); - if (!href) return; - - var boardheader = $('

'+_('Page')+' '+next_page.html()+'

'); - var loading_ind = $('

'+_('Loading...')+'

').insertBefore('form[name="postcontrols"]>.delete:first'); - - $.get(href, function(data) { - var doc = $(data); - - loading_ind.remove(); - boardheader.insertBefore('form[name="postcontrols"]>.delete:first'); - - var i = 0; - - doc.find('div[id*="thread_"]').each(function() { - var checkout = $(this).attr('id').replace('thread_', ''); - var $this = this; - - if ($('div#thread_' + checkout).length == 0) { - // Delay DOM insertion to lessen the lag. - setTimeout(function() { - $($this).insertBefore('form[name="postcontrols"]>.delete:first'); - $(document).trigger('new_post', $this); - $($this).hide().slideDown(); - }, 500*i); - i++; - } - }); - setTimeout(function() { - loading = false; - scrolltest(); - }, 500*(i+1)); - - next_page.addClass('selected'); - }); - + if (loading) return; + loading = true; + + var this_page = $(".pages a.selected:last"); + var next_page = this_page.next(); + + var href = next_page.prop("href"); + if (!href) return; + + var boardheader = $('

'+_('Page')+' '+next_page.html()+'

'); + var loading_ind = $('

'+_('Loading...')+'

').insertBefore('#post-moderation-fields'); + + $.get(href, function(data) { + var doc = $(data); + + loading_ind.remove(); + boardheader.insertBefore('#post-moderation-fields'); + + var i = 0; + + doc.find('div[id*="thread_"]').each(function() { + var checkout = $(this).attr('id').replace('thread_', ''); + var $this = this; + + if ($('div#thread_' + checkout).length == 0) { + // Delay DOM insertion to lessen the lag. + setTimeout(function() { + $($this).insertBefore('#post-moderation-fields'); + $(document).trigger('new_post', $this); + $($this).hide().slideDown(); + }, 500*i); + + i++; + } + }); + + setTimeout(function() { + loading = false; + scrolltest(); + }, 500*(i+1)); + + next_page.addClass('selected'); + }); }; var button = $(""+_("All")+" ").prependTo(".pages"); diff --git a/js/post-filter.js b/js/post-filter.js index aaab4d0e..023b54e4 100644 --- a/js/post-filter.js +++ b/js/post-filter.js @@ -1,6 +1,7 @@ if (active_page === 'thread' || active_page === 'index' || active_page === 'catalog') { - $(document).ready(function () { + $(document).on('menu_ready', function () { 'use strict'; + // returns blacklist object from storage function getList() { return JSON.parse(localStorage.postFilter); @@ -200,7 +201,7 @@ if (active_page === 'thread' || active_page === 'index' || active_page === 'cata * create filter menu when the button is clicked */ function initPostMenu(pageData) { - + var Menu = window.Menu; var submenu; Menu.add_item('filter-menu-hide', _('Hide post')); Menu.add_item('filter-menu-unhide', _('Unhide post')); @@ -836,4 +837,8 @@ if (active_page === 'thread' || active_page === 'index' || active_page === 'cata } init(); }); + + if (typeof window.Menu !== "undefined") { + $(document).trigger('menu_ready'); + } } diff --git a/js/post-menu.js b/js/post-menu.js index 7d83709a..6018dfdb 100644 --- a/js/post-menu.js +++ b/js/post-menu.js @@ -26,7 +26,7 @@ * $config['additional_javascript'][] = 'js/jquery.min.js'; * $config['additional_javascript'][] = 'js/post-menu.js'; */ -onready(function () { +$(document).ready(function () { var List = function (menuId, text) { this.id = menuId; @@ -133,6 +133,8 @@ Menu.get_submenu = function (id) { return mainMenu.get_submenu(id); }; +window.Menu = Menu; + /* * * * * * * * Initialize @@ -205,5 +207,5 @@ $(document).on('new_post', function (e, post) { addButton(post); }); -window.Menu = Menu; +$(document).trigger('menu_ready'); }); diff --git a/stylesheets/style.css b/stylesheets/style.css index 6a9f1a9a..6b4b19d9 100644 --- a/stylesheets/style.css +++ b/stylesheets/style.css @@ -416,12 +416,13 @@ fieldset label { } div.pages { - color: #89A; - background: #D6DAF0; - display: inline; - padding: 8px; - border-right: 1px solid #B7C5D9; - border-bottom: 1px solid #B7C5D9; + color: #89A; + background: #D6DAF0; + display: inline-block; + padding: 8px; + margin: 8px 0 4px 0; + border-right: 1px solid #B7C5D9; + border-bottom: 1px solid #B7C5D9; } div.pages.top { -- cgit v1.3 From 293543878a10e1ef93990acb373f8f22ca655f64 Mon Sep 17 00:00:00 2001 From: czaks Date: Fri, 6 May 2016 12:10:50 +0200 Subject: backport parts of 2d6d449bd2d72, in particular html classes --- stylesheets/style.css | 2 +- templates/generic_page.html | 2 +- templates/index.html | 2 +- templates/page.html | 2 +- templates/post_thread.html | 2 +- templates/themes/basic/index.html | 2 +- templates/thread.html | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) (limited to 'stylesheets/style.css') diff --git a/stylesheets/style.css b/stylesheets/style.css index 6b4b19d9..2c5663bd 100644 --- a/stylesheets/style.css +++ b/stylesheets/style.css @@ -666,7 +666,7 @@ pre { margin-left: -20px; } -div.thread:hover { +.theme-catalog div.thread:hover { background: #D6DAF0; border-color: #B7C5D9; } diff --git a/templates/generic_page.html b/templates/generic_page.html index 35b58df3..fbfc3c50 100644 --- a/templates/generic_page.html +++ b/templates/generic_page.html @@ -6,7 +6,7 @@ {{ board.url }} - {{ board.name }} {% endblock %} - + {{ boardlist.top }} {% if pm %}
You have an unread PM{% if pm.waiting > 0 %}, plus {{ pm.waiting }} more waiting{% endif %}.

{% endif %} {% if config.url_banner %}{% endif %} diff --git a/templates/index.html b/templates/index.html index d4c56707..1eea6e6b 100644 --- a/templates/index.html +++ b/templates/index.html @@ -16,7 +16,7 @@ {% include 'header.html' %} {{ board.url }} - {{ board.title|e }} - + {{ boardlist.top }} {% if pm %}
You have an unread PM{% if pm.waiting > 0 %}, plus {{ pm.waiting }} more waiting{% endif %}.

{% endif %} diff --git a/templates/page.html b/templates/page.html index 816bb72b..296b517e 100644 --- a/templates/page.html +++ b/templates/page.html @@ -8,7 +8,7 @@ {% include 'header.html' %} {{ title }} - + {{ boardlist.top }} {% if pm %}
You have an unread PM{% if pm.waiting > 0 %}, plus {{ pm.waiting }} more waiting{% endif %}.

{% endif %} diff --git a/templates/post_thread.html b/templates/post_thread.html index 61146491..72ca2998 100644 --- a/templates/post_thread.html +++ b/templates/post_thread.html @@ -1,7 +1,7 @@ {% filter remove_whitespace %} {# tabs and new lines will be ignored #} -
+
{% if not index %}{% endif %} {% include 'post/fileinfo.html' %} diff --git a/templates/themes/basic/index.html b/templates/themes/basic/index.html index 8cdaf182..9d7a2c41 100644 --- a/templates/themes/basic/index.html +++ b/templates/themes/basic/index.html @@ -11,7 +11,7 @@ {% if config.default_stylesheet.1 != '' %}{% endif %} {% if config.font_awesome %}{% endif %} - + {{ boardlist.top }}

{{ settings.title }}

diff --git a/templates/thread.html b/templates/thread.html index c909f843..425394bb 100644 --- a/templates/thread.html +++ b/templates/thread.html @@ -12,7 +12,7 @@ {% include 'header.html' %} {{ board.url }} - {% if config.thread_subject_in_title and thread.subject %}{{ thread.subject }}{% else %}{{ board.title|e }}{% endif %} - + {{ boardlist.top }} {% if pm %}
You have an unread PM{% if pm.waiting > 0 %}, plus {{ pm.waiting }} more waiting{% endif %}.

{% endif %} {% if config.url_banner %}{% endif %} -- cgit v1.3 From 6644ff666a1c794c6536c895e322dbcb50710134 Mon Sep 17 00:00:00 2001 From: 8n-tech <8n-tech@users.noreply.github.com> Date: Sat, 18 Apr 2015 04:39:50 +1000 Subject: Also improved some CSS and HTML aspects of the thread layout. Signed-off-by: 8n-tech <8n-tech@users.noreply.github.com> --- stylesheets/style.css | 86 ++++++++++++++++++++++++++++++++++++-------- templates/report_delete.html | 21 ++++++----- templates/thread.html | 31 ++++++++++------ 3 files changed, 105 insertions(+), 33 deletions(-) (limited to 'stylesheets/style.css') diff --git a/stylesheets/style.css b/stylesheets/style.css index 2c5663bd..bb7c2634 100644 --- a/stylesheets/style.css +++ b/stylesheets/style.css @@ -468,20 +468,6 @@ hr { clear: left; } -div.boardlist { - color: #89A; - font-size: 9pt; - margin-top: 3px; -} - -div.boardlist.bottom { - margin-top: 20px; -} - -div.boardlist a { - text-decoration: none; -} - div.report { color: #333; } @@ -944,6 +930,78 @@ span.pln { } } +.clearfix { + display: block; + clear: both; + visibility: hidden; + overflow: hidden; + + font-size: 0px; + line-height: 0px; + + box-sizing: border-box; + border: none; + height: 0; + margin: 0; + padding: 0; + width: 100%; + zoom: 1; +} + +/* === SPECIFIC PAGES & FEATURES === */ + +/* Board List */ +div.boardlist { + margin-top: 3px; + + color: #89A; + font-size: 9pt; +} +div.boardlist.bottom { + margin-top: 12px; + clear: both; +} +div.boardlist a { + text-decoration: none; +} + +/* Threads */ +/* Thread Footer */ +#thread-interactions { + margin: 8px 0; + clear: both; +} +#thread-links { + float: left; +} +#thread-links > a { + padding-left: none; + padding-right: 10px; +} +#thread-quick-reply { + display: none; + position: absolute; + left: 50%; + right: 50%; + text-align: center; + width: 100px; + margin-left: -50px; +} +#thread_stats { + float: right; +} + +#post-moderation-fields { + float: right; + text-align: right; +} +#delete-fields { +} +#report-fields { +} + + + /* threadwatcher */ #watchlist { diff --git a/templates/report_delete.html b/templates/report_delete.html index 2fcb7259..e246da9e 100644 --- a/templates/report_delete.html +++ b/templates/report_delete.html @@ -1,13 +1,16 @@ -{% if config.allow_delete %} -
- {% trans %}Delete Post{% endtrans %} [ - ] +
+ {% if config.allow_delete %} +
+ {% trans %}Delete Post{% endtrans %} [ + ] -
-{% endif %} -
- +
+ {% endif %} + +
+ -
+
+
\ No newline at end of file diff --git a/templates/thread.html b/templates/thread.html index 2ca81e2e..1cbb6d20 100644 --- a/templates/thread.html +++ b/templates/thread.html @@ -24,6 +24,7 @@ {{ board.url }} - {{ meta_subject }} + {{ boardlist.top }} {% if pm %}
You have an unread PM{% if pm.waiting > 0 %}, plus {{ pm.waiting }} more waiting{% endif %}.

{% endif %} {% if config.url_banner %}{% endif %} @@ -56,18 +57,28 @@ [{% trans %}Go to bottom{% endtrans %}]
- - {% if mod %}{% endif %} - {{ body }} - {% include 'report_delete.html' %} + + {% if mod %}{% endif %} + + {{ body }} + + + +
- - [{% trans %}Return{% endtrans %}] - [{% trans %}Go to top{% endtrans %}] - [{% trans %}Catalog{% endtrans %}] - - {{ boardlist.bottom }} {{ config.ad.bottom }} -- cgit v1.3 From d069a4c9fd9efb995fffa1d705dd201c09b7d13e Mon Sep 17 00:00:00 2001 From: Forkless Date: Mon, 3 Nov 2014 02:28:04 -0600 Subject: Added option for hiding IDs. --- js/forced-anon.js | 72 ++++++++++++++++++++++++++++--------------- stylesheets/style.css | 8 +++++ templates/post/poster_id.html | 4 +-- 3 files changed, 57 insertions(+), 27 deletions(-) (limited to 'stylesheets/style.css') diff --git a/js/forced-anon.js b/js/forced-anon.js index 11327ec9..26d0cb4f 100644 --- a/js/forced-anon.js +++ b/js/forced-anon.js @@ -18,10 +18,10 @@ if (active_page == 'ukko' || active_page == 'thread' || active_page == 'index' || (window.Options && Options.get_tab('general'))) $(document).ready(function() { var force_anon = function() { - if($(this).children('a.capcode').length == 0) { + if ($(this).children('a.capcode').length == 0) { var id = $(this).parent().children('a.post_no:eq(1)').text(); - if($(this).children('a.email').length != 0) + if ($(this).children('a.email').length != 0) var p = $(this).children('a.email'); else var p = $(this); @@ -29,7 +29,7 @@ $(document).ready(function() { old_info[id] = {'name': p.children('span.name').text(), 'trip': p.children('span.trip').text()}; p.children('span.name').text('Anonymous'); - if(p.children('span.trip').length != 0) + if (p.children('span.trip').length != 0) p.children('span.trip').text(''); } }; @@ -40,44 +40,60 @@ $(document).ready(function() { var disable_fa = function() { $('p.intro label').each(function() { - if($(this).children('a.capcode').length == 0) { + if ($(this).children('a.capcode').length == 0) { var id = $(this).parent().children('a.post_no:eq(1)').text(); if(old_info[id]) { - if($(this).children('a.email').length != 0) + if ($(this).children('a.email').length != 0) var p = $(this).children('a.email'); else var p = $(this); p.children('span.name').text(old_info[id]['name']); - if(p.children('span.trip').length != 0) + if (p.children('span.trip').length != 0) p.children('span.trip').text(old_info[id]['trip']); } } }); }; + var toggle_id = function() { + if (localStorage.hideids == 'true'){ + $(this).addClass('hidden'); + } else { + $(this).removeClass('hidden'); + } + }; + old_info = {}; forced_anon = localStorage['forcedanon'] ? true : false; - var selector, event; - if (window.Options && Options.get_tab('general')) { - selector = '#forced-anon'; - event = 'change'; - Options.extend_tab("general", ""); - } - else { - selector = '#forced-anon'; - event = 'click'; + if (window.Options && Options.get_tab('general')) { + var s1 = '#hide-ids', s2 = '#forced-anon', e = 'change'; + Options.extend_tab("general", ""); + Options.extend_tab("general", ""); + } + else { + var s1 = '#hide-ids', s2 = '#forced-anon', e = 'click'; + $('hr:first').before(''); $('hr:first').before(''); $('div#forced-anon a').text(_('Forced anonymity')+' (' + (forced_anon ? _('enabled') : _('disabled')) + ')'); - } + } + $(s1).on(e, function(e) { + if (!localStorage.hideids || localStorage.hideids == 'false') { + localStorage.hideids = 'true'; + if (window.Options && Options.get_tab('general')) e.target.checked = true; + } else { + localStorage.hideids = 'false'; + if (window.Options && Options.get_tab('general')) e.target.checked = false; + } + $('.poster_id').each(toggle_id); + }); - $(selector).on(event, function() { + $(s2).on(e, function() { forced_anon = !forced_anon; - - if(forced_anon) { + if (forced_anon) { $('div#forced-anon a').text(_('Forced anonymity')+' ('+_('enabled')+')'); localStorage.forcedanon = true; enable_fa(); @@ -86,21 +102,27 @@ $(document).ready(function() { delete localStorage.forcedanon; disable_fa(); } - return false; }); + // initial option setup on script load + if (localStorage.hideids == 'true'){ + if (window.Options && Options.get_tab('general')) $('#hide-ids>input').prop('checked',true); + $('.poster_id').each(toggle_id); + } + if(forced_anon) { enable_fa(); - - if (window.Options && Options.get_tab('general')) { - $('#toggle-locked-threads>input').prop('checked', true); - } + if (window.Options && Options.get_tab('general')) { + $('#toggle-locked-threads>input').prop('checked', true); + } } $(document).on('new_post', function(e, post) { - if(forced_anon) + if (forced_anon) $(post).find('p.intro label').each(force_anon); + if (localStorage.hideids == 'true') + $(post).find('.poster_id').each(toggle_id); }); }); diff --git a/stylesheets/style.css b/stylesheets/style.css index bb7c2634..e54faf93 100644 --- a/stylesheets/style.css +++ b/stylesheets/style.css @@ -8,6 +8,10 @@ body { padding-right: 4px; } +.hidden { + display:none; +} + a,a:visited { text-decoration: underline; color: #34345C; @@ -905,6 +909,10 @@ pre { cursor: pointer; } +.poster_id::before { + content: " ID: "; +} + pre { /* Better code tags */ max-width:inherit; diff --git a/templates/post/poster_id.html b/templates/post/poster_id.html index 4efc56ff..51f0624f 100644 --- a/templates/post/poster_id.html +++ b/templates/post/poster_id.html @@ -1,7 +1,7 @@ {% if config.poster_ids %} {% if post.thread %} - ID: {{ post.ip|poster_id(post.thread) }} + {{ post.ip|poster_id(post.thread) }} {% else %} - ID: {{ post.ip|poster_id(post.id) }} + {{ post.ip|poster_id(post.id) }} {% endif %} {% endif %} -- cgit v1.3 From 65ea7b78c50ab3da60a541237f73b13cd2e7e6d8 Mon Sep 17 00:00:00 2001 From: Fredrick Brennan Date: Sun, 10 May 2015 12:51:35 +0800 Subject: Catalog: click to scroll thread --- js/catalog.js | 10 ++++++++++ stylesheets/style.css | 1 - 2 files changed, 10 insertions(+), 1 deletion(-) (limited to 'stylesheets/style.css') diff --git a/js/catalog.js b/js/catalog.js index 065fba7b..9adaeaef 100644 --- a/js/catalog.js +++ b/js/catalog.js @@ -35,4 +35,14 @@ if (active_page == 'catalog') $(function(){ if (catalog.image_size !== undefined) { $('#image_size').val(catalog.image_size).trigger('change'); } + + $('div.thread').on('click', function(e) { + if ($(this).css('overflow-y') === 'hidden') { + $(this).css('overflow-y', 'auto'); + $(this).css('width', '100%'); + } else { + $(this).css('overflow-y', 'hidden'); + $(this).css('width', 'auto'); + } + }); }); diff --git a/stylesheets/style.css b/stylesheets/style.css index e54faf93..b36a9de9 100644 --- a/stylesheets/style.css +++ b/stylesheets/style.css @@ -1033,7 +1033,6 @@ div.boardlist a { #watchlist-toggle, .watchThread, .watchlist-remove, #clearList, #clearGhosts { cursor: pointer; } -<<<<<<< HEAD #youtube-size input { width: 50px; -- cgit v1.3 From ce9f9eec252c435bfc1a9d637ae23c5178f9c1e4 Mon Sep 17 00:00:00 2001 From: czaks Date: Fri, 6 May 2016 17:11:12 +0200 Subject: settings dialog refinements: now you can resize it --- stylesheets/style.css | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'stylesheets/style.css') diff --git a/stylesheets/style.css b/stylesheets/style.css index b36a9de9..39d1fd04 100644 --- a/stylesheets/style.css +++ b/stylesheets/style.css @@ -819,10 +819,14 @@ pre { } #options_div { - width: 600px; - height: 320px; + width: 620px; + height: 400px; + resize: both; + overflow: auto; } + + #alert_div { width: 500px; } @@ -853,7 +857,7 @@ pre { #options_tablist { padding: 0px 5px; left: 0px; - width: 70px; + width: 90px; top: 0px; bottom: 0px; height: 100%; @@ -882,11 +886,12 @@ pre { padding: 10px; position: absolute; top: 0px; - bottom: 0px; - left: 81px; + bottom: 10px; + left: 101px; right: 0px; text-align: left; font-size: 12px; + overflow-y: auto; } .options_tab h2 { -- cgit v1.3 From 04f42b3802631a825d8ef112b153e66e962a0e66 Mon Sep 17 00:00:00 2001 From: fatchan Date: Wed, 1 Jun 2016 19:51:21 +1000 Subject: CSS hover instead of javascript mouseover. Need to use important because the dark/light text determined by IDToRGB is added inline and takes priority over stylesheets. --- js/id_colors.js | 6 ------ stylesheets/style.css | 4 +++- 2 files changed, 3 insertions(+), 7 deletions(-) (limited to 'stylesheets/style.css') diff --git a/js/id_colors.js b/js/id_colors.js index 6335f960..55454476 100644 --- a/js/id_colors.js +++ b/js/id_colors.js @@ -50,12 +50,6 @@ if (active_page == 'thread' || active_page == 'index') { "border-radius": "8px", "color": ft }); - - $(el).mouseover(function() { - $(this).css('color', '#800000'); // how about a CSS :hover rule instead? - }).mouseout(function() { - $(this).css('color', ft); - }); } $(".poster_id").each(function(k, v){ diff --git a/stylesheets/style.css b/stylesheets/style.css index 39d1fd04..7bedfe14 100644 --- a/stylesheets/style.css +++ b/stylesheets/style.css @@ -913,7 +913,9 @@ pre { .poster_id { cursor: pointer; } - +.poster_id:hover { + color: #800000!important; +} .poster_id::before { content: " ID: "; } -- cgit v1.3 From f23d11be60dd03039b04320dc0ea83f563332c9c Mon Sep 17 00:00:00 2001 From: Duane Moody Date: Thu, 22 Oct 2015 10:50:59 -0700 Subject: Prevent poster IDs from wordwrapping Poster IDs still linebreak between "ID:" and the ID, this corrects that without having to replace the space inbetween with an   nonbreaking space. --- stylesheets/style.css | 1 + 1 file changed, 1 insertion(+) (limited to 'stylesheets/style.css') diff --git a/stylesheets/style.css b/stylesheets/style.css index 7bedfe14..abd94973 100644 --- a/stylesheets/style.css +++ b/stylesheets/style.css @@ -912,6 +912,7 @@ pre { .poster_id { cursor: pointer; + white-space:nowrap; } .poster_id:hover { color: #800000!important; -- cgit v1.3 From c9ef21bff98698902cf5c89b3baf29a17864fd7a Mon Sep 17 00:00:00 2001 From: fatchan Date: Wed, 8 Jun 2016 00:03:50 +1000 Subject: Better solution to prevent ID wrapping. Also no longer text-selectable. Much cleaner. --- stylesheets/style.css | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'stylesheets/style.css') diff --git a/stylesheets/style.css b/stylesheets/style.css index abd94973..23d3ad7d 100644 --- a/stylesheets/style.css +++ b/stylesheets/style.css @@ -912,7 +912,12 @@ pre { .poster_id { cursor: pointer; - white-space:nowrap; + display: inline-block; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + -o-user-select: none; + user-select: none; } .poster_id:hover { color: #800000!important; -- cgit v1.3