mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-05-08 16:05:05 -04:00
Merge 8649be0e56
into 642b716553
This commit is contained in:
commit
f6ffb384a6
8 changed files with 45 additions and 3 deletions
|
@ -2588,6 +2588,17 @@ function OUTER(gscope)
|
|||
}
|
||||
editorInfo.ace_setAttributeOnSelection = setAttributeOnSelection;
|
||||
|
||||
function toggleAttributeOnSelectedLine(attributeName)
|
||||
{
|
||||
if (!(rep.selStart && rep.selEnd)) return;
|
||||
//set the full line to be selected
|
||||
rep.selStart[1]=0;
|
||||
rep.selEnd[1]=rep.lines.atIndex(rep.selEnd[0]).text.length;
|
||||
toggleAttributeOnSelection(attributeName);
|
||||
}
|
||||
editorInfo.ace_toggleAttributeOnSelectedLine = toggleAttributeOnSelectedLine;
|
||||
|
||||
|
||||
function toggleAttributeOnSelection(attributeName)
|
||||
{
|
||||
if (!(rep.selStart && rep.selEnd)) return;
|
||||
|
@ -2602,7 +2613,6 @@ function OUTER(gscope)
|
|||
{
|
||||
return withItRegex.test(attribs);
|
||||
}
|
||||
|
||||
var selStartLine = rep.selStart[0];
|
||||
var selEndLine = rep.selEnd[0];
|
||||
for (var n = selStartLine; n <= selEndLine; n++)
|
||||
|
|
|
@ -33,7 +33,9 @@ linestylefilter.ATTRIB_CLASSES = {
|
|||
'bold': 'tag:b',
|
||||
'italic': 'tag:i',
|
||||
'underline': 'tag:u',
|
||||
'strikethrough': 'tag:s'
|
||||
'strikethrough': 'tag:s',
|
||||
'heading1': 'tag:h1',
|
||||
'heading2': 'tag:h2'
|
||||
};
|
||||
|
||||
linestylefilter.getAuthorClassName = function(author)
|
||||
|
|
|
@ -31,7 +31,9 @@ linestylefilter.ATTRIB_CLASSES = {
|
|||
'bold': 'tag:b',
|
||||
'italic': 'tag:i',
|
||||
'underline': 'tag:u',
|
||||
'strikethrough': 'tag:s'
|
||||
'strikethrough': 'tag:s',
|
||||
'heading1': 'tag:h1',
|
||||
'heading2': 'tag:h2'
|
||||
};
|
||||
|
||||
linestylefilter.getAuthorClassName = function(author)
|
||||
|
|
|
@ -124,6 +124,7 @@ var padeditbar = (function()
|
|||
padeditor.ace.callWithAce(function(ace)
|
||||
{
|
||||
if (cmd == 'bold' || cmd == 'italic' || cmd == 'underline' || cmd == 'strikethrough') ace.ace_toggleAttributeOnSelection(cmd);
|
||||
else if (cmd == 'heading1' || cmd == 'heading2') ace.ace_toggleAttributeOnSelectedLine(cmd);
|
||||
else if (cmd == 'undo' || cmd == 'redo') ace.ace_doUndoRedo(cmd);
|
||||
else if (cmd == 'insertunorderedlist') ace.ace_doInsertUnorderedList();
|
||||
else if (cmd == 'indent')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue