/home/aqcert/public_html/admin/tinymce/tests/plugins
NameSizeModeActions
filemanager/-0755rm
image/-0755rm
link/-0755rm
media/-0755rm
autolink.js36250644editdlrm
autosave.js24100644editdlrm
charmap.js17040644editdlrm
fullpage.js45890644editdlrm
image.js144030644editdlrm
importcss.js93920644editdlrm
jquery_initialization.js7940644editdlrm
jquery_plugin.js24680644editdlrm
legacyoutput.js25930644editdlrm
link.js42060644editdlrm
lists.js517630644editdlrm
media.js71360644editdlrm
noneditable.js13690644editdlrm
paste.js1113380644editdlrm
paste_images.js48990644editdlrm
paste_smart.js33510644editdlrm
searchreplace.js41480644editdlrm
spellchecker.js27000644editdlrm
table.js518340644editdlrm
textpattern.js26590644editdlrm
wordcount.js18780644editdlrm
Edit: /home/aqcert/public_html/admin/tinymce/tests/plugins/link.js (4206B)
(function() { var nonRelativeRegex = /^\w+:/i; module("tinymce.plugins.Link", { setupModule: function() { QUnit.stop(); tinymce.init({ selector: 'textarea', add_unload_trigger: false, skin: false, indent: false, plugins: "link", init_instance_callback: function(ed) { window.editor = ed; QUnit.start(); } }); }, teardown: function() { delete editor.settings.file_browser_callback; delete editor.settings.link_list; delete editor.settings.link_class_list; delete editor.settings.link_target_list; delete editor.settings.rel_list; var win = Utils.getFrontmostWindow(); if (win) { win.close(); } } }); function cleanHtml(html) { return Utils.cleanHtml(html).replace(/

( |]+>)<\/p>$/, ''); } function fillAndSubmitWindowForm(data) { var win = Utils.getFrontmostWindow(); win.fromJSON(data); win.find('form')[0].submit(); win.close(); } test('Default link dialog on empty editor', function() { editor.setContent(''); editor.execCommand('mceLink', true); deepEqual(Utils.getFrontmostWindow().toJSON(), { "href": "", "target": "", "text": "", "title": "" }); fillAndSubmitWindowForm({ "href": "href", "target": "_blank", "text": "text", "title": "title" }); equal( cleanHtml(editor.getContent()), '

text

' ); }); test('Default link dialog on text selection', function() { editor.setContent('

abc

'); Utils.setSelection('p', 1, 'p', 2); editor.execCommand('mceLink', true); deepEqual(Utils.getFrontmostWindow().toJSON(), { "href": "", "target": "", "text": "b", "title": "" }); fillAndSubmitWindowForm({ "href": "href", "target": "_blank", "title": "title" }); equal( cleanHtml(editor.getContent()), '

abc

' ); }); test('Default link dialog on non pure text selection', function() { editor.setContent('

a

bc

'); Utils.setSelection('p:nth-child(1)', 0, 'p:nth-child(2)', 2); editor.execCommand('mceLink', true); deepEqual(Utils.getFrontmostWindow().toJSON(), { "href": "", "target": "", "title": "" }); fillAndSubmitWindowForm({ "href": "href", "target": "_blank", "title": "title" }); equal( cleanHtml(editor.getContent()), '

a

' + '

bc

' ); }); test('All lists link dialog on empty editor', function() { editor.settings.link_list = [ {title: 'link1', value: 'link1'}, {title: 'link2', value: 'link2'} ]; editor.settings.link_class_list = [ {title: 'class1', value: 'class1'}, {title: 'class2', value: 'class2'} ]; editor.settings.target_list = [ {title: 'target1', value: 'target1'}, {title: 'target2', value: 'target2'} ]; editor.settings.rel_list = [ {title: 'rel1', value: 'rel1'}, {title: 'rel2', value: 'rel2'} ]; editor.setContent(''); editor.execCommand('mceLink', true); deepEqual(Utils.getFrontmostWindow().toJSON(), { "class": "class1", "href": "", "rel": "rel1", "target": "target1", "text": "", "title": "" }); fillAndSubmitWindowForm({ "href": "href", "text": "text", "title": "title" }); equal( cleanHtml(editor.getContent()), '

text

' ); }); //Since there's no capability to use the confirm dialog with unit tests, simply test the regex we're using test('Test new regex for non relative link setting ftp', function() { equal(nonRelativeRegex.test('ftp://testftp.com'), true); }); test('Test new regex for non relative link setting http', function() { equal(nonRelativeRegex.test('http://testhttp.com'), true); }); test('Test new regex for non relative link setting relative', function() { equal(nonRelativeRegex.test('testhttp.com'), false); }); test('Test new regex for non relative link setting relative base', function() { equal(nonRelativeRegex.test('/testjpg.jpg'), false); }); })();