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


TypeScript Step.raw方法代码示例

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


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

示例1: Plugin

UnitTest.asynctest('browser.tinymce.plugins.table.InlineEditorInsideTableTest', (success, failure) => {
  Plugin();
  SilverTheme();

  const containerHtml = '<table>' +
  '<tbody>' +
  '<tr>' +
  '<td>' +
  '<div class="tinymce" style="border: 1px gray solid">a</div>' +
  '</td>' +
  '</tr>' +
  '</tbody>' +
  '</table>';

  const cOnSelector = function (selector) {
    return Chain.control(
      Chain.async(function (_, next) {
        EditorManager.init({
          selector,
          inline: true,
          theme: 'silver',
          statusbar: false,
          menubar: false,
          plugins: 'table',
          skin_url: '/project/tinymce/js/tinymce/skins/ui/oxide',
          content_css: '/project/tinymce/js/tinymce/skins/content/default',
          setup (editor) {
            editor.on('SkinLoaded', function () {
                Delay.setTimeout(function () {
                    next(editor);
                }, 0);
            });
        }
        });
      }),
      Guard.addLogging('Add editor settings')
    );
  };

  const cNotExists = (container, selector) => {
    return Chain.control(
      Chain.op(() => {
        UiFinder.findIn(container, selector).fold(
          () => RawAssertions.assertEq('should not find anything', true, true),
          () => RawAssertions.assertEq('Expected ' + selector + ' not to exist.', true, false)
        );
      }),
      Guard.addLogging('Assert ' + selector + ' does not exist')
    );
  };

  const step = Step.raw((_, next, die, initLogs) => {
    NamedChain.pipeline([
      NamedChain.write('container', Chain.async((input, n, die) => {
        const container = Element.fromTag('div');
        Attr.set(container, 'id', 'test-container-div');
        Html.set(container, containerHtml);
        Insert.append(Body.body(), container);
        n(container);
      })),
      NamedChain.write('editor', cOnSelector('div.tinymce')),
      NamedChain.direct('container', Chain.fromChains([
        UiFinder.cFindIn('div.tinymce'),
        Mouse.cMouseOver,
        cNotExists(Body.body(), 'div[data-row="0"]')
      ]), '_'),
      NamedChain.read('editor', Editor.cRemove),
      NamedChain.read('container', Chain.op((div) => Remove.remove(div)))
    ], next, die, initLogs);
  });

  Pipeline.async({}, [
    Log.step('TBA', 'Table: Table outside of inline editor should not become resizable', step)
  ], () => success(), failure, TestLogs.init());
  });
开发者ID:tinymce,项目名称:tinymce,代码行数:75,代码来源:InlineEditorInsideTableTest.ts


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