From 63c65f784ba2b9bb3bd1f088e97f4112128d1075 Mon Sep 17 00:00:00 2001
From: John McLear
Date: Mon, 19 Jan 2015 01:45:49 +0000
Subject: [PATCH 01/19] semi working example
---
src/locales/en.json | 1 +
src/static/css/pad.css | 11 +++++++++++
src/static/js/chat.js | 14 ++++++++++++++
src/static/js/pad.js | 15 +++++++++++++++
src/templates/pad.html | 4 ++++
5 files changed, 45 insertions(+)
diff --git a/src/locales/en.json b/src/locales/en.json
index 7f5846fd2..de309ba1b 100644
--- a/src/locales/en.json
+++ b/src/locales/en.json
@@ -32,6 +32,7 @@
"pad.settings.padSettings": "Pad Settings",
"pad.settings.myView": "My View",
"pad.settings.stickychat": "Chat always on screen",
+ "pad.settings.chatAndUsers": "Show Chat and Users",
"pad.settings.colorcheck": "Authorship colors",
"pad.settings.linenocheck": "Line numbers",
"pad.settings.rtlcheck": "Read content from right to left?",
diff --git a/src/static/css/pad.css b/src/static/css/pad.css
index 4ba9f5750..1b6482065 100644
--- a/src/static/css/pad.css
+++ b/src/static/css/pad.css
@@ -914,6 +914,17 @@ input[type=checkbox] {
border-left: 1px solid #ccc !important;
width: 185px !important;
}
+.chatAndUsers{
+ display:block !important;
+ right:0px !important;
+ border-radius:0px !important;
+ height:185px !important;
+ width:180px !important;
+}
+.chatAndUsersChat{
+ top:300px !important;
+}
+
@media screen and (max-width: 600px) {
.toolbar ul li.separator {
display: none;
diff --git a/src/static/js/chat.js b/src/static/js/chat.js
index 4cbbbaa78..82ca15bdc 100644
--- a/src/static/js/chat.js
+++ b/src/static/js/chat.js
@@ -54,6 +54,20 @@ var chat = (function()
isStuck = false;
}
},
+ chatAndUsers: function(status){
+ if(status || $('#options-chatandusers').prop('checked')){
+ padcookie.setPref("chatAndUsers", true);
+ chat.stickToScreen(true);
+ $('#options-stickychat').prop("disabled", "disabled");
+ $('#users').addClass("chatAndUsers");
+ $("#chatbox").addClass("chatAndUsersChat");
+ }else{
+ chat.stickToScreen(false);
+ $('#options-stickychat').prop("disabled", false);
+ $('#users').removeClass("chatAndUsers");
+ $("#chatbox").removeClass("chatAndUsersChat");
+ }
+ },
hide: function ()
{
// decide on hide logic based on chat window being maximized or not
diff --git a/src/static/js/pad.js b/src/static/js/pad.js
index ff62f86cc..5b1736422 100644
--- a/src/static/js/pad.js
+++ b/src/static/js/pad.js
@@ -120,6 +120,7 @@ var getParameters = [
{ name: "userColor", checkVal: null, callback: function(val) { settings.globalUserColor = decodeURIComponent(val); } },
{ name: "rtl", checkVal: "true", callback: function(val) { settings.rtlIsTrue = true } },
{ name: "alwaysShowChat", checkVal: "true", callback: function(val) { chat.stickToScreen(); } },
+ { name: "chatAndUsers", checkVal: "true", callback: function(val) { chat.chatAndUsers(); } },
{ name: "lang", checkVal: null, callback: function(val) { window.html10n.localize([val, 'en']); } }
];
@@ -562,6 +563,10 @@ var pad = {
chat.stickToScreen(true); // stick it to the screen
$('#options-stickychat').prop("checked", true); // set the checkbox to on
}
+ if(padcookie.getPref("chatAndUsers")){ // if we have a cookie for always showing chat then show it
+ chat.chatAndUsers(true); // stick it to the screen
+ $('#options-chatandusers').prop("checked", true); // set the checkbox to on
+ }
if(padcookie.getPref("showAuthorshipColors") == false){
pad.changeViewOption('showAuthorColors', false);
}
@@ -791,6 +796,16 @@ var pad = {
$('#options-stickychat').prop("checked", false); // set the checkbox for off
}
},
+ determineChatAndUsersVisibility: function(){
+ var chatAUVisCookie = padcookie.getPref('chatAndUsersVisible');
+ if(chatAUVisCookie){ // if the cookie is set for chat always visible
+ chat.chatAndUsers(true); // stick it to the screen
+ $('#options-chatandusers').prop("checked", true); // set the checkbox to on
+ }
+ else{
+ $('#options-chatandusers').prop("checked", false); // set the checkbox for off
+ }
+ },
determineAuthorshipColorsVisibility: function(){
var authColCookie = padcookie.getPref('showAuthorshipColors');
if (authColCookie){
diff --git a/src/templates/pad.html b/src/templates/pad.html
index ce1ea2188..48b46c410 100644
--- a/src/templates/pad.html
+++ b/src/templates/pad.html
@@ -133,6 +133,10 @@
+
+
+
+
From 13eff60dfea7b5ddcca15f9c4c4adab18c3e7dfe Mon Sep 17 00:00:00 2001
From: John McLear
Date: Mon, 19 Jan 2015 02:13:34 +0000
Subject: [PATCH 02/19] mheh I suck at css 0ip would do a way better job of
this
---
src/static/css/pad.css | 19 ++++++++++++++++---
1 file changed, 16 insertions(+), 3 deletions(-)
diff --git a/src/static/css/pad.css b/src/static/css/pad.css
index 1b6482065..0ecf91f05 100644
--- a/src/static/css/pad.css
+++ b/src/static/css/pad.css
@@ -918,11 +918,24 @@ input[type=checkbox] {
display:block !important;
right:0px !important;
border-radius:0px !important;
- height:185px !important;
- width:180px !important;
+ height:200px !important;
+ width:182px !important;
+ margin:2px 0 0 0 !important;
+ border: none !important;
+ border-bottom: 1px solid #ccc !important;
+}
+.chatAndUsersChat > div > #titlecross{
+ display:none;
}
.chatAndUsersChat{
- top:300px !important;
+ bottom:0px !important;
+ padding:0 !important;
+ margin:0 !important;
+ right:0 !important;
+ top: 315px !important;
+ width:182px !important;
+ border: none !important;
+ padding:5px !important;
}
@media screen and (max-width: 600px) {
From eacf1118f86fa0bf489fa86f65b970347f45077a Mon Sep 17 00:00:00 2001
From: John McLear
Date: Wed, 21 Jan 2015 02:55:03 +0000
Subject: [PATCH 03/19] blind attempt to try
---
src/static/js/ace2_inner.js | 20 ++++++++------------
src/static/js/contentcollector.js | 3 ++-
src/static/js/domline.js | 4 ++--
3 files changed, 12 insertions(+), 15 deletions(-)
diff --git a/src/static/js/ace2_inner.js b/src/static/js/ace2_inner.js
index bd1f0053f..d2952ffe3 100644
--- a/src/static/js/ace2_inner.js
+++ b/src/static/js/ace2_inner.js
@@ -34,8 +34,9 @@ var isNodeText = Ace2Common.isNodeText,
binarySearchInfinite = Ace2Common.binarySearchInfinite,
htmlPrettyEscape = Ace2Common.htmlPrettyEscape,
noop = Ace2Common.noop;
- var hooks = require('./pluginfw/hooks');
- var browser = require('./browser').browser;
+
+var hooks = require('./pluginfw/hooks');
+var browser = require('./browser').browser;
function Ace2Inner(){
@@ -944,7 +945,7 @@ function Ace2Inner(){
showslinenumbers : function(value){
hasLineNumbers = !! value;
// disable line numbers on mobile devices
- if (browser.mobile) hasLineNumbers = false;
+ // if (browser.mobile) hasLineNumbers = false;
setClassPresence(sideDiv, "sidedivhidden", !hasLineNumbers);
fixView();
},
@@ -1605,7 +1606,7 @@ function Ace2Inner(){
if (linesWrapped > 0)
{
- if(!browser.ie){
+ if(!browser.msie){
// chrome decides in it's infinite wisdom that its okay to put the browsers visisble window in the middle of the span
// an outcome of this is that the first chars of the string are no longer visible to the user.. Yay chrome..
// Move the browsers visible area to the left hand side of the span
@@ -2964,6 +2965,7 @@ function Ace2Inner(){
}
else
{
+ // cake
return domline.createDomLine(nonEmpty, doesWrap, browser, doc);
}
}
@@ -3583,7 +3585,7 @@ function Ace2Inner(){
// On Mac and Linux, move right moves to end of word and move left moves to start;
// on Windows, always move to start of word.
// On Windows, Firefox and IE disagree on whether to stop for punctuation (FF says no).
- if (browser.windows && forwardNotBack)
+ if (browser.msie && forwardNotBack)
{
while ((!isDone()) && isWordChar(nextChar()))
{
@@ -4264,12 +4266,6 @@ function Ace2Inner(){
end.collapse(false);
selection.startPoint = pointFromCollapsedRange(start);
selection.endPoint = pointFromCollapsedRange(end);
-/*if ((!selection.startPoint.node.isText) && (!selection.endPoint.node.isText)) {
- console.log(selection.startPoint.node.uniqueId()+","+
- selection.startPoint.index+" / "+
- selection.endPoint.node.uniqueId()+","+
- selection.endPoint.index);
-}*/
}
return selection;
}
@@ -4867,7 +4863,7 @@ function Ace2Inner(){
})
// CompositionEvent is not implemented below IE version 8
- if ( !(browser.msie && browser.version < 9) && document.documentElement)
+ if ( !(browser.msie && browser.version <= 9) && document.documentElement)
{
$(document.documentElement).on("compositionstart", handleCompositionEvent);
$(document.documentElement).on("compositionend", handleCompositionEvent);
diff --git a/src/static/js/contentcollector.js b/src/static/js/contentcollector.js
index b7b3c568b..7a6deeb11 100644
--- a/src/static/js/contentcollector.js
+++ b/src/static/js/contentcollector.js
@@ -37,7 +37,8 @@ function sanitizeUnicode(s)
function makeContentCollector(collectStyles, browser, apool, domInterface, className2Author)
{
- browser = browser || {};
+ // browser = browser || {};
+ // I don't like the above.
var dom = domInterface || {
isNodeText: function(n)
diff --git a/src/static/js/domline.js b/src/static/js/domline.js
index b1927b162..e793956b5 100644
--- a/src/static/js/domline.js
+++ b/src/static/js/domline.js
@@ -65,7 +65,7 @@ domline.createDomLine = function(nonEmpty, doesWrap, optBrowser, optDocument)
lineMarker: 0
};
- var browser = (optBrowser || {});
+ // var browser = (optBrowser || {});
var document = optDocument;
if (document)
@@ -225,7 +225,7 @@ domline.createDomLine = function(nonEmpty, doesWrap, optBrowser, optDocument)
{
newHTML += ' ';
}
- else if (!browser.msie)
+ else if (!optBrowser.msie)
{
newHTML += ' ';
}
From 34d6b31c983475e7bf222a593e937fdee796788d Mon Sep 17 00:00:00 2001
From: John McLear
Date: Wed, 21 Jan 2015 13:24:21 +0000
Subject: [PATCH 04/19] some sanity
---
src/static/js/ace2_inner.js | 93 ++++++++++++++++------------------
src/static/js/broadcast.js | 12 -----
src/static/js/collab_client.js | 2 +-
src/static/js/pad.js | 3 +-
4 files changed, 47 insertions(+), 63 deletions(-)
diff --git a/src/static/js/ace2_inner.js b/src/static/js/ace2_inner.js
index d2952ffe3..8adbc8dcd 100644
--- a/src/static/js/ace2_inner.js
+++ b/src/static/js/ace2_inner.js
@@ -19,8 +19,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-var _, $, jQuery, plugins, Ace2Common;
-
+var _, $, jQuery, plugins, Ace2Common, mybrowser;
+mybrowser = require('./browser').browser;
Ace2Common = require('./ace2_common');
plugins = require('ep_etherpad-lite/static/js/pluginfw/client_plugins');
@@ -36,7 +36,6 @@ var isNodeText = Ace2Common.isNodeText,
noop = Ace2Common.noop;
var hooks = require('./pluginfw/hooks');
-var browser = require('./browser').browser;
function Ace2Inner(){
@@ -599,7 +598,7 @@ function Ace2Inner(){
// Chrome can't handle the truth.. If CSS rule white-space:pre-wrap
// is true then any paste event will insert two lines..
- if(browser.chrome){
+ if(mybrowser.chrome){
$("#innerdocbody").css({"white-space":"normal"});
}
@@ -945,7 +944,7 @@ function Ace2Inner(){
showslinenumbers : function(value){
hasLineNumbers = !! value;
// disable line numbers on mobile devices
- // if (browser.mobile) hasLineNumbers = false;
+ // if (mybrowser.mobile) hasLineNumbers = false;
setClassPresence(sideDiv, "sidedivhidden", !hasLineNumbers);
fixView();
},
@@ -1312,7 +1311,9 @@ function Ace2Inner(){
else
{
var offsetIntoLine = 0;
- var filteredFunc = linestylefilter.getFilterStack(text, textAndClassFunc, browser);
+mybrowser.msie = false; // cake 1
+ var filteredFunc = linestylefilter.getFilterStack(text, textAndClassFunc, mybrowser);
+mybrowser.msie = true;
var lineNum = rep.lines.indexOfEntry(lineEntry);
var aline = rep.alines[lineNum];
filteredFunc = linestylefilter.getLineStyleFilter(
@@ -1560,13 +1561,16 @@ function Ace2Inner(){
lastDirtyNode = (lastDirtyNode && isNodeDirty(lastDirtyNode) && lastDirtyNode);
if (firstDirtyNode && lastDirtyNode)
{
- var cc = makeContentCollector(isStyled, browser, rep.apool, null, className2Author);
+// cake 2
+mybrowser.msie = false;
+ var cc = makeContentCollector(isStyled, mybrowser, rep.apool, null, className2Author);
+mybrowser.msie = true;
cc.notifySelection(selection);
var dirtyNodes = [];
for (var n = firstDirtyNode; n && !(n.previousSibling && n.previousSibling == lastDirtyNode);
n = n.nextSibling)
{
- if (browser.msie)
+ if (mybrowser.msie)
{
// try to undo IE's pesky and overzealous linkification
try
@@ -1606,7 +1610,7 @@ function Ace2Inner(){
if (linesWrapped > 0)
{
- if(!browser.msie){
+ if(!mybrowser.msie){
// chrome decides in it's infinite wisdom that its okay to put the browsers visisble window in the middle of the span
// an outcome of this is that the first chars of the string are no longer visible to the user.. Yay chrome..
// Move the browsers visible area to the left hand side of the span
@@ -1911,7 +1915,7 @@ function Ace2Inner(){
if (charsLeft === 0)
{
var index = 0;
- if (browser.msie && line == (rep.lines.length() - 1) && lineNode.childNodes.length === 0)
+ if (mybrowser.msie && line == (rep.lines.length() - 1) && lineNode.childNodes.length === 0)
{
// best to stay at end of last empty div in IE
index = 1;
@@ -2904,7 +2908,7 @@ function Ace2Inner(){
function doCreateDomLine(nonEmpty)
{
- if (browser.msie && (!nonEmpty))
+ if (mybrowser.msie && (!nonEmpty))
{
var result = {
node: null,
@@ -2965,8 +2969,10 @@ function Ace2Inner(){
}
else
{
- // cake
- return domline.createDomLine(nonEmpty, doesWrap, browser, doc);
+ // cake 3
+mybrowser.msie = false;
+ return domline.createDomLine(nonEmpty, doesWrap, mybrowser, doc);
+mybrowser.msie = true;
}
}
@@ -3233,7 +3239,7 @@ function Ace2Inner(){
var dirtiness = {};
dirtiness.nodeId = uniqueId(n);
dirtiness.knownHTML = n.innerHTML;
- if (browser.msie)
+ if (mybrowser.msie)
{
// adding a space to an "empty" div in IE designMode doesn't
// change the innerHTML of the div's parent; also, other
@@ -3250,7 +3256,7 @@ function Ace2Inner(){
var data = getAssoc(n, "dirtiness");
if (!data) return true;
if (n.id !== data.nodeId) return true;
- if (browser.msie)
+ if (mybrowser.msie)
{
if (n.innerText !== data.knownText) return true;
}
@@ -3585,7 +3591,7 @@ function Ace2Inner(){
// On Mac and Linux, move right moves to end of word and move left moves to start;
// on Windows, always move to start of word.
// On Windows, Firefox and IE disagree on whether to stop for punctuation (FF says no).
- if (browser.msie && forwardNotBack)
+ if (mybrowser.msie && forwardNotBack)
{
while ((!isDone()) && isWordChar(nextChar()))
{
@@ -3657,13 +3663,13 @@ function Ace2Inner(){
if (isModKey) return;
// If the key is a keypress and the browser is opera and the key is enter, do nothign at all as this fires twice.
- if (keyCode == 13 && browser.opera && (type == "keypress")){
+ if (keyCode == 13 && mybrowser.opera && (type == "keypress")){
return; // This stops double enters in Opera but double Tabs still show on single tab keypress, adding keyCode == 9 to this doesn't help as the event is fired twice
}
var specialHandled = false;
- var isTypeForSpecialKey = ((browser.msie || browser.safari || browser.chrome) ? (type == "keydown") : (type == "keypress"));
- var isTypeForCmdKey = ((browser.msie || browser.safari || browser.chrome) ? (type == "keydown") : (type == "keypress"));
+ var isTypeForSpecialKey = ((mybrowser.msie || mybrowser.safari || mybrowser.chrome) ? (type == "keydown") : (type == "keypress"));
+ var isTypeForCmdKey = ((mybrowser.msie || mybrowser.safari || mybrowser.chrome) ? (type == "keydown") : (type == "keypress"));
var stopped = false;
@@ -3880,7 +3886,7 @@ function Ace2Inner(){
/* Attempt to apply some sanity to cursor handling in Chrome after a copy / paste event
We have to do this the way we do because rep. doesn't hold the value for keyheld events IE if the user
presses and holds the arrow key .. Sorry if this is ugly, blame Chrome's weird handling of viewports after new content is added*/
- if((evt.which == 37 || evt.which == 38 || evt.which == 39 || evt.which == 40) && browser.chrome){
+ if((evt.which == 37 || evt.which == 38 || evt.which == 39 || evt.which == 40) && mybrowser.chrome){
var viewport = getViewPortTopBottom();
var myselection = document.getSelection(); // get the current caret selection, can't use rep. here because that only gives us the start position not the current
var caretOffsetTop = myselection.focusNode.parentNode.offsetTop || myselection.focusNode.offsetTop; // get the carets selection offset in px IE 214
@@ -3951,10 +3957,10 @@ function Ace2Inner(){
}
// Is part of multi-keystroke international character on Firefox Mac
- var isFirefoxHalfCharacter = (browser.mozilla && evt.altKey && charCode === 0 && keyCode === 0);
+ var isFirefoxHalfCharacter = (mybrowser.firefox && evt.altKey && charCode === 0 && keyCode === 0);
// Is part of multi-keystroke international character on Safari Mac
- var isSafariHalfCharacter = (browser.safari && evt.altKey && keyCode == 229);
+ var isSafariHalfCharacter = (mybrowser.safari && evt.altKey && keyCode == 229);
if (thisKeyDoesntTriggerNormalize || isFirefoxHalfCharacter || isSafariHalfCharacter)
{
@@ -4068,7 +4074,7 @@ function Ace2Inner(){
// each of which has node (a magicdom node), index, and maxIndex. If the node
// is a text node, maxIndex is the length of the text; else maxIndex is 1.
// index is between 0 and maxIndex, inclusive.
- if (browser.msie)
+ if (mybrowser.msie)
{
var browserSelection;
try
@@ -4364,7 +4370,7 @@ function Ace2Inner(){
maxIndex: pt.maxIndex
};
}
- if (browser.msie)
+ if (mybrowser.msie)
{
// Oddly enough, accessing scrollHeight fixes return key handling on IE 8,
// presumably by forcing some kind of internal DOM update.
@@ -4653,17 +4659,17 @@ function Ace2Inner(){
for (var i = 0; i < 2; i++)
{
var newHeight = root.clientHeight;
- var newWidth = (browser.msie ? root.createTextRange().boundingWidth : root.clientWidth);
+ var newWidth = root.clientWidth;
var viewHeight = getInnerHeight() - iframePadBottom - iframePadTop;
var viewWidth = getInnerWidth() - iframePadLeft - iframePadRight;
if (newHeight < viewHeight)
{
newHeight = viewHeight;
- if (browser.msie) setIfNecessary(outerWin.document.documentElement.style, 'overflowY', 'auto');
+// if (mybrowser.msie) setIfNecessary(outerWin.document.documentElement.style, 'overflowY', 'auto');
}
else
{
- if (browser.msie) setIfNecessary(outerWin.document.documentElement.style, 'overflowY', 'scroll');
+// if (mybrowser.msie) setIfNecessary(outerWin.document.documentElement.style, 'overflowY', 'scroll');
}
if (doesWrap)
{
@@ -4677,7 +4683,7 @@ function Ace2Inner(){
setIfNecessary(iframe.style, "width", newWidth + "px");
setIfNecessary(sideDiv.style, "height", newHeight + "px");
}
- if (browser.mozilla)
+ if (mybrowser.firefox)
{
if (!doesWrap)
{
@@ -4776,14 +4782,14 @@ function Ace2Inner(){
}
return false;
}
- if (browser.msie || browser.safari)
+ if (mybrowser.msie || mybrowser.safari)
{
setIfNecessary(root, 'contentEditable', (newVal ? 'true' : 'false'));
}
else
{
var wasSet = setIfNecessary(doc, 'designMode', (newVal ? 'on' : 'off'));
- if (wasSet && newVal && browser.opera)
+ if (wasSet && newVal && mybrowser.opera)
{
// turning on designMode clears event handlers
bindTheEventHandlers();
@@ -4849,11 +4855,11 @@ function Ace2Inner(){
$(document).on("keyup", handleKeyEvent);
$(document).on("click", handleClick);
$(root).on("blur", handleBlur);
- if (browser.msie)
+ if (mybrowser.msie)
{
$(document).on("click", handleIEOuterClick);
}
- if (browser.msie) $(root).on("paste", handleIEPaste);
+ if (mybrowser.msie) $(root).on("paste", handleIEPaste);
// Don't paste on middle click of links
$(root).on("paste", function(e){
@@ -4863,7 +4869,7 @@ function Ace2Inner(){
})
// CompositionEvent is not implemented below IE version 8
- if ( !(browser.msie && browser.version <= 9) && document.documentElement)
+ if ( !(mybrowser.msie && mybrowser.version <= 9) && document.documentElement)
{
$(document.documentElement).on("compositionstart", handleCompositionEvent);
$(document.documentElement).on("compositionend", handleCompositionEvent);
@@ -4926,7 +4932,7 @@ function Ace2Inner(){
function handleBlur(evt)
{
- if (browser.msie)
+ if (mybrowser.msie)
{
// a fix: in IE, clicking on a control like a button outside the
// iframe can "blur" the editor, causing it to stop getting
@@ -4997,7 +5003,7 @@ function Ace2Inner(){
var win = outerWin;
var odoc = win.document;
var h;
- if (browser.opera) h = win.innerHeight;
+ if (mybrowser.opera) h = win.innerHeight;
else h = odoc.documentElement.clientHeight;
if (h) return h;
@@ -5326,20 +5332,9 @@ function Ace2Inner(){
{
var body = doc.getElementById("innerdocbody");
root = body; // defined as a var in scope outside
- if (browser.mozilla) $(root).addClass("mozilla");
- if (browser.safari) $(root).addClass("safari");
- if (browser.msie) $(root).addClass("msie");
- if (browser.msie)
- {
- // cache CSS background images
- try
- {
- doc.execCommand("BackgroundImageCache", false, true);
- }
- catch (e)
- { /* throws an error in some IE 6 but not others! */
- }
- }
+ if (mybrowser.firefox) $(root).addClass("mozilla");
+ if (mybrowser.safari) $(root).addClass("safari");
+ if (mybrowser.msie) $(root).addClass("msie");
setClassPresence(root, "authorColors", true);
setClassPresence(root, "doesWrap", doesWrap);
diff --git a/src/static/js/broadcast.js b/src/static/js/broadcast.js
index a25d889b9..817155b55 100644
--- a/src/static/js/broadcast.js
+++ b/src/static/js/broadcast.js
@@ -66,18 +66,6 @@ function loadBroadcastJS(socket, sendSocketMsg, fireWhenAllScriptsAreLoaded, Bro
}
}
- // for IE
- if (browser.msie)
- {
- try
- {
- document.execCommand("BackgroundImageCache", false, true);
- }
- catch (e)
- {}
- }
-
-
//var socket;
var channelState = "DISCONNECTED";
diff --git a/src/static/js/collab_client.js b/src/static/js/collab_client.js
index 6089f1972..8bc5020b1 100644
--- a/src/static/js/collab_client.js
+++ b/src/static/js/collab_client.js
@@ -82,7 +82,7 @@ function getCollabClient(ace2editor, serverVars, initialUserInfo, options, _pad)
{}
};
- if (browser.mozilla)
+ if (browser.firefox)
{
// Prevent "escape" from taking effect and canceling a comet connection;
// doesn't work if focus is on an iframe.
diff --git a/src/static/js/pad.js b/src/static/js/pad.js
index ff62f86cc..685b420b1 100644
--- a/src/static/js/pad.js
+++ b/src/static/js/pad.js
@@ -494,7 +494,8 @@ var pad = {
pad.initTime = +(new Date());
pad.padOptions = clientVars.initialOptions;
- if ((!browser.msie) && (!(browser.mozilla && browser.version.indexOf("1.8.") == 0)))
+console.log("pad", browser);
+ if ((!browser.msie) && (!(browser.firefox && browser.version.indexOf("1.8.") == 0)))
{
document.domain = document.domain; // for comet
}
From 990e14c9042cacd03ff16259b9140a28269678c9 Mon Sep 17 00:00:00 2001
From: John McLear
Date: Wed, 21 Jan 2015 14:25:24 +0000
Subject: [PATCH 05/19] working with a big hack
---
src/static/js/ace2_inner.js | 32 +++++++++++++++----------------
src/static/js/collab_client.js | 1 -
src/static/js/contentcollector.js | 10 +++++-----
src/static/js/domline.js | 3 ++-
src/static/js/linestylefilter.js | 6 +++---
5 files changed, 25 insertions(+), 27 deletions(-)
diff --git a/src/static/js/ace2_inner.js b/src/static/js/ace2_inner.js
index 8adbc8dcd..aa65ff958 100644
--- a/src/static/js/ace2_inner.js
+++ b/src/static/js/ace2_inner.js
@@ -21,6 +21,15 @@
*/
var _, $, jQuery, plugins, Ace2Common, mybrowser;
mybrowser = require('./browser').browser;
+
+if(mybrowser.msie){
+ // Honestly fuck IE royally.
+ // Basically every hack we have since V11 causes a problem
+ if(parseInt(mybrowser.version) >= 11){
+ delete mybrowser.msie;
+ mybrowser.firefox = true;
+ }
+}
Ace2Common = require('./ace2_common');
plugins = require('ep_etherpad-lite/static/js/pluginfw/client_plugins');
@@ -1311,9 +1320,7 @@ function Ace2Inner(){
else
{
var offsetIntoLine = 0;
-mybrowser.msie = false; // cake 1
var filteredFunc = linestylefilter.getFilterStack(text, textAndClassFunc, mybrowser);
-mybrowser.msie = true;
var lineNum = rep.lines.indexOfEntry(lineEntry);
var aline = rep.alines[lineNum];
filteredFunc = linestylefilter.getLineStyleFilter(
@@ -1355,7 +1362,7 @@ mybrowser.msie = true;
// (from how it looks in our representation) and record them in a way
// that can be used to "normalize" the document (apply the changes to our
// representation, and put the DOM in a canonical form).
- //top.console.log("observeChangesAroundNode(%o)", node);
+ // top.console.log("observeChangesAroundNode(%o)", node);
var cleanNode;
var hasAdjacentDirtyness;
if (!isNodeDirty(node))
@@ -1561,10 +1568,7 @@ mybrowser.msie = true;
lastDirtyNode = (lastDirtyNode && isNodeDirty(lastDirtyNode) && lastDirtyNode);
if (firstDirtyNode && lastDirtyNode)
{
-// cake 2
-mybrowser.msie = false;
var cc = makeContentCollector(isStyled, mybrowser, rep.apool, null, className2Author);
-mybrowser.msie = true;
cc.notifySelection(selection);
var dirtyNodes = [];
for (var n = firstDirtyNode; n && !(n.previousSibling && n.previousSibling == lastDirtyNode);
@@ -2964,15 +2968,11 @@ mybrowser.msie = true;
{
return "";
};
-
return result;
}
else
{
- // cake 3
-mybrowser.msie = false;
return domline.createDomLine(nonEmpty, doesWrap, mybrowser, doc);
-mybrowser.msie = true;
}
}
@@ -3632,7 +3632,6 @@ mybrowser.msie = true;
evt.preventDefault();
return;
}
-
// Is caret potentially hidden by the chat button?
var myselection = document.getSelection(); // get the current caret selection
var caretOffsetTop = myselection.focusNode.parentNode.offsetTop | myselection.focusNode.offsetTop; // get the carets selection offset in px IE 214
@@ -3669,8 +3668,7 @@ mybrowser.msie = true;
var specialHandled = false;
var isTypeForSpecialKey = ((mybrowser.msie || mybrowser.safari || mybrowser.chrome) ? (type == "keydown") : (type == "keypress"));
- var isTypeForCmdKey = ((mybrowser.msie || mybrowser.safari || mybrowser.chrome) ? (type == "keydown") : (type == "keypress"));
-
+ var isTypeForCmdKey = (type === "keydown")
var stopped = false;
inCallStackIfNecessary("handleKeyEvent", function()
@@ -3920,10 +3918,10 @@ mybrowser.msie = true;
// only move the viewport if we're at the bottom of the viewport, if we hit down any other time the viewport shouldn't change
// NOTE: This behavior only fires if Chrome decides to break the page layout after a paste, it's annoying but nothing I can do
var selection = getSelection();
- top.console.log("line #", rep.selStart[0]); // the line our caret is on
- top.console.log("firstvisible", visibleLineRange[0]); // the first visiblel ine
- top.console.log("lastVisible", visibleLineRange[1]); // the last visible line
- top.console.log(rep.selStart[0], visibleLineRange[1], rep.selStart[0], visibleLineRange[0]);
+ // top.console.log("line #", rep.selStart[0]); // the line our caret is on
+ // top.console.log("firstvisible", visibleLineRange[0]); // the first visiblel ine
+ // top.console.log("lastVisible", visibleLineRange[1]); // the last visible line
+ // top.console.log(rep.selStart[0], visibleLineRange[1], rep.selStart[0], visibleLineRange[0]);
var newY = viewport.top + lineHeight;
}
if(newY){
diff --git a/src/static/js/collab_client.js b/src/static/js/collab_client.js
index 8bc5020b1..e5c0ec8b2 100644
--- a/src/static/js/collab_client.js
+++ b/src/static/js/collab_client.js
@@ -81,7 +81,6 @@ function getCollabClient(ace2editor, serverVars, initialUserInfo, options, _pad)
onServerMessage: function()
{}
};
-
if (browser.firefox)
{
// Prevent "escape" from taking effect and canceling a comet connection;
diff --git a/src/static/js/contentcollector.js b/src/static/js/contentcollector.js
index 7a6deeb11..c39410b7c 100644
--- a/src/static/js/contentcollector.js
+++ b/src/static/js/contentcollector.js
@@ -35,9 +35,9 @@ function sanitizeUnicode(s)
return UNorm.nfc(s);
}
-function makeContentCollector(collectStyles, browser, apool, domInterface, className2Author)
+function makeContentCollector(collectStyles, abrowser, apool, domInterface, className2Author)
{
- // browser = browser || {};
+ abrowser = abrowser || {};
// I don't like the above.
var dom = domInterface || {
@@ -485,7 +485,7 @@ function makeContentCollector(collectStyles, browser, apool, domInterface, class
var cls = dom.nodeProp(node, "className");
var isPre = (tname == "pre");
- if ((!isPre) && browser.safari)
+ if ((!isPre) && abrowser.safari)
{
isPre = (styl && /\bwhite-space:\s*pre\b/i.exec(styl));
}
@@ -611,7 +611,7 @@ function makeContentCollector(collectStyles, browser, apool, domInterface, class
}
}
}
- if (!browser.msie)
+ if (!abrowser.msie)
{
_reachBlockPoint(node, 1, state);
}
@@ -627,7 +627,7 @@ function makeContentCollector(collectStyles, browser, apool, domInterface, class
}
}
- if (browser.msie)
+ if (abrowser.msie)
{
// in IE, a point immediately after a DIV appears on the next line
_reachBlockPoint(node, 1, state);
diff --git a/src/static/js/domline.js b/src/static/js/domline.js
index e793956b5..03f1b9c89 100644
--- a/src/static/js/domline.js
+++ b/src/static/js/domline.js
@@ -65,7 +65,6 @@ domline.createDomLine = function(nonEmpty, doesWrap, optBrowser, optDocument)
lineMarker: 0
};
- // var browser = (optBrowser || {});
var document = optDocument;
if (document)
@@ -93,8 +92,10 @@ domline.createDomLine = function(nonEmpty, doesWrap, optBrowser, optDocument)
var perTextNodeProcess = (doesWrap ? _.identity : processSpaces);
var perHtmlLineProcess = (doesWrap ? processSpaces : _.identity);
var lineClass = 'ace-line';
+
result.appendSpan = function(txt, cls)
{
+
var processedMarker = false;
// Handle lineAttributeMarker, if present
if (cls.indexOf(lineAttributeMarker) >= 0)
diff --git a/src/static/js/linestylefilter.js b/src/static/js/linestylefilter.js
index 675f19d02..17ab993b1 100644
--- a/src/static/js/linestylefilter.js
+++ b/src/static/js/linestylefilter.js
@@ -318,20 +318,20 @@ linestylefilter.textAndClassFuncSplitter = function(func, splitPointsOpt)
return spanHandler;
};
-linestylefilter.getFilterStack = function(lineText, textAndClassFunc, browser)
+linestylefilter.getFilterStack = function(lineText, textAndClassFunc, abrowser)
{
var func = linestylefilter.getURLFilter(lineText, textAndClassFunc);
var hookFilters = hooks.callAll("aceGetFilterStack", {
linestylefilter: linestylefilter,
- browser: browser
+ browser: abrowser
});
_.map(hookFilters ,function(hookFilter)
{
func = hookFilter(lineText, func);
});
- if (browser !== undefined && browser.msie)
+ if (abrowser !== undefined && abrowser.msie)
{
// IE7+ will take an e-mail address like and linkify it to foo@bar.com.
// We then normalize it back to text with no angle brackets. It's weird. So always
From ce40cacafaf220e4c075daa79240dd0263aeaa5d Mon Sep 17 00:00:00 2001
From: John McLear
Date: Wed, 21 Jan 2015 14:49:06 +0000
Subject: [PATCH 06/19] mheh looks fixed
---
src/static/js/ace2_inner.js | 78 ++++++++++++++++++-------------------
1 file changed, 39 insertions(+), 39 deletions(-)
diff --git a/src/static/js/ace2_inner.js b/src/static/js/ace2_inner.js
index aa65ff958..dd2f2b124 100644
--- a/src/static/js/ace2_inner.js
+++ b/src/static/js/ace2_inner.js
@@ -19,15 +19,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-var _, $, jQuery, plugins, Ace2Common, mybrowser;
-mybrowser = require('./browser').browser;
+var _, $, jQuery, plugins, Ace2Common, bowser;
+bowser = require('./browser').browser;
-if(mybrowser.msie){
+if(bowser.msie){
// Honestly fuck IE royally.
// Basically every hack we have since V11 causes a problem
- if(parseInt(mybrowser.version) >= 11){
- delete mybrowser.msie;
- mybrowser.firefox = true;
+ if(parseInt(bowser.version) >= 11){
+ delete bowser.msie;
+ bowser.chrome = true;
}
}
Ace2Common = require('./ace2_common');
@@ -607,7 +607,7 @@ function Ace2Inner(){
// Chrome can't handle the truth.. If CSS rule white-space:pre-wrap
// is true then any paste event will insert two lines..
- if(mybrowser.chrome){
+ if(bowser.chrome){
$("#innerdocbody").css({"white-space":"normal"});
}
@@ -953,7 +953,7 @@ function Ace2Inner(){
showslinenumbers : function(value){
hasLineNumbers = !! value;
// disable line numbers on mobile devices
- // if (mybrowser.mobile) hasLineNumbers = false;
+ // if (bowser.mobile) hasLineNumbers = false;
setClassPresence(sideDiv, "sidedivhidden", !hasLineNumbers);
fixView();
},
@@ -1320,7 +1320,7 @@ function Ace2Inner(){
else
{
var offsetIntoLine = 0;
- var filteredFunc = linestylefilter.getFilterStack(text, textAndClassFunc, mybrowser);
+ var filteredFunc = linestylefilter.getFilterStack(text, textAndClassFunc, bowser);
var lineNum = rep.lines.indexOfEntry(lineEntry);
var aline = rep.alines[lineNum];
filteredFunc = linestylefilter.getLineStyleFilter(
@@ -1568,13 +1568,13 @@ function Ace2Inner(){
lastDirtyNode = (lastDirtyNode && isNodeDirty(lastDirtyNode) && lastDirtyNode);
if (firstDirtyNode && lastDirtyNode)
{
- var cc = makeContentCollector(isStyled, mybrowser, rep.apool, null, className2Author);
+ var cc = makeContentCollector(isStyled, bowser, rep.apool, null, className2Author);
cc.notifySelection(selection);
var dirtyNodes = [];
for (var n = firstDirtyNode; n && !(n.previousSibling && n.previousSibling == lastDirtyNode);
n = n.nextSibling)
{
- if (mybrowser.msie)
+ if (bowser.msie)
{
// try to undo IE's pesky and overzealous linkification
try
@@ -1614,7 +1614,7 @@ function Ace2Inner(){
if (linesWrapped > 0)
{
- if(!mybrowser.msie){
+ if(!bowser.msie){
// chrome decides in it's infinite wisdom that its okay to put the browsers visisble window in the middle of the span
// an outcome of this is that the first chars of the string are no longer visible to the user.. Yay chrome..
// Move the browsers visible area to the left hand side of the span
@@ -1919,7 +1919,7 @@ function Ace2Inner(){
if (charsLeft === 0)
{
var index = 0;
- if (mybrowser.msie && line == (rep.lines.length() - 1) && lineNode.childNodes.length === 0)
+ if (bowser.msie && line == (rep.lines.length() - 1) && lineNode.childNodes.length === 0)
{
// best to stay at end of last empty div in IE
index = 1;
@@ -2912,7 +2912,7 @@ function Ace2Inner(){
function doCreateDomLine(nonEmpty)
{
- if (mybrowser.msie && (!nonEmpty))
+ if (bowser.msie && (!nonEmpty))
{
var result = {
node: null,
@@ -2972,7 +2972,7 @@ function Ace2Inner(){
}
else
{
- return domline.createDomLine(nonEmpty, doesWrap, mybrowser, doc);
+ return domline.createDomLine(nonEmpty, doesWrap, bowser, doc);
}
}
@@ -3239,7 +3239,7 @@ function Ace2Inner(){
var dirtiness = {};
dirtiness.nodeId = uniqueId(n);
dirtiness.knownHTML = n.innerHTML;
- if (mybrowser.msie)
+ if (bowser.msie)
{
// adding a space to an "empty" div in IE designMode doesn't
// change the innerHTML of the div's parent; also, other
@@ -3256,7 +3256,7 @@ function Ace2Inner(){
var data = getAssoc(n, "dirtiness");
if (!data) return true;
if (n.id !== data.nodeId) return true;
- if (mybrowser.msie)
+ if (bowser.msie)
{
if (n.innerText !== data.knownText) return true;
}
@@ -3591,7 +3591,7 @@ function Ace2Inner(){
// On Mac and Linux, move right moves to end of word and move left moves to start;
// on Windows, always move to start of word.
// On Windows, Firefox and IE disagree on whether to stop for punctuation (FF says no).
- if (mybrowser.msie && forwardNotBack)
+ if (bowser.msie && forwardNotBack)
{
while ((!isDone()) && isWordChar(nextChar()))
{
@@ -3662,13 +3662,13 @@ function Ace2Inner(){
if (isModKey) return;
// If the key is a keypress and the browser is opera and the key is enter, do nothign at all as this fires twice.
- if (keyCode == 13 && mybrowser.opera && (type == "keypress")){
+ if (keyCode == 13 && bowser.opera && (type == "keypress")){
return; // This stops double enters in Opera but double Tabs still show on single tab keypress, adding keyCode == 9 to this doesn't help as the event is fired twice
}
var specialHandled = false;
- var isTypeForSpecialKey = ((mybrowser.msie || mybrowser.safari || mybrowser.chrome) ? (type == "keydown") : (type == "keypress"));
- var isTypeForCmdKey = (type === "keydown")
+ var isTypeForSpecialKey = ((bowser.msie || bowser.safari || bowser.chrome) ? (type == "keydown") : (type == "keypress"));
+ var isTypeForCmdKey = ((bowser.msie || bowser.safari || bowser.chrome) ? (type == "keydown") : (type == "keypress"));
var stopped = false;
inCallStackIfNecessary("handleKeyEvent", function()
@@ -3884,7 +3884,7 @@ function Ace2Inner(){
/* Attempt to apply some sanity to cursor handling in Chrome after a copy / paste event
We have to do this the way we do because rep. doesn't hold the value for keyheld events IE if the user
presses and holds the arrow key .. Sorry if this is ugly, blame Chrome's weird handling of viewports after new content is added*/
- if((evt.which == 37 || evt.which == 38 || evt.which == 39 || evt.which == 40) && mybrowser.chrome){
+ if((evt.which == 37 || evt.which == 38 || evt.which == 39 || evt.which == 40) && bowser.chrome){
var viewport = getViewPortTopBottom();
var myselection = document.getSelection(); // get the current caret selection, can't use rep. here because that only gives us the start position not the current
var caretOffsetTop = myselection.focusNode.parentNode.offsetTop || myselection.focusNode.offsetTop; // get the carets selection offset in px IE 214
@@ -3955,10 +3955,10 @@ function Ace2Inner(){
}
// Is part of multi-keystroke international character on Firefox Mac
- var isFirefoxHalfCharacter = (mybrowser.firefox && evt.altKey && charCode === 0 && keyCode === 0);
+ var isFirefoxHalfCharacter = (bowser.firefox && evt.altKey && charCode === 0 && keyCode === 0);
// Is part of multi-keystroke international character on Safari Mac
- var isSafariHalfCharacter = (mybrowser.safari && evt.altKey && keyCode == 229);
+ var isSafariHalfCharacter = (bowser.safari && evt.altKey && keyCode == 229);
if (thisKeyDoesntTriggerNormalize || isFirefoxHalfCharacter || isSafariHalfCharacter)
{
@@ -4072,7 +4072,7 @@ function Ace2Inner(){
// each of which has node (a magicdom node), index, and maxIndex. If the node
// is a text node, maxIndex is the length of the text; else maxIndex is 1.
// index is between 0 and maxIndex, inclusive.
- if (mybrowser.msie)
+ if (bowser.msie)
{
var browserSelection;
try
@@ -4368,7 +4368,7 @@ function Ace2Inner(){
maxIndex: pt.maxIndex
};
}
- if (mybrowser.msie)
+ if (bowser.msie)
{
// Oddly enough, accessing scrollHeight fixes return key handling on IE 8,
// presumably by forcing some kind of internal DOM update.
@@ -4663,11 +4663,11 @@ function Ace2Inner(){
if (newHeight < viewHeight)
{
newHeight = viewHeight;
-// if (mybrowser.msie) setIfNecessary(outerWin.document.documentElement.style, 'overflowY', 'auto');
+// if (bowser.msie) setIfNecessary(outerWin.document.documentElement.style, 'overflowY', 'auto');
}
else
{
-// if (mybrowser.msie) setIfNecessary(outerWin.document.documentElement.style, 'overflowY', 'scroll');
+// if (bowser.msie) setIfNecessary(outerWin.document.documentElement.style, 'overflowY', 'scroll');
}
if (doesWrap)
{
@@ -4681,7 +4681,7 @@ function Ace2Inner(){
setIfNecessary(iframe.style, "width", newWidth + "px");
setIfNecessary(sideDiv.style, "height", newHeight + "px");
}
- if (mybrowser.firefox)
+ if (bowser.firefox)
{
if (!doesWrap)
{
@@ -4780,14 +4780,14 @@ function Ace2Inner(){
}
return false;
}
- if (mybrowser.msie || mybrowser.safari)
+ if (bowser.msie || bowser.safari)
{
setIfNecessary(root, 'contentEditable', (newVal ? 'true' : 'false'));
}
else
{
var wasSet = setIfNecessary(doc, 'designMode', (newVal ? 'on' : 'off'));
- if (wasSet && newVal && mybrowser.opera)
+ if (wasSet && newVal && bowser.opera)
{
// turning on designMode clears event handlers
bindTheEventHandlers();
@@ -4853,11 +4853,11 @@ function Ace2Inner(){
$(document).on("keyup", handleKeyEvent);
$(document).on("click", handleClick);
$(root).on("blur", handleBlur);
- if (mybrowser.msie)
+ if (bowser.msie)
{
$(document).on("click", handleIEOuterClick);
}
- if (mybrowser.msie) $(root).on("paste", handleIEPaste);
+ if (bowser.msie) $(root).on("paste", handleIEPaste);
// Don't paste on middle click of links
$(root).on("paste", function(e){
@@ -4867,7 +4867,7 @@ function Ace2Inner(){
})
// CompositionEvent is not implemented below IE version 8
- if ( !(mybrowser.msie && mybrowser.version <= 9) && document.documentElement)
+ if ( !(bowser.msie && bowser.version <= 9) && document.documentElement)
{
$(document.documentElement).on("compositionstart", handleCompositionEvent);
$(document.documentElement).on("compositionend", handleCompositionEvent);
@@ -4930,7 +4930,7 @@ function Ace2Inner(){
function handleBlur(evt)
{
- if (mybrowser.msie)
+ if (bowser.msie)
{
// a fix: in IE, clicking on a control like a button outside the
// iframe can "blur" the editor, causing it to stop getting
@@ -5001,7 +5001,7 @@ function Ace2Inner(){
var win = outerWin;
var odoc = win.document;
var h;
- if (mybrowser.opera) h = win.innerHeight;
+ if (bowser.opera) h = win.innerHeight;
else h = odoc.documentElement.clientHeight;
if (h) return h;
@@ -5330,9 +5330,9 @@ function Ace2Inner(){
{
var body = doc.getElementById("innerdocbody");
root = body; // defined as a var in scope outside
- if (mybrowser.firefox) $(root).addClass("mozilla");
- if (mybrowser.safari) $(root).addClass("safari");
- if (mybrowser.msie) $(root).addClass("msie");
+ if (bowser.firefox) $(root).addClass("mozilla");
+ if (bowser.safari) $(root).addClass("safari");
+ if (bowser.msie) $(root).addClass("msie");
setClassPresence(root, "authorColors", true);
setClassPresence(root, "doesWrap", doesWrap);
From f2891e3b8b3c1b0d34c729ba5c14dc4f291d5b7a Mon Sep 17 00:00:00 2001
From: John McLear
Date: Wed, 21 Jan 2015 14:55:29 +0000
Subject: [PATCH 07/19] working
---
src/static/js/ace2_inner.js | 14 +++++++-------
src/static/js/pad.js | 1 -
2 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/src/static/js/ace2_inner.js b/src/static/js/ace2_inner.js
index dd2f2b124..937398051 100644
--- a/src/static/js/ace2_inner.js
+++ b/src/static/js/ace2_inner.js
@@ -19,9 +19,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-var _, $, jQuery, plugins, Ace2Common, bowser;
-bowser = require('./browser').browser;
+var _, $, jQuery, plugins, Ace2Common;
+var bowser = require('./browser').browser;
if(bowser.msie){
// Honestly fuck IE royally.
// Basically every hack we have since V11 causes a problem
@@ -30,6 +30,7 @@ if(bowser.msie){
bowser.chrome = true;
}
}
+
Ace2Common = require('./ace2_common');
plugins = require('ep_etherpad-lite/static/js/pluginfw/client_plugins');
@@ -43,7 +44,6 @@ var isNodeText = Ace2Common.isNodeText,
binarySearchInfinite = Ace2Common.binarySearchInfinite,
htmlPrettyEscape = Ace2Common.htmlPrettyEscape,
noop = Ace2Common.noop;
-
var hooks = require('./pluginfw/hooks');
function Ace2Inner(){
@@ -953,7 +953,7 @@ function Ace2Inner(){
showslinenumbers : function(value){
hasLineNumbers = !! value;
// disable line numbers on mobile devices
- // if (bowser.mobile) hasLineNumbers = false;
+ if (bowser.mobile) hasLineNumbers = false;
setClassPresence(sideDiv, "sidedivhidden", !hasLineNumbers);
fixView();
},
@@ -4657,17 +4657,17 @@ function Ace2Inner(){
for (var i = 0; i < 2; i++)
{
var newHeight = root.clientHeight;
- var newWidth = root.clientWidth;
+ var newWidth = (browser.msie ? root.createTextRange().boundingWidth : root.clientWidth);
var viewHeight = getInnerHeight() - iframePadBottom - iframePadTop;
var viewWidth = getInnerWidth() - iframePadLeft - iframePadRight;
if (newHeight < viewHeight)
{
newHeight = viewHeight;
-// if (bowser.msie) setIfNecessary(outerWin.document.documentElement.style, 'overflowY', 'auto');
+ if (bowser.msie) setIfNecessary(outerWin.document.documentElement.style, 'overflowY', 'auto');
}
else
{
-// if (bowser.msie) setIfNecessary(outerWin.document.documentElement.style, 'overflowY', 'scroll');
+ if (bowser.msie) setIfNecessary(outerWin.document.documentElement.style, 'overflowY', 'scroll');
}
if (doesWrap)
{
diff --git a/src/static/js/pad.js b/src/static/js/pad.js
index 685b420b1..5bbf41236 100644
--- a/src/static/js/pad.js
+++ b/src/static/js/pad.js
@@ -494,7 +494,6 @@ var pad = {
pad.initTime = +(new Date());
pad.padOptions = clientVars.initialOptions;
-console.log("pad", browser);
if ((!browser.msie) && (!(browser.firefox && browser.version.indexOf("1.8.") == 0)))
{
document.domain = document.domain; // for comet
From 7237a3b7cc8c43fb206846b6e0492c9d021c7da4 Mon Sep 17 00:00:00 2001
From: John McLear
Date: Wed, 21 Jan 2015 14:58:47 +0000
Subject: [PATCH 08/19] bump ueberdb
---
src/package.json | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/package.json b/src/package.json
index 9259b50f6..0598a4b60 100644
--- a/src/package.json
+++ b/src/package.json
@@ -17,7 +17,7 @@
"etherpad-require-kernel" : "1.0.7",
"resolve" : "1.0.0",
"socket.io" : "1.3.2",
- "ueberDB" : "0.2.10",
+ "ueberDB" : "0.2.11",
"express" : "3.8.1",
"async" : "0.9.0",
"connect" : "2.7.11",
@@ -55,5 +55,5 @@
"repository" : { "type" : "git",
"url" : "http://github.com/ether/etherpad-lite.git"
},
- "version" : "1.5.0"
+ "version" : "1.5.1"
}
From a2cb8a2f1933dff672d5cbe6b7671d83b4f2e948 Mon Sep 17 00:00:00 2001
From: John McLear
Date: Wed, 21 Jan 2015 15:01:39 +0000
Subject: [PATCH 09/19] rename back to browser
---
src/static/js/ace2_inner.js | 76 ++++++++++++++++++-------------------
1 file changed, 38 insertions(+), 38 deletions(-)
diff --git a/src/static/js/ace2_inner.js b/src/static/js/ace2_inner.js
index 937398051..e68a1b669 100644
--- a/src/static/js/ace2_inner.js
+++ b/src/static/js/ace2_inner.js
@@ -21,13 +21,13 @@
*/
var _, $, jQuery, plugins, Ace2Common;
-var bowser = require('./browser').browser;
-if(bowser.msie){
+var browser = require('./browser').browser;
+if(browser.msie){
// Honestly fuck IE royally.
// Basically every hack we have since V11 causes a problem
- if(parseInt(bowser.version) >= 11){
- delete bowser.msie;
- bowser.chrome = true;
+ if(parseInt(browser.version) >= 11){
+ delete browser.msie;
+ browser.chrome = true;
}
}
@@ -607,7 +607,7 @@ function Ace2Inner(){
// Chrome can't handle the truth.. If CSS rule white-space:pre-wrap
// is true then any paste event will insert two lines..
- if(bowser.chrome){
+ if(browser.chrome){
$("#innerdocbody").css({"white-space":"normal"});
}
@@ -953,7 +953,7 @@ function Ace2Inner(){
showslinenumbers : function(value){
hasLineNumbers = !! value;
// disable line numbers on mobile devices
- if (bowser.mobile) hasLineNumbers = false;
+ if (browser.mobile) hasLineNumbers = false;
setClassPresence(sideDiv, "sidedivhidden", !hasLineNumbers);
fixView();
},
@@ -1320,7 +1320,7 @@ function Ace2Inner(){
else
{
var offsetIntoLine = 0;
- var filteredFunc = linestylefilter.getFilterStack(text, textAndClassFunc, bowser);
+ var filteredFunc = linestylefilter.getFilterStack(text, textAndClassFunc, browser);
var lineNum = rep.lines.indexOfEntry(lineEntry);
var aline = rep.alines[lineNum];
filteredFunc = linestylefilter.getLineStyleFilter(
@@ -1568,13 +1568,13 @@ function Ace2Inner(){
lastDirtyNode = (lastDirtyNode && isNodeDirty(lastDirtyNode) && lastDirtyNode);
if (firstDirtyNode && lastDirtyNode)
{
- var cc = makeContentCollector(isStyled, bowser, rep.apool, null, className2Author);
+ var cc = makeContentCollector(isStyled, browser, rep.apool, null, className2Author);
cc.notifySelection(selection);
var dirtyNodes = [];
for (var n = firstDirtyNode; n && !(n.previousSibling && n.previousSibling == lastDirtyNode);
n = n.nextSibling)
{
- if (bowser.msie)
+ if (browser.msie)
{
// try to undo IE's pesky and overzealous linkification
try
@@ -1614,7 +1614,7 @@ function Ace2Inner(){
if (linesWrapped > 0)
{
- if(!bowser.msie){
+ if(!browser.msie){
// chrome decides in it's infinite wisdom that its okay to put the browsers visisble window in the middle of the span
// an outcome of this is that the first chars of the string are no longer visible to the user.. Yay chrome..
// Move the browsers visible area to the left hand side of the span
@@ -1919,7 +1919,7 @@ function Ace2Inner(){
if (charsLeft === 0)
{
var index = 0;
- if (bowser.msie && line == (rep.lines.length() - 1) && lineNode.childNodes.length === 0)
+ if (browser.msie && line == (rep.lines.length() - 1) && lineNode.childNodes.length === 0)
{
// best to stay at end of last empty div in IE
index = 1;
@@ -2912,7 +2912,7 @@ function Ace2Inner(){
function doCreateDomLine(nonEmpty)
{
- if (bowser.msie && (!nonEmpty))
+ if (browser.msie && (!nonEmpty))
{
var result = {
node: null,
@@ -2972,7 +2972,7 @@ function Ace2Inner(){
}
else
{
- return domline.createDomLine(nonEmpty, doesWrap, bowser, doc);
+ return domline.createDomLine(nonEmpty, doesWrap, browser, doc);
}
}
@@ -3239,7 +3239,7 @@ function Ace2Inner(){
var dirtiness = {};
dirtiness.nodeId = uniqueId(n);
dirtiness.knownHTML = n.innerHTML;
- if (bowser.msie)
+ if (browser.msie)
{
// adding a space to an "empty" div in IE designMode doesn't
// change the innerHTML of the div's parent; also, other
@@ -3256,7 +3256,7 @@ function Ace2Inner(){
var data = getAssoc(n, "dirtiness");
if (!data) return true;
if (n.id !== data.nodeId) return true;
- if (bowser.msie)
+ if (browser.msie)
{
if (n.innerText !== data.knownText) return true;
}
@@ -3591,7 +3591,7 @@ function Ace2Inner(){
// On Mac and Linux, move right moves to end of word and move left moves to start;
// on Windows, always move to start of word.
// On Windows, Firefox and IE disagree on whether to stop for punctuation (FF says no).
- if (bowser.msie && forwardNotBack)
+ if (browser.msie && forwardNotBack)
{
while ((!isDone()) && isWordChar(nextChar()))
{
@@ -3662,13 +3662,13 @@ function Ace2Inner(){
if (isModKey) return;
// If the key is a keypress and the browser is opera and the key is enter, do nothign at all as this fires twice.
- if (keyCode == 13 && bowser.opera && (type == "keypress")){
+ if (keyCode == 13 && browser.opera && (type == "keypress")){
return; // This stops double enters in Opera but double Tabs still show on single tab keypress, adding keyCode == 9 to this doesn't help as the event is fired twice
}
var specialHandled = false;
- var isTypeForSpecialKey = ((bowser.msie || bowser.safari || bowser.chrome) ? (type == "keydown") : (type == "keypress"));
- var isTypeForCmdKey = ((bowser.msie || bowser.safari || bowser.chrome) ? (type == "keydown") : (type == "keypress"));
+ var isTypeForSpecialKey = ((browser.msie || browser.safari || browser.chrome) ? (type == "keydown") : (type == "keypress"));
+ var isTypeForCmdKey = ((browser.msie || browser.safari || browser.chrome) ? (type == "keydown") : (type == "keypress"));
var stopped = false;
inCallStackIfNecessary("handleKeyEvent", function()
@@ -3884,7 +3884,7 @@ function Ace2Inner(){
/* Attempt to apply some sanity to cursor handling in Chrome after a copy / paste event
We have to do this the way we do because rep. doesn't hold the value for keyheld events IE if the user
presses and holds the arrow key .. Sorry if this is ugly, blame Chrome's weird handling of viewports after new content is added*/
- if((evt.which == 37 || evt.which == 38 || evt.which == 39 || evt.which == 40) && bowser.chrome){
+ if((evt.which == 37 || evt.which == 38 || evt.which == 39 || evt.which == 40) && browser.chrome){
var viewport = getViewPortTopBottom();
var myselection = document.getSelection(); // get the current caret selection, can't use rep. here because that only gives us the start position not the current
var caretOffsetTop = myselection.focusNode.parentNode.offsetTop || myselection.focusNode.offsetTop; // get the carets selection offset in px IE 214
@@ -3955,10 +3955,10 @@ function Ace2Inner(){
}
// Is part of multi-keystroke international character on Firefox Mac
- var isFirefoxHalfCharacter = (bowser.firefox && evt.altKey && charCode === 0 && keyCode === 0);
+ var isFirefoxHalfCharacter = (browser.firefox && evt.altKey && charCode === 0 && keyCode === 0);
// Is part of multi-keystroke international character on Safari Mac
- var isSafariHalfCharacter = (bowser.safari && evt.altKey && keyCode == 229);
+ var isSafariHalfCharacter = (browser.safari && evt.altKey && keyCode == 229);
if (thisKeyDoesntTriggerNormalize || isFirefoxHalfCharacter || isSafariHalfCharacter)
{
@@ -4072,7 +4072,7 @@ function Ace2Inner(){
// each of which has node (a magicdom node), index, and maxIndex. If the node
// is a text node, maxIndex is the length of the text; else maxIndex is 1.
// index is between 0 and maxIndex, inclusive.
- if (bowser.msie)
+ if (browser.msie)
{
var browserSelection;
try
@@ -4368,7 +4368,7 @@ function Ace2Inner(){
maxIndex: pt.maxIndex
};
}
- if (bowser.msie)
+ if (browser.msie)
{
// Oddly enough, accessing scrollHeight fixes return key handling on IE 8,
// presumably by forcing some kind of internal DOM update.
@@ -4663,11 +4663,11 @@ function Ace2Inner(){
if (newHeight < viewHeight)
{
newHeight = viewHeight;
- if (bowser.msie) setIfNecessary(outerWin.document.documentElement.style, 'overflowY', 'auto');
+ if (browser.msie) setIfNecessary(outerWin.document.documentElement.style, 'overflowY', 'auto');
}
else
{
- if (bowser.msie) setIfNecessary(outerWin.document.documentElement.style, 'overflowY', 'scroll');
+ if (browser.msie) setIfNecessary(outerWin.document.documentElement.style, 'overflowY', 'scroll');
}
if (doesWrap)
{
@@ -4681,7 +4681,7 @@ function Ace2Inner(){
setIfNecessary(iframe.style, "width", newWidth + "px");
setIfNecessary(sideDiv.style, "height", newHeight + "px");
}
- if (bowser.firefox)
+ if (browser.firefox)
{
if (!doesWrap)
{
@@ -4780,14 +4780,14 @@ function Ace2Inner(){
}
return false;
}
- if (bowser.msie || bowser.safari)
+ if (browser.msie || browser.safari)
{
setIfNecessary(root, 'contentEditable', (newVal ? 'true' : 'false'));
}
else
{
var wasSet = setIfNecessary(doc, 'designMode', (newVal ? 'on' : 'off'));
- if (wasSet && newVal && bowser.opera)
+ if (wasSet && newVal && browser.opera)
{
// turning on designMode clears event handlers
bindTheEventHandlers();
@@ -4853,11 +4853,11 @@ function Ace2Inner(){
$(document).on("keyup", handleKeyEvent);
$(document).on("click", handleClick);
$(root).on("blur", handleBlur);
- if (bowser.msie)
+ if (browser.msie)
{
$(document).on("click", handleIEOuterClick);
}
- if (bowser.msie) $(root).on("paste", handleIEPaste);
+ if (browser.msie) $(root).on("paste", handleIEPaste);
// Don't paste on middle click of links
$(root).on("paste", function(e){
@@ -4867,7 +4867,7 @@ function Ace2Inner(){
})
// CompositionEvent is not implemented below IE version 8
- if ( !(bowser.msie && bowser.version <= 9) && document.documentElement)
+ if ( !(browser.msie && browser.version <= 9) && document.documentElement)
{
$(document.documentElement).on("compositionstart", handleCompositionEvent);
$(document.documentElement).on("compositionend", handleCompositionEvent);
@@ -4930,7 +4930,7 @@ function Ace2Inner(){
function handleBlur(evt)
{
- if (bowser.msie)
+ if (browser.msie)
{
// a fix: in IE, clicking on a control like a button outside the
// iframe can "blur" the editor, causing it to stop getting
@@ -5001,7 +5001,7 @@ function Ace2Inner(){
var win = outerWin;
var odoc = win.document;
var h;
- if (bowser.opera) h = win.innerHeight;
+ if (browser.opera) h = win.innerHeight;
else h = odoc.documentElement.clientHeight;
if (h) return h;
@@ -5330,9 +5330,9 @@ function Ace2Inner(){
{
var body = doc.getElementById("innerdocbody");
root = body; // defined as a var in scope outside
- if (bowser.firefox) $(root).addClass("mozilla");
- if (bowser.safari) $(root).addClass("safari");
- if (bowser.msie) $(root).addClass("msie");
+ if (browser.firefox) $(root).addClass("mozilla");
+ if (browser.safari) $(root).addClass("safari");
+ if (browser.msie) $(root).addClass("msie");
setClassPresence(root, "authorColors", true);
setClassPresence(root, "doesWrap", doesWrap);
From 26a158447074dc3048c26882379cbc09c7c8d4a5 Mon Sep 17 00:00:00 2001
From: John McLear
Date: Wed, 21 Jan 2015 15:21:15 +0000
Subject: [PATCH 10/19] fix tests w/ new context
---
tests/frontend/specs/bold.js | 2 +-
tests/frontend/specs/caret.js | 2 +-
tests/frontend/specs/indentation.js | 2 +-
tests/frontend/specs/italic.js | 2 +-
tests/frontend/specs/redo.js | 2 +-
5 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/tests/frontend/specs/bold.js b/tests/frontend/specs/bold.js
index bffb281b5..b54466e4e 100644
--- a/tests/frontend/specs/bold.js
+++ b/tests/frontend/specs/bold.js
@@ -44,7 +44,7 @@ describe("bold button", function(){
//select this text element
$firstTextElement.sendkeys('{selectall}');
- if(inner$(window)[0].bowser.firefox || inner$(window)[0].bowser.msie){ // if it's a mozilla or IE
+ if(inner$(window)[0].bowser.firefox || inner$(window)[0].bowser.modernIE){ // if it's a mozilla or IE
var evtType = "keypress";
}else{
var evtType = "keydown";
diff --git a/tests/frontend/specs/caret.js b/tests/frontend/specs/caret.js
index 6e68b6f52..14ff8d6a6 100644
--- a/tests/frontend/specs/caret.js
+++ b/tests/frontend/specs/caret.js
@@ -297,7 +297,7 @@ function prepareDocument(n, target){ // generates a random document with random
}
function keyEvent(target, charCode, ctrl, shift){ // sends a charCode to the window
- if(inner$(window)[0].bowser.firefox || inner$(window)[0].bowser.msie){ // if it's a mozilla or IE
+ if(inner$(window)[0].bowser.firefox || inner$(window)[0].bowser.modernIE){ // if it's a mozilla or IE
var evtType = "keypress";
}else{
var evtType = "keydown";
diff --git a/tests/frontend/specs/indentation.js b/tests/frontend/specs/indentation.js
index c8f2cee81..8e851d873 100644
--- a/tests/frontend/specs/indentation.js
+++ b/tests/frontend/specs/indentation.js
@@ -15,7 +15,7 @@ describe("indentation button", function(){
//select this text element
$firstTextElement.sendkeys('{selectall}');
- if(inner$(window)[0].bowser.firefox || inner$(window)[0].bowser.msie){ // if it's a mozilla or IE
+ if(inner$(window)[0].bowser.firefox || inner$(window)[0].bowser.modernIE){ // if it's a mozilla or IE
var evtType = "keypress";
}else{
var evtType = "keydown";
diff --git a/tests/frontend/specs/italic.js b/tests/frontend/specs/italic.js
index 4ef4b4085..bf7f2bc60 100644
--- a/tests/frontend/specs/italic.js
+++ b/tests/frontend/specs/italic.js
@@ -44,7 +44,7 @@ describe("italic some text", function(){
//select this text element
$firstTextElement.sendkeys('{selectall}');
- if(inner$(window)[0].bowser.firefox || inner$(window)[0].bowser.msie){ // if it's a mozilla or IE
+ if(inner$(window)[0].bowser.firefox || inner$(window)[0].bowser.modernIE){ // if it's a mozilla or IE
var evtType = "keypress";
}else{
var evtType = "keydown";
diff --git a/tests/frontend/specs/redo.js b/tests/frontend/specs/redo.js
index 00873d14a..caa32feec 100644
--- a/tests/frontend/specs/redo.js
+++ b/tests/frontend/specs/redo.js
@@ -47,7 +47,7 @@ describe("undo button then redo button", function(){
var modifiedValue = $firstTextElement.text(); // get the modified value
expect(modifiedValue).not.to.be(originalValue); // expect the value to change
- if(inner$(window)[0].bowser.firefox || inner$(window)[0].bowser.msie){ // if it's a mozilla or IE
+ if(inner$(window)[0].bowser.firefox || inner$(window)[0].bowser.modernIE){ // if it's a mozilla or IE
var evtType = "keypress";
}else{
var evtType = "keydown";
From 3cd8759cec034534a29b753648263b7d08d6cb75 Mon Sep 17 00:00:00 2001
From: John McLear
Date: Wed, 21 Jan 2015 15:21:31 +0000
Subject: [PATCH 11/19] expose modernIE value
---
src/static/js/ace2_inner.js | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/static/js/ace2_inner.js b/src/static/js/ace2_inner.js
index 0e122e6a3..4b84e784d 100644
--- a/src/static/js/ace2_inner.js
+++ b/src/static/js/ace2_inner.js
@@ -28,6 +28,7 @@ if(browser.msie){
if(parseInt(browser.version) >= 11){
delete browser.msie;
browser.chrome = true;
+ browser.modernIE = true;
}
}
From 941cc3c24be22bf5a834e244f78b53836a630bdc Mon Sep 17 00:00:00 2001
From: John McLear
Date: Wed, 21 Jan 2015 15:37:55 +0000
Subject: [PATCH 12/19] url param
---
src/static/js/chat.js | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/static/js/chat.js b/src/static/js/chat.js
index 82ca15bdc..2bf233f7a 100644
--- a/src/static/js/chat.js
+++ b/src/static/js/chat.js
@@ -62,6 +62,7 @@ var chat = (function()
$('#users').addClass("chatAndUsers");
$("#chatbox").addClass("chatAndUsersChat");
}else{
+ padcookie.setPref("chatAndUsers", false);
chat.stickToScreen(false);
$('#options-stickychat').prop("disabled", false);
$('#users').removeClass("chatAndUsers");
From 17fa87552d97a29a703084efdaa2cb67a1c281b9 Mon Sep 17 00:00:00 2001
From: John McLear
Date: Wed, 21 Jan 2015 15:48:21 +0000
Subject: [PATCH 13/19] styling
---
src/static/css/pad.css | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/static/css/pad.css b/src/static/css/pad.css
index 0ecf91f05..f5ea99d86 100644
--- a/src/static/css/pad.css
+++ b/src/static/css/pad.css
@@ -918,11 +918,12 @@ input[type=checkbox] {
display:block !important;
right:0px !important;
border-radius:0px !important;
- height:200px !important;
width:182px !important;
margin:2px 0 0 0 !important;
border: none !important;
border-bottom: 1px solid #ccc !important;
+ height:155px !important;
+ border-left: 1px solid #ccc !important;
}
.chatAndUsersChat > div > #titlecross{
display:none;
@@ -932,10 +933,11 @@ input[type=checkbox] {
padding:0 !important;
margin:0 !important;
right:0 !important;
- top: 315px !important;
+ top: 200px !important;
width:182px !important;
border: none !important;
padding:5px !important;
+ border-left: 1px solid #ccc !important;
}
@media screen and (max-width: 600px) {
From 753e8fdf0b2bde3ef53ee866466ca7be3d215e7b Mon Sep 17 00:00:00 2001
From: John McLear
Date: Wed, 21 Jan 2015 16:08:54 +0000
Subject: [PATCH 14/19] working logic
---
src/static/js/chat.js | 7 ++++---
src/static/js/pad.js | 3 ++-
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/src/static/js/chat.js b/src/static/js/chat.js
index 2bf233f7a..fb01befec 100644
--- a/src/static/js/chat.js
+++ b/src/static/js/chat.js
@@ -54,16 +54,17 @@ var chat = (function()
isStuck = false;
}
},
- chatAndUsers: function(status){
- if(status || $('#options-chatandusers').prop('checked')){
+ chatAndUsers: function(fromInitialCall)
+ {
+ if(fromInitialCall || $('#options-chatandusers').prop('checked')){
padcookie.setPref("chatAndUsers", true);
chat.stickToScreen(true);
+ $('#options-stickychat').prop('checked', true)
$('#options-stickychat').prop("disabled", "disabled");
$('#users').addClass("chatAndUsers");
$("#chatbox").addClass("chatAndUsersChat");
}else{
padcookie.setPref("chatAndUsers", false);
- chat.stickToScreen(false);
$('#options-stickychat').prop("disabled", false);
$('#users').removeClass("chatAndUsers");
$("#chatbox").removeClass("chatAndUsersChat");
diff --git a/src/static/js/pad.js b/src/static/js/pad.js
index 7c2e22c76..77bfab7f1 100644
--- a/src/static/js/pad.js
+++ b/src/static/js/pad.js
@@ -784,6 +784,7 @@ var pad = {
handleIsFullyConnected: function(isConnected, isInitialConnect)
{
pad.determineChatVisibility(isConnected && !isInitialConnect);
+ pad.determineChatAndUsersVisibility(isConnected && !isInitialConnect);
pad.determineAuthorshipColorsVisibility();
},
determineChatVisibility: function(asNowConnectedFeedback){
@@ -796,7 +797,7 @@ var pad = {
$('#options-stickychat').prop("checked", false); // set the checkbox for off
}
},
- determineChatAndUsersVisibility: function(){
+ determineChatAndUsersVisibility: function(asNowConnectedFeedback){
var chatAUVisCookie = padcookie.getPref('chatAndUsersVisible');
if(chatAUVisCookie){ // if the cookie is set for chat always visible
chat.chatAndUsers(true); // stick it to the screen
From aee0fd797dd5c914e07f563ca8f0ea099ecab3bd Mon Sep 17 00:00:00 2001
From: John McLear
Date: Wed, 21 Jan 2015 16:11:00 +0000
Subject: [PATCH 15/19] working translation
---
src/locales/en.json | 2 +-
src/templates/pad.html | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/locales/en.json b/src/locales/en.json
index de309ba1b..cafbd76e5 100644
--- a/src/locales/en.json
+++ b/src/locales/en.json
@@ -32,7 +32,7 @@
"pad.settings.padSettings": "Pad Settings",
"pad.settings.myView": "My View",
"pad.settings.stickychat": "Chat always on screen",
- "pad.settings.chatAndUsers": "Show Chat and Users",
+ "pad.settings.chatandusers": "Show Chat and Users",
"pad.settings.colorcheck": "Authorship colors",
"pad.settings.linenocheck": "Line numbers",
"pad.settings.rtlcheck": "Read content from right to left?",
diff --git a/src/templates/pad.html b/src/templates/pad.html
index 48b46c410..7c7257cc6 100644
--- a/src/templates/pad.html
+++ b/src/templates/pad.html
@@ -135,7 +135,7 @@
-
+
From 657974b5189719ee9b214befdd2fd5f2f3391bed Mon Sep 17 00:00:00 2001
From: John McLear
Date: Wed, 21 Jan 2015 16:40:44 +0000
Subject: [PATCH 16/19] move saved revs notification to gritter
---
src/locales/en.json | 1 +
src/static/js/pad_savedrevs.js | 11 ++++++++++-
2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/src/locales/en.json b/src/locales/en.json
index cafbd76e5..23bb3a040 100644
--- a/src/locales/en.json
+++ b/src/locales/en.json
@@ -121,6 +121,7 @@
"timeslider.unnamedauthors": "{{num}} unnamed {[plural(num) one: author, other: authors ]}",
"pad.savedrevs.marked": "This revision is now marked as a saved revision",
+ "pad.savedrevs.timeslider": "You can see saved revisions by visiting the timeslider",
"pad.userlist.entername": "Enter your name",
"pad.userlist.unnamed": "unnamed",
"pad.userlist.guest": "Guest",
diff --git a/src/static/js/pad_savedrevs.js b/src/static/js/pad_savedrevs.js
index e1552c27c..34323b22f 100644
--- a/src/static/js/pad_savedrevs.js
+++ b/src/static/js/pad_savedrevs.js
@@ -18,7 +18,16 @@ var pad;
exports.saveNow = function(){
pad.collabClient.sendMessage({"type": "SAVE_REVISION"});
- alert(_("pad.savedrevs.marked"));
+ $.gritter.add({
+ // (string | mandatory) the heading of the notification
+ title: _("pad.savedrevs.marked"),
+ // (string | mandatory) the text inside the notification
+ text: _("pad.savedrevs.timeslider") || "You can view saved revisions in the timeslider",
+ // (bool | optional) if you want it to fade out on its own or just sit there
+ sticky: false,
+ // (int | optional) the time you want it to be alive for before fading out
+ time: '2000'
+ });
}
exports.init = function(_pad){
From 036dea3d0fd06dd549c73ac5a60a6658f66ff127 Mon Sep 17 00:00:00 2001
From: John McLear
Date: Wed, 21 Jan 2015 17:25:06 +0000
Subject: [PATCH 17/19] styling
---
src/static/css/pad.css | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/static/css/pad.css b/src/static/css/pad.css
index f5ea99d86..70c15b515 100644
--- a/src/static/css/pad.css
+++ b/src/static/css/pad.css
@@ -925,6 +925,10 @@ input[type=checkbox] {
height:155px !important;
border-left: 1px solid #ccc !important;
}
+.chatAndUsers > #otherusers{
+ max-height: 100px;
+ overflow-y: auto;
+}
.chatAndUsersChat > div > #titlecross{
display:none;
}
From 6fd0285d4d48a530677eed08d280901f4fe71b54 Mon Sep 17 00:00:00 2001
From: John McLear
Date: Wed, 21 Jan 2015 21:36:11 +0000
Subject: [PATCH 18/19] include lineContent in hok
---
src/node/utils/ExportHtml.js | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/src/node/utils/ExportHtml.js b/src/node/utils/ExportHtml.js
index 5e5aca843..0bb93326b 100644
--- a/src/node/utils/ExportHtml.js
+++ b/src/node/utils/ExportHtml.js
@@ -30,8 +30,6 @@ function getPadHTML(pad, revNum, callback)
var html;
async.waterfall([
// fetch revision atext
-
-
function (callback)
{
if (revNum != undefined)
@@ -416,6 +414,7 @@ function getHTMLFromAtext(pad, atext, authorColors)
var lineContentFromHook = hooks.callAllStr("getLineHTMLForExport",
{
line: line,
+ lineContent: lineContent,
apool: apool,
attribLine: attribLines[i],
text: textLines[i]
From 1f023c52bc8d6ec83174b8387c694b5f313db826 Mon Sep 17 00:00:00 2001
From: Kay Strobach
Date: Fri, 23 Jan 2015 08:14:01 +0100
Subject: [PATCH 19/19] Add: How to create an issue
How to create an issue and which information should be given
---
CONTRIBUTING.md | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 0110151c1..b6e1c2473 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -1,6 +1,31 @@
# Developer Guidelines
(Please talk to people on the mailing list before you change this page, see our section on [how to get in touch](https://github.com/ether/etherpad-lite#get-in-touch))
+## How to write a bug report
+
+* Please be polite, we all are humans and problems can occur.
+* Please add as much information as possible, for example
+ * client os(s) and version(s)
+ * browser(s) and version(s), is the problem reproduceable on different clients
+ * special environments like firewalls or antivirus
+ * host os and version
+ * npm and nodejs version
+ * Logfiles if available
+ * steps to reproduce
+ * what you expected to happen
+ * what actually happened
+* Please format logfiles and code examples with markdown see github Markdown help below the issue textarea for more information.
+
+If you send logfiles, please set the loglevel switch DEBUG in your settings.json file:
+
+```
+/* The log level we are using, can be: DEBUG, INFO, WARN, ERROR */
+ "loglevel": "DEBUG",
+```
+
+The logfile location is defined in startup script or the log is directly shown in the commandline after you have started etherpad.
+
+
## Important note for pull requests
**Pull requests should be issued against the develop branch**. We never pull directly into master.