• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

TypeScript Delay.setEditorTimeout函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了TypeScript中tinymce/core/api/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:abstask,项目名称:tinymce,代码行数:7,代码来源:Actions.ts


示例2: function

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


示例3: function

const startTimedUpload = function (editor: Editor, imageUploadTimerState) {
  const imageUploadTimer = Delay.setEditorTimeout(editor, function () {
    editor.editorUpload.uploadImagesAuto();
  }, Settings.getUploadTimeout(editor));

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


示例4: 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


示例5: function

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

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


示例6:

 editor.on('focusout', (e) => {
   Delay.setEditorTimeout(editor, () => {
     if (Focus.search(sink.element()).isNone() && Focus.search(contextbar.element()).isNone()) {
       lastAnchor.set(Option.none());
       InlineView.hide(contextbar);
     }
   }, 0);
 });
开发者ID:tinymce,项目名称:tinymce,代码行数:8,代码来源:ContextToolbar.ts


示例7: function

const delayedConfirm = function (editor: Editor, message: string, callback: (state: boolean) => void) {
  const rng = editor.selection.getRng();

  Delay.setEditorTimeout(editor, function () {
    editor.windowManager.confirm(message, function (state) {
      editor.selection.setRng(rng);
      callback(state);
    });
  });
};
开发者ID:tinymce,项目名称:tinymce,代码行数:10,代码来源:DialogConfirms.ts


示例8: toggle

 editor.on('ProgressState', (e) => {
   timer.get().each(Delay.clearTimeout);
   if (Type.isNumber(e.time)) {
     const timerId = Delay.setEditorTimeout(editor, () => toggle(e.state), e.time);
     timer.set(Option.some(timerId));
   } else {
     toggle(e.state);
     timer.set(Option.none());
   }
 });
开发者ID:tinymce,项目名称:tinymce,代码行数:10,代码来源:Throbber.ts


示例9: resize

const wait = (editor: Editor, oldSize: Cell<number>, times: number, interval: number, callback?: Function) => {
  Delay.setEditorTimeout(editor, () => {
    resize(editor, oldSize);

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



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
TypeScript Delay.setInterval函数代码示例发布时间:2022-05-25
下一篇:
TypeScript Delay.requestAnimationFrame函数代码示例发布时间:2022-05-25
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap