12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679 |
- (function () {
- var defs = {}; // id -> {dependencies, definition, instance (possibly undefined)}
- // Used when there is no 'main' module.
- // The name is probably (hopefully) unique so minification removes for releases.
- var register_3795 = function (id) {
- var module = dem(id);
- var fragments = id.split('.');
- var target = Function('return this;')();
- for (var i = 0; i < fragments.length - 1; ++i) {
- if (target[fragments[i]] === undefined)
- target[fragments[i]] = {};
- target = target[fragments[i]];
- }
- target[fragments[fragments.length - 1]] = module;
- };
- var instantiate = function (id) {
- var actual = defs[id];
- var dependencies = actual.deps;
- var definition = actual.defn;
- var len = dependencies.length;
- var instances = new Array(len);
- for (var i = 0; i < len; ++i)
- instances[i] = dem(dependencies[i]);
- var defResult = definition.apply(null, instances);
- if (defResult === undefined)
- throw 'module [' + id + '] returned undefined';
- actual.instance = defResult;
- };
- var def = function (id, dependencies, definition) {
- if (typeof id !== 'string')
- throw 'module id must be a string';
- else if (dependencies === undefined)
- throw 'no dependencies for ' + id;
- else if (definition === undefined)
- throw 'no definition function for ' + id;
- defs[id] = {
- deps: dependencies,
- defn: definition,
- instance: undefined
- };
- };
- var dem = function (id) {
- var actual = defs[id];
- if (actual === undefined)
- throw 'module [' + id + '] was undefined';
- else if (actual.instance === undefined)
- instantiate(id);
- return actual.instance;
- };
- var req = function (ids, callback) {
- var len = ids.length;
- var instances = new Array(len);
- for (var i = 0; i < len; ++i)
- instances.push(dem(ids[i]));
- callback.apply(null, callback);
- };
- var ephox = {};
- ephox.bolt = {
- module: {
- api: {
- define: def,
- require: req,
- demand: dem
- }
- }
- };
- var define = def;
- var require = req;
- var demand = dem;
- // this helps with minificiation when using a lot of global references
- var defineGlobal = function (id, ref) {
- define(id, [], function () { return ref; });
- };
- /*jsc
- ["tinymce/inlite/Theme","global!tinymce.ThemeManager","global!tinymce.util.Delay","tinymce/inlite/ui/Panel","tinymce/inlite/ui/Buttons","tinymce/inlite/core/SkinLoader","tinymce/inlite/core/SelectionMatcher","tinymce/inlite/core/ElementMatcher","tinymce/inlite/core/Matcher","tinymce/inlite/alien/Arr","tinymce/inlite/core/PredicateId","global!tinymce.util.Tools","global!tinymce.ui.Factory","global!tinymce.DOM","tinymce/inlite/ui/Toolbar","tinymce/inlite/ui/Forms","tinymce/inlite/core/Measure","tinymce/inlite/core/Layout","tinymce/inlite/file/Conversions","tinymce/inlite/file/Picker","tinymce/inlite/core/Actions","global!tinymce.EditorManager","global!tinymce.util.Promise","tinymce/inlite/alien/Uuid","tinymce/inlite/alien/Unlink","tinymce/inlite/core/UrlType","global!tinymce.geom.Rect","tinymce/inlite/core/Convert","tinymce/inlite/alien/Bookmark","global!tinymce.dom.TreeWalker","global!tinymce.dom.RangeUtils"]
- jsc*/
- defineGlobal("global!tinymce.ThemeManager", tinymce.ThemeManager);
- defineGlobal("global!tinymce.util.Delay", tinymce.util.Delay);
- defineGlobal("global!tinymce.util.Tools", tinymce.util.Tools);
- defineGlobal("global!tinymce.ui.Factory", tinymce.ui.Factory);
- defineGlobal("global!tinymce.DOM", tinymce.DOM);
- /**
- * Toolbar.js
- *
- * Released under LGPL License.
- * Copyright (c) 1999-2016 Ephox Corp. All rights reserved
- *
- * License: http://www.tinymce.com/license
- * Contributing: http://www.tinymce.com/contributing
- */
- define('tinymce/inlite/ui/Toolbar', [
- 'global!tinymce.util.Tools',
- 'global!tinymce.ui.Factory'
- ], function (Tools, Factory) {
- var setActiveItem = function (item, name) {
- return function(state, args) {
- var nodeName, i = args.parents.length;
- while (i--) {
- nodeName = args.parents[i].nodeName;
- if (nodeName == 'OL' || nodeName == 'UL') {
- break;
- }
- }
- item.active(state && nodeName == name);
- };
- };
- var getSelectorStateResult = function (itemName, item) {
- var result = function (selector, handler) {
- return {
- selector: selector,
- handler: handler
- };
- };
- var activeHandler = function(state) {
- item.active(state);
- };
- var disabledHandler = function (state) {
- item.disabled(state);
- };
- if (itemName == 'bullist') {
- return result('ul > li', setActiveItem(item, 'UL'));
- }
- if (itemName == 'numlist') {
- return result('ol > li', setActiveItem(item, 'OL'));
- }
- if (item.settings.stateSelector) {
- return result(item.settings.stateSelector, activeHandler);
- }
- if (item.settings.disabledStateSelector) {
- return result(item.settings.disabledStateSelector, disabledHandler);
- }
- return null;
- };
- var bindSelectorChanged = function (editor, itemName, item) {
- return function () {
- var result = getSelectorStateResult(itemName, item);
- if (result !== null) {
- editor.selection.selectorChanged(result.selector, result.handler);
- }
- };
- };
- var create = function (editor, name, items) {
- var toolbarItems = [], buttonGroup;
- if (!items) {
- return;
- }
- Tools.each(items.split(/[ ,]/), function(item) {
- var itemName;
- if (item == '|') {
- buttonGroup = null;
- } else {
- if (Factory.has(item)) {
- item = {type: item};
- toolbarItems.push(item);
- buttonGroup = null;
- } else {
- if (!buttonGroup) {
- buttonGroup = {type: 'buttongroup', items: []};
- toolbarItems.push(buttonGroup);
- }
- if (editor.buttons[item]) {
- itemName = item;
- item = editor.buttons[itemName];
- if (typeof item == 'function') {
- item = item();
- }
- item.type = item.type || 'button';
- item = Factory.create(item);
- item.on('postRender', bindSelectorChanged(editor, itemName, item));
- buttonGroup.items.push(item);
- }
- }
- }
- });
- return Factory.create({
- type: 'toolbar',
- layout: 'flow',
- name: name,
- items: toolbarItems
- });
- };
- return {
- create: create
- };
- });
- defineGlobal("global!tinymce.util.Promise", tinymce.util.Promise);
- /**
- * Uuid.js
- *
- * Released under LGPL License.
- * Copyright (c) 1999-2016 Ephox Corp. All rights reserved
- *
- * License: http://www.tinymce.com/license
- * Contributing: http://www.tinymce.com/contributing
- */
- /**
- * Generates unique ids this is the same as in core but since
- * it's not exposed as a global we can't access it.
- */
- define("tinymce/inlite/alien/Uuid", [
- ], function() {
- var count = 0;
- var seed = function () {
- var rnd = function () {
- return Math.round(Math.random() * 0xFFFFFFFF).toString(36);
- };
- return 's' + Date.now().toString(36) + rnd() + rnd() + rnd();
- };
- var uuid = function (prefix) {
- return prefix + (count++) + seed();
- };
- return {
- uuid: uuid
- };
- });
- /**
- * Bookmark.js
- *
- * Released under LGPL License.
- * Copyright (c) 1999-2016 Ephox Corp. All rights reserved
- *
- * License: http://www.tinymce.com/license
- * Contributing: http://www.tinymce.com/contributing
- */
- define('tinymce/inlite/alien/Bookmark', [
- ], function () {
- /**
- * Returns a range bookmark. This will convert indexed bookmarks into temporary span elements with
- * index 0 so that they can be restored properly after the DOM has been modified. Text bookmarks will not have spans
- * added to them since they can be restored after a dom operation.
- *
- * So this: <p><b>|</b><b>|</b></p>
- * becomes: <p><b><span data-mce-type="bookmark">|</span></b><b data-mce-type="bookmark">|</span></b></p>
- *
- * @param {DOMRange} rng DOM Range to get bookmark on.
- * @return {Object} Bookmark object.
- */
- var create = function (dom, rng) {
- var bookmark = {};
- function setupEndPoint(start) {
- var offsetNode, container, offset;
- container = rng[start ? 'startContainer' : 'endContainer'];
- offset = rng[start ? 'startOffset' : 'endOffset'];
- if (container.nodeType == 1) {
- offsetNode = dom.create('span', {'data-mce-type': 'bookmark'});
- if (container.hasChildNodes()) {
- offset = Math.min(offset, container.childNodes.length - 1);
- if (start) {
- container.insertBefore(offsetNode, container.childNodes[offset]);
- } else {
- dom.insertAfter(offsetNode, container.childNodes[offset]);
- }
- } else {
- container.appendChild(offsetNode);
- }
- container = offsetNode;
- offset = 0;
- }
- bookmark[start ? 'startContainer' : 'endContainer'] = container;
- bookmark[start ? 'startOffset' : 'endOffset'] = offset;
- }
- setupEndPoint(true);
- if (!rng.collapsed) {
- setupEndPoint();
- }
- return bookmark;
- };
- /**
- * Moves the selection to the current bookmark and removes any selection container wrappers.
- *
- * @param {Object} bookmark Bookmark object to move selection to.
- */
- var resolve = function (dom, bookmark) {
- function restoreEndPoint(start) {
- var container, offset, node;
- function nodeIndex(container) {
- var node = container.parentNode.firstChild, idx = 0;
- while (node) {
- if (node == container) {
- return idx;
- }
- // Skip data-mce-type=bookmark nodes
- if (node.nodeType != 1 || node.getAttribute('data-mce-type') != 'bookmark') {
- idx++;
- }
- node = node.nextSibling;
- }
- return -1;
- }
- container = node = bookmark[start ? 'startContainer' : 'endContainer'];
- offset = bookmark[start ? 'startOffset' : 'endOffset'];
- if (!container) {
- return;
- }
- if (container.nodeType == 1) {
- offset = nodeIndex(container);
- container = container.parentNode;
- dom.remove(node);
- }
- bookmark[start ? 'startContainer' : 'endContainer'] = container;
- bookmark[start ? 'startOffset' : 'endOffset'] = offset;
- }
- restoreEndPoint(true);
- restoreEndPoint();
- var rng = dom.createRng();
- rng.setStart(bookmark.startContainer, bookmark.startOffset);
- if (bookmark.endContainer) {
- rng.setEnd(bookmark.endContainer, bookmark.endOffset);
- }
- return rng;
- };
- return {
- create: create,
- resolve: resolve
- };
- });
- defineGlobal("global!tinymce.dom.TreeWalker", tinymce.dom.TreeWalker);
- defineGlobal("global!tinymce.dom.RangeUtils", tinymce.dom.RangeUtils);
- /**
- * Unlink.js
- *
- * Released under LGPL License.
- * Copyright (c) 1999-2016 Ephox Corp. All rights reserved
- *
- * License: http://www.tinymce.com/license
- * Contributing: http://www.tinymce.com/contributing
- */
- /**
- * Unlink implementation that doesn't leave partial links for example it would produce:
- * a[b<a href="x">c]d</a>e -> a[bc]de
- * instead of:
- * a[b<a href="x">c]d</a>e -> a[bc]<a href="x">d</a>e
- */
- define("tinymce/inlite/alien/Unlink", [
- 'tinymce/inlite/alien/Bookmark',
- 'global!tinymce.util.Tools',
- 'global!tinymce.dom.TreeWalker',
- 'global!tinymce.dom.RangeUtils'
- ], function (Bookmark, Tools, TreeWalker, RangeUtils) {
- var getSelectedElements = function (rootElm, startNode, endNode) {
- var walker, node, elms = [];
- walker = new TreeWalker(startNode, rootElm);
- for (node = startNode; node; node = walker.next()) {
- if (node.nodeType === 1) {
- elms.push(node);
- }
- if (node === endNode) {
- break;
- }
- }
- return elms;
- };
- var unwrapElements = function (editor, elms) {
- var bookmark, dom, selection;
- dom = editor.dom;
- selection = editor.selection;
- bookmark = Bookmark.create(dom, selection.getRng());
- Tools.each(elms, function (elm) {
- editor.dom.remove(elm, true);
- });
- selection.setRng(Bookmark.resolve(dom, bookmark));
- };
- var isLink = function (elm) {
- return elm.nodeName === 'A' && elm.hasAttribute('href');
- };
- var getParentAnchorOrSelf = function (dom, elm) {
- var anchorElm = dom.getParent(elm, isLink);
- return anchorElm ? anchorElm : elm;
- };
- var getSelectedAnchors = function (editor) {
- var startElm, endElm, rootElm, anchorElms, selection, dom, rng;
- selection = editor.selection;
- dom = editor.dom;
- rng = selection.getRng();
- startElm = getParentAnchorOrSelf(dom, RangeUtils.getNode(rng.startContainer, rng.startOffset));
- endElm = RangeUtils.getNode(rng.endContainer, rng.endOffset);
- rootElm = editor.getBody();
- anchorElms = Tools.grep(getSelectedElements(rootElm, startElm, endElm), isLink);
- return anchorElms;
- };
- var unlinkSelection = function (editor) {
- unwrapElements(editor, getSelectedAnchors(editor));
- };
- return {
- unlinkSelection: unlinkSelection
- };
- });
- /**
- * Actions.js
- *
- * Released under LGPL License.
- * Copyright (c) 1999-2016 Ephox Corp. All rights reserved
- *
- * License: http://www.tinymce.com/license
- * Contributing: http://www.tinymce.com/contributing
- */
- define('tinymce/inlite/core/Actions', [
- 'tinymce/inlite/alien/Uuid',
- 'tinymce/inlite/alien/Unlink'
- ], function (Uuid, Unlink) {
- var createTableHtml = function (cols, rows) {
- var x, y, html;
- html = '<table data-mce-id="mce" style="width: 100%">';
- html += '<tbody>';
- for (y = 0; y < rows; y++) {
- html += '<tr>';
- for (x = 0; x < cols; x++) {
- html += '<td><br></td>';
- }
- html += '</tr>';
- }
- html += '</tbody>';
- html += '</table>';
- return html;
- };
- var getInsertedElement = function (editor) {
- var elms = editor.dom.select('*[data-mce-id]');
- return elms[0];
- };
- var insertTable = function (editor, cols, rows) {
- editor.undoManager.transact(function () {
- var tableElm, cellElm;
- editor.insertContent(createTableHtml(cols, rows));
- tableElm = getInsertedElement(editor);
- tableElm.removeAttribute('data-mce-id');
- cellElm = editor.dom.select('td,th', tableElm);
- editor.selection.setCursorLocation(cellElm[0], 0);
- });
- };
- var formatBlock = function (editor, formatName) {
- editor.execCommand('FormatBlock', false, formatName);
- };
- var insertBlob = function (editor, base64, blob) {
- var blobCache, blobInfo;
- blobCache = editor.editorUpload.blobCache;
- blobInfo = blobCache.create(Uuid.uuid('mceu'), blob, base64);
- blobCache.add(blobInfo);
- editor.insertContent(editor.dom.createHTML('img', {src: blobInfo.blobUri()}));
- };
- var collapseSelectionToEnd = function (editor) {
- editor.selection.collapse(false);
- };
- var unlink = function (editor) {
- editor.focus();
- Unlink.unlinkSelection(editor);
- collapseSelectionToEnd(editor);
- };
- var changeHref = function (editor, elm, url) {
- editor.focus();
- editor.dom.setAttrib(elm, 'href', url);
- collapseSelectionToEnd(editor);
- };
- var insertLink = function (editor, url) {
- editor.execCommand('mceInsertLink', false, {href: url});
- collapseSelectionToEnd(editor);
- };
- var updateOrInsertLink = function (editor, url) {
- var elm = editor.dom.getParent(editor.selection.getStart(), 'a[href]');
- elm ? changeHref(editor, elm, url) : insertLink(editor, url);
- };
- var createLink = function (editor, url) {
- url.trim().length === 0 ? unlink(editor) : updateOrInsertLink(editor, url);
- };
- return {
- insertTable: insertTable,
- formatBlock: formatBlock,
- insertBlob: insertBlob,
- createLink: createLink,
- unlink: unlink
- };
- });
- /**
- * UrlType.js
- *
- * Released under LGPL License.
- * Copyright (c) 1999-2016 Ephox Corp. All rights reserved
- *
- * License: http://www.tinymce.com/license
- * Contributing: http://www.tinymce.com/contributing
- */
- define('tinymce/inlite/core/UrlType', [
- ], function () {
- var isDomainLike = function (href) {
- return /^www\.|\.(com|org|edu|gov|uk|net|ca|de|jp|fr|au|us|ru|ch|it|nl|se|no|es|mil)$/i.test(href.trim());
- };
- var isAbsolute = function (href) {
- return /^https?:\/\//.test(href.trim());
- };
- return {
- isDomainLike: isDomainLike,
- isAbsolute: isAbsolute
- };
- });
- /**
- * Forms.js
- *
- * Released under LGPL License.
- * Copyright (c) 1999-2016 Ephox Corp. All rights reserved
- *
- * License: http://www.tinymce.com/license
- * Contributing: http://www.tinymce.com/contributing
- */
- define('tinymce/inlite/ui/Forms', [
- 'global!tinymce.util.Tools',
- 'global!tinymce.ui.Factory',
- 'global!tinymce.util.Promise',
- 'tinymce/inlite/core/Actions',
- 'tinymce/inlite/core/UrlType'
- ], function (Tools, Factory, Promise, Actions, UrlType) {
- var focusFirstTextBox = function (form) {
- form.find('textbox').eq(0).each(function (ctrl) {
- ctrl.focus();
- });
- };
- var createForm = function (name, spec) {
- var form = Factory.create(
- Tools.extend({
- type: 'form',
- layout: 'flex',
- direction: 'row',
- padding: 5,
- name: name,
- spacing: 3
- }, spec)
- );
- form.on('show', function () {
- focusFirstTextBox(form);
- });
- return form;
- };
- var toggleVisibility = function (ctrl, state) {
- return state ? ctrl.show() : ctrl.hide();
- };
- var askAboutPrefix = function (editor, href) {
- return new Promise(function (resolve) {
- editor.windowManager.confirm(
- 'The URL you entered seems to be an external link. Do you want to add the required http:// prefix?',
- function (result) {
- var output = result === true ? 'http://' + href : href;
- resolve(output);
- }
- );
- });
- };
- var convertLinkToAbsolute = function (editor, href) {
- return !UrlType.isAbsolute(href) && UrlType.isDomainLike(href) ? askAboutPrefix(editor, href) : Promise.resolve(href);
- };
- var createQuickLinkForm = function (editor, hide) {
- var unlink = function () {
- editor.focus();
- Actions.unlink(editor);
- hide();
- };
- return createForm('quicklink', {
- items: [
- {type: 'button', name: 'unlink', icon: 'unlink', onclick: unlink, tooltip: 'Remove link'},
- {type: 'textbox', name: 'linkurl', placeholder: 'Paste or type a link'},
- {type: 'button', icon: 'checkmark', subtype: 'primary', tooltip: 'Ok', onclick: 'submit'}
- ],
- onshow: function () {
- var elm, linkurl = '';
- elm = editor.dom.getParent(editor.selection.getStart(), 'a[href]');
- if (elm) {
- linkurl = editor.dom.getAttrib(elm, 'href');
- }
- this.fromJSON({
- linkurl: linkurl
- });
- toggleVisibility(this.find('#unlink'), elm);
- },
- onsubmit: function (e) {
- convertLinkToAbsolute(editor, e.data.linkurl).then(function (url) {
- Actions.createLink(editor, url);
- hide();
- });
- }
- });
- };
- return {
- createQuickLinkForm: createQuickLinkForm
- };
- });
- defineGlobal("global!tinymce.geom.Rect", tinymce.geom.Rect);
- /**
- * Convert.js
- *
- * Released under LGPL License.
- * Copyright (c) 1999-2016 Ephox Corp. All rights reserved
- *
- * License: http://www.tinymce.com/license
- * Contributing: http://www.tinymce.com/contributing
- */
- define('tinymce/inlite/core/Convert', [
- ], function () {
- var fromClientRect = function (clientRect) {
- return {
- x: clientRect.left,
- y: clientRect.top,
- w: clientRect.width,
- h: clientRect.height
- };
- };
- var toClientRect = function (geomRect) {
- return {
- left: geomRect.x,
- top: geomRect.y,
- width: geomRect.w,
- height: geomRect.h,
- right: geomRect.x + geomRect.w,
- bottom: geomRect.y + geomRect.h
- };
- };
- return {
- fromClientRect: fromClientRect,
- toClientRect: toClientRect
- };
- });
- /**
- * Measure.js
- *
- * Released under LGPL License.
- * Copyright (c) 1999-2016 Ephox Corp. All rights reserved
- *
- * License: http://www.tinymce.com/license
- * Contributing: http://www.tinymce.com/contributing
- */
- define('tinymce/inlite/core/Measure', [
- 'global!tinymce.DOM',
- 'global!tinymce.geom.Rect',
- 'tinymce/inlite/core/Convert'
- ], function (DOM, Rect, Convert) {
- var toAbsolute = function (rect) {
- var vp = DOM.getViewPort();
- return {
- x: rect.x + vp.x,
- y: rect.y + vp.y,
- w: rect.w,
- h: rect.h
- };
- };
- var measureElement = function (elm) {
- var clientRect = elm.getBoundingClientRect();
- return toAbsolute({
- x: clientRect.left,
- y: clientRect.top,
- w: Math.max(elm.clientWidth, elm.offsetWidth),
- h: Math.max(elm.clientHeight, elm.offsetHeight)
- });
- };
- var getElementRect = function (editor, elm) {
- return measureElement(elm);
- };
- var getPageAreaRect = function (editor) {
- return measureElement(editor.getElement().ownerDocument.body);
- };
- var getContentAreaRect = function (editor) {
- return measureElement(editor.getContentAreaContainer() || editor.getBody());
- };
- var getSelectionRect = function (editor) {
- var clientRect = editor.selection.getBoundingClientRect();
- return clientRect ? toAbsolute(Convert.fromClientRect(clientRect)) : null;
- };
- return {
- getElementRect: getElementRect,
- getPageAreaRect: getPageAreaRect,
- getContentAreaRect: getContentAreaRect,
- getSelectionRect: getSelectionRect
- };
- });
- /**
- * Layout.js
- *
- * Released under LGPL License.
- * Copyright (c) 1999-2016 Ephox Corp. All rights reserved
- *
- * License: http://www.tinymce.com/license
- * Contributing: http://www.tinymce.com/contributing
- */
- define('tinymce/inlite/core/Layout', [
- 'global!tinymce.geom.Rect',
- 'tinymce/inlite/core/Convert'
- ], function (Rect, Convert) {
- var result = function (rect, position) {
- return {
- rect: rect,
- position: position
- };
- };
- var moveTo = function (rect, toRect) {
- return {x: toRect.x, y: toRect.y, w: rect.w, h: rect.h};
- };
- var calcByPositions = function (testPositions1, testPositions2, targetRect, contentAreaRect, panelRect) {
- var relPos, relRect, outputPanelRect;
- relPos = Rect.findBestRelativePosition(panelRect, targetRect, contentAreaRect, testPositions1);
- targetRect = Rect.clamp(targetRect, contentAreaRect);
- if (relPos) {
- relRect = Rect.relativePosition(panelRect, targetRect, relPos);
- outputPanelRect = moveTo(panelRect, relRect);
- return result(outputPanelRect, relPos);
- }
- targetRect = Rect.intersect(contentAreaRect, targetRect);
- if (targetRect) {
- relPos = Rect.findBestRelativePosition(panelRect, targetRect, contentAreaRect, testPositions2);
- if (relPos) {
- relRect = Rect.relativePosition(panelRect, targetRect, relPos);
- outputPanelRect = moveTo(panelRect, relRect);
- return result(outputPanelRect, relPos);
- }
- outputPanelRect = moveTo(panelRect, targetRect);
- return result(outputPanelRect, relPos);
- }
- return null;
- };
- var calcInsert = function (targetRect, contentAreaRect, panelRect) {
- return calcByPositions(
- ['cr-cl', 'cl-cr'],
- ['bc-tc', 'bl-tl', 'br-tr'],
- targetRect,
- contentAreaRect,
- panelRect
- );
- };
- var calc = function (targetRect, contentAreaRect, panelRect) {
- return calcByPositions(
- ['tc-bc', 'bc-tc', 'tl-bl', 'bl-tl', 'tr-br', 'br-tr'],
- ['bc-tc', 'bl-tl', 'br-tr'],
- targetRect,
- contentAreaRect,
- panelRect
- );
- };
- var userConstrain = function (handler, targetRect, contentAreaRect, panelRect) {
- var userConstrainedPanelRect;
- if (typeof handler === 'function') {
- userConstrainedPanelRect = handler({
- elementRect: Convert.toClientRect(targetRect),
- contentAreaRect: Convert.toClientRect(contentAreaRect),
- panelRect: Convert.toClientRect(panelRect)
- });
- return Convert.fromClientRect(userConstrainedPanelRect);
- }
- return panelRect;
- };
- return {
- calcInsert: calcInsert,
- calc: calc,
- userConstrain: userConstrain
- };
- });
- /**
- * Panel.js
- *
- * Released under LGPL License.
- * Copyright (c) 1999-2016 Ephox Corp. All rights reserved
- *
- * License: http://www.tinymce.com/license
- * Contributing: http://www.tinymce.com/contributing
- */
- define('tinymce/inlite/ui/Panel', [
- 'global!tinymce.util.Tools',
- 'global!tinymce.ui.Factory',
- 'global!tinymce.DOM',
- 'tinymce/inlite/ui/Toolbar',
- 'tinymce/inlite/ui/Forms',
- 'tinymce/inlite/core/Measure',
- 'tinymce/inlite/core/Layout'
- ], function (Tools, Factory, DOM, Toolbar, Forms, Measure, Layout) {
- return function () {
- var DEFAULT_TEXT_SELECTION_ITEMS = 'bold italic | quicklink h2 h3 blockquote';
- var DEFAULT_INSERT_TOOLBAR_ITEMS = 'quickimage quicktable';
- var panel, currentRect;
- var createToolbars = function (editor, toolbars) {
- return Tools.map(toolbars, function (toolbar) {
- return Toolbar.create(editor, toolbar.id, toolbar.items);
- });
- };
- var getTextSelectionToolbarItems = function (settings) {
- var value = settings.selection_toolbar;
- return value ? value : DEFAULT_TEXT_SELECTION_ITEMS;
- };
- var getInsertToolbarItems = function (settings) {
- var value = settings.insert_toolbar;
- return value ? value : DEFAULT_INSERT_TOOLBAR_ITEMS;
- };
- var create = function (editor, toolbars) {
- var items, settings = editor.settings;
- items = createToolbars(editor, toolbars);
- items = items.concat([
- Toolbar.create(editor, 'text', getTextSelectionToolbarItems(settings)),
- Toolbar.create(editor, 'insert', getInsertToolbarItems(settings)),
- Forms.createQuickLinkForm(editor, hide)
- ]);
- return Factory.create({
- type: 'floatpanel',
- role: 'dialog',
- classes: 'tinymce tinymce-inline arrow',
- ariaLabel: 'Inline toolbar',
- layout: 'flex',
- direction: 'column',
- align: 'stretch',
- autohide: false,
- autofix: true,
- fixed: true,
- border: 1,
- items: items,
- oncancel: function() {
- editor.focus();
- }
- });
- };
- var showPanel = function (panel) {
- if (panel) {
- panel.show();
- }
- };
- var movePanelTo = function (panel, pos) {
- panel.moveTo(pos.x, pos.y);
- };
- var togglePositionClass = function (panel, relPos) {
- relPos = relPos ? relPos.substr(0, 2) : '';
- Tools.each({
- t: 'down',
- b: 'up',
- c: 'center'
- }, function(cls, pos) {
- panel.classes.toggle('arrow-' + cls, pos === relPos.substr(0, 1));
- });
- if (relPos === 'cr') {
- panel.classes.toggle('arrow-left', true);
- panel.classes.toggle('arrow-right', false);
- } else if (relPos === 'cl') {
- panel.classes.toggle('arrow-left', true);
- panel.classes.toggle('arrow-right', true);
- } else {
- Tools.each({
- l: 'left',
- r: 'right'
- }, function(cls, pos) {
- panel.classes.toggle('arrow-' + cls, pos === relPos.substr(1, 1));
- });
- }
- };
- var showToolbar = function (panel, id) {
- var toolbars = panel.items().filter('#' + id);
- if (toolbars.length > 0) {
- toolbars[0].show();
- panel.reflow();
- }
- };
- var showPanelAt = function (panel, id, editor, targetRect) {
- var contentAreaRect, panelRect, result, userConstainHandler;
- showPanel(panel);
- panel.items().hide();
- showToolbar(panel, id);
- userConstainHandler = editor.settings.inline_toolbar_position_handler;
- contentAreaRect = Measure.getContentAreaRect(editor);
- panelRect = DOM.getRect(panel.getEl());
- if (id === 'insert') {
- result = Layout.calcInsert(targetRect, contentAreaRect, panelRect);
- } else {
- result = Layout.calc(targetRect, contentAreaRect, panelRect);
- }
- if (result) {
- panelRect = result.rect;
- currentRect = targetRect;
- movePanelTo(panel, Layout.userConstrain(userConstainHandler, targetRect, contentAreaRect, panelRect));
- togglePositionClass(panel, result.position);
- } else {
- hide(panel);
- }
- };
- var hasFormVisible = function () {
- return panel.items().filter('form:visible').length > 0;
- };
- var showForm = function (editor, id) {
- if (panel) {
- panel.items().hide();
- showToolbar(panel, id);
- var contentAreaRect, panelRect, result, userConstainHandler;
- showPanel(panel);
- panel.items().hide();
- showToolbar(panel, id);
- userConstainHandler = editor.settings.inline_toolbar_position_handler;
- contentAreaRect = Measure.getContentAreaRect(editor);
- panelRect = DOM.getRect(panel.getEl());
- result = Layout.calc(currentRect, contentAreaRect, panelRect);
- if (result) {
- panelRect = result.rect;
- movePanelTo(panel, Layout.userConstrain(userConstainHandler, currentRect, contentAreaRect, panelRect));
- togglePositionClass(panel, result.position);
- }
- }
- };
- var show = function (editor, id, targetRect, toolbars) {
- if (!panel) {
- panel = create(editor, toolbars);
- panel.renderTo(document.body).reflow().moveTo(targetRect.x, targetRect.y);
- editor.nodeChanged();
- }
- showPanelAt(panel, id, editor, targetRect);
- };
- var hide = function () {
- if (panel) {
- panel.hide();
- }
- };
- var focus = function () {
- if (panel) {
- panel.find('toolbar:visible').eq(0).each(function (item) {
- item.focus(true);
- });
- }
- };
- var remove = function () {
- if (panel) {
- panel.remove();
- panel = null;
- }
- };
- var inForm = function () {
- return panel && panel.visible() && hasFormVisible();
- };
- return {
- show: show,
- showForm: showForm,
- inForm: inForm,
- hide: hide,
- focus: focus,
- remove: remove
- };
- };
- });
- /**
- * Conversions.js
- *
- * Released under LGPL License.
- * Copyright (c) 1999-2016 Ephox Corp. All rights reserved
- *
- * License: http://www.tinymce.com/license
- * Contributing: http://www.tinymce.com/contributing
- */
- define('tinymce/inlite/file/Conversions', [
- 'global!tinymce.util.Promise'
- ], function (Promise) {
- var blobToBase64 = function (blob) {
- return new Promise(function(resolve) {
- var reader = new FileReader();
- reader.onloadend = function() {
- resolve(reader.result.split(',')[1]);
- };
- reader.readAsDataURL(blob);
- });
- };
- return {
- blobToBase64: blobToBase64
- };
- });
- /**
- * Picker.js
- *
- * Released under LGPL License.
- * Copyright (c) 1999-2016 Ephox Corp. All rights reserved
- *
- * License: http://www.tinymce.com/license
- * Contributing: http://www.tinymce.com/contributing
- */
- define('tinymce/inlite/file/Picker', [
- 'global!tinymce.util.Promise'
- ], function (Promise) {
- var pickFile = function () {
- return new Promise(function (resolve) {
- var fileInput;
- fileInput = document.createElement("input");
- fileInput.type = "file";
- fileInput.style.position = 'fixed';
- fileInput.style.left = 0;
- fileInput.style.top = 0;
- fileInput.style.opacity = 0.001;
- document.body.appendChild(fileInput);
- fileInput.onchange = function(e) {
- resolve(Array.prototype.slice.call(e.target.files));
- };
- fileInput.click();
- fileInput.parentNode.removeChild(fileInput);
- });
- };
- return {
- pickFile: pickFile
- };
- });
- /**
- * Buttons.js
- *
- * Released under LGPL License.
- * Copyright (c) 1999-2016 Ephox Corp. All rights reserved
- *
- * License: http://www.tinymce.com/license
- * Contributing: http://www.tinymce.com/contributing
- */
- define('tinymce/inlite/ui/Buttons', [
- 'tinymce/inlite/ui/Panel',
- 'tinymce/inlite/file/Conversions',
- 'tinymce/inlite/file/Picker',
- 'tinymce/inlite/core/Actions'
- ], function (Panel, Conversions, Picker, Actions) {
- var addHeaderButtons = function (editor) {
- var formatBlock = function (name) {
- return function () {
- Actions.formatBlock(editor, name);
- };
- };
- for (var i = 1; i < 6; i++) {
- var name = 'h' + i;
- editor.addButton(name, {
- text: name.toUpperCase(),
- tooltip: 'Heading ' + i,
- stateSelector: name,
- onclick: formatBlock(name),
- onPostRender: function () {
- // TODO: Remove this hack that produces bold H1-H6 when we have proper icons
- var span = this.getEl().firstChild.firstChild;
- span.style.fontWeight = 'bold';
- }
- });
- }
- };
- var addToEditor = function (editor, panel) {
- editor.addButton('quicklink', {
- icon: 'link',
- tooltip: 'Insert/Edit link',
- stateSelector: 'a[href]',
- onclick: function () {
- panel.showForm(editor, 'quicklink');
- }
- });
- editor.addButton('quickimage', {
- icon: 'image',
- tooltip: 'Insert image',
- onclick: function () {
- Picker.pickFile().then(function (files) {
- var blob = files[0];
- Conversions.blobToBase64(blob).then(function (base64) {
- Actions.insertBlob(editor, base64, blob);
- });
- });
- }
- });
- editor.addButton('quicktable', {
- icon: 'table',
- tooltip: 'Insert table',
- onclick: function () {
- panel.hide();
- Actions.insertTable(editor, 2, 2);
- }
- });
- addHeaderButtons(editor);
- };
- return {
- addToEditor: addToEditor
- };
- });
- defineGlobal("global!tinymce.EditorManager", tinymce.EditorManager);
- /**
- * SkinLoader.js
- *
- * Released under LGPL License.
- * Copyright (c) 1999-2016 Ephox Corp. All rights reserved
- *
- * License: http://www.tinymce.com/license
- * Contributing: http://www.tinymce.com/contributing
- */
- define('tinymce/inlite/core/SkinLoader', [
- 'global!tinymce.EditorManager',
- 'global!tinymce.DOM'
- ], function (EditorManager, DOM) {
- var fireSkinLoaded = function (editor, callback) {
- var done = function () {
- editor.fire('SkinLoaded');
- callback();
- };
- if (editor.initialized) {
- done();
- } else {
- editor.on('init', done);
- }
- };
- var load = function (editor, skin, callback) {
- var baseUrl = EditorManager.baseURL;
- var skinUrl = baseUrl + '/skins/' + skin;
- var done = function () {
- fireSkinLoaded(editor, callback);
- };
- DOM.styleSheetLoader.load(skinUrl + '/skin.min.css', done);
- editor.contentCSS.push(skinUrl + '/content.inline.min.css');
- };
- return {
- load: load
- };
- });
- /**
- * Matcher.js
- *
- * Released under LGPL License.
- * Copyright (c) 1999-2016 Ephox Corp. All rights reserved
- *
- * License: http://www.tinymce.com/license
- * Contributing: http://www.tinymce.com/contributing
- */
- define('tinymce/inlite/core/Matcher', [
- ], function () {
- // result :: String, Rect -> Matcher.result
- var result = function (id, rect) {
- return {
- id: id,
- rect: rect
- };
- };
- // match :: Editor, [(Editor -> Matcher.result | Null)] -> Matcher.result | Null
- var match = function (editor, matchers) {
- for (var i = 0; i < matchers.length; i++) {
- var f = matchers[i];
- var result = f(editor);
- if (result) {
- return result;
- }
- }
- return null;
- };
- return {
- match: match,
- result: result
- };
- });
- /**
- * SelectionMatcher.js
- *
- * Released under LGPL License.
- * Copyright (c) 1999-2016 Ephox Corp. All rights reserved
- *
- * License: http://www.tinymce.com/license
- * Contributing: http://www.tinymce.com/contributing
- */
- define('tinymce/inlite/core/SelectionMatcher', [
- 'tinymce/inlite/core/Matcher',
- 'tinymce/inlite/core/Measure'
- ], function (Matcher, Measure) {
- // textSelection :: String -> (Editor -> Matcher.result | Null)
- var textSelection = function (id) {
- return function (editor) {
- if (!editor.selection.isCollapsed()) {
- return Matcher.result(id, Measure.getSelectionRect(editor));
- }
- return null;
- };
- };
- // emptyTextBlock :: [Elements], String -> (Editor -> Matcher.result | Null)
- var emptyTextBlock = function (elements, id) {
- return function (editor) {
- var i, textBlockElementsMap = editor.schema.getTextBlockElements();
- for (i = 0; i < elements.length; i++) {
- if (elements[i].nodeName === 'TABLE') {
- return null;
- }
- }
- for (i = 0; i < elements.length; i++) {
- if (elements[i].nodeName in textBlockElementsMap) {
- if (editor.dom.isEmpty(elements[i])) {
- return Matcher.result(id, Measure.getSelectionRect(editor));
- }
- return null;
- }
- }
- return null;
- };
- };
- return {
- textSelection: textSelection,
- emptyTextBlock: emptyTextBlock
- };
- });
- /**
- * ElementMatcher.js
- *
- * Released under LGPL License.
- * Copyright (c) 1999-2016 Ephox Corp. All rights reserved
- *
- * License: http://www.tinymce.com/license
- * Contributing: http://www.tinymce.com/contributing
- */
- define('tinymce/inlite/core/ElementMatcher', [
- 'tinymce/inlite/core/Matcher',
- 'tinymce/inlite/core/Measure'
- ], function (Matcher, Measure) {
- // element :: Element, [PredicateId] -> (Editor -> Matcher.result | Null)
- var element = function (element, predicateIds) {
- return function (editor) {
- for (var i = 0; i < predicateIds.length; i++) {
- if (predicateIds[i].predicate(element)) {
- return Matcher.result(predicateIds[i].id, Measure.getElementRect(editor, element));
- }
- }
- return null;
- };
- };
- // parent :: [Elements], [PredicateId] -> (Editor -> Matcher.result | Null)
- var parent = function (elements, predicateIds) {
- return function (editor) {
- for (var i = 0; i < elements.length; i++) {
- for (var x = 0; x < predicateIds.length; x++) {
- if (predicateIds[x].predicate(elements[i])) {
- return Matcher.result(predicateIds[x].id, Measure.getElementRect(editor, elements[i]));
- }
- }
- }
- return null;
- };
- };
- return {
- element: element,
- parent: parent
- };
- });
- /**
- * Arr.js
- *
- * Released under LGPL License.
- * Copyright (c) 1999-2016 Ephox Corp. All rights reserved
- *
- * License: http://www.tinymce.com/license
- * Contributing: http://www.tinymce.com/contributing
- */
- define('tinymce/inlite/alien/Arr', [
- ], function () {
- var flatten = function (arr) {
- return arr.reduce(function (results, item) {
- return Array.isArray(item) ? results.concat(flatten(item)) : results.concat(item);
- }, []);
- };
- return {
- flatten: flatten
- };
- });
- /**
- * PredicateId.js
- *
- * Released under LGPL License.
- * Copyright (c) 1999-2016 Ephox Corp. All rights reserved
- *
- * License: http://www.tinymce.com/license
- * Contributing: http://www.tinymce.com/contributing
- */
- define('tinymce/inlite/core/PredicateId', [
- 'global!tinymce.util.Tools'
- ], function (Tools) {
- var create = function (id, predicate) {
- return {
- id: id,
- predicate: predicate
- };
- };
- // fromContextToolbars :: [ContextToolbar] -> [PredicateId]
- var fromContextToolbars = function (toolbars) {
- return Tools.map(toolbars, function (toolbar) {
- return create(toolbar.id, toolbar.predicate);
- });
- };
- return {
- create: create,
- fromContextToolbars: fromContextToolbars
- };
- });
- /**
- * Theme.js
- *
- * Released under LGPL License.
- * Copyright (c) 1999-2016 Ephox Corp. All rights reserved
- *
- * License: http://www.tinymce.com/license
- * Contributing: http://www.tinymce.com/contributing
- */
- define('tinymce/inlite/Theme', [
- 'global!tinymce.ThemeManager',
- 'global!tinymce.util.Delay',
- 'tinymce/inlite/ui/Panel',
- 'tinymce/inlite/ui/Buttons',
- 'tinymce/inlite/core/SkinLoader',
- 'tinymce/inlite/core/SelectionMatcher',
- 'tinymce/inlite/core/ElementMatcher',
- 'tinymce/inlite/core/Matcher',
- 'tinymce/inlite/alien/Arr',
- 'tinymce/inlite/core/PredicateId'
- ], function(ThemeManager, Delay, Panel, Buttons, SkinLoader, SelectionMatcher, ElementMatcher, Matcher, Arr, PredicateId) {
- var getSelectionElements = function (editor) {
- var node = editor.selection.getNode();
- var elms = editor.dom.getParents(node);
- return elms;
- };
- var createToolbar = function (editor, selector, id, items) {
- var selectorPredicate = function (elm) {
- return editor.dom.is(elm, selector);
- };
- return {
- predicate: selectorPredicate,
- id: id,
- items: items
- };
- };
- var getToolbars = function (editor) {
- var contextToolbars = editor.contextToolbars;
- return Arr.flatten([
- contextToolbars ? contextToolbars : [],
- createToolbar(editor, 'img', 'image', 'alignleft aligncenter alignright')
- ]);
- };
- var findMatchResult = function (editor, toolbars) {
- var result, elements, contextToolbarsPredicateIds;
- elements = getSelectionElements(editor);
- contextToolbarsPredicateIds = PredicateId.fromContextToolbars(toolbars);
- result = Matcher.match(editor, [
- ElementMatcher.element(elements[0], contextToolbarsPredicateIds),
- SelectionMatcher.textSelection('text'),
- SelectionMatcher.emptyTextBlock(elements, 'insert'),
- ElementMatcher.parent(elements, contextToolbarsPredicateIds)
- ]);
- return result && result.rect ? result : null;
- };
- var togglePanel = function (editor, panel) {
- var toggle = function () {
- var toolbars = getToolbars(editor);
- var result = findMatchResult(editor, toolbars);
- if (result) {
- panel.show(editor, result.id, result.rect, toolbars);
- } else {
- panel.hide();
- }
- };
- return function () {
- if (!editor.removed) {
- toggle();
- }
- };
- };
- var ignoreWhenFormIsVisible = function (panel, f) {
- return function () {
- if (!panel.inForm()) {
- f();
- }
- };
- };
- var bindContextualToolbarsEvents = function (editor, panel) {
- var throttledTogglePanel = Delay.throttle(togglePanel(editor, panel), 0);
- var throttledTogglePanelWhenNotInForm = Delay.throttle(ignoreWhenFormIsVisible(panel, togglePanel(editor, panel)), 0);
- editor.on('blur hide ObjectResizeStart', panel.hide);
- editor.on('click', throttledTogglePanel);
- editor.on('nodeChange mouseup', throttledTogglePanelWhenNotInForm);
- editor.on('ResizeEditor ResizeWindow keyup', throttledTogglePanel);
- editor.on('remove', panel.remove);
- editor.shortcuts.add('Alt+F10', '', panel.focus);
- };
- var overrideLinkShortcut = function (editor, panel) {
- editor.shortcuts.remove('meta+k');
- editor.shortcuts.add('meta+k', '', function () {
- var toolbars = getToolbars(editor);
- var result = result = Matcher.match(editor, [
- SelectionMatcher.textSelection('quicklink')
- ]);
- if (result) {
- panel.show(editor, result.id, result.rect, toolbars);
- }
- });
- };
- var renderInlineUI = function (editor, panel) {
- var skinName = editor.settings.skin || 'lightgray';
- SkinLoader.load(editor, skinName, function () {
- bindContextualToolbarsEvents(editor, panel);
- overrideLinkShortcut(editor, panel);
- });
- return {};
- };
- var fail = function (message) {
- throw new Error(message);
- };
- ThemeManager.add('inlite', function (editor) {
- var panel = new Panel();
- Buttons.addToEditor(editor, panel);
- var renderUI = function () {
- return editor.inline ? renderInlineUI(editor, panel) : fail('inlite theme only supports inline mode.');
- };
- return {
- renderUI: renderUI
- };
- });
- return function() {};
- });
- dem('tinymce/inlite/Theme')();
- })();
|