From 6a27a547274c1d4ad57dac994720285ed36c3c95 Mon Sep 17 00:00:00 2001 From: mluto Date: Sun, 6 Jan 2013 12:48:32 +0100 Subject: [PATCH 01/37] Added --root argument to run.sh to bypass the root-check, fix for #1324 --- bin/run.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/bin/run.sh b/bin/run.sh index 82e89a946..41a8090d2 100755 --- a/bin/run.sh +++ b/bin/run.sh @@ -8,10 +8,18 @@ if [ -d "../bin" ]; then cd "../" fi +ignoreRoot=0 +for ARG in $* +do + if [ $ARG == '--root' ]; then + ignoreRoot=1 + fi +done + #Stop the script if its started as root -if [ "$(id -u)" -eq 0 ]; then +if [ "$(id -u)" -eq 0 ] && [ $ignoreRoot -eq 0 ]; then echo "You shouldn't start Etherpad-Lite as root!" - echo "Please type 'Etherpad Lite rocks my socks' if you still want to start it as root" + echo "Please type 'Etherpad Lite rocks my socks' or supply the '--root' argument if you still want to start it as root" read rocks if [ ! $rocks = "Etherpad Lite rocks my socks" ] then From 9484b92ae236888fc72a181adf3248816b52b7f0 Mon Sep 17 00:00:00 2001 From: mluto Date: Sun, 6 Jan 2013 14:55:33 +0100 Subject: [PATCH 02/37] fixed and unified indenting, added comments in handleClientReady --- src/node/handler/PadMessageHandler.js | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/node/handler/PadMessageHandler.js b/src/node/handler/PadMessageHandler.js index a0bccfc51..ef70d604e 100644 --- a/src/node/handler/PadMessageHandler.js +++ b/src/node/handler/PadMessageHandler.js @@ -782,15 +782,15 @@ function handleClientReady(client, message) var padIds; async.series([ - // Get ro/rw id:s - function (callback) { + //Get ro/rw id:s + function (callback) + { readOnlyManager.getIds(message.padId, function(err, value) { if(ERR(err, callback)) return; padIds = value; callback(); }); }, - //check permissions function(callback) { @@ -816,7 +816,7 @@ function handleClientReady(client, message) } }); }, - //get all authordata of this new user + //get all authordata of this new user, and load the pad-object from the database function(callback) { async.parallel([ @@ -840,6 +840,7 @@ function handleClientReady(client, message) callback(); }); }, + //get pad function(callback) { padManager.getPad(padIds.padId, function(err, value) @@ -851,7 +852,7 @@ function handleClientReady(client, message) } ], callback); }, - //these db requests all need the pad object + //these db requests all need the pad object (timestamp of latest revission, author data, chat messages) function(callback) { var authors = pad.getAllAuthors(); @@ -894,6 +895,7 @@ function handleClientReady(client, message) ], callback); }, + //glue the clientVars together, send them and tell the other clients that a new one is there function(callback) { //Check that the client is still here. It might have disconnected between callbacks. @@ -980,11 +982,10 @@ function handleClientReady(client, message) }, "abiwordAvailable": settings.abiwordAvailable(), "plugins": { - "plugins": plugins.plugins, - "parts": plugins.parts, - }, - "initialChangesets": [] // FIXME: REMOVE THIS SHIT - + "plugins": plugins.plugins, + "parts": plugins.parts, + }, + "initialChangesets": [] // FIXME: REMOVE THIS SHIT } //Add a username to the clientVars if one avaiable From 5592c4b0feb42082ab50e1c90753c28e5cd79334 Mon Sep 17 00:00:00 2001 From: mluto Date: Sun, 6 Jan 2013 16:11:48 +0100 Subject: [PATCH 03/37] client loads messages using the new client loads messages using new method, getChatMessages restructured and renamed to getLastChatMessages, added GET_CHAT_MESSAGES, getChatMessages restructured and renamed to getLastChatMessages --- src/node/db/Pad.js | 26 ++------ src/node/handler/PadMessageHandler.js | 87 +++++++++++++++++++++++---- src/static/js/chat.js | 23 +++---- src/static/js/collab_client.js | 14 ++++- src/static/js/pad.js | 5 ++ 5 files changed, 108 insertions(+), 47 deletions(-) diff --git a/src/node/db/Pad.js b/src/node/db/Pad.js index dba791fd2..0914c175b 100644 --- a/src/node/db/Pad.js +++ b/src/node/db/Pad.js @@ -281,27 +281,7 @@ Pad.prototype.getChatMessage = function getChatMessage(entryNum, callback) { }); }; -Pad.prototype.getLastChatMessages = function getLastChatMessages(count, callback) { - //return an empty array if there are no chat messages - if(this.chatHead == -1) - { - callback(null, []); - return; - } - - var _this = this; - - //works only if we decrement the amount, for some reason - count--; - - //set the startpoint - var start = this.chatHead-count; - if(start < 0) - start = 0; - - //set the endpoint - var end = this.chatHead; - +Pad.prototype.getChatMessages = function getChatMessages(start, end, callback) { //collect the numbers of chat entries and in which order we need them var neededEntries = []; var order = 0; @@ -310,7 +290,9 @@ Pad.prototype.getLastChatMessages = function getLastChatMessages(count, callback neededEntries.push({entryNum:i, order: order}); order++; } - + + var _this = this; + //get all entries out of the database var entries = []; async.forEach(neededEntries, function(entryObject, callback) diff --git a/src/node/handler/PadMessageHandler.js b/src/node/handler/PadMessageHandler.js index ef70d604e..00eb234e4 100644 --- a/src/node/handler/PadMessageHandler.js +++ b/src/node/handler/PadMessageHandler.js @@ -205,6 +205,8 @@ exports.handleMessage = function(client, message) handleUserInfoUpdate(client, message); } else if (message.data.type == "CHAT_MESSAGE") { handleChatMessage(client, message); + } else if (message.data.type == "GET_CHAT_MESSAGES") { + handleGetChatMessages(client, message); } else if (message.data.type == "SAVE_REVISION") { handleSaveRevisionMessage(client, message); } else if (message.data.type == "CLIENT_MESSAGE" && @@ -362,6 +364,74 @@ function handleChatMessage(client, message) }); } +/** + * Handles the clients requets for more chat-messages + * @param client the client that send this message + * @param message the message from the client + */ +function handleGetChatMessages(client, message) +{ + if(message.data.start == null) + { + messageLogger.warn("Dropped message, GetChatMessages Message has no start!"); + return; + } + if(message.data.end == null) + { + messageLogger.warn("Dropped message, GetChatMessages Message has no start!"); + return; + } + + var start = message.data.start; + var end = message.data.end; + var count = start - count; + + if(count < 0 && count > 100) + { + messageLogger.warn("Dropped message, GetChatMessages Message, client requested invalid amout of messages!"); + return; + } + + var padId = sessioninfos[client.id].padId; + var pad; + + async.series([ + //get the pad + function(callback) + { + padManager.getPad(padId, function(err, _pad) + { + if(ERR(err, callback)) return; + pad = _pad; + callback(); + }); + }, + function(callback) + { + pad.getChatMessages(start, end, function(err, chatMessages) + { + if(ERR(err, callback)) return; + + var infoMsg = { + type: "COLLABROOM", + data: { + type: "CHAT_MESSAGES", + messages: chatMessages + } + }; + + // send the messages back to the client + for(var i in pad2sessions[padId]) + { + if(pad2sessions[padId][i] == client.id) + { + socketio.sockets.sockets[pad2sessions[padId][i]].json.send(infoMsg); + break; + } + } + }); + }]); +} /** * Handles a handleSuggestUserName, that means a user have suggest a userName for a other user @@ -778,7 +848,6 @@ function handleClientReady(client, message) var pad; var historicalAuthorData = {}; var currentTime; - var chatMessages; var padIds; async.series([ @@ -852,7 +921,7 @@ function handleClientReady(client, message) } ], callback); }, - //these db requests all need the pad object (timestamp of latest revission, author data, chat messages) + //these db requests all need the pad object (timestamp of latest revission, author data) function(callback) { var authors = pad.getAllAuthors(); @@ -881,16 +950,6 @@ function handleClientReady(client, message) callback(); }); }, callback); - }, - //get the latest chat messages - function(callback) - { - pad.getLastChatMessages(100, function(err, _chatMessages) - { - if(ERR(err, callback)) return; - chatMessages = _chatMessages; - callback(); - }); } ], callback); @@ -968,7 +1027,9 @@ function handleClientReady(client, message) "padId": message.padId, "initialTitle": "Pad: " + message.padId, "opts": {}, - "chatHistory": chatMessages, + // tell the client the number of the latest chat-message, which will be + // used to request the latest 100 chat-messages later (GET_CHAT_MESSAGES) + "chatHead": pad.chatHead, "numConnectedUsers": pad2sessions[padIds.padId].length, "isProPad": false, "readOnlyId": padIds.readOnlyPadId, diff --git a/src/static/js/chat.js b/src/static/js/chat.js index 79224e80c..19c4cba80 100644 --- a/src/static/js/chat.js +++ b/src/static/js/chat.js @@ -28,6 +28,7 @@ var Tinycon = require('tinycon/tinycon'); var chat = (function() { var isStuck = false; + var gotInitialMessages = false; var chatMentions = 0; var self = { show: function () @@ -76,7 +77,7 @@ var chat = (function() this._pad.collabClient.sendMessage({"type": "CHAT_MESSAGE", "text": text}); $("#chatinput").val(""); }, - addMessage: function(msg, increment) + addMessage: function(msg, increment, isHistoryAdd) { //correct the time msg.time += this._pad.clientTimeOffset; @@ -112,7 +113,10 @@ var chat = (function() var authorName = msg.userName == null ? _('pad.userlist.unnamed') : padutils.escapeHtml(msg.userName); var html = "

" + authorName + ":" + timeStr + " " + text + "

"; - $("#chattext").append(html); + if(isHistoryAdd) + $("#chattext").prepend(html); + else + $("#chattext").append(html); //should we increment the counter?? if(increment) @@ -125,7 +129,7 @@ var chat = (function() $("#chatcounter").text(count); // chat throb stuff -- Just make it throw for twice as long - if(wasMentioned && !alreadyFocused) + if(wasMentioned && !alreadyFocused && !isHistoryAdd) { // If the user was mentioned show for twice as long and flash the browser window $('#chatthrob').html(""+authorName+"" + ": " + text).show().delay(4000).hide(400); chatMentions++; @@ -141,8 +145,8 @@ var chat = (function() chatMentions = 0; Tinycon.setBubble(0); }); - self.scrollDown(); - + if(!isHistoryAdd) + self.scrollDown(); }, init: function(pad) { @@ -157,12 +161,9 @@ var chat = (function() } }); - var that = this; - $.each(clientVars.chatHistory, function(i, o){ - that.addMessage(o, false); - }) - - $("#chatcounter").text(clientVars.chatHistory.length); + // initial messages are loaded in pad.js' _afterHandshake + + $("#chatcounter").text(0); } } diff --git a/src/static/js/collab_client.js b/src/static/js/collab_client.js index b700fc490..29c404828 100644 --- a/src/static/js/collab_client.js +++ b/src/static/js/collab_client.js @@ -400,7 +400,19 @@ function getCollabClient(ace2editor, serverVars, initialUserInfo, options, _pad) } else if (msg.type == "CHAT_MESSAGE") { - chat.addMessage(msg, true); + chat.addMessage(msg, true, false); + } + else if (msg.type == "CHAT_MESSAGES") + { + for(var i = msg.messages.length - 1; i >= 0; i--) + { + chat.addMessage(msg.messages[i], true, true); + } + if(!chat.gotInitalMessages) + { + chat.scrollDown(); + chat.gotInitalMessages = true; + } } else if (msg.type == "SERVER_MESSAGE") { diff --git a/src/static/js/pad.js b/src/static/js/pad.js index a02d7abbc..56a1dad7c 100644 --- a/src/static/js/pad.js +++ b/src/static/js/pad.js @@ -555,6 +555,11 @@ var pad = { pad.collabClient.setOnChannelStateChange(pad.handleChannelStateChange); pad.collabClient.setOnInternalAction(pad.handleCollabAction); + // load initial chat-messages + var chatHead = clientVars.chatHead; + var start = Math.max(chatHead - 100, 0); + pad.collabClient.sendMessage({"type": "GET_CHAT_MESSAGES", "start": start, "end": chatHead}); + function postAceInit() { padeditbar.init(); From 5f81daed0ae9b8e147d00724516b5002dc77f289 Mon Sep 17 00:00:00 2001 From: mluto Date: Mon, 7 Jan 2013 17:36:03 +0100 Subject: [PATCH 04/37] Added link to load more chat-messages using new GET_CHAT_MESSAGES --- src/locales/de.json | 1 + src/locales/en.json | 2 +- src/static/css/pad.css | 5 +++++ src/static/js/chat.js | 16 +++++++++++++++- src/static/js/collab_client.js | 5 ++++- src/static/js/pad.js | 13 ++++++++++--- src/templates/pad.html | 2 +- 7 files changed, 37 insertions(+), 7 deletions(-) diff --git a/src/locales/de.json b/src/locales/de.json index 5ede40f08..1bdbdaf3d 100644 --- a/src/locales/de.json +++ b/src/locales/de.json @@ -81,6 +81,7 @@ "pad.share.emebdcode": "In Webseite einbetten", "pad.chat": "Chat", "pad.chat.title": "Den Chat dieses Pads \u00f6ffnen", + "pad.chat.loadmessages": "Weitere Nachrichten laden", "timeslider.pageTitle": "{{appTitle}} Pad-Versionsgeschichte", "timeslider.toolbar.returnbutton": "Zur\u00fcck zum Pad", "timeslider.toolbar.authors": "Autoren:", diff --git a/src/locales/en.json b/src/locales/en.json index c3ab8c583..37e07a154 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -1 +1 @@ -{"index.newPad":"New Pad","index.createOpenPad":"or create/open a Pad with the name:","pad.toolbar.bold.title":"Bold (Ctrl-B)","pad.toolbar.italic.title":"Italic (Ctrl-I)","pad.toolbar.underline.title":"Underline (Ctrl-U)","pad.toolbar.strikethrough.title":"Strikethrough","pad.toolbar.ol.title":"Ordered list","pad.toolbar.ul.title":"Unordered List","pad.toolbar.indent.title":"Indent","pad.toolbar.unindent.title":"Outdent","pad.toolbar.undo.title":"Undo (Ctrl-Z)","pad.toolbar.redo.title":"Redo (Ctrl-Y)","pad.toolbar.clearAuthorship.title":"Clear Authorship Colors","pad.toolbar.import_export.title":"Import/Export from/to different file formats","pad.toolbar.timeslider.title":"Timeslider","pad.toolbar.savedRevision.title":"Saved Revisions","pad.toolbar.settings.title":"Settings","pad.toolbar.embed.title":"Embed this pad","pad.toolbar.showusers.title":"Show the users on this pad","pad.colorpicker.save":"Save","pad.colorpicker.cancel":"Cancel","pad.loading":"Loading...","pad.passwordRequired":"You need a password to access this pad","pad.permissionDenied":"You do not have permission to access this pad","pad.wrongPassword":"Your password was wrong","pad.settings.padSettings":"Pad Settings","pad.settings.myView":"My View","pad.settings.stickychat":"Chat always on screen","pad.settings.colorcheck":"Authorship colors","pad.settings.linenocheck":"Line numbers","pad.settings.fontType":"Font type:","pad.settings.fontType.normal":"Normal","pad.settings.fontType.monospaced":"Monospace","pad.settings.globalView":"Global View","pad.settings.language":"Language:","pad.importExport.import_export":"Import/Export","pad.importExport.import":"Upload any text file or document","pad.importExport.importSuccessful":"Successful!","pad.importExport.export":"Export current pad as:","pad.importExport.exporthtml":"HTML","pad.importExport.exportplain":"Plain text","pad.importExport.exportword":"Microsoft Word","pad.importExport.exportpdf":"PDF","pad.importExport.exportopen":"ODF (Open Document Format)","pad.importExport.exportdokuwiki":"DokuWiki","pad.importExport.abiword.innerHTML":"You only can import from plain text or html formats. For more advanced import features please install abiword.","pad.modals.connected":"Connected.","pad.modals.reconnecting":"Reconnecting to your pad..","pad.modals.forcereconnect":"Force reconnect","pad.modals.userdup":"Opened in another window","pad.modals.userdup.explanation":"This pad seems to be opened in more than one browser window on this computer.","pad.modals.userdup.advice":"Reconnect to use this window instead.","pad.modals.unauth":"Not authorized","pad.modals.unauth.explanation":"Your permissions have changed while viewing this page. Try to reconnect.","pad.modals.looping":"Disconnected.","pad.modals.looping.explanation":"There are communication problems with the synchronization server.","pad.modals.looping.cause":"Perhaps you connected through an incompatible firewall or proxy.","pad.modals.initsocketfail":"Server is unreachable.","pad.modals.initsocketfail.explanation":"Couldn't connect to the synchronization server.","pad.modals.initsocketfail.cause":"This is probably due to a problem with your browser or your internet connection.","pad.modals.slowcommit":"Disconnected.","pad.modals.slowcommit.explanation":"The server is not responding.","pad.modals.slowcommit.cause":"This could be due to problems with network connectivity.","pad.modals.deleted":"Deleted.","pad.modals.deleted.explanation":"This pad has been removed.","pad.modals.disconnected":"You have been disconnected.","pad.modals.disconnected.explanation":"The connection to the server was lost","pad.modals.disconnected.cause":"The server may be unavailable. Please notify us if this continues to happen.","pad.share":"Share this pad","pad.share.readonly":"Read only","pad.share.link":"Link","pad.share.emebdcode":"Embed URL","pad.chat":"Chat","pad.chat.title":"Open the chat for this pad.","timeslider.pageTitle":"{{appTitle}} Timeslider","timeslider.toolbar.returnbutton":"Return to pad","timeslider.toolbar.authors":"Authors:","timeslider.toolbar.authorsList":"No Authors","timeslider.toolbar.exportlink.title":"Export","timeslider.exportCurrent":"Export current version as:","timeslider.version":"Version {{version}}","timeslider.saved":"Saved {{month}} {{day}}, {{year}}","timeslider.dateformat":"{{month}}/{{day}}/{{year}} {{hours}}:{{minutes}}:{{seconds}}","timeslider.month.january":"January","timeslider.month.february":"February","timeslider.month.march":"March","timeslider.month.april":"April","timeslider.month.may":"May","timeslider.month.june":"June","timeslider.month.july":"July","timeslider.month.august":"August","timeslider.month.september":"September","timeslider.month.october":"October","timeslider.month.november":"November","timeslider.month.december":"December","pad.savedrevs.marked":"This revision is now marked as a saved revision","pad.userlist.entername":"Enter your name","pad.userlist.unnamed":"unnamed","pad.userlist.guest":"Guest","pad.userlist.deny":"Deny","pad.userlist.approve":"Approve","pad.editbar.clearcolors":"Clear authorship colors on entire document?","pad.impexp.importbutton":"Import Now","pad.impexp.importing":"Importing...","pad.impexp.confirmimport":"Importing a file will overwrite the current text of the pad. Are you sure you want to proceed?","pad.impexp.convertFailed":"We were not able to import this file. Please use a different document format or copy paste manually","pad.impexp.uploadFailed":"The upload failed, please try again","pad.impexp.importfailed":"Import failed","pad.impexp.copypaste":"Please copy paste","pad.impexp.exportdisabled":"Exporting as {{type}} format is disabled. Please contact your system administrator for details."} \ No newline at end of file +{"index.newPad":"New Pad","index.createOpenPad":"or create/open a Pad with the name:","pad.toolbar.bold.title":"Bold (Ctrl-B)","pad.toolbar.italic.title":"Italic (Ctrl-I)","pad.toolbar.underline.title":"Underline (Ctrl-U)","pad.toolbar.strikethrough.title":"Strikethrough","pad.toolbar.ol.title":"Ordered list","pad.toolbar.ul.title":"Unordered List","pad.toolbar.indent.title":"Indent","pad.toolbar.unindent.title":"Outdent","pad.toolbar.undo.title":"Undo (Ctrl-Z)","pad.toolbar.redo.title":"Redo (Ctrl-Y)","pad.toolbar.clearAuthorship.title":"Clear Authorship Colors","pad.toolbar.import_export.title":"Import/Export from/to different file formats","pad.toolbar.timeslider.title":"Timeslider","pad.toolbar.savedRevision.title":"Saved Revisions","pad.toolbar.settings.title":"Settings","pad.toolbar.embed.title":"Embed this pad","pad.toolbar.showusers.title":"Show the users on this pad","pad.colorpicker.save":"Save","pad.colorpicker.cancel":"Cancel","pad.loading":"Loading...","pad.passwordRequired":"You need a password to access this pad","pad.permissionDenied":"You do not have permission to access this pad","pad.wrongPassword":"Your password was wrong","pad.settings.padSettings":"Pad Settings","pad.settings.myView":"My View","pad.settings.stickychat":"Chat always on screen","pad.settings.colorcheck":"Authorship colors","pad.settings.linenocheck":"Line numbers","pad.settings.fontType":"Font type:","pad.settings.fontType.normal":"Normal","pad.settings.fontType.monospaced":"Monospace","pad.settings.globalView":"Global View","pad.settings.language":"Language:","pad.importExport.import_export":"Import/Export","pad.importExport.import":"Upload any text file or document","pad.importExport.importSuccessful":"Successful!","pad.importExport.export":"Export current pad as:","pad.importExport.exporthtml":"HTML","pad.importExport.exportplain":"Plain text","pad.importExport.exportword":"Microsoft Word","pad.importExport.exportpdf":"PDF","pad.importExport.exportopen":"ODF (Open Document Format)","pad.importExport.exportdokuwiki":"DokuWiki","pad.importExport.abiword.innerHTML":"You only can import from plain text or html formats. For more advanced import features please install abiword.","pad.modals.connected":"Connected.","pad.modals.reconnecting":"Reconnecting to your pad..","pad.modals.forcereconnect":"Force reconnect","pad.modals.userdup":"Opened in another window","pad.modals.userdup.explanation":"This pad seems to be opened in more than one browser window on this computer.","pad.modals.userdup.advice":"Reconnect to use this window instead.","pad.modals.unauth":"Not authorized","pad.modals.unauth.explanation":"Your permissions have changed while viewing this page. Try to reconnect.","pad.modals.looping":"Disconnected.","pad.modals.looping.explanation":"There are communication problems with the synchronization server.","pad.modals.looping.cause":"Perhaps you connected through an incompatible firewall or proxy.","pad.modals.initsocketfail":"Server is unreachable.","pad.modals.initsocketfail.explanation":"Couldn't connect to the synchronization server.","pad.modals.initsocketfail.cause":"This is probably due to a problem with your browser or your internet connection.","pad.modals.slowcommit":"Disconnected.","pad.modals.slowcommit.explanation":"The server is not responding.","pad.modals.slowcommit.cause":"This could be due to problems with network connectivity.","pad.modals.deleted":"Deleted.","pad.modals.deleted.explanation":"This pad has been removed.","pad.modals.disconnected":"You have been disconnected.","pad.modals.disconnected.explanation":"The connection to the server was lost","pad.modals.disconnected.cause":"The server may be unavailable. Please notify us if this continues to happen.","pad.share":"Share this pad","pad.share.readonly":"Read only","pad.share.link":"Link","pad.share.emebdcode":"Embed URL","pad.chat":"Chat","pad.chat.title":"Open the chat for this pad.","pad.chat.loadmessages": "Load more messages","timeslider.pageTitle":"{{appTitle}} Timeslider","timeslider.toolbar.returnbutton":"Return to pad","timeslider.toolbar.authors":"Authors:","timeslider.toolbar.authorsList":"No Authors","timeslider.toolbar.exportlink.title":"Export","timeslider.exportCurrent":"Export current version as:","timeslider.version":"Version {{version}}","timeslider.saved":"Saved {{month}} {{day}}, {{year}}","timeslider.dateformat":"{{month}}/{{day}}/{{year}} {{hours}}:{{minutes}}:{{seconds}}","timeslider.month.january":"January","timeslider.month.february":"February","timeslider.month.march":"March","timeslider.month.april":"April","timeslider.month.may":"May","timeslider.month.june":"June","timeslider.month.july":"July","timeslider.month.august":"August","timeslider.month.september":"September","timeslider.month.october":"October","timeslider.month.november":"November","timeslider.month.december":"December","pad.savedrevs.marked":"This revision is now marked as a saved revision","pad.userlist.entername":"Enter your name","pad.userlist.unnamed":"unnamed","pad.userlist.guest":"Guest","pad.userlist.deny":"Deny","pad.userlist.approve":"Approve","pad.editbar.clearcolors":"Clear authorship colors on entire document?","pad.impexp.importbutton":"Import Now","pad.impexp.importing":"Importing...","pad.impexp.confirmimport":"Importing a file will overwrite the current text of the pad. Are you sure you want to proceed?","pad.impexp.convertFailed":"We were not able to import this file. Please use a different document format or copy paste manually","pad.impexp.uploadFailed":"The upload failed, please try again","pad.impexp.importfailed":"Import failed","pad.impexp.copypaste":"Please copy paste","pad.impexp.exportdisabled":"Exporting as {{type}} format is disabled. Please contact your system administrator for details."} \ No newline at end of file diff --git a/src/static/css/pad.css b/src/static/css/pad.css index bb8da99b6..a36a7ff9c 100644 --- a/src/static/css/pad.css +++ b/src/static/css/pad.css @@ -488,6 +488,11 @@ table#otheruserstable { -ms-overflow-x: hidden; overflow-x: hidden; } +#chatloadmessages +{ + color: blue; + text-decoration: underline; +} #chatinputbox { padding: 3px 2px; position: absolute; diff --git a/src/static/js/chat.js b/src/static/js/chat.js index 19c4cba80..2136c56c1 100644 --- a/src/static/js/chat.js +++ b/src/static/js/chat.js @@ -29,6 +29,7 @@ var chat = (function() { var isStuck = false; var gotInitialMessages = false; + var historyPointer = 0; var chatMentions = 0; var self = { show: function () @@ -114,7 +115,7 @@ var chat = (function() var html = "

" + authorName + ":" + timeStr + " " + text + "

"; if(isHistoryAdd) - $("#chattext").prepend(html); + $(html).insertAfter('#chatloadmessages'); else $("#chattext").append(html); @@ -164,6 +165,19 @@ var chat = (function() // initial messages are loaded in pad.js' _afterHandshake $("#chatcounter").text(0); + $("#chatloadmessages").click(function() + { + var start = Math.max(self.historyPointer - 100, 0); + var end = self.historyPointer; + + if(start == end) // nothing to load + return; + if(start == 0) // reached the top + $("#chatloadmessages").css("display", "none"); + + pad.collabClient.sendMessage({"type": "GET_CHAT_MESSAGES", "start": start, "end": end}); + self.historyPointer = start; + }); } } diff --git a/src/static/js/collab_client.js b/src/static/js/collab_client.js index 29c404828..902301d50 100644 --- a/src/static/js/collab_client.js +++ b/src/static/js/collab_client.js @@ -411,7 +411,10 @@ function getCollabClient(ace2editor, serverVars, initialUserInfo, options, _pad) if(!chat.gotInitalMessages) { chat.scrollDown(); - chat.gotInitalMessages = true; + chat.gotInitalMessages = true; + chat.historyPointer = clientVars.chatHead - msg.messages.length; + if(chat.historyPointer == -1) // there are less than 100 messages + $("#chatloadmessages").css("display", "none"); } } else if (msg.type == "SERVER_MESSAGE") diff --git a/src/static/js/pad.js b/src/static/js/pad.js index 56a1dad7c..57aa2834e 100644 --- a/src/static/js/pad.js +++ b/src/static/js/pad.js @@ -556,9 +556,16 @@ var pad = { pad.collabClient.setOnInternalAction(pad.handleCollabAction); // load initial chat-messages - var chatHead = clientVars.chatHead; - var start = Math.max(chatHead - 100, 0); - pad.collabClient.sendMessage({"type": "GET_CHAT_MESSAGES", "start": start, "end": chatHead}); + if(clientVars.chatHead != -1) + { + var chatHead = clientVars.chatHead; + var start = Math.max(chatHead - 100, 0); + pad.collabClient.sendMessage({"type": "GET_CHAT_MESSAGES", "start": start, "end": chatHead}); + } + else // there are no messages + { + $("#chatloadmessages").css("display", "none"); + } function postAceInit() { diff --git a/src/templates/pad.html b/src/templates/pad.html index a9313a1be..780ceaaa0 100644 --- a/src/templates/pad.html +++ b/src/templates/pad.html @@ -368,7 +368,7 @@
-
+
From 825b258d995f3c1512af20124d9c72768014ef09 Mon Sep 17 00:00:00 2001 From: mluto Date: Mon, 7 Jan 2013 17:43:03 +0100 Subject: [PATCH 05/37] only load 20 messages when pressing the load-link, fixed whitespace --- src/static/js/chat.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/static/js/chat.js b/src/static/js/chat.js index 2136c56c1..edd6c500a 100644 --- a/src/static/js/chat.js +++ b/src/static/js/chat.js @@ -167,9 +167,9 @@ var chat = (function() $("#chatcounter").text(0); $("#chatloadmessages").click(function() { - var start = Math.max(self.historyPointer - 100, 0); - var end = self.historyPointer; - + var start = Math.max(self.historyPointer - 20, 0); + var end = self.historyPointer; + if(start == end) // nothing to load return; if(start == 0) // reached the top From bc05f9eb0adf5d9f674159106644f64d363e62e1 Mon Sep 17 00:00:00 2001 From: mluto Date: Mon, 7 Jan 2013 19:15:55 +0100 Subject: [PATCH 06/37] converted load-more-link to button, added loading-gif, fixed typo --- src/node/handler/PadMessageHandler.js | 2 +- src/static/css/pad.css | 17 ++++++++++++++--- src/static/js/chat.js | 9 +++++---- src/static/js/collab_client.js | 11 +++++++++-- src/static/js/pad.js | 2 +- src/templates/pad.html | 5 ++++- 6 files changed, 34 insertions(+), 12 deletions(-) diff --git a/src/node/handler/PadMessageHandler.js b/src/node/handler/PadMessageHandler.js index 00eb234e4..a013f2203 100644 --- a/src/node/handler/PadMessageHandler.js +++ b/src/node/handler/PadMessageHandler.js @@ -365,7 +365,7 @@ function handleChatMessage(client, message) } /** - * Handles the clients requets for more chat-messages + * Handles the clients request for more chat-messages * @param client the client that send this message * @param message the message from the client */ diff --git a/src/static/css/pad.css b/src/static/css/pad.css index a36a7ff9c..bbbadbc18 100644 --- a/src/static/css/pad.css +++ b/src/static/css/pad.css @@ -488,10 +488,21 @@ table#otheruserstable { -ms-overflow-x: hidden; overflow-x: hidden; } -#chatloadmessages +.chatloadmessages { - color: blue; - text-decoration: underline; + margin-bottom: 5px; + margin-top: 5px; + margin-left: auto; + margin-right: auto; + display: block; +} +#chatloadmessagesbutton +{ + line-height: 1.8em; +} +#chatloadmessagesball +{ + display: none; } #chatinputbox { padding: 3px 2px; diff --git a/src/static/js/chat.js b/src/static/js/chat.js index edd6c500a..01adc34e8 100644 --- a/src/static/js/chat.js +++ b/src/static/js/chat.js @@ -115,7 +115,7 @@ var chat = (function() var html = "

" + authorName + ":" + timeStr + " " + text + "

"; if(isHistoryAdd) - $(html).insertAfter('#chatloadmessages'); + $(html).insertAfter('#chatloadmessagesbutton'); else $("#chattext").append(html); @@ -165,15 +165,16 @@ var chat = (function() // initial messages are loaded in pad.js' _afterHandshake $("#chatcounter").text(0); - $("#chatloadmessages").click(function() + $("#chatloadmessagesbutton").click(function() { var start = Math.max(self.historyPointer - 20, 0); var end = self.historyPointer; if(start == end) // nothing to load return; - if(start == 0) // reached the top - $("#chatloadmessages").css("display", "none"); + + $("#chatloadmessagesbutton").css("display", "none"); + $("#chatloadmessagesball").css("display", "block"); pad.collabClient.sendMessage({"type": "GET_CHAT_MESSAGES", "start": start, "end": end}); self.historyPointer = start; diff --git a/src/static/js/collab_client.js b/src/static/js/collab_client.js index 902301d50..7df0b7114 100644 --- a/src/static/js/collab_client.js +++ b/src/static/js/collab_client.js @@ -413,9 +413,16 @@ function getCollabClient(ace2editor, serverVars, initialUserInfo, options, _pad) chat.scrollDown(); chat.gotInitalMessages = true; chat.historyPointer = clientVars.chatHead - msg.messages.length; - if(chat.historyPointer == -1) // there are less than 100 messages - $("#chatloadmessages").css("display", "none"); } + + // messages are loaded, so hide the loading-ball + $("#chatloadmessagesball").css("display", "none"); + + // there are less than 100 messages or we reached the top + if(chat.historyPointer <= 0) + $("#chatloadmessagesbutton").css("display", "none"); + else // there are still more messages, re-show the load-button + $("#chatloadmessagesbutton").css("display", "block"); } else if (msg.type == "SERVER_MESSAGE") { diff --git a/src/static/js/pad.js b/src/static/js/pad.js index 57aa2834e..64d8b42b8 100644 --- a/src/static/js/pad.js +++ b/src/static/js/pad.js @@ -564,7 +564,7 @@ var pad = { } else // there are no messages { - $("#chatloadmessages").css("display", "none"); + $("#chatloadmessagesbutton").css("display", "none"); } function postAceInit() diff --git a/src/templates/pad.html b/src/templates/pad.html index 780ceaaa0..cbfdc5276 100644 --- a/src/templates/pad.html +++ b/src/templates/pad.html @@ -368,7 +368,10 @@
-
+
+ loading.. + +
From 198754222df8345b17f9d4b61417d6e8be865817 Mon Sep 17 00:00:00 2001 From: Swen Date: Tue, 8 Jan 2013 20:14:01 +0100 Subject: [PATCH 07/37] Added functionality to list pads on this server. --- src/node/db/API.js | 6 ++++ src/node/db/Pad.js | 3 +- src/node/db/PadManager.js | 55 +++++++++++++++++++++++++++++++++- src/node/handler/APIHandler.js | 36 ++++++++++++++++++++++ 4 files changed, 97 insertions(+), 3 deletions(-) diff --git a/src/node/db/API.js b/src/node/db/API.js index ea58d8599..9bcb4eb5b 100644 --- a/src/node/db/API.js +++ b/src/node/db/API.js @@ -42,6 +42,12 @@ exports.deleteGroup = groupManager.deleteGroup; exports.listPads = groupManager.listPads; exports.createGroupPad = groupManager.createGroupPad; +/**********************/ +/**PADLIST FUNCTION****/ +/**********************/ + +exports.listAllPads = padManager.getPads; + /**********************/ /**AUTHOR FUNCTIONS****/ /**********************/ diff --git a/src/node/db/Pad.js b/src/node/db/Pad.js index dba791fd2..a420c8f9d 100644 --- a/src/node/db/Pad.js +++ b/src/node/db/Pad.js @@ -473,8 +473,7 @@ Pad.prototype.remove = function remove(callback) { //delete the pad entry and delete pad from padManager function(callback) { - db.remove("pad:"+padID); - padManager.unloadPad(padID); + padManager.removePad(padID); hooks.callAll("padRemove", {'padID':padID}); callback(); } diff --git a/src/node/db/PadManager.js b/src/node/db/PadManager.js index 5f08b1b1b..79a41ddc2 100644 --- a/src/node/db/PadManager.js +++ b/src/node/db/PadManager.js @@ -34,10 +34,52 @@ var db = require("./DB").db; */ var globalPads = { get: function (name) { return this[':'+name]; }, - set: function (name, value) { this[':'+name] = value; }, + set: function (name, value) + { + this[':'+name] = value; + padList.addPad(name); + }, remove: function (name) { delete this[':'+name]; } }; +var padList = { + list: [], + init: function() + { + db.get("pads", function(err, dbData) + { + if(ERR(err)) return; + if(dbData != null){ + dbData.forEach(function(val){ + padList.addPad(val,false); + }); + } + }); + return this; + }, + getPads: function(){ + return this.list; + }, + addPad: function(name,immediateSave) + { + if(this.list.indexOf(name) == -1){ + this.list.push(name); + if(immediateSave == undefined || immediateSave == true){ + db.set("pads", this.list); + } + } + }, + removePad: function(name) + { + var index=this.list.indexOf(name); + if(index>-1){ + this.list.splice(index,1); + db.set("pads", this.list); + } + } +}; +padList.init(); + /** * An array of padId transformations. These represent changes in pad name policy over * time, and allow us to "play back" these changes so legacy padIds can be found. @@ -109,6 +151,11 @@ exports.getPad = function(id, text, callback) } } +exports.getPads = function(callback) +{ + callback(null,padList.getPads()); +} + //checks if a pad exists exports.doesPadExists = function(padId, callback) { @@ -163,6 +210,12 @@ exports.isValidPadId = function(padId) return /^(g.[a-zA-Z0-9]{16}\$)?[^$]{1,50}$/.test(padId); } +exports.removePad = function(padId){ + db.remove("pad:"+padId); + exports.unloadPad(padId); + padList.removePad(padId); +} + //removes a pad from the array exports.unloadPad = function(padId) { diff --git a/src/node/handler/APIHandler.js b/src/node/handler/APIHandler.js index 0bcd5f0c9..ae93e933f 100644 --- a/src/node/handler/APIHandler.js +++ b/src/node/handler/APIHandler.js @@ -138,6 +138,42 @@ var version = , "listAllGroups" : [] , "checkToken" : [] } +, "1.2.1": + { "createGroup" : [] + , "createGroupIfNotExistsFor" : ["groupMapper"] + , "deleteGroup" : ["groupID"] + , "listPads" : ["groupID"] + , "listAllPads" : [] + , "createPad" : ["padID", "text"] + , "createGroupPad" : ["groupID", "padName", "text"] + , "createAuthor" : ["name"] + , "createAuthorIfNotExistsFor": ["authorMapper" , "name"] + , "listPadsOfAuthor" : ["authorID"] + , "createSession" : ["groupID", "authorID", "validUntil"] + , "deleteSession" : ["sessionID"] + , "getSessionInfo" : ["sessionID"] + , "listSessionsOfGroup" : ["groupID"] + , "listSessionsOfAuthor" : ["authorID"] + , "getText" : ["padID", "rev"] + , "setText" : ["padID", "text"] + , "getHTML" : ["padID", "rev"] + , "setHTML" : ["padID", "html"] + , "getRevisionsCount" : ["padID"] + , "getLastEdited" : ["padID"] + , "deletePad" : ["padID"] + , "getReadOnlyID" : ["padID"] + , "setPublicStatus" : ["padID", "publicStatus"] + , "getPublicStatus" : ["padID"] + , "setPassword" : ["padID", "password"] + , "isPasswordProtected" : ["padID"] + , "listAuthorsOfPad" : ["padID"] + , "padUsersCount" : ["padID"] + , "getAuthorName" : ["authorID"] + , "padUsers" : ["padID"] + , "sendClientsMessage" : ["padID", "msg"] + , "listAllGroups" : [] + , "checkToken" : [] + } }; /** From 8c3263a6ea6105ad1f2c6e2c5b09a5f88c120fb1 Mon Sep 17 00:00:00 2001 From: Swen Date: Tue, 8 Jan 2013 20:19:10 +0100 Subject: [PATCH 08/37] Added comments --- src/node/db/PadManager.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/node/db/PadManager.js b/src/node/db/PadManager.js index 79a41ddc2..fc273c56c 100644 --- a/src/node/db/PadManager.js +++ b/src/node/db/PadManager.js @@ -210,6 +210,9 @@ exports.isValidPadId = function(padId) return /^(g.[a-zA-Z0-9]{16}\$)?[^$]{1,50}$/.test(padId); } +/** + * Removes the pad from database and unloads it. + */ exports.removePad = function(padId){ db.remove("pad:"+padId); exports.unloadPad(padId); From 7a49c82e16d11604d45c84844db2bad4d6251cef Mon Sep 17 00:00:00 2001 From: Swen Date: Tue, 8 Jan 2013 20:21:14 +0100 Subject: [PATCH 09/37] Added comments --- src/node/db/PadManager.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/node/db/PadManager.js b/src/node/db/PadManager.js index fc273c56c..891f65953 100644 --- a/src/node/db/PadManager.js +++ b/src/node/db/PadManager.js @@ -78,6 +78,7 @@ var padList = { } } }; +//initialises the allknowing data structure padList.init(); /** From c9f137b2e581339b46522bf6ce70ce9b0eb5612d Mon Sep 17 00:00:00 2001 From: Swen Date: Wed, 9 Jan 2013 20:45:39 +0100 Subject: [PATCH 10/37] Added functionality to use spcsser/ueberDB findKey functionality. --- src/node/db/PadManager.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/node/db/PadManager.js b/src/node/db/PadManager.js index 891f65953..32119038a 100644 --- a/src/node/db/PadManager.js +++ b/src/node/db/PadManager.js @@ -46,12 +46,12 @@ var padList = { list: [], init: function() { - db.get("pads", function(err, dbData) + db.findKeys("pad:*", "*:*:*", function(err, dbData) { if(ERR(err)) return; if(dbData != null){ dbData.forEach(function(val){ - padList.addPad(val,false); + padList.addPad(val.replace(/pad:/,""),false); }); } }); @@ -60,13 +60,10 @@ var padList = { getPads: function(){ return this.list; }, - addPad: function(name,immediateSave) + addPad: function(name) { if(this.list.indexOf(name) == -1){ this.list.push(name); - if(immediateSave == undefined || immediateSave == true){ - db.set("pads", this.list); - } } }, removePad: function(name) @@ -74,7 +71,6 @@ var padList = { var index=this.list.indexOf(name); if(index>-1){ this.list.splice(index,1); - db.set("pads", this.list); } } }; From ac448937abd4744195bcf17003315f39ee32ba3b Mon Sep 17 00:00:00 2001 From: John McLear Date: Thu, 10 Jan 2013 00:01:38 +0000 Subject: [PATCH 11/37] fix egils fix of time delta resolves #1345 --- src/static/js/broadcast.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/static/js/broadcast.js b/src/static/js/broadcast.js index 05e4c1742..6bd135bd2 100644 --- a/src/static/js/broadcast.js +++ b/src/static/js/broadcast.js @@ -244,14 +244,14 @@ function loadBroadcastJS(socket, sendSocketMsg, fireWhenAllScriptsAreLoaded, Bro if (broadcasting) applyChangeset(changesetForward, revision + 1, false, timeDelta); } -/* + /* At this point, we must be certain that the changeset really does map from the current revision to the specified revision. Any mistakes here will cause the whole slider to get out of sync. */ function applyChangeset(changeset, revision, preventSliderMovement, timeDelta) - { + { // disable the next 'gotorevision' call handled by a timeslider update if (!preventSliderMovement) { @@ -271,7 +271,8 @@ function loadBroadcastJS(socket, sendSocketMsg, fireWhenAllScriptsAreLoaded, Bro Changeset.mutateTextLines(changeset, padContents); padContents.currentRevision = revision; - padContents.currentTime += timeDelta; + padContents.currentTime += timeDelta * 1000; + debugLog('Time Delta: ', timeDelta) updateTimer(); @@ -293,8 +294,6 @@ function loadBroadcastJS(socket, sendSocketMsg, fireWhenAllScriptsAreLoaded, Bro return str; } - - var date = new Date(padContents.currentTime); var dateFormat = function() { @@ -319,7 +318,6 @@ function loadBroadcastJS(socket, sendSocketMsg, fireWhenAllScriptsAreLoaded, Bro $('#timer').html(dateFormat()); - var revisionDate = html10n.get("timeslider.saved", { "day": date.getDate(), "month": [ From 730266256c9702cb5858bd75f29898e0f6d915c8 Mon Sep 17 00:00:00 2001 From: John McLear Date: Thu, 10 Jan 2013 15:14:10 +0000 Subject: [PATCH 12/37] fix #1341 by adding css to stop highlighting --- src/static/css/timeslider.css | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/static/css/timeslider.css b/src/static/css/timeslider.css index d786d89ba..b3c201847 100644 --- a/src/static/css/timeslider.css +++ b/src/static/css/timeslider.css @@ -32,6 +32,12 @@ background-image: url(../../static/img/timeslider_background.png); height: 63px; margin: 0 9px; + -webkit-touch-callout: none; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; } #timeslider #timeslider-slider { height: 61px; @@ -140,6 +146,14 @@ #padmain { top: 0px !important } +#editbar{ + -webkit-touch-callout: none; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} #editbarright { float: right } From e9726890a4aa4c80bebac2c8e6c3af29522495a5 Mon Sep 17 00:00:00 2001 From: Swen Date: Fri, 11 Jan 2013 04:43:59 +0100 Subject: [PATCH 13/37] Edited getPads function to be able to work without callback --- src/node/db/PadManager.js | 6 +++++- src/package.json | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/node/db/PadManager.js b/src/node/db/PadManager.js index 32119038a..82bc27d0e 100644 --- a/src/node/db/PadManager.js +++ b/src/node/db/PadManager.js @@ -150,7 +150,11 @@ exports.getPad = function(id, text, callback) exports.getPads = function(callback) { - callback(null,padList.getPads()); + if(callback != null){ + callback(null,padList.getPads()); + }else{ + return padList.getPads(); + } } //checks if a pad exists diff --git a/src/package.json b/src/package.json index 67acd1260..826db97b2 100644 --- a/src/package.json +++ b/src/package.json @@ -46,5 +46,5 @@ "engines" : { "node" : ">=0.6.0", "npm" : ">=1.0" }, - "version" : "1.2.3" + "version" : "1.2.4" } From 062dbff738ac0c4a302946aaaa91537f53cf6a18 Mon Sep 17 00:00:00 2001 From: spcsser Date: Fri, 11 Jan 2013 12:59:02 +0100 Subject: [PATCH 14/37] Added listAllPads api docu --- doc/api/http_api.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/doc/api/http_api.md b/doc/api/http_api.md index 61daeaa39..65309dbc4 100644 --- a/doc/api/http_api.md +++ b/doc/api/http_api.md @@ -419,3 +419,13 @@ returns ok when api token is valid *Example returns:* * `{"code":0,"message":"ok","data":null}` * `{"code":4,"message":"no or wrong API Key","data":null}` + +### Pads + +#### listAllPads() + * API >= 1.2.1 + +lists all pads on this epl instance + +*Example returns:* + * `{code: 0, message:"ok", data: ["testPad", "thePadsOfTheOthers"]}` \ No newline at end of file From 9687ecbb829721ff6272cfbc7d4a8e3eba9a4892 Mon Sep 17 00:00:00 2001 From: spcsser Date: Fri, 11 Jan 2013 18:31:53 +0100 Subject: [PATCH 15/37] Modified pad list manager to return an ordered list. --- src/node/db/PadManager.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/node/db/PadManager.js b/src/node/db/PadManager.js index 82bc27d0e..8cd69a83e 100644 --- a/src/node/db/PadManager.js +++ b/src/node/db/PadManager.js @@ -44,6 +44,7 @@ var globalPads = { var padList = { list: [], + sorted : false, init: function() { db.findKeys("pad:*", "*:*:*", function(err, dbData) @@ -57,13 +58,21 @@ var padList = { }); return this; }, + /** + * Returns all pads in alphabetical order as array. + */ getPads: function(){ + if(!this.sorted){ + this.list=this.list.sort(); + this.sorted=true; + } return this.list; }, addPad: function(name) { if(this.list.indexOf(name) == -1){ this.list.push(name); + this.sorted=false; } }, removePad: function(name) @@ -71,6 +80,7 @@ var padList = { var index=this.list.indexOf(name); if(index>-1){ this.list.splice(index,1); + this.sorted=false; } } }; From 2786807f2f2b1884f9d7a5d8eb499b9c2be0db7a Mon Sep 17 00:00:00 2001 From: 0ip Date: Sat, 12 Jan 2013 18:41:56 +0100 Subject: [PATCH 16/37] Fix broken relative paths MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bug introduced inĀ 53521c8732 --- src/templates/index.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/templates/index.html b/src/templates/index.html index 668b7abe2..f0e1beb3f 100644 --- a/src/templates/index.html +++ b/src/templates/index.html @@ -33,9 +33,9 @@ - - - + + + + <% e.end_block(); %> @@ -74,6 +75,7 @@
+ <% e.begin_block("timesliderEditbarRight"); %> + <% e.end_block(); %>
@@ -222,7 +225,7 @@ }); })(); - <% e.end_block(); %> + From 1e7bcdba59f821033096026b31e12298beb003c4 Mon Sep 17 00:00:00 2001 From: John McLear Date: Mon, 14 Jan 2013 03:42:09 +0000 Subject: [PATCH 24/37] more sensible timeslider blocks.. --- src/templates/timeslider.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/templates/timeslider.html b/src/templates/timeslider.html index 0372b66c7..4a8543c56 100644 --- a/src/templates/timeslider.html +++ b/src/templates/timeslider.html @@ -48,6 +48,7 @@
+ <% e.begin_block("timesliderTop"); %>
+ <% e.end_block(); %>
From 77401f275960b68ec1bf8cbd330201d08ff33731 Mon Sep 17 00:00:00 2001 From: mluto Date: Mon, 14 Jan 2013 17:11:56 +0100 Subject: [PATCH 25/37] prevent empty chat-messages from being sent --- src/static/js/chat.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/static/js/chat.js b/src/static/js/chat.js index 79224e80c..fd286debe 100644 --- a/src/static/js/chat.js +++ b/src/static/js/chat.js @@ -73,6 +73,8 @@ var chat = (function() send: function() { var text = $("#chatinput").val(); + if(text.trim().length == 0) + return; this._pad.collabClient.sendMessage({"type": "CHAT_MESSAGE", "text": text}); $("#chatinput").val(""); }, From adf5c97664172ef61c3817167d53f4a3f109cc58 Mon Sep 17 00:00:00 2001 From: mluto Date: Mon, 14 Jan 2013 17:45:11 +0100 Subject: [PATCH 26/37] Added test for empty-message-block --- tests/frontend/specs/keystroke_chat.js | 27 ++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/tests/frontend/specs/keystroke_chat.js b/tests/frontend/specs/keystroke_chat.js index d6a7d2fd4..060c5aa2f 100644 --- a/tests/frontend/specs/keystroke_chat.js +++ b/tests/frontend/specs/keystroke_chat.js @@ -36,4 +36,31 @@ describe("send chat message", function(){ }); }); + + it("makes sure that an empty message can't be sent", function(done) { + var inner$ = helper.padInner$; + var chrome$ = helper.padChrome$; + + //click on the chat button to make chat visible + var $chatButton = chrome$("#chaticon"); + $chatButton.click(); + var $chatInput = chrome$("#chatinput"); + $chatInput.sendkeys('{enter}'); // simulate a keypress of enter (to send an empty message) + $chatInput.sendkeys('mluto'); // simulate a keypress of typing mluto + $chatInput.sendkeys('{enter}'); // simulate a keypress of enter (to send 'mluto') + + //check if chat shows up + helper.waitFor(function(){ + return chrome$("#chattext").children("p").length !== 0; // wait until the chat message shows up + }).done(function(){ + // check that the empty message is not there + expect(chrome$("#chattext").children("p").length).to.be(1); + // check that the received message is not the empty one + var $firstChatMessage = chrome$("#chattext").children("p"); + var containsMessage = $firstChatMessage.text().indexOf("mluto") !== -1; + expect(containsMessage).to.be(true); + done(); + }); + + }); }); From 94f9b05c4c539cb209a96eeb5519a7496126513e Mon Sep 17 00:00:00 2001 From: mluto Date: Mon, 14 Jan 2013 22:08:33 +0100 Subject: [PATCH 27/37] Only create clientVars when they are needed --- src/node/handler/PadMessageHandler.js | 129 +++++++++++++------------- 1 file changed, 64 insertions(+), 65 deletions(-) diff --git a/src/node/handler/PadMessageHandler.js b/src/node/handler/PadMessageHandler.js index a013f2203..0b60e8fdb 100644 --- a/src/node/handler/PadMessageHandler.js +++ b/src/node/handler/PadMessageHandler.js @@ -990,71 +990,7 @@ function handleClientReady(client, message) //Saves in pad2sessions that this session belongs to this pad pad2sessions[padIds.padId].push(client.id); - - //prepare all values for the wire - var atext = Changeset.cloneAText(pad.atext); - var attribsForWire = Changeset.prepareForWire(atext.attribs, pad.pool); - var apool = attribsForWire.pool.toJsonable(); - atext.attribs = attribsForWire.translated; - - // Warning: never ever send padIds.padId to the client. If the - // client is read only you would open a security hole 1 swedish - // mile wide... - var clientVars = { - "accountPrivs": { - "maxRevisions": 100 - }, - "initialRevisionList": [], - "initialOptions": { - "guestPolicy": "deny" - }, - "savedRevisions": pad.getSavedRevisions(), - "collab_client_vars": { - "initialAttributedText": atext, - "clientIp": "127.0.0.1", - //"clientAgent": "Anonymous Agent", - "padId": message.padId, - "historicalAuthorData": historicalAuthorData, - "apool": apool, - "rev": pad.getHeadRevisionNumber(), - "globalPadId": message.padId, - "time": currentTime, - }, - "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", "#4c9c82", "#12d1ad", "#2d8e80", "#7485c3", "#a091c7", "#3185ab", "#6818b4", "#e6e76d", "#a42c64", "#f386e5", "#4ecc0c", "#c0c236", "#693224", "#b5de6a", "#9b88fd", "#358f9b", "#496d2f", "#e267fe", "#d23056", "#1a1a64", "#5aa335", "#d722bb", "#86dc6c", "#b5a714", "#955b6a", "#9f2985", "#4b81c8", "#3d6a5b", "#434e16", "#d16084", "#af6a0e", "#8c8bd8"], - "clientIp": "127.0.0.1", - "userIsGuest": true, - "userColor": authorColorId, - "padId": message.padId, - "initialTitle": "Pad: " + message.padId, - "opts": {}, - // tell the client the number of the latest chat-message, which will be - // used to request the latest 100 chat-messages later (GET_CHAT_MESSAGES) - "chatHead": pad.chatHead, - "numConnectedUsers": pad2sessions[padIds.padId].length, - "isProPad": false, - "readOnlyId": padIds.readOnlyPadId, - "readonly": padIds.readonly, - "serverTimestamp": new Date().getTime(), - "globalPadId": message.padId, - "userId": author, - "cookiePrefsToSet": { - "fullWidth": false, - "hideSidebar": false - }, - "abiwordAvailable": settings.abiwordAvailable(), - "plugins": { - "plugins": plugins.plugins, - "parts": plugins.parts, - }, - "initialChangesets": [] // FIXME: REMOVE THIS SHIT - } - - //Add a username to the clientVars if one avaiable - if(authorName != null) - { - clientVars.userName = authorName; - } - + //If this is a reconnect, we don't have to send the client the ClientVars again if(message.reconnect == true) { @@ -1064,6 +1000,69 @@ function handleClientReady(client, message) //This is a normal first connect else { + //prepare all values for the wire + var atext = Changeset.cloneAText(pad.atext); + var attribsForWire = Changeset.prepareForWire(atext.attribs, pad.pool); + var apool = attribsForWire.pool.toJsonable(); + atext.attribs = attribsForWire.translated; + + // Warning: never ever send padIds.padId to the client. If the + // client is read only you would open a security hole 1 swedish + // mile wide... + var clientVars = { + "accountPrivs": { + "maxRevisions": 100 + }, + "initialRevisionList": [], + "initialOptions": { + "guestPolicy": "deny" + }, + "savedRevisions": pad.getSavedRevisions(), + "collab_client_vars": { + "initialAttributedText": atext, + "clientIp": "127.0.0.1", + "padId": message.padId, + "historicalAuthorData": historicalAuthorData, + "apool": apool, + "rev": pad.getHeadRevisionNumber(), + "globalPadId": message.padId, + "time": currentTime, + }, + "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", "#4c9c82", "#12d1ad", "#2d8e80", "#7485c3", "#a091c7", "#3185ab", "#6818b4", "#e6e76d", "#a42c64", "#f386e5", "#4ecc0c", "#c0c236", "#693224", "#b5de6a", "#9b88fd", "#358f9b", "#496d2f", "#e267fe", "#d23056", "#1a1a64", "#5aa335", "#d722bb", "#86dc6c", "#b5a714", "#955b6a", "#9f2985", "#4b81c8", "#3d6a5b", "#434e16", "#d16084", "#af6a0e", "#8c8bd8"], + "clientIp": "127.0.0.1", + "userIsGuest": true, + "userColor": authorColorId, + "padId": message.padId, + "initialTitle": "Pad: " + message.padId, + "opts": {}, + // tell the client the number of the latest chat-message, which will be + // used to request the latest 100 chat-messages later (GET_CHAT_MESSAGES) + "chatHead": pad.chatHead, + "numConnectedUsers": pad2sessions[padIds.padId].length, + "isProPad": false, + "readOnlyId": padIds.readOnlyPadId, + "readonly": padIds.readonly, + "serverTimestamp": new Date().getTime(), + "globalPadId": message.padId, + "userId": author, + "cookiePrefsToSet": { + "fullWidth": false, + "hideSidebar": false + }, + "abiwordAvailable": settings.abiwordAvailable(), + "plugins": { + "plugins": plugins.plugins, + "parts": plugins.parts, + }, + "initialChangesets": [] // FIXME: REMOVE THIS SHIT + } + + //Add a username to the clientVars if one avaiable + if(authorName != null) + { + clientVars.userName = authorName; + } + //Send the clientVars to the Client client.json.send({type: "CLIENT_VARS", data: clientVars}); //Save the current revision in sessioninfos, should be the same as in clientVars From 41cb5d82657f5b48fdb6ba32b3e0b34dea8933ed Mon Sep 17 00:00:00 2001 From: mluto Date: Mon, 14 Jan 2013 22:51:26 +0100 Subject: [PATCH 28/37] Added hook for clientVars and hook-doc --- doc/api/hooks_server-side.md | 21 +++++++++++++++++++++ src/node/handler/PadMessageHandler.js | 20 ++++++++++++++++---- 2 files changed, 37 insertions(+), 4 deletions(-) diff --git a/doc/api/hooks_server-side.md b/doc/api/hooks_server-side.md index c60d810e8..0486f7d3c 100644 --- a/doc/api/hooks_server-side.md +++ b/doc/api/hooks_server-side.md @@ -175,6 +175,27 @@ function handleMessage ( hook, context, callback ) { }; ``` +## clientVars +Called from: src/node/handler/PadMessageHandler.js + +Things in context: + +1. clientVars - the basic `clientVars` built by the core +2. pad - the pad this session is about + +This hook will be called once a client connects and the `clientVars` are being sent. Plugins can use this hook to give the client a initial configuriation, like the tracking-id of an external analytics-tool that is used on the client-side. You can also overwrite values from the original `clientVars`. + +Example: + +``` +exports.clientVars = function(hook, context, callback) +{ + // tell the client which year we are in + return callback({ "currentYear": new Date().getFullYear() }); +}; +``` + +This can be accessed on the client-side using `clientVars.currentYear`. ## getLineHTMLForExport Called from: src/node/utils/ExportHtml.js diff --git a/src/node/handler/PadMessageHandler.js b/src/node/handler/PadMessageHandler.js index 0b60e8fdb..434c25ad6 100644 --- a/src/node/handler/PadMessageHandler.js +++ b/src/node/handler/PadMessageHandler.js @@ -1063,10 +1063,22 @@ function handleClientReady(client, message) clientVars.userName = authorName; } - //Send the clientVars to the Client - client.json.send({type: "CLIENT_VARS", data: clientVars}); - //Save the current revision in sessioninfos, should be the same as in clientVars - sessioninfos[client.id].rev = pad.getHeadRevisionNumber(); + //call the clientVars-hook so plugins can modify them before they get sent to the client + hooks.aCallAll("clientVars", { clientVars: clientVars, pad: pad }, function ( err, messages ) { + if(ERR(err, callback)) return; + + _.each(messages, function(newVars) { + //combine our old object with the new attributes from the hook + for(var attr in newVars) { + clientVars[attr] = newVars[attr]; + } + }); + + //Send the clientVars to the Client + client.json.send({type: "CLIENT_VARS", data: clientVars}); + //Save the current revision in sessioninfos, should be the same as in clientVars + sessioninfos[client.id].rev = pad.getHeadRevisionNumber(); + }); } sessioninfos[client.id].author = author; From 27c5498c545159e5d07c11059f1e09a77f9bf1cf Mon Sep 17 00:00:00 2001 From: mluto Date: Mon, 14 Jan 2013 23:22:12 +0100 Subject: [PATCH 29/37] Require ueberDB 0.1.9, not 0.1.8; this is needed for findKeys --- src/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/package.json b/src/package.json index 826db97b2..d90fba7e3 100644 --- a/src/package.json +++ b/src/package.json @@ -16,7 +16,7 @@ "require-kernel" : "1.0.5", "resolve" : "0.2.x", "socket.io" : "0.9.x", - "ueberDB" : "0.1.8", + "ueberDB" : "0.1.9", "async" : "0.1.x", "express" : "3.x", "connect" : "2.4.x", From 7db6448e2acb68bec8f70afd5f1389e60ac90858 Mon Sep 17 00:00:00 2001 From: mluto Date: Tue, 15 Jan 2013 07:31:51 +0100 Subject: [PATCH 30/37] Load npm before everything else in checkPad.js --- bin/checkPad.js | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/bin/checkPad.js b/bin/checkPad.js index a92f836ca..bad5abced 100644 --- a/bin/checkPad.js +++ b/bin/checkPad.js @@ -10,15 +10,25 @@ if(process.argv.length != 3) //get the padID var padId = process.argv[2]; -//initalize the database -var settings = require("../src/node/utils/Settings"); +//initalize the variables +var db, settings, padManager; +var npm = require("../src/node_modules/npm"); var async = require("../src/node_modules/async"); -var db = require('../src/node/db/DB'); var Changeset = require("ep_etherpad-lite/static/js/Changeset"); -var padManager; async.series([ + //load npm + function(callback) { + npm.load({}, function(er) { + callback(er); + }) + }, + //load modules + function(callback) { + settings = require('../src/node/utils/Settings'); + db = require('../src/node/db/DB'); + }, //intallize the database function (callback) { From 7d2c31d8639e94cc593278e708ee26311de3eb8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= Date: Tue, 15 Jan 2013 21:16:19 +0000 Subject: [PATCH 31/37] fix module links in README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 90831a0fa..e254b81d3 100644 --- a/README.md +++ b/README.md @@ -115,9 +115,9 @@ Join the [mailinglist](http://groups.google.com/group/etherpad-lite-dev) and mak # Modules created for this project -* [ueberDB](https://github.com/ether/ueberDB) "transforms every database into a object key value store" - manages all database access -* [channels](https://github.com/ether/channels) "Event channels in node.js" - ensures that ueberDB operations are atomic and in series for each key -* [async-stacktrace](https://github.com/ether/async-stacktrace) "Improves node.js stacktraces and makes it easier to handle errors" +* [ueberDB](https://github.com/Pita/ueberDB) "transforms every database into a object key value store" - manages all database access +* [channels](https://github.com/Pita/channels) "Event channels in node.js" - ensures that ueberDB operations are atomic and in series for each key +* [async-stacktrace](https://github.com/Pita/async-stacktrace) "Improves node.js stacktraces and makes it easier to handle errors" # Donate! * [Flattr] (http://flattr.com/thing/71378/Etherpad-Foundation) From 09fa1d49a1de70e07d9069e264e9e03211ea1672 Mon Sep 17 00:00:00 2001 From: mluto Date: Tue, 15 Jan 2013 22:17:40 +0100 Subject: [PATCH 32/37] Added ability to load the same pad twice with helper.newPad, use this in load-message-tests --- tests/frontend/helper.js | 11 ++++++----- tests/frontend/specs/chat_load_messages.js | 20 ++++++++++---------- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/tests/frontend/helper.js b/tests/frontend/helper.js index ee57c8690..bf5df5082 100644 --- a/tests/frontend/helper.js +++ b/tests/frontend/helper.js @@ -56,13 +56,13 @@ var helper = {}; window.document.cookie = ""; } - helper.newPad = function(){ + helper.newPad = function(cb, padName){ //build opts object var opts = {clearCookies: true} - if(typeof arguments[0] === 'function'){ - opts.cb = arguments[0] + if(typeof cb === 'function'){ + opts.cb = cb } else { - opts = _.defaults(arguments[0], opts); + opts = _.defaults(cb, opts); } //clear cookies @@ -70,7 +70,8 @@ var helper = {}; helper.clearCookies(); } - var padName = "FRONTEND_TEST_" + helper.randomString(20); + if(!padName) + padName = "FRONTEND_TEST_" + helper.randomString(20); $iframe = $(""); //clean up inner iframe references diff --git a/tests/frontend/specs/chat_load_messages.js b/tests/frontend/specs/chat_load_messages.js index 8dc98691e..cf625dc46 100644 --- a/tests/frontend/specs/chat_load_messages.js +++ b/tests/frontend/specs/chat_load_messages.js @@ -1,6 +1,9 @@ describe("chat-load-messages", function(){ + var padName; + it("creates a pad", function(done) { - helper.newPad(done); + padName = helper.newPad(done); + this.timeout(60000); }); it("adds a lot of messages", function(done) { @@ -11,6 +14,8 @@ describe("chat-load-messages", function(){ var chatInput = chrome$("#chatinput"); var chatText = chrome$("#chattext"); + this.timeout(10000); + var messages = 140; for(var i=1; i <= messages; i++) { var num = ''+i; @@ -25,20 +30,15 @@ describe("chat-load-messages", function(){ return chatText.children("p").length == messages; }).always(function(){ expect(chatText.children("p").length).to.be(messages); - $('#iframe-container iframe')[0].contentWindow.location.reload(); - done(); + helper.newPad(done, padName); }); }); it("checks initial message count", function(done) { var chatText; var expectedCount = 101; + var chrome$ = helper.padChrome$; helper.waitFor(function(){ - // wait for the frame to load - var chrome$ = $('#iframe-container iframe')[0].contentWindow.$; - if(!chrome$) // page not fully loaded - return false; - var chatButton = chrome$("#chaticon"); chatButton.click(); chatText = chrome$("#chattext"); @@ -51,7 +51,7 @@ describe("chat-load-messages", function(){ it("loads more messages", function(done) { var expectedCount = 122; - var chrome$ = $('#iframe-container iframe')[0].contentWindow.$; + var chrome$ = helper.padChrome$; var chatButton = chrome$("#chaticon"); chatButton.click(); var chatText = chrome$("#chattext"); @@ -68,7 +68,7 @@ describe("chat-load-messages", function(){ it("checks for button vanishing", function(done) { var expectedDisplay = 'none'; - var chrome$ = $('#iframe-container iframe')[0].contentWindow.$; + var chrome$ = helper.padChrome$; var chatButton = chrome$("#chaticon"); chatButton.click(); var chatText = chrome$("#chattext"); From ae07b7384004ccffc97fb79ea394e93d6feea8e3 Mon Sep 17 00:00:00 2001 From: mluto Date: Tue, 15 Jan 2013 22:51:53 +0100 Subject: [PATCH 33/37] Increased timeouts to make IE9 happy, made button-test more strict --- tests/frontend/specs/chat_load_messages.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/frontend/specs/chat_load_messages.js b/tests/frontend/specs/chat_load_messages.js index cf625dc46..7b09b47e1 100644 --- a/tests/frontend/specs/chat_load_messages.js +++ b/tests/frontend/specs/chat_load_messages.js @@ -14,7 +14,7 @@ describe("chat-load-messages", function(){ var chatInput = chrome$("#chatinput"); var chatText = chrome$("#chattext"); - this.timeout(10000); + this.timeout(60000); var messages = 140; for(var i=1; i <= messages; i++) { @@ -28,7 +28,7 @@ describe("chat-load-messages", function(){ } helper.waitFor(function(){ return chatText.children("p").length == messages; - }).always(function(){ + }, 60000).always(function(){ expect(chatText.children("p").length).to.be(messages); helper.newPad(done, padName); }); @@ -73,12 +73,15 @@ describe("chat-load-messages", function(){ chatButton.click(); var chatText = chrome$("#chattext"); var loadMsgBtn = chrome$("#chatloadmessagesbutton"); + var loadMsgBall = chrome$("#chatloadmessagesball"); loadMsgBtn.click(); helper.waitFor(function(){ - return loadMsgBtn.css('display') == expectedDisplay; + return loadMsgBtn.css('display') == expectedDisplay && + loadMsgBall.css('display') == expectedDisplay; }).always(function(){ expect(loadMsgBtn.css('display')).to.be(expectedDisplay); + expect(loadMsgBall.css('display')).to.be(expectedDisplay); done(); }); }); From e31b9fd1bd301f8bfe11ecde4657bfa0f7edca1c Mon Sep 17 00:00:00 2001 From: mluto Date: Wed, 16 Jan 2013 18:48:25 +0100 Subject: [PATCH 34/37] IE8 does not have a string.trim()-function, so use regex.. --- src/static/js/chat.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/static/js/chat.js b/src/static/js/chat.js index 4699d4444..205294a85 100644 --- a/src/static/js/chat.js +++ b/src/static/js/chat.js @@ -75,7 +75,7 @@ var chat = (function() send: function() { var text = $("#chatinput").val(); - if(text.trim().length == 0) + if(text.replace(/\s+/,'').length == 0) return; this._pad.collabClient.sendMessage({"type": "CHAT_MESSAGE", "text": text}); $("#chatinput").val(""); From a1188c15c0eb18fc8831e36f6c6d8f19dbc3d141 Mon Sep 17 00:00:00 2001 From: Marcel Klehr Date: Wed, 16 Jan 2013 19:47:54 +0100 Subject: [PATCH 35/37] [html10n] Fix onload event listener (must be attached to window!) --- src/static/js/html10n.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/static/js/html10n.js b/src/static/js/html10n.js index c45f4b31b..b2c4e6195 100644 --- a/src/static/js/html10n.js +++ b/src/static/js/html10n.js @@ -883,7 +883,7 @@ window.html10n = (function(window, document, undefined) { html10n.index() }, false) else if (window.attachEvent) - document.attachEvent('onload', function() { + window.attachEvent('onload', function() { html10n.index() }, false) From 90ca3d53c31ecfc3c57f6b686f6455ab7339415c Mon Sep 17 00:00:00 2001 From: Marcel Klehr Date: Thu, 17 Jan 2013 17:31:56 +0100 Subject: [PATCH 36/37] Fix #1367: async.series was lacking callback in checkPad.js --- bin/checkPad.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/bin/checkPad.js b/bin/checkPad.js index bad5abced..a9b7e8bce 100644 --- a/bin/checkPad.js +++ b/bin/checkPad.js @@ -28,10 +28,8 @@ async.series([ function(callback) { settings = require('../src/node/utils/Settings'); db = require('../src/node/db/DB'); - }, - //intallize the database - function (callback) - { + + //intallize the database db.init(callback); }, //get the pad From 96989e63c74e05ea0665ed38d6ef6ea08720a6e7 Mon Sep 17 00:00:00 2001 From: John McLear Date: Fri, 18 Jan 2013 13:30:46 +0000 Subject: [PATCH 37/37] prepare for release --- CHANGELOG.md | 11 +++++++++++ src/package.json | 4 ++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 80a6148fb..7e471f004 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,14 @@ +# 1.2.5 + * Create timeslider EEJS blocks for plugins + * Allow for "more messages" to be loaded in chat + * Introduce better logging + * API endpoint for "listAllPads" + * Fix: Stop highlight of timeslider when dragging mouse + * Fix: Time Delta on Timeslider make date update properly + * Fix: Prevent empty chat messages from being sent + * Fix: checkPad script + * Fix: IE onLoad listener for i18n + # 1.2.4 * Fix IE console issue created in 1.2.3 * Allow CI Tests to pass by ignoring timeslider test diff --git a/src/package.json b/src/package.json index d90fba7e3..81e6ff164 100644 --- a/src/package.json +++ b/src/package.json @@ -16,7 +16,7 @@ "require-kernel" : "1.0.5", "resolve" : "0.2.x", "socket.io" : "0.9.x", - "ueberDB" : "0.1.9", + "ueberDB" : "0.1.x", "async" : "0.1.x", "express" : "3.x", "connect" : "2.4.x", @@ -46,5 +46,5 @@ "engines" : { "node" : ">=0.6.0", "npm" : ">=1.0" }, - "version" : "1.2.4" + "version" : "1.2.5" }