PHP Classes

File: public/js/tinymce/src/plugins/textpattern/src/test/js/module/test/Utils.js

Recommend this page to a friend!
  Classes of Abed Nego Ragil Putra   GoLavaCMS   public/js/tinymce/src/plugins/textpattern/src/test/js/module/test/Utils.js   Download  
File: public/js/tinymce/src/plugins/textpattern/src/test/js/module/test/Utils.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: 2,689 bytes
 

Contents

Class file image Download
define( 'tinymce.plugins.textpattern.test.Utils', [ 'ephox.agar.api.ApproxStructure', 'ephox.agar.api.GeneralSteps', 'ephox.agar.api.Keys', 'ephox.katamari.api.Arr' ], function (ApproxStructure, GeneralSteps, Keys, Arr) { var sSetContentAndPressKey = function (key) { return function (tinyApis, tinyActions, content) { var padding = key === Keys.space() ? '\u00a0' : ''; var extraOffset = padding === '' ? 0 : 1; return GeneralSteps.sequence([ tinyApis.sSetContent('<p>' + content + padding + '</p>'), tinyApis.sFocus, tinyApis.sSetCursor( [0, 0], content.length + extraOffset ), tinyActions.sContentKeystroke(key, {}) ]); }; }; var withTeardown = function (steps, teardownStep) { return Arr.bind(steps, function (step) { return [step, teardownStep]; }); }; var bodyStruct = function (children) { return ApproxStructure.build(function (s, str) { return s.element('body', { children: children }); }); }; var inlineStructHelper = function (tag, content) { return ApproxStructure.build(function (s, str) { return bodyStruct([ s.element('p', { children: [ s.element(tag, { children: [ s.text(str.is(content)) ] }), s.text(str.is('\u00A0')) ] }) ]); }); }; var inlineBlockStructHelper = function (tag, content) { return ApproxStructure.build(function (s, str) { return bodyStruct([ s.element('p', { children: [ s.element(tag, { children: [ s.text(str.is(content)), s.anything() ] }) ] }), s.element('p', {}) ]); }); }; var blockStructHelper = function (tag, content) { return ApproxStructure.build(function (s, str) { return bodyStruct([ s.element(tag, { children: [ s.text(str.is(content)) ] }), s.element('p', {}) ]); }); }; return { sSetContentAndPressSpace: sSetContentAndPressKey(Keys.space()), sSetContentAndPressEnter: sSetContentAndPressKey(Keys.enter()), withTeardown: withTeardown, bodyStruct: bodyStruct, inlineStructHelper: inlineStructHelper, inlineBlockStructHelper: inlineBlockStructHelper, blockStructHelper: blockStructHelper }; } );