PHP Classes

File: public/js/tinymce/src/themes/mobile/src/test/js/module/test/ui/TestFrameEditor.js

Recommend this page to a friend!
  Classes of Abed Nego Ragil Putra   GoLavaCMS   public/js/tinymce/src/themes/mobile/src/test/js/module/test/ui/TestFrameEditor.js   Download  
File: public/js/tinymce/src/themes/mobile/src/test/js/module/test/ui/TestFrameEditor.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,414 bytes
 

Contents

Class file image Download
define( 'tinymce.themes.mobile.test.ui.TestFrameEditor', [ 'ephox.agar.api.Cursors', 'ephox.alloy.api.component.GuiFactory', 'ephox.katamari.api.Fun', 'ephox.sugar.api.dom.Focus', 'ephox.sugar.api.node.Element', 'ephox.sugar.api.properties.Attr', 'ephox.sugar.api.selection.WindowSelection', 'tinymce.themes.mobile.test.ui.TestEditor' ], function (Cursors, GuiFactory, Fun, Focus, Element, Attr, WindowSelection, TestEditor) { return function () { var frame = Element.fromTag('iframe'); Attr.set(frame, 'src', '/project/src/themes/mobile/src/test/html/editor.html'); var config = { getFrame: function () { return frame; }, onDomChanged: function () { return { unbind: Fun.noop }; } }; var delegate = TestEditor(); var dEditor = delegate.editor(); var editor = { selection: { getStart: function () { return WindowSelection.getExact(frame.dom().contentWindow).map(function (sel) { return sel.start().dom(); }).getOr(null); }, getContent: function () { return frame.dom().contentWindow.document.body.innerHTML; }, select: Fun.noop }, getBody: function () { return frame.dom().contentWindow.document.body; }, insertContent: dEditor.insertContent, execCommand: dEditor.execCommand, dom: dEditor.dom, // Maybe this should be implemented focus: function () { Focus.focus(frame); var win = frame.dom().contentWindow; WindowSelection.getExact(win).orThunk(function () { var fbody = Element.fromDom(frame.dom().contentWindow.document.body); var elem = Cursors.calculateOne(fbody, [ 0 ]); WindowSelection.setExact(win, elem, 0, elem, 0); }); } }; var component = GuiFactory.build( GuiFactory.external({ element: frame }) ); return { component: Fun.constant(component), config: Fun.constant(config), editor: Fun.constant(editor), adder: delegate.adder, assertEq: delegate.assertEq, sAssertEq: delegate.sAssertEq, sClear: delegate.sClear, sPrepareState: delegate.sPrepareState }; }; } );