Index: lams_build/conf/etherpad/etherpad-lite/node_modules/ep_resize/static/js/index.js =================================================================== diff -u -r68a60b37cc8c4bd9372ebfdd67f612d94d0a057d -r323395f54fbda641b4ca15ccfe6849b52f6be25d --- lams_build/conf/etherpad/etherpad-lite/node_modules/ep_resize/static/js/index.js (.../index.js) (revision 68a60b37cc8c4bd9372ebfdd67f612d94d0a057d) +++ lams_build/conf/etherpad/etherpad-lite/node_modules/ep_resize/static/js/index.js (.../index.js) (revision 323395f54fbda641b4ca15ccfe6849b52f6be25d) @@ -2,54 +2,47 @@ var lastHeight; var lastWidth; -var returnchildHeights = function (children, offsetTop) { - offsetTop = offsetTop + 10 || 10; //Some extra padding for possible shadows etc. - +var returnchildHeights = function (children) { var maxHeight = 0; if (children.length) { maxHeight = 0; children.each(function (key, child) { - if ($(child).is(':visible') && $(child).attr('id') !== 'editorcontainerbox' && $(child).attr('id') !== 'editbar' && !$(child).is('iframe') && $(child)[0].offsetHeight > 0) { // Avoid infinit increasing - var childtop = ($(child).offset().top + $(child)[0].offsetHeight) + offsetTop; + if ($(child).is(':visible')) { + var childtop = ($(child).offset().top + $(child).outerHeight()); if (childtop > maxHeight) { maxHeight = childtop; } - } + } }); } return maxHeight; }; -exports.aceEditEvent = function (event, context, callback) { - var ace_outer_top = $('iframe[name=ace_outer]').offset().top; - var ace_inner_top = $('iframe[name=ace_outer]').contents().find('iframe[name=ace_inner]').offset().top; - var getFinalLine = context.rep.lines.atIndex(context.rep.lines.length()-1); - var finalLine = $(getFinalLine.lineNode); +exports.aceEditEvent = function (event, args, callback) { + var editbar = $('#editbar'); var elem = $('iframe[name=ace_outer]').contents().find('iframe[name=ace_inner]'); - var newHeight = finalLine.offset().top + finalLine.outerHeight() + ace_outer_top + ace_inner_top; + var newHeight = elem.outerHeight() + (editbar.length ? editbar.outerHeight() : 0); var newWidth = elem.outerWidth(); - var maxChild = returnchildHeights($('iframe[name=ace_outer]').contents().find('body').children(), ace_outer_top); + var maxChild = returnchildHeights($('iframe[name=ace_outer]').contents().find('body').children()); var maxChildBody = returnchildHeights($('body').children()); - if (maxChildBody > maxChild) { maxChild = maxChildBody } if (maxChild > newHeight) { newHeight = maxChild; } - if (!lastHeight || !lastWidth || lastHeight !== newHeight || lastWidth !== newWidth) { sendResizeMessage(newWidth, newHeight, window.document.location.href); } }; exports.goToRevisionEvent = function (hook_name, context, cb) { - + var editbar = $('#timeslider-top') var elem = $('#padeditor'); @@ -64,8 +57,8 @@ var sendResizeMessage = function (width, height, location) { lastHeight = height; lastWidth = width; + - window.parent.postMessage({ name: 'ep_resize', data: { @@ -74,4 +67,4 @@ location : location } }, '*'); -} +} Index: lams_build/conf/etherpad/etherpad-lite/settings.json =================================================================== diff -u -r5d515ce1673823c66a63cfceb178b74f826d92a9 -r323395f54fbda641b4ca15ccfe6849b52f6be25d --- lams_build/conf/etherpad/etherpad-lite/settings.json (.../settings.json) (revision 5d515ce1673823c66a63cfceb178b74f826d92a9) +++ lams_build/conf/etherpad/etherpad-lite/settings.json (.../settings.json) (revision 323395f54fbda641b4ca15ccfe6849b52f6be25d) @@ -197,7 +197,6 @@ */ "defaultPadText" : "", - /* * Default Pad behavior. * @@ -405,12 +404,22 @@ * follow the section "secure your installation" in README.md */ + /* "users": { "admin": { + // 1) "password" can be replaced with "hash" if you install ep_hash_auth + // 2) please note that if password is null, the user will not be created "password": "changeme1", "is_admin": true + }, + "user": { + // 1) "password" can be replaced with "hash" if you install ep_hash_auth + // 2) please note that if password is null, the user will not be created + "password": "changeme1", + "is_admin": false } }, + */ /* * Restrict socket.io transport methods @@ -458,7 +467,37 @@ */ "importMaxFileSize": 52428800, // 50 * 1024 * 1024 + /* + * From Etherpad 1.8.3 onwards import was restricted to authors who had + * content within the pad. + * + * This setting will override that restriction and allow any user to import + * without the requirement to add content to a pad. + * + * This setting is useful for when you use a plugin for authentication so you + * can already trust each user. + */ + "allowAnyoneToImport": false, + + /* + * From Etherpad 1.9.0 onwards, when Etherpad is in production mode commits from individual users are rate limited + * + * The default is to allow at most 10 changes per IP in a 1 second window. + * After that the change is rejected. + * + * See https://github.com/animir/node-rate-limiter-flexible/wiki/Overall-example#websocket-single-connection-prevent-flooding for more options + */ + "commitRateLimiting": { + // duration of the rate limit window (seconds) + "duration": 1, + + // maximum number of chanes per IP to allow during the rate limit window + "points": 10 + }, + + + /* * Toolbar buttons configuration. * * Uncomment to customize. @@ -550,5 +589,8 @@ */ ] - } // logconfig + }, // logconfig + + /* Override any strings found in locale directories */ + "customLocaleStrings": {} } Index: lams_build/conf/etherpad/etherpad-lite/src/static/js/pad.js =================================================================== diff -u -rfc9e5a52a60f07e8ea0488ad1a39791939f061ca -r323395f54fbda641b4ca15ccfe6849b52f6be25d --- lams_build/conf/etherpad/etherpad-lite/src/static/js/pad.js (.../pad.js) (revision fc9e5a52a60f07e8ea0488ad1a39791939f061ca) +++ lams_build/conf/etherpad/etherpad-lite/src/static/js/pad.js (.../pad.js) (revision 323395f54fbda641b4ca15ccfe6849b52f6be25d) @@ -29,7 +29,6 @@ require('./jquery'); require('./farbtastic'); require('./excanvas'); -JSON = require('./json2'); var chat = require('./chat').chat; var getCollabClient = require('./collab_client').getCollabClient; @@ -74,15 +73,15 @@ var getParameters = [ { name: "noColors", checkVal: "true", callback: function(val) { settings.noColors = true; $('#clearAuthorship').hide(); } }, { name: "showControls", checkVal: "true", callback: function(val) { $('#editbar').css('display', 'flex') } }, - { name: "showChat", checkVal: "true", callback: function(val) { $('#chaticon').show(); } }, - { name: "showLineNumbers", checkVal: null, callback: function(val) { settings.LineNumbersDisabled = val == 'false'; } }, + { name: "showChat", checkVal: null, callback: function(val) { if(val==="false"){settings.hideChat = true;chat.hide();$('#chaticon').hide();} } }, + { name: "showLineNumbers", checkVal: "false", callback: function(val) { settings.LineNumbersDisabled = true; } }, { name: "useMonospaceFont", checkVal: "true", callback: function(val) { settings.useMonospaceFontGlobal = true; } }, // If the username is set as a parameter we should set a global value that we can call once we have initiated the pad. { name: "userName", checkVal: null, callback: function(val) { settings.globalUserName = decodeURIComponent(val); clientVars.userName = decodeURIComponent(val); } }, // If the userColor is set as a parameter, set a global value to use once we have initiated the pad. { name: "userColor", checkVal: null, callback: function(val) { settings.globalUserColor = decodeURIComponent(val); clientVars.userColor = decodeURIComponent(val); } }, { name: "rtl", checkVal: "true", callback: function(val) { settings.rtlIsTrue = true } }, - { name: "alwaysShowChat", checkVal: "true", callback: function(val) { chat.stickToScreen(); } }, + { name: "alwaysShowChat", checkVal: "true", callback: function(val) { if(!settings.hideChat) chat.stickToScreen(); } }, { name: "chatAndUsers", checkVal: "true", callback: function(val) { chat.chatAndUsers(); } }, { name: "lang", checkVal: null, callback: function(val) { window.html10n.localize([val, 'en']); createCookie('language', val); } } ]; @@ -92,7 +91,7 @@ // Tries server enforced options first.. for(var i = 0; i < getParameters.length; i++) { - var setting = getParameters[i]; + var setting = getParameters[i]; var value = clientVars.padOptions[setting.name]; if(value.toString() === setting.checkVal) { @@ -157,7 +156,8 @@ createCookie("token", token, 60); } - var sessionID = decodeURIComponent(readCookie("sessionID")); + var encodedSessionID = readCookie('sessionID'); + var sessionID = encodedSessionID == null ? null : decodeURIComponent(encodedSessionID); var password = readCookie("password"); var msg = { @@ -173,8 +173,20 @@ //this is a reconnect, lets tell the server our revisionnumber if(isReconnect == true) { + // Hammer approach for now. This is obviously wrong and needs a proper fix + // TODO: See https://github.com/ether/etherpad-lite/issues/3830 + document.location=document.location; + + // Switching to pad should work but doesn't... + // return pad.switchToPad(padId); // hacky but whatever. + // It might be related to Auth because failure logs... + // [ERROR] console - Auth was never applied to a session. + // If you are using the stress-test tool then restart Etherpad + // and the Stress test tool. + msg.client_rev=pad.collabClient.getCurrentRevisionNumber(); msg.reconnect=true; + } socket.json.send(msg); @@ -265,9 +277,6 @@ //if we haven't recieved the clientVars yet, then this message should it be else if (!receivedClientVars && obj.type == "CLIENT_VARS") { - //log the message - if (window.console) console.log(obj); - receivedClientVars = true; //set some client vars @@ -286,6 +295,8 @@ $('#chaticon').hide(); $('#options-chatandusers').parent().hide(); $('#options-stickychat').parent().hide(); + }else{ + if(!settings.hideChat) $('#chaticon').show(); } $("body").addClass(clientVars.readonly ? "readonly" : "readwrite") @@ -338,8 +349,6 @@ //this message advices the client to disconnect if (obj.disconnect) { - console.warn("FORCED TO DISCONNECT"); - console.warn(obj); padconnectionstatus.disconnected(obj.disconnect); socket.disconnect(); @@ -422,16 +431,27 @@ }, switchToPad: function(padId) { + var newHref = new RegExp(/.*\/p\/[^\/]+/).exec(document.location.pathname) || clientVars.padId; + newHref = newHref[0]; + + var options = clientVars.padOptions; + if (typeof options != "undefined" && options != null) + { + var option_str = []; + $.each(options, function(k,v) { + var str = k + "=" + v; + option_str.push(str); + }); + var option_str = option_str.join("&"); + + newHref = newHref + '?' + option_str; + } + // destroy old pad from DOM // See https://github.com/ether/etherpad-lite/pull/3915 // TODO: Check if Destroying is enough and doesn't leave negative stuff // See ace.js "editor.destroy" for a reference of how it was done before $('#editorcontainer').find("iframe")[0].remove(); - var options = document.location.href.split('?')[1]; - var newHref = padId; - if (typeof options != "undefined" && options != null){ - newHref = newHref + '?' + options; - } if(window.history && window.history.pushState) { @@ -465,11 +485,6 @@ // This will check if the prefs-cookie is set. // Otherwise it shows up a message to the user. padcookie.init(); - if (!padcookie.isCookiesEnabled()) - { - $('#loading').hide(); - $('#noCookie').show(); - } }); }, _afterHandshake: function() @@ -737,10 +752,15 @@ if (newState == "CONNECTED") { padeditor.enable(); + padeditbar.enable(); + padimpexp.enable(); padconnectionstatus.connected(); } else if (newState == "RECONNECTING") { + padeditor.disable(); + padeditbar.disable(); + padimpexp.disable(); padconnectionstatus.reconnecting(); } else if (newState == "DISCONNECTED") Index: lams_build/conf/etherpad/etherpad-lite/src/static/js/pad_userlist.js =================================================================== diff -u -r68fc7659b76cba8c48bbfaa1a777fba0cd3cf3d5 -r323395f54fbda641b4ca15ccfe6849b52f6be25d --- lams_build/conf/etherpad/etherpad-lite/src/static/js/pad_userlist.js (.../pad_userlist.js) (revision 68fc7659b76cba8c48bbfaa1a777fba0cd3cf3d5) +++ lams_build/conf/etherpad/etherpad-lite/src/static/js/pad_userlist.js (.../pad_userlist.js) (revision 323395f54fbda641b4ca15ccfe6849b52f6be25d) @@ -483,7 +483,7 @@ }); } */ - + // color picker $("#myswatchbox").click(showColorPicker); $("#mycolorpicker .pickerswatchouter").click(function() @@ -735,7 +735,7 @@ } else { - $("#myusernameedit").addClass("editempty").val(_("pad.userlist.entername")); + $("#myusernameedit").attr("placeholder", html10n.get("pad.userlist.entername")); } if (colorPickerOpen) { Index: lams_build/conf/etherpad/readme.txt =================================================================== diff -u -r749827b9ad1f4765f25eaf4d0a85eab3ffbac2f4 -r323395f54fbda641b4ca15ccfe6849b52f6be25d --- lams_build/conf/etherpad/readme.txt (.../readme.txt) (revision 749827b9ad1f4765f25eaf4d0a85eab3ffbac2f4) +++ lams_build/conf/etherpad/readme.txt (.../readme.txt) (revision 323395f54fbda641b4ca15ccfe6849b52f6be25d) @@ -1,7 +1,7 @@ Etherpad is required for Dokumaran tool and for Etherpad tag -1) Modifications are required for Etherpad server version 1.8.4, available at - https://github.com/ether/etherpad-lite/tree/1.8.4 +1) Modifications are required for Etherpad server version 1.8.6, available at + https://github.com/ether/etherpad-lite/tree/1.8.6 2) Install ep_resize plugin https://github.com/tiblu/ep_resize @@ -13,11 +13,15 @@ Besides, one can turn on "editOnly" option in /${etherpad-lite-server-folder}/settings.json. This option's description: "Users may edit pads but not create new ones. Pad creation is only via the API. This applies both to group pads and regular pads." 5) Other plugins (optional): - adminpads: Gives the ability to list and administrate all pads on admin page 0.0.12 - authornames: Adds author names to span titles (shows on hover) in etherpad-lite 0.1.3 - authorship_toggle: Toggle authorship colors on and off. 0.0.3 - export_authors: Etherpad plugin to add author information to the html export 0.1.1 - stats: See pad Stats in Etherpad 0.0.4 + adminpads2: plugin to list and delete pads in /admin 2.1.16 + authornames: Adds author names to span titles (shows on hover) 0.2.0 + author_neat: Neat author display 0.0.31 + comments_page: Adds comments on sidebar and link it to the text 0.1.27 + export_authors: Etherpad plugin to add author information to the html export 0.1.1 + headings2: Adds heading support 0.1.15 + message_all: Use the Etherpad admin backend to send a message to all connected users 1.1.0 + tables4: Insert tables into your Etherpad documents 1.0.5 + stats: See pad Stats 0.0.6 ----------Same domain policy---------