本文整理汇总了TypeScript中tinymce/plugins/spellchecker/Plugin.default函数的典型用法代码示例。如果您正苦于以下问题:TypeScript default函数的具体用法?TypeScript default怎么用?TypeScript default使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了default函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: function
UnitTest.asynctest('browser.tinymce.plugins.spellchecker.SpellcheckerTest', function () {
const success = arguments[arguments.length - 2];
const failure = arguments[arguments.length - 1];
SilverTheme();
SpellcheckerPlugin();
const sTestDefaultLanguage = function (editor) {
return Step.sync(function () {
RawAssertions.assertEq('should be same', Settings.getLanguage(editor), 'en');
});
};
TinyLoader.setup(function (editor, onSuccess, onFailure) {
const ui = TinyUi(editor);
Pipeline.async({}, Log.steps('TBA', 'Spellchecker: default settings', [
sTestDefaultLanguage(editor),
ui.sWaitForUi('my button', '.tox-split-button'),
]), onSuccess, onFailure);
}, {
theme: 'silver',
plugins: 'spellchecker',
toolbar: 'spellchecker',
base_url: '/project/tinymce/js/tinymce'
}, success, failure);
});
示例2: function
export default function () {
AdvListPlugin();
AnchorPlugin();
AutoLinkPlugin();
AutoResizePlugin();
AutoSavePlugin();
BbCodePlugin();
CharMapPlugin();
CodePlugin();
CodeSamplePlugin();
ColorPickerPlugin();
ContextMenuPlugin();
DirectionalityPlugin();
EmoticonsPlugin();
FullPagePlugin();
FullScreenPlugin();
HrPlugin();
ImagePlugin();
ImageToolsPlugin();
ImportCssPlugin();
InsertDatetimePlugin();
LegacyOutputPlugin();
LinkPlugin();
ListsPlugin();
MediaPlugin();
NonBreakingPlugin();
NonEditablePlugin();
PageBreakPlugin();
PastePlugin();
PreviewPlugin();
PrintPlugin();
SavePlugin();
SearchReplacePlugin();
SpellCheckerPlugin();
TabFocusPlugin();
TablePlugin();
TemplatePlugin();
TextColorPlugin();
TextPatternPlugin();
TocPlugin();
VisualBlocksPlugin();
VisualCharsPlugin();
WordCountPlugin();
ModernTheme();
MobileTheme();
HelpPlugin();
PluginManager.urls.emoticons = '../../../../js/tinymce/plugins/emoticons';
const settings = {
skin_url: '../../../../js/tinymce/skins/lightgray',
codesample_content_css: '../../../../js/tinymce/plugins/codesample/css/prism.css',
visualblocks_content_css: '../../../../js/tinymce/plugins/visualblocks/css/visualblocks.css',
images_upload_url: 'd',
selector: 'textarea',
// rtl_ui: true,
link_list: [
{ title: 'My page 1', value: 'http://www.tinymce.com' },
{ title: 'My page 2', value: 'http://www.moxiecode.com' }
],
image_list: [
{ title: 'My page 1', value: 'http://www.tinymce.com' },
{ title: 'My page 2', value: 'http://www.moxiecode.com' }
],
image_class_list: [
{ title: 'None', value: '' },
{ title: 'Some class', value: 'class-name' }
],
importcss_append: true,
height: 400,
file_picker_callback (callback, value, meta) {
// Provide file and text for the link dialog
if (meta.filetype === 'file') {
callback('https://www.google.com/logos/google.jpg', { text: 'My text' });
}
// Provide image and alt text for the image dialog
if (meta.filetype === 'image') {
callback('https://www.google.com/logos/google.jpg', { alt: 'My alt text' });
}
// Provide alternative source and posted for the media dialog
if (meta.filetype === 'media') {
callback('movie.mp4', { source2: 'alt.ogg', poster: 'https://www.google.com/logos/google.jpg' });
}
},
spellchecker_callback (method, text, success, failure) {
const words = text.match(this.getWordCharPattern());
if (method === 'spellcheck') {
const suggestions = {};
for (let i = 0; i < words.length; i++) {
suggestions[words[i]] = ['First', 'Second'];
}
success(suggestions);
}
if (method === 'addToDictionary') {
//.........这里部分代码省略.........
示例3: function
UnitTest.asynctest('browser.tinymce.plugins.spellchecker.SpellcheckerTest', function () {
const success = arguments[arguments.length - 2];
const failure = arguments[arguments.length - 1];
ModernTheme();
SpellcheckerPlugin();
const sCheckButtonType = function (editor, expected) {
return Step.sync(function () {
const button = editor.buttons.spellchecker;
RawAssertions.assertEq('should have same type', expected, button.type);
});
};
TinyLoader.setup(function (editor, onSuccess, onFailure) {
Pipeline.async({}, [
sCheckButtonType(editor, 'button')
], onSuccess, onFailure);
}, {
plugins: 'spellchecker',
toolbar: 'spellchecker',
spellchecker_languages: 'English=en',
skin_url: '/project/js/tinymce/skins/lightgray'
}, success, failure);
});
示例4: ModernTheme
UnitTest.asynctest('browser.tinymce.plugins.spellchecker.SpellcheckerChangeLanguageTest', (success, failure) => {
ModernTheme();
SpellcheckerPlugin();
TinyLoader.setup(function (editor, onSuccess, onFailure) {
const tinyUi = TinyUi(editor);
Pipeline.async({}, [
tinyUi.sClickOnToolbar('click caret', 'div[aria-label="Spellcheck"] i.mce-caret'),
tinyUi.sClickOnUi('click german', 'span:contains("German")'),
Step.sync(() => RawAssertions.assertEq('should be "de"', 'de', editor.plugins.spellchecker.getLanguage()))
], onSuccess, onFailure);
}, {
plugins: 'spellchecker',
toolbar: 'spellchecker',
spellchecker_languages: 'English=en,French=fr,German=de',
skin_url: '/project/js/tinymce/skins/lightgray'
}, success, failure);
});
示例5: SpellcheckerPlugin
UnitTest.asynctest('browser.tinymce.plugins.spellchecker.AddToDictionaryTest', (success, failure) => {
SpellcheckerPlugin();
const dict = [];
TinyLoader.setup(function (editor, onSuccess, onFailure) {
const api = TinyApis(editor);
const ui = TinyUi(editor);
Pipeline.async({}, Log.steps('TBA', 'Spellchecker: Add a new word to dictionary', [
api.sFocus,
api.sSetContent('<p>hello world</p>'),
ui.sClickOnToolbar('click spellcheck button', '[title="Spellcheck"] > .tox-tbtn'),
api.sSetCursor([ 0, 0, 0 ], 0),
Chain.asStep(Element.fromDom(editor.getBody()), [
UiFinder.cFindIn('span:contains("hello")'),
Mouse.cContextMenu
]),
Chain.asStep(Body.body(), [
UiFinder.cWaitFor('wait for context menu', 'div[role="menu"]'),
UiFinder.cFindIn('.tox-collection__item-label:contains("Add to dictionary")'),
Mouse.cClick
]),
Step.sync(() => RawAssertions.assertEq('dict should now have hello', ['hello'], dict))
]), onSuccess, onFailure);
}, {
theme: 'silver',
plugins: 'spellchecker',
toolbar: 'spellchecker',
spellchecker_languages: 'English=en,French=fr,German=de',
base_url: '/project/tinymce/js/tinymce',
spellchecker_callback(method, text, success, failure) {
if (method === 'spellcheck') {
success({dictionary: dict, words: {hello: ['word1'], world: ['word2']}});
} else if (method === 'addToDictionary') {
dict.push(text);
success();
}
}
}, success, failure);
});
示例6: function
UnitTest.asynctest('browser.tinymce.plugins.spellchecker.SpellcheckerTest', function () {
const success = arguments[arguments.length - 2];
const failure = arguments[arguments.length - 1];
SpellcheckerPlugin();
TinyLoader.setup(function (editor, onSuccess, onFailure) {
const ui = TinyUi(editor);
Pipeline.async({}, Log.steps('TBA', 'Spellchecker: Single language normal button', [
ui.sWaitForUi('my button', '.tox-tbtn'),
]), onSuccess, onFailure);
}, {
theme: 'silver',
plugins: 'spellchecker',
toolbar: 'spellchecker',
spellchecker_languages: 'English=en',
base_url: '/project/tinymce/js/tinymce'
}, success, failure);
});
示例7: SpellcheckerPlugin
UnitTest.asynctest('browser.tinymce.plugins.spellchecker.SpellcheckerChangeLanguageTest', (success, failure) => {
SpellcheckerPlugin();
TinyLoader.setup(function (editor, onSuccess, onFailure) {
const ui = TinyUi(editor);
Pipeline.async({}, Log.steps('TBA', 'Spellchecker: Change language test', [
ui.sClickOnToolbar('Click spelling', 'span.tox-split-button__chevron'),
ui.sWaitForUi('Wait for menu', '.tox-collection__item-label:contains("German")'),
ui.sClickOnUi('click german', '.tox-collection__item-label:contains("German")'),
Step.sync(() => RawAssertions.assertEq('should be "de"', 'de', editor.plugins.spellchecker.getLanguage()))
]), onSuccess, onFailure);
}, {
theme: 'silver',
plugins: 'spellchecker',
toolbar: 'spellchecker',
spellchecker_languages: 'English=en,French=fr,German=de',
base_url: '/project/tinymce/js/tinymce'
}, success, failure);
});
示例8: ModernTheme
UnitTest.asynctest('browser.tinymce.plugins.spellchecker.AddToDictionaryTest', (success, failure) => {
ModernTheme();
SpellcheckerPlugin();
const dict = [];
TinyLoader.setup(function (editor, onSuccess, onFailure) {
const tinyApis = TinyApis(editor);
const tinyUi = TinyUi(editor);
Pipeline.async({}, [
tinyApis.sFocus,
tinyApis.sSetContent('<p>hello world</p>'),
tinyUi.sClickOnToolbar('click spellcheck button', 'div[aria-label="Spellcheck"] button'),
Chain.asStep(Element.fromDom(editor.getBody()), [
UiFinder.cFindIn('span:contains("hello")'),
Mouse.cClick
]),
Chain.asStep(Body.body(), [
UiFinder.cWaitFor('wait for context menu', 'div.mce-floatpanel'),
UiFinder.cFindIn('span:contains("Add to Dictionary")'),
Mouse.cClick
]),
Step.sync(() => RawAssertions.assertEq('dict should now have hello', ['hello'], dict))
], onSuccess, onFailure);
}, {
plugins: 'spellchecker',
toolbar: 'spellchecker',
spellchecker_languages: 'English=en,French=fr,German=de',
skin_url: '/project/js/tinymce/skins/lightgray',
spellchecker_callback(method, text, success, failure) {
if (method === 'spellcheck') {
success({dictionary: dict, words: {hello: ['word1'], world: ['word2']}});
} else if (method === 'addToDictionary') {
dict.push(text);
success();
}
}
}, success, failure);
});
示例9: SpellcheckerPlugin
UnitTest.asynctest('browser.tinymce.plugins.spellchecker.SpellcheckerSpanClassTest', (success, failure) => {
SpellcheckerPlugin();
const dict = [];
TinyLoader.setup(function (editor, onSuccess, onFailure) {
const api = TinyApis(editor);
const ui = TinyUi(editor);
Pipeline.async({}, Log.steps('TBA', 'Spellchecker: Spelling marks should not reuse existing span. Spelling marks will be nested inside existing spans', [
api.sFocus,
api.sSetContent('<p>hello <span class="bold">bold</span> world</p>'),
api.sAssertContentPresence({
span: 1
}),
ui.sClickOnToolbar('click spellcheck button', '[title="Spellcheck"] > .tox-tbtn'),
api.sAssertContentPresence({
'span': 4,
'.bold.mce-spellchecker-word': 0,
'.bold > .mce-spellchecker-word': 1,
'.mce-spellchecker-word': 3
})
]), onSuccess, onFailure);
}, {
theme: 'silver',
plugins: 'spellchecker',
toolbar: 'spellchecker',
spellchecker_languages: 'English=en,French=fr,German=de',
base_url: '/project/tinymce/js/tinymce',
spellchecker_callback(method, text, success, failure) {
if (method === 'spellcheck') {
success({dictionary: dict, words: {hello: ['word1'], world: ['word2'], bold: ['word3']}});
} else if (method === 'addToDictionary') {
dict.push(text);
success();
}
}
}, success, failure);
});
示例10:
/**
* Demo.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
*/
import SpellCheckerPlugin from 'tinymce/plugins/spellchecker/Plugin';
declare let tinymce: any;
SpellCheckerPlugin();
tinymce.init({
selector: 'textarea.tinymce',
plugins: 'spellchecker code',
toolbar: 'spellchecker code',
skin_url: '../../../../../js/tinymce/skins/lightgray',
height: 600
});