本文整理汇总了TypeScript中tinymce/core/api/Editor.Editor.getParam方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Editor.getParam方法的具体用法?TypeScript Editor.getParam怎么用?TypeScript Editor.getParam使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tinymce/core/api/Editor.Editor
的用法示例。
在下文中一共展示了Editor.getParam方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1:
const getForcedRootBlock = (editor: Editor): string => {
// Legacy option
if (editor.getParam('force_p_newlines', false)) {
return 'p';
}
const block = editor.getParam('forced_root_block', 'p');
return block === false ? '' : block;
};
示例2: function
const getSpellcheckerWordcharPattern = function (editor: Editor) {
const defaultPattern = new RegExp('[^' +
'\\s!"#$%&()*+,-./:;<=>?@[\\]^_{|}`' +
'\u00a7\u00a9\u00ab\u00ae\u00b1\u00b6\u00b7\u00b8\u00bb' +
'\u00bc\u00bd\u00be\u00bf\u00d7\u00f7\u00a4\u201d\u201c\u201e\u00a0\u2002\u2003\u2009' +
']+', 'g');
return editor.getParam('spellchecker_wordchar_pattern', defaultPattern);
};
示例3:
const getWordValidElements = (editor: Editor): string => {
const defaultValidElements = (
'-strong/b,-em/i,-u,-span,-p,-ol,-ul,-li,-h1,-h2,-h3,-h4,-h5,-h6,' +
'-p/div,-a[href|name],sub,sup,strike,br,del,table[width],tr,' +
'td[colspan|rowspan|width],th[colspan|rowspan|width],thead,tfoot,tbody'
);
return editor.getParam('paste_word_valid_elements', defaultValidElements);
};
示例4: if
const getCloneElements = (editor: Editor): Option<string[]> => {
const cloneElements = editor.getParam('table_clone_elements');
if (Type.isString(cloneElements)) {
return Option.some(cloneElements.split(/[ ,]/));
} else if (Array.isArray(cloneElements)) {
return Option.some(cloneElements);
} else {
return Option.none();
}
};
示例5: parseInt
export const handle = (editor: Editor, command: string) => {
const { settings, dom, selection, formatter } = editor;
const indentUnit = /[a-z%]+$/i.exec(settings.indentation)[0];
const indentValue = parseInt(settings.indentation, 10);
const useMargin = editor.getParam('indent_use_margin', false);
// If forced_root_blocks is set to false we don't have a block to indent so lets create a div
if (!editor.queryCommandState('InsertUnorderedList') && !editor.queryCommandState('InsertOrderedList')) {
if (!settings.forced_root_block && !dom.getParent(selection.getNode(), dom.isBlock)) {
formatter.apply('div');
}
}
Arr.each(getBlocksToIndent(editor), (block) => {
indentElement(dom, command, useMargin, indentValue, indentUnit, block.dom());
});
};