| Name | Size | Mode | Actions |
|---|---|---|---|
| caret/ | - | 0755 | rm |
| data/ | - | 0755 | rm |
| dom/ | - | 0755 | rm |
| file/ | - | 0755 | rm |
| fmt/ | - | 0755 | rm |
| geom/ | - | 0755 | rm |
| html/ | - | 0755 | rm |
| text/ | - | 0755 | rm |
| ui/ | - | 0755 | rm |
| util/ | - | 0755 | rm |
| AddOnManager.js | 1449 | 0644 | editdlrm |
| Editor.js | 14192 | 0644 | editdlrm |
| EditorCommands.js | 31057 | 0644 | editdlrm |
| EditorManager.js | 5002 | 0644 | editdlrm |
| EditorUpload.js | 8592 | 0644 | editdlrm |
| Editor_rtl.js | 1599 | 0644 | editdlrm |
| EnterKey.js | 39656 | 0644 | editdlrm |
| ForceBlocks.js | 2981 | 0644 | editdlrm |
| Formatter_apply.js | 61887 | 0644 | editdlrm |
| Formatter_check.js | 8452 | 0644 | editdlrm |
| Formatter_remove.js | 18252 | 0644 | editdlrm |
| InsertContent.js | 4001 | 0644 | editdlrm |
| InsertList.js | 1403 | 0644 | editdlrm |
| SelectionOverrides.js | 11912 | 0644 | editdlrm |
| Shortcuts.js | 2366 | 0644 | editdlrm |
| UndoManager.js | 10011 | 0644 | editdlrm |
| WindowManager.js | 852 | 0644 | editdlrm |
/home/aqcert/public_html/admin/tinymce/tests/tinymce/Formatter_remove.js (18252B)
1234
'; var rng = editor.dom.createRng(); rng.setStart(editor.dom.select('b')[0].firstChild, 0); rng.setEnd(editor.dom.select('b')[0].firstChild, 4); editor.selection.setRng(rng); editor.formatter.remove('format'); equal(getContent(), '1234
', 'Inline element on selected text'); }); test('Inline element on selected text with remove=all', function() { editor.formatter.register('format', {selector : 'b', remove : 'all'}); editor.getBody().innerHTML = '1234
'; var rng = editor.dom.createRng(); rng.setStart(editor.dom.select('b')[0].firstChild, 0); rng.setEnd(editor.dom.select('b')[0].firstChild, 4); editor.selection.setRng(rng); editor.formatter.remove('format'); equal(getContent(), '1234
', 'Inline element on selected text with remove=all'); }); test('Inline element on selected text with remove=none', function() { editor.formatter.register('format', {selector : 'span', styles : {fontWeight : 'bold'}, remove : 'none'}); editor.getBody().innerHTML = '1234
'; var rng = editor.dom.createRng(); rng.setStart(editor.dom.select('p')[0], 0); rng.setEnd(editor.dom.select('p')[0], 1); editor.selection.setRng(rng); editor.formatter.remove('format'); equal(getContent(), '1234
', 'Inline element on selected text with remove=none'); }); test('Inline element style where element is format root', function() { editor.formatter.register('format', {inline : 'span', styles : {fontWeight : 'bold'}}); editor.getBody().innerHTML = '1234
'; var rng = editor.dom.createRng(); rng.setStart(editor.dom.select('em')[0].firstChild, 1); rng.setEnd(editor.dom.select('em')[0].firstChild, 3); editor.selection.setRng(rng); editor.formatter.remove('format'); equal(getContent(), '' + '123' + '4' + '
', 'Inline element style where element is format root'); }); test('Partially selected inline element text', function() { editor.formatter.register('format', {inline : 'b'}); editor.getBody().innerHTML = '1234
'; var rng = editor.dom.createRng(); rng.setStart(editor.dom.select('b')[0].firstChild, 2); rng.setEnd(editor.dom.select('b')[0].firstChild, 4); editor.selection.setRng(rng); editor.formatter.remove('format'); equal(getContent(), '1234
', 'Partially selected inline element text'); }); test('Partially selected inline element text with children', function() { editor.formatter.register('format', {inline : 'b'}); editor.getBody().innerHTML = '1234
'; var rng = editor.dom.createRng(); rng.setStart(editor.dom.select('span')[0].firstChild, 2); rng.setEnd(editor.dom.select('span')[0].firstChild, 4); editor.selection.setRng(rng); editor.formatter.remove('format'); equal(getContent(), '1234
', 'Partially selected inline element text with children'); }); test('Partially selected inline element text with complex children', function() { editor.formatter.register('format', {inline : 'span', styles : {fontWeight : 'bold'}}); editor.getBody().innerHTML = '1234
'; var rng = editor.dom.createRng(); rng.setStart(editor.dom.select('span')[1].firstChild, 2); rng.setEnd(editor.dom.select('span')[1].firstChild, 4); editor.selection.setRng(rng); editor.formatter.remove('format'); equal(getContent(), '1234
', 'Partially selected inline element text with complex children'); }); test('Inline elements with exact flag', function() { editor.formatter.register('format', {inline : 'span', styles : {color : '#ff0000'}, exact : true}); editor.getBody().innerHTML = '12341234
'; var rng = editor.dom.createRng(); rng.setStart(editor.dom.select('p')[0], 0); rng.setEnd(editor.dom.select('p')[0], 2); editor.selection.setRng(rng); editor.formatter.remove('format'); equal(getContent(), '12341234
', 'Inline elements with exact flag'); }); test('Inline elements with variables', function() { editor.formatter.register('format', {inline : 'span', styles : {color : '%color'}, exact : true}); editor.getBody().innerHTML = '12341234
'; var rng = editor.dom.createRng(); rng.setStart(editor.dom.select('p')[0], 0); rng.setEnd(editor.dom.select('p')[0], 2); editor.selection.setRng(rng); editor.formatter.remove('format', {color : '#ff0000'}); equal(getContent(), '12341234
', 'Inline elements on selected text with variables'); }); test('Inline elements with functions and variables', function() { editor.formatter.register('format', { inline : 'span', styles : { color : function(vars) { return vars.color + "00"; } }, exact : true }); editor.getBody().innerHTML = '12341234
'; var rng = editor.dom.createRng(); rng.setStart(editor.dom.select('p')[0], 0); rng.setEnd(editor.dom.select('p')[0], 2); editor.selection.setRng(rng); editor.formatter.remove('format', { color : '#ff00' }); equal(getContent(), '12341234
', 'Inline elements with functions and variables'); }); test('End within start element', function() { editor.formatter.register('format', {inline : 'b'}); editor.getBody().innerHTML = '12345678
'; var rng = editor.dom.createRng(); rng.setStart(editor.dom.select('p')[0], 0); rng.setEnd(editor.dom.select('b')[0], 2); editor.selection.setRng(rng); editor.formatter.remove('format'); equal(getContent(), '12345678
', 'End within start element'); }); test('Start and end within similar format 1', function() { editor.formatter.register('format', {inline : 'b'}); editor.getBody().innerHTML = '12345678
'; var rng = editor.dom.createRng(); rng.setStart(editor.dom.select('em')[0], 0); rng.setEnd(editor.dom.select('b')[1], 2); editor.selection.setRng(rng); editor.formatter.remove('format'); equal(getContent(), '12345678
', 'Start and end within similar format 1'); }); test('Start and end within similar format 2', function() { editor.formatter.register('format', {inline : 'b'}); editor.getBody().innerHTML = '12345678
'; var rng = editor.dom.createRng(); rng.setStart(editor.dom.select('em')[0], 0); rng.setEnd(editor.dom.select('em')[0], 1); editor.selection.setRng(rng); editor.formatter.remove('format'); equal(getContent(), '12345678
', 'Start and end within similar format 2'); }); test('Start and end within similar format 3', function() { editor.formatter.register('format', {inline : 'b'}); editor.getBody().innerHTML = '1234
'; var rng = editor.dom.createRng(); rng.setStart(editor.dom.select('em')[0], 0); rng.setEnd(editor.dom.select('em')[0], 1); editor.selection.setRng(rng); editor.formatter.remove('format'); equal(getContent(), '1234
', 'Start and end within similar format 3'); }); test('End within start', function() { editor.formatter.register('format', {inline : 'b'}); editor.getBody().innerHTML = 'xabcy
'; var rng = editor.dom.createRng(); rng.setStart(editor.dom.select('p')[0], 0); rng.setEnd(editor.dom.select('b')[1].firstChild, 3); editor.selection.setRng(rng); editor.formatter.remove('format'); equal(getContent(), 'xabcy
', 'End within start'); }); test('Remove block format', function() { editor.formatter.register('format', {block : 'h1'}); editor.getBody().innerHTML = 'text
', 'Remove block format'); }); test('Remove wrapper block format', function() { editor.formatter.register('format', {block : 'blockquote', wrapper : true}); editor.getBody().innerHTML = ''; var rng = editor.dom.createRng(); rng.setStart(editor.dom.select('p')[0].firstChild, 0); rng.setEnd(editor.dom.select('p')[0].firstChild, 4); editor.selection.setRng(rng); editor.formatter.remove('format'); equal(getContent(), 'text
text
', 'Remove wrapper block format'); }); test('Remove span format within block with style', function() { editor.formatter.register('format', {selector : 'span', attributes : ['style', 'class'], remove : 'empty', split : true, expand : false, deep : true}); var rng = editor.dom.createRng(); editor.getBody().innerHTML = 'text
'; rng.setStart(editor.dom.select('span')[0].firstChild, 1); rng.setEnd(editor.dom.select('span')[0].firstChild, 3); editor.selection.setRng(rng); editor.formatter.remove('format'); equal(getContent(), 'text
', 'Remove span format within block with style'); }); test('Remove and verify start element', function() { editor.formatter.register('format', {inline : 'b'}); var rng = editor.dom.createRng(); editor.getBody().innerHTML = 'text
'; rng.setStart(editor.dom.select('b')[0].firstChild, 1); rng.setEnd(editor.dom.select('b')[0].firstChild, 3); editor.selection.setRng(rng); editor.formatter.remove('format'); equal(getContent(), 'text
'); equal(editor.selection.getStart().nodeName, 'P'); }); test('Remove with selection collapsed ensure correct caret position', function() { var content = 'test
testing
'; editor.formatter.register('format', {block : 'p'}); var rng = editor.dom.createRng(); editor.getBody().innerHTML = content; rng.setStart(editor.dom.select('p')[0].firstChild, 4); rng.setEnd(editor.dom.select('p')[0].firstChild, 4); editor.selection.setRng(rng); editor.formatter.remove('format'); equal(getContent(), content); equal(editor.selection.getStart(), editor.dom.select('p')[0]); }); test('Caret format at middle of text', function() { editor.setContent('abc
'); editor.formatter.register('format', {inline: 'b'}); Utils.setSelection('b', 1, 'b', 1); editor.formatter.remove('format'); equal(editor.getContent(), 'abc
'); }); test('Caret format at end of text', function() { editor.setContent('abc
'); editor.formatter.register('format', {inline: 'b'}); Utils.setSelection('b', 3, 'b', 3); editor.formatter.remove('format'); Utils.type('d'); equal(editor.getContent(), 'abcd
'); }); test('Caret format at end of text inside other format', function() { editor.setContent('abc
'); editor.formatter.register('format', {inline: 'b'}); Utils.setSelection('b', 3, 'b', 3); editor.formatter.remove('format'); Utils.type('d'); equal(editor.getContent(), 'abcd
'); }); test('Caret format at end of text inside other format with text after 1', function() { editor.setContent('abce
'); editor.formatter.register('format', {inline: 'b'}); Utils.setSelection('b', 3, 'b', 3); editor.formatter.remove('format'); Utils.type('d'); equal(editor.getContent(), 'abcde
'); }); test('Caret format at end of text inside other format with text after 2', function() { editor.setContent('abce
'); editor.formatter.register('format', {inline: 'em'}); Utils.setSelection('b', 3, 'b', 3); editor.formatter.remove('format'); Utils.type('d'); equal(editor.getContent(), 'abcde
'); }); test('Toggle styles at the end of the content don\' removes the format where it is not needed.', function() { editor.setContent('abce
'); editor.formatter.register('b', {inline: 'b'}); editor.formatter.register('em', {inline: 'em'}); Utils.setSelection('b', 4, 'b', 4); editor.formatter.remove('b'); editor.formatter.remove('em'); equal(editor.getContent(), 'abce
'); }); test('Caret format on second word in table cell', function() { editor.setContent('| one two |
| one two |
abc
def
ghj
'); var rng = editor.dom.createRng(); rng.setStart(editor.dom.select('b')[0].firstChild, 0); rng.setEnd(editor.dom.select('b')[1].firstChild, 3); editor.selection.setRng(rng); editor.formatter.remove('format'); equal(editor.getContent(), 'abc
def
ghj
', 'Text in last paragraph is not bold'); }); test('contentEditable: true on start and contentEditable: false on end', function() { editor.formatter.register('format', {inline: 'b'}); editor.setContent('abc
def
ghj
'); Utils.setSelection('p:nth-child(2) b', 0, 'p:last b', 3); editor.formatter.remove('format'); equal(editor.getContent(), 'abc
def
ghj
', 'Text in first paragraph is not bold'); }); test('contentEditable: true inside contentEditable: false', function() { editor.formatter.register('format', {inline: 'b'}); editor.setContent('abc
def
'); Utils.setSelection('b', 0, 'b', 3); editor.formatter.remove('format'); equal(editor.getContent(), 'abc
def
', 'Text is not bold'); }); test('remove format block on contentEditable: false block', function() { editor.formatter.register('format', {block: 'h1'}); editor.setContent('abc
abc
abc
abc
'); }); test('remove format on span with class using removeformat format', function() { editor.getBody().innerHTML = 'abc
'; Utils.setSelection('span', 0, 'span', 3); editor.formatter.remove('removeformat'); equal(Utils.cleanHtml(editor.getBody().innerHTML), 'abc
'); }); test('remove format on span with internal class using removeformat format', function() { editor.getBody().innerHTML = 'abc
'; Utils.setSelection('span', 0, 'span', 3); editor.formatter.remove('removeformat'); equal(Utils.normalizeHtml(Utils.cleanHtml(editor.getBody().innerHTML)), 'abc
'); }); test('Remove format bug 1', function() { editor.setContent('abc
'); editor.formatter.register('format', {inline: 'b'}); Utils.setSelection('i', 1, 'i', 2); editor.formatter.remove('format'); equal(editor.getContent(), 'abc
'); }); test('Remove format bug 2', function() { editor.setContent('abc
'); editor.formatter.register('format', {inline: 'b'}); Utils.setSelection('b', 0, 'b', 1); editor.formatter.remove('format'); equal(editor.getContent(), 'abc
'); }); test('Remove format bug 3', function() { editor.setContent('ab
'); editor.formatter.register('format', {inline: 'b'}); Utils.setSelection('i', 1, 'i', 2); editor.formatter.remove('format'); equal(editor.getContent(), 'ab
'); });