當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript Mouse.sTrueClickOn方法代碼示例

本文整理匯總了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);
  }, {
開發者ID:tinymce,項目名稱:tinymce,代碼行數:47,代碼來源:ContextToolbarTest.ts

示例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);
  }, {
開發者ID:abstask,項目名稱:tinymce,代碼行數:18,代碼來源:ContextToolbarTest.ts


注:本文中的@ephox/agar.Mouse.sTrueClickOn方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。