本文整理汇总了TypeScript中tinymce/plugins/preview/Plugin.default函数的典型用法代码示例。如果您正苦于以下问题:TypeScript default函数的具体用法?TypeScript default怎么用?TypeScript default使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了default函数的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: function
UnitTest.asynctest('browser.tinymce.plugins.preview.PreviewContentStyleTest', function () {
const success = arguments[arguments.length - 2];
const failure = arguments[arguments.length - 1];
ModernTheme();
PreviewPlugin();
const assertIframeContains = function (editor, text, expected) {
const actual = IframeContent.getPreviewHtml(editor);
const regexp = new RegExp(text);
RawAssertions.assertEq('Should be same html', expected, regexp.test(actual));
};
const sAssertIframeHtmlContains = function (editor, text) {
return Step.sync(function () {
assertIframeContains(editor, text, true);
});
};
const sAssertIframeHtmlNotContains = function (editor, text) {
return Step.sync(function () {
assertIframeContains(editor, text, false);
});
};
TinyLoader.setup(function (editor, onSuccess, onFailure) {
const tinyApis = TinyApis(editor);
Pipeline.async({}, [
tinyApis.sSetContent('<p>hello world</p>'),
tinyApis.sSetSetting('content_style', 'p {color: blue;}'),
sAssertIframeHtmlContains(editor, '<style type="text/css">p {color: blue;}</style>'),
tinyApis.sDeleteSetting('content_style'),
sAssertIframeHtmlNotContains(editor, '<style type="text/css">p {color: blue;}</style>')
], onSuccess, onFailure);
}, {
plugins: 'preview',
skin_url: '/project/js/tinymce/skins/lightgray'
}, success, failure);
});
示例4: function
UnitTest.asynctest('browser.tinymce.plugins.preview.PreviewSanityTest', function () {
const success = arguments[arguments.length - 2];
const failure = arguments[arguments.length - 1];
ModernTheme();
PreviewPlugin();
TinyLoader.setup(function (editor, onSuccess, onFailure) {
const tinyApis = TinyApis(editor);
const tinyUi = TinyUi(editor);
Pipeline.async({}, [
tinyApis.sSetContent('<strong>a</strong>'),
tinyUi.sClickOnToolbar('click on preview toolbar', 'div[aria-label="Preview"] > button'),
tinyUi.sWaitForPopup('wait for preview popup', 'div[role="dialog"][aria-label="Preview"] iframe')
], onSuccess, onFailure);
}, {
plugins: 'preview',
toolbar: 'preview',
skin_url: '/project/js/tinymce/skins/lightgray'
}, success, failure);
});
示例5: PreviewPlugin
UnitTest.asynctest('browser.tinymce.plugins.preview.PreviewSanityTest', (success, failure) => {
PreviewPlugin();
const dialogSelector = 'div[role="dialog"]';
const docBody = Element.fromDom(document.body);
const doc = TinyDom.fromDom(document);
TinyLoader.setup(function (editor, onSuccess, onFailure) {
const tinyApis = TinyApis(editor);
const tinyUi = TinyUi(editor);
const sOpenDialog = () => {
return GeneralSteps.sequence(Logger.ts('Open dialog and wait for it to be visible', [
tinyUi.sClickOnToolbar('click on preview toolbar', 'button'),
tinyUi.sWaitForPopup('wait for preview popup', '[role="dialog"] iframe')
]));
};
Pipeline.async({},
Log.steps('TBA', 'Preview: Set content, open dialog, click Close to close dialog. Open dialog, press escape and assert dialog closes', [
tinyApis.sSetContent('<strong>a</strong>'),
sOpenDialog(),
tinyUi.sClickOnUi('Click on Close button', '.tox-button:not(.tox-button--secondary)'),
Waiter.sTryUntil('Dialog should close', UiFinder.sNotExists(docBody, dialogSelector), 100, 3000),
sOpenDialog(),
Keyboard.sKeydown(doc, Keys.escape(), { }),
Waiter.sTryUntil('Dialog should close on esc', UiFinder.sNotExists(docBody, dialogSelector), 100, 3000)
])
, onSuccess, onFailure);
}, {
theme: 'silver',
plugins: 'preview',
toolbar: 'preview',
base_url: '/project/tinymce/js/tinymce',
}, success, failure);
});
示例6: PreviewPlugin
UnitTest.asynctest('browser.tinymce.plugins.preview.PreviewContentStyleTest', (success, failure) => {
PreviewPlugin();
const sAssertIframeContains = (editor, text, expected) => Step.sync(() => {
const actual = IframeContent.getPreviewHtml(editor);
const regexp = new RegExp(text);
RawAssertions.assertEq('Should be same html', expected, regexp.test(actual));
});
const sAssertIframeHtmlContains = function (editor, text) {
return Logger.t('Assert Iframe Html contains ' + text, sAssertIframeContains(editor, text, true));
};
const sAssertIframeHtmlNotContains = function (editor, text) {
return Logger.t('Assert Iframe Html does not contain ' + text, sAssertIframeContains(editor, text, false));
};
TinyLoader.setup(function (editor, onSuccess, onFailure) {
const tinyApis = TinyApis(editor);
Pipeline.async({},
Log.steps('TBA', 'Preview: Set content, set style setting and assert content and style. Delete style and assert style is removed', [
tinyApis.sSetContent('<p>hello world</p>'),
tinyApis.sSetSetting('content_style', 'p {color: blue;}'),
sAssertIframeHtmlContains(editor, '<style type="text/css">p {color: blue;}</style>'),
tinyApis.sDeleteSetting('content_style'),
sAssertIframeHtmlNotContains(editor, '<style type="text/css">p {color: blue;}</style>')
])
, onSuccess, onFailure);
}, {
theme: 'silver',
plugins: 'preview',
base_url: '/project/tinymce/js/tinymce',
}, success, failure);
});
示例7:
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();