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