本文整理汇总了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)
});
});
示例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);
};
示例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;
};
示例4: function
const firePastePostProcess = function (editor: Editor, node: HTMLElement, internal: boolean, isWordHtml: boolean) {
return editor.fire('PastePostProcess', { node, internal, wordContent: isWordHtml });
};
示例5: function
editor.dom.bind(pasteBinElm, 'paste keyup', function (e) {
if (!isDefault(editor, pasteBinDefaultContent)) {
editor.fire('paste');
}
});
示例6: function
return StyleFormats.ui(editor, styleFormats, function () {
editor.fire('scrollIntoView');
});
示例7: function
const fireSpellcheckStart = function (editor: Editor) {
return editor.fire('SpellcheckStart');
};