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


TypeScript Attr.setAll方法代码示例

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


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

示例1: function

const createIframeElement = function (id: string, title: TranslatedString, height: number, customAttrs: {}) {
  const iframe = Element.fromTag('iframe');

  Attr.setAll(iframe, customAttrs);

  Attr.setAll(iframe, {
    id: id + '_ifr',
    frameBorder: '0',
    allowTransparency: 'true',
    title
  });

  Class.add(iframe, 'tox-edit-area__iframe');

  return iframe;
};
开发者ID:tinymce,项目名称:tinymce,代码行数:16,代码来源:InitIframe.ts

示例2: function

 }, function (link) {
   const text = getTextToApply(link, url, info);
   Attr.setAll(link, attrs);
   text.each(function (newText) {
     TextContent.set(link, newText);
   });
 });
开发者ID:abstask,项目名称:tinymce,代码行数:7,代码来源:LinkBridge.ts

示例3: 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

示例4: function

const createIframeElement = function (id, title, height, customAttrs) {
  const iframe = Element.fromTag('iframe');

  Attr.setAll(iframe, customAttrs);

  Attr.setAll(iframe, {
    id: id + '_ifr',
    frameBorder: '0',
    allowTransparency: 'true',
    title
  });

  Css.setAll(iframe, {
    width: '100%',
    height: normalizeHeight(height),
    display: 'block' // Important for Gecko to render the iframe correctly
  });

  return iframe;
};
开发者ID:mdgbayly,项目名称:tinymce,代码行数:20,代码来源:InitIframe.ts

示例5: decorate

const makeAnnotation = (eDoc: Document, { uid = Id.generate('mce-annotation'), ...data }, annotationName: string, decorate: Decorator): Element => {
  const master = Element.fromTag('span', eDoc);
  Class.add(master, Markings.annotation());
  Attr.set(master, `${Markings.dataAnnotationId()}`, uid);
  Attr.set(master, `${Markings.dataAnnotation()}`, annotationName);

  const { attributes = { }, classes = [ ] } = decorate(uid, data);
  Attr.setAll(master, attributes);
  Classes.add(master, classes);
  return master;
};
开发者ID:danielpunkass,项目名称:tinymce,代码行数:11,代码来源:Wrapping.ts

示例6: 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

示例7: function

const createIframeElement = function (id, title, height, customAttrs) {
  const iframe = Element.fromTag('iframe');

  Attr.setAll(iframe, customAttrs);

  // Workaround WebKit regression in which findFrameNamed: no longer works to find the TinyMCE editor frame by it's ID,
  // because the frame's name is only considered to be set by the name attribute. See: https://bugs.webkit.org/show_bug.cgi?id=187937
  // Need to define "name" below to accommodate it.
  Attr.setAll(iframe, {
    id: id + '_ifr',
    name: id + '_ifr',
    frameBorder: '0',
    allowTransparency: 'true',
    title
  });

  Css.setAll(iframe, {
    width: '100%',
    height: normalizeHeight(height),
    display: 'block' // Important for Gecko to render the iframe correctly
  });

  return iframe;
};
开发者ID:danielpunkass,项目名称:tinymce,代码行数:24,代码来源:InitIframe.ts

示例8: function

const createCaretContainer = function (fill) {
  const caretContainer = Element.fromTag('span');

  Attr.setAll(caretContainer, {
    // style: 'color:red',
    'id': CARET_ID,
    'data-mce-bogus': '1',
    'data-mce-type': 'format-caret'
  });

  if (fill) {
    Insert.append(caretContainer, Element.fromText(ZWSP));
  }

  return caretContainer;
};
开发者ID:abstask,项目名称:tinymce,代码行数:16,代码来源:CaretFormat.ts

示例9: moveToRange

    editor.undoManager.transact(() => {
      const element = SugarElement.fromTag(forcedRootBlock);
      Attr.setAll(element, Settings.getForcedRootBlockAttrs(editor));
      Insert.append(element, SugarElement.fromTag('br'));

      if (down) {
        Insert.after(SugarElement.fromDom(table), element);
      } else {
        Insert.before(SugarElement.fromDom(table), element);
      }

      const rng = editor.dom.createRng();
      rng.setStart(element.dom(), 0);
      rng.setEnd(element.dom(), 0);
      moveToRange(editor, rng);
    });
开发者ID:danielpunkass,项目名称:tinymce,代码行数:16,代码来源:TableNavigation.ts

示例10: function

  const onload = DomEvent.bind(iframe, 'load', function () {
    const head = Element.fromDom(iframe.dom().contentWindow.document.head);
    const body = Element.fromDom(iframe.dom().contentWindow.document.body);
    Attachment.attachSystem(body, realm.system());

    Css.set(body, 'margin', '0px');

    const css = Element.fromTag('link');
    Attr.setAll(css, {
      href: '/project/tinymce/js/tinymce/skins/ui/oxide/skin.mobile.min.css',
      rel: 'Stylesheet',
      type: 'text/css'
    });
    Insert.append(head, css);
    onload.unbind();

    const editor = Element.fromTag('iframe');
    Attr.set(editor, 'src', '/project/tinymce/src/themes/mobile/test/html/editor.html');
    Replacing.append(
      realm.system().getByDom(Element.fromDom(
        realm.element().dom().querySelector('.tinymce-mobile-editor-socket'))
      ).getOrDie(),
      GuiFactory.external({
        element: editor
      })
    );

    realm.init({
      editor: {
        getFrame () {
          return editor;
        },
        onDomChanged () {
          return { unbind: Fun.noop };
        }
      },
      container: realm.element(),
      socket: Element.fromDom(realm.element().dom().querySelector('.tinymce-mobile-editor-socket')),
      toolstrip: Element.fromDom(realm.element().dom().querySelector('.tinymce-mobile-toolstrip')),
      toolbar: Element.fromDom(realm.element().dom().querySelector('.tinymce-mobile-toolbar')),
      alloy: realm.system(),
      dropup: realm.dropup()
    });
  });
开发者ID:tinymce,项目名称:tinymce,代码行数:44,代码来源:IosRealmTest.ts


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