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


TypeScript Chain.on方法代碼示例

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


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

示例1: next

const cOpFromChains = (chains: Chain<any, any>[]) => Chain.control(
  // TODO: Another API case.
  Chain.on((value, next, die, logs) => {
    Chain.pipeline([Chain.inject(value)].concat(chains), (_, newLogs) => next(Chain.wrap(value), newLogs), die, logs);
  }),
  Guard.addLogging('Chain operations')
);
開發者ID:tinymce,項目名稱:tinymce,代碼行數:7,代碼來源:Helpers.ts

示例2: function

 const cAssertDialogContents = function (data) {
   return Chain.on(function (element, next, die) {
     getDialogByElement(element).fold(die, function (win) {
       Assertions.assertEq('asserting dialog contents', data, win.toJSON());
       next(Chain.wrap(element));
     });
   });
 };
開發者ID:abstask,項目名稱:tinymce,代碼行數:8,代碼來源:AllowUnsafeLinkTargetTest.ts

示例3: function

 const cFindChildWithState = function (selector, predicate) {
   return Chain.on(function (scope, next, die) {
     const children = PredicateFilter.descendants(scope, function (element) {
       return Selectors.is(element, selector) && predicate(element);
     });
     children.length ? next(Chain.wrap(children[0])) : die();
   });
 };
開發者ID:abstask,項目名稱:tinymce,代碼行數:8,代碼來源:ImageOps.ts

示例4: function

  const cValidateBookmark = function (rootPath) {
    return Chain.on(function (input, next, die) {
      const root = Hierarchy.follow(Element.fromDom(viewBlock.get()), rootPath).getOrDie();

      return input.each(function (b) {
        return next(Chain.wrap(SelectionBookmark.validate(root, b)));
      });
    });
  };
開發者ID:abstask,項目名稱:tinymce,代碼行數:9,代碼來源:SelectionBookmarkTest.ts

示例5: function

  const cAssertEditorDimension = function (dimension, value) {
    return Chain.on(function (editor, next, die) {
      const container = editor.iframeElement;
      const getter = dimension === 'width' ? Width.get : Height.get;
      const actualValue = typeof value === 'string' ? container.style[dimension] : getter(Element.fromDom(container));

      Assertions.assertEq('Editors content area has expected ' + dimension, value, actualValue);

      next(Chain.wrap(editor));
    });
  };
開發者ID:abstask,項目名稱:tinymce,代碼行數:11,代碼來源:DimensionsTest.ts

示例6: function

 const cPopupToDialog = function (selector) {
   return Chain.fromChains([
     ui.cWaitForPopup('Locate popup', selector),
     Chain.on(function (container, next, die) {
       return Arr.find(editor.windowManager.getWindows(), function (win) {
         return container.dom().id === win._id;
       }).fold(die, function (win) {
         next(Chain.wrap(win));
       });
     })
   ]);
 };
開發者ID:abstask,項目名稱:tinymce,代碼行數:12,代碼來源:UploadTabTest.ts

示例7: function

  const cCreateInlineEditor = function (html) {
    return Chain.on(function (viewBlock, next, die) {
      viewBlock.update(html);

      EditorManager.init({
        selector: '.tinymce-editor',
        inline: true,
        skin_url: '/project/js/tinymce/skins/lightgray',
        setup (editor) {
          editor.on('SkinLoaded', function () {
            next(Chain.wrap(editor));
          });
        }
      });
    });
  };
開發者ID:abstask,項目名稱:tinymce,代碼行數:16,代碼來源:EditorFocusTest.ts

示例8: function

  const cCreateInlineEditor = function (settings) {
    return Chain.on(function (viewBlock, next, die) {
      viewBlock.update('<div id="inline-tiny"></div>');

      EditorManager.init(Merger.merge({
        selector: '#inline-tiny',
        inline: true,
        skin_url: '/project/js/tinymce/skins/lightgray',
        setup (editor) {
          editor.on('SkinLoaded', function () {
            next(Chain.wrap(editor));
          });
        }
      }, settings));
    });
  };
開發者ID:aha-app,項目名稱:tinymce-word-paste-filter,代碼行數:16,代碼來源:PasteSettingsTest.ts

示例9: function

  const cFromSettings = function (settings, html) {
    return Chain.on(function (_, next, die) {
      const randomId = Id.generate('tiny-loader');
      settings = settings || {};
      const target = Element.fromHtml(html);

      Attr.set(target, 'id', randomId);
      Insert.append(Element.fromDom(document.body), target);

      EditorManager.init(Merger.merge(settings, {
        selector: '#' + randomId,
        init_instance_callback (editor) {
          setTimeout(function () {
            next(Chain.wrap(editor));
          }, 0);
        }
      }));
    });
  };
開發者ID:aha-app,項目名稱:tinymce-word-paste-filter,代碼行數:19,代碼來源:TableAsBodyTest.ts


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