From 41ee55a1b2dadacdc646f5ca9797d2aa3cc91c10 Mon Sep 17 00:00:00 2001 From: undido Date: Wed, 20 Mar 2013 00:56:59 -0300 Subject: Update auto-reload.js check if viewing a thread or viewing a board page when updating a thread so new posts do not appear at bottom of page while viewing threads list not sure if this was because of an outdated template but I thought I should point out this as it may affect html templates no matter the code as the banner code is the only code that checks where the user currently is. --- js/auto-reload.js | 3 +++ 1 file changed, 3 insertions(+) (limited to 'js') diff --git a/js/auto-reload.js b/js/auto-reload.js index c0c63056..5d96146a 100644 --- a/js/auto-reload.js +++ b/js/auto-reload.js @@ -16,6 +16,9 @@ $(document).ready(function(){ if($('div.banner').length == 0) return; // not index + + if($(".post.op").size() != 1) + return; //not thread page var poll_interval; -- cgit v1.3 From 0e490407e18679de2458647b891edaeb664a2f8f Mon Sep 17 00:00:00 2001 From: lanc33 Date: Wed, 29 May 2013 19:16:37 -0300 Subject: Fixes #59 by making quick-reply.js agnostic to the value of $config['button_reply']. --- js/quick-reply.js | 2 +- templates/index.html | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'js') diff --git a/js/quick-reply.js b/js/quick-reply.js index dc48a743..bc36ca48 100644 --- a/js/quick-reply.js +++ b/js/quick-reply.js @@ -17,7 +17,7 @@ $(document).ready(function(){ return; // not index txt_new_topic = $('form[name=post] input[type=submit]').val(); - txt_new_reply = txt_new_topic == 'Submit' ? txt_new_topic : 'New Reply'; + txt_new_reply = txt_new_topic == 'Submit' ? txt_new_topic : new_reply_string; undo_quick_reply = function() { $('div.banner').remove(); diff --git a/templates/index.html b/templates/index.html index 761227ed..112756d1 100644 --- a/templates/index.html +++ b/templates/index.html @@ -10,6 +10,11 @@ {% if config.default_stylesheet.1 != '' %}{% endif %} {% if not nojavascript %} + {% if config.quick_reply %} + + {% endif %} {% if not config.additional_javascript_compile %} {% for javascript in config.additional_javascript %}{% endfor %} {% endif %} -- cgit v1.3 From ef66fd62b4d5aca67a9a3f3442524f2c401d5e98 Mon Sep 17 00:00:00 2001 From: czaks Date: Sat, 15 Jun 2013 00:37:12 -0400 Subject: inline-expanding.js: don't set max height --- js/inline-expanding.js | 1 - 1 file changed, 1 deletion(-) (limited to 'js') diff --git a/js/inline-expanding.js b/js/inline-expanding.js index f6714d7f..ec7978a7 100644 --- a/js/inline-expanding.js +++ b/js/inline-expanding.js @@ -16,7 +16,6 @@ onready(function(){ for(var i = 0; i < link.length; i++) { if(typeof link[i] == "object" && link[i].childNodes[0].src && link[i].className != 'file') { link[i].childNodes[0].style.maxWidth = '95%'; - link[i].childNodes[0].style.maxHeight = '95%'; link[i].onclick = function(e) { if(e.which == 2) { return true; -- cgit v1.3 From 1d76164e291a6f73378e33fa1f70f804acad0838 Mon Sep 17 00:00:00 2001 From: czaks Date: Sat, 15 Jun 2013 01:39:39 -0400 Subject: javascripts: fixed interactions (BEWARE, inline-expanding.js now requires jquery! fix your configs) --- js/expand.js | 1 + js/inline-expanding.js | 59 +++++++++++++++++++++++++++++--------------------- js/show-backlinks.js | 4 ++++ 3 files changed, 39 insertions(+), 25 deletions(-) (limited to 'js') diff --git a/js/expand.js b/js/expand.js index 05aece95..d78cea9a 100644 --- a/js/expand.js +++ b/js/expand.js @@ -35,6 +35,7 @@ $(document).ready(function(){ } last_expanded = $(this); + $(document).trigger('new_post', this); } }); $('Hide expanded replies.') diff --git a/js/inline-expanding.js b/js/inline-expanding.js index ec7978a7..ef84e806 100644 --- a/js/inline-expanding.js +++ b/js/inline-expanding.js @@ -6,41 +6,50 @@ * Copyright (c) 2012 Michael Save * * Usage: + * $config['additional_javascript'][] = 'js/jquery.min.js'; * $config['additional_javascript'][] = 'js/inline-expanding.js'; * */ onready(function(){ - var link = document.getElementsByTagName('a'); + var inline_expand_post = function() { + var link = this.getElementsByTagName('a'); - for(var i = 0; i < link.length; i++) { - if(typeof link[i] == "object" && link[i].childNodes[0].src && link[i].className != 'file') { - link[i].childNodes[0].style.maxWidth = '95%'; - link[i].onclick = function(e) { - if(e.which == 2) { - return true; - } - if(!this.tag) { - this.tag = this.childNodes[0].src; - this.childNodes[0].src = this.href; - this.childNodes[0].style.width = 'auto'; - this.childNodes[0].style.height = 'auto'; - this.childNodes[0].style.opacity = '0.4'; - this.childNodes[0].style.filter = 'alpha(opacity=40)'; - this.childNodes[0].onload = function() { - this.style.opacity = '1'; - this.style.filter = ''; + for(var i = 0; i < link.length; i++) { + if(typeof link[i] == "object" && link[i].childNodes[0].src && link[i].className != 'file') { + link[i].childNodes[0].style.maxWidth = '95%'; + link[i].onclick = function(e) { + if(e.which == 2) { + return true; + } + if(!this.tag) { + this.tag = this.childNodes[0].src; + this.childNodes[0].src = this.href; + this.childNodes[0].style.width = 'auto'; + this.childNodes[0].style.height = 'auto'; + this.childNodes[0].style.opacity = '0.4'; + this.childNodes[0].style.filter = 'alpha(opacity=40)'; + this.childNodes[0].onload = function() { + this.style.opacity = '1'; + this.style.filter = ''; + } + } else { + this.childNodes[0].src = this.tag; + this.childNodes[0].style.width = 'auto'; + this.childNodes[0].style.height = 'auto'; + this.tag = ''; } - } else { - this.childNodes[0].src = this.tag; - this.childNodes[0].style.width = 'auto'; - this.childNodes[0].style.height = 'auto'; - this.tag = ''; + return false; } - return false; } - } } + + $('div[id^="thread_"]').each(inline_expand_post); + + // allow to work with auto-reload.js, etc. + $(document).bind('new_post', function(e, post) { + inline_expand_post.call(post); + }); }); diff --git a/js/show-backlinks.js b/js/show-backlinks.js index e6e17e4f..4ead494b 100644 --- a/js/show-backlinks.js +++ b/js/show-backlinks.js @@ -46,5 +46,9 @@ onready(function(){ }; $('div.post.reply').each(showBackLinks); + + $(document).bind('new_post', function(e, post) { + showBackLinks.call(post); + }); }); -- cgit v1.3 From 399aa463b3d046a49c861a2c60c997f39af22561 Mon Sep 17 00:00:00 2001 From: Macil Tech Date: Tue, 18 Jun 2013 12:10:06 -0500 Subject: Fix #71. --- js/post-hover.js | 2 ++ 1 file changed, 2 insertions(+) (limited to 'js') diff --git a/js/post-hover.js b/js/post-hover.js index 2f25540b..48f0ed96 100644 --- a/js/post-hover.js +++ b/js/post-hover.js @@ -20,6 +20,8 @@ onready(function(){ if(id = $link.text().match(/^>>(\d+)$/)) { id = id[1]; + } else { + return; } var $post = false; -- cgit v1.3 From 0cae0d70b8a25264871a0d39dc1bfdbfa53e44dd Mon Sep 17 00:00:00 2001 From: czaks Date: Mon, 24 Jun 2013 09:02:12 -0400 Subject: post-hider.js: fixed multiple board issues; eg. you could hide a thread on one board, and threads from other boards with the same id would have been hidden too --- js/post-hider.js | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) (limited to 'js') diff --git a/js/post-hider.js b/js/post-hider.js index 0a2e3c1a..02a421fe 100644 --- a/js/post-hider.js +++ b/js/post-hider.js @@ -1,33 +1,37 @@ -function phGetCookieName(id) { - return "ph_hide_" + id; +function phGetCookieName(board, id) { + return "ph_hide_" + board + "_" + id; } -function phPostHidden(id) { - return (localStorage.getItem(phGetCookieName(id)) != null); +function phPostHidden(board, id) { + return (localStorage.getItem(phGetCookieName(board, id)) != null); } -function phPostToggle(id) { - if(phPostHidden(id)) { localStorage.removeItem(phGetCookieName(id)); } - else { localStorage.setItem(phGetCookieName(id),"yes"); } +function phPostToggle(board, id) { + if(phPostHidden(board, id)) { localStorage.removeItem(phGetCookieName(board, id)); } + else { localStorage.setItem(phGetCookieName(board, id),"yes"); } } -function phGetInnerText(id) { - if(phPostHidden(id)) { return "[+]"; } - else { return "[-]"; } +function phGetInnerText(board, id) { + if(phPostHidden(board, id)) { return "[+]"; } + else { return "[–]"; } } function phGetOpID(element) { return Number(element.children("div.post.op").children("p.intro").children("a.post_no:eq(1)").text()); } +function phGetOpBoard(element) { + return element.data("board"); +} function phPostHandle(element) { var id = phGetOpID(element); + var board = phGetOpBoard(element); var preplies = element.children("div.post.reply"); var pbody = element.children("div.post.op").children("div.body"); var pimage = element.children("a:first").children("img"); var pbutton = element.children("div.post.op").children("p.intro").children("a.posthider"); var pomitted = element.children("div.post.op").children("span.omitted"); - if(phPostHidden(id)) { element.addClass("thread-hidden"); pomitted.hide(); preplies.hide(); pbody.hide(); pimage.hide(); pbutton.text("[+]"); } - else { element.removeClass("thread-hidden"); pomitted.show(); preplies.show(); pbody.show(); pimage.show(); pbutton.text("[-]"); } + if(phPostHidden(board, id)) { element.addClass("thread-hidden"); pomitted.hide(); preplies.hide(); pbody.hide(); pimage.hide(); pbutton.text("[+]"); } + else { element.removeClass("thread-hidden"); pomitted.show(); preplies.show(); pbody.show(); pimage.show(); pbutton.text("[–]"); } } $(document).ready(function(){ - $('div[id^="thread"]').each(function(index, element){ + $('form[name="postcontrols"] > div[id^="thread"]').each(function(index, element){ // Get thread ID. var pin = $(this).children("div.post.op").children("p.intro"); var tid = phGetOpID($(this)); @@ -35,7 +39,7 @@ $(document).ready(function(){ $("[?]").insertAfter(pin.children('a:last')).click(function(e) { var eO = $(e.target); var par = eO.parent().parent().parent(); - phPostToggle(phGetOpID(par)); + phPostToggle(phGetOpBoard(par), phGetOpID(par)); phPostHandle(par); return false; }); -- cgit v1.3 From d134d2ae22e879becc9d5fc67d7ef63987c409b6 Mon Sep 17 00:00:00 2001 From: czaks Date: Mon, 24 Jun 2013 09:05:33 -0400 Subject: post-hider.js: further code cleanup; fix displaying on board pages --- js/post-hider.js | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) (limited to 'js') diff --git a/js/post-hider.js b/js/post-hider.js index 02a421fe..f4cde66a 100644 --- a/js/post-hider.js +++ b/js/post-hider.js @@ -30,20 +30,24 @@ function phPostHandle(element) { else { element.removeClass("thread-hidden"); pomitted.show(); preplies.show(); pbody.show(); pimage.show(); pbutton.text("[–]"); } } +function phHandleThread(index, element) { + // Get thread ID. + var pin = $(this).children("div.post.op").children("p.intro"); + var tid = phGetOpID($(this)); + if(tid != NaN) { + $("[?]").insertAfter(pin.children('a:last')).click(function(e) { + var eO = $(e.target); + var par = eO.parent().parent().parent(); + phPostToggle(phGetOpBoard(par), phGetOpID(par)); + phPostHandle(par); + return false; + }); + phPostHandle($(this)); + } +} + $(document).ready(function(){ - $('form[name="postcontrols"] > div[id^="thread"]').each(function(index, element){ - // Get thread ID. - var pin = $(this).children("div.post.op").children("p.intro"); - var tid = phGetOpID($(this)); - if(tid != NaN) { - $("[?]").insertAfter(pin.children('a:last')).click(function(e) { - var eO = $(e.target); - var par = eO.parent().parent().parent(); - phPostToggle(phGetOpBoard(par), phGetOpID(par)); - phPostHandle(par); - return false; - }); - phPostHandle($(this)); - } - }); + if (active_page != "thread") { + $('form[name="postcontrols"] > div[id^="thread"]').each(phHandleThread); + } }); -- cgit v1.3 From dfe31de15669bb10e87db98418b5bd36bd4c4a6e Mon Sep 17 00:00:00 2001 From: czaks Date: Tue, 2 Jul 2013 20:58:16 -0400 Subject: local-time.js: make it work in localised environments --- js/local-time.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'js') diff --git a/js/local-time.js b/js/local-time.js index b92cc5be..bb81c83a 100644 --- a/js/local-time.js +++ b/js/local-time.js @@ -25,13 +25,13 @@ onready(function(){ var times = document.getElementsByTagName('time'); for(var i = 0; i < times.length; i++) { - if(!times[i].innerHTML.match(/^\d+\/\d+\/\d+ \(\w+\) \d+:\d+:\d+$/)) + if(typeof times[i].getAttribute('data-local') == 'undefined') continue; var t = iso8601(times[i].getAttribute('datetime')); - + times[i].setAttribute('data-local', 'true'); times[i].innerHTML = // date zeropad(t.getMonth() + 1, 2) + "/" + zeropad(t.getDate(), 2) + "/" + t.getFullYear().toString().substring(2) + -- cgit v1.3 From fe1e07f1bfa818b515d10b93588a1397b3f76b78 Mon Sep 17 00:00:00 2001 From: czaks Date: Tue, 2 Jul 2013 21:09:05 -0400 Subject: local-time.js: make it work with thread expand etc; BEWARE IT NOW NEEDS JQUERY TO BE LOADED BEFORE --- js/local-time.js | 36 +++++++++++++++++++++++------------- 1 file changed, 23 insertions(+), 13 deletions(-) (limited to 'js') diff --git a/js/local-time.js b/js/local-time.js index bb81c83a..aee26ed2 100644 --- a/js/local-time.js +++ b/js/local-time.js @@ -6,6 +6,7 @@ * Copyright (c) 2012 Michael Save * * Usage: + * $config['additional_javascript'][] = 'js/jquery.min.js'; * $config['additional_javascript'][] = 'js/local-time.js'; * */ @@ -21,23 +22,32 @@ onready(function(){ var zeropad = function(num, count) { return [Math.pow(10, count - num.toString().length), num].join('').substr(1); }; + + var do_localtime = function(elem) { + var times = elem.getElementsByTagName('time'); - var times = document.getElementsByTagName('time'); - - for(var i = 0; i < times.length; i++) { - if(typeof times[i].getAttribute('data-local') == 'undefined') - continue; + for(var i = 0; i < times.length; i++) { + if(typeof times[i].getAttribute('data-local') == 'undefined') + continue; - var t = iso8601(times[i].getAttribute('datetime')); + var t = iso8601(times[i].getAttribute('datetime')); - times[i].setAttribute('data-local', 'true'); - times[i].innerHTML = - // date - zeropad(t.getMonth() + 1, 2) + "/" + zeropad(t.getDate(), 2) + "/" + t.getFullYear().toString().substring(2) + - " (" + ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"][t.getDay()] + ") " + - // time - zeropad(t.getHours(), 2) + ":" + zeropad(t.getMinutes(), 2) + ":" + zeropad(t.getSeconds(), 2); + times[i].setAttribute('data-local', 'true'); + times[i].innerHTML = + // date + zeropad(t.getMonth() + 1, 2) + "/" + zeropad(t.getDate(), 2) + "/" + t.getFullYear().toString().substring(2) + + " (" + ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"][t.getDay()] + ") " + + // time + zeropad(t.getHours(), 2) + ":" + zeropad(t.getMinutes(), 2) + ":" + zeropad(t.getSeconds(), 2); + }; }; + + do_localtime(document); + + // allow to work with auto-reload.js, etc. + $(document).bind('new_post', function(e, post) { + do_localtime(post); + }); }); -- cgit v1.3 From da9f367f2f9cf24d47b8d6a04cf2e54cb14a03bc Mon Sep 17 00:00:00 2001 From: czaks Date: Wed, 3 Jul 2013 01:04:08 -0400 Subject: js i18n: misc fixes; quick-reply.js i18n --- js/quick-reply.js | 6 +++--- templates/main.js | 4 ++-- tools/i18n_compile.php | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) (limited to 'js') diff --git a/js/quick-reply.js b/js/quick-reply.js index bc36ca48..ea504b48 100644 --- a/js/quick-reply.js +++ b/js/quick-reply.js @@ -17,7 +17,7 @@ $(document).ready(function(){ return; // not index txt_new_topic = $('form[name=post] input[type=submit]').val(); - txt_new_reply = txt_new_topic == 'Submit' ? txt_new_topic : new_reply_string; + txt_new_reply = txt_new_topic == _('Submit') ? txt_new_topic : new_reply_string; undo_quick_reply = function() { $('div.banner').remove(); @@ -27,9 +27,9 @@ $(document).ready(function(){ $('div.post.op').each(function() { var id = $(this).children('p.intro').children('a.post_no:eq(1)').text(); - $('[Quick reply]').insertAfter($(this).children('p.intro').children('a:last')).click(function() { + $('['+_("Quick reply")+']').insertAfter($(this).children('p.intro').children('a:last')).click(function() { $('div.banner').remove(); - $('') + $('') .insertBefore('form[name=post]'); $('form[name=post] input[type=submit]').val(txt_new_reply); diff --git a/templates/main.js b/templates/main.js index b3e773a3..31c0254a 100644 --- a/templates/main.js +++ b/templates/main.js @@ -2,12 +2,12 @@ /* gettext-compatible _ function, example of usage: * - * > // Loading pl_PL.json here (containing polish translation strings generated by tools/locale_compile.php) + * > // Loading pl_PL.json here (containing polish translation strings generated by tools/i18n_compile.php) * > alert(_("Hello!")); * Witaj! */ function _(s) { - return (typeof tb_l10n != 'undefined' && typeof tb_l10n[s] != 'undefined') ? tb_l10n[s] : s; + return (typeof l10n != 'undefined' && typeof l10n[s] != 'undefined') ? l10n[s] : s; } /* printf-like formatting function, example of usage: diff --git a/tools/i18n_compile.php b/tools/i18n_compile.php index c85ccb83..ce00051c 100755 --- a/tools/i18n_compile.php +++ b/tools/i18n_compile.php @@ -35,10 +35,10 @@ foreach ($locales as $loc) { if (file_exists($locdir."/LC_MESSAGES/tinyboard.po")) $join = "-j"; else $join = ""; `cd $locdir/LC_MESSAGES; - msgfmt tinyboard.po`; + msgfmt tinyboard.po -o tinyboard.mo`; // Generate javascript.po `cd tools/inc/lib/jsgettext/; php po2json.php -i ../../../../$locdir/LC_MESSAGES/javascript.po \ - -o ../../../../$locdir/LC_MESSAGES/javascript.js -k tb_i18n`; + -o ../../../../$locdir/LC_MESSAGES/javascript.js`; } -- cgit v1.3 From 37c1b134dea3dc54cee8f9fe07b713ee98ca993b Mon Sep 17 00:00:00 2001 From: czaks Date: Wed, 3 Jul 2013 01:17:56 -0400 Subject: js i18n: expand.js --- js/expand.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'js') diff --git a/js/expand.js b/js/expand.js index d78cea9a..0e3537a8 100644 --- a/js/expand.js +++ b/js/expand.js @@ -1,5 +1,5 @@ /* - *expand.js + * expand.js * https://github.com/savetheinternet/Tinyboard/blob/master/js/expand.js * * Released under the MIT license @@ -17,7 +17,7 @@ $(document).ready(function(){ $('div.post.op span.omitted').each(function() { $(this) - .html($(this).text().replace(/Click reply to view\./, 'Click to expand.')) + .html($(this).text().replace(_("Click reply to view."), ''+_("Click to expand")+'.')) .find('a').click(function() { var thread = $(this).parent().parent().parent(); var id = thread.attr('id').replace(/^thread_/, ''); @@ -38,7 +38,7 @@ $(document).ready(function(){ $(document).trigger('new_post', this); } }); - $('Hide expanded replies.') + $('' + _('Hide expanded replies') + '.') .insertAfter(thread.find('span.omitted').css('display', 'none')) .click(function() { thread.find('.expanded').remove(); -- cgit v1.3 From 7180a7770540f0a3934604b69ad780421efe57b0 Mon Sep 17 00:00:00 2001 From: czaks Date: Wed, 3 Jul 2013 01:18:44 -0400 Subject: smartphone-spoiler.js: make it work with thread expanding etc. --- js/smartphone-spoiler.js | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'js') diff --git a/js/smartphone-spoiler.js b/js/smartphone-spoiler.js index 67b9c789..ee904b54 100644 --- a/js/smartphone-spoiler.js +++ b/js/smartphone-spoiler.js @@ -13,12 +13,21 @@ onready(function(){ if(device_type == 'mobile') { - var spoilers = document.getElementsByClassName('spoiler'); - for(var i = 0; i < spoilers.length; i++) { - spoilers[i].onmousedown = function() { - this.style.color = 'white'; - }; - } + var fix_spoilers = function(where) { + var spoilers = where.getElementsByClassName('spoiler'); + for(var i = 0; i < spoilers.length; i++) { + spoilers[i].onmousedown = function() { + this.style.color = 'white'; + }; + } + }; + fix_spoilers(document); + + // allow to work with auto-reload.js, etc. + $(document).bind('new_post', function(e, post) { + fix_spoilers(post); + }); + } }); -- cgit v1.3 From f9abd0669bcb62e974ad24cd17078e46d6436428 Mon Sep 17 00:00:00 2001 From: czaks Date: Wed, 3 Jul 2013 01:27:09 -0400 Subject: js i18n: local-time.js --- js/local-time.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'js') diff --git a/js/local-time.js b/js/local-time.js index aee26ed2..a4e2fb51 100644 --- a/js/local-time.js +++ b/js/local-time.js @@ -37,7 +37,7 @@ onready(function(){ times[i].innerHTML = // date zeropad(t.getMonth() + 1, 2) + "/" + zeropad(t.getDate(), 2) + "/" + t.getFullYear().toString().substring(2) + - " (" + ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"][t.getDay()] + ") " + + " (" + [_("Sun"), _("Mon"), _("Tue"), _("Wed"), _("Thu"), _("Fri"), _("Sat"), _("Sun")][t.getDay()] + ") " + // time zeropad(t.getHours(), 2) + ":" + zeropad(t.getMinutes(), 2) + ":" + zeropad(t.getSeconds(), 2); }; -- cgit v1.3 From 7660be1e02b07acad20598399175e47fd5936e3a Mon Sep 17 00:00:00 2001 From: czaks Date: Wed, 3 Jul 2013 01:40:23 -0400 Subject: js i18n: hide-locked-threads.js i18n --- js/toggle-locked-threads.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'js') diff --git a/js/toggle-locked-threads.js b/js/toggle-locked-threads.js index 50c44eda..1d517a4d 100644 --- a/js/toggle-locked-threads.js +++ b/js/toggle-locked-threads.js @@ -36,7 +36,7 @@ $(document).ready(function(){ $('hr:first').before(''); $('div#toggle-locked-threads a') - .text((hide_locked_threads ? 'Show' : 'Hide') + ' locked threads') + .text(hide_locked_threads ? _('Show locked threads') : _('Hide locked threads')) .click(function() { hide_locked_threads = !hide_locked_threads; if (hide_locked_threads) { @@ -51,7 +51,7 @@ $(document).ready(function(){ delete localStorage.hidelockedthreads; } - $(this).text((hide_locked_threads ? 'Show' : 'Hide') + ' locked threads') + $(this).text(hide_locked_threads ? _('Show locked threads') : _('Hide locked threads')) }); if (hide_locked_threads) { -- cgit v1.3 From 05e719cea01e1e523d6db973955b1664387433a0 Mon Sep 17 00:00:00 2001 From: czaks Date: Wed, 3 Jul 2013 01:48:24 -0400 Subject: js i18n: forced-anon.js --- js/forced-anon.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'js') diff --git a/js/forced-anon.js b/js/forced-anon.js index 3dbf0dfc..6ae43882 100644 --- a/js/forced-anon.js +++ b/js/forced-anon.js @@ -56,17 +56,17 @@ $(document).ready(function() { forced_anon = localStorage['forcedanon'] ? true : false; $('hr:first').before(''); - $('div#forced-anon a').text('Forced anonymity (' + (forced_anon ? 'enabled' : 'disabled') + ')'); + $('div#forced-anon a').text(_('Forced anonymity')+' (' + (forced_anon ? _('enabled') : _('disabled')) + ')'); $('div#forced-anon a').click(function() { forced_anon = !forced_anon; if(forced_anon) { - $('div#forced-anon a').text('Forced anonymity (enabled)'); + $('div#forced-anon a').text(_('Forced anonymity')+' ('+_('enabled')+')'); localStorage.forcedanon = true; enable_fa(); } else { - $('div#forced-anon a').text('Forced anonymity (disabled)'); + $('div#forced-anon a').text(_('Forced anonymity')+' ('+_('disabled')+')'); delete localStorage.forcedanon; disable_fa(); } -- cgit v1.3 From 1e3ae4c7f7d6f056ceea3160d14b2d884cabd32d Mon Sep 17 00:00:00 2001 From: czaks Date: Wed, 3 Jul 2013 01:55:43 -0400 Subject: js i18n: quick-post-controls.js --- js/quick-post-controls.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'js') diff --git a/js/quick-post-controls.js b/js/quick-post-controls.js index 0c164bbb..c28f874f 100644 --- a/js/quick-post-controls.js +++ b/js/quick-post-controls.js @@ -24,17 +24,17 @@ $(document).ready(function(){ '' + - ': ' + + ': ' + '' + - '' + - '' + - ' ' + + '' + + '' + + ' ' + '
' + - ': ' + + ': ' + '' + - ' ' + + ' ' + '' + ''); post_form -- cgit v1.3 From 95b49f221597a7b45f920f997cddc67be929b47e Mon Sep 17 00:00:00 2001 From: czaks Date: Wed, 17 Jul 2013 22:09:28 -0400 Subject: quick-reply.js: activate only on index page --- js/quick-reply.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'js') diff --git a/js/quick-reply.js b/js/quick-reply.js index ea504b48..bee204b7 100644 --- a/js/quick-reply.js +++ b/js/quick-reply.js @@ -12,6 +12,7 @@ * */ +if (active_page == 'index') { $(document).ready(function(){ if($('div.banner').length != 0) return; // not index @@ -43,4 +44,4 @@ $(document).ready(function(){ }); }); }); - +} -- cgit v1.3 From dd4aea54312b288dbfe885be87148f8df116047a Mon Sep 17 00:00:00 2001 From: czaks Date: Wed, 17 Jul 2013 22:15:16 -0400 Subject: inline-expanding.js: internal fix for better stability --- js/inline-expanding.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'js') diff --git a/js/inline-expanding.js b/js/inline-expanding.js index ef84e806..7c9923fa 100644 --- a/js/inline-expanding.js +++ b/js/inline-expanding.js @@ -16,7 +16,7 @@ onready(function(){ var link = this.getElementsByTagName('a'); for(var i = 0; i < link.length; i++) { - if(typeof link[i] == "object" && link[i].childNodes[0].src && link[i].className != 'file') { + if(typeof link[i] == "object" && typeof link[i].childNodes[0] !== 'undefined' && link[i].childNodes[0].src && link[i].className != 'file') { link[i].childNodes[0].style.maxWidth = '95%'; link[i].onclick = function(e) { if(e.which == 2) { -- cgit v1.3