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

TypeScript mcagar.TinyUi函数代码示例

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

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



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

示例1: TinyApis

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

    Pipeline.async({}, [
      Logger.t('click image list, check that source changes, change source and check that image list changes', GeneralSteps.sequence([
        tinyApis.sSetSetting('image_list', [
          { title: 'Dog', value: 'mydog.jpg' },
          { title: 'Cat', value: 'mycat.jpg' }
        ]),
        tinyUi.sClickOnToolbar('click image button', 'div[aria-label="Insert/edit image"] button'),
        Chain.asStep({}, [
          tinyUi.cWaitForPopup('wait for dialog', 'div[role="dialog"]'),
          UiFinder.cFindIn('label:contains("Image list") + div > button'),
          Mouse.cClick
        ]),
        Chain.asStep(TinyDom.fromDom(document.body), [
          UiFinder.cFindIn('div[role="menuitem"] > span:contains("Dog")'),
          Mouse.cClick
        ]),
        Chain.asStep({}, [
          Chain.fromParent(tinyUi.cWaitForPopup('wait for dialog', 'div[role="dialog"]'),
            [
              Chain.fromChains([
                UiFinder.cFindIn('label:contains("Source") + div > input'),
                UiControls.cGetValue,
                Assertions.cAssertEq('should be dog', 'mydog.jpg')
              ]),
              Chain.fromChains([
                UiFinder.cFindIn('label:contains("Source") + div > input'),
                UiControls.cSetValue('mycat.jpg'),
                cFakeEvent('change')
              ]),
              Chain.fromChains([
                UiFinder.cFindIn('label:contains("Image list") + div > button > span:contains("Cat")')
              ])
            ]
          )
        ])
      ]))
    ], onSuccess, onFailure);
  }, {
开发者ID:aha-app,项目名称:tinymce-word-paste-filter,代码行数:42,代码来源:ImageListTest.ts


示例2: TinyApis

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

    Pipeline.async({}, [
      tinyApis.sFocus,
      tinyApis.sSetContent('<p>hello world</p>'),
      tinyUi.sClickOnToolbar('click spellcheck button', 'div[aria-label="Spellcheck"] button'),
      Chain.asStep(Element.fromDom(editor.getBody()), [
        UiFinder.cFindIn('span:contains("hello")'),
        Mouse.cClick
      ]),
      Chain.asStep(Body.body(), [
        UiFinder.cWaitFor('wait for context menu', 'div.mce-floatpanel'),
        UiFinder.cFindIn('span:contains("Add to Dictionary")'),
        Mouse.cClick
      ]),
      Step.sync(() => RawAssertions.assertEq('dict should now have hello', ['hello'], dict))
    ], onSuccess, onFailure);
  }, {
开发者ID:abstask,项目名称:tinymce,代码行数:20,代码来源:AddToDictionaryTest.ts


示例3: TinyUi

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

    Pipeline.async({}, [
      Utils.sOpenDialog(tinyUi),
      Utils.sPasteTextareaValue(
        tinyUi,
        '<iframe width="200" height="100" src="a" ' +
        ' frameborder="0" allowfullscreen></iframe>'
      ),
      Utils.sSubmitDialog(tinyUi),
      Waiter.sTryUntil(
        'content was not expected structure',
        tinyApis.sAssertContentStructure(struct),
        100,
        4000
      )
    ], onSuccess, onFailure);
  }, {
开发者ID:aha-app,项目名称:tinymce-word-paste-filter,代码行数:20,代码来源:DimensionsFalseEmbedTest.ts


示例4: TinyUi

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

    Pipeline.async({}, [
      Utils.sOpenDialog(ui),
      Utils.sPasteSourceValue(ui, 'a'),
      Utils.sAssertWidthValue(ui, '300'),
      ui.sClickOnUi('Click on close button', 'button:contains("Ok")'),
      sWaitForResizeHandles(editor),
      Utils.sOpenDialog(ui),
      Utils.sChangeWidthValue(ui, '500'),
      ui.sClickOnUi('Click on close button', 'button:contains("Ok")'),
      sWaitForResizeHandles(editor),
      Waiter.sTryUntil(
        'Try assert content',
        sRawAssertImagePresence(editor),
        100, 3000
      )
    ], onSuccess, onFailure);
  }, {
开发者ID:abstask,项目名称:tinymce,代码行数:20,代码来源:ReopenResizeTest.ts


示例5: TinyUi

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

    Pipeline.async({},
      Log.steps('TBA', 'Help: Assert Help Plugin list contains getMetadata functionality', [
        Mouse.sClickOn(Element.fromDom(editor.getContainer()), Selectors.toolbarHelpButton),
        PluginAssert.sAssert(
          'Failed to list fake plugins',
          {
            'li a:contains("Help")': 1,
            'li a:contains("Fake")': 1,
            'li:contains("nometafake")': 1,
            'button:contains("Close")': 1
          },
          Selectors.dialog,
          Selectors.pluginsTab
        )
      ])
    , onSuccess, onFailure);
  }, {
开发者ID:tinymce,项目名称:tinymce,代码行数:20,代码来源:MetadataTest.ts


示例6: TinyUi

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

    const content = '<div contenteditable="false" data-ephox-embed-iri="embed-iri"><iframe src="about:blank"></iframe></div>';

    Pipeline.async({},
      Log.steps('TBA', 'Media: Open dialog, assert embeded content, close dialog and aseert div structure', [
        apis.sFocus,
        apis.sSetContent(content),
        sAssertDivStructure(editor, ephoxEmbedStructure),
        apis.sSelect('div', []),
        Utils.sOpenDialog(ui),
        Utils.sAssertSourceValue(ui, 'embed-iri'),
        Utils.sAssertEmbedData(ui, content),
        Utils.sSubmitDialog(ui),
        Waiter.sTryUntil('wait for div struture', sAssertDivStructure(editor, ephoxEmbedStructure), 100, 3000)
      ])
    , onSuccess, onFailure);
  }, {
开发者ID:tinymce,项目名称:tinymce,代码行数:20,代码来源:EphoxEmbedTest.ts


示例7: TinyUi

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

    Pipeline.async({}, [
      apis.sFocus,
      apis.sSetContent('<div contenteditable="false" data-ephox-embed-iri="embed-iri"><iframe src="about:blank"></iframe></div>'),
      sAssertDivStructure(editor, ephoxEmbedStructure),
      apis.sSelect('div', []),
      Utils.sOpenDialog(ui),
      Utils.sAssertSourceValue(ui, 'embed-iri'),
      Utils.sAssertEmbedContent(ui,
        '<div contenteditable="false" data-ephox-embed-iri="embed-iri">' +
        '<iframe src="about:blank"></iframe>' +
        '</div>'
      ),
      Utils.sSubmitDialog(ui),
      Waiter.sTryUntil('wait for div struture', sAssertDivStructure(editor, ephoxEmbedStructure), 100, 3000)
    ], onSuccess, onFailure);
  }, {
开发者ID:danielpunkass,项目名称:tinymce,代码行数:20,代码来源:EphoxEmbedTest.ts


示例8: TinyUi

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

    Pipeline.async({},
      Log.steps('TBA', 'Anchor: Add anchor, then check if that anchor is present in the editor', [
        tinyApis.sSetContent('abc'),
        tinyApis.sFocus,
        tinyUi.sClickOnToolbar('click anchor button', 'button[aria-label="Anchor"]'),
        tinyUi.sWaitForPopup('wait for window', 'div[role="dialog"].tox-dialog  input'),
        sType('abc'),
        tinyUi.sClickOnUi('click on Save btn', 'div.tox-dialog__footer button.tox-button:not(.tox-button--secondary)'),
        Waiter.sTryUntil('wait for anchor',
          tinyApis.sAssertContentPresence(
            { 'a.mce-item-anchor': 1 }
          ), 100, 4000
        )
    ])
    , onSuccess, onFailure);
  }, {
开发者ID:tinymce,项目名称:tinymce,代码行数:20,代码来源:AnchorSanityTest.ts


示例9: TinyUi

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

      Pipeline.async({}, [
        tinyUi.sClickOnToolbar('click on insertdatetime button', 'div[aria-label="Insert date/time"] > button.mce-open'),
        tinyUi.sClickOnUi('click on first in menu', 'div[role="menu"] > div.mce-first > span'),
        tinyApis.sAssertContentStructure(ApproxStructure.build(function (s) {
          return s.element('body', {
            children: [
              s.element('p', {
                children: [
                  s.element('time', {})
                ]
              })
            ]
          });
        }))
      ], onSuccess, onFailure);
    }, {
开发者ID:aha-app,项目名称:tinymce-word-paste-filter,代码行数:20,代码来源:InsertDatetimeSanityTest.ts


示例10: TinyApis

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

    Pipeline.async({}, [
      tinyApis.sFocus,
      Logger.t('no toolbar on by default', GeneralSteps.sequence([
        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('')
      ])),
      Logger.t('only after setting set to true', GeneralSteps.sequence([
        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:danielpunkass,项目名称:tinymce,代码行数:20,代码来源:ContextToolbarTest.ts



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
TypeScript mcagar.ActionChains类代码示例发布时间:2022-05-28
下一篇:
TypeScript mcagar.TinyApis函数代码示例发布时间: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