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