Merge branch 'develop' of https://github.com/ether/etherpad-lite into fix-dead-keys

This commit is contained in:
John McLear 2015-05-07 15:56:01 +00:00
commit debca84ebe
49 changed files with 509 additions and 108 deletions

View file

@ -113,7 +113,11 @@ body.doesWrap {
word-wrap: break-word; /* fix for issue #1648 - firefox not wrapping long lines (without spaces) correctly */
}
body.doesWrap > div{
.noprewrap{
white-space: normal;
}
body.doesWrap:not(.noprewrap) > div{
/* Related to #1766 */
white-space: pre-wrap;
}

View file

@ -860,6 +860,7 @@ input[type=checkbox] {
padding: 10px;
border-radius: 0 0 6px 6px;
border: 1px solid #ccc;
border-top: none;
background: #f7f7f7;
background: -webkit-linear-gradient(#F7F7F7, #EEE);
background: -moz-linear-gradient(#F7F7F7, #EEE);

View file

@ -260,13 +260,13 @@ exports.checkRep = function (cs) {
break;
case '-':
oldPos += o.chars;
exports.assert(oldPos < oldLen, oldPos, " >= ", oldLen, " in ", cs);
exports.assert(oldPos <= oldLen, oldPos, " > ", oldLen, " in ", cs);
break;
case '+':
{
calcNewLen += o.chars;
numInserted += o.chars;
exports.assert(calcNewLen < newLen, calcNewLen, " >= ", newLen, " in ", cs);
exports.assert(calcNewLen <= newLen, calcNewLen, " > ", newLen, " in ", cs);
break;
}
}
@ -1408,8 +1408,8 @@ exports.makeSplice = function (oldFullText, spliceStart, numRemoved, newText, op
if (spliceStart >= oldLen) {
spliceStart = oldLen - 1;
}
if (numRemoved > oldFullText.length - spliceStart - 1) {
numRemoved = oldFullText.length - spliceStart - 1;
if (numRemoved > oldFullText.length - spliceStart) {
numRemoved = oldFullText.length - spliceStart;
}
var oldText = oldFullText.substring(spliceStart, spliceStart + numRemoved);
var newLen = oldLen + newText.length - oldText.length;

View file

@ -612,7 +612,7 @@ function Ace2Inner(){
// So this has to be set to pre-wrap ;(
// We need to file a bug w/ the Chromium team.
if(browser.chrome){
$("#innerdocbody").css({"white-space":"pre-wrap"});
$("#innerdocbody").addClass("noprewrap");
}
}
@ -3640,6 +3640,7 @@ function Ace2Inner(){
}else{
var lineHeight = myselection.focusNode.offsetHeight; // line height of blank lines
}
var heightOfChatIcon = parent.parent.$('#chaticon').height(); // height of the chat icon button
lineHeight = (lineHeight *2) + heightOfChatIcon;
var viewport = getViewPortTopBottom();
@ -3709,11 +3710,11 @@ function Ace2Inner(){
firstEditbarElement.focus();
evt.preventDefault();
}
if ((!specialHandled) && altKey && keyCode == 67){
if ((!specialHandled) && altKey && keyCode == 67 && type === "keydown"){
// Alt c focuses on the Chat window
$(this).blur();
parent.parent.chat.show();
parent.parent.chat.focus();
parent.parent.$("#chatinput").focus();
evt.preventDefault();
}
if ((!specialHandled) && evt.ctrlKey && shiftKey && keyCode == 50 && type === "keydown"){
@ -3905,7 +3906,7 @@ function Ace2Inner(){
doInsertUnorderedList()
specialHandled = true;
}
if ((!specialHandled) && isTypeForCmdKey && String.fromCharCode(which).toLowerCase() == "n" && (evt.metaKey || evt.ctrlKey) && evt.shiftKey)
if ((!specialHandled) && isTypeForCmdKey && (String.fromCharCode(which).toLowerCase() == "n" || String.fromCharCode(which) == 1) && (evt.metaKey || evt.ctrlKey) && evt.shiftKey)
{
// cmd-shift-N (orderedlist)
fastIncorp(9);

View file

@ -39,8 +39,6 @@ var chat = (function()
},
focus: function ()
{
// I'm not sure why we need a setTimeout here but without it we don't get focus...
// Animation maybe?
setTimeout(function(){
$("#chatinput").focus();
},100);
@ -214,23 +212,24 @@ var chat = (function()
init: function(pad)
{
this._pad = pad;
$("#chatinput").keyup(function(evt)
{
$("#chatinput").on("keydown", function(evt){
// If the event is Alt C or Escape & we're already in the chat menu
// Send the users focus back to the pad
if((evt.altKey == true && evt.which === 67) || evt.which === 27){
// If we're in chat already..
$(':focus').blur(); // required to do not try to remove!
padeditor.ace.focus(); // Sends focus back to pad
evt.preventDefault();
return false;
}
});
$('body:not(#chatinput)').on("keydown", function(evt){
$('body:not(#chatinput)').on("keypress", function(evt){
if (evt.altKey && evt.which == 67){
// Alt c focuses on the Chat window
$(this).blur();
parent.parent.chat.show();
parent.parent.chat.focus();
chat.show();
$("#chatinput").focus();
evt.preventDefault();
}
});

View file

@ -279,7 +279,7 @@ function getCollabClient(ace2editor, serverVars, initialUserInfo, options, _pad)
if (newRev != (oldRev + 1))
{
parent.parent.console.warn("bad message revision on NEW_CHANGES: " + newRev + " not " + (oldRev + 1));
window.console.warn("bad message revision on NEW_CHANGES: " + newRev + " not " + (oldRev + 1));
// setChannelState("DISCONNECTED", "badmessage_newchanges");
return;
}
@ -289,7 +289,7 @@ function getCollabClient(ace2editor, serverVars, initialUserInfo, options, _pad)
if (newRev != (rev + 1))
{
parent.parent.console.warn("bad message revision on NEW_CHANGES: " + newRev + " not " + (rev + 1));
window.console.warn("bad message revision on NEW_CHANGES: " + newRev + " not " + (rev + 1));
// setChannelState("DISCONNECTED", "badmessage_newchanges");
return;
}
@ -303,7 +303,7 @@ function getCollabClient(ace2editor, serverVars, initialUserInfo, options, _pad)
{
if (newRev != (msgQueue[msgQueue.length - 1].newRev + 1))
{
parent.parent.console.warn("bad message revision on ACCEPT_COMMIT: " + newRev + " not " + (msgQueue[msgQueue.length - 1][0] + 1));
window.console.warn("bad message revision on ACCEPT_COMMIT: " + newRev + " not " + (msgQueue[msgQueue.length - 1][0] + 1));
// setChannelState("DISCONNECTED", "badmessage_acceptcommit");
return;
}
@ -313,7 +313,7 @@ function getCollabClient(ace2editor, serverVars, initialUserInfo, options, _pad)
if (newRev != (rev + 1))
{
parent.parent.console.warn("bad message revision on ACCEPT_COMMIT: " + newRev + " not " + (rev + 1));
window.console.warn("bad message revision on ACCEPT_COMMIT: " + newRev + " not " + (rev + 1));
// setChannelState("DISCONNECTED", "badmessage_acceptcommit");
return;
}

View file

@ -71,8 +71,9 @@ function makeContentCollector(collectStyles, abrowser, apool, domInterface, clas
},
nodeAttr: function(n, a)
{
if(n.getAttribute == null) return null;
return n.getAttribute(a);
if(n.getAttribute != null) return n.getAttribute(a);
if(n.attribs != null) return n.attribs[a];
return null;
},
optNodeInnerHTML: function(n)
{
@ -516,7 +517,7 @@ function makeContentCollector(collectStyles, abrowser, apool, domInterface, clas
else if (!isEmpty)
{
var styl = dom.nodeAttr(node, "style");
var cls = dom.nodeProp(node, "className");
var cls = dom.nodeAttr(node, "class");
var isPre = (tname == "pre");
if ((!isPre) && abrowser.safari)
{

View file

@ -456,10 +456,11 @@ var pad = {
},
switchToPad: function(padId)
{
var options = document.location.href.split('?')[1];
var newHref = "/p/" + padId;
if (options != null)
newHref = newHref + '?' + options;
var newHref = new RegExp(/.*\/p\/[^\/]+/).exec(document.location.pathname) || clientVars.padId;
newHref = newHref[0];
if (options != null){
newHref = newHref + '?' + options;
}
if(window.history && window.history.pushState)
{

View file

@ -235,7 +235,7 @@ var padimpexp = (function()
addImportFrames();
$("#importfileinput").change(fileInputUpdated);
$('#importform').submit(fileInputSubmit);
$('#importform').unbind("submit").submit(fileInputSubmit);
$('.disabledexport').click(cantExport);
},
handleFrameCall: function(directDatabaseAccess, status)

View file

@ -26,6 +26,17 @@ exports.formatPlugins = function () {
return _.keys(exports.plugins).join(", ");
};
exports.formatPluginsWithVersion = function () {
var plugins = [];
_.forEach(exports.plugins, function(plugin){
if(plugin.package.name !== "ep_etherpad-lite"){
var pluginStr = plugin.package.name + "@" + plugin.package.version;
plugins.push(pluginStr);
}
});
return plugins.join(", ");
};
exports.formatParts = function () {
return _.map(exports.parts, function (part) { return part.full_name; }).join("\n");
};

View file

@ -147,7 +147,7 @@ function handleClientVars(message)
// export_links is a jQuery Array, so .each is allowed.
export_links.each(function()
{
this.setAttribute('href', this.href.replace( /(.+?)\/\w+\/(\d+\/)?export/ , '$1/' + padId + '/' + revno + '/export'));
this.setAttribute('href', this.href.replace( /(.+?)\/[^\/]+\/(\d+\/)?export/ , '$1/' + padId + '/' + revno + '/export'));
});
});