Changeset 28138
- Timestamp:
- 04/15/2014 10:06:11 PM (10 years ago)
- Location:
- trunk/tests/qunit/editor
- Files:
-
- 2 added
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/qunit/editor/index.html
r27679 r28138 6 6 <meta http-equiv="X-UA-Compatible" content="IE=edge" /> 7 7 <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0" /> 8 <title>QUnit tests</title>9 8 <link rel="stylesheet" href="js/qunit/qunit.css" type="text/css" /> 10 9 <link rel="stylesheet" href="../../../src/wp-includes/js/tinymce/skins/lightgray/skin.min.css" type="text/css" /> … … 71 70 72 71 <!-- tinymce.* --> 72 <script src="tinymce/AddOnManager.js"></script> 73 73 <script src="tinymce/Editor.js"></script> 74 74 <script src="tinymce/EditorCommands.js"></script> 75 <script src="tinymce/EditorManager.js"></script> 75 76 <script src="tinymce/EnterKey.js"></script> 76 77 <script src="tinymce/ForceBlocks.js"></script> -
trunk/tests/qunit/editor/js/init.js
r27679 r28138 1 1 (function() { 2 var coverObjects = [], modulesExecuted = {} ;2 var coverObjects = [], modulesExecuted = {}, log = [], currentModule; 3 3 4 4 QUnit.config.reorder = false; 5 QUnit.config.hidepassed = true; 5 6 6 7 var oldModule = module; 7 8 8 9 QUnit.moduleStart(function(details) { 10 currentModule = details.name; 9 11 modulesExecuted[details.name] = true; 10 12 … … 18 20 }); 19 21 20 QUnit.done(function() { 22 // Sauce labs 23 QUnit.testStart(function(testDetails) { 24 QUnit.log = function(details) { 25 if (!details.result) { 26 details.name = currentModule + ':' + testDetails.name; 27 log.push(details); 28 } 29 }; 30 }); 31 32 QUnit.done(function(results) { 21 33 document.getElementById("view").style.display = 'none'; 22 34 … … 28 40 }).appendTo(document.body); 29 41 } 42 43 // Sauce labs 44 var tests = []; 45 for (var i = 0; i < log.length; i++) { 46 tests.push({ 47 name: log[i].name, 48 result: log[i].result, 49 expected: log[i].expected, 50 actual: log[i].actual, 51 source: log[i].source 52 }); 53 } 54 55 results.tests = tests; 56 window.global_test_results = results; 30 57 }); 31 58 -
trunk/tests/qunit/editor/js/utils.js
r27679 r28138 99 99 ev = document.createEvent('UIEvents'); 100 100 101 if (ev.initUIEvent) 101 if (ev.initUIEvent) { 102 102 ev.initUIEvent(na, true, true, window, 1); 103 } 103 104 104 105 ev.keyCode = o.keyCode; … … 111 112 function normalizeRng(rng) { 112 113 if (rng.startContainer.nodeType == 3) { 113 if (rng.startOffset == 0)114 if (rng.startOffset === 0) { 114 115 rng.setStartBefore(rng.startContainer); 115 else if (rng.startOffset >= rng.startContainer.nodeValue.length - 1)116 } else if (rng.startOffset >= rng.startContainer.nodeValue.length - 1) { 116 117 rng.setStartAfter(rng.startContainer); 118 } 117 119 } 118 120 119 121 if (rng.endContainer.nodeType == 3) { 120 if (rng.endOffset == 0)122 if (rng.endOffset === 0) { 121 123 rng.setEndBefore(rng.endContainer); 122 else if (rng.endOffset >= rng.endContainer.nodeValue.length - 1)124 } else if (rng.endOffset >= rng.endContainer.nodeValue.length - 1) { 123 125 rng.setEndAfter(rng.endContainer); 126 } 124 127 } 125 128 … … 129 132 // TODO: Replace this with the new event logic in 3.5 130 133 function type(chr) { 131 var editor = tinymce.activeEditor, keyCode, charCode, ev ent = tinymce.dom.Event, evt, startElm, rng;134 var editor = tinymce.activeEditor, keyCode, charCode, evt, startElm, rng; 132 135 133 136 function fakeEvent(target, type, evt) { … … 316 319 function trimBrsOnIE(html) { 317 320 return html.replace(/<br[^>]*>/gi, ''); 321 } 322 323 function patch(proto, name, patchFunc) { 324 var originalFunc = proto[name]; 325 var originalFuncs = proto.__originalFuncs; 326 327 if (!originalFuncs) { 328 proto.__originalFuncs = originalFuncs = {}; 329 } 330 331 if (!originalFuncs[name]) { 332 originalFuncs[name] = originalFunc; 333 } else { 334 originalFunc = originalFuncs[name]; 335 } 336 337 proto[name] = function() { 338 var args = Array.prototype.slice.call(arguments); 339 args.unshift(originalFunc); 340 return patchFunc.apply(this, args); 341 }; 342 } 343 344 function unpatch(proto, name) { 345 var originalFuncs = proto.__originalFuncs; 346 347 if (!originalFuncs) { 348 return; 349 } 350 351 if (name) { 352 proto[name] = originalFuncs[name]; 353 delete originalFuncs[name]; 354 } else { 355 for (var key in originalFuncs) { 356 proto[key] = originalFuncs[key]; 357 } 358 359 delete proto.__originalFuncs; 360 } 318 361 } 319 362 … … 335 378 pressArrowKey: pressArrowKey, 336 379 pressEnter: pressEnter, 337 trimBrsOnIE: trimBrsOnIE 380 trimBrsOnIE: trimBrsOnIE, 381 patch: patch, 382 unpatch: unpatch 338 383 }; 339 384 })(); -
trunk/tests/qunit/editor/plugins/lists.js
r27679 r28138 5 5 6 6 function wait() { 7 if ( editor &&inlineEditor) {7 if (window.editor && window.inlineEditor) { 8 8 if (!QUnit.started) { 9 9 QUnit.start(); … … 450 450 }); 451 451 452 test('Apply UL list to br line and text block line', function() { 453 editor.settings.forced_root_block = false; 454 455 editor.setContent( 456 'a' + 457 '<p>b</p>' 458 ); 459 460 var rng = editor.dom.createRng(); 461 rng.setStart(editor.getBody().firstChild, 0); 462 rng.setEnd(editor.getBody().lastChild.firstChild, 1); 463 editor.selection.setRng(rng); 464 execCommand('InsertUnorderedList'); 465 466 equal(editor.getContent(), 467 '<ul>' + 468 '<li>a</li>' + 469 '<li>b</li>' + 470 '</ul>' 471 ); 472 473 equal(editor.selection.getStart().nodeName, 'LI'); 474 equal(editor.selection.getEnd().nodeName, 'LI'); 475 }); 452 // Ignore on IE 7, 8 this is a known bug not worth fixing 453 if (!tinymce.Env.ie || tinymce.Env.ie > 8) { 454 test('Apply UL list to br line and text block line', function() { 455 editor.settings.forced_root_block = false; 456 457 editor.setContent( 458 'a' + 459 '<p>b</p>' 460 ); 461 462 var rng = editor.dom.createRng(); 463 rng.setStart(editor.getBody().firstChild, 0); 464 rng.setEnd(editor.getBody().lastChild.firstChild, 1); 465 editor.selection.setRng(rng); 466 execCommand('InsertUnorderedList'); 467 468 equal(editor.getContent(), 469 '<ul>' + 470 '<li>a</li>' + 471 '<li>b</li>' + 472 '</ul>' 473 ); 474 475 equal(editor.selection.getStart().nodeName, 'LI'); 476 equal(editor.selection.getEnd().nodeName, 'LI'); 477 }); 478 } 476 479 477 480 test('Apply UL list to text block line and br line', function() { … … 839 842 }); 840 843 841 test('Remove empty UL between two textblocks in BR mode', function() { 842 editor.settings.forced_root_block = false; 843 844 editor.getBody().innerHTML = trimBrs( 845 '<div>a</div>' + 846 '<ul>' + 847 '<li></li>' + 848 '</ul>' + 849 '<div>b</div>' 850 ); 851 852 editor.focus(); 853 Utils.setSelection('li:first', 0); 854 execCommand('InsertUnorderedList'); 855 856 equal(editor.getContent(), 857 '<div>a</div>' + 858 '<br />' + 859 '<div>b</div>' 860 ); 861 equal(editor.selection.getStart().nodeName, 'BR'); 862 }); 844 // Ignore on IE 7, 8 this is a known bug not worth fixing 845 if (!tinymce.Env.ie || tinymce.Env.ie > 8) { 846 test('Remove empty UL between two textblocks in BR mode', function() { 847 editor.settings.forced_root_block = false; 848 849 editor.getBody().innerHTML = trimBrs( 850 '<div>a</div>' + 851 '<ul>' + 852 '<li></li>' + 853 '</ul>' + 854 '<div>b</div>' 855 ); 856 857 editor.focus(); 858 Utils.setSelection('li:first', 0); 859 execCommand('InsertUnorderedList'); 860 861 equal(editor.getContent(), 862 '<div>a</div>' + 863 '<br />' + 864 '<div>b</div>' 865 ); 866 equal(editor.selection.getStart().nodeName, 'BR'); 867 }); 868 } 863 869 864 870 // Outdent … … 1731 1737 test('Remove UL in inline body element contained in LI', function() { 1732 1738 inlineEditor.setContent('<ul><li>a</li></ul>'); 1733 inlineEditor. focus();1739 inlineEditor.selection.setCursorLocation(); 1734 1740 inlineEditor.execCommand('InsertUnorderedList'); 1735 1741 equal(inlineEditor.getContent(), '<p>a</p>'); -
trunk/tests/qunit/editor/plugins/noneditable.js
r27679 r28138 24 24 }); 25 25 26 test('expand to noneditable (start)', function() { 27 editor.setContent('<p><span class="mceNonEditable">no</span>yes</p>'); 28 29 var rng = editor.dom.createRng(); 30 rng.setStart(editor.getBody().firstChild.firstChild.firstChild, 1); 31 rng.setEnd(editor.getBody().firstChild.lastChild, 1); 32 editor.selection.setRng(rng); 33 34 editor.dom.fire(editor.getBody(), 'mouseup'); 35 rng = Utils.normalizeRng(editor.selection.getRng(true)); 36 37 equal(rng.startContainer.nodeName, 'P'); 38 equal(rng.startOffset, 0); 39 equal(rng.endContainer.nodeName, '#text'); 40 equal(rng.endOffset, 1); 41 }); 42 43 test('expand to noneditable (end)', function() { 44 editor.setContent('<p>yes<span class="mceNonEditable">no</span></p>'); 45 46 var rng = editor.dom.createRng(); 47 rng.setStart(editor.getBody().firstChild.firstChild, 1); 48 rng.setEnd(editor.getBody().firstChild.lastChild.firstChild, 1); 49 editor.selection.setRng(rng); 50 51 editor.dom.fire(editor.getBody(), 'mouseup'); 52 rng = Utils.normalizeRng(editor.selection.getRng(true)); 53 54 equal(rng.startContainer.nodeName, '#text'); 55 equal(rng.startOffset, 1); 56 equal(rng.endContainer.nodeName, 'P'); 57 equal(rng.endOffset, 2); 58 }); 59 60 test('expand to noneditable (start/end)', function() { 61 editor.setContent('<p>yes<span class="mceNonEditable">noedit</span>yes</p>'); 62 63 var rng = editor.dom.createRng(); 64 rng.setStart(editor.dom.select('span')[0].firstChild, 1); 65 rng.setEnd(editor.dom.select('span')[0].firstChild, 2); 66 editor.selection.setRng(rng); 67 68 editor.dom.fire(editor.getBody(), 'mouseup'); 69 rng = Utils.normalizeRng(editor.selection.getRng(true)); 70 71 equal(rng.startContainer.nodeName, 'P'); 72 equal(rng.startOffset, 1); 73 equal(rng.endContainer.nodeName, 'P'); 74 equal(rng.endOffset, 2); 75 }); 76 77 test('type after non editable', function() { 78 editor.setContent('<p><span class="mceNonEditable">no</span>yes</p>'); 79 80 var rng = editor.dom.createRng(); 81 rng.setStart(editor.dom.select('span')[0].firstChild, 2); 82 rng.setEnd(editor.dom.select('span')[0].firstChild, 2); 83 editor.selection.setRng(rng); 84 85 editor.dom.fire(editor.getBody(), 'mouseup'); 86 Utils.type('X'); 87 rng = Utils.normalizeRng(editor.selection.getRng(true)); 88 89 equal(rng.startContainer.getAttribute('data-mce-bogus'), 'true'); 90 equal(rng.startContainer.nodeName, 'SPAN'); 91 equal(rng.startOffset, 1); 92 equal(rng.endContainer.nodeName, 'SPAN'); 93 equal(rng.endOffset, 1); 94 equal(editor.getContent(), '<p><span class="mceNonEditable">no</span>Xyes</p>'); 95 }); 26 // Ignore on IE 7, 8 this is a known bug not worth fixing 27 if (!tinymce.Env.ie || tinymce.Env.ie > 8) { 28 test('expand to noneditable (start)', function() { 29 editor.setContent('<p><span class="mceNonEditable">no</span>yes</p>'); 30 31 var rng = editor.dom.createRng(); 32 rng.setStart(editor.getBody().firstChild.firstChild.firstChild, 1); 33 rng.setEnd(editor.getBody().firstChild.lastChild, 1); 34 editor.selection.setRng(rng); 35 36 editor.dom.fire(editor.getBody(), 'mouseup'); 37 rng = Utils.normalizeRng(editor.selection.getRng(true)); 38 39 equal(rng.startContainer.nodeName, 'P'); 40 equal(rng.startOffset, 0); 41 equal(rng.endContainer.nodeName, '#text'); 42 equal(rng.endOffset, 1); 43 }); 44 45 test('expand to noneditable (end)', function() { 46 editor.setContent('<p>yes<span class="mceNonEditable">no</span></p>'); 47 48 var rng = editor.dom.createRng(); 49 rng.setStart(editor.getBody().firstChild.firstChild, 1); 50 rng.setEnd(editor.getBody().firstChild.lastChild.firstChild, 1); 51 editor.selection.setRng(rng); 52 53 editor.dom.fire(editor.getBody(), 'mouseup'); 54 rng = Utils.normalizeRng(editor.selection.getRng(true)); 55 56 equal(rng.startContainer.nodeName, '#text'); 57 equal(rng.startOffset, 1); 58 equal(rng.endContainer.nodeName, 'P'); 59 equal(rng.endOffset, 2); 60 }); 61 62 test('expand to noneditable (start/end)', function() { 63 editor.setContent('<p>yes<span class="mceNonEditable">noedit</span>yes</p>'); 64 65 var rng = editor.dom.createRng(); 66 rng.setStart(editor.dom.select('span')[0].firstChild, 1); 67 rng.setEnd(editor.dom.select('span')[0].firstChild, 2); 68 editor.selection.setRng(rng); 69 70 editor.dom.fire(editor.getBody(), 'mouseup'); 71 rng = Utils.normalizeRng(editor.selection.getRng(true)); 72 73 equal(rng.startContainer.nodeName, 'P'); 74 equal(rng.startOffset, 1); 75 equal(rng.endContainer.nodeName, 'P'); 76 equal(rng.endOffset, 2); 77 }); 78 79 test('type after non editable', function() { 80 editor.setContent('<p><span class="mceNonEditable">no</span>yes</p>'); 81 82 var rng = editor.dom.createRng(); 83 rng.setStart(editor.dom.select('span')[0].firstChild, 2); 84 rng.setEnd(editor.dom.select('span')[0].firstChild, 2); 85 editor.selection.setRng(rng); 86 87 editor.dom.fire(editor.getBody(), 'mouseup'); 88 Utils.type('X'); 89 rng = Utils.normalizeRng(editor.selection.getRng(true)); 90 91 equal(rng.startContainer.getAttribute('data-mce-bogus'), 'true'); 92 equal(rng.startContainer.nodeName, 'SPAN'); 93 equal(rng.startOffset, 1); 94 equal(rng.endContainer.nodeName, 'SPAN'); 95 equal(rng.endOffset, 1); 96 equal(editor.getContent(), '<p><span class="mceNonEditable">no</span>Xyes</p>'); 97 }); 98 } 96 99 97 100 test('type between non editable', function() { … … 135 138 }); 136 139 137 test('escape noneditable inline element (left)', function() { 138 editor.setContent('<p>no <span class="mceNonEditable">yes</span> no</p><p class="mceNonEditable">no</p>'); 139 140 var rng = editor.dom.createRng(); 141 rng.selectNode(editor.dom.select('span')[0]); 142 editor.selection.setRng(rng); 143 144 Utils.type({keyCode: 37}); 145 rng = Utils.normalizeRng(editor.selection.getRng(true)); 146 147 equal(rng.startContainer.nodeName, 'SPAN'); 148 equal(rng.startContainer.parentNode.nodeName, 'P'); 149 equal(editor.dom.nodeIndex(rng.startContainer), 1); 150 equal(rng.collapsed, true); 151 }); 140 // Ignore on IE 7, 8 this is a known bug not worth fixing 141 if (!tinymce.Env.ie || tinymce.Env.ie > 8) { 142 test('escape noneditable inline element (left)', function() { 143 editor.setContent('<p>no <span class="mceNonEditable">yes</span> no</p><p class="mceNonEditable">no</p>'); 144 145 var rng = editor.dom.createRng(); 146 rng.selectNode(editor.dom.select('span')[0]); 147 editor.selection.setRng(rng); 148 149 Utils.type({keyCode: 37}); 150 rng = Utils.normalizeRng(editor.selection.getRng(true)); 151 152 equal(rng.startContainer.nodeName, 'SPAN'); 153 equal(rng.startContainer.parentNode.nodeName, 'P'); 154 equal(editor.dom.nodeIndex(rng.startContainer), 1); 155 equal(rng.collapsed, true); 156 }); 157 } 152 158 153 159 test('escape noneditable inline element (right)', function() { -
trunk/tests/qunit/editor/plugins/paste.js
r27679 r28138 16 16 } 17 17 }); 18 }, 19 20 teardown: function() { 21 delete editor.settings.paste_remove_styles_if_webkit; 22 delete editor.settings.paste_retain_style_properties; 23 delete editor.settings.paste_enable_default_filters; 24 delete editor.settings.paste_data_images; 18 25 } 19 26 }); … … 97 104 editor.execCommand('mceInsertClipboardContent', false, {content: '<p class="ListStyle" style="margin-left:36.0pt;mso-add-space:auto;text-indent:-18.0pt;mso-list:l0 level1 lfo1;tab-stops:list 36.0pt"><span lang="EN-US" style="color:black;mso-ansi-language:EN-US"><span style="mso-list:Ignore">1.<span style="font:7.0pt "Times New Roman""> </span></span></span><span lang="EN-US" style="font-family:Arial;mso-fareast-font-family:Arial;mso-bidi-font-family:Arial;color:black;mso-ansi-language:EN-US">Version 7.0</span><span lang="EN-US" style="font-family:Arial;mso-fareast-font-family:Arial;mso-bidi-font-family:Arial;color:black;mso-ansi-language:EN-US">:<o:p></o:p></span></p>'}); 98 105 equal(editor.getContent().replace(/[\r\n]+/g, ''), '<ol><li>Version 7.0:</li></ol>'); 99 editor.settings.paste_retain_style_properties = '';100 106 }); 101 107 … … 140 146 editor.execCommand('mceInsertClipboardContent', false, {content: '<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><meta name="ProgId" content="Word.Document"><meta name="Generator" content="Microsoft Word 12"><meta name="Originator" content="Microsoft Word 12"><link rel="File-List" href="file:///C:%5CUsers%5Cspocke%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_filelist.xml"><link rel="themeData" href="file:///C:%5CUsers%5Cspocke%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_themedata.thmx"><link rel="colorSchemeMapping" href="file:///C:%5CUsers%5Cspocke%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_colorschememapping.xml"><!--[if gte mso 9]><xml> <w:WordDocument> <w:View>Normal</w:View> <w:Zoom>0</w:Zoom> <w:TrackMoves/> <w:TrackFormatting/> <w:HyphenationZone>21</w:HyphenationZone> <w:PunctuationKerning/> <w:ValidateAgainstSchemas/> <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid> <w:IgnoreMixedContent>false</w:IgnoreMixedContent> <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText> <w:DoNotPromoteQF/> <w:LidThemeOther>SV</w:LidThemeOther> <w:LidThemeAsian>X-NONE</w:LidThemeAsian> <w:LidThemeComplexScript>X-NONE</w:LidThemeComplexScript> <w:Compatibility> <w:BreakWrappedTables/> <w:SnapToGridInCell/> <w:WrapTextWithPunct/> <w:UseAsianBreakRules/> <w:DontGrowAutofit/> <w:SplitPgBreakAndParaMark/> <w:DontVertAlignCellWithSp/> <w:DontBreakConstrainedForcedTables/> <w:DontVertAlignInTxbx/> <w:Word11KerningPairs/> <w:CachedColBalance/> </w:Compatibility> <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel> <m:mathPr> <m:mathFont m:val="Cambria Math"/> <m:brkBin m:val="before"/> <m:brkBinSub m:val="--"/> <m:smallFrac m:val="off"/> <m:dispDef/> <m:lMargin m:val="0"/> <m:rMargin m:val="0"/> <m:defJc m:val="centerGroup"/> <m:wrapIndent m:val="1440"/> <m:intLim m:val="subSup"/> <m:naryLim m:val="undOvr"/> </m:mathPr></w:WordDocument> </xml><![endif]--><!--[if gte mso 9]><xml> <w:LatentStyles DefLockedState="false" DefUnhideWhenUsed="true" DefSemiHidden="true" DefQFormat="false" DefPriority="99" LatentStyleCount="267"> <w:LsdException Locked="false" Priority="0" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="Normal"/> <w:LsdException Locked="false" Priority="9" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="heading 1"/> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 2"/> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 3"/> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 4"/> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 5"/> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 6"/> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 7"/> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 8"/> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 9"/> <w:LsdException Locked="false" Priority="39" Name="toc 1"/> <w:LsdException Locked="false" Priority="39" Name="toc 2"/> <w:LsdException Locked="false" Priority="39" Name="toc 3"/> <w:LsdException Locked="false" Priority="39" Name="toc 4"/> <w:LsdException Locked="false" Priority="39" Name="toc 5"/> <w:LsdException Locked="false" Priority="39" Name="toc 6"/> <w:LsdException Locked="false" Priority="39" Name="toc 7"/> <w:LsdException Locked="false" Priority="39" Name="toc 8"/> <w:LsdException Locked="false" Priority="39" Name="toc 9"/> <w:LsdException Locked="false" Priority="35" QFormat="true" Name="caption"/> <w:LsdException Locked="false" Priority="10" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="Title"/> <w:LsdException Locked="false" Priority="1" Name="Default Paragraph Font"/> <w:LsdException Locked="false" Priority="11" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="Subtitle"/> <w:LsdException Locked="false" Priority="22" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="Strong"/> <w:LsdException Locked="false" Priority="20" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="Emphasis"/> <w:LsdException Locked="false" Priority="59" SemiHidden="false" UnhideWhenUsed="false" Name="Table Grid"/> <w:LsdException Locked="false" UnhideWhenUsed="false" Name="Placeholder Text"/> <w:LsdException Locked="false" Priority="1" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="No Spacing"/> <w:LsdException Locked="false" Priority="60" SemiHidden="false" UnhideWhenUsed="false" Name="Light Shading"/> <w:LsdException Locked="false" Priority="61" SemiHidden="false" UnhideWhenUsed="false" Name="Light List"/> <w:LsdException Locked="false" Priority="62" SemiHidden="false" UnhideWhenUsed="false" Name="Light Grid"/> <w:LsdException Locked="false" Priority="63" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 1"/> <w:LsdException Locked="false" Priority="64" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 2"/> <w:LsdException Locked="false" Priority="65" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 1"/> <w:LsdException Locked="false" Priority="66" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 2"/> <w:LsdException Locked="false" Priority="67" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 1"/> <w:LsdException Locked="false" Priority="68" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 2"/> <w:LsdException Locked="false" Priority="69" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 3"/> <w:LsdException Locked="false" Priority="70" SemiHidden="false" UnhideWhenUsed="false" Name="Dark List"/> <w:LsdException Locked="false" Priority="71" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Shading"/> <w:LsdException Locked="false" Priority="72" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful List"/> <w:LsdException Locked="false" Priority="73" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Grid"/> <w:LsdException Locked="false" Priority="60" SemiHidden="false" UnhideWhenUsed="false" Name="Light Shading Accent 1"/> <w:LsdException Locked="false" Priority="61" SemiHidden="false" UnhideWhenUsed="false" Name="Light List Accent 1"/> <w:LsdException Locked="false" Priority="62" SemiHidden="false" UnhideWhenUsed="false" Name="Light Grid Accent 1"/> <w:LsdException Locked="false" Priority="63" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 1 Accent 1"/> <w:LsdException Locked="false" Priority="64" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 2 Accent 1"/> <w:LsdException Locked="false" Priority="65" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 1 Accent 1"/> <w:LsdException Locked="false" UnhideWhenUsed="false" Name="Revision"/> <w:LsdException Locked="false" Priority="34" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="List Paragraph"/> <w:LsdException Locked="false" Priority="29" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="Quote"/> <w:LsdException Locked="false" Priority="30" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="Intense Quote"/> <w:LsdException Locked="false" Priority="66" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 2 Accent 1"/> <w:LsdException Locked="false" Priority="67" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 1 Accent 1"/> <w:LsdException Locked="false" Priority="68" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 2 Accent 1"/> <w:LsdException Locked="false" Priority="69" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 3 Accent 1"/> <w:LsdException Locked="false" Priority="70" SemiHidden="false" UnhideWhenUsed="false" Name="Dark List Accent 1"/> <w:LsdException Locked="false" Priority="71" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Shading Accent 1"/> <w:LsdException Locked="false" Priority="72" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful List Accent 1"/> <w:LsdException Locked="false" Priority="73" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Grid Accent 1"/> <w:LsdException Locked="false" Priority="60" SemiHidden="false" UnhideWhenUsed="false" Name="Light Shading Accent 2"/> <w:LsdException Locked="false" Priority="61" SemiHidden="false" UnhideWhenUsed="false" Name="Light List Accent 2"/> <w:LsdException Locked="false" Priority="62" SemiHidden="false" UnhideWhenUsed="false" Name="Light Grid Accent 2"/> <w:LsdException Locked="false" Priority="63" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 1 Accent 2"/> <w:LsdException Locked="false" Priority="64" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 2 Accent 2"/> <w:LsdException Locked="false" Priority="65" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 1 Accent 2"/> <w:LsdException Locked="false" Priority="66" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 2 Accent 2"/> <w:LsdException Locked="false" Priority="67" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 1 Accent 2"/> <w:LsdException Locked="false" Priority="68" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 2 Accent 2"/> <w:LsdException Locked="false" Priority="69" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 3 Accent 2"/> <w:LsdException Locked="false" Priority="70" SemiHidden="false" UnhideWhenUsed="false" Name="Dark List Accent 2"/> <w:LsdException Locked="false" Priority="71" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Shading Accent 2"/> <w:LsdException Locked="false" Priority="72" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful List Accent 2"/> <w:LsdException Locked="false" Priority="73" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Grid Accent 2"/> <w:LsdException Locked="false" Priority="60" SemiHidden="false" UnhideWhenUsed="false" Name="Light Shading Accent 3"/> <w:LsdException Locked="false" Priority="61" SemiHidden="false" UnhideWhenUsed="false" Name="Light List Accent 3"/> <w:LsdException Locked="false" Priority="62" SemiHidden="false" UnhideWhenUsed="false" Name="Light Grid Accent 3"/> <w:LsdException Locked="false" Priority="63" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 1 Accent 3"/> <w:LsdException Locked="false" Priority="64" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 2 Accent 3"/> <w:LsdException Locked="false" Priority="65" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 1 Accent 3"/> <w:LsdException Locked="false" Priority="66" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 2 Accent 3"/> <w:LsdException Locked="false" Priority="67" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 1 Accent 3"/> <w:LsdException Locked="false" Priority="68" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 2 Accent 3"/> <w:LsdException Locked="false" Priority="69" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 3 Accent 3"/> <w:LsdException Locked="false" Priority="70" SemiHidden="false" UnhideWhenUsed="false" Name="Dark List Accent 3"/> <w:LsdException Locked="false" Priority="71" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Shading Accent 3"/> <w:LsdException Locked="false" Priority="72" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful List Accent 3"/> <w:LsdException Locked="false" Priority="73" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Grid Accent 3"/> <w:LsdException Locked="false" Priority="60" SemiHidden="false" UnhideWhenUsed="false" Name="Light Shading Accent 4"/> <w:LsdException Locked="false" Priority="61" SemiHidden="false" UnhideWhenUsed="false" Name="Light List Accent 4"/> <w:LsdException Locked="false" Priority="62" SemiHidden="false" UnhideWhenUsed="false" Name="Light Grid Accent 4"/> <w:LsdException Locked="false" Priority="63" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 1 Accent 4"/> <w:LsdException Locked="false" Priority="64" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 2 Accent 4"/> <w:LsdException Locked="false" Priority="65" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 1 Accent 4"/> <w:LsdException Locked="false" Priority="66" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 2 Accent 4"/> <w:LsdException Locked="false" Priority="67" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 1 Accent 4"/> <w:LsdException Locked="false" Priority="68" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 2 Accent 4"/> <w:LsdException Locked="false" Priority="69" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 3 Accent 4"/> <w:LsdException Locked="false" Priority="70" SemiHidden="false" UnhideWhenUsed="false" Name="Dark List Accent 4"/> <w:LsdException Locked="false" Priority="71" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Shading Accent 4"/> <w:LsdException Locked="false" Priority="72" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful List Accent 4"/> <w:LsdException Locked="false" Priority="73" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Grid Accent 4"/> <w:LsdException Locked="false" Priority="60" SemiHidden="false" UnhideWhenUsed="false" Name="Light Shading Accent 5"/> <w:LsdException Locked="false" Priority="61" SemiHidden="false" UnhideWhenUsed="false" Name="Light List Accent 5"/> <w:LsdException Locked="false" Priority="62" SemiHidden="false" UnhideWhenUsed="false" Name="Light Grid Accent 5"/> <w:LsdException Locked="false" Priority="63" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 1 Accent 5"/> <w:LsdException Locked="false" Priority="64" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 2 Accent 5"/> <w:LsdException Locked="false" Priority="65" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 1 Accent 5"/> <w:LsdException Locked="false" Priority="66" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 2 Accent 5"/> <w:LsdException Locked="false" Priority="67" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 1 Accent 5"/> <w:LsdException Locked="false" Priority="68" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 2 Accent 5"/> <w:LsdException Locked="false" Priority="69" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 3 Accent 5"/> <w:LsdException Locked="false" Priority="70" SemiHidden="false" UnhideWhenUsed="false" Name="Dark List Accent 5"/> <w:LsdException Locked="false" Priority="71" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Shading Accent 5"/> <w:LsdException Locked="false" Priority="72" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful List Accent 5"/> <w:LsdException Locked="false" Priority="73" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Grid Accent 5"/> <w:LsdException Locked="false" Priority="60" SemiHidden="false" UnhideWhenUsed="false" Name="Light Shading Accent 6"/> <w:LsdException Locked="false" Priority="61" SemiHidden="false" UnhideWhenUsed="false" Name="Light List Accent 6"/> <w:LsdException Locked="false" Priority="62" SemiHidden="false" UnhideWhenUsed="false" Name="Light Grid Accent 6"/> <w:LsdException Locked="false" Priority="63" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 1 Accent 6"/> <w:LsdException Locked="false" Priority="64" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 2 Accent 6"/> <w:LsdException Locked="false" Priority="65" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 1 Accent 6"/> <w:LsdException Locked="false" Priority="66" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 2 Accent 6"/> <w:LsdException Locked="false" Priority="67" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 1 Accent 6"/> <w:LsdException Locked="false" Priority="68" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 2 Accent 6"/> <w:LsdException Locked="false" Priority="69" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 3 Accent 6"/> <w:LsdException Locked="false" Priority="70" SemiHidden="false" UnhideWhenUsed="false" Name="Dark List Accent 6"/> <w:LsdException Locked="false" Priority="71" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Shading Accent 6"/> <w:LsdException Locked="false" Priority="72" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful List Accent 6"/> <w:LsdException Locked="false" Priority="73" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Grid Accent 6"/> <w:LsdException Locked="false" Priority="19" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="Subtle Emphasis"/> <w:LsdException Locked="false" Priority="21" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="Intense Emphasis"/> <w:LsdException Locked="false" Priority="31" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="Subtle Reference"/> <w:LsdException Locked="false" Priority="32" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="Intense Reference"/> <w:LsdException Locked="false" Priority="33" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="Book Title"/> <w:LsdException Locked="false" Priority="37" Name="Bibliography"/> <w:LsdException Locked="false" Priority="39" QFormat="true" Name="TOC Heading"/> </w:LatentStyles> </xml><![endif]--><style> <!-- /* Font Definitions */ @font-face {font-family:Calibri; panose-1:2 15 5 2 2 2 4 3 2 4; mso-font-charset:0; mso-generic-font-family:swiss; mso-font-pitch:variable; mso-font-signature:-1610611985 1073750139 0 0 159 0;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-unhide:no; mso-style-qformat:yes; mso-style-parent:""; margin-top:0cm; margin-right:0cm; margin-bottom:10.0pt; margin-left:0cm; line-height:115%; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-fareast-font-family:Calibri; mso-fareast-theme-font:minor-latin; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi; mso-fareast-language:EN-US;} p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph {mso-style-priority:34; mso-style-unhide:no; mso-style-qformat:yes; margin-top:0cm; margin-right:0cm; margin-bottom:10.0pt; margin-left:36.0pt; mso-add-space:auto; line-height:115%; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-fareast-font-family:Calibri; mso-fareast-theme-font:minor-latin; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi; mso-fareast-language:EN-US;} p.MsoListParagraphCxSpFirst, li.MsoListParagraphCxSpFirst, div.MsoListParagraphCxSpFirst {mso-style-priority:34; mso-style-unhide:no; mso-style-qformat:yes; mso-style-type:export-only; margin-top:0cm; margin-right:0cm; margin-bottom:0cm; margin-left:36.0pt; margin-bottom:.0001pt; mso-add-space:auto; line-height:115%; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-fareast-font-family:Calibri; mso-fareast-theme-font:minor-latin; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi; mso-fareast-language:EN-US;} p.MsoListParagraphCxSpMiddle, li.MsoListParagraphCxSpMiddle, div.MsoListParagraphCxSpMiddle {mso-style-priority:34; mso-style-unhide:no; mso-style-qformat:yes; mso-style-type:export-only; margin-top:0cm; margin-right:0cm; margin-bottom:0cm; margin-left:36.0pt; margin-bottom:.0001pt; mso-add-space:auto; line-height:115%; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-fareast-font-family:Calibri; mso-fareast-theme-font:minor-latin; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi; mso-fareast-language:EN-US;} p.MsoListParagraphCxSpLast, li.MsoListParagraphCxSpLast, div.MsoListParagraphCxSpLast {mso-style-priority:34; mso-style-unhide:no; mso-style-qformat:yes; mso-style-type:export-only; margin-top:0cm; margin-right:0cm; margin-bottom:10.0pt; margin-left:36.0pt; mso-add-space:auto; line-height:115%; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-fareast-font-family:Calibri; mso-fareast-theme-font:minor-latin; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi; mso-fareast-language:EN-US;} .MsoChpDefault {mso-style-type:export-only; mso-default-props:yes; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-fareast-font-family:Calibri; mso-fareast-theme-font:minor-latin; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi; mso-fareast-language:EN-US;} .MsoPapDefault {mso-style-type:export-only; margin-bottom:10.0pt; line-height:115%;} @page Section1 {size:595.3pt 841.9pt; margin:70.85pt 70.85pt 70.85pt 70.85pt; mso-header-margin:35.4pt; mso-footer-margin:35.4pt; mso-paper-source:0;} div.Section1 {page:Section1;} --> </style><!--[if gte mso 10]> <style> /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-qformat:yes; mso-style-parent:""; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-para-margin-top:0cm; mso-para-margin-right:0cm; mso-para-margin-bottom:10.0pt; mso-para-margin-left:0cm; line-height:115%; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-fareast-language:EN-US;} table.MsoTableGrid {mso-style-name:"Table Grid"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-priority:59; mso-style-unhide:no; border:solid black 1.0pt; mso-border-themecolor:text1; mso-border-alt:solid black .5pt; mso-border-themecolor:text1; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-border-insideh:.5pt solid black; mso-border-insideh-themecolor:text1; mso-border-insidev:.5pt solid black; mso-border-insidev-themecolor:text1; mso-para-margin:0cm; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-fareast-language:EN-US;} </style> <![endif]--> <table class="MsoTableGrid" style="border: medium none ; margin-left: 36pt; border-collapse: collapse;" border="1" cellpadding="0" cellspacing="0"> <tbody><tr style=""> <td style="border: 1pt solid black; padding: 0cm 5.4pt; width: 230.3pt;" valign="top" width="307"> <p class="MsoListParagraphCxSpFirst" style="margin: 0cm 0cm 0.0001pt; line-height: normal;">Cell 1</p> </td> <td style="border-style: solid solid solid none; border-color: black black black -moz-use-text-color; border-width: 1pt 1pt 1pt medium; padding: 0cm 5.4pt; width: 230.3pt;" valign="top" width="307"> <p class="MsoListParagraphCxSpLast" style="margin: 0cm 0cm 0.0001pt; line-height: normal;">Cell 2</p> </td> </tr> <tr style=""> <td style="border-style: none solid solid; border-color: -moz-use-text-color black black; border-width: medium 1pt 1pt; padding: 0cm 5.4pt; width: 230.3pt;" valign="top" width="307"> <p class="MsoListParagraphCxSpFirst" style="margin: 0cm 0cm 0.0001pt; line-height: normal;">Cell 3</p> </td> <td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 230.3pt;" valign="top" width="307"> <p class="MsoListParagraphCxSpLast" style="margin: 0cm 0cm 0.0001pt; line-height: normal;">Cell 4</p> </td> </tr> </tbody></table> <p class="MsoListParagraph"><o:p> </o:p></p>'}); 141 147 equal(editor.getContent().replace(/[\r\n]+/g, ''), '<table><tbody><tr><td width="307"><p>Cell 1</p></td><td width="307"><p>Cell 2</p></td></tr><tr><td width="307"><p>Cell 3</p></td><td width="307"><p>Cell 4</p></td></tr></tbody></table><p> </p>'); 148 }); 149 150 test("Paste Office 365", function() { 151 var rng = editor.dom.createRng(); 152 153 editor.setContent('<p>1234</p>'); 154 rng.setStart(editor.getBody().firstChild.firstChild, 0); 155 rng.setEnd(editor.getBody().firstChild.firstChild, 4); 156 editor.selection.setRng(rng); 157 158 editor.execCommand('mceInsertClipboardContent', false, {content: '<div class="OutlineElement Ltr SCX195156559">Test</div>'}); 159 equal(editor.getContent().replace(/[\r\n]+/g, ''), '<p>Test</p>'); 160 }); 161 162 test("Paste Google Docs", function() { 163 var rng = editor.dom.createRng(); 164 165 editor.setContent('<p>1234</p>'); 166 rng.setStart(editor.getBody().firstChild.firstChild, 0); 167 rng.setEnd(editor.getBody().firstChild.firstChild, 4); 168 editor.selection.setRng(rng); 169 170 editor.execCommand('mceInsertClipboardContent', false, {content: '<span id="docs-internal-guid-94e46f1a-1c88-b42b-d502-1d19da30dde7"></span><p dir="ltr>Test</p>'}); 171 equal(editor.getContent().replace(/[\r\n]+/g, ''), '<p>Test</p>'); 142 172 }); 143 173 … … 198 228 editor.execCommand('mceInsertClipboardContent', false, {content: '<p class="MsoNormal" style="background-color: #ff0000">Test</p>'}); 199 229 equal(Utils.trimContent(editor.getContent().replace(/[\r\n]+/g, '')), '<p style=\"background-color: #ff0000;\">Test</p>'); 200 201 editor.settings.paste_retain_style_properties = ''; 230 }); 231 232 test("Paste Word retain bold/italic styles to elements", function() { 233 editor.settings.paste_retain_style_properties = 'color'; 234 235 editor.setContent(''); 236 237 editor.execCommand('mceInsertClipboardContent', false, { 238 content: ( 239 '<p class="MsoNormal">' + 240 '<span style="font-weight: bold">bold</span>' + 241 '<span style="font-style: italic">italic</span>' + 242 '<span style="font-weight: bold; font-style: italic">bold + italic</span>' + 243 '<span style="font-weight: bold; color: red">bold + color</span>' + 244 '</p>' 245 ) 246 }); 247 248 equal(editor.getContent(), '<p><strong>bold</strong><em>italic</em><strong><em>bold + italic</em></strong><strong><span style="color: red;">bold + color</span></strong></p>'); 202 249 }); 203 250 … … 218 265 editor.execCommand('mceInsertClipboardContent', false, {content: '<p class="MsoNormal" style="color: #ff0000;">Test</p>'}); 219 266 equal(Utils.trimContent(editor.getContent().replace(/[\r\n]+/g, '')), '<p class="MsoNormal" style="color: #ff0000;">Test</p>'); 220 221 editor.settings.paste_enable_default_filters = true;222 267 }); 223 268 … … 402 447 equal(tinymce.pasteplugin.Utils.innerText(editor.getBody().firstChild.innerHTML), ' a '); 403 448 }); 449 450 if (tinymce.Env.webkit) { 451 test('paste webkit remove runtime styles (color)', function() { 452 editor.setContent(''); 453 editor.execCommand('mceInsertClipboardContent', false, {content: '<span style="color:red; text-indent: 10px">Test</span>'}); 454 equal(editor.getContent(), '<p><span style="color: red;">Test</span></p>'); 455 }); 456 457 test('paste webkit remove runtime styles (background-color)', function() { 458 editor.setContent(''); 459 editor.execCommand('mceInsertClipboardContent', false, {content: '<span style="background-color:red; text-indent: 10px">Test</span>'}); 460 equal(editor.getContent(), '<p><span style="background-color: red;">Test</span></p>'); 461 }); 462 463 test('paste webkit remove runtime styles (font-size)', function() { 464 editor.setContent(''); 465 editor.execCommand('mceInsertClipboardContent', false, {content: '<span style="font-size:42px; text-indent: 10px">Test</span>'}); 466 equal(editor.getContent(), '<p><span style="font-size: 42px;">Test</span></p>'); 467 }); 468 /* 469 test('paste webkit remove runtime styles (font-family)', function() { 470 editor.setContent(''); 471 editor.execCommand('mceInsertClipboardContent', false, {content: '<span style="font-family:Arial; text-indent: 10px">Test</span>'}); 472 equal(editor.getContent(), '<p><span style="font-family: Arial;">Test</span></p>'); 473 }); 474 */ 475 test('paste webkit remove runtime styles (custom styles)', function() { 476 editor.settings.paste_webkit_styles = 'color font-style'; 477 editor.setContent(''); 478 editor.execCommand('mceInsertClipboardContent', false, {content: '<span style="color: red; font-style: italic; text-indent: 10px">Test</span>'}); 479 equal(editor.getContent(), '<p><span style="color: red; font-style: italic;">Test</span></p>'); 480 }); 481 482 test('paste webkit remove runtime styles (all)', function() { 483 editor.settings.paste_webkit_styles = 'all'; 484 editor.setContent(''); 485 editor.execCommand('mceInsertClipboardContent', false, {content: '<span style="color: red; font-style: italic; text-indent: 10px">Test</span>'}); 486 equal(editor.getContent(), '<p><span style=\"color: red; font-style: italic; text-indent: 10px;\">Test</span></p>'); 487 }); 488 489 test('paste webkit remove runtime styles (none)', function() { 490 editor.settings.paste_webkit_styles = 'none'; 491 editor.setContent(''); 492 editor.execCommand('mceInsertClipboardContent', false, {content: '<span style="color: red; font-style: italic; text-indent: 10px">Test</span>'}); 493 equal(editor.getContent(), '<p>Test</p>'); 494 }); 495 496 test('paste webkit remove runtime styles (color) in the same (color) (named)', function() { 497 editor.setContent('<p style="color:red">Test</span>'); 498 Utils.setSelection('p', 0, 'p', 4); 499 500 editor.execCommand('mceInsertClipboardContent', false, { 501 content: ( 502 '<span style="color:red; text-indent: 10px">a</span>' + 503 '<span style="color:#ff0000; text-indent: 10px">b</span>' + 504 '<span style="color:rgb(255, 0, 0); text-indent: 10px">c</span>' 505 ) 506 }); 507 508 equal(editor.getContent(), '<p style="color: red;">abc</p>'); 509 }); 510 511 test('paste webkit remove runtime styles (color) in the same (color) (hex)', function() { 512 editor.setContent('<p style="color:#ff0000">Test</span>'); 513 Utils.setSelection('p', 0, 'p', 4); 514 515 editor.execCommand('mceInsertClipboardContent', false, { 516 content: ( 517 '<span style="color:red; text-indent: 10px">a</span>' + 518 '<span style="color:#ff0000; text-indent: 10px">b</span>' + 519 '<span style="color:rgb(255, 0, 0); text-indent: 10px">c</span>' 520 ) 521 }); 522 523 equal(editor.getContent(), '<p style="color: #ff0000;">abc</p>'); 524 }); 525 526 test('paste webkit remove runtime styles (color) in the same (color) (rgb)', function() { 527 editor.setContent('<p style="color:rgb(255, 0, 0)">Test</span>'); 528 Utils.setSelection('p', 0, 'p', 4); 529 530 editor.execCommand('mceInsertClipboardContent', false, { 531 content: ( 532 '<span style="color:red; text-indent: 10px">a</span>' + 533 '<span style="color:#ff0000; text-indent: 10px">b</span>' + 534 '<span style="color:rgb(255, 0, 0); text-indent: 10px">c</span>' 535 ) 536 }); 537 538 equal(editor.getContent(), '<p style="color: #ff0000;">abc</p>'); 539 }); 540 } -
trunk/tests/qunit/editor/tinymce/Editor.js
r27679 r28138 9 9 skin: false, 10 10 entities: 'raw', 11 indent: false, 11 12 valid_styles: { 12 13 '*': 'color,font-size,font-family,background-color,font-weight,font-style,text-decoration,float,margin,margin-top,margin-right,margin-bottom,margin-left,display' … … 138 139 editor.dom.replace(p, editor.getBody().firstChild); 139 140 140 equal(editor.getContent(), '<p>123</p> \n<table>\n<tbody>\n<tr>\n<td>X</td>\n</tr>\n</tbody>\n</table>\n<p>456</p>');141 equal(editor.getContent(), '<p>123</p><table><tbody><tr><td>X</td></tr></tbody></table><p>456</p>'); 141 142 } 142 143 }); … … 188 189 189 190 test('custom elements', function() { 190 expect(1);191 192 191 editor.setContent('<custom1>c1</custom1><custom2>c1</custom2>'); 193 equal(editor.getContent() .replace(/[\r\n]/g, ''), '<custom1>c1</custom1><p><custom2>c1</custom2></p>');192 equal(editor.getContent(), '<custom1>c1</custom1><p><custom2>c1</custom2></p>'); 194 193 }); 195 194 195 test('Store/restore tabindex', function() { 196 editor.setContent('<span tabindex="42">abc</span>'); 197 equal(editor.getContent({format:'raw'}).toLowerCase(), '<p><span data-mce-tabindex="42">abc</span></p>'); 198 equal(editor.getContent(), '<p><span tabindex="42">abc</span></p>'); 199 }); -
trunk/tests/qunit/editor/tinymce/EnterKey.js
r27679 r28138 393 393 ); 394 394 395 equal(editor.selection.getNode().nodeName, 'LI'); 395 // Ignore on IE 7, 8 this is a known bug not worth fixing 396 if (!tinymce.Env.ie || tinymce.Env.ie > 8) { 397 equal(editor.selection.getNode().nodeName, 'LI'); 398 } 396 399 }); 397 400 … … 428 431 // Nested lists in OL elements 429 432 430 test('Enter before nested list', function() { 431 editor.getBody().innerHTML = Utils.trimBrsOnIE( 432 '<ol>' + 433 '<li>a' + 434 '<ul>' + 435 '<li>b</li>' + 436 '<li>c</li>' + 437 '</ul>' + 438 '</li>' + 439 '</ol>' 440 ); 441 442 Utils.setSelection('ol > li', 1); 443 editor.focus(); 444 Utils.pressEnter(); 445 446 equal(editor.getContent(), 447 '<ol>' + 448 '<li>a</li>' + 449 '<li>\u00a0' + 450 '<ul>' + 451 '<li>b</li>' + 452 '<li>c</li>' + 453 '</ul>' + 454 '</li>' + 455 '</ol>' 456 ); 457 458 equal(editor.selection.getNode().nodeName, 'LI'); 459 }); 433 // Ignore on IE 7, 8 this is a known bug not worth fixing 434 if (!tinymce.Env.ie || tinymce.Env.ie > 8) { 435 test('Enter before nested list', function() { 436 editor.getBody().innerHTML = Utils.trimBrsOnIE( 437 '<ol>' + 438 '<li>a' + 439 '<ul>' + 440 '<li>b</li>' + 441 '<li>c</li>' + 442 '</ul>' + 443 '</li>' + 444 '</ol>' 445 ); 446 447 Utils.setSelection('ol > li', 1); 448 editor.focus(); 449 Utils.pressEnter(); 450 451 equal(editor.getContent(), 452 '<ol>' + 453 '<li>a</li>' + 454 '<li>\u00a0' + 455 '<ul>' + 456 '<li>b</li>' + 457 '<li>c</li>' + 458 '</ul>' + 459 '</li>' + 460 '</ol>' 461 ); 462 463 equal(editor.selection.getNode().nodeName, 'LI'); 464 }); 465 } 460 466 461 467 test('Enter inside empty LI in beginning of OL in OL', function() { … … 562 568 Utils.pressEnter(); 563 569 equal(editor.getContent(),'<ol><li><p>ab</p></li><li><p>cd</p></li></ol>'); 564 equal(editor.selection.getNode().nodeName, 'P'); 570 571 // Ignore on IE 7, 8 this is a known bug not worth fixing 572 if (!tinymce.Env.ie || tinymce.Env.ie > 8) { 573 equal(editor.selection.getNode().nodeName, 'P'); 574 } 565 575 }); 566 576 … … 919 929 }); 920 930 921 test('Enter before BR between DIVs', function() { 922 editor.getBody().innerHTML = '<div>a<span>b</span>c</div><br /><div>d</div>'; 923 var rng = editor.dom.createRng(); 924 rng.setStartBefore(editor.dom.select('br')[0]); 925 rng.setEndBefore(editor.dom.select('br')[0]); 926 editor.selection.setRng(rng); 927 Utils.pressEnter(); 928 equal(editor.getContent(),'<div>a<span>b</span>c</div><p>\u00a0</p><p>\u00a0</p><div>d</div>'); 929 }); 931 // Ignore on IE 7, 8 this is a known bug not worth fixing 932 if (!tinymce.Env.ie || tinymce.Env.ie > 8) { 933 test('Enter before BR between DIVs', function() { 934 editor.getBody().innerHTML = '<div>a<span>b</span>c</div><br /><div>d</div>'; 935 var rng = editor.dom.createRng(); 936 rng.setStartBefore(editor.dom.select('br')[0]); 937 rng.setEndBefore(editor.dom.select('br')[0]); 938 editor.selection.setRng(rng); 939 Utils.pressEnter(); 940 equal(editor.getContent(),'<div>a<span>b</span>c</div><p>\u00a0</p><p>\u00a0</p><div>d</div>'); 941 }); 942 } 930 943 931 944 // Only test these on modern browsers -
trunk/tests/qunit/editor/tinymce/Formatter_check.js
r27679 r28138 229 229 ok(!inlineEditor.formatter.match('div'), 'Formatter.match on div says true'); 230 230 }); 231 232 test('Get preview css text for formats', function() { 233 ok(/font-weight\:(bold|700)/.test(editor.formatter.getCssText('bold')), 'Bold not found in preview style'); 234 ok(/font-weight\:(bold|700)/.test(editor.formatter.getCssText({inline: 'b'})), 'Bold not found in preview style'); 235 }); -
trunk/tests/qunit/editor/tinymce/UndoManager.js
r27679 r28138 150 150 }); 151 151 152 asyncTest('Undo added when typing and losing focus', function() { 153 window.focus(); 154 155 window.setTimeout(function() { 156 start(); 157 158 editor.focus(); 159 editor.undoManager.clear(); 160 editor.setContent("<p>some text</p>"); 161 Utils.setSelection('p', 4, 'p', 9); 162 Utils.type('\b'); 163 164 // Move focus to an input element 165 var input = document.createElement('input'); 166 document.getElementById('view').appendChild(input); 167 input.focus(); 168 input.parentNode.removeChild(input); 169 170 editor.execCommand('FormatBlock', false, 'h1'); 171 editor.undoManager.undo(); 172 equal(editor.getContent(), "<p>some</p>"); 173 }, 0); 174 }); 152 test('Transact', function() { 153 var count = 0; 154 155 editor.undoManager.clear(); 156 157 editor.on('BeforeAddUndo', function() { 158 count++; 159 }); 160 161 editor.undoManager.transact(function() { 162 editor.undoManager.add(); 163 editor.undoManager.add(); 164 }); 165 166 equal(count, 1); 167 }); 168 169 test('Transact nested', function() { 170 var count = 0; 171 172 editor.undoManager.clear(); 173 174 editor.on('BeforeAddUndo', function() { 175 count++; 176 }); 177 178 editor.undoManager.transact(function() { 179 editor.undoManager.add(); 180 181 editor.undoManager.transact(function() { 182 editor.undoManager.add(); 183 }); 184 }); 185 186 equal(count, 1); 187 }); 188 189 test('Transact exception', function() { 190 var count = 0; 191 192 editor.undoManager.clear(); 193 194 editor.on('BeforeAddUndo', function() { 195 count++; 196 }); 197 198 throws( 199 function() { 200 editor.undoManager.transact(function() { 201 throw new Error("Test"); 202 }); 203 }, 204 205 "Test" 206 ); 207 208 editor.undoManager.add(); 209 210 equal(count, 1); 211 }); 212 213 test('Exclude internal elements', function() { 214 var count = 0, lastLevel; 215 216 editor.undoManager.clear(); 217 equal(count, 0); 218 219 editor.on('AddUndo', function() { 220 count++; 221 }); 222 223 editor.on('BeforeAddUndo', function(e) { 224 lastLevel = e.level; 225 }); 226 227 editor.getBody().innerHTML = ( 228 'test' + 229 '<img src="about:blank" data-mce-selected="1" />' + 230 '<table data-mce-selected="1"><tr><td>x</td></tr></table>' 231 ); 232 233 editor.undoManager.add(); 234 equal(count, 1); 235 equal(Utils.cleanHtml(lastLevel.content), 236 'test' + 237 '<img src="about:blank">' + 238 '<table><tbody><tr><td>x</td></tr></tbody></table>' 239 ); 240 241 editor.getBody().innerHTML = ( 242 '<span data-mce-bogus="1">\u200B</span>' + 243 '<span data-mce-bogus="1">\uFEFF</span>' + 244 '<div data-mce-bogus="1"></div>' + 245 'test' + 246 '<img src="about:blank" />' + 247 '<table><tr><td>x</td></tr></table>' 248 ); 249 250 editor.undoManager.add(); 251 equal(count, 1); 252 equal(Utils.cleanHtml(lastLevel.content), 253 'test' + 254 '<img src="about:blank">' + 255 '<table><tbody><tr><td>x</td></tr></tbody></table>' 256 ); 257 }); 258 259 test('Undo added when typing and losing focus', function() { 260 var lastLevel; 261 262 editor.on('BeforeAddUndo', function(e) { 263 lastLevel = e.level; 264 }); 265 266 editor.undoManager.clear(); 267 editor.setContent("<p>some text</p>"); 268 Utils.setSelection('p', 4, 'p', 9); 269 Utils.type('\b'); 270 271 equal(Utils.cleanHtml(lastLevel.content), "<p>some text</p>"); 272 editor.fire('blur'); 273 equal(Utils.cleanHtml(lastLevel.content), "<p>some</p>"); 274 275 editor.execCommand('FormatBlock', false, 'h1'); 276 editor.undoManager.undo(); 277 equal(editor.getContent(), "<p>some</p>"); 278 }); 279 280 test('BeforeAddUndo event', function() { 281 var lastEvt, addUndoEvt; 282 283 editor.on('BeforeAddUndo', function(e) { 284 lastEvt = e; 285 }); 286 287 editor.undoManager.clear(); 288 editor.setContent("<p>a</p>"); 289 editor.undoManager.add(); 290 291 equal(lastEvt.lastLevel, null); 292 equal(Utils.cleanHtml(lastEvt.level.content), "<p>a</p>"); 293 294 editor.setContent("<p>b</p>"); 295 editor.undoManager.add(); 296 297 equal(Utils.cleanHtml(lastEvt.lastLevel.content), "<p>a</p>"); 298 equal(Utils.cleanHtml(lastEvt.level.content), "<p>b</p>"); 299 300 editor.on('BeforeAddUndo', function(e) { 301 e.preventDefault(); 302 }); 303 304 editor.on('AddUndo', function(e) { 305 addUndoEvt = e; 306 }); 307 308 editor.setContent("<p>c</p>"); 309 editor.undoManager.add(null, {data: 1}); 310 311 equal(Utils.cleanHtml(lastEvt.lastLevel.content), "<p>b</p>"); 312 equal(Utils.cleanHtml(lastEvt.level.content), "<p>c</p>"); 313 equal(lastEvt.originalEvent.data, 1); 314 ok(!addUndoEvt, "Event level produced when it should be blocked"); 315 }); -
trunk/tests/qunit/editor/tinymce/dom/EventUtils.js
r27679 r28138 329 329 }); 330 330 331 /* 331 332 asyncTest("focusin/focusout bind/unbind", function() { 332 333 var result = {}; … … 349 350 }, 0); 350 351 }); 352 */ 351 353 352 354 test("bind unbind fire clean on null", function() { -
trunk/tests/qunit/editor/tinymce/dom/Serializer.js
r27679 r28138 491 491 equal(ser.serialize(DOM.get('test')), '<span class="b"></span>'); 492 492 }); 493 494 test('Restore tabindex', function() { 495 var ser = new tinymce.dom.Serializer({ 496 valid_elements: 'span[tabindex]' 497 }); 498 499 DOM.setHTML('test', '<span data-mce-tabindex="42"></span>'); 500 equal(ser.serialize(DOM.get('test')), '<span tabindex="42"></span>'); 501 }); -
trunk/tests/qunit/editor/tinymce/ui/Control.js
r27679 r28138 54 54 }); 55 55 56 /*57 56 test("Properties", function() { 58 57 var ctrl, cont; … … 90 89 // Set all states 91 90 ctrl = ctrl. 92 refresh(). 93 bind('click', function() {}). 94 unbind(). 95 renderTo(document.getElementById('viewport')). 96 fire("nothing"). 91 on('click', function() {}). 92 off(). 93 renderTo(document.getElementById('view')). 97 94 remove(); 98 95 … … 103 100 test("Events", function() { 104 101 var ctrl = new tinymce.ui.Control({ 105 handlers: { 102 onMyEvent: function() { 103 count++; 104 }, 105 callbacks: { 106 106 handler1: function() { 107 107 count++; … … 110 110 }), count; 111 111 112 ctrl. bind('MyEvent', function(target,args) {113 ok(target === ctrl);114 ok(ctrl ===this);115 deepEqual(args, {myKey: 'myVal'});112 ctrl.on('MyEvent', function(args) { 113 equal(ctrl, args.control); 114 equal(ctrl, this); 115 equal(args.myKey, 'myVal'); 116 116 }); 117 117 118 118 ctrl.fire('MyEvent', {myKey: 'myVal'}); 119 119 120 function countAndBreak( target, args) {120 function countAndBreak() { 121 121 count++; 122 122 return false; … … 124 124 125 125 // Bind two events 126 ctrl. bind('MyEvent2', countAndBreak);127 ctrl. bind('MyEvent2', countAndBreak);126 ctrl.on('MyEvent2', countAndBreak); 127 ctrl.on('MyEvent2', countAndBreak); 128 128 129 129 // Check if only one of them was called … … 136 136 137 137 // Unbind all 138 ctrl. unbind();138 ctrl.off(); 139 139 count = 0; 140 140 ctrl.fire('MyEvent2', {myKey: 'myVal'}); … … 142 142 143 143 // Unbind by name 144 ctrl. bind('MyEvent1', countAndBreak);145 ctrl. bind('MyEvent2', countAndBreak);146 ctrl. unbind('MyEvent2');144 ctrl.on('MyEvent1', countAndBreak); 145 ctrl.on('MyEvent2', countAndBreak); 146 ctrl.off('MyEvent2'); 147 147 count = 0; 148 148 ctrl.fire('MyEvent1', {myKey: 'myVal'}); … … 151 151 152 152 // Unbind by name callback 153 ctrl. bind('MyEvent1', countAndBreak);154 ctrl. bind('MyEvent1', function() {count++;});155 ctrl. unbind('MyEvent1', countAndBreak);153 ctrl.on('MyEvent1', countAndBreak); 154 ctrl.on('MyEvent1', function() {count++;}); 155 ctrl.off('MyEvent1', countAndBreak); 156 156 count = 0; 157 157 ctrl.fire('MyEvent1', {myKey: 'myVal'}); … … 159 159 160 160 // Bind by named handler 161 ctrl. unbind();162 ctrl. bind('MyEvent', 'handler1');161 ctrl.off(); 162 ctrl.on('MyEvent', 'handler1'); 163 163 count = 0; 164 164 ctrl.fire('MyEvent', {myKey: 'myVal'}); … … 169 169 var ctrl = new tinymce.ui.Control({classes: 'class1 class2 class3'}); 170 170 171 equal(ctrl.classes(), ' class1 class2class3');171 equal(ctrl.classes(), 'mce-class1 mce-class2 mce-class3'); 172 172 ok(ctrl.hasClass('class1')); 173 173 ok(ctrl.hasClass('class2')); … … 176 176 177 177 ctrl.addClass('class4'); 178 equal(ctrl.classes(), ' class1 class2 class3class4');178 equal(ctrl.classes(), 'mce-class1 mce-class2 mce-class3 mce-class4'); 179 179 ok(ctrl.hasClass('class1')); 180 180 ok(ctrl.hasClass('class2')); … … 183 183 184 184 ctrl.removeClass('class4'); 185 equal(ctrl.classes(), ' class1 class2class3');185 equal(ctrl.classes(), 'mce-class1 mce-class2 mce-class3'); 186 186 ok(ctrl.hasClass('class1')); 187 187 ok(ctrl.hasClass('class2')); … … 190 190 191 191 ctrl.removeClass('class3').removeClass('class2'); 192 equal(ctrl.classes(), ' class1');192 equal(ctrl.classes(), 'mce-class1'); 193 193 ok(ctrl.hasClass('class1')); 194 194 ok(!ctrl.hasClass('class2')); … … 201 201 ok(!ctrl.hasClass('class3')); 202 202 }); 203 */ 203 204 test("encode", function() { 205 tinymce.i18n.add('en', {'old': '"new"'}); 206 equal(new tinymce.ui.Control({}).encode('<>"&'), '<>"&'); 207 equal(new tinymce.ui.Control({}).encode('old'), '"new"'); 208 equal(new tinymce.ui.Control({}).encode('old', false), 'old'); 209 }); 210 211 test("translate", function() { 212 tinymce.i18n.add('en', {'old': 'new'}); 213 equal(new tinymce.ui.Control({}).translate('old'), 'new'); 214 equal(new tinymce.ui.Control({}).translate('old2'), 'old2'); 215 }); 204 216 })();
Note: See TracChangeset
for help on using the changeset viewer.