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


TypeScript Html.getOuter方法代码示例

本文整理汇总了TypeScript中@ephox/sugar.Html.getOuter方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Html.getOuter方法的具体用法?TypeScript Html.getOuter怎么用?TypeScript Html.getOuter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在@ephox/sugar.Html的用法示例。


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

示例1: function

const insert = function (editor, columns, rows) {
  let tableElm;

  const renderedHtml = TableRender.render(rows, columns, 0, 0);

  Attr.set(renderedHtml, 'id', '__mce');

  const html = Html.getOuter(renderedHtml);

  editor.insertContent(html);

  tableElm = editor.dom.get('__mce');
  editor.dom.setAttrib(tableElm, 'id', null);

  editor.$('tr', tableElm).each(function (index, row) {
    editor.fire('newrow', {
      node: row
    });

    editor.$('th,td', row).each(function (index, cell) {
      editor.fire('newcell', {
        node: cell
      });
    });
  });

  editor.dom.setAttribs(tableElm, editor.settings.table_default_attributes || {});
  editor.dom.setStyles(tableElm, editor.settings.table_default_styles || {});

  selectFirstCellInTable(editor, Element.fromDom(tableElm));

  return tableElm;
};
开发者ID:,项目名称:,代码行数:33,代码来源:

示例2: function

 const assertPath = function (label, root, expPath, expOffset, actElement, actOffset) {
   const expected = Cursors.calculateOne(root, expPath);
   const message = function () {
     const actual = Element.fromDom(actElement);
     const actPath = Hierarchy.path(root, actual).getOrDie('could not find path to root');
     return 'Expected path: ' + JSON.stringify(expPath) + '.\nActual path: ' + JSON.stringify(actPath);
   };
   Assertions.assertEq('Assert incorrect for ' + label + '.\n' + message(), true, expected.dom() === actElement);
   Assertions.assertEq('Offset mismatch for ' + label + ' in :\n' + Html.getOuter(expected), expOffset, actOffset);
 };
开发者ID:howardjing,项目名称:tinymce,代码行数:10,代码来源:SelectionBookmarkInlineEditorTest.ts

示例3: getDefaultStyles

const insert = (editor: Editor, columns: number, rows: number): HTMLElement => {
  const defaultStyles = getDefaultStyles(editor);
  const options: TableRender.RenderOptions = {
    styles: defaultStyles,
    attributes: getDefaultAttributes(editor),
    percentages: isPercentage(defaultStyles.width) && !isPixelsForced(editor)
  };

  const table = TableRender.render(rows, columns, 0, 0, options);
  Attr.set(table, 'data-mce-id', '__mce');

  const html = Html.getOuter(table);
  editor.insertContent(html);

  return SelectorFind.descendant(Util.getBody(editor), 'table[data-mce-id="__mce"]').map((table) => {
    if (isPixelsForced(editor)) {
      Css.set(table, 'width', Css.get(table, 'width'));
    }
    Attr.remove(table, 'data-mce-id');
    fireEvents(editor, table);
    selectFirstCellInTable(editor, table);
    return table.dom();
  }).getOr(null);
};
开发者ID:abstask,项目名称:tinymce,代码行数:24,代码来源:InsertTable.ts

示例4:

 return Chain.op(function (tableModel) {
   const actualHtml = Html.getOuter(SimpleTableModel.toDom(tableModel));
   Assertions.assertHtml('Should be expected table html', expectedHtml, actualHtml);
 });
开发者ID:aha-app,项目名称:tinymce-word-paste-filter,代码行数:4,代码来源:SimpleTableModelTest.ts

示例5: function

 function (table) {
   return Result.value(Html.getOuter(table));
 },
开发者ID:aha-app,项目名称:tinymce-word-paste-filter,代码行数:3,代码来源:TableDeleteActionTest.ts

示例6:

 Step.sync(function () {
   const elm = Element.fromHtml('<p>a</p>');
   PaddingBr.fillWithPaddingBr(elm);
   Assertions.assertHtml('Should be padded with bogus br', '<p><br data-mce-bogus="1"></p>', Html.getOuter(elm));
 })
开发者ID:aha-app,项目名称:tinymce-word-paste-filter,代码行数:5,代码来源:PaddingBrTest.ts


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