当前位置: 首页>>代码示例>>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;未经允许,请勿转载。