From d5120c98d0db50e48ed0c6338a9f3c509bbb259a Mon Sep 17 00:00:00 2001 From: johnyma22 Date: Thu, 5 Apr 2012 18:22:53 +0100 Subject: [PATCH 01/36] very quick admin interface styling and sensibility --- src/static/css/admin.css | 90 ++++++++++++++++++++++ src/templates/admin/plugins.html | 128 +++++++++++++++---------------- 2 files changed, 153 insertions(+), 65 deletions(-) diff --git a/src/static/css/admin.css b/src/static/css/admin.css index 80089c4c..20946531 100644 --- a/src/static/css/admin.css +++ b/src/static/css/admin.css @@ -1,3 +1,93 @@ +body { + margin: 0; + height: 100%; + color: #333; + font: 14px helvetica, sans-serif; + background: #ddd; + background: -webkit-radial-gradient(circle,#aaa,#eee 60%) center fixed; + background: -moz-radial-gradient(circle,#aaa,#eee 60%) center fixed; + background: -ms-radial-gradient(circle,#aaa,#eee 60%) center fixed; + background: -o-radial-gradient(circle,#aaa,#eee 60%) center fixed; + border-top: 8px solid rgba(51,51,51,.8); +} +#wrapper { + border-top: 1px solid #999; + margin-top: 160px; + padding: 15px; + background: #eee; + background: -webkit-linear-gradient(#fff,#ccc); + background: -moz-linear-gradient(#fff,#ccc); + background: -ms-linear-gradient(#fff,#ccc); + background: -o-linear-gradient(#fff,#ccc); + opacity: .9; + box-shadow: 0px 1px 8px rgba(0,0,0,0.3); + max-width: 1200px; + margin: auto; +} +#inner { + width: 300px; + margin: 0 auto; +} +#button:hover { + cursor: pointer; + background: #666; + background: -webkit-linear-gradient(#707070,#666666 50%,#5B5B5B 51%,#474747); + background: -moz-linear-gradient(#707070,#666666 50%,#5B5B5B 51%,#474747); + background: -ms-linear-gradient(#707070,#666666 50%,#5B5B5B 51%,#474747); + background: -o-linear-gradient(#707070,#666666 50%,#5B5B5B 51%,#474747); +} +#button:active { + box-shadow: inset 0 1px 12px rgba(0,0,0,0.9); + background: #444; +} +#label { + text-align: left; + text-shadow: 0 1px 1px #fff; + margin: 16px auto 0; +} +form { + border: 1px solid #bbb; + border-radius: 3px; + position: relative; +} +button, input { + font-weight: bold; + font-size: 15px; +} +input[type="button"] { + height:30px; +} +input[type="text"] { + border-radius: 3px; + box-sizing: border-box; + -moz-box-sizing: border-box; + padding: 10px 45px 10px 10px; + *padding: 0; /* IE7 hack */ + width: 100%; + outline: none; + border: none; +} +button{ + display:block; +} +@media only screen and (min-device-width: 320px) and (max-device-width: 720px) { + body { + background: #bbb; + background: -webkit-linear-gradient(#aaa,#eee 60%) center fixed; + background: -moz-linear-gradient(#aaa,#eee 60%) center fixed; + background: -ms-linear-gradient(#aaa,#eee 60%) center fixed; + } + #wrapper { + margin-top: 0; + } + #inner { + width: 95%; + } + #label { + text-align: center; + } +} + table { border-collapse: collapse; } diff --git a/src/templates/admin/plugins.html b/src/templates/admin/plugins.html index 5e5a1b03..6f38d048 100644 --- a/src/templates/admin/plugins.html +++ b/src/templates/admin/plugins.html @@ -19,7 +19,7 @@ if ($("#search-query")[0].value != "") socket.emit("search", $("#search-query")[0].value); }); - + $(".do-install").unbind('click').click(function (e) { var row = $(e.target).closest("tr"); doUpdate = true; @@ -95,74 +95,72 @@ - <% if (errors.length) { %> -
- <% errors.forEach(function (item) { %> -
<%= item.toString() %>
- <% }) %> -
- <% } %> +
+ + <% if (errors.length) { %> +
+ <% errors.forEach(function (item) { %> +
<%= item.toString() %>
+ <% }) %> +
+ <% } %> -

Installed plugins

- - - - - - - - - - - - - - - - - -
NameDescription
- -
+

Installed plugins

+ + + + + + + + + + + + + + + + + +
NameDescription
+ +
+ +

Search for plugins to install

+
+ + +
+ + + + + + + + + + + + + + + + + +
NameDescription
+ +
- - -

Search for plugins to install

-
- - -
- - - - - - - - - - - - - - - - - -
NameDescription
- -
- - -
-

- Please wait: +
+

+ Please wait: -

- -
+

+
+
- From 05fcf4ba4a9a63c2007eef31405c2a3712776241 Mon Sep 17 00:00:00 2001 From: 0ip Date: Wed, 11 Apr 2012 22:22:28 +0300 Subject: [PATCH 02/36] Having "maxAge" twice doesn't double the fun --- settings.json.template | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/settings.json.template b/settings.json.template index 7aaa5d7e..d75d53a8 100644 --- a/settings.json.template +++ b/settings.json.template @@ -40,8 +40,8 @@ "minify" : true, /* How long may clients use served javascript code (in seconds)? Without versioning this - is may cause problems during deployment. Set to 0 to disable caching */ - "maxAge" : 21600, // 6 hours + may cause problems during deployment. Set to 0 to disable caching */ + "maxAge" : 21600, // 60 * 60 * 6 = 6 hours /* This is the path to the Abiword executable. Setting it to null, disables abiword. Abiword is needed to enable the import/export of pads*/ @@ -55,7 +55,4 @@ /* The log level we are using, can be: DEBUG, INFO, WARN, ERROR */ "loglevel": "INFO", - - /* cache 6 hours = 1000*60*60*6 */ - "maxAge": 21600000 } From 3dd24bdf6f8ef330928c66bde9ed4ddd4dc58f6d Mon Sep 17 00:00:00 2001 From: 0ip Date: Wed, 11 Apr 2012 22:25:04 +0300 Subject: [PATCH 03/36] forgot to remove a ',' ^.^ --- settings.json.template | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/settings.json.template b/settings.json.template index d75d53a8..a664ea8e 100644 --- a/settings.json.template +++ b/settings.json.template @@ -54,5 +54,5 @@ // "adminHttpAuth" : "user:pass", /* The log level we are using, can be: DEBUG, INFO, WARN, ERROR */ - "loglevel": "INFO", + "loglevel": "INFO" } From 362ef454b811802a5e170835756ba158a393aa06 Mon Sep 17 00:00:00 2001 From: Jordan Hollinger Date: Fri, 13 Apr 2012 05:17:48 -0400 Subject: [PATCH 04/36] Don't block static paths with http auth --- src/node/hooks/express/webaccess.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/node/hooks/express/webaccess.js b/src/node/hooks/express/webaccess.js index d0e28737..48b5edae 100644 --- a/src/node/hooks/express/webaccess.js +++ b/src/node/hooks/express/webaccess.js @@ -28,6 +28,11 @@ exports.basicAuth = function (req, res, next) { return next(); } } + // Do not require auth for static paths...this could be a bit brittle + else if (req.path.match(/^\/(static|javascripts|pluginfw)/)) { + return next(); + } + // Otherwise return Auth required Headers, delayed for 1 second, if auth failed. res.header('WWW-Authenticate', 'Basic realm="Protected Area"'); From 06f36664b85340ec87aab09a5bfbeab0f65f489f Mon Sep 17 00:00:00 2001 From: Jordan Hollinger Date: Fri, 13 Apr 2012 17:21:07 -0400 Subject: [PATCH 05/36] Fix re-enabling line numbers. issue #618 --- src/static/js/ace2_inner.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/static/js/ace2_inner.js b/src/static/js/ace2_inner.js index d2d14503..b61c50e3 100644 --- a/src/static/js/ace2_inner.js +++ b/src/static/js/ace2_inner.js @@ -4635,7 +4635,7 @@ function Ace2Inner(){ function setClassPresence(elem, className, present) { if (present) $(elem).addClass(className); - else $(elem).removeClass(elem, className); + else $(elem).removeClass(className); } function setup() From d834c42ffc728ee7f21a27e4a975b99395276026 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Bartelme=C3=9F?= Date: Sun, 15 Apr 2012 19:18:29 +0200 Subject: [PATCH 06/36] avoid missing anon. timeslider authors --- src/static/js/broadcast_slider.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/static/js/broadcast_slider.js b/src/static/js/broadcast_slider.js index a2a15773..6dffc0ef 100644 --- a/src/static/js/broadcast_slider.js +++ b/src/static/js/broadcast_slider.js @@ -216,7 +216,7 @@ function loadBroadcastSliderJS(fireWhenAllScriptsAreLoaded) authorsList.append(' ('); _.each(colorsAnonymous, function(color, i){ if( i > 0 ) authorsList.append(' '); - $(' ') + $(' ') .css('background-color', color) .addClass('author author-anonymous') .appendTo(authorsList); From e664320b8ceb734a333c1877a3f358975e55cf33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Bartelme=C3=9F?= Date: Sun, 15 Apr 2012 19:25:23 +0200 Subject: [PATCH 07/36] removed sliderEnabled, supportsSlider clientVars, as they were not used anywhere --- src/node/handler/TimesliderMessageHandler.js | 2 - src/static/js/broadcast_slider.js | 131 ++++++++----------- 2 files changed, 52 insertions(+), 81 deletions(-) diff --git a/src/node/handler/TimesliderMessageHandler.js b/src/node/handler/TimesliderMessageHandler.js index a6cf8f4d..5556efa1 100644 --- a/src/node/handler/TimesliderMessageHandler.js +++ b/src/node/handler/TimesliderMessageHandler.js @@ -155,8 +155,6 @@ function createTimesliderClientVars (padId, callback) var clientVars = { viewId: padId, colorPalette: ["#ffc7c7", "#fff1c7", "#e3ffc7", "#c7ffd5", "#c7ffff", "#c7d5ff", "#e3c7ff", "#ffc7f1", "#ff8f8f", "#ffe38f", "#c7ff8f", "#8fffab", "#8fffff", "#8fabff", "#c78fff", "#ff8fe3", "#d97979", "#d9c179", "#a9d979", "#79d991", "#79d9d9", "#7991d9", "#a979d9", "#d979c1", "#d9a9a9", "#d9cda9", "#c1d9a9", "#a9d9b5", "#a9d9d9", "#a9b5d9", "#c1a9d9", "#d9a9cd"], - sliderEnabled : true, - supportsSlider: true, savedRevisions: [], padIdForUrl: padId, fullWidth: false, diff --git a/src/static/js/broadcast_slider.js b/src/static/js/broadcast_slider.js index a2a15773..1d1f279c 100644 --- a/src/static/js/broadcast_slider.js +++ b/src/static/js/broadcast_slider.js @@ -162,11 +162,8 @@ function loadBroadcastSliderJS(fireWhenAllScriptsAreLoaded) function showReconnectUI() { - if (!clientVars.sliderEnabled || !clientVars.supportsSlider) - { - $("#padmain, #rightbars").css('top', "130px"); - $("#timeslider").show(); - } + $("#padmain, #rightbars").css('top', "130px"); + $("#timeslider").show(); $('#error').show(); } @@ -287,55 +284,52 @@ function loadBroadcastSliderJS(fireWhenAllScriptsAreLoaded) { disableSelection($("#playpause_button")[0]); disableSelection($("#timeslider")[0]); - - if (clientVars.sliderEnabled && clientVars.supportsSlider) + + $(document).keyup(function(e) { - $(document).keyup(function(e) - { - var code = -1; - if (!e) var e = window.event; - if (e.keyCode) code = e.keyCode; - else if (e.which) code = e.which; + var code = -1; + if (!e) var e = window.event; + if (e.keyCode) code = e.keyCode; + else if (e.which) code = e.which; - if (code == 37) - { // left - if (!e.shiftKey) - { - setSliderPosition(getSliderPosition() - 1); - } - else - { - var nextStar = 0; // default to first revision in document - for (var i = 0; i < savedRevisions.length; i++) - { - var pos = parseInt(savedRevisions[i].attr('pos')); - if (pos < getSliderPosition() && nextStar < pos) nextStar = pos; - } - setSliderPosition(nextStar); - } - } - else if (code == 39) + if (code == 37) + { // left + if (!e.shiftKey) { - if (!e.shiftKey) - { - setSliderPosition(getSliderPosition() + 1); - } - else - { - var nextStar = sliderLength; // default to last revision in document - for (var i = 0; i < savedRevisions.length; i++) - { - var pos = parseInt(savedRevisions[i].attr('pos')); - if (pos > getSliderPosition() && nextStar > pos) nextStar = pos; - } - setSliderPosition(nextStar); - } + setSliderPosition(getSliderPosition() - 1); } - else if (code == 32) playpause(); - - }); - } + else + { + var nextStar = 0; // default to first revision in document + for (var i = 0; i < savedRevisions.length; i++) + { + var pos = parseInt(savedRevisions[i].attr('pos')); + if (pos < getSliderPosition() && nextStar < pos) nextStar = pos; + } + setSliderPosition(nextStar); + } + } + else if (code == 39) + { + if (!e.shiftKey) + { + setSliderPosition(getSliderPosition() + 1); + } + else + { + var nextStar = sliderLength; // default to last revision in document + for (var i = 0; i < savedRevisions.length; i++) + { + var pos = parseInt(savedRevisions[i].attr('pos')); + if (pos > getSliderPosition() && nextStar > pos) nextStar = pos; + } + setSliderPosition(nextStar); + } + } + else if (code == 32) playpause(); + }); + $(window).resize(function() { updateSliderElements(); @@ -485,37 +479,16 @@ function loadBroadcastSliderJS(fireWhenAllScriptsAreLoaded) $("#revision").css('right', "20px"); $("#revision").css('top', "20px"); } - - - if (clientVars.sliderEnabled) + + $("#timeslider").show(); + setSliderLength(clientVars.totalRevs); + setSliderPosition(clientVars.revNum); + + _.each(clientVars.savedRevisions, function(revision) { - if (clientVars.supportsSlider) - { - $("#timeslider").show(); - setSliderLength(clientVars.totalRevs); - setSliderPosition(clientVars.revNum); - _.each(clientVars.savedRevisions, function(revision) - { - addSavedRevision(revision.revNum, revision); - }) - } - else - { - // slider is not supported - $("#padmain, #rightbars").css('top', "130px"); - $("#timeslider").show(); - $("#error").html("The timeslider feature is not supported on this pad. Why not?"); - $("#error").show(); - } - } - else - { - if (clientVars.supportsSlider) - { - setSliderLength(clientVars.totalRevs); - setSliderPosition(clientVars.revNum); - } - } + addSavedRevision(revision.revNum, revision); + }) + } }); })(); From 9cbb897c45ced7c8affce33a72057ea6bcbab80e Mon Sep 17 00:00:00 2001 From: 0ip Date: Mon, 16 Apr 2012 15:13:07 +0200 Subject: [PATCH 08/36] template/pad.html removed some whitespace --- src/templates/pad.html | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/src/templates/pad.html b/src/templates/pad.html index 91583b36..08e34fa2 100644 --- a/src/templates/pad.html +++ b/src/templates/pad.html @@ -58,7 +58,7 @@ <% e.end_block(); %> - +