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

TypeScript mcagar.TinyApis函数代码示例

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

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



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

示例1: TinyApis

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

    Pipeline.async({}, [
      Logger.t('Should should retain open attribute if it is not opened', GeneralSteps.sequence([
        tinyApis.sSetContent('<details><summary>a</summary>b</details>'),
        tinyApis.sAssertContentStructure(ApproxStructure.build((s, str, arr) => {
          return s.element('body', {
            children: [
              s.element('details', {
                attrs: {
                  'open': str.is('open'),
                  'data-mce-open': str.none('Should not have a data attr')
                },
                children: [
                  s.element('summary', {
                    children: [
                      s.text(str.is('a'))
                    ]
                  }),
                  s.text(str.is('b'))
                ]
              })
            ]
          });
        })),
        tinyApis.sAssertContent('<details><summary>a</summary>b</details>')
      ])),
      Logger.t('Should should retain open attribute if it opened', GeneralSteps.sequence([
        tinyApis.sSetContent('<details open="open"><summary>a</summary>b</details>'),
        tinyApis.sAssertContentStructure(ApproxStructure.build((s, str, arr) => {
          return s.element('body', {
            children: [
              s.element('details', {
                attrs: {
                  'open': str.is('open'),
                  'data-mce-open': str.is('open')
                },
                children: [
                  s.element('summary', {
                    children: [
                      s.text(str.is('a'))
                    ]
                  }),
                  s.text(str.is('b'))
                ]
              })
            ]
          });
        })),
        tinyApis.sAssertContent('<details open="open"><summary>a</summary>b</details>')
      ]))
    ], onSuccess, onFailure);
  }, {
开发者ID:tinymce,项目名称:tinymce,代码行数:54,代码来源:DetailsElementTest.ts


示例2: TinyApis

  TinyLoader.setup((editor: Editor, onSuccess, onFailure) => {
      const uiContainer = Element.fromDom(editor.getContainer());
      const contentAreaContainer = Element.fromDom(editor.getContentAreaContainer());

      const tinyApis = TinyApis(editor);

      Pipeline.async({ }, Arr.flatten([
        sUiContainerTest(editor, uiContainer, tinyApis),
        sContentAreaContainerTest(contentAreaContainer)
      ]), onSuccess, onFailure);
    },
开发者ID:tinymce,项目名称:tinymce,代码行数:11,代码来源:SilverInlineEditorTest.ts


示例3: TinyApis

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

    Pipeline.async({}, [
      tinyApis.sFocus,
      sTestEnterAtStartOfAnchorZwsp(tinyApis, tinyActions),
      sTestEnterAtEndOfAnchorZwsp(tinyApis, tinyActions),
      sTestEnterAtStartOfAnchorZwspWithAdjacentContent(tinyApis, tinyActions),
      sTestEnterAtEndOfAnchorZwspWithAdjacentContent(tinyApis, tinyActions)
    ], onSuccess, onFailure);
  }, {
开发者ID:danielpunkass,项目名称:tinymce,代码行数:12,代码来源:EnterKeyAnchorTest.ts


示例4: TinyApis

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

    Pipeline.async({}, [
      Logger.t('Select image by context menu clicking on it', GeneralSteps.sequence([
        Step.label('Focus editor', tinyApis.sFocus),
        Step.label('Set editor content to a paragraph with a image within', tinyApis.sSetContent('<p><img src="http://www.google.com/google.jpg" width="100" height="100"></p>')),
        Step.label('Context menu click on the image', sContextMenuClickInMiddleOf(editor, [0, 0])),
        Step.label('Check that the image is selected', tinyApis.sAssertSelection([0], 0, [0], 1))
      ]))
    ], onSuccess, onFailure);
  }, {
开发者ID:tinymce,项目名称:tinymce,代码行数:12,代码来源:ControlSelectionTest.ts


示例5: TinyApis

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

    Pipeline.async({}, [
      tinyApis.sFocus,
      sBoldTests(tinyApis),
      sH2Tests(tinyApis),
      sLinkTests(tinyApis, tinyActions),
      sInsertTableTests(editor, tinyApis),
      sAriaTests(tinyApis, tinyActions)
    ], onSuccess, onFailure);
  }, {
开发者ID:abstask,项目名称:tinymce,代码行数:12,代码来源:ThemeTest.ts


示例6: TinyApis

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

    Pipeline.async({}, [
      Logger.t('Select image by context menu clicking on it', GeneralSteps.sequence([
        tinyApis.sFocus,
        tinyApis.sSetContent('<p><img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAAAAACH5BAAAAAAALAAAAAABAAEAAAICTAEAOw==" width="100" height="100"></p>'),
        sContextMenuClickInMiddleOf(editor, [0, 0]),
        tinyApis.sAssertSelection([0], 0, [0], 1)
      ]))
    ], onSuccess, onFailure);
  }, {
开发者ID:aha-app,项目名称:tinymce-word-paste-filter,代码行数:12,代码来源:ControlSelectionTest.ts


示例7: TinyApis

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

    Pipeline.async({}, [
      Log.stepsAsStep('TBA', 'Table: test that settings for appearance can be disabled', [
        tinyApis.sFocus,
        tinyApis.sSetContent(tableHtml),
        // This used to be opening the context toolbar.
        tinyApis.sSelect('table td', [0]),
        tinyApis.sExecCommand('mceTableProps'),
        Chain.asStep({}, [
          TableTestUtils.cWaitForDialog,
          Chain.op(function (dialog) {
            Assertions.assertPresence(
              'assert presence of spacing, padding, border and caption inputs',
              {
                // Remove the label:0 when it is working.
                'label:contains("Cell spacing")': 0,
                'label:contains("Cell padding")': 0,
                'label:contains("Border") + input': 0,
                'label:contains("Caption")': 0
              }, dialog);
          })
        ]),
        TableTestUtils.sClickDialogButton('close', false)
      ]),

      Log.stepsAsStep('TBA', 'Table: test that settings for appearance can be enabled', [
        tinyApis.sSetSetting('table_appearance_options', true),
        tinyApis.sFocus,
        tinyApis.sSetContent(tableHtml),
        // This used to be opening the context toolbar.
        tinyApis.sSelect('table td', [0]),
        tinyApis.sExecCommand('mceTableProps'),
        Chain.asStep({}, [
          TableTestUtils.cWaitForDialog,
          Chain.op(function (dialog) {
            Assertions.assertPresence(
              'assert presence of spacing, padding, border and caption inputs',
              {
                // Remove the label:0 when it is working.
                'label:contains("Cell spacing")': 1,
                'label:contains("Cell padding")': 1,
                'label:contains("Border") + input': 1,
                'label:contains("Caption")': 1
              }, dialog);
          })
        ]),
        TableTestUtils.sClickDialogButton('close', false)
      ])
    ], onSuccess, onFailure);
  }, {
开发者ID:tinymce,项目名称:tinymce,代码行数:52,代码来源:TableAppearanceOptionsTest.ts


示例8: TinyApis

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

    Pipeline.async({}, [
      Logger.t('get text format content should trim zwsp', GeneralSteps.sequence([
        tinyApis.sSetContent('<p>' + Zwsp.ZWSP + 'a</p>'),
        Step.sync(function () {
          const html = editor.getContent({ format: 'text' });
          Assertions.assertEq('Should be expected html', 'a', html);
        })
      ]))
    ], onSuccess, onFailure);
  }, {
开发者ID:tinymce,项目名称:tinymce,代码行数:13,代码来源:EditorGetContentTextFormatTest.ts


示例9: TinyApis

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

    Pipeline.async({},
      Log.steps('TBA', 'Preview: Set content, set style setting and assert content and style. Delete style and assert style is removed', [
        tinyApis.sSetContent('<p>hello world</p>'),
        tinyApis.sSetSetting('content_style', 'p {color: blue;}'),
        sAssertIframeHtmlContains(editor, '<style type="text/css">p {color: blue;}</style>'),
        tinyApis.sDeleteSetting('content_style'),
        sAssertIframeHtmlNotContains(editor, '<style type="text/css">p {color: blue;}</style>')
    ])
    , onSuccess, onFailure);
  }, {
开发者ID:tinymce,项目名称:tinymce,代码行数:13,代码来源:PreviewContentStyleTest.ts


示例10: TinyApis

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

    Pipeline.async({}, Env.gecko ? [ // This test is only relevant on Firefox
      Logger.t('cursor before table type', GeneralSteps.sequence([
        tinyApis.sSetContent('<table style="border-collapse: collapse; width: 100%;" border="1"><tbody><tr><td style="width: 50%;">&nbsp;</td><td style="width: 50%;">&nbsp;</td></tr><tr><td style="width: 50%;">&nbsp;</td><td style="width: 50%;">&nbsp;</td></tr></tbody></table>'),
        tinyApis.sSetCursor([], 0),
        sAssertUndoManagerDataLength(editor, 1),
        Step.sync(() => KeyUtils.type(editor, 'a')),
        sAssertUndoManagerDataLength(editor, 3)
      ]))
    ] : [], onSuccess, onFailure);
  }, {
开发者ID:danielpunkass,项目名称:tinymce,代码行数:13,代码来源:FirefoxFakeCaretBeforeTableTypeTest.ts



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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