当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript Fun.curry方法代码示例

本文整理汇总了TypeScript中@ephox/katamari.Fun.curry方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Fun.curry方法的具体用法?TypeScript Fun.curry怎么用?TypeScript Fun.curry使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在@ephox/katamari.Fun的用法示例。


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

示例1: function

const getTableSelectionFromRng = function (rootNode, rng) {
  const isRoot = Fun.curry(Compare.eq, rootNode);

  return getCellRng(rng, isRoot)
    .map(function (cellRng) {
      return getTableSelectionFromCellRng(cellRng, isRoot);
    });
};
开发者ID:aha-app,项目名称:tinymce-word-paste-filter,代码行数:8,代码来源:TableDeleteAction.ts

示例2: function

const findLocation = function (forward, isInlineTarget, rootNode, pos) {
  const from = InlineUtils.normalizePosition(forward, pos);
  const fromLocation = readLocation(isInlineTarget, rootNode, from);

  return readLocation(isInlineTarget, rootNode, from).bind(Fun.curry(findLocationSimple, forward)).orThunk(function () {
    return findLocationTraverse(forward, isInlineTarget, rootNode, fromLocation, pos);
  });
};
开发者ID:enigmatic-user,项目名称:tinymce-1,代码行数:8,代码来源:BoundaryLocation.ts

示例3: function

const insert = function (editor, evt?) {
  const anchorLocation = readInlineAnchorLocation(editor);

  if (anchorLocation.isSome()) {
    anchorLocation.each(Fun.curry(insertBrOutsideAnchor, editor));
  } else {
    insertBrAtCaret(editor, evt);
  }
};
开发者ID:howardjing,项目名称:tinymce,代码行数:9,代码来源:InsertBr.ts

示例4: function

const findLocation = function (editor, caret, forward) {
  const rootNode = editor.getBody();
  const from = CaretPosition.fromRangeStart(editor.selection.getRng());
  const isInlineTarget = Fun.curry(InlineUtils.isInlineTarget, editor);
  const location = BoundaryLocation.findLocation(forward, isInlineTarget, rootNode, from);
  return location.bind(function (location) {
    return renderCaretLocation(editor, caret, location);
  });
};
开发者ID:aha-app,项目名称:tinymce-word-paste-filter,代码行数:9,代码来源:BoundarySelection.ts

示例5: function

 return function () {
   return editor._scanForImages().
     then(Fun.curry(findSelectedBlob, editor)).
     then(ResultConversions.blobToImageResult).
     then(fn).
     then(function (imageResult) {
       return updateSelectedImage(editor, imageResult, false, imageUploadTimerState, size);
     }, function (error) {
       displayError(editor, error);
     });
 };
开发者ID:abstask,项目名称:tinymce,代码行数:11,代码来源:Actions.ts

示例6: function

const applyStyle = function (dom, name, value) {
  return Fun.curry(function (name, value, node) {
    dom.setStyle(node, name, value);

    if (node.getAttribute('style') === '') {
      node.removeAttribute('style');
    }

    unwrapEmptySpan(dom, node);
  }, name, value);
};
开发者ID:abstask,项目名称:tinymce,代码行数:11,代码来源:MergeFormats.ts

示例7: function

const scrollIntoView = function (cWin, socket, dropup, top, bottom) {
  const greenzone = DeviceZones.getGreenzone(socket, dropup);
  const refreshCursor = Fun.curry(CursorRefresh.refresh, cWin);

  if (top > greenzone || bottom > greenzone) {
    IosScrolling.moveOnlyScroll(socket, socket.dom().scrollTop - greenzone + bottom).get(refreshCursor);
  } else if (top < 0) {
    IosScrolling.moveOnlyScroll(socket, socket.dom().scrollTop + top).get(refreshCursor);
  } else {
    // do nothing
  }
};
开发者ID:danielpunkass,项目名称:tinymce,代码行数:12,代码来源:Greenzone.ts

示例8: getWinFromFrame

      return getWinFromFrame(frame).map(function (win) {

        const html = Element.fromDom(doc.dom().documentElement);

        const getCursorBox = editor.getCursorBox.getOrThunk(function () {
          return function () {
            return WindowSelection.get(win).bind(function (sel) {
              return WindowSelection.getFirstRect(win, sel).orThunk(function () {
                return tryFallbackBox(win);
              });
            });
          };
        });

        const setSelection = editor.setSelection.getOrThunk(function () {
          return function (start, soffset, finish, foffset) {
            WindowSelection.setExact(win, start, soffset, finish, foffset);
          };
        });

        const clearSelection = editor.clearSelection.getOrThunk(function () {
          return function () {
            WindowSelection.clear(win);
          };
        });

        return {
          body: Fun.constant(body),
          doc: Fun.constant(doc),
          win: Fun.constant(win),
          html: Fun.constant(html),
          getSelection: Fun.curry(getSelectionFromFrame, frame),
          setSelection,
          clearSelection,
          frame: Fun.constant(frame),

          onKeyup: getOrListen(editor, doc, 'onKeyup', 'keyup'),
          onNodeChanged: getOrListen(editor, doc, 'onNodeChanged', 'selectionchange'),
          onDomChanged: editor.onDomChanged, // consider defaulting with MutationObserver

          onScrollToCursor: editor.onScrollToCursor,
          onScrollToElement: editor.onScrollToElement,
          onToReading: editor.onToReading,
          onToEditing: editor.onToEditing,

          onToolbarScrollStart: editor.onToolbarScrollStart,
          onTouchContent: editor.onTouchContent,
          onTapContent: editor.onTapContent,
          onTouchToolstrip: editor.onTouchToolstrip,

          getCursorBox
        };
      });
开发者ID:abstask,项目名称:tinymce,代码行数:53,代码来源:PlatformEditor.ts

示例9: function

const findLineNodeRects = (root: Node, targetNodeRect: NodeClientRect): ClientRectLine[] => {
  let clientRects = [];

  const collect = (checkPosFn, node) => {
    let lineRects;

    lineRects = Arr.filter(getClientRects([node]), function (clientRect) {
      return !checkPosFn(clientRect, targetNodeRect);
    });

    clientRects = clientRects.concat(lineRects);

    return lineRects.length === 0;
  };

  clientRects.push(targetNodeRect);
  walkUntil(VDirection.Up, root, Fun.curry(collect, GeomClientRect.isAbove), targetNodeRect.node);
  walkUntil(VDirection.Down, root, Fun.curry(collect, GeomClientRect.isBelow), targetNodeRect.node);

  return clientRects;
};
开发者ID:danielpunkass,项目名称:tinymce,代码行数:21,代码来源:LineUtils.ts

示例10: CaretWalker

const getHorizontalRange = (editor, forward: boolean): Range => {
  const caretWalker = CaretWalker(editor.getBody());
  const getNextVisualCaretPosition = Fun.curry(getVisualCaretPosition, caretWalker.next);
  const getPrevVisualCaretPosition = Fun.curry(getVisualCaretPosition, caretWalker.prev);
  let newRange;
  const direction = forward ? HDirection.Forwards : HDirection.Backwards;
  const getNextPosFn = forward ? getNextVisualCaretPosition : getPrevVisualCaretPosition;
  const range = editor.selection.getRng();

  newRange = moveToCeFalseHorizontally(direction, editor, getNextPosFn, range);
  if (newRange) {
    return newRange;
  }

  newRange = exitPreBlock(editor, direction, range);
  if (newRange) {
    return newRange;
  }

  return null;
};
开发者ID:mdgbayly,项目名称:tinymce,代码行数:21,代码来源:CefNavigation.ts


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