當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript Guard.addLogging方法代碼示例

本文整理匯總了TypeScript中@ephox/agar.Guard.addLogging方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript Guard.addLogging方法的具體用法?TypeScript Guard.addLogging怎麽用?TypeScript Guard.addLogging使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在@ephox/agar.Guard的用法示例。


在下文中一共展示了Guard.addLogging方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: Theme

UnitTest.asynctest('tinymce.plugins.paste.browser.PasteSettingsTest', (success, failure) => {
  Theme();
  Plugin();

  const cCreateInlineEditor = function (settings) {
    return Chain.control(
      McEditor.cFromSettings(Merger.merge(settings, {
        inline: true,
        base_url: '/project/tinymce/js/tinymce'
      })),
      Guard.addLogging('Create inline editor')
    );
  };

  const cRemoveEditor = Chain.control(
    McEditor.cRemove,
    Guard.addLogging('Remove editor')
  );

  Pipeline.async({}, [
    Chain.asStep({}, Log.chains('TBA', 'Paste: paste_as_text setting', [
      cCreateInlineEditor({
        paste_as_text: true,
        plugins: 'paste'
      }),
      Chain.op(function (editor) {
        Assertions.assertEq('Should be text format', 'text', editor.plugins.paste.clipboard.pasteFormat.get());
      }),
      cRemoveEditor
    ]))
  ], function () {
    success();
  }, failure);
});
開發者ID:tinymce,項目名稱:tinymce,代碼行數:34,代碼來源:PasteSettingsTest.ts

示例2:

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

示例3: next

const cOpFromChains = (chains: Chain<any, any>[]) => Chain.control(
  // TODO: Another API case.
  Chain.on((value, next, die, logs) => {
    Chain.pipeline([Chain.inject(value)].concat(chains), (_, newLogs) => next(Chain.wrap(value), newLogs), die, logs);
  }),
  Guard.addLogging('Chain operations')
);
開發者ID:tinymce,項目名稱:tinymce,代碼行數:7,代碼來源:Helpers.ts

示例4: from

 const cResizeToPos = (sx: number, sy: number, dx: number, dy: number, delta: number = 10) => {
   // Simulate moving the mouse, by making a number of movements
   const numMoves = sy === dy ? Math.abs(dx - sx) / delta : Math.abs(dy - sy) / delta;
   // Determine the deltas based on the number of moves to make
   const deltaX = (dx - sx) / numMoves;
   const deltaY = (dy - sy) / numMoves;
   // Move and release the mouse
   return Chain.control(
     Chain.fromChains([
         UiFinder.cFindIn('.tox-blocker'),
         Mouse.cMouseMoveTo(sx, sy)
       ].concat(
         Arr.range(numMoves, (count) => {
           const nx = sx + count * deltaX;
           const ny = sy + count * deltaY;
           return Mouse.cMouseMoveTo(nx, ny);
         })
       ).concat([
         Mouse.cMouseMoveTo(dx, dy),
         Mouse.cMouseUp
       ])
     ),
     Guard.addLogging(`Resizing from (${sx}, ${sy}) to (${dx}, ${dy})`)
   );
 };
開發者ID:tinymce,項目名稱:tinymce,代碼行數:25,代碼來源:ResizeTest.ts

示例5:

const cGetInput = (selector: string) => Chain.control(
  Chain.fromChains([
    Chain.inject(Body.body()),
    UiFinder.cFindIn(selector)
  ]),
  Guard.addLogging('Get input')
);
開發者ID:tinymce,項目名稱:tinymce,代碼行數:7,代碼來源:TestLinkUi.ts

示例6: keys

const cMergeCells = (keys) => Chain.control(
  Chain.mapper((editor: any) => {
    keys(editor);
    editor.execCommand('mceTableMergeCells');
  }),
  Guard.addLogging('Merge cells')
);
開發者ID:tinymce,項目名稱:tinymce,代碼行數:7,代碼來源:TableTestUtils.ts

示例7:

const cSubmitDialog = () => Chain.control(
  NamedChain.asChain([
    NamedChain.writeValue('body', Body.body()),
    NamedChain.read('body', Mouse.cClickOn('.tox-button:contains("Save")')),
    NamedChain.outputInput
  ]),
  Guard.addLogging('Submit dialog')
);
開發者ID:tinymce,項目名稱:tinymce,代碼行數:8,代碼來源:Helpers.ts

示例8:

 const cSetHtml = (html) => {
   return Chain.control(
     Chain.op(function (elm: Element) {
       Html.set(elm, html);
     }),
     Guard.addLogging('Set html')
   );
 };
開發者ID:tinymce,項目名稱:tinymce,代碼行數:8,代碼來源:ImageDataTest.ts

示例9:

 const cAssertEditorAndLastEvent = (label, state) =>
   Chain.control(
     Chain.fromChains([
       Chain.op(() => Assertions.assertEq('Editor isFullscreen', state, editor.plugins.fullscreen.isFullscreen())),
       Chain.op(() => Assertions.assertEq('FullscreenStateChanged event', state, lastEventArgs.get().state))
     ]),
     Guard.addLogging(label)
   );
開發者ID:tinymce,項目名稱:tinymce,代碼行數:8,代碼來源:FullScreenPluginTest.ts


注:本文中的@ephox/agar.Guard.addLogging方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。