From 827dac38e893745fdf2154f00eb237f0a60675f7 Mon Sep 17 00:00:00 2001 From: Pashe Date: Fri, 13 Feb 2015 18:01:23 -0600 Subject: [PATCH 1/5] Make user JS/CSS textareas reasonably sized --- js/options/user-css.js | 14 +++++--------- js/options/user-js.js | 14 +++++--------- 2 files changed, 10 insertions(+), 18 deletions(-) diff --git a/js/options/user-css.js b/js/options/user-css.js index 22b005fa..45cad85b 100644 --- a/js/options/user-css.js +++ b/js/options/user-css.js @@ -14,17 +14,13 @@ var tab = Options.add_tab("user-css", "css3", _("User CSS")); var textarea = $("").css({ - "font-size": 12, - position: "absolute", - top: 35, bottom: 35, - width: "calc(100% - 20px)", margin: 0, padding: "4px", border: "1px solid black", - left: 5, right: 5 + "height" : "85%", + "width" : "100%", + "font-size" : "9pt", + "font-family": "monospace", }).appendTo(tab.content); var submit = $("").css({ - position: "absolute", - height: 25, bottom: 5, - width: "calc(100% - 10px)", - left: 5, right: 5 + "width": "100%", }).click(function() { localStorage.user_css = textarea.val(); apply_css(); diff --git a/js/options/user-js.js b/js/options/user-js.js index 221ca5d9..9d95a037 100644 --- a/js/options/user-js.js +++ b/js/options/user-js.js @@ -14,17 +14,13 @@ var tab = Options.add_tab("user-js", "code", _("User JS")); var textarea = $("").css({ - "font-size": 12, - position: "absolute", - top: 35, bottom: 35, - width: "calc(100% - 20px)", margin: 0, padding: "4px", border: "1px solid black", - left: 5, right: 5 + "height" : "85%", + "width" : "100%", + "font-size" : "9pt", + "font-family": "monospace", }).appendTo(tab.content); var submit = $("").css({ - position: "absolute", - height: 25, bottom: 5, - width: "calc(100% - 10px)", - left: 5, right: 5 + "width": "100%", }).click(function() { localStorage.user_js = textarea.val(); document.location.reload(); From a2f62d06176316ee51ea8605420dc30467bd62b3 Mon Sep 17 00:00:00 2001 From: Pashe Date: Fri, 13 Feb 2015 18:06:18 -0600 Subject: [PATCH 2/5] Remove some comments from the default user JS/CSS --- js/options/user-css.js | 4 +--- js/options/user-js.js | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/js/options/user-css.js b/js/options/user-css.js index 45cad85b..58f7d2c2 100644 --- a/js/options/user-css.js +++ b/js/options/user-css.js @@ -38,9 +38,7 @@ var apply_css = function() { var update_textarea = function() { if (!localStorage.user_css) { - textarea.text("/* "+_("Enter here your own CSS rules...")+" */\n" + - "/* "+_("If you want to make a redistributable style, be sure to\nhave a Yotsuba B theme selected.")+" */\n" + - "/* "+_("You can include CSS files from remote servers, for example:")+" */\n" + + textarea.text("/* "+_("You can include CSS files from remote servers, for example:")+" */\n" + '/* @import "http://example.com/style.css"; */'); } else { diff --git a/js/options/user-js.js b/js/options/user-js.js index 9d95a037..454aab51 100644 --- a/js/options/user-js.js +++ b/js/options/user-js.js @@ -47,9 +47,7 @@ var apply_js = function() { var update_textarea = function() { if (!localStorage.user_js) { - textarea.text("/* "+_("Enter here your own Javascript code...")+" */\n" + - "/* "+_("Have a backup of your storage somewhere, as messing here\nmay render you this website unusable.")+" */\n" + - "/* "+_("You can include JS files from remote servers, for example:")+" */\n" + + textarea.text("/* "+_("You can include JS files from remote servers, for example:")+" */\n" + '/* load_js("http://example.com/script.js"); */'); } else { From 4f126e91ea9145d3b6d24a8531cd41b7bc849bb3 Mon Sep 17 00:00:00 2001 From: Pashe Date: Fri, 13 Feb 2015 18:07:38 -0600 Subject: [PATCH 3/5] Save makes more sense than update here --- js/options/user-css.js | 2 +- js/options/user-js.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/js/options/user-css.js b/js/options/user-css.js index 58f7d2c2..62ed3f80 100644 --- a/js/options/user-css.js +++ b/js/options/user-css.js @@ -19,7 +19,7 @@ var textarea = $("").css({ "font-size" : "9pt", "font-family": "monospace", }).appendTo(tab.content); -var submit = $("").css({ +var submit = $("").css({ "width": "100%", }).click(function() { localStorage.user_css = textarea.val(); diff --git a/js/options/user-js.js b/js/options/user-js.js index 454aab51..24f5726f 100644 --- a/js/options/user-js.js +++ b/js/options/user-js.js @@ -19,7 +19,7 @@ var textarea = $("").css({ "font-size" : "9pt", "font-family": "monospace", }).appendTo(tab.content); -var submit = $("").css({ +var submit = $("").css({ "width": "100%", }).click(function() { localStorage.user_js = textarea.val(); From d7ef24030ae2125b68bd59a27a2afd33a1a9039e Mon Sep 17 00:00:00 2001 From: Pashe Date: Wed, 25 Feb 2015 21:51:45 -0600 Subject: [PATCH 4/5] Revert "Remove some comments from the default user JS/CSS" This reverts commit a2f62d06176316ee51ea8605420dc30467bd62b3. --- js/options/user-css.js | 4 +++- js/options/user-js.js | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/js/options/user-css.js b/js/options/user-css.js index 62ed3f80..bca98aa0 100644 --- a/js/options/user-css.js +++ b/js/options/user-css.js @@ -38,7 +38,9 @@ var apply_css = function() { var update_textarea = function() { if (!localStorage.user_css) { - textarea.text("/* "+_("You can include CSS files from remote servers, for example:")+" */\n" + + textarea.text("/* "+_("Enter here your own CSS rules...")+" */\n" + + "/* "+_("If you want to make a redistributable style, be sure to\nhave a Yotsuba B theme selected.")+" */\n" + + "/* "+_("You can include CSS files from remote servers, for example:")+" */\n" + '/* @import "http://example.com/style.css"; */'); } else { diff --git a/js/options/user-js.js b/js/options/user-js.js index 24f5726f..4d792979 100644 --- a/js/options/user-js.js +++ b/js/options/user-js.js @@ -47,7 +47,9 @@ var apply_js = function() { var update_textarea = function() { if (!localStorage.user_js) { - textarea.text("/* "+_("You can include JS files from remote servers, for example:")+" */\n" + + textarea.text("/* "+_("Enter here your own Javascript code...")+" */\n" + + "/* "+_("Have a backup of your storage somewhere, as messing here\nmay render you this website unusable.")+" */\n" + + "/* "+_("You can include JS files from remote servers, for example:")+" */\n" + '/* load_js("http://example.com/script.js"); */'); } else { From 7f7176d12c82d01af417c7cf1b6e993e81ca974f Mon Sep 17 00:00:00 2001 From: marktaiwan Date: Mon, 9 Mar 2015 12:49:29 +0800 Subject: [PATCH 5/5] shrink expanded thumbnails on post hover --- js/post-hover.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/js/post-hover.js b/js/post-hover.js index 7be1c155..043a423b 100644 --- a/js/post-hover.js +++ b/js/post-hover.js @@ -77,10 +77,8 @@ onready(function(){ .appendTo(link.closest('div.post')); // shrink expanded images - newPost.find('div.file a[data-expanded="true"]').each(function() { - var thumb = $(this).find('img.post-image').attr('src'); - $(this).find('img.full-image').attr('src', thumb); - }); + newPost.find('div.file img.post-image').css({'display': '', 'opacity': ''}); + newPost.find('div.file img.full-image').remove(); // Highlight references to the current post if (link.hasClass('mentioned-'+id)) {