From 645ec830b0f5914b209020c75c729c51629d8c08 Mon Sep 17 00:00:00 2001 From: Beau Gunderson Date: Tue, 18 Nov 2014 13:52:42 -0800 Subject: [PATCH 1/3] Don't crash on bad plugins.json; fixes #2323 --- src/static/js/pluginfw/installer.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/static/js/pluginfw/installer.js b/src/static/js/pluginfw/installer.js index bf779d7ac..90bd9aa27 100644 --- a/src/static/js/pluginfw/installer.js +++ b/src/static/js/pluginfw/installer.js @@ -66,7 +66,12 @@ exports.getAvailablePlugins = function(maxCacheAge, cb) { if(exports.availablePlugins && maxCacheAge && Math.round(+new Date/1000)-cacheTimestamp <= maxCacheAge) { return cb && cb(null, exports.availablePlugins) } - plugins = JSON.parse(plugins); + try { + plugins = JSON.parse(plugins); + } catch (err) { + console.error('error parsing plugins.json:', err); + plugins = []; + } exports.availablePlugins = plugins; cacheTimestamp = Math.round(+new Date/1000); cb && cb(null, plugins) From f5dcc374bae933f87ee3232d90750d9f1675e9e8 Mon Sep 17 00:00:00 2001 From: John McLear Date: Tue, 18 Nov 2014 23:15:56 +0000 Subject: [PATCH 2/3] slight ui fix --- src/static/js/pad_editbar.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/static/js/pad_editbar.js b/src/static/js/pad_editbar.js index d39bfecd7..bdf2d5569 100644 --- a/src/static/js/pad_editbar.js +++ b/src/static/js/pad_editbar.js @@ -181,7 +181,7 @@ var padeditbar = (function() }, redrawHeight: function(){ var editbarHeight = $('.menu_left').height() + 2 + "px"; - var containerTop = $('.menu_left').height() + 5 + "px"; + var containerTop = $('.menu_left').height() + 7 + "px"; $('#editbar').css("height", editbarHeight); $('#editorcontainer').css("top", containerTop); }, From 0f1fd0b2818393386c13801cc83ec0cb51a1fe98 Mon Sep 17 00:00:00 2001 From: John McLear Date: Tue, 18 Nov 2014 23:51:22 +0000 Subject: [PATCH 3/3] working blocks --- src/templates/pad.html | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/templates/pad.html b/src/templates/pad.html index 15fd45e2d..ed1332a7c 100644 --- a/src/templates/pad.html +++ b/src/templates/pad.html @@ -42,7 +42,11 @@ <% e.begin_block("styles"); %> + + <% e.begin_block("customStyles"); %> + <% e.end_block(); %> + <% e.end_block(); %> @@ -347,7 +351,9 @@ + <% e.begin_block("customScripts"); %> + <% e.end_block(); %>