當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript Insert.append方法代碼示例

本文整理匯總了TypeScript中@ephox/sugar.Insert.append方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript Insert.append方法的具體用法?TypeScript Insert.append怎麽用?TypeScript Insert.append使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在@ephox/sugar.Insert的用法示例。


在下文中一共展示了Insert.append方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: function

const appendStyle = function (editor: Editor, text: string) {
  const head = Element.fromDom(editor.getDoc().head);
  const tag = Element.fromTag('style');
  Attr.set(tag, 'type', 'text/css');
  Insert.append(tag, Element.fromText(text));
  Insert.append(head, tag);
};
開發者ID:tinymce,項目名稱:tinymce,代碼行數:7,代碼來源:InitContentBody.ts

示例2: n

 NamedChain.write('container', Chain.async((input, n, die) => {
   const container = Element.fromTag('div');
   Attr.set(container, 'id', 'test-container-div');
   Html.set(container, containerHtml);
   Insert.append(Body.body(), container);
   n(container);
 })),
開發者ID:tinymce,項目名稱:tinymce,代碼行數:7,代碼來源:InlineEditorInsideTableTest.ts

示例3:

const insertElement = (root: Element, elm: Element, forward: boolean) => {
  if (forward) {
    Insert.append(root, elm);
  } else {
    Insert.prepend(root, elm);
  }
};
開發者ID:danielpunkass,項目名稱:tinymce,代碼行數:7,代碼來源:ContentEndpointNavigation.ts

示例4:

const createSection = (scope: Document, listType: ListType): Section => {
  const section: Section = {
    list: Element.fromTag(listType, scope),
    item: Element.fromTag('li', scope)
  };
  Insert.append(section.list, section.item);
  return section;
};
開發者ID:mdgbayly,項目名稱:tinymce,代碼行數:8,代碼來源:ComposeList.ts

示例5:

const createSegment = (scope: Document, listType: ListType): Segment => {
  const segment: Segment = {
    list: Element.fromTag(listType, scope),
    item: Element.fromTag('li', scope)
  };
  Insert.append(segment.list, segment.item);
  return segment;
};
開發者ID:danielpunkass,項目名稱:tinymce,代碼行數:8,代碼來源:ComposeList.ts

示例6: function

const createDomTable = function (table, rows) {
  const tableElement = Replication.shallow(table.element());
  const tableBody = Element.fromTag('tbody');

  InsertAll.append(tableBody, rows);
  Insert.append(tableElement, tableBody);

  return tableElement;
};
開發者ID:abstask,項目名稱:tinymce,代碼行數:9,代碼來源:SimpleTableModel.ts

示例7: next

  return Step.stateful(function (value, next, die) {
    const style = Element.fromTag('style');
    const head = Element.fromDom(doc.dom().head);
    Insert.append(head, style);
    Html.set(style, styles.join('\n'));

    next(Merger.deepMerge(value, {
      style
    }));
  });
開發者ID:abstask,項目名稱:tinymce,代碼行數:10,代碼來源:GuiSetup.ts

示例8: function

const paddEmptyBlock = function (elm) {
  if (Empty.isEmpty(elm)) {
    const br = Element.fromHtml('<br data-mce-bogus="1">');
    Remove.empty(elm);
    Insert.append(elm, br);
    return Option.some(CaretPosition.before(br.dom()));
  } else {
    return Option.none();
  }
};
開發者ID:tinymce,項目名稱:tinymce,代碼行數:10,代碼來源:DeleteElement.ts

示例9: rangeBefore

const insertBlock = (root: Element, forward: boolean, blockName: string, attrs: Record<string, string>) => {
  const block = Element.fromTag(blockName);
  const br = Element.fromTag('br');

  Attr.setAll(block, attrs);
  Insert.append(block, br);
  insertElement(root, block, forward);

  return rangeBefore(br);
};
開發者ID:danielpunkass,項目名稱:tinymce,代碼行數:10,代碼來源:ContentEndpointNavigation.ts

示例10: function

const addStyles = function () {
  const link = Element.fromTag('link');
  Attr.setAll(link, {
    rel: 'Stylesheet',
    href: '/project/js/tinymce/skins/lightgray/skin.mobile.min.css',
    type: 'text/css'
  });
  Class.add(link, styleClass);

  const head = Element.fromDom(document.head);
  Insert.append(head, link);
};
開發者ID:aha-app,項目名稱:tinymce-word-paste-filter,代碼行數:12,代碼來源:TestStyles.ts


注:本文中的@ephox/sugar.Insert.append方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。