本文整理匯總了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);
}, {