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


TypeScript Editor.fire函数代码示例

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


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

示例1: function

  editor.on('init', function (e) {
    const model = generate();

    const globallyUniqueSelectors = {};
    const selectorFilter = compileFilter(Settings.getSelectorFilter(editor));
    const groups = compileUserDefinedGroups(Settings.getCssGroups(editor));

    const processSelector = function (selector: string, group: StyleGroup) {
      if (isUniqueSelector(editor, selector, group, globallyUniqueSelectors)) {
        markUniqueSelector(editor, selector, group, globallyUniqueSelectors);

        const format = convertSelectorToFormat(editor, editor.plugins.importcss, selector, group);
        if (format) {
          const formatName = format.name || DOMUtils.DOM.uniqueId();
          editor.formatter.register(formatName, format);

          // NOTE: itemDefaults has been removed as it was not supported by bridge and its concept
          // is handled elsewhere.
          return Tools.extend({}, {
            title: format.title,
            format: formatName
          });
        }
      }

      return null;
    };

    Tools.each(getSelectors(editor, editor.getDoc(), compileFilter(Settings.getFileFilter(editor))), function (selector: string) {
      if (selector.indexOf('.mce-') === -1) {
        if (!selectorFilter || selectorFilter(selector)) {
          const selectorGroups = getGroupsBySelector(groups, selector);

          if (selectorGroups.length > 0) {
            Tools.each(selectorGroups, function (group) {
              const menuItem = processSelector(selector, group);
              if (menuItem) {
                model.addItemToGroup(group.title, menuItem);
              }
            });
          } else {
            const menuItem = processSelector(selector, null);
            if (menuItem) {
              model.addItem(menuItem);
            }
          }
        }
      }
    });

    const items = model.toFormats();
    editor.fire('addStyleModifications', {
      items,
      replace: !Settings.shouldAppend(editor)
    });
  });
开发者ID:tinymce,项目名称:tinymce,代码行数:56,代码来源:ImportCss.ts

示例2: function

    const setReadOnly = function (dynamicGroup, readOnlyGroups, mainGroups, ro) {
      if (ro === false) {
        editor.selection.collapse();
      }
      const toolbars = configureToolbar(dynamicGroup, readOnlyGroups, mainGroups);
      realm.setToolbarGroups(ro === true ? toolbars.readOnly : toolbars.main);

      editor.setMode(ro === true ? 'readonly' : 'design');
      editor.fire(ro === true ? READING() : EDITING());
      realm.updateMode(ro);
    };
开发者ID:tinymce,项目名称:tinymce,代码行数:11,代码来源:Theme.ts

示例3: while

  const updatePath = (parents) => {
    const newPath = [];
    let i = parents.length;

    while (i-- > 0) {
      const parent = parents[i];
      if (parent.nodeType === 1 && !isHidden(parent)) {
        const args = editor.fire('ResolveName', {
          name: parent.nodeName.toLowerCase(),
          target: parent
        });

        if (!args.isDefaultPrevented()) {
          newPath.push({ name: args.name, element: parent });
        }

        if (args.isPropagationStopped()) {
          break;
        }
      }
    }

    return newPath;
  };
开发者ID:tinymce,项目名称:tinymce,代码行数:24,代码来源:ElementPath.ts

示例4: function

const firePastePostProcess = function (editor: Editor, node: HTMLElement, internal: boolean, isWordHtml: boolean) {
  return editor.fire('PastePostProcess', { node, internal, wordContent: isWordHtml });
};
开发者ID:tinymce,项目名称:tinymce,代码行数:3,代码来源:Events.ts

示例5: function

 editor.dom.bind(pasteBinElm, 'paste keyup', function (e) {
   if (!isDefault(editor, pasteBinDefaultContent)) {
     editor.fire('paste');
   }
 });
开发者ID:tinymce,项目名称:tinymce,代码行数:5,代码来源:PasteBin.ts

示例6: function

 return StyleFormats.ui(editor, styleFormats, function () {
   editor.fire('scrollIntoView');
 });
开发者ID:tinymce,项目名称:tinymce,代码行数:3,代码来源:Features.ts

示例7: function

const fireSpellcheckStart = function (editor: Editor) {
  return editor.fire('SpellcheckStart');
};
开发者ID:tinymce,项目名称:tinymce,代码行数:3,代码来源:Events.ts


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