Index: lams_build/conf/etherpad/etherpad-lite/node_modules/ep_resize/static/js/index.js =================================================================== diff -u -r68a60b37cc8c4bd9372ebfdd67f612d94d0a057d -r6c35e7bbcc3c98e9e3a1c31a367c44cb87bdf987 --- 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 6c35e7bbcc3c98e9e3a1c31a367c44cb87bdf987) @@ -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 -r6c35e7bbcc3c98e9e3a1c31a367c44cb87bdf987 --- lams_build/conf/etherpad/etherpad-lite/settings.json (.../settings.json) (revision 5d515ce1673823c66a63cfceb178b74f826d92a9) +++ lams_build/conf/etherpad/etherpad-lite/settings.json (.../settings.json) (revision 6c35e7bbcc3c98e9e3a1c31a367c44cb87bdf987) @@ -403,14 +403,22 @@ * WARNING: passwords should not be stored in plaintext in this file. * If you want to mitigate this, please install ep_hash_auth and * 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 +466,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. @@ -485,6 +523,7 @@ ["timeslider_export", "timeslider_returnToPad"] ] }, + /* * Expose Etherpad version in the web interface and in the Server http header. @@ -550,5 +589,8 @@ */ ] - } // logconfig + }, // logconfig + + /* Override any strings found in locale directories */ + "customLocaleStrings": {} } Index: lams_build/conf/etherpad/etherpad-lite/src/node/db/AuthorManager.js =================================================================== diff -u -re43f0bd30b5df2f0c65f7cb75474c76ef253b39a -r6c35e7bbcc3c98e9e3a1c31a367c44cb87bdf987 --- lams_build/conf/etherpad/etherpad-lite/src/node/db/AuthorManager.js (.../AuthorManager.js) (revision e43f0bd30b5df2f0c65f7cb75474c76ef253b39a) +++ lams_build/conf/etherpad/etherpad-lite/src/node/db/AuthorManager.js (.../AuthorManager.js) (revision 6c35e7bbcc3c98e9e3a1c31a367c44cb87bdf987) @@ -22,7 +22,7 @@ var customError = require("../utils/customError"); var randomString = require('ep_etherpad-lite/static/js/pad_utils').randomString; -exports.getColorPalette = function(){ +exports.getColorPalette = function() { //*LAMS* modified the following array: replaced dark colors with the more lighter ones return ["#ffc7c7", "#fff1c7", "#e3ffc7", "#c7ffd5", "#c7ffff", "#c7d5ff", "#e3c7ff", "#ffc7f1", "#ff8f8f", "#ffe38f", "#c7ff8f", "#8fffab", "#8fffff", "#8fabff", "#c78fff", "#ff8fe3", "#ecbcbc", "#d9c179", "#a9d979", "#79d991", "#79d9d9", "#bcc8ec", "#dcc9ef", "#efc9e6", "#d9a9a9", "#d9cda9", "#c1d9a9", "#a9d9b5", "#a9d9d9", "#a9b5d9", "#c1a9d9", "#d9a9cd", "#c9e1d9", "#12d1ad", "#d5e8e5", "#d5daed", "#a091c7", "#c1dae5", "#e0d0f0", "#e6e76d", "#e3bfd0", "#f386e5", "#4ecc0c", "#c0c236", "#d2c1bd", "#b5de6a", "#9b88fd", "#c2dde1", "#c8d3c0", "#e267fe", "#f1c0cc", "#babad0", "#cde3c2", "#f7d2f1", "#86dc6c", "#b5a714", "#dfcdd2", "#ebd4e6", "#4b81c8", "#c4d2cd", "#c6c9b9", "#d16084", "#efe1ce", "#8c8bd8"]; }; Index: lams_build/conf/etherpad/etherpad-lite/src/static/js/pad.js =================================================================== diff -u -rfc9e5a52a60f07e8ea0488ad1a39791939f061ca -r6c35e7bbcc3c98e9e3a1c31a367c44cb87bdf987 --- 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 6c35e7bbcc3c98e9e3a1c31a367c44cb87bdf987) @@ -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: "showChat", checkVal: null, callback: function(val) { if(val==="false"){settings.hideChat = true;chat.hide();$('#chaticon').hide();} } }, { name: "showLineNumbers", checkVal: null, callback: function(val) { settings.LineNumbersDisabled = val == 'false'; } }, { 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) { @@ -173,8 +172,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); @@ -210,6 +221,7 @@ }); socket.on('reconnecting', function() { + padeditor.disable(); pad.collabClient.setStateIdle(); pad.collabClient.setIsPendingRevision(true); pad.collabClient.setChannelState("RECONNECTING"); @@ -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() Index: lams_build/conf/etherpad/etherpad-lite/src/static/js/pad_userlist.js =================================================================== diff -u -r68fc7659b76cba8c48bbfaa1a777fba0cd3cf3d5 -r6c35e7bbcc3c98e9e3a1c31a367c44cb87bdf987 --- 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 6c35e7bbcc3c98e9e3a1c31a367c44cb87bdf987) @@ -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) {