PHP Classes

File: public/js/tinymce/src/plugins/noneditable/src/test/js/browser/NonEditablePluginTest.js

Recommend this page to a friend!
  Classes of Abed Nego Ragil Putra   GoLavaCMS   public/js/tinymce/src/plugins/noneditable/src/test/js/browser/NonEditablePluginTest.js   Download  
File: public/js/tinymce/src/plugins/noneditable/src/test/js/browser/NonEditablePluginTest.js
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: GoLavaCMS
Publish content on Web pages with SEO support
Author: By
Last change:
Date: 6 years ago
Size: 1,937 bytes
 

Contents

Class file image Download
asynctest( 'browser.tinymce.plugins.noneditable.NonEditablePluginTest', [ 'ephox.agar.api.Pipeline', 'ephox.mcagar.api.LegacyUnit', 'ephox.mcagar.api.TinyLoader', 'tinymce.plugins.noneditable.Plugin', 'tinymce.themes.modern.Theme' ], function (Pipeline, LegacyUnit, TinyLoader, Plugin, Theme) { var success = arguments[arguments.length - 2]; var failure = arguments[arguments.length - 1]; var suite = LegacyUnit.createSuite(); Plugin(); Theme(); suite.test('noneditable class', function (editor) { editor.setContent('<p><span class="mceNonEditable">abc</span></p>'); LegacyUnit.equal(editor.dom.select('span')[0].contentEditable, "false"); }); suite.test('editable class', function (editor) { editor.setContent('<p><span class="mceEditable">abc</span></p>'); LegacyUnit.equal(editor.dom.select('span')[0].contentEditable, "true"); }); suite.test('noneditable regexp', function (editor) { editor.setContent('<p>{test1}{test2}</p>'); LegacyUnit.equal(editor.dom.select('span').length, 2); LegacyUnit.equal(editor.dom.select('span')[0].contentEditable, "false"); LegacyUnit.equal(editor.dom.select('span')[1].contentEditable, "false"); LegacyUnit.equal(editor.getContent(), '<p>{test1}{test2}</p>'); }); suite.test('noneditable regexp inside cE=false', function (editor) { editor.setContent('<span contenteditable="false">{test1}</span>'); LegacyUnit.equal(editor.dom.select('span').length, 1); }); TinyLoader.setup(function (editor, onSuccess, onFailure) { Pipeline.async({}, suite.toSteps(editor), onSuccess, onFailure); }, { add_unload_trigger: false, indent: false, noneditable_regexp: [/\{[^\}]+\}/g], plugins: 'noneditable', entities: 'raw', skin_url: '/project/src/skins/lightgray/dist/lightgray' }, success, failure); } );