當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。