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

TypeScript agar.UiControls类代码示例

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

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



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

示例1: TinyUi

  TinyLoader.setup(function (editor, onSuccess, onFailure) {
    const tinyUi = TinyUi(editor);

    Pipeline.async({}, [
      Logger.t('insert url by typing', GeneralSteps.sequence([
        tinyUi.sClickOnToolbar('click on link button', 'div[aria-label="Insert/edit link"] > button'),
        Chain.asStep({}, [
          Chain.fromParent(tinyUi.cWaitForPopup('Wait for dialog', 'div[role="dialog"]'),
            [
              Chain.fromChains([
                UiFinder.cFindIn('div > label:contains("Url") + div > input'),
                UiControls.cSetValue('http://www.test.com/'),
                cFakeEvent('keyup')
              ]),
              Chain.fromChains([
                UiFinder.cFindIn('label:contains("Text to display") + input'),
                UiControls.cGetValue,
                Assertions.cAssertEq('should be the same url', 'http://www.test.com/')
              ]),
              cCloseDialog
            ]
          )
        ])

      ])),
      Logger.t('insert url by pasting', GeneralSteps.sequence([
        tinyUi.sClickOnToolbar('click on link button', 'div[aria-label="Insert/edit link"] > button'),
        Chain.asStep({}, [
          Chain.fromParent(tinyUi.cWaitForPopup('Wait for dialog', 'div[role="dialog"]'),
            [
              Chain.fromChains([
                UiFinder.cFindIn('div > label:contains("Url") + div > input'),
                UiControls.cSetValue('http://www.test.com/'),
                cFakeEvent('paste')
              ]),
              Chain.fromChains([
                UiFinder.cFindIn('label:contains("Text to display") + input'),
                UiControls.cGetValue,
                Assertions.cAssertEq('should be the same url', 'http://www.test.com/')
              ]),
              cCloseDialog
            ]
          )
        ])

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


示例2: 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


示例3: function

const sPasteTextareaValue = function (ui, value) {
  return Chain.asStep({}, [
    cFindTextarea(ui, 'Paste your embed code below:'),
    UiControls.cSetValue(value),
    cFakeEvent('paste')
  ]);
};
开发者ID:danielpunkass,项目名称:tinymce,代码行数:7,代码来源:Utils.ts


示例4: TinyApis

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

    Pipeline.async({},
      Log.steps('TBA', 'Anchor: Add anchor by selecting text content, then check that anchor is inserted correctly', [
        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[role="dialog"].tox-dialog'),
            [
              Chain.fromChains([
                UiFinder.cFindIn('input'),
                UiControls.cSetValue('abc')
              ]),
              Chain.fromChains([
                UiFinder.cFindIn('button:contains("Save")'),
                Mouse.cClick
              ])
            ]
          )
        ]),
        tinyApis.sAssertContent('<p>abc <a id="abc"></a>123</p>')
    ])
    , onSuccess, onFailure);
  }, {
开发者ID:tinymce,项目名称:tinymce,代码行数:29,代码来源:AnchorInlineTest.ts


示例5:

const cSetInputValue = (section, newValue) =>  Chain.control(
  Chain.fromChains([
    UiFinder.cFindIn(`label:contains(${section}) + div > input`),
    UiControls.cSetValue(newValue)
  ]),
  Guard.addLogging('Set input value' + newValue)
);
开发者ID:tinymce,项目名称:tinymce,代码行数:7,代码来源:TableTestUtils.ts


示例6: function

const cSetSourceInput = function (ui, value) {
  return Chain.control(
    Chain.fromChains([
      cFindFilepickerInput(ui),
      UiControls.cSetValue(value)
    ]),
    Guard.addLogging(`Set source input ${value}`)
  );
};
开发者ID:tinymce,项目名称:tinymce,代码行数:9,代码来源:Utils.ts


示例7: cFindInDialog

const cSetValueOn = (selector: string, newValue: any) => (ui) => {
  return Chain.control(
    Chain.fromChains([
      cFindInDialog(selector)(ui),
      UiControls.cSetValue(newValue)
    ]),
    Guard.addLogging('Set value')
  );
};
开发者ID:tinymce,项目名称:tinymce,代码行数:9,代码来源:Utils.ts


示例8: TinyApis

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

    Pipeline.async({},
      Log.steps('TBA', 'SearchReplace: replace one of three found, undo and redo and assert there is no matcher spans in editor', [
        tinyApis.sSetContent('<p>cats cats cats</p>'),
        tinyUi.sClickOnToolbar('click on searchreplace button', 'button[aria-label="Find and replace"]'),
        Chain.asStep({}, [
          Chain.fromParent(tinyUi.cWaitForPopup('wait for dialog', 'div[role="dialog"]'), [
            Chain.fromChains([
              UiFinder.cFindIn('label:contains("Find") + input'),
              UiControls.cSetValue('cats')
            ]),
            Chain.fromChains([
              UiFinder.cFindIn('label:contains("Replace with") + input'),
              UiControls.cSetValue('dogs')
            ]),
            Chain.fromChains([
              UiFinder.cFindIn('button:contains("Find")'),
              Mouse.cClick
            ]),
            Chain.fromChains([
              UiFinder.cWaitFor('wait for button to be enabled', 'button[disabled!="disabled"]:contains("Replace")')
            ]),
            Chain.fromChains([
              UiFinder.cFindIn('button:contains("Replace")'),
              Mouse.cClick
            ]),
            Chain.fromChains([
              UiFinder.cFindIn('button[aria-label="Close"]'),
              Mouse.cClick
            ])
          ])
        ]),
        sUndo(editor),
        tinyApis.sAssertContent('<p>cats cats cats</p>'),
        sRedo(editor),
        tinyApis.sAssertContentPresence({ 'span.mce-match-marker': 0 }),
        tinyApis.sAssertContent('<p>dogs cats cats</p>')
      ])
    , onSuccess, onFailure);
  }, {
开发者ID:tinymce,项目名称:tinymce,代码行数:43,代码来源:UndoReplaceSpanTest.ts



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
TypeScript agar.UiFinder类代码示例发布时间:2022-05-28
下一篇:
TypeScript agar.TestLogs类代码示例发布时间: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