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

TypeScript mcagar.TinyDom类代码示例

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

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



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

示例1: sAssertUrlStructure

    const testChangingUrlValueWith = (sChooseItem: Step<any, any>) => Log.stepsAsStep('TBA', 'Link: Choosing something in the urlinput changes text and value', [
      tinyApis.sSetContent('<h1>Header One</h1><h2 id="existing-id">Header2</h2>'),
      TestLinkUi.sOpenLinkDialog,
      Keyboard.sKeydown(doc, Keys.down(), { }),
      UiFinder.sWaitForVisible('Waiting for dropdown', TinyDom.fromDom(document.body), '.tox-menu'),
      sChooseItem,
      sAssertUrlStructure((s, str, _arr) => {
        return s.element('input', {
          value: str.startsWith('#h_')
        });
      }),
      sAssertInputValue('Header One', 'Text to display'),
      TestLinkUi.sAssertContentPresence(tinyApis, {
        'h1[id]': 0,
        'h2[id]': 1
      }),
      TestLinkUi.sClickSave,
      TestLinkUi.sAssertContentPresence(tinyApis, {
        'h1[id]': 1
      }),

      // Check that the h1's id value is referred to by a link containing dog
      Chain.asStep(TinyDom.fromDom(editor.getBody()), [
        NamedChain.asChain([
          NamedChain.direct(NamedChain.inputName(), UiFinder.cFindIn('h1'), 'h1'),
          NamedChain.direct('h1', Chain.mapper((h1) => Attr.get(h1, 'id')), 'h1-id'),
          NamedChain.bundle((obj) => {
            return UiFinder.findIn(obj[NamedChain.inputName()], `a[href="#${obj['h1-id']}"]:contains("Header One")`);
          })
        ])
      ])
    ]);
开发者ID:tinymce,项目名称:tinymce,代码行数:32,代码来源:DialogFlowTest.ts


示例2: TinyApis

  TinyLoader.setup(function (editor, onSuccess, onFailure) {
    const tinyApis = TinyApis(editor);
    const doc = TinyDom.fromDom(document);

    Pipeline.async({}, [
      TestLinkUi.sClearHistory,
      Log.stepsAsStep('TBA', 'Checking only choosing link and submitting works', [
        Step.sync(() => {
          editor.execCommand('mceLink');
        }),
        UiFinder.sWaitForVisible('wait for link dialog', TinyDom.fromDom(document.body), '[role="dialog"]'),
        FocusTools.sTryOnSelector('Selector should be in first field of dialog', doc, '.tox-dialog input'),
        FocusTools.sSetActiveValue(doc, 'http://goo'),
        Chain.asStep(doc, [
          FocusTools.cGetFocused,
          TestLinkUi.cFireEvent('input')
        ]),
        Keyboard.sKeydown(doc, Keys.enter(), { }),
        Waiter.sTryUntil(
          'Waiting for link to be inserted',
          tinyApis.sAssertContentPresence({
            'a[href="http://goo"]': 1
          }),
          100,
          1000
        )
      ]),
      TestLinkUi.sClearHistory,
    ], onSuccess, onFailure);
  }, {
开发者ID:tinymce,项目名称:tinymce,代码行数:30,代码来源:LinkJustFirstFieldTest.ts


示例3: TinyApis

  TinyLoader.setup(function (editor, onSuccess, onFailure) {
    const tinyApis = TinyApis(editor);
    const doc = TinyDom.fromDom(document);

    Pipeline.async({},
      Log.steps('TBA', 'Link: complex selections should preserve the text', [
        TestLinkUi.sClearHistory,
        tinyApis.sSetContent('<p><strong>word</strong></p><p><strong>other</strong></p>'),
        tinyApis.sSetSelection([0], 0, [1], 1),
        tinyApis.sExecCommand('mcelink'),
        UiFinder.sWaitForVisible('wait for link dialog', TinyDom.fromDom(document.body), '[role="dialog"]'),
        FocusTools.sSetActiveValue(doc, 'http://something'),
        Keyboard.sKeydown(doc, Keys.enter(), { }),
        Waiter.sTryUntil(
          'Wait until link is inserted',
          tinyApis.sAssertContentPresence({
            'a[href="http://something"]': 2,
            'p:contains(word)': 1,
            'p:contains(other)': 1,
            'p': 2
          }),
          100,
          1000
        ),
        TestLinkUi.sClearHistory
      ])
    , onSuccess, onFailure);
  }, {
开发者ID:tinymce,项目名称:tinymce,代码行数:28,代码来源:SelectedTextLinkTest.ts


示例4:

const sClickOnConfirmDialog = (label: string, state: boolean) => Logger.t('Click on confirm dialog', GeneralSteps.sequence([
  Mouse.sClickOn(TinyDom.fromDom(document.body), '[role="dialog"].tox-confirm-dialog button:contains("' + (state ? 'Yes' : 'No') + '")'),
  Waiter.sTryUntil(
    'Waiting for confirm dialog to go away',
    UiFinder.sNotExists(TinyDom.fromDom(document.body), '.tox-confirm-dialog'),
    100,
    1000
  )
]));
开发者ID:tinymce,项目名称:tinymce,代码行数:9,代码来源:TestLinkUi.ts


示例5:

const sClickDialogButton = (label: string, isSave: boolean) => Logger.t('Close dialog and wait to confirm dialog goes away', GeneralSteps.sequence([
  Mouse.sClickOn(TinyDom.fromDom(document.body), '[role="dialog"].tox-dialog button:contains("' + (isSave ? 'Save' : 'Cancel') + '")'),
  Waiter.sTryUntil(
    'Waiting for confirm dialog to go away',
    UiFinder.sNotExists(TinyDom.fromDom(document.body), '.tox-confirm-dialog'),
    100,
    1000
  )
]));
开发者ID:tinymce,项目名称:tinymce,代码行数:9,代码来源:TableTestUtils.ts


示例6: function

 const sClickFocusedButton = function (selector) {
   return GeneralSteps.sequence([
     Waiter.sTryUntil(
       'Focus was not moved to the expected element',
       FocusTools.sIsOnSelector('Is not on the right element', TinyDom.fromDom(document), selector),
       10,
       1000
     ),
     Chain.asStep(TinyDom.fromDom(document), [
       FocusTools.cGetFocused,
       Mouse.cTrueClick
     ])
   ]);
 };
开发者ID:abstask,项目名称:tinymce,代码行数:14,代码来源:ThemeTest.ts


示例7: function

 const sAssertErrorMessage = function (html) {
   return Step.label('Check notification message', Chain.asStep(TinyDom.fromDom(document.body), [
     UiFinder.cWaitFor('Find notification', '.tox-notification__body > p'),
     Chain.label('Get notification HTML', Chain.mapper(Html.get)),
     Chain.label('Assert HTML matches expected', Assertions.cAssertHtml('Message html does not match', html))
   ]));
 };
开发者ID:tinymce,项目名称:tinymce,代码行数:7,代码来源:ImageToolsErrorTest.ts


示例8: function

 const sWaitForAndAssertNotification = function (expected) {
   return Chain.asStep(TinyDom.fromDom(document.body), [
     UiFinder.cWaitFor('Could not find notification', 'div.mce-notification-inner'),
     Chain.mapper(Html.get),
     Assertions.cAssertHtml('Plugin list html does not match', expected)
   ]);
 };
开发者ID:danielpunkass,项目名称:tinymce,代码行数:7,代码来源:IsCachedResponseTest.ts


示例9: function

 const sAssertErrorMessage = function (html) {
   return Chain.asStep(TinyDom.fromDom(document.body), [
     UiFinder.cWaitFor('Could not find notification', '.mce-notification-inner'),
     Chain.mapper(Html.get),
     Assertions.cAssertHtml('Message html does not match', html)
   ]);
 };
开发者ID:danielpunkass,项目名称:tinymce,代码行数:7,代码来源:ImageToolsErrorTest.ts


示例10: function

 const sAssertPluginList = function (html) {
   return Chain.asStep(TinyDom.fromDom(document.body), [
     UiFinder.cWaitFor('Could not find notification', 'div.mce-floatpanel ul'),
     Chain.mapper(Html.get),
     Assertions.cAssertHtml('Plugin list html does not match', html)
   ]);
 };
开发者ID:aha-app,项目名称:tinymce-word-paste-filter,代码行数:7,代码来源:IgnoreForcedPluginsTest.ts



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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