当前位置: 首页>>代码示例>>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;未经允许,请勿转载。