mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-20 23:46:14 -04:00
Merge branch 'develop' into ace2_refactoring
This commit is contained in:
commit
2dd60b0b6d
48 changed files with 1545 additions and 1779 deletions
|
@ -841,7 +841,7 @@ function Ace2Inner(){
|
|||
var cmdArgs = Array.prototype.slice.call(arguments, 1);
|
||||
if (CMDS[cmd])
|
||||
{
|
||||
inCallStack(cmd, function()
|
||||
inCallStackIfNecessary(cmd, function()
|
||||
{
|
||||
fastIncorp(9);
|
||||
CMDS[cmd].apply(CMDS, cmdArgs);
|
||||
|
@ -851,7 +851,7 @@ function Ace2Inner(){
|
|||
|
||||
function replaceRange(start, end, text)
|
||||
{
|
||||
inCallStack('replaceRange', function()
|
||||
inCallStackIfNecessary('replaceRange', function()
|
||||
{
|
||||
fastIncorp(9);
|
||||
performDocumentReplaceRange(start, end, text);
|
||||
|
@ -1152,7 +1152,7 @@ function Ace2Inner(){
|
|||
return;
|
||||
}
|
||||
|
||||
inCallStack("idleWorkTimer", function()
|
||||
inCallStackIfNecessary("idleWorkTimer", function()
|
||||
{
|
||||
|
||||
var isTimeUp = newTimeLimit(250);
|
||||
|
@ -1991,6 +1991,7 @@ function Ace2Inner(){
|
|||
return [lineNum, col];
|
||||
}
|
||||
}
|
||||
editorInfo.ace_getLineAndCharForPoint = getLineAndCharForPoint;
|
||||
|
||||
function createDomLineEntry(lineString)
|
||||
{
|
||||
|
@ -2276,6 +2277,7 @@ function Ace2Inner(){
|
|||
var cs = builder.toString();
|
||||
performDocumentApplyChangeset(cs);
|
||||
}
|
||||
editorInfo.ace_performDocumentApplyAttributesToRange = performDocumentApplyAttributesToRange;
|
||||
|
||||
function buildKeepToStartOfRange(builder, start)
|
||||
{
|
||||
|
@ -2801,6 +2803,7 @@ function Ace2Inner(){
|
|||
currentCallStack.selectionAffected = true;
|
||||
}
|
||||
}
|
||||
editorInfo.ace_performSelectionChange = performSelectionChange;
|
||||
|
||||
// Change the abstract representation of the document to have a different selection.
|
||||
// Should not rely on the line representation. Should not affect the DOM.
|
||||
|
@ -3228,7 +3231,7 @@ function Ace2Inner(){
|
|||
|
||||
function handleClick(evt)
|
||||
{
|
||||
inCallStack("handleClick", function()
|
||||
inCallStackIfNecessary("handleClick", function()
|
||||
{
|
||||
idleWorkTimer.atMost(200);
|
||||
});
|
||||
|
@ -3550,7 +3553,7 @@ function Ace2Inner(){
|
|||
|
||||
var stopped = false;
|
||||
|
||||
inCallStack("handleKeyEvent", function()
|
||||
inCallStackIfNecessary("handleKeyEvent", function()
|
||||
{
|
||||
|
||||
if (type == "keypress" || (isTypeForSpecialKey && keyCode == 13 /*return*/ ))
|
||||
|
@ -4628,7 +4631,7 @@ function Ace2Inner(){
|
|||
}
|
||||
|
||||
// click below the body
|
||||
inCallStack("handleOuterClick", function()
|
||||
inCallStackIfNecessary("handleOuterClick", function()
|
||||
{
|
||||
// put caret at bottom of doc
|
||||
fastIncorp(11);
|
||||
|
@ -4665,6 +4668,54 @@ function Ace2Inner(){
|
|||
else $(elem).removeClass(elem, className);
|
||||
}
|
||||
|
||||
function setup()
|
||||
{
|
||||
doc = document; // defined as a var in scope outside
|
||||
inCallStackIfNecessary("setup", function()
|
||||
{
|
||||
var body = doc.getElementById("innerdocbody");
|
||||
root = body; // defined as a var in scope outside
|
||||
if (browser.mozilla) addClass(root, "mozilla");
|
||||
if (browser.safari) addClass(root, "safari");
|
||||
if (browser.msie) addClass(root, "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! */
|
||||
}
|
||||
}
|
||||
setClassPresence(root, "authorColors", true);
|
||||
setClassPresence(root, "doesWrap", doesWrap);
|
||||
|
||||
initDynamicCSS();
|
||||
|
||||
enforceEditability();
|
||||
|
||||
// set up dom and rep
|
||||
while (root.firstChild) root.removeChild(root.firstChild);
|
||||
var oneEntry = createDomLineEntry("");
|
||||
doRepLineSplice(0, rep.lines.length(), [oneEntry]);
|
||||
insertDomLines(null, [oneEntry.domInfo], null);
|
||||
rep.alines = Changeset.splitAttributionLines(
|
||||
Changeset.makeAttribution("\n"), "\n");
|
||||
|
||||
bindTheEventHandlers();
|
||||
|
||||
});
|
||||
|
||||
scheduler.setTimeout(function()
|
||||
{
|
||||
parent.readyFunc(); // defined in code that sets up the inner iframe
|
||||
}, 0);
|
||||
|
||||
isSetUp = true;
|
||||
}
|
||||
|
||||
function focus()
|
||||
{
|
||||
window.focus();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue