當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript EditorManager.get函數代碼示例

本文整理匯總了TypeScript中tinymce/core/EditorManager.get函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript get函數的具體用法?TypeScript get怎麽用?TypeScript get使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了get函數的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1:

      Step.sync(function () {
        const caretElm0 = EditorManager.get(0).getBody().querySelector('[data-mce-caret]');
        const caretElm1 = EditorManager.get(1).getBody().querySelector('[data-mce-caret]');

        Assertions.assertEq('Should not be a caret element present editor 0', false, !!caretElm0);
        Assertions.assertEq('Should be a caret element present editor 1', true, !!caretElm1);
      }),
開發者ID:aha-app,項目名稱:tinymce-word-paste-filter,代碼行數:7,代碼來源:CefFocusTest.ts

示例2: function

    Tools.each(invalidNames.split(' '), function (invalidName) {
      const elm = DOMUtils.DOM.add(document.body, invalidName, { class: 'targetEditor' }, null);

      EditorManager.init({
        selector: invalidName + '.targetEditor',
        skin_url: '/project/js/tinymce/skins/lightgray',
        inline: true
      });

      LegacyUnit.strictEqual(EditorManager.get().length, 0, 'Should not have created an editor');
      DOMUtils.DOM.remove(elm);
    });
開發者ID:aha-app,項目名稱:tinymce-word-paste-filter,代碼行數:12,代碼來源:EditorManagerTest.ts

示例3: function

EditorManager._beforeUnloadHandler = function () {
  let msg;

  Tools.each(EditorManager.get(), function (editor) {
    // Store a draft for each editor instance
    if (editor.plugins.autosave) {
      editor.plugins.autosave.storeDraft();
    }

    // Setup a return message if the editor is dirty
    if (!msg && editor.isDirty() && Settings.shouldAskBeforeUnload(editor)) {
      msg = editor.translate('You have unsaved changes are you sure you want to navigate away?');
    }
  });

  return msg;
};
開發者ID:aha-app,項目名稱:tinymce-word-paste-filter,代碼行數:17,代碼來源:BeforeUnload.ts

示例4: init_instance_callback

        Delay.setTimeout(function () {
          // Destroy the editor by setting innerHTML common ajax pattern
          viewBlock.update('<textarea id="' + editor1.id + '"></textarea>');

          // Re-init the editor will have the same id
          EditorManager.init({
            selector: 'textarea',
            skin_url: '/project/js/tinymce/skins/lightgray',
            init_instance_callback (editor2) {
              LegacyUnit.equal(EditorManager.get().length, 1);
              LegacyUnit.equal(editor1.id, editor2.id);
              LegacyUnit.equal(editor1.destroyed, 1, 'First editor instance should be destroyed');

              teardown(done);
            }
          });
        }, 0);
開發者ID:aha-app,項目名稱:tinymce-word-paste-filter,代碼行數:17,代碼來源:EditorManagerTest.ts

示例5: canSelect

 function canSelect(el) {
   return /INPUT|TEXTAREA|BUTTON/.test(el.tagName) && EditorManager.get(e.id) && el.tabIndex !== -1 && canSelectRecursive(el);
 }
開發者ID:aha-app,項目名稱:tinymce-word-paste-filter,代碼行數:3,代碼來源:Keyboard.ts

示例6: tabHandler

  function tabHandler(e) {
    let x, el, v, i;

    if (e.keyCode !== VK.TAB || e.ctrlKey || e.altKey || e.metaKey || e.isDefaultPrevented()) {
      return;
    }

    function find(direction) {
      el = DOM.select(':input:enabled,*[tabindex]:not(iframe)');

      function canSelectRecursive(e) {
        return e.nodeName === 'BODY' || (e.type !== 'hidden' &&
          e.style.display !== 'none' &&
          e.style.visibility !== 'hidden' && canSelectRecursive(e.parentNode));
      }

      function canSelect(el) {
        return /INPUT|TEXTAREA|BUTTON/.test(el.tagName) && EditorManager.get(e.id) && el.tabIndex !== -1 && canSelectRecursive(el);
      }

      Tools.each(el, function (e, i) {
        if (e.id === editor.id) {
          x = i;
          return false;
        }
      });
      if (direction > 0) {
        for (i = x + 1; i < el.length; i++) {
          if (canSelect(el[i])) {
            return el[i];
          }
        }
      } else {
        for (i = x - 1; i >= 0; i--) {
          if (canSelect(el[i])) {
            return el[i];
          }
        }
      }

      return null;
    }

    v = Tools.explode(Settings.getTabFocus(editor));

    if (v.length === 1) {
      v[1] = v[0];
      v[0] = ':prev';
    }

    // Find element to focus
    if (e.shiftKey) {
      if (v[0] === ':prev') {
        el = find(-1);
      } else {
        el = DOM.get(v[0]);
      }
    } else {
      if (v[1] === ':next') {
        el = find(1);
      } else {
        el = DOM.get(v[1]);
      }
    }

    if (el) {
      const focusEditor = EditorManager.get(el.id || el.name);

      if (el.id && focusEditor) {
        focusEditor.focus();
      } else {
        Delay.setTimeout(function () {
          if (!Env.webkit) {
            window.focus();
          }

          el.focus();
        }, 10);
      }

      e.preventDefault();
    }
  }
開發者ID:aha-app,項目名稱:tinymce-word-paste-filter,代碼行數:83,代碼來源:Keyboard.ts


注:本文中的tinymce/core/EditorManager.get函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。