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