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


TypeScript Fun.not方法代码示例

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


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

示例1:

const getItemSelection = (editor: Editor): Option<ItemSelection> => {
  const selectedListItems = Arr.map(Selection.getSelectedListItems(editor), Element.fromDom);

  return Options.liftN([
    Arr.find(selectedListItems, Fun.not(hasFirstChildList)),
    Arr.find(Arr.reverse(selectedListItems), Fun.not(hasFirstChildList))
  ], (start, end) => ({ start, end }));
};
开发者ID:danielpunkass,项目名称:tinymce,代码行数:8,代码来源:ListsIndendation.ts

示例2: normalizedTextOffset

const create = (root: Node, caretPosition: CaretPosition): string => {
  let container, offset, path = [],
    outputOffset, childNodes, parents;

  container = caretPosition.container();
  offset = caretPosition.offset();

  if (isText(container)) {
    outputOffset = normalizedTextOffset(container, offset);
  } else {
    childNodes = container.childNodes;
    if (offset >= childNodes.length) {
      outputOffset = 'after';
      offset = childNodes.length - 1;
    } else {
      outputOffset = 'before';
    }

    container = childNodes[offset];
  }

  path.push(createPathItem(container));
  parents = parentsUntil(root, container);
  parents = ArrUtils.filter(parents, Fun.not(NodeType.isBogus));
  path = path.concat(ArrUtils.map(parents, function (node) {
    return createPathItem(node);
  }));

  return path.reverse().join('/') + ',' + outputOffset;
};
开发者ID:tinymce,项目名称:tinymce,代码行数:30,代码来源:CaretBookmark.ts

示例3: function

const takeover = function (viewport, contentBody, toolbar, dropup) {
  const outerWindow = Traverse.owner(viewport).dom().defaultView;
  const toolbarSetup = takeoverToolbar(toolbar);
  const toolbarHeight = Height.get(toolbar);
  const dropupHeight = Height.get(dropup);
  const viewportHeight = deriveViewportHeight(viewport, toolbarHeight, dropupHeight);

  const viewportSetup = takeoverViewport(toolbarHeight, viewportHeight, viewport);

  const dropupSetup = takeoverDropup(dropup, toolbarHeight, viewportHeight);

  let isActive = true;

  const restore = function () {
    isActive = false;
    toolbarSetup.restore();
    viewportSetup.restore();
    dropupSetup.restore();
  };

  const isExpanding = function () {
    const currentWinHeight = outerWindow.innerHeight;
    const lastWinHeight = getLastWindowSize(viewport);
    return currentWinHeight > lastWinHeight;
  };

  const refresh = function () {
    if (isActive) {
      const newToolbarHeight = Height.get(toolbar);
      const dropupHeight = Height.get(dropup);
      const newHeight = deriveViewportHeight(viewport, newToolbarHeight, dropupHeight);
      Attr.set(viewport, yFixedData, newToolbarHeight + 'px');
      Css.set(viewport, 'height', newHeight + 'px');

      Css.set(dropup, 'bottom', -(newToolbarHeight + newHeight + dropupHeight) + 'px');
      DeviceZones.updatePadding(contentBody, viewport, dropup);
    }
  };

  const setViewportOffset = function (newYOffset) {
    const offsetPx = newYOffset + 'px';
    Attr.set(viewport, yFixedData, offsetPx);
    // The toolbar height has probably changed, so recalculate the viewport height.
    refresh();
  };

  DeviceZones.updatePadding(contentBody, viewport, dropup);

  return {
    setViewportOffset,
    isExpanding,
    isShrinking: Fun.not(isExpanding),
    refresh,
    restore
  };
};
开发者ID:abstask,项目名称:tinymce,代码行数:56,代码来源:IosViewport.ts

示例4: function

 const eraseTable = function () {
   const cell = Element.fromDom(editor.dom.getParent(editor.selection.getStart(), 'th,td'));
   const table = TableLookup.table(cell, isRoot);
   table.filter(Fun.not(isRoot)).each(function (table) {
     const cursor = Element.fromText('');
     Insert.after(table, cursor);
     Remove.remove(table);
     const rng = editor.dom.createRng();
     rng.setStart(cursor.dom(), 0);
     rng.setEnd(cursor.dom(), 0);
     editor.selection.setRng(rng);
   });
 };
开发者ID:aha-app,项目名称:tinymce-word-paste-filter,代码行数:13,代码来源:TableCommands.ts

示例5: interpretInForm

const renderBodyPanel = <I>(spec: BodyPanelFoo<I>, backstage: UiFactoryBackstage): SimpleSpec => {
  const memForm = Memento.record(
    AlloyForm.sketch((parts) => {
      return {
        dom: {
          tag: 'div',
          classes: [ 'tox-form' ]
        },
        // All of the items passed through the form need to be put through the interpreter
        // with their form part preserved.
        components: Arr.map(spec.items, (item) => {
          return interpretInForm(parts, item, backstage);
        })
      };
    })
  );

  return {
    dom: {
      tag: 'div',
      classes: [ 'tox-dialog__body' ]
    },
    components: [
      {
        dom: {
          tag: 'div',
          classes: ['tox-dialog__body-content']
        },
        components: [
          memForm.asSpec()
        ]
      }
    ],
    behaviours: Behaviour.derive([
      Keying.config({
        mode: 'acyclic',
        useTabstopAt: Fun.not(NavigableObject.isPseudoStop)
      }),
      ComposingConfigs.memento(memForm),
      RepresentingConfigs.memento(memForm, {
        postprocess: (formValue) => FormValues.toValidValues(formValue).fold(
          (err) => {
            console.error(err);
            return { };
          },
          (vals) => vals
        )
      })
    ])
  };
};
开发者ID:tinymce,项目名称:tinymce,代码行数:51,代码来源:BodyPanel.ts

示例6:

      .each((cellOrCaption) => {
        const tableOpt = TableLookup.table(cellOrCaption, isRoot);
        tableOpt.filter(Fun.not(isRoot)).each((table) => {
          const cursor = Element.fromText('');
          Insert.after(table, cursor);
          Remove.remove(table);

          if (editor.dom.isEmpty(editor.getBody())) {
            editor.setContent('');
            editor.selection.setCursorLocation();
          } else {
            const rng = editor.dom.createRng();
            rng.setStart(cursor.dom(), 0);
            rng.setEnd(cursor.dom(), 0);
            editor.selection.setRng(rng);
            editor.nodeChanged();
          }
        });
      });
开发者ID:tinymce,项目名称:tinymce,代码行数:19,代码来源:Commands.ts

示例7:

const renderIframeBody = (spec: Types.UrlDialog.UrlDialog) => {
  const bodySpec = {
    dom: {
      tag: 'div',
      classes: [ 'tox-dialog__content-js' ]
    },
    components: [
      {
        dom: {
          tag: 'div',
          classes: [ 'tox-dialog__body-iframe' ]
        },
        components: [
          NavigableObject.craft({
            dom: {
              tag: 'iframe',
              attributes: {
                src: spec.url
              }
            },
            behaviours: Behaviour.derive([
              Tabstopping.config({ }),
              Focusing.config({ })
            ])
          })
        ]
      }
    ],
    behaviours: Behaviour.derive([
      Keying.config({
        mode: 'acyclic',
        useTabstopAt: Fun.not(NavigableObject.isPseudoStop)
      })
    ])
  };

  return ModalDialog.parts().body(
    bodySpec
  );
};
开发者ID:tinymce,项目名称:tinymce,代码行数:40,代码来源:SilverDialogBody.ts

示例8: interpretInForm

          AlloyForm.sketch((parts) => {
            return {
              dom: {
                tag: 'div',
                classes: [ 'tox-form' ]
              },
              components: Arr.map(tab.items, (item) => interpretInForm(parts, item, backstage)),
              formBehaviours: Behaviour.derive([
                Keying.config({
                  mode: 'acyclic',
                  useTabstopAt: Fun.not(NavigableObject.isPseudoStop)
                }),

                AddEventsBehaviour.config('TabView.form.events', [
                  AlloyEvents.runOnAttached(setDataOnForm),
                  AlloyEvents.runOnDetached(updateDataWithForm)
                ]),
                Receiving.config({
                  channels: Objects.wrapAll([
                    {
                      key: SendDataToSectionChannel,
                      value:  {
                        onReceive: updateDataWithForm
                      }
                    },
                    {
                      key: SendDataToViewChannel,
                      value: {
                        onReceive: setDataOnForm
                      }
                    }
                  ])
                })
              ])
            };
          })
开发者ID:tinymce,项目名称:tinymce,代码行数:36,代码来源:TabPanel.ts

示例9: function

const getPluginKeys = function (editor) {
  const keys = Obj.keys(editor.plugins);
  return editor.settings.forced_plugins === undefined ?
    keys :
    Arr.filter(keys, Fun.not(Fun.curry(Arr.contains, editor.settings.forced_plugins)));
};
开发者ID:abstask,项目名称:tinymce,代码行数:6,代码来源:PluginsTab.ts

示例10:

 * This module contains logic for creating caret positions within a document a caretposition
 * is similar to a DOMRange object but it doesn't have two endpoints and is also more lightweight
 * since it's now updated live when the DOM changes.
 *
 * @private
 * @class tinymce.caret.CaretPosition
 * @example
 * var caretPos1 = CaretPosition(container, offset);
 * var caretPos2 = CaretPosition.fromRangeStart(someRange);
 */

const isElement = NodeType.isElement;
const isCaretCandidate = CaretCandidate.isCaretCandidate;
const isBlock = NodeType.matchStyleValues('display', 'block table');
const isFloated = NodeType.matchStyleValues('float', 'left right');
const isValidElementCaretCandidate = Predicate.and(isElement, isCaretCandidate, Fun.not(isFloated));
const isNotPre = Fun.not(NodeType.matchStyleValues('white-space', 'pre pre-line pre-wrap'));
const isText = NodeType.isText;
const isBr = NodeType.isBr;
const nodeIndex = DOMUtils.nodeIndex;
const resolveIndex = RangeNodes.getNode;
const createRange = (doc: Document): Range => 'createRange' in doc ? doc.createRange() : DOMUtils.DOM.createRng();
const isWhiteSpace = (chr: string): boolean => chr && /[\r\n\t ]/.test(chr);
const isRange = (rng: any): rng is Range => !!rng.setStart && !!rng.setEnd;

const isHiddenWhiteSpaceRange = (range: Range): boolean => {
  const container = range.startContainer;
  const offset = range.startOffset;
  let text;

  if (isWhiteSpace(range.toString()) && isNotPre(container.parentNode) && NodeType.isText(container)) {
开发者ID:danielpunkass,项目名称:tinymce,代码行数:31,代码来源:CaretPosition.ts


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