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


TypeScript Editor.getParam方法代码示例

本文整理汇总了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;
};
开发者ID:danielpunkass,项目名称:tinymce,代码行数:9,代码来源:Settings.ts

示例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);
};
开发者ID:danielpunkass,项目名称:tinymce,代码行数:8,代码来源:Settings.ts

示例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);
};
开发者ID:abstask,项目名称:tinymce,代码行数:9,代码来源:Settings.ts

示例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();
  }
};
开发者ID:danielpunkass,项目名称:tinymce,代码行数:11,代码来源:Settings.ts

示例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());
  });
};
开发者ID:danielpunkass,项目名称:tinymce,代码行数:17,代码来源:IndentOutdent.ts


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