本文整理汇总了TypeScript中tinymce/core/api/PluginManager.add函数的典型用法代码示例。如果您正苦于以下问题:TypeScript add函数的具体用法?TypeScript add怎么用?TypeScript add使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了add函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: Theme
UnitTest.asynctest('browser.tinymce.core.init.InitEditorPluginInitErrorTest', (success, failure) => {
Theme();
PluginManager.add('errorplugin', () => {
throw new Error('Failed to initialize plugin');
});
TinyLoader.setup(function (editor, onSuccess, onFailure) {
const tinyApis = TinyApis(editor);
Pipeline.async({}, [
Log.stepsAsStep('TBA', 'Editor is responsive after using a plugin that throws an error during init', [
tinyApis.sSetContent('<p>a</p>'),
tinyApis.sAssertContent('<p>a</p>'),
]),
Log.step('TBA', 'Failed plugin shouldn\'t be registered', Step.sync(() => {
Assertions.assertEq('Plugin shouldn\'t be registered', undefined, editor.plugins.errorplugin);
})),
Log.step('TBA', 'Notification opened detailing plugin failed to init', Step.sync(() => {
const notifications = editor.notificationManager.getNotifications();
Assertions.assertEq('Notification should exist', 1, notifications.length);
const notification = notifications[0];
Assertions.assertEq('Notification should have a message', 'Failed to initialize plugin: errorplugin', notification.settings.text);
Assertions.assertEq('Notification should be an error', 'error', notification.settings.type);
notification.close();
}))
], onSuccess, onFailure);
}, {
skin_url: '/project/js/tinymce/skins/lightgray',
plugins: 'errorplugin'
}, success, failure);
});
开发者ID:danielpunkass,项目名称:tinymce,代码行数:32,代码来源:InitEditorPluginInitErrorTest.ts
示例2: function
function () {
// Fake loading of tinymcespellchecker
PluginManager.add('tinymcespellchecker', function () { });
Assertions.assertEq('Should not have pro plugin', false, DetectProPlugin.hasProPlugin(new Editor('id', { plugins: 'paste' }, EditorManager)));
Assertions.assertEq('Should not have pro plugin', false, DetectProPlugin.hasProPlugin(new Editor('id', { plugins: '' }, EditorManager)));
Assertions.assertEq('Should have pro plugin', true, DetectProPlugin.hasProPlugin(new Editor('id', { plugins: 'tinymcespellchecker' }, EditorManager)));
Assertions.assertEq('Should have pro plugin', true, DetectProPlugin.hasProPlugin(new Editor('id', { plugins: 'paste tinymcespellchecker' }, EditorManager)));
Assertions.assertEq('Should have pro plugin', true, DetectProPlugin.hasProPlugin(new Editor('id', { plugins: 'tinymcespellchecker paste' }, EditorManager)));
Assertions.assertEq('Should have pro plugin', true, DetectProPlugin.hasProPlugin(new Editor('id', { plugins: 'paste tinymcespellchecker paste' }, EditorManager)));
Assertions.assertEq('Should have pro plugin', true, DetectProPlugin.hasProPlugin(new Editor('id', { plugins: 'paste,tinymcespellchecker,paste' }, EditorManager)));
Assertions.assertEq('Should have pro plugin', true, DetectProPlugin.hasProPlugin(new Editor('id', { plugins: 'paste tinymcespellchecker paste' }, EditorManager)));
}
开发者ID:abstask,项目名称:tinymce,代码行数:13,代码来源:DetectProPluginTest.ts
示例3: function
UnitTest.test('browser.tinymce.plugins.paste.alien.DetectProPluginTest', function () {
// Fake loading of powerpaste
PluginManager.add('powerpaste', function () { });
Assertions.assertEq('TestCase-TBA: Paste: Should not have pro plugin', false, DetectProPlugin.hasProPlugin(new Editor('id', { plugins: 'paste' }, EditorManager)));
Assertions.assertEq('TestCase-TBA: Paste: Should not have pro plugin', false, DetectProPlugin.hasProPlugin(new Editor('id', { plugins: '' }, EditorManager)));
Assertions.assertEq('TestCase-TBA: Paste: Should have pro plugin', true, DetectProPlugin.hasProPlugin(new Editor('id', { plugins: 'powerpaste' }, EditorManager)));
Assertions.assertEq('TestCase-TBA: Paste: Should have pro plugin', true, DetectProPlugin.hasProPlugin(new Editor('id', { plugins: 'paste powerpaste' }, EditorManager)));
Assertions.assertEq('TestCase-TBA: Paste: Should have pro plugin', true, DetectProPlugin.hasProPlugin(new Editor('id', { plugins: 'powerpaste paste' }, EditorManager)));
Assertions.assertEq('TestCase-TBA: Paste: Should have pro plugin', true, DetectProPlugin.hasProPlugin(new Editor('id', { plugins: 'paste powerpaste paste' }, EditorManager)));
Assertions.assertEq('TestCase-TBA: Paste: Should have pro plugin', true, DetectProPlugin.hasProPlugin(new Editor('id', { plugins: 'paste,powerpaste,paste' }, EditorManager)));
Assertions.assertEq('TestCase-TBA: Paste: Should have pro plugin', true, DetectProPlugin.hasProPlugin(new Editor('id', { plugins: 'paste powerpaste paste' }, EditorManager)));
});
开发者ID:tinymce,项目名称:tinymce,代码行数:13,代码来源:DetectProPluginTest.ts
示例4: function
/**
* Plugin.js
*
* Released under LGPL License.
* Copyright (c) 1999-2017 Ephox Corp. All rights reserved
*
* License: http://www.tinymce.com/license
* Contributing: http://www.tinymce.com/contributing
*/
import { Cell } from '@ephox/katamari';
import PluginManager from 'tinymce/core/api/PluginManager';
import Commands from './api/Commands';
import Buttons from './ui/Buttons';
PluginManager.add('insertdatetime', function (editor) {
const lastFormatState = Cell(null);
Commands.register(editor);
Buttons.register(editor, lastFormatState);
});
export default function () { }
开发者ID:abstask,项目名称:tinymce,代码行数:23,代码来源:Plugin.ts
示例5: function
/**
* Copyright (c) Tiny Technologies, Inc. All rights reserved.
* Licensed under the LGPL or a commercial license.
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*/
import PluginManager from 'tinymce/core/api/PluginManager';
import Api from './api/Api';
import Commands from './api/Commands';
import FilterContent from './core/FilterContent';
import ResolveName from './core/ResolveName';
import Selection from './core/Selection';
import Buttons from './ui/Buttons';
PluginManager.add('media', function (editor) {
Commands.register(editor);
Buttons.register(editor);
ResolveName.setup(editor);
FilterContent.setup(editor);
Selection.setup(editor);
return Api.get(editor);
});
export default function () { }
开发者ID:danielpunkass,项目名称:tinymce,代码行数:25,代码来源:Plugin.ts
示例6: function
/**
* Plugin.js
*
* Released under LGPL License.
* Copyright (c) 1999-2017 Ephox Corp. All rights reserved
*
* License: http://www.tinymce.com/license
* Contributing: http://www.tinymce.com/contributing
*/
import PluginManager from 'tinymce/core/api/PluginManager';
import Formats from './core/Formats';
import Buttons from './ui/Buttons';
/**
* This class contains all core logic for the legacyoutput plugin.
*
* @class tinymce.legacyoutput.Plugin
* @private
*/
PluginManager.add('legacyoutput', function (editor) {
Formats.setup(editor);
Buttons.register(editor);
});
export default function () { }
开发者ID:abstask,项目名称:tinymce,代码行数:27,代码来源:Plugin.ts
示例7: function
/**
* Plugin.js
*
* Released under LGPL License.
* Copyright (c) 1999-2017 Ephox Corp. All rights reserved
*
* License: http://www.tinymce.com/license
* Contributing: http://www.tinymce.com/contributing
*/
import PluginManager from 'tinymce/core/api/PluginManager';
import Commands from './api/Commands';
import FilterContent from './core/FilterContent';
import Buttons from './ui/Buttons';
PluginManager.add('image', function (editor) {
FilterContent.setup(editor);
Buttons.register(editor);
Commands.register(editor);
});
export default function () { }
开发者ID:abstask,项目名称:tinymce,代码行数:22,代码来源:Plugin.ts
示例8: function
/**
* Plugin.js
*
* Released under LGPL License.
* Copyright (c) 1999-2017 Ephox Corp. All rights reserved
*
* License: http://www.tinymce.com/license
* Contributing: http://www.tinymce.com/contributing
*/
import PluginManager from 'tinymce/core/api/PluginManager';
import Api from './api/Api';
import ImportCss from './core/ImportCss';
PluginManager.add('importcss', function (editor) {
ImportCss.setup(editor);
return Api.get(editor);
});
export default function () { }
开发者ID:abstask,项目名称:tinymce,代码行数:20,代码来源:Plugin.ts
示例9: function
/**
* Copyright (c) Tiny Technologies, Inc. All rights reserved.
* Licensed under the LGPL or a commercial license.
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*/
import { Cell } from '@ephox/katamari';
import PluginManager from 'tinymce/core/api/PluginManager';
import Commands from './api/Commands';
import Bindings from './core/Bindings';
import Buttons from './ui/Buttons';
PluginManager.add('visualblocks', (editor, pluginUrl) => {
const enabledState = Cell(false);
Commands.register(editor, pluginUrl, enabledState);
Buttons.register(editor, enabledState);
Bindings.setup(editor, pluginUrl, enabledState);
});
export default function () { }
开发者ID:tinymce,项目名称:tinymce,代码行数:22,代码来源:Plugin.ts
示例10: function
/**
* Copyright (c) Tiny Technologies, Inc. All rights reserved.
* Licensed under the LGPL or a commercial license.
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*/
import PluginManager from 'tinymce/core/api/PluginManager';
import Commands from './api/Commands';
import Buttons from './ui/Buttons';
PluginManager.add('directionality', function (editor) {
Commands.register(editor);
Buttons.register(editor);
});
export default function () { }
开发者ID:danielpunkass,项目名称:tinymce,代码行数:17,代码来源:Plugin.ts
注:本文中的tinymce/core/api/PluginManager.add函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论