本文整理汇总了TypeScript中@ephox/agar.Mouse.sTrueClickOn方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Mouse.sTrueClickOn方法的具体用法?TypeScript Mouse.sTrueClickOn怎么用?TypeScript Mouse.sTrueClickOn使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类@ephox/agar.Mouse
的用法示例。
在下文中一共展示了Mouse.sTrueClickOn方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: TinyApis
TinyLoader.setup(function (editor, onSuccess, onFailure) {
const tinyApis = TinyApis(editor);
const tinyUi = TinyUi(editor);
const editorEle = TinyDom.fromDom(editor.getBody());
const docEle = TinyDom.fromDom(document.body);
Pipeline.async({}, [
TestLinkUi.sClearHistory,
tinyApis.sFocus,
Log.stepsAsStep('TBA', 'no toolbar on by default', [
tinyApis.sSetContent('<a href="http://www.google.com">google</a>'),
Mouse.sTrueClickOn(editorEle, 'a'),
UiFinder.sNotExists(editorEle, '.tox-toolbar button[aria-label="Link"]'),
tinyApis.sSetContent('')
]),
Log.stepsAsStep('TBA', 'only after setting set to true', [
tinyApis.sSetSetting('link_context_toolbar', true),
tinyApis.sSetContent('<a href="http://www.google.com">google</a>'),
Mouse.sTrueClickOn(editorEle, 'a'),
tinyUi.sWaitForUi('wait for toolbar link button', '.tox-toolbar button[aria-label="Link"]'),
tinyUi.sWaitForUi('wait for toolbar unlink button', '.tox-toolbar button[aria-label="Remove link"]'),
tinyUi.sWaitForUi('wait for toolbar open link button', '.tox-toolbar button[aria-label="Open link"]'),
Chain.asStep(docEle, [
UiFinder.cWaitForState('check link content', '.tox-toolbar input', (ele) => ele.dom().value === 'http://www.google.com')
])
]),
Log.stepsAsStep('TBA', 'shows relative link urls', [
tinyApis.sSetSetting('link_context_toolbar', true),
tinyApis.sSetContent('<a href="#heading-1">heading</a>'),
Mouse.sTrueClickOn(editorEle, 'a'),
tinyUi.sWaitForUi('wait for toolbar link button', '.tox-toolbar button[aria-label="Link"]'),
Chain.asStep(docEle, [
UiFinder.cWaitForState('check link content', '.tox-toolbar input', (ele) => ele.dom().value === '#heading-1')
])
]),
Log.stepsAsStep('TBA', 'works with non text elements (e.g. images)', [
tinyApis.sSetSetting('link_context_toolbar', true),
tinyApis.sSetContent('<a href="http://www.google.com/"><img src="image.jpg"></a>'),
Mouse.sTrueClickOn(editorEle, 'a'),
tinyUi.sWaitForUi('wait for toolbar link button', '.tox-toolbar button[aria-label="Link"]'),
Chain.asStep(docEle, [
UiFinder.cWaitForState('check link content', '.tox-toolbar input', (ele) => ele.dom().value === 'http://www.google.com/')
])
]),
TestLinkUi.sClearHistory
], onSuccess, onFailure);
}, {
示例2: TinyApis
TinyLoader.setup(function (editor, onSuccess, onFailure) {
const tinyApis = TinyApis(editor);
const tinyUi = TinyUi(editor);
Pipeline.async({}, [
// no toolbar on by default
tinyApis.sSetContent('<a href="http://www.google.com">google</a>'),
Mouse.sTrueClickOn(TinyDom.fromDom(editor.getBody()), 'a'),
UiFinder.sNotExists(TinyDom.fromDom(editor.getBody()), 'div[aria-label="Open link"]'),
tinyApis.sSetContent(''),
// only after setting set to true
tinyApis.sSetSetting('link_context_toolbar', true),
tinyApis.sSetContent('<a href="http://www.google.com">google</a>'),
Mouse.sTrueClickOn(TinyDom.fromDom(editor.getBody()), 'a'),
tinyUi.sWaitForUi('wait for open button', 'div[aria-label="Open link"]')
], onSuccess, onFailure);
}, {