本文整理汇总了TypeScript中tinymce/plugins/textpattern/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
UnitTest.asynctest('browser.tinymce.plugins.textpattern.UndoTextpatternTest', function () {
const success = arguments[arguments.length - 2];
const failure = arguments[arguments.length - 1];
ModernTheme();
TextpatternPlugin();
TinyLoader.setup(function (editor, onSuccess, onFailure) {
const tinyApis = TinyApis(editor);
const tinyActions = TinyActions(editor);
const steps = Utils.withTeardown([
Logger.t('inline italic then undo', GeneralSteps.sequence([
Utils.sSetContentAndPressSpace(tinyApis, tinyActions, '*a*'),
tinyApis.sAssertContentStructure(Utils.inlineStructHelper('em', 'a')),
tinyApis.sExecCommand('Undo'),
tinyApis.sAssertContent('<p>*a* </p>')
]))
], tinyApis.sSetContent(''));
Pipeline.async({}, steps, onSuccess, onFailure);
}, {
plugins: 'textpattern',
toolbar: 'textpattern',
skin_url: '/project/js/tinymce/skins/lightgray'
}, success, failure);
});
示例3: Theme
UnitTest.asynctest('browser.tinymce.plugins.textpattern.UndoTextpatternTest', (success, failure) => {
Theme();
TextpatternPlugin();
TinyLoader.setup(function (editor, onSuccess, onFailure) {
const tinyApis = TinyApis(editor);
const tinyActions = TinyActions(editor);
const steps = Utils.withTeardown(
[
Log.stepsAsStep('TBA', 'TextPattern: inline italic then undo', [
Utils.sSetContentAndPressSpace(tinyApis, tinyActions, '*a*'),
tinyApis.sAssertContentStructure(Utils.inlineStructHelper('em', 'a')),
tinyApis.sExecCommand('Undo'),
tinyApis.sAssertContent('<p>*a* </p>')
]),
Log.stepsAsStep('TBA', 'TextPattern: block italic then undo', [
Utils.sSetContentAndPressEnter(tinyApis, tinyActions, '*a*'),
tinyApis.sAssertContentStructure(Utils.inlineBlockStructHelper('em', 'a')),
tinyApis.sExecCommand('Undo'),
tinyApis.sAssertContent('<p>*a*</p>\n<p> </p>'),
tinyApis.sExecCommand('Undo'),
tinyApis.sAssertContent('<p>*a*</p>'),
]),
],
tinyApis.sSetContent('')
);
Pipeline.async({}, steps, onSuccess, onFailure);
}, {
plugins: 'textpattern',
base_url: '/project/tinymce/js/tinymce'
}, success, failure);
});
示例4: mobileTheme
UnitTest.asynctest('browser.tinymce.themes.mobile.ThemeTest', (success, failure) => {
mobileTheme();
ImagePlugin();
TablePlugin();
LinkPlugin();
PastePlugin();
ContextMenuPlugin();
TextPatternPlugin();
TinyLoader.setup(function (editor, onSuccess, onFailure) {
const ui = TinyUi(editor);
Pipeline.async({}, [
UiFinder.sExists(Element.fromDom(document.body), `.${Styles.resolve('mask-tap-icon')}`),
ui.sClickOnUi('Click the tap to edit button', `.${Styles.resolve('mask-tap-icon')}`),
ui.sWaitForUi('Wait mobile Toolbar', `.${Styles.resolve('toolbar')}`),
ui.sWaitForUi('Check for The first group', '[aria-label="The first group"]'),
ui.sWaitForUi('Check for the action group', '[aria-label="the action group"]'),
UiFinder.sNotExists(Element.fromDom(document.body), '[aria-label="The read only mode group"]'),
UiFinder.sNotExists(Element.fromDom(document.body), `.${Styles.resolve('mask-edit-icon')}`),
ui.sClickOnUi('Click back to Tap to Edit screen', `.${Styles.resolve('icon-back')}`),
UiFinder.sExists(Element.fromDom(document.body), `.${Styles.resolve('mask-tap-icon')}`),
], onSuccess, onFailure);
}, {
theme: 'mobile',
plugins: 'image table link paste textpattern',
insert_toolbar: 'quickimage media quicktable',
selection_toolbar: 'bold italic | quicklink h1 h2 blockquote',
inline: false,
base_url: '/project/tinymce/js/tinymce'
}, success, failure);
});
示例5: function
function () {
const success = arguments[arguments.length - 2];
const failure = arguments[arguments.length - 1];
ModernTheme();
TextpatternPlugin();
TinyLoader.setup(function (editor, onSuccess, onFailure) {
const tinyApis = TinyApis(editor);
// var tinyActions = TinyActions(editor);
const steps = Utils.withTeardown([
Logger.t('enter after first * in *a*', GeneralSteps.sequence([
tinyApis.sSetContent('<p>*a*</p>'),
tinyApis.sFocus,
tinyApis.sSetCursor([0, 0], 1),
Step.sync(function () {
editor.fire('keydown', { keyCode: 13 });
}),
tinyApis.sAssertContent('<p>*</p><p>a*</p>')
])),
Logger.t('enter after first * in *a*', GeneralSteps.sequence([
tinyApis.sSetContent('<p><strong>a</strong>*b*</p>'),
tinyApis.sFocus,
tinyApis.sSetCursor([0, 1], 1),
Step.sync(function () {
editor.fire('keydown', { keyCode: 13 });
})
]))
], tinyApis.sSetContent(''));
Pipeline.async({}, steps, onSuccess, onFailure);
}, {
plugins: 'textpattern',
toolbar: 'textpattern',
indent: false,
skin_url: '/project/js/tinymce/skins/lightgray'
}, success, failure);
}
示例6: Theme
'browser.tinymce.plugins.textpattern.TriggerInlinePatternBeginningTest', (success, failure) => {
Theme();
TextpatternPlugin();
TinyLoader.setup(function (editor, onSuccess, onFailure) {
const tinyApis = TinyApis(editor);
// var tinyActions = TinyActions(editor);
const steps = Utils.withTeardown([
Log.stepsAsStep('TBA', 'TextPattern: enter after first * in *a*', [
tinyApis.sSetContent('<p>*a*</p>'),
tinyApis.sFocus,
tinyApis.sSetCursor([0, 0], 1),
Step.sync(function () {
editor.fire('keydown', { keyCode: 13 });
}),
tinyApis.sAssertContent('<p>*</p><p>a*</p>')
]),
Log.stepsAsStep('TBA', 'TextPattern: enter after first * in *b*', [
tinyApis.sSetContent('<p><strong>a</strong>*b*</p>'),
tinyApis.sFocus,
tinyApis.sSetCursor([0, 1], 1),
Step.sync(function () {
editor.fire('keydown', { keyCode: 13 });
}),
tinyApis.sAssertContent('<p><strong>a</strong>*</p><p>b*</p>')
])
], tinyApis.sSetContent(''));
Pipeline.async({}, steps, onSuccess, onFailure);
}, {
plugins: 'textpattern',
indent: false,
base_url: '/project/tinymce/js/tinymce'
}, success, failure);
}
示例7: function
UnitTest.asynctest('browser.AutoCompleteTest', function () {
const success = arguments[arguments.length - 2];
const failure = arguments[arguments.length - 1];
ImagePlugin();
LinkPlugin();
PastePlugin();
ContextMenuPlugin();
TablePlugin();
TextpatternPlugin();
Theme();
const cKeyStroke = function (keyvalue, modifiers) {
return Chain.op(function (dispatcher) {
Keyboard.keystroke(keyvalue, modifiers, dispatcher);
});
};
const sSetupLinkableContent = function (tinyApis) {
return GeneralSteps.sequence([
tinyApis.sSetContent(
'<h1 id="a">abc</h1>' +
'<h2 id="b">abcd</h2>' +
'<h3 id="c">abce</h3>'
),
tinyApis.sSetSelection([0, 0], 0, [0, 0], 1)
]);
};
const sSelectAutoCompleteLink = function (tinyApis, url) {
return Chain.asStep({}, [
Chain.fromParent(Toolbar.cWaitForToolbar, [
Toolbar.cClickButton('Insert/Edit link')
]),
Chain.fromParent(UiFinder.cFindIn('input'), [
UiControls.cSetValue(url),
cKeyStroke(Keys.space(), {}),
cKeyStroke(Keys.down(), {})
]),
Chain.inject(TinyDom.fromDom(document)),
Chain.fromParent(FocusTools.cGetFocused, [
cKeyStroke(Keys.down(), {}),
cKeyStroke(Keys.enter(), {})
]),
Chain.fromParent(Toolbar.cWaitForToolbar, [
Toolbar.cClickButton('Ok')
])
]);
};
TinyLoader.setup(function (editor, onSuccess, onFailure) {
const tinyApis = TinyApis(editor);
const tinyActions = TinyActions(editor);
Pipeline.async({}, [
tinyApis.sFocus,
sSetupLinkableContent(tinyApis),
tinyActions.sContentKeystroke(Keys.space(), {}),
sSelectAutoCompleteLink(tinyApis, 'a'),
tinyApis.sAssertContent(
'<h1 id="a"><a href="#b">a</a>bc</h1>\n' +
'<h2 id="b">abcd</h2>\n' +
'<h3 id="c">abce</h3>'
)
], onSuccess, onFailure);
}, {
theme: 'inlite',
plugins: 'image table link paste contextmenu textpattern',
insert_toolbar: 'quickimage media quicktable',
selection_toolbar: 'bold italic | quicklink h1 h2 blockquote',
inline: true,
skin_url: '/project/js/tinymce/skins/lightgray'
}, success, failure);
});
示例8: sContentActionTest
UnitTest.asynctest('browser.core.ThemeTest', function () {
const success = arguments[arguments.length - 2];
const failure = arguments[arguments.length - 1];
const dialogRoot = TinyDom.fromDom(document.body);
InliteTheme();
ImagePlugin();
TablePlugin();
LinkPlugin();
PastePlugin();
ContextMenuPlugin();
TextPatternPlugin();
const sClickFocusedButton = function (selector) {
return GeneralSteps.sequence([
Waiter.sTryUntil(
'Focus was not moved to the expected element',
FocusTools.sIsOnSelector('Is not on the right element', TinyDom.fromDom(document), selector),
10,
1000
),
Chain.asStep(TinyDom.fromDom(document), [
FocusTools.cGetFocused,
Mouse.cTrueClick
])
]);
};
const sBoldTests = function (tinyApis) {
return GeneralSteps.sequence([
tinyApis.sSetContent('<p>a</p>'),
tinyApis.sSetSelection([0, 0], 0, [0, 0], 1),
Toolbar.sClickButton('Bold'),
tinyApis.sAssertContent('<p><strong>a</strong></p>')
]);
};
const sH2Tests = function (tinyApis) {
return GeneralSteps.sequence([
tinyApis.sSetContent('<p>a</p>'),
tinyApis.sSetSelection([0, 0], 0, [0, 0], 1),
Toolbar.sClickButton('Heading 2'),
tinyApis.sAssertContent('<h2>a</h2>')
]);
};
const sInsertLink = function (url) {
return Chain.asStep({}, [
Toolbar.cWaitForToolbar,
Toolbar.cClickButton('Insert/Edit link'),
Toolbar.cWaitForToolbar,
UiFinder.cFindIn('input'),
UiControls.cSetValue(url),
Toolbar.cWaitForToolbar,
Toolbar.cClickButton('Ok')
]);
};
const cWaitForConfirmDialog = Chain.fromChainsWith(dialogRoot, [
UiFinder.cWaitForState('window element', '.mce-window', function () {
return true;
})
]);
const cClickButton = function (btnText) {
return Chain.fromChains([
UiFinder.cFindIn('button:contains("' + btnText + '")'),
Mouse.cTrueClick
]);
};
const sClickConfirmButton = function (btnText) {
return Chain.asStep({}, [
cWaitForConfirmDialog,
cClickButton(btnText)
]);
};
const sInsertLinkConfirmPrefix = function (url, btnText) {
return GeneralSteps.sequence([
sInsertLink(url),
sClickConfirmButton(btnText)
]);
};
const sUnlink = Chain.asStep({}, [
Toolbar.cWaitForToolbar,
Toolbar.cClickButton('Insert/Edit link'),
Toolbar.cWaitForToolbar,
Toolbar.cClickButton('Remove link')
]);
const sLinkTests = function (tinyApis, tinyActions) {
const sContentActionTest = function (inputHtml, spath, soffset, fpath, foffset, expectedHtml, sAction) {
return GeneralSteps.sequence([
tinyApis.sSetContent(inputHtml),
tinyApis.sSetSelection(spath, soffset, fpath, foffset),
tinyActions.sContentKeystroke(Keys.space(), {}),
sAction,
tinyApis.sAssertContent(expectedHtml)
//.........这里部分代码省略.........
示例9: function
function () {
const success = arguments[arguments.length - 2];
const failure = arguments[arguments.length - 1];
ModernTheme();
TextpatternPlugin();
const sTypeChar = function (editor, character) {
return Step.sync(function () {
const charCode = character.charCodeAt(0);
editor.fire('keypress', { charCode });
});
};
const sTypeAndTrigger = function (tinyApis, editor) {
return function (label, patternText, trigger, tag, rawText) {
return Logger.t(label, GeneralSteps.sequence([
tinyApis.sSetContent('<p>' + patternText + trigger + '</p>'),
tinyApis.sFocus,
tinyApis.sSetCursor([0, 0], patternText.length + 1),
sTypeChar(editor, trigger),
Waiter.sTryUntil(
'did not get expected format',
tinyApis.sAssertContentStructure(ApproxStructure.build(function (s, str) {
return s.element('body', {
children: [
s.element('p', {
children: [
s.element(tag, {
children: [
s.text(str.is(rawText))
]
}),
s.text(str.is(trigger))
]
})
]
});
})), 100, 4000
)
]));
};
};
TinyLoader.setup(function (editor, onSuccess, onFailure) {
const tinyApis = TinyApis(editor);
const tnt = sTypeAndTrigger(tinyApis, editor);
Pipeline.async({}, [
tnt('em with ,', '*a*', ',', 'em', 'a'),
tnt('strong with ,', '**a**', ',', 'strong', 'a'),
tnt('em with .', '*a*', '.', 'em', 'a'),
tnt('strong with .', '**a**', '.', 'strong', 'a'),
tnt('em with ;', '*a*', ';', 'em', 'a'),
tnt('strong with ;', '**a**', ';', 'strong', 'a'),
tnt('em with :', '*a*', ':', 'em', 'a'),
tnt('strong with :', '**a**', ':', 'strong', 'a'),
tnt('em with !', '*a*', '!', 'em', 'a'),
tnt('strong with !', '**a**', '!', 'strong', 'a'),
tnt('em with ?', '*a*', '?', 'em', 'a'),
tnt('strong with ?', '**a**', '?', 'strong', 'a')
], onSuccess, onFailure);
}, {
plugins: 'textpattern',
skin_url: '/project/js/tinymce/skins/lightgray'
}, success, failure);
}
示例10: function
UnitTest.asynctest('browser.tinymce.plugins.textpattern.TextPatternPluginTest', function () {
const success = arguments[arguments.length - 2];
const failure = arguments[arguments.length - 1];
TextpatternPlugin();
Theme();
TinyLoader.setup(function (editor, onSuccess, onFailure) {
const tinyApis = TinyApis(editor);
const tinyActions = TinyActions(editor);
const steps = Utils.withTeardown([
Logger.t('space on ** without content does nothing', GeneralSteps.sequence([
Utils.sSetContentAndPressSpace(tinyApis, tinyActions, '**'),
tinyApis.sAssertContent('<p>** </p>')
])),
Logger.t('Italic format on single word using space', GeneralSteps.sequence([
tinyApis.sSetContent('<p>*a *\u00a0</p>'),
tinyApis.sFocus,
tinyApis.sSetCursor([0, 0], 6),
tinyActions.sContentKeystroke(Keys.space(), {}),
tinyApis.sAssertContentStructure(ApproxStructure.build(function (s, str) {
return Utils.bodyStruct([
s.element('p', {
children: [
s.element('em', {
children: [
s.text(str.is('a'))
]
}),
s.text(str.is('\u00A0')),
s.text(str.is(' ')),
s.text(str.is('\u00A0'))
]
})
]);
}))
])),
Logger.t('Italic format on single word using space', GeneralSteps.sequence([
Utils.sSetContentAndPressSpace(tinyApis, tinyActions, '*a*'),
tinyApis.sAssertContentStructure(Utils.inlineStructHelper('em', 'a'))
])),
Logger.t('Bold format on single word using space', GeneralSteps.sequence([
Utils.sSetContentAndPressSpace(tinyApis, tinyActions, '**a**'),
tinyApis.sAssertContentStructure(Utils.inlineStructHelper('strong', 'a'))
])),
Logger.t('Bold/italic format on single word using space', GeneralSteps.sequence([
Utils.sSetContentAndPressSpace(tinyApis, tinyActions, '***a***'),
tinyApis.sAssertContentStructure(ApproxStructure.build(function (s, str) {
return Utils.bodyStruct([
s.element('p', {
children: [
s.element('em', {
children: [
s.element('strong', {
children: [
s.text(str.is('a'))
]
})
]
}),
s.text(str.is('\u00A0'))
]
})
]);
}))
])),
Logger.t('Bold format on multiple words using space', GeneralSteps.sequence([
Utils.sSetContentAndPressSpace(tinyApis, tinyActions, '**a b**'),
tinyApis.sAssertContentStructure(Utils.inlineStructHelper('strong', 'a b'))
])),
Logger.t('Bold format on single word using enter', GeneralSteps.sequence([
Utils.sSetContentAndPressEnter(tinyApis, tinyActions, '**a**'),
tinyApis.sAssertContentStructure(Utils.inlineBlockStructHelper('strong', 'a'))
])),
Logger.t('Bold/italic format on single word using enter', GeneralSteps.sequence([
Utils.sSetContentAndPressEnter(tinyApis, tinyActions, '***a***'),
tinyApis.sAssertContentStructure(ApproxStructure.build(function (s, str) {
return Utils.bodyStruct([
s.element('p', {
children: [
s.element('em', {
children: [
s.element('strong', {
children: [
s.text(str.is('a')),
s.anything()
]
})
]
})
]
}),
s.anything()
]);
}))
])),
Logger.t('H1 format on single word node using enter', GeneralSteps.sequence([
Utils.sSetContentAndPressEnter(tinyApis, tinyActions, '# a'),
tinyApis.sAssertContentStructure(Utils.blockStructHelper('h1', ' a'))
//.........这里部分代码省略.........