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


TypeScript sugar.Attr類代碼示例

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


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

示例1: function

const wasSimple = function (link) {
  const prevHref = Attr.get(link, 'href');
  const prevText = TextContent.get(link);
  return prevHref === prevText;
};
開發者ID:danielpunkass,項目名稱:tinymce,代碼行數:5,代碼來源:LinkBridge.ts

示例2: function

 Arr.each(dataStyleCells, function (cell) {
   Attr.remove(cell, 'data-mce-style');
 });
開發者ID:danielpunkass,項目名稱:tinymce,代碼行數:3,代碼來源:Util.ts

示例3: function

 const maximize = function () {
   Attr.set(element, 'content', 'width=device-width, initial-scale=1.0, user-scalable=no, maximum-scale=1.0');
 };
開發者ID:aha-app,項目名稱:tinymce-word-paste-filter,代碼行數:3,代碼來源:MetaViewport.ts

示例4: function

export default function () {
  const frame = Element.fromTag('iframe');
  Attr.set(frame, 'src', '/project/src/themes/mobile/test/html/editor.html');

  const config = {
    getFrame () {
      return frame;
    },
    onDomChanged () {
      return { unbind: Fun.noop };
    }
  };

  const delegate = TestEditor();
  const dEditor = delegate.editor();

  const editor = {
    selection: {
      getStart () {
        return WindowSelection.getExact(frame.dom().contentWindow).map(function (sel) {
          return sel.start().dom();
        }).getOr(null);
      },
      getContent () {
        return frame.dom().contentWindow.document.body.innerHTML;
      },
      select: Fun.noop
    },

    getBody () {
      return frame.dom().contentWindow.document.body;
    },

    insertContent: dEditor.insertContent,
    execCommand: dEditor.execCommand,
    dom: dEditor.dom,
    // Maybe this should be implemented
    focus () {
      Focus.focus(frame);
      const win = frame.dom().contentWindow;
      WindowSelection.getExact(win).orThunk(function () {
        const fbody = Element.fromDom(frame.dom().contentWindow.document.body);
        const elem = Cursors.calculateOne(fbody, [ 0 ]);
        WindowSelection.setExact(win, elem, 0, elem, 0);
      });
    }
  };

  const component = GuiFactory.build(
    GuiFactory.external({
      element: frame
    })
  );

  return {
    component: Fun.constant(component),
    config: Fun.constant(config),
    editor: Fun.constant(editor),
    adder: delegate.adder,
    assertEq: delegate.assertEq,
    sAssertEq: delegate.sAssertEq,
    sClear: delegate.sClear,
    sPrepareState: delegate.sPrepareState
  };
}
開發者ID:aha-app,項目名稱:tinymce-word-paste-filter,代碼行數:65,代碼來源:TestFrameEditor.ts

示例5: cWaitForState

 cWaitForState(function (el) {
   return Attr.get(el, 'src') !== origUrl;
 })
開發者ID:aha-app,項目名稱:tinymce-word-paste-filter,代碼行數:3,代碼來源:ImageOps.ts

示例6: function

 return Arr.bind(SelectorFilter.descendants(Element.fromDom(document), 'link'), function (link) {
   const href = Attr.get(link, 'href');
   const fileName = href.split('/').slice(-1).join('');
   const isSkin = href.indexOf('lightgray/') > -1;
   return isSkin ? [ fileName ] : [ ];
 });
開發者ID:danielpunkass,項目名稱:tinymce,代碼行數:6,代碼來源:EditorInitializationTest.ts

示例7: function

 const finish = function (/* dest */) {
   element.dom().scrollTop = destination;
   Attr.set(element, lastScroll, destination);
   callback(destination);
 };
開發者ID:danielpunkass,項目名稱:tinymce,代碼行數:5,代碼來源:IosScrolling.ts

示例8:

 memInvalidIcon.getOpt(comp).each((invalidComp) => {
   Attr.set(invalidComp.element(), 'title', providersBackstage.translate(err));
 });
開發者ID:tinymce,項目名稱:tinymce,代碼行數:3,代碼來源:UrlInput.ts

示例9: function

const setLastHeight = function (cBody, value) {
  Attr.set(cBody, data, value);
};
開發者ID:abstask,項目名稱:tinymce,代碼行數:3,代碼來源:AndroidSetup.ts


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