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


TypeScript Delay.setEditorTimeout函数代码示例

本文整理汇总了TypeScript中tinymce/core/util/Delay.setEditorTimeout函数的典型用法代码示例。如果您正苦于以下问题:TypeScript setEditorTimeout函数的具体用法?TypeScript setEditorTimeout怎么用?TypeScript setEditorTimeout使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: function

const startTimedUpload = function (editor, imageUploadTimerState) {
  const imageUploadTimer = Delay.setEditorTimeout(editor, function () {
    editor.editorUpload.uploadImagesAuto();
  }, editor.settings.images_upload_timeout || 30000);

  imageUploadTimerState.set(imageUploadTimer);
};
开发者ID:aha-app,项目名称:tinymce-word-paste-filter,代码行数:7,代码来源:Actions.ts

示例2: function

 editor.on('keypress', function (e) {
   if (KeyHandler.checkCharCode(charCodes, e)) {
     Delay.setEditorTimeout(editor, function () {
       KeyHandler.handleInlineKey(editor, patternsState.get());
     });
   }
 });
开发者ID:aha-app,项目名称:tinymce-word-paste-filter,代码行数:7,代码来源:Keyboard.ts

示例3: function

  suite.asyncTest('setEditorTimeout', function (_, done) {
    const fakeEditor = {};

    Delay.setEditorTimeout(fakeEditor, function () {
      ok(true, 'setEditorTimeout was executed.');
      done();
    });
  });
开发者ID:aha-app,项目名称:tinymce-word-paste-filter,代码行数:8,代码来源:DelayTest.ts

示例4: function

const delayedConfirm = function (editor, message, callback) {
  const rng = editor.selection.getRng();

  Delay.setEditorTimeout(editor, function () {
    editor.windowManager.confirm(message, function (state) {
      editor.selection.setRng(rng);
      callback(state);
    });
  });
};
开发者ID:aha-app,项目名称:tinymce-word-paste-filter,代码行数:10,代码来源:Dialog.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(e);
      const clipboardDelay = new Date().getTime() - clipboardTimer;

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

      keyboardPastePlainTextState = false;

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

      if (!hasHtmlOrText(clipboardContent) && pasteImageData(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 {
        Delay.setEditorTimeout(editor, function () {
          insertClipboardContent(clipboardContent, isKeyBoardPaste, plainTextMode, internal);
        }, 0);
      }
    });
开发者ID:aha-app,项目名称:tinymce-word-paste-filter,代码行数:55,代码来源:Clipboard.ts

示例6: function

const wait = function (editor, oldSize, times, interval, callback?) {
  Delay.setEditorTimeout(editor, function () {
    resize(editor, oldSize);

    if (times--) {
      wait(editor, oldSize, times, interval, callback);
    } else if (callback) {
      callback();
    }
  }, interval);
};
开发者ID:aha-app,项目名称:tinymce-word-paste-filter,代码行数:11,代码来源:Resize.ts

示例7: function

  editor.on('init', function () {
    const statusbar = editor.theme.panel && editor.theme.panel.find('#statusbar')[0];
    const debouncedUpdate = Delay.debounce(update, 300);

    if (statusbar) {
      Delay.setEditorTimeout(editor, function () {
        statusbar.insert({
          type: 'label',
          name: 'wordcount',
          text: wordsToText(editor),
          classes: 'wordcount',
          disabled: editor.settings.readonly
        }, 0);

        editor.on('setcontent beforeaddundo undo redo keyup', debouncedUpdate);
      }, 0);
    }
  });
开发者ID:aha-app,项目名称:tinymce-word-paste-filter,代码行数:18,代码来源:Statusbar.ts

示例8: function

  editor.on('drop', function (e) {
    let dropContent, rng;

    rng = getCaretRangeFromEvent(editor, e);

    if (e.isDefaultPrevented() || draggingInternallyState.get()) {
      return;
    }

    dropContent = clipboard.getDataTransferItems(e.dataTransfer);
    const internal = clipboard.hasContentType(dropContent, InternalHtml.internalHtmlMime());

    if ((!clipboard.hasHtmlOrText(dropContent) || isPlainTextFileUrl(dropContent)) && clipboard.pasteImageData(e, rng)) {
      return;
    }

    if (rng && Settings.shouldFilterDrop(editor)) {
      let content = dropContent['mce-internal'] || dropContent['text/html'] || dropContent['text/plain'];

      if (content) {
        e.preventDefault();

        // FF 45 doesn't paint a caret when dragging in text in due to focus call by execCommand
        Delay.setEditorTimeout(editor, function () {
          editor.undoManager.transact(function () {
            if (dropContent['mce-internal']) {
              editor.execCommand('Delete');
            }

            setFocusedRange(editor, rng);

            content = Utils.trimHtml(content);

            if (!dropContent['text/html']) {
              clipboard.pasteText(content);
            } else {
              clipboard.pasteHtml(content, internal);
            }
          });
        });
      }
    }
  });
开发者ID:aha-app,项目名称:tinymce-word-paste-filter,代码行数:43,代码来源:DragDrop.ts

示例9: function

  editor.on('click keyup setContent ObjectResized', function (e) {
    // Only act on partial inserts
    if (e.type === 'setcontent' && !e.selection) {
      return;
    }

    // Needs to be delayed to avoid Chrome img focus out bug
    Delay.setEditorTimeout(editor, function () {
      let match;

      match = findFrontMostMatch(editor.selection.getNode());
      if (match) {
        hideAllContextToolbars();
        showContextToolbar(match);
      } else {
        hideAllContextToolbars();
      }
    });
  });
开发者ID:howardjing,项目名称:tinymce,代码行数:19,代码来源:ContextToolbars.ts


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