• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

TypeScript mcagar.TinyActions函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了TypeScript中@ephox/mcagar.TinyActions函数的典型用法代码示例。如果您正苦于以下问题:TypeScript TinyActions函数的具体用法?TypeScript TinyActions怎么用?TypeScript TinyActions使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了TinyActions函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。

示例1: TinyApis

  TinyLoader.setup(function (editor, onSuccess, onFailure) {
    const tinyApis = TinyApis(editor);
    const tinyActions = TinyActions(editor);

    Pipeline.async({}, [
      tinyApis.sFocus,
      Logger.t('Type text before cef inline element', GeneralSteps.sequence([
        tinyApis.sSetContent('<p><span contenteditable="false">a</span></p>'),
        tinyApis.sSelect('p', [1]),
        tinyActions.sContentKeystroke(Keys.left(), {}),
        TypeText.sTypeContentAtSelection(Element.fromDom(editor.getDoc()), 'bc'),
        tinyApis.sAssertSelection([0, 0], 2, [0, 0], 2),
        tinyApis.sAssertContent('<p>bc<span contenteditable="false">a</span></p>')
      ])),
      Logger.t('Type after cef inline element', GeneralSteps.sequence([
        tinyApis.sSetContent('<p><span contenteditable="false">a</span></p>'),
        tinyApis.sSelect('p', [1]),
        tinyActions.sContentKeystroke(Keys.right(), {}),
        TypeText.sTypeContentAtSelection(Element.fromDom(editor.getDoc()), 'bc'),
        tinyApis.sAssertSelection([0, 1], 3, [0, 1], 3),
        tinyApis.sAssertContent('<p><span contenteditable="false">a</span>bc</p>')
      ])),
      Logger.t('Type between cef inline elements', GeneralSteps.sequence([
        tinyApis.sSetContent('<p><span contenteditable="false">a</span>&nbsp;<span contenteditable="false">b</span></p>'),
        tinyApis.sSelect('p', [3]),
        tinyActions.sContentKeystroke(Keys.left(), {}),
        tinyActions.sContentKeystroke(Keys.left(), {}),
        TypeText.sTypeContentAtSelection(Element.fromDom(editor.getDoc()), 'bc'),
        tinyApis.sAssertSelection([0, 1], 3, [0, 1], 3),
        tinyApis.sAssertContent('<p><span contenteditable="false">a</span>bc&nbsp;<span contenteditable="false">b</span></p>')
      ]))
    ], onSuccess, onFailure);
  }, {
开发者ID:tinymce,项目名称:tinymce,代码行数:33,代码来源:TypeTextAtCefTest.ts


示例2: TinyApis

  TinyLoader.setup(function (editor, onSuccess, onFailure) {
    const tinyApis = TinyApis(editor);
    const tinyActions = TinyActions(editor);

    Pipeline.async({}, [
      tinyApis.sFocus,

      Logger.t('ul > li in table', GeneralSteps.sequence([
        tinyApis.sSetContent('<table><tbody><tr><td><ul><li>a</li><li>b</li></ul></td></tr></tbody></table>'),
        tinyApis.sSetCursor([0, 0, 0, 0, 0, 1], 1),
        tinyActions.sContentKeystroke(Keys.tab(), {}),
        sAssertTableInnerHTML(editor, '<tbody><tr><td><ul><li>a<ul><li>b</li></ul></li></ul></td></tr></tbody>')
      ])),

      Logger.t('ol > li in table', GeneralSteps.sequence([
        tinyApis.sSetContent('<table><tbody><tr><td><ol><li>a</li><li>b</li></ol></td></tr></tbody></table>'),
        tinyApis.sSetCursor([0, 0, 0, 0, 0, 1], 1),
        tinyActions.sContentKeystroke(Keys.tab(), {}),
        sAssertTableInnerHTML(editor, '<tbody><tr><td><ol><li>a<ol><li>b</li></ol></li></ol></td></tr></tbody>')
      ])),

      Logger.t('dl > dt in table', GeneralSteps.sequence([
        tinyApis.sSetContent('<table><tbody><tr><td><dl><dt>a</dt><dt>b</dt></dl></td></tr></tbody></table>'),
        tinyApis.sSetCursor([0, 0, 0, 0, 0, 1], 1),
        tinyActions.sContentKeystroke(Keys.tab(), {}),
        sAssertTableInnerHTML(editor, '<tbody><tr><td><dl><dt>a</dt><dd>b</dd></dl></td></tr></tbody>')
      ]))

    ], onSuccess, onFailure);
  }, {
开发者ID:abstask,项目名称:tinymce,代码行数:30,代码来源:IndentListsInTableTest.ts


示例3: TinyApis

  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*&nbsp;</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>&nbsp;</p>'),
          tinyApis.sExecCommand('Undo'),
          tinyApis.sAssertContent('<p>*a*</p>'),
        ]),
      ],
      tinyApis.sSetContent('')
    );

    Pipeline.async({}, steps, onSuccess, onFailure);
  }, {
开发者ID:tinymce,项目名称:tinymce,代码行数:26,代码来源:UndoTextpatternTest.ts


示例4: TinyApis

    TinyLoader.setup(function (editor, onSuccess, onFailure) {
      const tinyApis = TinyApis(editor);
      const tinyActions = TinyActions(editor);

      const selectionChangeState = Cell(false);

      Pipeline.async({}, Env.webkit ?
        Log.steps('TBA', 'TestCase-Table-TBA-Create lists within table cells and verify keyboard navigation for the cells', [
          tinyApis.sFocus,
          tinyApis.sSetContent(
            '<table><tbody><tr><td><ul><li>a</li><li>b</li></ul></td></tr><tr><td><ul><li>c</li><li>d</li></ul></td></tr></tbody></table>'
          ),
          tinyApis.sSetCursor([0, 0, 0, 0, 0, 1, 0], 0),
          tinyActions.sContentKeydown(Keys.down(), {}),
          tinyApis.sSetCursor([0, 0, 1, 0, 0, 0, 0], 0),
          Step.sync(function () {
            editor.on('SelectionChange', function () {
              selectionChangeState.set(true);
            });
          }),
          Waiter.sTryUntil(
            'editor did not have correct selection',
            Step.sync(function () {
              RawAssertions.assertEq('state is true', true, selectionChangeState.get());
            }),
            100, 3000
          ),
          tinyApis.sAssertSelection([0, 0, 1, 0, 0, 0, 0], 0, [0, 0, 1, 0, 0, 0, 0], 0)
        ])
      : [], onSuccess, onFailure);
    }, {
开发者ID:tinymce,项目名称:tinymce,代码行数:31,代码来源:KeyboardCellNavigationTest.ts


示例5: TinyApis

    TinyLoader.setup(function (editor, onSuccess, onFailure) {
      const tinyApis = TinyApis(editor);
      const tinyActions = TinyActions(editor);

      const selectionChangeState = Cell(false);

      Pipeline.async({}, Env.webkit ? [
        tinyApis.sFocus,
        tinyApis.sSetContent(
          '<table><tbody><tr><td><ul><li>a</li><li>b</li></ul></td></tr><tr><td><ul><li>c</li><li>d</li></ul></td></tr></tbody></table>'
        ),
        tinyApis.sSetCursor([0, 0, 0, 0, 0, 1, 0], 0),
        tinyActions.sContentKeydown(Keys.down(), {}),
        tinyApis.sSetCursor([0, 0, 1, 0, 0, 0, 0], 0),
        Step.sync(function () {
          editor.on('selectionchange', function () {
            selectionChangeState.set(true);
          });
        }),
        Waiter.sTryUntil(
          'editor did not have correct selection',
          Step.sync(function () {
            RawAssertions.assertEq('state is true', true, selectionChangeState.get());
          }),
          100, 3000
        ),
        tinyApis.sAssertSelection([0, 0, 1, 0, 0, 0, 0], 0, [0, 0, 1, 0, 0, 0, 0], 0)
      ] : [], onSuccess, onFailure);
    }, {
开发者ID:abstask,项目名称:tinymce,代码行数:29,代码来源:KeyboardCellNavigationTest.ts


示例6: TinyApis

  TinyLoader.setup(function (editor, onSuccess, onFailure) {
    const tinyApis = TinyApis(editor);
    const tinyActions = TinyActions(editor);

    Pipeline.async({}, [
      tinyApis.sFocus,
      tinyApis.sSetContent('<p>abc 123</p>'),
      tinyApis.sSetSelection([0, 0], 4, [0, 0], 7),
      tinyActions.sContentKeystroke(Keys.space(), {}),
      tinyApis.sExecCommand('mceanchor'),
      Chain.asStep(Element.fromDom(document.body), [
        Chain.fromParent(UiFinder.cWaitForVisible('wait for dialog', 'div[aria-label="Anchor"][role="dialog"]'),
          [
            Chain.fromChains([
              UiFinder.cFindIn('input'),
              UiControls.cSetValue('abc')
            ]),
            Chain.fromChains([
              UiFinder.cFindIn('button:contains("Ok")'),
              Mouse.cClick
            ])
          ]
        )
      ]),
      tinyApis.sAssertContent('<p>abc <a id="abc"></a>123</p>')

    ], onSuccess, onFailure);
  }, {
开发者ID:aha-app,项目名称:tinymce-word-paste-filter,代码行数:28,代码来源:AnchorInlineTest.ts


示例7: TinyApis

  TinyLoader.setup(function (editor, onSuccess, onFailure) {
    const tinyApis = TinyApis(editor);
    const tinyActions = TinyActions(editor);

    Pipeline.async({}, [
      Logger.t('Press space at beginning of inline boundary', GeneralSteps.sequence([
        tinyApis.sFocus,
        tinyApis.sSetContent('<p>a <a href="#">b</a> c</p>'),
        tinyApis.sSetCursor([0, 1, 0], 0),
        tinyApis.sNodeChanged,
        tinyActions.sContentKeystroke(Keys.space(), {}),
        tinyApis.sAssertSelection([0, 1, 0], 1, [0, 1, 0], 1),
        tinyApis.sAssertContent('<p>a <a href="#">&nbsp;b</a> c</p>')
      ])),
      Logger.t('Press space at end of inline boundary', GeneralSteps.sequence([
        tinyApis.sFocus,
        tinyApis.sSetContent('<p>a <a href="#">b</a> c</p>'),
        tinyApis.sSetCursor([0, 1, 0], 1),
        tinyApis.sNodeChanged,
        tinyActions.sContentKeystroke(Keys.space(), {}),
        tinyApis.sAssertSelection([0, 1, 0], 2, [0, 1, 0], 2),
        tinyApis.sAssertContent('<p>a <a href="#">b&nbsp;</a> c</p>')
      ]))
    ], onSuccess, onFailure);
  }, {
开发者ID:aha-app,项目名称:tinymce-word-paste-filter,代码行数:25,代码来源:SpaceKeyTest.ts


示例8: TinyApis

  TinyLoader.setup(function (editor, onSuccess, onFailure) {
    const tinyApis = TinyApis(editor);
    const tinyActions = TinyActions(editor);

    Pipeline.async({}, [
      sTestDeletePadd(editor, tinyApis, tinyActions)
    ], onSuccess, onFailure);
  }, {
开发者ID:danielpunkass,项目名称:tinymce,代码行数:8,代码来源:CefDeleteTest.ts


示例9: TinyApis

  TinyLoader.setup((editor, onSuccess, onFailure) => {
    const tinyApis = TinyApis(editor);
    const tinyActions = TinyActions(editor);

    const steps = Utils.withTeardown([
      Logger.t('Apply html replacement pattern on space', GeneralSteps.sequence([
        Utils.sSetContentAndPressSpace(tinyApis, tinyActions, 'heading'),
        tinyApis.sAssertContent('<h1>My Heading</h1>'),
        tinyApis.sAssertSelection([0, 0], 10, [0, 0], 10)
      ])),
      Logger.t('Apply html replacement pattern on enter', GeneralSteps.sequence([
        Utils.sSetContentAndPressEnter(tinyApis, tinyActions, 'heading'),
        tinyApis.sAssertContent('<h1>My Heading</h1><p>&nbsp;</p>'),
        tinyApis.sAssertSelection([1], 0, [1], 0)
      ])),
      Logger.t('Apply html replacement pattern on enter in middle of word', GeneralSteps.sequence([
        tinyApis.sSetContent('<p>XheadingX</p>'),
        tinyApis.sSetSelection([0, 0], 8, [0, 0], 8),
        Utils.sPressEnter(tinyApis, tinyActions),
        tinyApis.sAssertContent('<p>X</p><h1>My Heading</h1><p>&nbsp;</p><p>X</p>'),
        tinyApis.sAssertSelection([2], 0, [2], 0)
      ])),
      Logger.t('Apply complex html replacement pattern on enter', GeneralSteps.sequence([
        tinyApis.sSetContent('<p>complex pattern</p>'),
        tinyApis.sSetSelection([0, 0], 15, [0, 0], 15),
        Utils.sPressEnter(tinyApis, tinyActions),
        tinyApis.sAssertContent('<h1>Text</h1><p>More text</p><p>&nbsp;</p>'),
      ])),

      Logger.t('Apply text replacement pattern on space', GeneralSteps.sequence([
        Utils.sSetContentAndPressSpace(tinyApis, tinyActions, 'brb'),
        tinyApis.sAssertContent('<p>Be Right Back</p>'),
        tinyApis.sAssertSelection([0, 0], 13, [0, 0], 13)
      ])),
      Logger.t('Apply text replacement pattern on space with content after', GeneralSteps.sequence([
        tinyApis.sSetContent('<p>brbX</p>'),
        tinyApis.sSetSelection([0, 0], 3, [0, 0], 3),
        Utils.sPressSpace(tinyApis, tinyActions),
        tinyApis.sAssertContent('<p>Be Right BackX</p>'),
        tinyApis.sAssertSelection([0, 0], 14, [0, 0], 14)
      ])),
      Logger.t('Apply text replacement pattern on enter', GeneralSteps.sequence([
        tinyApis.sSetContent('<p>brb</p>'),
        tinyApis.sSetSelection([0, 0], 3, [0, 0], 3),
        Utils.sPressEnter(tinyApis, tinyActions),
        tinyApis.sAssertContent('<p>Be Right Back</p><p>&nbsp;</p>'),
      ])),
      Logger.t('Apply text replacement pattern on enter with content after', GeneralSteps.sequence([
        tinyApis.sSetContent('<p>brbX</p>'),
        tinyApis.sSetSelection([0, 0], 3, [0, 0], 3),
        Utils.sPressEnter(tinyApis, tinyActions),
        tinyApis.sAssertContent('<p>Be Right Back</p><p>X</p>'),
        tinyApis.sAssertSelection([1, 0], 0, [1, 0], 0)
      ])),
    ], tinyApis.sSetContent(''));

    Pipeline.async({}, steps, onSuccess, onFailure);
  }, {
开发者ID:danielpunkass,项目名称:tinymce,代码行数:58,代码来源:ReplacementTest.ts


示例10: TinyApis

  TinyLoader.setup(function (editor, onSuccess, onFailure) {
    const tinyApis = TinyApis(editor);
    const tinyActions = TinyActions(editor);

    Pipeline.async({}, [
      tinyApis.sFocus,

      Logger.t('Enter before HR in the beginning of content', GeneralSteps.sequence([
        tinyApis.sSetContent('<hr /><p>a</p>'),
        tinyApis.sSetCursor([], 0),
        tinyActions.sContentKeystroke(Keys.enter(), {}),
        tinyApis.sAssertContent('<p>&nbsp;</p><hr /><p>a</p>'),
        tinyApis.sAssertSelection([0], 0, [0], 0)
      ])),

      Logger.t('Enter after HR in the beginning of content', GeneralSteps.sequence([
        tinyApis.sSetContent('<hr /><p>a</p>'),
        tinyApis.sSetCursor([], 1),
        tinyActions.sContentKeystroke(Keys.enter(), {}),
        tinyApis.sAssertContent('<hr /><p>&nbsp;</p><p>a</p>'),
        tinyApis.sAssertSelection([2, 0], 0, [2, 0], 0)
      ])),

      Logger.t('Enter before HR in the middle of content', GeneralSteps.sequence([
        tinyApis.sSetContent('<p>a</p><hr /><p>b</p>'),
        tinyApis.sSetCursor([], 1),
        tinyActions.sContentKeystroke(Keys.enter(), {}),
        tinyApis.sAssertContent('<p>a</p><p>&nbsp;</p><hr /><p>b</p>'),
        tinyApis.sAssertSelection([1], 0, [1], 0)
      ])),

      Logger.t('Enter after HR in the middle of content', GeneralSteps.sequence([
        tinyApis.sSetContent('<p>a</p><hr /><p>b</p>'),
        tinyApis.sSetCursor([], 2),
        tinyActions.sContentKeystroke(Keys.enter(), {}),
        tinyApis.sAssertContent('<p>a</p><hr /><p>&nbsp;</p><p>b</p>'),
        tinyApis.sAssertSelection([3, 0], 0, [3, 0], 0)
      ])),

      Logger.t('Enter before HR in the end of content', GeneralSteps.sequence([
        tinyApis.sFocus,
        tinyApis.sSetContent('<p>a</p><hr />'),
        tinyApis.sSetCursor([], 1),
        tinyActions.sContentKeystroke(Keys.enter(), {}),
        tinyApis.sAssertContent('<p>a</p><p>&nbsp;</p><hr />'),
        tinyApis.sAssertSelection([1], 0, [1], 0)
      ])),

      Logger.t('Enter after HR in the end of content', GeneralSteps.sequence([
        tinyApis.sFocus,
        tinyApis.sSetContent('<p>a</p><hr />'),
        tinyApis.sSetCursor([], 2),
        tinyActions.sContentKeystroke(Keys.enter(), {}),
        tinyApis.sAssertContent('<p>a</p><hr /><p>&nbsp;</p>'),
        tinyApis.sAssertSelection([2], 0, [2], 0)
      ]))
    ], onSuccess, onFailure);
  }, {
开发者ID:abstask,项目名称:tinymce,代码行数:58,代码来源:EnterKeyHrTest.ts



注:本文中的@ephox/mcagar.TinyActions函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
TypeScript mcagar.TinyApis函数代码示例发布时间:2022-05-28
下一篇:
TypeScript katamari.Unicode类代码示例发布时间:2022-05-28
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap