From 04f3faac4b39312d6ef52b3e8e54f874274c0b3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Bartelme=C3=9F?= Date: Fri, 23 Mar 2012 19:28:46 +0100 Subject: [PATCH 01/10] re-enabled maxAge setting. maxAge is now in seconds, not milliseconds. --- settings.json.template | 6 +++--- src/node/server.js | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/settings.json.template b/settings.json.template index 6c0ebd385..3ae0a9815 100644 --- a/settings.json.template +++ b/settings.json.template @@ -39,9 +39,9 @@ but makes it impossible to debug the javascript/css */ "minify" : true, - /* How long may clients use served javascript code? Without versioning this - is may cause problems during deployment. */ - "maxAge" : 21600000, // 6 hours + /* 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 /* This is the path to the Abiword executable. Setting it to null, disables abiword. Abiword is needed to enable the import/export of pads*/ diff --git a/src/node/server.js b/src/node/server.js index 19df6e728..8e6d6fa0b 100644 --- a/src/node/server.js +++ b/src/node/server.js @@ -51,8 +51,9 @@ console.log("Report bugs at https://github.com/Pita/etherpad-lite/issues") var serverName = "Etherpad-Lite " + version + " (http://j.mp/ep-lite)"; -//cache 6 hours -exports.maxAge = 1000*60*60*6; +//cache 6 hours, by default +var hour = 60*60; +exports.maxAge = settings.maxAge || 6 * hour; //set loglevel log4js.setGlobalLogLevel(settings.loglevel); From ef248555aaaf93aee25e7aeaac2fb78c2c8ab0e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Bartelme=C3=9F?= Date: Sat, 24 Mar 2012 13:28:17 +0100 Subject: [PATCH 02/10] Send the Content-Type header for plugin-definitions.json in the right format --- src/node/hooks/express/static.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/node/hooks/express/static.js b/src/node/hooks/express/static.js index e8f9afbb8..9209967ce 100644 --- a/src/node/hooks/express/static.js +++ b/src/node/hooks/express/static.js @@ -35,7 +35,7 @@ exports.expressCreateServer = function (hook_name, args, cb) { // serve plugin definitions // not very static, but served here so that client can do require("pluginfw/static/js/plugin-definitions.js"); args.app.get('/pluginfw/plugin-definitions.json', function (req, res, next) { - res.header("Content-Type","application/json; charset: utf-8"); + res.header("Content-Type","application/json; charset=utf-8"); res.write(JSON.stringify({"plugins": plugins.plugins, "parts": plugins.parts})); res.end(); }); From 1789c6e1c5c255397fbd918efdf339c6e1bf0510 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Bartelme=C3=9F?= Date: Sat, 24 Mar 2012 13:29:15 +0100 Subject: [PATCH 03/10] proceed if plugin-definitions.json didn't load properly --- src/static/js/pluginfw/plugins.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/static/js/pluginfw/plugins.js b/src/static/js/pluginfw/plugins.js index 0745b6986..aa2dfafb2 100644 --- a/src/static/js/pluginfw/plugins.js +++ b/src/static/js/pluginfw/plugins.js @@ -86,6 +86,9 @@ if (exports.isClient) { exports.hooks = exports.extractHooks(exports.parts, "client_hooks"); exports.loaded = true; cb(); + }).error(function(xhr, s, err){ + console.error("Failed to load plugin-definitions: " + err); + cb(); }); } } else { From 371aee2e19798e03c5191169b64abe75dcf8aafc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Bartelme=C3=9F?= Date: Sat, 24 Mar 2012 20:35:45 +0100 Subject: [PATCH 04/10] Added timeslider author UI --- src/static/css/timeslider.css | 45 ++++++++- src/static/js/broadcast_slider.js | 36 ++++--- src/static/timeslider.html | 156 ++++++++---------------------- 3 files changed, 106 insertions(+), 131 deletions(-) diff --git a/src/static/css/timeslider.css b/src/static/css/timeslider.css index 926c80123..ea914ae66 100644 --- a/src/static/css/timeslider.css +++ b/src/static/css/timeslider.css @@ -67,13 +67,56 @@ width:122px; } + .topbarcenter, #docbar {display:none;} -#padmain {top:30px;} +#padmain {top:0px !important;} #editbarright {float:right;} #returnbutton {color:#222; font-size:16px; line-height:29px; margin-top:0; padding-right:6px;} #importexport {top:118px;} #importexport .popup {width:185px;} + +.timeslider-bar +{ + background: #f7f7f7; + background: linear-gradient(#f7f7f7, #f1f1f1 80%); + border-bottom: 1px solid #ccc; + overflow: hidden; + padding-top: 3px; + width: 100%; +} + +.timeslider-bar #editbar +{ + border-bottom: none; + float: right; + width: 170px; + width: initial; +} + +.timeslider-bar h1 +{ + margin: 5px; +} +.timeslider-bar p +{ + margin: 5px; +} +#timeslider-top { + width: 100%; + position: fixed; + z-index: 1; +} + +#authorsList .author { + padding-left: 0.4em; + padding-right: 0.4em; +} + +#padeditor { + position: static; +} + /* lists */ .list-bullet2, .list-indent2, .list-number2 {margin-left:3em;} .list-bullet3, .list-indent3, .list-number3 {margin-left:4.5em;} diff --git a/src/static/js/broadcast_slider.js b/src/static/js/broadcast_slider.js index f88eb5ddc..9aceb7336 100644 --- a/src/static/js/broadcast_slider.js +++ b/src/static/js/broadcast_slider.js @@ -170,26 +170,27 @@ function loadBroadcastSliderJS(fireWhenAllScriptsAreLoaded) $('#error').show(); } + var fixPadHeight = _.throttle(function(){ + var height = $('#timeslider-top').height(); + $('#editorcontainerbox').css({marginTop: height}); + }, 600); + function setAuthors(authors) { - $("#authorstable").empty(); + var authorsList = $("#authorsList"); + authorsList.empty(); var numAnonymous = 0; var numNamed = 0; _.each(authors, function(author) { if (author.name) { + if (numNamed !== 0) authorsList.append(', '); + + var authorColor = clientVars.colorPalette[author.colorId] || author.colorId; + var span = $('').text(author.name || "unnamed").css('background-color', authorColor).addClass('author'); + authorsList.append(span); numNamed++; - var tr = $(''); - var swatchtd = $(''); - var swatch = $('
'); - swatch.css('background-color', clientVars.colorPalette[author.colorId]); - swatchtd.append(swatch); - tr.append(swatchtd); - var nametd = $(''); - nametd.text(author.name || "unnamed"); - tr.append(nametd); - $("#authorstable").append(tr); } else { @@ -198,13 +199,19 @@ function loadBroadcastSliderJS(fireWhenAllScriptsAreLoaded) }); if (numAnonymous > 0) { - var html = "" + (numNamed > 0 ? "...and " : "") + numAnonymous + " unnamed author" + (numAnonymous > 1 ? "s" : "") + ""; - $("#authorstable").append($(html)); + var anonymousAuthorString = numAnonymous + " unnamed author" + (numAnonymous > 1 ? "s" : "") + if (numNamed !== 0){ + authorsList.append(' + ' + anonymousAuthorString); + } else { + authorsList.append(anonymousAuthorString); + } } if (authors.length == 0) { - $("#authorstable").append($("No Authors")) + authorsList.append("No Authors"); } + + fixPadHeight(); } BroadcastSlider = { @@ -465,7 +472,6 @@ function loadBroadcastSliderJS(fireWhenAllScriptsAreLoaded) { if (clientVars.supportsSlider) { - $("#padmain, #rightbars").css('top', "130px"); $("#timeslider").show(); setSliderLength(clientVars.totalRevs); setSliderPosition(clientVars.revNum); diff --git a/src/static/timeslider.html b/src/static/timeslider.html index 413fbe804..3c909ede0 100644 --- a/src/static/timeslider.html +++ b/src/static/timeslider.html @@ -11,40 +11,14 @@ - +
-
-
- -
- -
- -
- -
- Etherpad v1.1 Etherpad is free software - -
- Full screen -
-
- -
- -
-

Server Notice:

hide -

@@ -67,104 +41,56 @@
- -
-