当前位置: 首页>>代码示例>>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;未经允许,请勿转载。