PHP Classes

File: public/js/tinymce/src/core/src/test/js/browser/init/ContentStylePositionTest.js

Recommend this page to a friend!
  Classes of Abed Nego Ragil Putra   GoLavaCMS   public/js/tinymce/src/core/src/test/js/browser/init/ContentStylePositionTest.js   Download  
File: public/js/tinymce/src/core/src/test/js/browser/init/ContentStylePositionTest.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,485 bytes
 

Contents

Class file image Download
asynctest( 'browser.tinymce.core.init.ContentStylePositionTest', [ 'ephox.agar.api.Assertions', 'ephox.agar.api.Pipeline', 'ephox.agar.api.Step', 'ephox.katamari.api.Arr', 'ephox.mcagar.api.TinyLoader', 'ephox.sugar.api.dom.Compare', 'ephox.sugar.api.node.Element', 'ephox.sugar.api.node.Node', 'tinymce.themes.modern.Theme' ], function (Assertions, Pipeline, Step, Arr, TinyLoader, Compare, Element, Node, ModernTheme) { var success = arguments[arguments.length - 2]; var failure = arguments[arguments.length - 1]; ModernTheme(); var contentStyle = '.class {color: blue;}'; TinyLoader.setup(function (editor, onSuccess, onFailure) { Pipeline.async({}, [ Step.sync(function () { var headStuff = editor.getDoc().head.querySelectorAll('link, style'); var linkIndex = Arr.findIndex(headStuff, function (elm) { return Node.name(Element.fromDom(elm)) === 'link'; }).getOrDie('could not find link elemnt'); var styleIndex = Arr.findIndex(headStuff, function (elm) { return elm.innerText === contentStyle; }).getOrDie('could not find content style tag'); Assertions.assertEq('style tag should be after link tag', linkIndex < styleIndex, true); }) ], onSuccess, onFailure); }, { content_style: contentStyle, skin_url: '/project/src/skins/lightgray/dist/lightgray' }, success, failure); } );