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


TypeScript Chain.inject方法代碼示例

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


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

示例1:

 const cAssertFullscreenClass = (label, shouldExist) => {
   const selector = shouldExist ? 'root:.tox-fullscreen' : 'root::not(.tox-fullscreen)';
   const label2 = `Body and Html should ${shouldExist ? '' : 'not '}have "tox-fullscreen" class`;
   return Chain.control(
     Chain.fromChains([
       Chain.inject(Body.body()),
       UiFinder.cFindIn(selector),
       Chain.inject(Element.fromDom(document.documentElement)),
       UiFinder.cFindIn(selector)
     ]),
     Guard.addLogging(`${label}: ${label2}`)
   );
 };
開發者ID:tinymce,項目名稱:tinymce,代碼行數:13,代碼來源:FullScreenPluginTest.ts

示例2: Plugin

UnitTest.asynctest('browser.tinymce.plugins.media.NoAdvancedTabTest', (success, failure) => {
  Plugin();
  Theme();

  Pipeline.async({}, [
    Log.chainsAsStep('TBA', 'Media: if alt source and poster set to false, do not show advance tab', [
      Chain.fromParent(
        Editor.cFromSettings({
          plugins: ['media'],
          toolbar: 'media',
          media_alt_source: false,
          media_poster: false,
          theme: 'silver',
          base_url: '/project/tinymce/js/tinymce'
        }),
        [
          Chain.fromChains([
            UiChains.cClickOnToolbar('click button', 'button[aria-label="Insert/edit media"]'),
            Chain.inject(Body.body()),
            UiFinder.cWaitForVisible('wait for popup', 'div.tox-dialog'),
            Utils.cNotExists('div.tox-tab:contains(Advanced)')
          ]),
          Editor.cRemove
        ]
      )
    ]),
    Log.chainsAsStep('TBA', 'Media: if alt source and poster not set to false, show advance tab', [
      Chain.fromParent(
        Editor.cFromSettings({
          plugins: ['media'],
          toolbar: 'media',
          theme: 'silver',
          base_url: '/project/tinymce/js/tinymce'
        }),
        [
          Chain.fromChains([
            UiChains.cClickOnToolbar('click button', 'button[aria-label="Insert/edit media"]'),
            Chain.inject(Body.body()),
            UiFinder.cWaitForVisible('wait for popup', 'div.tox-dialog'),
            Utils.cExists('div.tox-tab:contains(Advanced)')
          ]),
          Editor.cRemove
        ]
      )
    ])
  ], () => success(), failure);

});
開發者ID:tinymce,項目名稱:tinymce,代碼行數:48,代碼來源:NoAdvancedTabTest.ts

示例3:

const cGetInput = (selector: string) => Chain.control(
  Chain.fromChains([
    Chain.inject(Body.body()),
    UiFinder.cFindIn(selector)
  ]),
  Guard.addLogging('Get input')
);
開發者ID:tinymce,項目名稱:tinymce,代碼行數:7,代碼來源:TestLinkUi.ts

示例4: TinyUi

  TinyLoader.setup(function (editor, onSuccess, onFailure) {
    const tinyUi = TinyUi(editor);

    Pipeline.async({}, [
      Log.stepsAsStep('TBA', 'Image: image proportion constrains should work directly', [
        tinyUi.sClickOnToolbar('click image button', 'button[aria-label="Insert/edit image"]'),
        Chain.asStep({}, [
          Chain.fromParent(tinyUi.cWaitForPopup('Wait for dialog', 'div[role="dialog"]'),
            [
              Chain.fromChains([
                UiFinder.cFindIn('button.tox-browse-url'),
                Mouse.cClick
              ]),
              Chain.control(
                cAssertInputValue(generalTabSelectors.width, '1'),
                Guard.tryUntil('did not find width input with value 1', 10, 1000)
              ),
              cSetInputValue(generalTabSelectors.height, '5'),
              Chain.control(
                cAssertInputValue(generalTabSelectors.width, '5'),
                Guard.tryUntil('did not find width input with value 5', 10, 1000)
              ),
            ]
          ),
          tinyUi.cSubmitDialog(),
          Chain.inject(editor),
          cAssertCleanHtml('Checking output', '<p><img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" alt="" width="5" height="5" /></p>')
        ])
      ])

    ], onSuccess, onFailure);
  }, {
開發者ID:tinymce,項目名稱:tinymce,代碼行數:32,代碼來源:ImageResizeTest.ts

示例5: SilverTheme

UnitTest.asynctest('Image recognizes relative src url and prepends relative image_prepend_url setting.', (success, failure) => {
  SilverTheme();
  ImagePlugin();
  const prependUrl = 'testing/images/';
  Pipeline.async({}, [
    Log.chainsAsStep('TBA', 'Image: image recognizes relative src url and prepends relative image_prepend_url setting.', [
      Editor.cFromSettings({
        ...silverSettings,
        image_prepend_url: prependUrl
      }),
      cExecCommand('mceImage', true),
      cWaitForDialog(),
      cFillActiveDialog({
        src: {
          value: 'src'
        },
        alt: 'alt'
      }),
      cOpFromChains([
        Chain.inject(Body.body()),
        UiFinder.cFindIn(generalTabSelectors.src),
        cFakeEvent('change')
      ]),
      cSubmitDialog(),
      cAssertCleanHtml('Checking output', '<p><img src="' + prependUrl + 'src" alt="alt" /></p>'),
      Editor.cRemove
    ])
  ], () => success(), failure);
});
開發者ID:tinymce,項目名稱:tinymce,代碼行數:29,代碼來源:PrependRelativeTest.ts

示例6: Plugin

UnitTest.asynctest('browser.tinymce.plugins.media.NoAdvancedTabTest', (success, failure) => {
  Plugin();
  Theme();

  Pipeline.async({}, [
    Logger.t('if alt source and poster set to false, do not show advance tab', Chain.asStep({}, [
      Chain.fromParent(
        Editor.cFromSettings({
          plugins: ['media'],
          toolbar: 'media',
          media_alt_source: false,
          media_poster: false,
          skin_url: '/project/js/tinymce/skins/lightgray'
        }),
        [
          Chain.fromChains([
            UiChains.cClickOnToolbar('click button', 'div[aria-label="Insert/edit media"]'),
            Chain.inject(Body.body()),
            UiFinder.cWaitForVisible('wait for popup', 'div.mce-floatpanel[aria-label="Insert/edit media"]'),
            cNotExists('div.mce-tab:contains("Advanced")')
          ]),
          Editor.cRemove
        ]
      )
    ])),
    Logger.t('if alt source and poster not set to false, show advance tab', Chain.asStep({}, [
      Chain.fromParent(
        Editor.cFromSettings({
          plugins: ['media'],
          toolbar: 'media',
          skin_url: '/project/js/tinymce/skins/lightgray'
        }),
        [
          Chain.fromChains([
            UiChains.cClickOnToolbar('click button', 'div[aria-label="Insert/edit media"]'),
            Chain.inject(Body.body()),
            UiFinder.cWaitForVisible('wait for popup', 'div.mce-floatpanel[aria-label="Insert/edit media"]'),
            cExists('div.mce-tab:contains("Advanced")')
          ]),
          Editor.cRemove
        ]
      )
    ]))
  ], () => success(), failure);

});
開發者ID:danielpunkass,項目名稱:tinymce,代碼行數:46,代碼來源:NoAdvancedTabTest.ts

示例7: function

 const sDragDropBlocker = function (container, selector, dx, dy) {
   return Chain.asStep({}, [
     Chain.fromParent(Chain.inject(container), [
       Chain.fromChains([
         UiFinder.cFindIn(selector),
         Mouse.cMouseDown
       ]),
       Chain.fromChains([
         UiFinder.cFindIn('div.ephox-dragster-blocker'),
         Mouse.cMouseMove,
         Mouse.cMouseMoveTo(dx, dy),
         Mouse.cMouseUpTo(dx, dy)
       ])
     ])
   ]);
 };
開發者ID:aha-app,項目名稱:tinymce-word-paste-filter,代碼行數:16,代碼來源:DragResizeTest.ts

示例8: if

const cSetFieldValue = (selector, value) => {
  return Chain.fromChains([
    Chain.inject(Body.body()),
    UiFinder.cFindIn(selector),
    Chain.op(Focus.focus),
    Chain.op((element) => {
      if (element.dom().type === 'checkbox') {
        Checked.set(element, value);
      } else if (Node.name(element) === 'select' && typeof value === 'number') {
        SelectTag.setSelected(element, value);
      } else {
        Value.set(element, value);
      }
    })
  ]);
};
開發者ID:tinymce,項目名稱:tinymce,代碼行數:16,代碼來源:Helpers.ts

示例9:

 const sDragDropBlocker = (container, selector, dx, dy) => {
   return Logger.t('Block dragging and dropping of any other element in the container', Chain.asStep({}, [
     Chain.fromParent(Chain.inject(container), [
       Chain.fromChains([
         UiFinder.cFindIn(selector),
         Mouse.cMouseDown
       ]),
       Chain.fromChains([
         UiFinder.cFindIn('div.ephox-dragster-blocker'),
         Mouse.cMouseMove,
         Mouse.cMouseMoveTo(dx, dy),
         Mouse.cMouseUpTo(dx, dy)
       ])
     ])
   ]));
 };
開發者ID:tinymce,項目名稱:tinymce,代碼行數:16,代碼來源:DragResizeTest.ts


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