Merge git://github.com/Pita/etherpad-lite

This commit is contained in:
Mark Schmale 2011-11-21 02:20:01 +01:00
commit 33266915be
21 changed files with 305 additions and 103 deletions

View file

@ -3097,7 +3097,11 @@ function OUTER(gscope)
// Such a div is what IE 6 creates naturally when you make a blank line
// in a document of divs. However, when copy-and-pasted the div will
// contain a space, so we note its emptiness with a property.
lineElem.innerHTML = "";
if(browser.version < 9) {
lineElem.innerHTML = "";
} else {
lineElem.innerHTML = "<hr style=\"border:none; color:#fff; height:1px; display:none\"/>";
}
// a primitive-valued property survives copy-and-paste
setAssoc(lineElem, "shouldBeEmpty", true);
// an object property doesn't
@ -3576,9 +3580,15 @@ function OUTER(gscope)
function doTabKey(shiftDown)
{
if (!doIndentOutdent(shiftDown))
if (shiftDown === true){
doDeleteKey();
}
else
{
performDocumentReplaceSelection(THE_TAB);
if (!doIndentOutdent(shiftDown))
{
performDocumentReplaceSelection(THE_TAB);
}
}
}

View file

@ -152,6 +152,10 @@ domline.createDomLine = function(nonEmpty, doesWrap, optBrowser, optDocument)
{
if (href)
{
if(!~href.indexOf("http")) // if the url doesn't include http or https etc prefix it.
{
href = "http://"+href;
}
extraOpenTags = extraOpenTags + '<a href="' + href.replace(/\"/g, '&quot;') + '">';
extraCloseTags = '</a>' + extraCloseTags;
}

View file

@ -18,6 +18,7 @@
var socket;
var LineNumbersDisabled = false;
var noColors = false;
var useMonospaceFontGlobal = false;
var globalUserName = false;
@ -78,11 +79,21 @@ function randomString()
function getParams()
{
var showControls = getUrlVars()["showControls"];
var showChat = getUrlVars()["showChat"];
var userName = getUrlVars()["userName"];
var showLineNumbers = getUrlVars()["showLineNumbers"];
var useMonospaceFont = getUrlVars()["useMonospaceFont"];
var params = getUrlVars()
var showControls = params["showControls"];
var showChat = params["showChat"];
var userName = params["userName"];
var showLineNumbers = params["showLineNumbers"];
var useMonospaceFont = params["useMonospaceFont"];
var IsnoColors = params["noColors"];
if(IsnoColors)
{
if(IsnoColors == "true")
{
noColors = true;
}
}
if(showControls)
{
if(showControls == "false")
@ -120,7 +131,7 @@ function getParams()
if(userName)
{
// If the username is set as a parameter we should set a global value that we can call once we have initiated the pad.
globalUserName = userName;
globalUserName = unescape(userName);
}
}
@ -236,6 +247,13 @@ function handshake()
{
pad.changeViewOption('showLineNumbers', false);
}
// If the noColors value is set to true then we need to hide the backround colors on the ace spans
if (noColors == true)
{
pad.changeViewOption('noColors', true);
}
// If the Monospacefont value is set to true then change it to monospace.
if (useMonospaceFontGlobal == true)
{
@ -245,6 +263,7 @@ function handshake()
if (globalUserName !== false)
{
pad.notifyChangeName(globalUserName); // Notifies the server
pad.myUserInfo.name = globalUserName;
$('#myusernameedit').attr({"value":globalUserName}); // Updates the current users UI
}
}

View file

@ -61,6 +61,8 @@ var padeditor = (function()
{
pad.changeViewOption('useMonospaceFont', $("#viewfontmenu").val() == 'monospace');
});
noColors = !noColors; // Inversed so we can pass it to showauthorcolors
},
setViewOptions: function(newOptions)
{
@ -84,6 +86,9 @@ var padeditor = (function()
v = getOption('useMonospaceFont', false);
self.ace.setProperty("textface", (v ? "monospace" : "Arial, sans-serif"));
$("#viewfontmenu").val(v ? "monospace" : "normal");
self.ace.setProperty("showsauthorcolors", noColors);
},
initViewZoom: function()
{