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

TypeScript agar.Log类代码示例

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

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



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

示例1: function

  const sTestPaste = function (editor, tinyApis) {
    return Log.stepsAsStep('TBA', 'Paste: Paste external content', [
        sPaste(editor, tinyApis, '<p>abc</p>', { 'text/plain': 'X', 'text/html': '<p>X</p>' }, [0, 0], 0, [0, 0], 3),
        sWaitForProcessEvents,
        sAssertLastPreProcessEvent({ internal: false, content: 'X' }),
        sAssertLastPostProcessEvent({ internal: false, content: 'X' })
      ]),

      Log.stepsAsStep('TBA', 'Paste: Paste external content treated as plain text', [
        sPaste(editor, tinyApis, '<p>abc</p>', { 'text/html': '<p>X</p>' }, [0, 0], 0, [0, 0], 3),
        sWaitForProcessEvents,
        sAssertLastPreProcessEvent({ internal: false, content: 'X' }),
        sAssertLastPostProcessEvent({ internal: false, content: 'X' })
      ]),

      Log.stepsAsStep('TBA', 'Paste: Paste internal content with mark', [
        sPaste(editor, tinyApis, '<p>abc</p>', { 'text/plain': 'X', 'text/html': InternalHtml.mark('<p>X</p>') }, [0, 0], 0, [0, 0], 3),
        sWaitForProcessEvents,
        sAssertLastPreProcessEvent({ internal: true, content: '<p>X</p>' }),
        sAssertLastPostProcessEvent({ internal: true, content: '<p>X</p>' })
      ]),

      Log.stepsAsStep('TBA', 'Paste: Paste internal content with mime', [
        sPaste(editor, tinyApis, '<p>abc</p>',
          { 'text/plain': 'X', 'text/html': '<p>X</p>', 'x-tinymce/html': '<p>X</p>' },
          [0, 0], 0, [0, 0], 3
        ),
        sWaitForProcessEvents,
        sAssertLastPreProcessEvent({ internal: true, content: '<p>X</p>' }),
        sAssertLastPostProcessEvent({ internal: true, content: '<p>X</p>' })
      ]);
  };
开发者ID:tinymce,项目名称:tinymce,代码行数:32,代码来源:InternalClipboardTest.ts


示例2: TinyApis

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

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

      Log.stepsAsStep('TBA', 'Table: ul > li in table', [
        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>')
      ]),

      Log.stepsAsStep('TBA', 'Table: ol > li in table', [
        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>')
      ]),

      Log.stepsAsStep('TBA', 'Table: dl > dt in table', [
        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:tinymce,项目名称:tinymce,代码行数:30,代码来源:IndentListsInTableTest.ts


示例3: TinyApis

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

    Pipeline.async({}, [
      Log.stepsAsStep('TBA', 'Table: no class input without setting', [
        tinyApis.sFocus,
        tinyApis.sSetContent(tableHtml),
        tinyApis.sSetSelection([0, 0, 0, 0, 0], 0, [0, 0, 0, 0, 0], 1),
        tinyApis.sExecCommand('mceTableCellProps'),
        TableTestUtils.sAssertDialogPresence(
          'Checking that class label is not present',
          {
            'label:contains("Class")': 0
          }
        ),
        TableTestUtils.sClickDialogButton('close', false),
        tinyApis.sSetContent('')
      ]),

      Log.stepsAsStep('TBA', 'Table: class input with setting', [
        tinyApis.sFocus,
        tinyApis.sSetSetting('table_cell_class_list', [{ title: 'test', value: 'test' }]),
        tinyApis.sSetContent(tableHtml),
        tinyApis.sSetSelection([0, 0, 0, 0, 0], 0, [0, 0, 0, 0, 0], 1),
        tinyApis.sExecCommand('mceTableCellProps'),
        TableTestUtils.sAssertSelectValue('Class select', 'Class', 'test'),
        TableTestUtils.sClickDialogButton('Trigger test class', true),
        tinyApis.sAssertContentPresence({ 'td.test': 1 })
      ])
    ], onSuccess, onFailure);
  }, {
开发者ID:tinymce,项目名称:tinymce,代码行数:31,代码来源:TableCellClassListTest.ts


示例4: TinyApis

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

      const steps = Utils.withTeardown([
        Log.stepsAsStep('TBA', 'TextPattern: enter after first * in *a*', [
          tinyApis.sSetContent('<p>*a*</p>'),
          tinyApis.sFocus,
          tinyApis.sSetCursor([0, 0], 1),
          Step.sync(function () {
            editor.fire('keydown', { keyCode: 13 });
          }),
          tinyApis.sAssertContent('<p>*</p><p>a*</p>')
        ]),
        Log.stepsAsStep('TBA', 'TextPattern: enter after first * in *b*', [
          tinyApis.sSetContent('<p><strong>a</strong>*b*</p>'),
          tinyApis.sFocus,
          tinyApis.sSetCursor([0, 1], 1),
          Step.sync(function () {
            editor.fire('keydown', { keyCode: 13 });
          }),
          tinyApis.sAssertContent('<p><strong>a</strong>*</p><p>b*</p>')
        ])
      ], tinyApis.sSetContent(''));

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


示例5: TinyApis

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

    const dialogSelector = 'div.tox-dialog';
    const docBody = Element.fromDom(document.body);
    const editorBody = editor.contentDocument.body;
    const markupContent = '<p>hello world</p>';
    const tinyApis = TinyApis(editor);

    Pipeline.async({},
      [
        Log.stepsAsStep('TBA', 'CodeSample: TBA-Open the dialog and check it has the right initial values. Set the codesample content, submit and check the editor content changes correctly. Double-click on the editor and check if the dialog opens with the correct language and content.', [
          TestUtils.sOpenDialogAndAssertInitial(editor, docBody, 'markup', ''),
          TestUtils.sSetTextareaContent(markupContent),
          TestUtils.sSubmitDialog(docBody),
          TestUtils.sAssertEditorContents(editorBody, 'markup', markupContent, 'pre.language-markup'),
            Step.sync(function () {
              const pre = editor.getBody().querySelector('pre');
              editor.fire('dblclick', { target: pre });
            }),
          UiFinder.sWaitForVisible('Waited for dialog to be visible', docBody, dialogSelector),
          TestUtils.sAssertCodeSampleDialog('markup', markupContent),
        ]),

        Log.stepsAsStep('TBA', 'CodeSample: Selecting code sample should update button state', [
          tinyApis.sSetContent('<p>abc</p><pre class="language-markup"><code></code></pre>'),
          tinyApis.sSelect('p', []),
          tinyApis.sNodeChanged,
          UiFinder.sNotExists(docBody, 'button[aria-pressed="true"]'),
          tinyApis.sSelect('pre.language-markup', []),
          tinyApis.sNodeChanged,
          UiFinder.sExists(docBody, 'button[aria-pressed="true"]'),
        ]),
      ]
    , onSuccess, onFailure);
  }, {
开发者ID:tinymce,项目名称:tinymce,代码行数:35,代码来源:CodeSampleSelectionTest.ts


示例6: TinyApis

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

    Pipeline.async({}, [
      tinyApis.sFocus,
      Log.stepsAsStep('TBA', 'Text selection toolbar', [
        tinyApis.sSetContent('<p>Some <strong>bold</strong> and <em>italic</em> content.</p><blockquote><p>Some quoted content</p></blockquote>'),
        tinyApis.sSetSelection([0, 0], 0, [0, 0], 4),
        sWaitForTextToolbarAndAssertState(tinyUi, false, false, false, false, false, false),
        tinyApis.sSetSelection([0, 1, 0], 0, [0, 1, 0], 3),
        sWaitForTextToolbarAndAssertState(tinyUi, true, false, false, false, false, false),
        tinyApis.sSetSelection([0, 3, 0], 1, [0, 3, 0], 4),
        sWaitForTextToolbarAndAssertState(tinyUi, false, true, false, false, false, false),
        tinyApis.sSetSelection([1, 0], 0, [1, 0], 1),
        sWaitForTextToolbarAndAssertState(tinyUi, false, false, false, false, false, true)
      ]),
      Log.stepsAsStep('TBA', 'Image selection toolbar', [
        sSetImageAndAssertToolbarState(tinyApis, tinyUi, false),
        sSetImageAndAssertToolbarState(tinyApis, tinyUi, false, Alignment.Left),
        sSetImageAndAssertToolbarState(tinyApis, tinyUi, false, Alignment.Center),
        sSetImageAndAssertToolbarState(tinyApis, tinyUi, false, Alignment.Right),
        sSetImageAndAssertToolbarState(tinyApis, tinyUi, true),
        sSetImageAndAssertToolbarState(tinyApis, tinyUi, true, Alignment.Left),
        sSetImageAndAssertToolbarState(tinyApis, tinyUi, true, Alignment.Center),
        sSetImageAndAssertToolbarState(tinyApis, tinyUi, true, Alignment.Right)
      ])
    ], onSuccess, onFailure);
  }, {
开发者ID:tinymce,项目名称:tinymce,代码行数:29,代码来源:SelectionToolbarTest.ts


示例7: TinyApis

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

    Pipeline.async({}, browser.isIE() ? [] : [
      Log.stepsAsStep('TBA', 'TextColor: forecolor', [
        tinyApis.sFocus,
        tinyApis.sSetContent('hello test'),
        tinyApis.sSetSelection([0, 0], 0, [0, 0], 5),
        tinyUi.sClickOnToolbar('click forecolor', '[aria-label="Text color"] > .tox-tbtn + .tox-split-button__chevron'),
        tinyUi.sWaitForUi('wait for color swatch to open', '.tox-swatches'),
        tinyUi.sClickOnUi('click green color', 'div[data-mce-color="#18A085"]'),
        tinyUi.sClickOnToolbar('click forecolor again', '[aria-label="Text color"] > .tox-tbtn + .tox-split-button__chevron'),
        tinyUi.sWaitForUi('wait for color swatch to open', '.tox-swatches'),
        tinyUi.sClickOnUi('click blue color', 'div[data-mce-color="#2B3E50"]'),
        tinyApis.sAssertContentStructure(forecolorStruct)
      ]),
      Log.stepsAsStep('TBA', 'TextColor: backcolor', [
        tinyApis.sFocus,
        tinyApis.sSetContent('hello test'),
        tinyApis.sSetSelection([0, 0], 0, [0, 0], 5),
        tinyUi.sClickOnToolbar('click backcolor', '[aria-label="Background color"] > .tox-tbtn + .tox-split-button__chevron'),
        tinyUi.sWaitForUi('wait for color swatch to open', '.tox-swatches'),
        tinyUi.sClickOnUi('click green color', 'div[data-mce-color="#18A085"]'),
        tinyUi.sClickOnToolbar('click backcolor again', '[aria-label="Background color"] > .tox-tbtn + .tox-split-button__chevron'),
        tinyUi.sWaitForUi('wait for color swatch to open', '.tox-swatches'),
        tinyUi.sClickOnUi('click a nice purple color', 'div[data-mce-color="#2B3E50"]'),
        tinyApis.sAssertContentStructure(backcolorStruct)
      ])
    ], onSuccess, onFailure);
  }, {
开发者ID:tinymce,项目名称:tinymce,代码行数:31,代码来源:TextcolorSanityTest.ts


示例8: sSetProgressState

  TinyLoader.setup((editor, onSuccess, onFailure) => {
    const sSetProgressState = (state: boolean, time?: number) => Step.sync(() => {
      if (state) {
        editor.setProgressState(true, time);
      } else {
        editor.setProgressState(false);
      }
    });

    Pipeline.async({}, [
      Log.stepsAsStep('TBA', 'Throbber actions test', [
        sAssertThrobberHiddenStructure,
        sSetProgressState(true),
        UiFinder.sWaitForVisible('Wait for throbber to show', Body.body(), '.tox-throbber'),
        sAssertThrobberShownStructure,
        sSetProgressState(false),
        UiFinder.sWaitForHidden('Wait for throbber to hide', Body.body(), '.tox-throbber'),
        sAssertThrobberHiddenStructure
      ]),
      Log.stepsAsStep('TBA', 'Throbber actions with timeout test', [
        sSetProgressState(true, 300),
        // Wait for a little and make sure the throbber is still hidden
        Step.wait(150),
        sAssertThrobberHiddenStructure,
        UiFinder.sWaitForVisible('Wait for throbber to show', Body.body(), '.tox-throbber'),
        sAssertThrobberShownStructure,
        sSetProgressState(false),
        UiFinder.sWaitForHidden('Wait for throbber to hide', Body.body(), '.tox-throbber'),
        sAssertThrobberHiddenStructure
      ])
    ], onSuccess, onFailure);
  }, {
开发者ID:tinymce,项目名称:tinymce,代码行数:32,代码来源:ThrobberTest.ts


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



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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