PHP Classes

File: public/js/tinymce/src/plugins/textpattern/src/test/js/browser/TrailingPunctuationTest.js

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

Contents

Class file image Download
asynctest( 'browser.tinymce.plugins.textpattern.TrailingPunctuationTest', [ 'ephox.agar.api.ApproxStructure', 'ephox.agar.api.GeneralSteps', 'ephox.agar.api.Logger', 'ephox.agar.api.Pipeline', 'ephox.agar.api.Step', 'ephox.agar.api.Waiter', 'ephox.mcagar.api.TinyApis', 'ephox.mcagar.api.TinyLoader', 'tinymce.plugins.textpattern.Plugin', 'tinymce.themes.modern.Theme' ], function (ApproxStructure, GeneralSteps, Logger, Pipeline, Step, Waiter, TinyApis, TinyLoader, TextpatternPlugin, ModernTheme) { var success = arguments[arguments.length - 2]; var failure = arguments[arguments.length - 1]; ModernTheme(); TextpatternPlugin(); var sTypeChar = function (editor, character) { return Step.sync(function () { var charCode = character.charCodeAt(0); editor.fire('keypress', { charCode: charCode }); }); }; var sTypeAndTrigger = function (tinyApis, editor) { return function (label, patternText, trigger, tag, rawText) { return Logger.t(label, GeneralSteps.sequence([ tinyApis.sSetContent('<p>' + patternText + trigger + '</p>'), tinyApis.sFocus, tinyApis.sSetCursor([0, 0], patternText.length + 1), sTypeChar(editor, trigger), Waiter.sTryUntil( 'did not get expected format', tinyApis.sAssertContentStructure(ApproxStructure.build(function (s, str) { return s.element('body', { children: [ s.element('p', { children: [ s.element(tag, { children: [ s.text(str.is(rawText)) ] }), s.text(str.is(trigger)) ] }) ] }); })), 100, 4000 ) ])); }; }; TinyLoader.setup(function (editor, onSuccess, onFailure) { var tinyApis = TinyApis(editor); var tnt = sTypeAndTrigger(tinyApis, editor); Pipeline.async({}, [ tnt('em with ,', '*a*', ',', 'em', 'a'), tnt('strong with ,', '**a**', ',', 'strong', 'a'), tnt('em with .', '*a*', '.', 'em', 'a'), tnt('strong with .', '**a**', '.', 'strong', 'a'), tnt('em with ;', '*a*', ';', 'em', 'a'), tnt('strong with ;', '**a**', ';', 'strong', 'a'), tnt('em with :', '*a*', ':', 'em', 'a'), tnt('strong with :', '**a**', ':', 'strong', 'a'), tnt('em with !', '*a*', '!', 'em', 'a'), tnt('strong with !', '**a**', '!', 'strong', 'a'), tnt('em with ?', '*a*', '?', 'em', 'a'), tnt('strong with ?', '**a**', '?', 'strong', 'a') ], onSuccess, onFailure); }, { plugins: 'textpattern', skin_url: '/project/src/skins/lightgray/dist/lightgray' }, success, failure); } );