From 3a0015c3578083514987b254b2b6fac34a2eb237 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Bartelme=C3=9F?= Date: Sun, 8 Jul 2012 11:51:04 +0200 Subject: [PATCH 001/189] remove unused _opt in favor of code size/readability --- src/static/js/Changeset.js | 245 ++++++++++++++----------------------- 1 file changed, 89 insertions(+), 156 deletions(-) diff --git a/src/static/js/Changeset.js b/src/static/js/Changeset.js index 738ee1bab..cfea43625 100644 --- a/src/static/js/Changeset.js +++ b/src/static/js/Changeset.js @@ -27,8 +27,6 @@ var AttributePool = require("./AttributePool"); -var _opt = null; - /** * ==================== General Util Functions ======================= */ @@ -127,22 +125,13 @@ exports.opIterator = function (opsStr, optStartIndex) { function nextRegexMatch() { prevIndex = curIndex; var result; - if (_opt) { - result = _opt.nextOpInString(opsStr, curIndex); - if (result) { - if (result.opcode() == '?') { - exports.error("Hit error opcode in op stream"); - } - curIndex = result.lastIndex(); - } - } else { - regex.lastIndex = curIndex; - result = regex.exec(opsStr); - curIndex = regex.lastIndex; - if (result[0] == '?') { - exports.error("Hit error opcode in op stream"); - } + regex.lastIndex = curIndex; + result = regex.exec(opsStr); + curIndex = regex.lastIndex; + if (result[0] == '?') { + exports.error("Hit error opcode in op stream"); } + return result; } var regexResult = nextRegexMatch(); @@ -150,13 +139,7 @@ exports.opIterator = function (opsStr, optStartIndex) { function next(optObj) { var op = (optObj || obj); - if (_opt && regexResult) { - op.attribs = regexResult.attribs(); - op.lines = regexResult.lines(); - op.chars = regexResult.chars(); - op.opcode = regexResult.opcode(); - regexResult = nextRegexMatch(); - } else if ((!_opt) && regexResult[0]) { + if (regexResult[0]) { op.attribs = regexResult[1]; op.lines = exports.parseNum(regexResult[2] || 0); op.opcode = regexResult[3]; @@ -169,7 +152,7 @@ exports.opIterator = function (opsStr, optStartIndex) { } function hasNext() { - return !!(_opt ? regexResult : regexResult[0]); + return !!(regexResult[0]); } function lastIndex() { @@ -414,159 +397,109 @@ exports.smartOpAssembler = function () { }; }; -if (_opt) { - exports.mergingOpAssembler = function () { - var assem = _opt.mergingOpAssembler(); - function append(op) { - assem.append(op.opcode, op.chars, op.lines, op.attribs); - } +exports.mergingOpAssembler = function () { + // This assembler can be used in production; it efficiently + // merges consecutive operations that are mergeable, ignores + // no-ops, and drops final pure "keeps". It does not re-order + // operations. + var assem = exports.opAssembler(); + var bufOp = exports.newOp(); - function toString() { - return assem.toString(); - } + // If we get, for example, insertions [xxx\n,yyy], those don't merge, + // but if we get [xxx\n,yyy,zzz\n], that merges to [xxx\nyyyzzz\n]. + // This variable stores the length of yyy and any other newline-less + // ops immediately after it. + var bufOpAdditionalCharsAfterNewline = 0; - function clear() { - assem.clear(); - } - - function endDocument() { - assem.endDocument(); - } - - return { - append: append, - toString: toString, - clear: clear, - endDocument: endDocument - }; - }; -} else { - exports.mergingOpAssembler = function () { - // This assembler can be used in production; it efficiently - // merges consecutive operations that are mergeable, ignores - // no-ops, and drops final pure "keeps". It does not re-order - // operations. - var assem = exports.opAssembler(); - var bufOp = exports.newOp(); - - // If we get, for example, insertions [xxx\n,yyy], those don't merge, - // but if we get [xxx\n,yyy,zzz\n], that merges to [xxx\nyyyzzz\n]. - // This variable stores the length of yyy and any other newline-less - // ops immediately after it. - var bufOpAdditionalCharsAfterNewline = 0; - - function flush(isEndDocument) { - if (bufOp.opcode) { - if (isEndDocument && bufOp.opcode == '=' && !bufOp.attribs) { - // final merged keep, leave it implicit - } else { + function flush(isEndDocument) { + if (bufOp.opcode) { + if (isEndDocument && bufOp.opcode == '=' && !bufOp.attribs) { + // final merged keep, leave it implicit + } else { + assem.append(bufOp); + if (bufOpAdditionalCharsAfterNewline) { + bufOp.chars = bufOpAdditionalCharsAfterNewline; + bufOp.lines = 0; assem.append(bufOp); - if (bufOpAdditionalCharsAfterNewline) { - bufOp.chars = bufOpAdditionalCharsAfterNewline; - bufOp.lines = 0; - assem.append(bufOp); - bufOpAdditionalCharsAfterNewline = 0; - } + bufOpAdditionalCharsAfterNewline = 0; } - bufOp.opcode = ''; } + bufOp.opcode = ''; } + } - function append(op) { - if (op.chars > 0) { - if (bufOp.opcode == op.opcode && bufOp.attribs == op.attribs) { - if (op.lines > 0) { - // bufOp and additional chars are all mergeable into a multi-line op - bufOp.chars += bufOpAdditionalCharsAfterNewline + op.chars; - bufOp.lines += op.lines; - bufOpAdditionalCharsAfterNewline = 0; - } else if (bufOp.lines == 0) { - // both bufOp and op are in-line - bufOp.chars += op.chars; - } else { - // append in-line text to multi-line bufOp - bufOpAdditionalCharsAfterNewline += op.chars; - } + function append(op) { + if (op.chars > 0) { + if (bufOp.opcode == op.opcode && bufOp.attribs == op.attribs) { + if (op.lines > 0) { + // bufOp and additional chars are all mergeable into a multi-line op + bufOp.chars += bufOpAdditionalCharsAfterNewline + op.chars; + bufOp.lines += op.lines; + bufOpAdditionalCharsAfterNewline = 0; + } else if (bufOp.lines == 0) { + // both bufOp and op are in-line + bufOp.chars += op.chars; } else { - flush(); - exports.copyOp(op, bufOp); + // append in-line text to multi-line bufOp + bufOpAdditionalCharsAfterNewline += op.chars; } + } else { + flush(); + exports.copyOp(op, bufOp); } } + } - function endDocument() { - flush(true); - } + function endDocument() { + flush(true); + } - function toString() { - flush(); - return assem.toString(); - } + function toString() { + flush(); + return assem.toString(); + } - function clear() { - assem.clear(); - exports.clearOp(bufOp); - } - return { - append: append, - toString: toString, - clear: clear, - endDocument: endDocument - }; + function clear() { + assem.clear(); + exports.clearOp(bufOp); + } + return { + append: append, + toString: toString, + clear: clear, + endDocument: endDocument }; -} +}; -if (_opt) { - exports.opAssembler = function () { - var assem = _opt.opAssembler(); - // this function allows op to be mutated later (doesn't keep a ref) - function append(op) { - assem.append(op.opcode, op.chars, op.lines, op.attribs); + +exports.opAssembler = function () { + var pieces = []; + // this function allows op to be mutated later (doesn't keep a ref) + + function append(op) { + pieces.push(op.attribs); + if (op.lines) { + pieces.push('|', exports.numToString(op.lines)); } + pieces.push(op.opcode); + pieces.push(exports.numToString(op.chars)); + } - function toString() { - return assem.toString(); - } + function toString() { + return pieces.join(''); + } - function clear() { - assem.clear(); - } - return { - append: append, - toString: toString, - clear: clear - }; + function clear() { + pieces.length = 0; + } + return { + append: append, + toString: toString, + clear: clear }; -} else { - exports.opAssembler = function () { - var pieces = []; - // this function allows op to be mutated later (doesn't keep a ref) - - function append(op) { - pieces.push(op.attribs); - if (op.lines) { - pieces.push('|', exports.numToString(op.lines)); - } - pieces.push(op.opcode); - pieces.push(exports.numToString(op.chars)); - } - - function toString() { - return pieces.join(''); - } - - function clear() { - pieces.length = 0; - } - return { - append: append, - toString: toString, - clear: clear - }; - }; -} +}; /** * A custom made String Iterator From 4c8f69b7c55f1a8ba8e8d338c2cee6bac0cc85c4 Mon Sep 17 00:00:00 2001 From: Marcel Klehr Date: Sun, 8 Jul 2012 18:59:46 +0200 Subject: [PATCH 002/189] Use v8 to parse settings.json --- src/node/utils/Settings.js | 32 +++++++++++++------------------- 1 file changed, 13 insertions(+), 19 deletions(-) diff --git a/src/node/utils/Settings.js b/src/node/utils/Settings.js index e60446df4..aeeb9015e 100644 --- a/src/node/utils/Settings.js +++ b/src/node/utils/Settings.js @@ -24,6 +24,7 @@ var os = require("os"); var path = require('path'); var argv = require('./Cli').argv; var npm = require("npm/lib/npm.js"); +var vm = require('vm'); /* Root path of the installation */ exports.root = path.normalize(path.join(npm.dir, "..")); @@ -45,6 +46,7 @@ exports.dbType = "dirty"; * This setting is passed with dbType to ueberDB to set up the database */ exports.dbSettings = { "filename" : path.join(exports.root, "dirty.db") }; + /** * The default Text of a new pad */ @@ -102,33 +104,25 @@ exports.abiwordAvailable = function() // Discover where the settings file lives var settingsFilename = argv.settings || "settings.json"; -if (settingsFilename.charAt(0) != '/') { - settingsFilename = path.normalize(path.join(root, settingsFilename)); -} +settingsFilename = path.resolve(path.join(root, settingsFilename)); -var settingsStr +var settingsStr; try{ //read the settings sync - settingsStr = fs.readFileSync(settingsFilename).toString(); + settingsStr = fs.readFileSync(settingsFilename); } catch(e){ console.warn('No settings file found. Using defaults.'); - settingsStr = '{}'; } - -//remove all comments -settingsStr = settingsStr.replace(/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*+/gm,"").replace(/#.*/g,"").replace(/\/\/.*/g,""); -//try to parse the settings +// try to parse the settings var settings; -try -{ - settings = JSON.parse(settingsStr); -} -catch(e) -{ - console.error("There is a syntax error in your settings.json file"); - console.error(e.message); - process.exit(1); +try { + if(settingsStr) { + settings = vm.runInContext('exports = '+settingsStr, vm.createContext(), "settings.json"); + } +}catch(e){ + console.warn('There was an error processing your settings.json file. Using defaults.'); + console.warn(e.message); } //loop trough the settings From 975171a86b1c3eae8bebb91e1b87f6efcf990ec3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Bartelme=C3=9F?= Date: Sun, 8 Jul 2012 21:06:19 +0200 Subject: [PATCH 003/189] Make handleMessage async --- src/node/handler/PadMessageHandler.js | 34 ++++++++++++++++++++------- 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/src/node/handler/PadMessageHandler.js b/src/node/handler/PadMessageHandler.js index a0aef6648..d02e65377 100644 --- a/src/node/handler/PadMessageHandler.js +++ b/src/node/handler/PadMessageHandler.js @@ -159,11 +159,7 @@ exports.handleDisconnect = function(client) */ exports.handleMessage = function(client, message) { - _.map(hooks.callAll( "handleMessage", { client: client, message: message }), function ( newmessage ) { - if ( newmessage || newmessage === null ) { - message = newmessage; - } - }); + if(message == null) { messageLogger.warn("Message is null!"); @@ -175,6 +171,23 @@ exports.handleMessage = function(client, message) return; } + var handleMessageHook = function(callback){ + var dropMessage = false; + + // Call handleMessage hook. If a plugin returns null, the message will be dropped. Note that for all messages + // handleMessage will be called, even if the client is not authorized + hooks.aCallAll("handleMessage", { client: client, message: message }, function ( messages ) { + _.each(messages, function(newMessage){ + if ( newmessage === null ) { + dropMessage = true; + } + }); + + // If no plugins explicitly told us to drop the message, its ok to proceed + if(!dropMessage){ callback() }; + }); + } + var finalHandler = function () { //Check what type of message we get and delegate to the other methodes if(message.type == "CLIENT_READY") { @@ -203,11 +216,18 @@ exports.handleMessage = function(client, message) } }; - if (message && message.padId) { + if (message) { async.series([ + handleMessageHook, //check permissions function(callback) { + + if(!message.padId){ + // If the message has a padId we assume the client is already known to the server and needs no re-authorization + callback(); + return; + } // Note: message.sessionID is an entirely different kind of // session from the sessions we use here! Beware! FIXME: Call // our "sessions" "connections". @@ -231,8 +251,6 @@ exports.handleMessage = function(client, message) }, finalHandler ]); - } else { - finalHandler(); } } From 885844667887411c8fc2822ab1914b7277bcb4ca Mon Sep 17 00:00:00 2001 From: Marcel Klehr Date: Tue, 10 Jul 2012 21:38:14 +0200 Subject: [PATCH 004/189] Exit on error. --- src/node/utils/Settings.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/node/utils/Settings.js b/src/node/utils/Settings.js index aeeb9015e..68e58eb22 100644 --- a/src/node/utils/Settings.js +++ b/src/node/utils/Settings.js @@ -111,7 +111,8 @@ try{ //read the settings sync settingsStr = fs.readFileSync(settingsFilename); } catch(e){ - console.warn('No settings file found. Using defaults.'); + console.error('No settings file found.'); + process.exit(1); } // try to parse the settings @@ -121,8 +122,8 @@ try { settings = vm.runInContext('exports = '+settingsStr, vm.createContext(), "settings.json"); } }catch(e){ - console.warn('There was an error processing your settings.json file. Using defaults.'); - console.warn(e.message); + console.error('There was an error processing your settings.json file: '+e.message); + process.exit(1); } //loop trough the settings @@ -142,8 +143,7 @@ for(var i in settings) //this setting is unkown, output a warning and throw it away else { - console.warn("Unkown Setting: '" + i + "'"); - console.warn("This setting doesn't exist or it was removed"); + console.warn("Unkown Setting: '" + i + "'. This setting doesn't exist or it was removed"); } } From 87f26334d1259f6422c3a2b7d9325b611c72316b Mon Sep 17 00:00:00 2001 From: Marcel Klehr Date: Tue, 10 Jul 2012 21:55:35 +0200 Subject: [PATCH 005/189] Fix typo. --- src/node/utils/Settings.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/node/utils/Settings.js b/src/node/utils/Settings.js index 68e58eb22..205b675f2 100644 --- a/src/node/utils/Settings.js +++ b/src/node/utils/Settings.js @@ -143,7 +143,7 @@ for(var i in settings) //this setting is unkown, output a warning and throw it away else { - console.warn("Unkown Setting: '" + i + "'. This setting doesn't exist or it was removed"); + console.warn("Unknown Setting: '" + i + "'. This setting doesn't exist or it was removed"); } } From f09dd0f3fba8630d221dba3a652dad0a229aa509 Mon Sep 17 00:00:00 2001 From: Marcel Klehr Date: Wed, 11 Jul 2012 15:34:33 +0200 Subject: [PATCH 006/189] Put toString() back in. --- src/node/utils/Settings.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/node/utils/Settings.js b/src/node/utils/Settings.js index 205b675f2..1b7c3f46c 100644 --- a/src/node/utils/Settings.js +++ b/src/node/utils/Settings.js @@ -109,7 +109,7 @@ settingsFilename = path.resolve(path.join(root, settingsFilename)); var settingsStr; try{ //read the settings sync - settingsStr = fs.readFileSync(settingsFilename); + settingsStr = fs.readFileSync(settingsFilename).toString(); } catch(e){ console.error('No settings file found.'); process.exit(1); From dc09323d8f6ee5a65f301bb677d9e18a54672322 Mon Sep 17 00:00:00 2001 From: Marcel Klehr Date: Wed, 11 Jul 2012 15:36:41 +0200 Subject: [PATCH 007/189] Don't exit if no settings file was found. --- src/node/utils/Settings.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/node/utils/Settings.js b/src/node/utils/Settings.js index 1b7c3f46c..dd34ac5ee 100644 --- a/src/node/utils/Settings.js +++ b/src/node/utils/Settings.js @@ -111,8 +111,7 @@ try{ //read the settings sync settingsStr = fs.readFileSync(settingsFilename).toString(); } catch(e){ - console.error('No settings file found.'); - process.exit(1); + console.warn('No settings file found. Continuing using defaults!'); } // try to parse the settings From 6726ea66320e3075451027d5362d35d77bebaf5d Mon Sep 17 00:00:00 2001 From: John McLear Date: Wed, 11 Jul 2012 17:42:59 +0100 Subject: [PATCH 008/189] option to stop autoscroll --- src/static/js/chat.js | 7 +++++-- src/templates/pad.html | 4 ++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/static/js/chat.js b/src/static/js/chat.js index 47b0ae3ca..b2a7d2737 100644 --- a/src/static/js/chat.js +++ b/src/static/js/chat.js @@ -62,8 +62,11 @@ var chat = (function() }, scrollDown: function() { - if($('#chatbox').css("display") != "none") - $('#chattext').animate({scrollTop: $('#chattext')[0].scrollHeight}, "slow"); + if($('#options-scrollchat').is(':checked')){ + if($('#chatbox').css("display") != "none"){ + $('#chattext').animate({scrollTop: $('#chattext')[0].scrollHeight}, "slow"); + } + } }, send: function() { diff --git a/src/templates/pad.html b/src/templates/pad.html index 02af9b107..a25133472 100644 --- a/src/templates/pad.html +++ b/src/templates/pad.html @@ -168,6 +168,10 @@

+

+ + +

Font type:

-

- - -

Font type: + + + + <% e.end_block(); %> +

<% e.end_block(); %> + +
+
+
Loading...
+
@@ -263,53 +317,6 @@
-
- <% e.begin_block("modals"); %> -
-
-
Connecting...
-
Reestablishing connection...
-
-

Disconnected.

-

Opened in another window.

-

No Authorization.

-
-

We're having trouble talking to the EtherPad lite synchronization server. You may be connecting through an incompatible firewall or proxy server.

-
-
-

We were unable to connect to the EtherPad lite synchronization server. This may be due to an incompatibility with your web browser or internet connection.

-
-
-

You seem to have opened this pad in another browser window. If you'd like to use this window instead, you can reconnect.

-
-
-

Lost connection with the EtherPad lite synchronization server. This may be due to a loss of network connectivity.

-
-
-

Server not responding. This may be due to network connectivity issues or high load on the server.

-
-
-

Your browser's credentials or permissions have changed while viewing this pad. Try reconnecting.

-
-
-

This pad was deleted.

-
-
-

If this continues to happen, please let us know

-
-
- -
-
-
- -
- <% e.end_block(); %> -
<% e.end_block(); %> <% e.begin_block("scripts"); %> From 9e9cbd5ffa379607f1124b519aec53087cfe427d Mon Sep 17 00:00:00 2001 From: Marcel Klehr Date: Fri, 13 Jul 2012 08:24:02 +0200 Subject: [PATCH 014/189] Fix typo. --- src/static/js/ace2_inner.js | 2 +- src/static/js/pad_editbar.js | 12 ++++++------ src/static/js/pad_modals.js | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/static/js/ace2_inner.js b/src/static/js/ace2_inner.js index cc9f1288d..490eee19d 100644 --- a/src/static/js/ace2_inner.js +++ b/src/static/js/ace2_inner.js @@ -3237,7 +3237,7 @@ function Ace2Inner(){ } //hide the dropdownso if(window.parent.parent.padeditbar){ // required in case its in an iframe should probably use parent.. See Issue 327 https://github.com/Pita/etherpad-lite/issues/327 - window.parent.parent.padeditbar.toogleDropDown("none"); + window.parent.parent.padeditbar.toggleDropDown("none"); } } diff --git a/src/static/js/pad_editbar.js b/src/static/js/pad_editbar.js index 973bfda2a..31912f8a8 100644 --- a/src/static/js/pad_editbar.js +++ b/src/static/js/pad_editbar.js @@ -122,25 +122,25 @@ var padeditbar = (function() { if(cmd == "showusers") { - self.toogleDropDown("users"); + self.toggleDropDown("users"); } else if (cmd == 'settings') { - self.toogleDropDown("settings"); + self.toggleDropDown("settings"); } else if (cmd == 'connectivity') { - self.toogleDropDown("connectivity"); + self.toggleDropDown("connectivity"); } else if (cmd == 'embed') { self.setEmbedLinks(); $('#linkinput').focus().select(); - self.toogleDropDown("embed"); + self.toggleDropDown("embed"); } else if (cmd == 'import_export') { - self.toogleDropDown("importexport"); + self.toggleDropDown("importexport"); } else if (cmd == 'savedRevision') { @@ -186,7 +186,7 @@ var padeditbar = (function() } if(padeditor.ace) padeditor.ace.focus(); }, - toogleDropDown: function(moduleName, cb) + toggleDropDown: function(moduleName, cb) { var modules = ["settings", "connectivity", "importexport", "embed", "users"]; diff --git a/src/static/js/pad_modals.js b/src/static/js/pad_modals.js index ee986621e..720fdfc14 100644 --- a/src/static/js/pad_modals.js +++ b/src/static/js/pad_modals.js @@ -35,8 +35,8 @@ var padmodals = (function() { $("#connectivity .visible").removeClass('visible'); $("#connectivity ."+messageId).addClass('visible'); - padeditbar.toogleDropDown("none", function() { - padeditbar.toogleDropDown("connectivity"); + padeditbar.toggleDropDown("none", function() { + padeditbar.toggleDropDown("connectivity"); }); }, showOverlay: function(duration) { From 6bda1f8e4dbdebdf2e1cbf38f3380069e2224b2a Mon Sep 17 00:00:00 2001 From: Marcel Klehr Date: Fri, 13 Jul 2012 09:13:22 +0200 Subject: [PATCH 015/189] Fix padeditbar.toggleDropDown Only call callback, if one was passed. --- 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 31912f8a8..59658a046 100644 --- a/src/static/js/pad_editbar.js +++ b/src/static/js/pad_editbar.js @@ -209,7 +209,7 @@ var padeditbar = (function() returned = true; } } - if(!returned) return cb(); + if(!returned && cb) return cb(); } else { From 8ab12ee69e1c255dda51a8dacb8ca5c05ea84bbc Mon Sep 17 00:00:00 2001 From: Marcel Klehr Date: Sat, 14 Jul 2012 14:46:02 +0200 Subject: [PATCH 016/189] Only disable toolbar. Make content available and allow scrolling --- src/static/css/pad.css | 7 ++++--- src/static/js/pad_modals.js | 4 ++-- src/templates/pad.html | 7 +++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/static/css/pad.css b/src/static/css/pad.css index 3b600fd3c..226c1f7ca 100644 --- a/src/static/css/pad.css +++ b/src/static/css/pad.css @@ -402,6 +402,7 @@ table#otheruserstable { font-style: italic; } +#connectivitylink, #connectivity { z-index: 600 !important; } @@ -420,17 +421,17 @@ table#otheruserstable { padding: 5px; } -#modaloverlay { +.toolbar #overlay { z-index: 500; display: none; background-repeat: repeat-both; width: 100%; position: absolute; - height: 100%; + height: inherit; left: 0; top: 0; } -* html #modaloverlay { +* html #overlay { /* for IE 6+ */ -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)"; filter: alpha(opacity=100); diff --git a/src/static/js/pad_modals.js b/src/static/js/pad_modals.js index 720fdfc14..174779df4 100644 --- a/src/static/js/pad_modals.js +++ b/src/static/js/pad_modals.js @@ -40,7 +40,7 @@ var padmodals = (function() }); }, showOverlay: function(duration) { - $("#modaloverlay").show().css( + $("#overlay").show().css( { 'opacity': 0 }).animate( @@ -49,7 +49,7 @@ var padmodals = (function() }, duration); }, hideOverlay: function(duration) { - $("#modaloverlay").animate( + $("#overlay").animate( { 'opacity': 0 }, duration, function() diff --git a/src/templates/pad.html b/src/templates/pad.html index a01016cd2..4c02bdf6f 100644 --- a/src/templates/pad.html +++ b/src/templates/pad.html @@ -22,6 +22,9 @@ <% e.begin_block("body"); %>
+
+
+

Reestablishing connection...

+

Opened in another window.

From 2d0cf156af7213cd26246daf9a579b63bf13a8d0 Mon Sep 17 00:00:00 2001 From: Marcel Klehr Date: Sat, 14 Jul 2012 15:14:46 +0200 Subject: [PATCH 020/189] Fix showModal animation. New content shouldn' slide in before the containing popup. --- src/static/js/pad_modals.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/static/js/pad_modals.js b/src/static/js/pad_modals.js index 174779df4..0292e048f 100644 --- a/src/static/js/pad_modals.js +++ b/src/static/js/pad_modals.js @@ -33,9 +33,9 @@ var padmodals = (function() }, showModal: function(messageId) { - $("#connectivity .visible").removeClass('visible'); - $("#connectivity ."+messageId).addClass('visible'); padeditbar.toggleDropDown("none", function() { + $("#connectivity .visible").removeClass('visible'); + $("#connectivity ."+messageId).addClass('visible'); padeditbar.toggleDropDown("connectivity"); }); }, From 1466fa03a4d8c17d0bcb9a28abd4820531c89e27 Mon Sep 17 00:00:00 2001 From: Marcel Klehr Date: Sat, 14 Jul 2012 15:54:20 +0200 Subject: [PATCH 021/189] Fix some minor mistakes. --- src/static/css/pad.css | 1 - src/templates/pad.html | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/static/css/pad.css b/src/static/css/pad.css index 226c1f7ca..22cb6d26a 100644 --- a/src/static/css/pad.css +++ b/src/static/css/pad.css @@ -402,7 +402,6 @@ table#otheruserstable { font-style: italic; } -#connectivitylink, #connectivity { z-index: 600 !important; } diff --git a/src/templates/pad.html b/src/templates/pad.html index 88b5f4a58..8dee2cdc7 100644 --- a/src/templates/pad.html +++ b/src/templates/pad.html @@ -221,7 +221,7 @@ + +
+
+ +
+
@@ -70,54 +76,55 @@
-
-
- -
-
- -
- <% e.begin_block("modals"); %> -
-
-
Connecting...
-
Reestablishing connection...
-
-

Disconnected.

-

Opened in another window.

-

No Authorization.

-
-

We're having trouble talking to the EtherPad lite synchronization server. You may be connecting through an incompatible firewall or proxy server.

-
-
-

We were unable to connect to the EtherPad lite synchronization server. This may be due to an incompatibility with your web browser or internet connection.

-
-
-

You seem to have opened this pad in another browser window. If you'd like to use this window instead, you can reconnect.

-
-
-

Lost connection with the EtherPad lite synchronization server. This may be due to a loss of network connectivity.

-
-
-

Server not responding. This may be due to network connectivity issues or high load on the server.

-
-
-

Your browser's credentials or permissions have changed while viewing this pad. Try reconnecting.

-
-
-

This pad was deleted.

-
-
-

If this continues to happen, please let us know

-
-
- -
-
-
-
- <% e.end_block(); %> -
+
From b1123d11b60b6325e0f3dc5cd343814cd2c264bf Mon Sep 17 00:00:00 2001 From: 0ip Date: Sat, 14 Jul 2012 20:35:26 +0300 Subject: [PATCH 023/189] Correct path --- src/templates/admin/plugins.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/templates/admin/plugins.html b/src/templates/admin/plugins.html index 104f6b986..3dad3bd01 100644 --- a/src/templates/admin/plugins.html +++ b/src/templates/admin/plugins.html @@ -21,7 +21,7 @@

Etherpad Lite

- Technical information on installed plugins + Technical information on installed plugins

Installed plugins

From eb6be841509d7e6e33d4c4fc70f70da5426176c2 Mon Sep 17 00:00:00 2001 From: Marcel Klehr Date: Sun, 15 Jul 2012 16:03:12 +0200 Subject: [PATCH 024/189] Fix html/css --- src/static/css/pad.css | 4 ++ src/templates/pad.html | 32 ++++++------ src/templates/timeslider.html | 94 ++++++++++++++++++----------------- 3 files changed, 71 insertions(+), 59 deletions(-) diff --git a/src/static/css/pad.css b/src/static/css/pad.css index 22cb6d26a..df9dde143 100644 --- a/src/static/css/pad.css +++ b/src/static/css/pad.css @@ -730,6 +730,10 @@ input[type=checkbox] { .popup input[type=text], #users input[type=text] { outline: none; } +.popup button { + padding: 5px; + font-size: 14px; +} .popup a { text-decoration: none } diff --git a/src/templates/pad.html b/src/templates/pad.html index 8dee2cdc7..94138d96a 100644 --- a/src/templates/pad.html +++ b/src/templates/pad.html @@ -224,40 +224,44 @@

Connected.

-

Reestablishing connection...

+

Reestablishing connection...

-

Opened in another window.

-

You seem to have opened this pad in another browser window. If you'd like to use this window instead, you can reconnect.

+

Opened in another window.

+

You seem to have opened this pad in another browser window.

+

If you'd like to use this window instead, you can reconnect.

-

No Authorization.

+

No Authorization.

Your browser's credentials or permissions have changed while viewing this pad. Try reconnecting.

-

Disconnected.

-

We're having trouble talking to the EtherPad lite synchronization server. You may be connecting through an incompatible firewall or proxy server.

+

Disconnected.

+

We're having trouble talking to the EtherPad lite synchronization server.

+

You may be connecting through an incompatible firewall or proxy server.

-

Disconnected.

-

We were unable to connect to the EtherPad lite synchronization server. This may be due to an incompatibility with your web browser or internet connection.

+

Disconnected.

+

We were unable to connect to the EtherPad lite synchronization server.

+

This may be due to an incompatibility with your web browser or internet connection.

-

Disconnected.

-

Server not responding. This may be due to network connectivity issues or high load on the server.

+

Disconnected.

+

Server not responding.

+

This may be due to network connectivity issues or high load on the server.

-

Disconnected.

+

Disconnected.

This pad was deleted.

-

Disconnected.

-

Lost connection with the EtherPad lite synchronization server. This may be due to a loss of network connectivity.

-

If this continues to happen, please let us know

+

Disconnected.

+

Lost connection with the EtherPad lite synchronization server.

+

This may be due to a loss of network connectivity. If this continues to happen, please let us know

From 9bd23acb3dd14e381b7c97041a2a70712890761d Mon Sep 17 00:00:00 2001 From: Mark Holmquist Date: Tue, 17 Jul 2012 10:12:10 -0700 Subject: [PATCH 025/189] Add userJoinOrUpdate hook This hook fires on the client side, whenever a user joins or updates (hence the name). It will pass one thing, the user's info, into the context. This is mostly just for notification purposes. --- src/static/js/pad_userlist.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/static/js/pad_userlist.js b/src/static/js/pad_userlist.js index d83825854..474f9b0e1 100644 --- a/src/static/js/pad_userlist.js +++ b/src/static/js/pad_userlist.js @@ -21,6 +21,7 @@ */ var padutils = require('./pad_utils').padutils; +var hooks = require('./pluginfw/hooks'); var myUserInfo = {}; @@ -529,6 +530,10 @@ var paduserlist = (function() return; } + hooks.callAll('userJoinOrUpdate', { + userInfo: info + }); + var userData = {}; userData.color = typeof info.colorId == "number" ? clientVars.colorPalette[info.colorId] : info.colorId; userData.name = info.name; From 9aed433ad5947fbbeeac1bf94c0e4961f0833087 Mon Sep 17 00:00:00 2001 From: Marcel Klehr Date: Wed, 18 Jul 2012 15:54:53 +0200 Subject: [PATCH 026/189] Fix #880 Remove call to padsavedrevs.handleIsFullyConnected --- src/static/js/pad.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/static/js/pad.js b/src/static/js/pad.js index df6342e2d..a22e181a2 100644 --- a/src/static/js/pad.js +++ b/src/static/js/pad.js @@ -790,8 +790,6 @@ var pad = { }, 1000); } - padsavedrevs.handleIsFullyConnected(isConnected); - // pad.determineSidebarVisibility(isConnected && !isInitialConnect); pad.determineChatVisibility(isConnected && !isInitialConnect); pad.determineAuthorshipColorsVisibility(); From c0daf1aaaf6f24ff2c61df2d20642add67cae58f Mon Sep 17 00:00:00 2001 From: Jordan Wiens Date: Thu, 19 Jul 2012 00:59:15 -0400 Subject: [PATCH 027/189] adding basic numbered list support to dokuwiki export --- src/node/utils/ExportDokuWiki.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/node/utils/ExportDokuWiki.js b/src/node/utils/ExportDokuWiki.js index bcb211081..d2f71236b 100644 --- a/src/node/utils/ExportDokuWiki.js +++ b/src/node/utils/ExportDokuWiki.js @@ -252,7 +252,12 @@ function getDokuWikiFromAtext(pad, atext) if (line.listLevel && lineContent) { - pieces.push(new Array(line.listLevel + 1).join(' ') + '* '); + if (line.listTypeName == "number") + { + pieces.push(new Array(line.listLevel + 1).join(' ') + ' - '); + } else { + pieces.push(new Array(line.listLevel + 1).join(' ') + '* '); + } } pieces.push(lineContent); } From c3ddff3fa061a48ae7178c62038e143ab5304ec6 Mon Sep 17 00:00:00 2001 From: Marcel Klehr Date: Thu, 19 Jul 2012 11:34:14 +0200 Subject: [PATCH 028/189] Notify the user, if JavaScript is disabled. --- src/templates/pad.html | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/templates/pad.html b/src/templates/pad.html index 02af9b107..36d6334c2 100644 --- a/src/templates/pad.html +++ b/src/templates/pad.html @@ -148,7 +148,10 @@
-
Loading...
+
+

Loading...

+ +