mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-05-05 06:37:10 -04:00
Merge git://github.com/Pita/etherpad-lite
This commit is contained in:
commit
33266915be
21 changed files with 305 additions and 103 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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, '"') + '">';
|
||||
extraCloseTags = '</a>' + extraCloseTags;
|
||||
}
|
||||
|
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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()
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue