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


TypeScript Chain.op方法代碼示例

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


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

示例1: function

 const sAssertButtonIconImage = function (tooltip, expectedIconUrl) {
   return Chain.asStep({}, [
     cWaitForToolbar,
     cFindButton(tooltip),
     UiFinder.cFindIn('i'),
     Chain.op(function (iconElm) {
       const actualUrl = normalizeUrlString(iconElm.dom().style.backgroundImage);
       Assertions.assertEq('Needs to have correct icon url', 'url(' + expectedIconUrl + ')', actualUrl);
     })
   ]);
 };
開發者ID:danielpunkass,項目名稱:tinymce,代碼行數:11,代碼來源:SidebarTest.ts

示例2: function

  const cDragHandleRight = function (px) {
    return Chain.op(function (input: any) {
      const dom = input.editor.dom;
      const target = input.resizeSE.dom();
      const pos = dom.getPos(target);

      dom.fire(target, 'mousedown', { screenX: pos.x, screenY: pos.y });
      dom.fire(target, 'mousemove', { screenX: pos.x + px, screenY: pos.y });
      dom.fire(target, 'mouseup');
    });
  };
開發者ID:danielpunkass,項目名稱:tinymce,代碼行數:11,代碼來源:FigureResizeTest.ts

示例3:

 const sContentContains = (tinyApis: any, ed: Editor, pattern: string, isContained: boolean) => {
   return Chain.asStep({ }, [
     Chain.mapper(() => ed.getContent()),
     Chain.op((content) => {
       Assertions.assertEq(
         'editor.getContent() should contain: ' + pattern + ' = ' + isContained,
         true,
         content.indexOf(pattern) > -1 === isContained
       );
     })
   ]);
 };
開發者ID:tinymce,項目名稱:tinymce,代碼行數:12,代碼來源:AnnotationPersistenceTest.ts

示例4: cGetImageSources

 const sAssertImageFlip = (label) => {
   return Chain.asStep({editor}, [
     Chain.label(`Assert ${label}`,
     NamedChain.asChain([
       NamedChain.direct(NamedChain.inputName(), Chain.identity, 'editor'),
       NamedChain.direct('editor', cGetImageSources(label), 'urls'),
       NamedChain.read('urls', Chain.op((urls) => {
         Assertions.assertEq(`Image should be flipped: ${label}`, true, ( urls.srcBeforeFlip !== urls.srcAfterFlip ));
       }))
     ]))
   ]);
 };
開發者ID:tinymce,項目名稱:tinymce,代碼行數:12,代碼來源:ContextToolbarTest.ts

示例5: function

const assertStructureInDialog = function (errString, objStruc, waitOn, clickOn) {
    return Logger.t('Assert structure in dialog', Chain.asStep(TinyDom.fromDom(document.body), [
      UiFinder.cWaitFor('Could not find notification', waitOn),
      Mouse.cClickOn(clickOn),
      Chain.control(
        Chain.op((panel) => {
          Assertions.assertPresence(errString, objStruc, panel);
        }),
        Guard.tryUntil('Keep waiting', 100, 4000)
      )
    ]));
  };
開發者ID:tinymce,項目名稱:tinymce,代碼行數:12,代碼來源:PluginAssert.ts

示例6:

 const sAssertChanges = (message: string, expected: Array<{uid: string, state: boolean, name: string}>) => Logger.t(
   message,
   // Use a chain so that changes.get() can be evaluated at run-time.
   Chain.asStep({ }, [
     Chain.mapper((_) => {
       return changes.get();
     }),
     Chain.op((cs: Array<{uid: string, name: string}>) => {
       Assertions.assertEq('Checking changes', expected, cs);
     })
   ])
 );
開發者ID:danielpunkass,項目名稱:tinymce,代碼行數:12,代碼來源:AnnotationChangedTest.ts

示例7: function

  const cSetSelection = function (startPath, startOffset, endPath, endOffset) {
    return Chain.op(function (editor) {
      const startContainer = Hierarchy.follow(Element.fromDom(editor.getBody()), startPath).getOrDie();
      const endContainer = Hierarchy.follow(Element.fromDom(editor.getBody()), endPath).getOrDie();
      const rng = editor.dom.createRng();

      rng.setStart(startContainer.dom(), startOffset);
      rng.setEnd(endContainer.dom(), endOffset);

      editor.selection.setRng(rng);
    });
  };
開發者ID:abstask,項目名稱:tinymce,代碼行數:12,代碼來源:EditorFocusTest.ts

示例8: function

  const cAssertBlockBoundaryPositions = function (fromPath, fromOffset, toPath, toOffset) {
    return Chain.op(function (blockBoundaryOption) {
      const fromContainer = Hierarchy.follow(Element.fromDom(viewBlock.get()), fromPath).getOrDie();
      const toContainer = Hierarchy.follow(Element.fromDom(viewBlock.get()), toPath).getOrDie();
      const blockBoundary = blockBoundaryOption.getOrDie();

      Assertions.assertDomEq('Should be expected from container', fromContainer, Element.fromDom(blockBoundary.from().position().container()));
      Assertions.assertEq('Should be expected from offset', fromOffset, blockBoundary.from().position().offset());
      Assertions.assertDomEq('Should be expected to container', toContainer, Element.fromDom(blockBoundary.to().position().container()));
      Assertions.assertEq('Should be expected to offset', toOffset, blockBoundary.to().position().offset());
    });
  };
開發者ID:aha-app,項目名稱:tinymce-word-paste-filter,代碼行數:12,代碼來源:BlockBoundaryTest.ts


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