當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。