本文整理汇总了TypeScript中tinymce/plugins/charmap/Plugin.default函数的典型用法代码示例。如果您正苦于以下问题:TypeScript default函数的具体用法?TypeScript default怎么用?TypeScript default使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了default函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: 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') {
//.........这里部分代码省略.........
示例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();
const cmd = function (command, value?) {
return { command, value };
};
const commands = [
cmd('Bold'),
cmd('Italic'),
cmd('Underline'),
cmd('Strikethrough'),
cmd('Superscript'),
cmd('Subscript'),
cmd('Cut'),
cmd('Copy'),
cmd('Paste'),
cmd('Unlink'),
cmd('JustifyLeft'),
cmd('JustifyCenter'),
cmd('JustifyRight'),
cmd('JustifyFull'),
cmd('JustifyNone'),
cmd('InsertUnorderedList'),
cmd('InsertOrderedList'),
cmd('ForeColor', 'red'),
cmd('HiliteColor', 'green'),
cmd('FontName', 'Arial'),
cmd('FontSize', 7),
cmd('RemoveFormat'),
cmd('mceBlockQuote'),
cmd('FormatBlock', 'h1'),
cmd('mceInsertContent', 'abc'),
cmd('mceToggleFormat', 'bold'),
cmd('mceSetContent', 'abc'),
cmd('Indent'),
cmd('Outdent'),
cmd('InsertHorizontalRule'),
cmd('mceToggleVisualAid'),
cmd('mceInsertLink', 'url'),
cmd('selectAll'),
cmd('delete'),
cmd('mceNewDocument'),
cmd('Undo'),
cmd('Redo'),
cmd('mceAutoResize'),
cmd('mceShowCharmap'),
cmd('mceCodeEditor'),
cmd('mceDirectionLTR'),
cmd('mceDirectionRTL'),
cmd('mceFullPageProperties'),
cmd('mceFullscreen'),
cmd('mceImage'),
cmd('mceInsertDate'),
cmd('mceInsertTime'),
cmd('InsertDefinitionList'),
cmd('mceNonBreaking'),
cmd('mcePageBreak'),
//.........这里部分代码省略.........
示例3: CharmapPlugin
UnitTest.asynctest('browser.tinymce.plugins.charmap.AutocompletionTest', (success, failure) => {
CharmapPlugin();
TinyLoader.setup(function (editor, onSuccess, onFailure) {
const tinyApis = TinyApis(editor);
const eDoc = Element.fromDom(editor.getDoc());
Pipeline.async({},
Log.steps('TBA', 'Charmap: Autocomplete, trigger an autocomplete and check it appears', [
tinyApis.sFocus,
tinyApis.sSetContent('<p>:co</p>'),
tinyApis.sSetCursor([ 0, 0 ], 3),
Keyboard.sKeypress(eDoc, 'o'.charCodeAt(0), { }),
UiFinder.sWaitForVisible('Waiting for autocomplete menu', Body.body(), '.tox-autocompleter'),
Keyboard.sKeydown(eDoc, Keys.enter(), { }),
// This assertion does not pass on Phantom. The editor content
// is empty. Not sure if it's an encoding issue for entities.
navigator.userAgent.indexOf('PhantomJS') > -1 ? Step.pass : tinyApis.sAssertContent('<p>âĄ</p>')
])
, onSuccess, onFailure);
}, {
plugins: 'charmap',
toolbar: 'charmap',
theme: 'silver',
base_url: '/project/tinymce/js/tinymce',
}, success, failure);
});
示例4: function
UnitTest.asynctest('browser.tinymce.plugins.charmap.InsertQuotationMarkTest', function () {
const success = arguments[arguments.length - 2];
const failure = arguments[arguments.length - 1];
ModernTheme();
CharmapPlugin();
TinyLoader.setup(function (editor, onSuccess, onFailure) {
const tinyApis = TinyApis(editor);
const tinyUi = TinyUi(editor);
Pipeline.async({}, [
tinyApis.sFocus,
tinyUi.sClickOnToolbar('click charmap', 'div[aria-label="Special character"] button'),
Chain.asStep({}, [
tinyUi.cWaitForPopup('wait for popup', 'div[role="dialog"]'),
UiFinder.cFindIn('div[title="quotation mark"]'),
Mouse.cClick
]),
tinyApis.sAssertContent('<p>"</p>')
], onSuccess, onFailure);
}, {
plugins: 'charmap',
toolbar: 'charmap',
skin_url: '/project/js/tinymce/skins/lightgray'
}, success, failure);
});
示例5: CharmapPlugin
UnitTest.asynctest('browser.tinymce.plugins.charmap.CharmapUserDefinedTest', (success, failure) => {
CharmapPlugin();
TinyLoader.setup(function (editor, onSuccess, onFailure) {
const tinyApis = TinyApis(editor);
const tinyUi = TinyUi(editor);
const doc = Element.fromDom(document);
Pipeline.async({},
Log.steps('TBA', 'Charmap: User defined charmap', [
tinyApis.sFocus,
tinyApis.sFocus,
tinyUi.sClickOnToolbar('click charmap', 'button[aria-label="Special character"]'),
tinyUi.sWaitForPopup('wait for popup', 'div[role="dialog"]'),
FocusTools.sTryOnSelector('Focus should have moved to input', doc, 'input'),
FocusTools.sSetActiveValue(doc, 'A'),
Chain.asStep(doc, [
FocusTools.cGetFocused,
cFakeEvent('input')
]),
tinyUi.sWaitForUi('wait for character A', '.tox-collection .tox-collection__item-icon:contains(A)')
])
, onSuccess, onFailure);
}, {
plugins: 'charmap',
toolbar: 'charmap',
charmap: [['A'.charCodeAt(0), 'A']],
theme: 'silver',
base_url: '/project/tinymce/js/tinymce',
}, success, failure);
});
示例6: CharmapPlugin
UnitTest.asynctest('browser.tinymce.plugins.charmap.InsertQuotationMarkTest', (success, failure) => {
CharmapPlugin();
TinyLoader.setup(function (editor, onSuccess, onFailure) {
const tinyApis = TinyApis(editor);
const tinyUi = TinyUi(editor);
Pipeline.async({},
Log.steps('TBA', 'Charmap: Open dialog, click on the All tab and click on Quotation Mark and then assert Quotation Mark is inserted', [
tinyApis.sFocus,
tinyUi.sClickOnToolbar('click charmap', 'button[aria-label="Special character"]'),
Chain.asStep({}, [
Chain.fromParent(
tinyUi.cWaitForPopup('wait for popup', 'div[role="dialog"]'),
[
Mouse.cClickOn('.tox-dialog__body-nav-item:contains(All)'),
Mouse.cClickOn('.tox-collection .tox-collection__item-icon:contains(")') // Could not get span[data-glyph="\"""] or similar to work...
]
)
]),
tinyApis.sAssertContent('<p>"</p>')
])
, onSuccess, onFailure);
}, {
plugins: 'charmap',
charmap_append: [[34, 'quotation mark']],
toolbar: 'charmap',
theme: 'silver',
base_url: '/project/tinymce/js/tinymce',
}, success, failure);
});
示例7: Plugin
UnitTest.asynctest('browser.tinymce.plugins.charmap.CharMapPluginTest', (success, failure) => {
const suite = LegacyUnit.createSuite();
Plugin();
suite.test('TestCase-TBA: Charmap: Replace characters by array', function (editor) {
editor.settings.charmap = [
[65, 'Latin A'],
[66, 'Latin B']
];
LegacyUnit.deepEqual(editor.plugins.charmap.getCharMap(), [
{
name: 'User Defined',
characters: [
[65, 'Latin A'],
[66, 'Latin B']
]
}
]);
});
suite.test('TestCase-TBA: Charmap: Replace characters by function', function (editor) {
editor.settings.charmap = function () {
return [
[65, 'Latin A fun'],
[66, 'Latin B fun']
];
};
LegacyUnit.deepEqual(editor.plugins.charmap.getCharMap(), [
{
name: 'User Defined',
characters: [
[65, 'Latin A fun'],
[66, 'Latin B fun']
]
}
]);
});
suite.test('TestCase-TBA: Charmap: Append characters by array', function (editor) {
editor.settings.charmap = [
[67, 'Latin C']
];
editor.settings.charmap_append = [
[65, 'Latin A'],
[66, 'Latin B']
];
LegacyUnit.deepEqual(editor.plugins.charmap.getCharMap(), [
{
name: 'User Defined',
characters: [
[67, 'Latin C'],
[65, 'Latin A'],
[66, 'Latin B']
]
}
]);
});
suite.test('TestCase-TBA: Charmap: Append characters by function', function (editor) {
editor.settings.charmap = [
[67, 'Latin C']
];
editor.settings.charmap_append = function () {
return [
[65, 'Latin A fun'],
[66, 'Latin B fun']
];
};
LegacyUnit.deepEqual(editor.plugins.charmap.getCharMap(), [
{
name: 'User Defined',
characters: [
[67, 'Latin C'],
[65, 'Latin A fun'],
[66, 'Latin B fun']]
}
]);
});
suite.test('TestCase-TBA: Charmap: Insert character', function (editor) {
let lastEvt;
editor.on('InsertCustomChar', function (e) {
lastEvt = e;
});
editor.plugins.charmap.insertChar('A');
LegacyUnit.equal(lastEvt.chr, 'A');
});
TinyLoader.setup(function (editor, onSuccess, onFailure) {
Pipeline.async({}, Log.steps('TBA', 'Charmap: Test replacing, appending and inserting characters', suite.toSteps(editor)), onSuccess, onFailure);
}, {
//.........这里部分代码省略.........
示例8: CharmapPlugin
UnitTest.asynctest('browser.tinymce.plugins.charmap.SearchTest', (success, failure) => {
// TODO: Replicate this test with only one category of characters.
CharmapPlugin();
// Move into shared library
const cFakeEvent = function (name) {
return Chain.control(
Chain.op(function (elm: Element) {
const evt = document.createEvent('HTMLEvents');
evt.initEvent(name, true, true);
elm.dom().dispatchEvent(evt);
}),
Guard.addLogging('Fake event')
);
};
TinyLoader.setup(function (editor, onSuccess, onFailure) {
const tinyApis = TinyApis(editor);
const tinyUi = TinyUi(editor);
const doc = Element.fromDom(document);
Pipeline.async({},
Log.steps('TBA', 'Charmap: Open dialog, Search for "euro", Euro should be first option', [
tinyApis.sFocus,
tinyUi.sClickOnToolbar('click charmap', 'button[aria-label="Special character"]'),
Chain.asStep({}, [
tinyUi.cWaitForPopup('wait for popup', 'div[role="dialog"]'),
]),
FocusTools.sTryOnSelector('Focus should start on', doc, '[role="tab"]'), // TODO: Remove duped startup of these tests
Keyboard.sKeydown(doc, Keys.tab(), { }),
FocusTools.sTryOnSelector('Focus should have moved to input', doc, 'input'),
FocusTools.sSetActiveValue(doc, 'euro'),
Chain.asStep(doc, [
FocusTools.cGetFocused,
cFakeEvent('input')
]),
Waiter.sTryUntil(
'Wait until Euro is the first choice (search should filter)',
Chain.asStep(Body.body(), [
UiFinder.cFindIn('.tox-collection__item:first'),
Chain.mapper((item) => {
return Attr.get(item, 'data-collection-item-value');
}),
Assertions.cAssertEq('Search should show euro', 'âŹ')
]),
100,
1000
),
Keyboard.sKeydown(doc, Keys.tab(), { }),
FocusTools.sTryOnSelector('Focus should have moved to collection', doc, '.tox-collection__item'),
Keyboard.sKeydown(doc, Keys.enter(), { }),
Waiter.sTryUntil(
'Waiting for content update',
tinyApis.sAssertContent('<p>€</p>'),
100,
1000
)
])
, onSuccess, onFailure);
}, {
plugins: 'charmap',
toolbar: 'charmap',
theme: 'silver',
base_url: '/project/tinymce/js/tinymce',
}, success, failure);
});
示例9:
/**
* 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 CharMapPlugin from 'tinymce/plugins/charmap/Plugin';
declare let tinymce: any;
CharMapPlugin();
tinymce.init({
selector: 'textarea.tinymce',
theme: 'modern',
skin_url: '../../../../../js/tinymce/skins/lightgray',
plugins: 'charmap code',
toolbar: 'charmap code',
height: 600
});
示例10: function
UnitTest.asynctest('browser.tinymce.plugins.charmap.CharMapPluginTest', function () {
const success = arguments[arguments.length - 2];
const failure = arguments[arguments.length - 1];
const suite = LegacyUnit.createSuite();
Plugin();
Theme();
suite.test('Replace characters by array', function (editor) {
editor.settings.charmap = [
[65, 'Latin A'],
[66, 'Latin B']
];
LegacyUnit.deepEqual(editor.plugins.charmap.getCharMap(), [
[65, 'Latin A'],
[66, 'Latin B']
]);
});
suite.test('Replace characters by function', function (editor) {
editor.settings.charmap = function () {
return [
[65, 'Latin A fun'],
[66, 'Latin B fun']
];
};
LegacyUnit.deepEqual(editor.plugins.charmap.getCharMap(), [
[65, 'Latin A fun'],
[66, 'Latin B fun']
]);
});
suite.test('Append characters by array', function (editor) {
editor.settings.charmap = [
[67, 'Latin C']
];
editor.settings.charmap_append = [
[65, 'Latin A'],
[66, 'Latin B']
];
LegacyUnit.deepEqual(editor.plugins.charmap.getCharMap(), [
[67, 'Latin C'],
[65, 'Latin A'],
[66, 'Latin B']
]);
});
suite.test('Append characters by function', function (editor) {
editor.settings.charmap = [
[67, 'Latin C']
];
editor.settings.charmap_append = function () {
return [
[65, 'Latin A fun'],
[66, 'Latin B fun']
];
};
LegacyUnit.deepEqual(editor.plugins.charmap.getCharMap(), [
[67, 'Latin C'],
[65, 'Latin A fun'],
[66, 'Latin B fun']
]);
});
suite.test('Insert character', function (editor) {
let lastEvt;
editor.on('insertCustomChar', function (e) {
lastEvt = e;
});
editor.plugins.charmap.insertChar('A');
LegacyUnit.equal(lastEvt.chr, 'A');
});
TinyLoader.setup(function (editor, onSuccess, onFailure) {
Pipeline.async({}, suite.toSteps(editor), onSuccess, onFailure);
}, {
plugins: 'charmap',
indent: false,
skin_url: '/project/js/tinymce/skins/lightgray'
}, success, failure);
});