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


TypeScript Cell.get方法代码示例

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


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

示例1:

 const getPatterns = () => {
   return [
     ...patternsState.get().inlinePatterns,
     ...patternsState.get().blockPatterns,
     ...patternsState.get().replacementPatterns
   ];
 };
开发者ID:danielpunkass,项目名称:tinymce,代码行数:7,代码来源:Api.ts

示例2: setIconColor

    onSetup: (splitButtonApi) => {
      if (lastColor.get() !== null) {
        setIconColor(splitButtonApi, name, lastColor.get());
      }

      return () => { };
    }
开发者ID:tinymce,项目名称:tinymce,代码行数:7,代码来源:ColorSwatch.ts

示例3: function

const safeRemoveCaretContainer = function (editor: Editor, caret: Cell<Text>) {
  if (editor.selection.isCollapsed() && editor.composing !== true && caret.get()) {
    const pos = CaretPosition.fromRangeStart(editor.selection.getRng());
    if (CaretPosition.isTextPosition(pos) && InlineUtils.isAtZwsp(pos) === false) {
      setCaretPosition(editor, CaretContainerRemove.removeAndReposition(caret.get(), pos));
      caret.set(null);
    }
  }
};
开发者ID:danielpunkass,项目名称:tinymce,代码行数:9,代码来源:BoundarySelection.ts

示例4: function

  return function (e) {
    const selectedLanguage = currentLanguageState.get();

    e.control.items().each(function (ctrl) {
      ctrl.active(ctrl.settings.data === selectedLanguage);
    });
  };
开发者ID:danielpunkass,项目名称:tinymce,代码行数:7,代码来源:Buttons.ts

示例5: function

  editor.on('paste', function (e) {
    // Getting content from the Clipboard can take some time
    const clipboardTimer = new Date().getTime();
    const clipboardContent = getClipboardContent(editor, e);
    const clipboardDelay = new Date().getTime() - clipboardTimer;

    const isKeyBoardPaste = (new Date().getTime() - keyboardPasteTimeStamp - clipboardDelay) < 1000;
    const plainTextMode = pasteFormat.get() === 'text' || keyboardPastePlainTextState;
    let internal = hasContentType(clipboardContent, InternalHtml.internalHtmlMime());

    // Reset ephemeral flags
    pasteFormat.set(undefined);
    keyboardPastePlainTextState = false;

    if (e.isDefaultPrevented() || isBrokenAndroidClipboardEvent(e)) {
      pasteBin.remove();
      return;
    }

    if (!hasHtmlOrText(clipboardContent) && pasteImageData(editor, e, getLastRng())) {
      pasteBin.remove();
      return;
    }

    // Not a keyboard paste prevent default paste and try to grab the clipboard contents using different APIs
    if (!isKeyBoardPaste) {
      e.preventDefault();
    }

    // Try IE only method if paste isn't a keyboard paste
    if (Env.ie && (!isKeyBoardPaste || e.ieFake) && !hasContentType(clipboardContent, 'text/html')) {
      pasteBin.create();

      editor.dom.bind(pasteBin.getEl(), 'paste', function (e) {
        e.stopPropagation();
      });

      editor.getDoc().execCommand('Paste', false, null);
      clipboardContent['text/html'] = pasteBin.getHtml();
    }

    // If clipboard API has HTML then use that directly
    if (hasContentType(clipboardContent, 'text/html')) {
      e.preventDefault();

      // if clipboard lacks internal mime type, inspect html for internal markings
      if (!internal) {
        internal = InternalHtml.isMarked(clipboardContent['text/html']);
      }

      insertClipboardContent(clipboardContent, isKeyBoardPaste, plainTextMode, internal);
    } else {
      // Since we never use the pastebin on Red Sweater branch, we want to prevent the default in both cases
      // to avoid a double-paste behavior.
      e.preventDefault();
      Delay.setEditorTimeout(editor, function () {
        insertClipboardContent(clipboardContent, isKeyBoardPaste, plainTextMode, internal);
      }, 0);
    }
  });
开发者ID:danielpunkass,项目名称:tinymce,代码行数:60,代码来源:Clipboard.ts

示例6: function

 editor.on('keydown', function (e: EditorEvent<KeyboardEvent>) {
   if (e.keyCode === 13 && !VK.modifierPressed(e)) {
     if (KeyHandler.handleEnter(editor, patternsState.get())) {
       e.preventDefault();
     }
   }
 }, true);
开发者ID:tinymce,项目名称:tinymce,代码行数:7,代码来源:Keyboard.ts

示例7: createEntry

  return Traverse.firstChild(item).filter(isList).fold(() => {

    // Update selectionState (start)
    itemSelection.each((selection) => {
      if (Compare.eq(selection.start, item)) {
        selectionState.set(true);
      }
    });

    const currentItemEntry = createEntry(item, depth, selectionState.get());

    // Update selectionState (end)
    itemSelection.each((selection) => {
      if (Compare.eq(selection.end, item)) {
        selectionState.set(false);
      }
    });

    const childListEntries: Entry[] = Traverse.lastChild(item)
      .filter(isList)
      .map((list) => parseList(depth, itemSelection, selectionState, list))
      .getOr([]);

    return currentItemEntry.toArray().concat(childListEntries);
  }, (list) => parseList(depth, itemSelection, selectionState, list));
开发者ID:danielpunkass,项目名称:tinymce,代码行数:25,代码来源:ParseLists.ts

示例8: updateSelectionState

  return Traverse.firstChild(item).filter(isList).fold(() => {
    updateSelectionState(ItemRange.Start);
    const fromCurrentItem: Entry = createEntry(item, depth, selectionState.get());
    updateSelectionState(ItemRange.End);
    const fromChildList: Entry[] = Traverse.lastChild(item).filter(isList).map(curriedParseList).getOr([]);

    return [ fromCurrentItem, ...fromChildList ];
  }, curriedParseList);
开发者ID:mdgbayly,项目名称:tinymce,代码行数:8,代码来源:ParseLists.ts

示例9: function

const toggleVisualBlocks = function (editor: Editor, pluginUrl: string, enabledState: Cell<boolean>) {
  const dom = editor.dom;

  dom.toggleClass(editor.getBody(), 'mce-visualblocks');
  enabledState.set(!enabledState.get());

  Events.fireVisualBlocks(editor, enabledState.get());
};
开发者ID:tinymce,项目名称:tinymce,代码行数:8,代码来源:VisualBlocks.ts

示例10: getMaxTabviewHeight

 SelectorFind.ancestor(dialogBody, '[role="dialog"]').each((dialog) => {
   maxTabHeight.get().map((height) => {
     // Set the tab view height to 0, so we can calculate the max tabview height, without worrying about overflows
     Css.set(tabview, 'height', '0');
     return Math.min(height, getMaxTabviewHeight(dialog, dialogBody));
   }).each((height) => {
     Css.set(tabview, 'height', height + 'px');
   });
 });
开发者ID:tinymce,项目名称:tinymce,代码行数:9,代码来源:DialogTabHeight.ts


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