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


TypeScript Plugin.default函数代码示例

本文整理汇总了TypeScript中tinymce/plugins/link/Plugin.default函数的典型用法代码示例。如果您正苦于以下问题:TypeScript default函数的具体用法?TypeScript default怎么用?TypeScript default使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: LinkPlugin

UnitTest.asynctest('browser.tinymce.plugins.link.DefaultLinkTargetTest', (success, failure) => {

  LinkPlugin();

  TinyLoader.setup(function (editor, onSuccess, onFailure) {
    const tinyApis = TinyApis(editor);

    Pipeline.async({}, [
      TestLinkUi.sClearHistory,
      Log.stepsAsStep('TBA', 'Link: does not add target if no default is set', [
        TestLinkUi.sInsertLink('http://www.google.com'),
        TestLinkUi.sAssertContentPresence(tinyApis, { 'a[target="_blank"]': 0, 'a': 1 }),
        tinyApis.sSetContent('')
      ]),
      Log.stepsAsStep('TBA', 'Link: adds target if default is set', [
        tinyApis.sSetSetting('default_link_target', '_blank'),
        TestLinkUi.sInsertLink('http://www.google.com'),
        TestLinkUi.sAssertContentPresence(tinyApis, { 'a[target="_blank"]': 1, 'a': 1 }),
        tinyApis.sSetContent('')
      ]),
      TestLinkUi.sClearHistory
    ], onSuccess, onFailure);
  }, {
    plugins: 'link',
    toolbar: 'link',
    theme: 'silver',
    base_url: '/project/js/tinymce'
  }, success, failure);
});
开发者ID:tinymce,项目名称:tinymce,代码行数:29,代码来源:DefaultLinkTargetTest.ts

示例2: function

UnitTest.asynctest('browser.tinymce.plugins.link.ContextToolbarTest', function () {
  const success = arguments[arguments.length - 2];
  const failure = arguments[arguments.length - 1];

  ModernTheme();
  LinkPlugin();

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

    Pipeline.async({}, [
      // no toolbar on by default
      tinyApis.sSetContent('<a href="http://www.google.com">google</a>'),
      Mouse.sTrueClickOn(TinyDom.fromDom(editor.getBody()), 'a'),
      UiFinder.sNotExists(TinyDom.fromDom(editor.getBody()), 'div[aria-label="Open link"]'),
      tinyApis.sSetContent(''),

      // only after setting set to true
      tinyApis.sSetSetting('link_context_toolbar', true),
      tinyApis.sSetContent('<a href="http://www.google.com">google</a>'),
      Mouse.sTrueClickOn(TinyDom.fromDom(editor.getBody()), 'a'),
      tinyUi.sWaitForUi('wait for open button', 'div[aria-label="Open link"]')
    ], onSuccess, onFailure);
  }, {
    plugins: 'link',
    toolbar: 'link',
    skin_url: '/project/js/tinymce/skins/lightgray'
  }, success, failure);
});
开发者ID:abstask,项目名称:tinymce,代码行数:30,代码来源:ContextToolbarTest.ts

示例3: function

UnitTest.asynctest('browser.tinymce.plugins.link.TargetListTest', function () {
  const success = arguments[arguments.length - 2];
  const failure = arguments[arguments.length - 1];

  ModernTheme();
  LinkPlugin();

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

    Pipeline.async({}, [
      // show target list by default
      tinyUi.sClickOnToolbar('click on link button', 'div[aria-label="Insert/edit link"] > button'),
      tinyUi.sWaitForPopup('wait for link dialog', 'div[aria-label="Insert link"][role="dialog"]'),
      UiFinder.sExists(TinyDom.fromDom(document.body), 'label:contains("Target")'),
      tinyUi.sClickOnUi('click on cancel', 'button:contains("Cancel")'),

      // but not when setting set to false
      tinyApis.sSetSetting('target_list', false),
      tinyUi.sClickOnToolbar('click on link button', 'div[aria-label="Insert/edit link"] > button'),
      tinyUi.sWaitForPopup('wait for link dialog', 'div[aria-label="Insert link"][role="dialog"]'),
      UiFinder.sNotExists(TinyDom.fromDom(document.body), 'label:contains("Target")'),
      tinyUi.sClickOnUi('click on cancel', 'button:contains("Cancel")')
    ], onSuccess, onFailure);
  }, {
    plugins: 'link',
    toolbar: 'link',
    skin_url: '/project/js/tinymce/skins/lightgray'
  }, success, failure);
});
开发者ID:aha-app,项目名称:tinymce-word-paste-filter,代码行数:31,代码来源:TargetListTest.ts

示例4: mobileTheme

UnitTest.asynctest('browser.tinymce.themes.mobile.ThemeTest', (success, failure) => {

  mobileTheme();
  ImagePlugin();
  TablePlugin();
  LinkPlugin();
  PastePlugin();
  ContextMenuPlugin();
  TextPatternPlugin();

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

    Pipeline.async({}, [
      UiFinder.sExists(Element.fromDom(document.body), `.${Styles.resolve('mask-tap-icon')}`),
      ui.sClickOnUi('Click the tap to edit button', `.${Styles.resolve('mask-tap-icon')}`),
      ui.sWaitForUi('Wait mobile Toolbar', `.${Styles.resolve('toolbar')}`),
      ui.sWaitForUi('Check for The first group', '[aria-label="The first group"]'),
      ui.sWaitForUi('Check for the action group', '[aria-label="the action group"]'),
      UiFinder.sNotExists(Element.fromDom(document.body), '[aria-label="The read only mode group"]'),
      UiFinder.sNotExists(Element.fromDom(document.body), `.${Styles.resolve('mask-edit-icon')}`),
      ui.sClickOnUi('Click back to Tap to Edit screen', `.${Styles.resolve('icon-back')}`),
      UiFinder.sExists(Element.fromDom(document.body), `.${Styles.resolve('mask-tap-icon')}`),
    ], onSuccess, onFailure);
  }, {
    theme: 'mobile',
    plugins: 'image table link paste textpattern',
    insert_toolbar: 'quickimage media quicktable',
    selection_toolbar: 'bold italic | quicklink h1 h2 blockquote',
    inline: false,
    base_url: '/project/tinymce/js/tinymce'
  }, success, failure);
});
开发者ID:tinymce,项目名称:tinymce,代码行数:33,代码来源:ThemeTest.ts

示例5: LinkPlugin

UnitTest.asynctest('browser.tinymce.plugins.link.SelectedLinkTest', (success, failure) => {

  LinkPlugin();

  TinyLoader.setup(function (editor, onSuccess, onFailure) {
    const tinyApis = TinyApis(editor);

    Pipeline.async({},
      Log.steps('TBA', 'Link: should not get anchor info if not selected node', [
        TestLinkUi.sClearHistory,
        tinyApis.sSetContent('<p><a href="http://tinymce.com">tiny</a></p>'),
        tinyApis.sSetSelection([0], 1, [0], 1),
        tinyApis.sExecCommand('mcelink'),
        TestLinkUi.sAssertDialogContents({
          href: '',
          text: '',
          title: '',
          target: ''
        }),
        TestLinkUi.sClearHistory
      ])
    , onSuccess, onFailure);
  }, {
    plugins: 'link',
    toolbar: '',
    theme: 'silver',
    base_url: '/project/tinymce/js/tinymce'
  }, success, failure);
});
开发者ID:tinymce,项目名称:tinymce,代码行数:29,代码来源:SelectedLinkTest.ts

示例6: function

UnitTest.asynctest('browser.plugin.IgnoreForcedPluginsTest', function () {
  const success = arguments[arguments.length - 2];
  const failure = arguments[arguments.length - 1];

  Theme();
  HelpPlugin();
  LinkPlugin();

  const sAssertPluginList = function (html) {
    return Chain.asStep(TinyDom.fromDom(document.body), [
      UiFinder.cWaitFor('Could not find notification', 'div.mce-floatpanel ul'),
      Chain.mapper(Html.get),
      Assertions.cAssertHtml('Plugin list html does not match', html)
    ]);
  };

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

    Pipeline.async({}, [
      tinyUi.sClickOnToolbar('click on button', 'button'),
      sAssertPluginList('<li><a href="https://www.tinymce.com/docs/plugins/help" target="_blank" rel="noopener">Help</a></li>')
    ], onSuccess, onFailure);
  }, {
    plugins: 'help link',
    toolbar: 'help',
    forced_plugins: ['link'],
    skin_url: '/project/js/tinymce/skins/lightgray'
  }, success, failure);
});
开发者ID:aha-app,项目名称:tinymce-word-paste-filter,代码行数:30,代码来源:IgnoreForcedPluginsTest.ts

示例7: HelpPlugin

UnitTest.asynctest('browser.plugin.IgnoreForcedPluginsTest', (success, failure) => {
  HelpPlugin();
  LinkPlugin();

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

    Pipeline.async({},
      Log.steps('TBA', 'Help: Hide forced plugins from Help plugin list', [
        Mouse.sClickOn(Element.fromDom(editor.getContainer()), Selectors.toolbarHelpButton),
        PluginAssert.sAssert(
          'Could not ignore forced plugin: link',
          {
            'li a:contains("Help")': 1,
            'li a:contains("Link")': 0
          },
          Selectors.dialog,
          Selectors.pluginsTab
        )
      ])
    , onSuccess, onFailure);
  }, {
    plugins: 'help',
    toolbar: 'help',
    theme: 'silver',
    forced_plugins: ['link'],
    base_url: '/project/tinymce/js/tinymce',
  }, success, failure);
});
开发者ID:tinymce,项目名称:tinymce,代码行数:29,代码来源:IgnoreForcedPluginsTest.ts

示例8: function

UnitTest.asynctest('browser.ClosedDialogScrollTest', function () {
  const success = arguments[arguments.length - 2];
  const failure = arguments[arguments.length - 1];

  InliteTheme();
  LinkPlugin();

  TinyLoader.setup(function (editor, onSuccess, onFailure) {
    const tinyApis = TinyApis(editor);
    const tinyActions = TinyActions(editor);
    Pipeline.async({}, [
      tinyApis.sFocus,
      tinyApis.sSetContent('<p style="height: 5000px">a</p><p>b</p>'),
      tinyApis.sSetSelection([1], 0, [1], 1),
      tinyActions.sContentKeystroke(Keys.space(), {}),
      Chain.asStep({}, [
        Toolbar.cWaitForToolbar,
        Toolbar.cClickButton('Insert/Edit link')
      ]),
      tinyActions.sUiKeydown(Keys.enter(), {}),
      Step.sync(function () {
        const offset = window.pageYOffset;

        RawAssertions.assertEq('Should not be at top', offset > 0, true);
      })
    ], onSuccess, onFailure);
  }, {
    theme: 'inlite',
    plugins: 'link',
    insert_toolbar: 'quickimage media quicktable',
    selection_toolbar: 'bold italic | quicklink h1 h2 blockquote',
    inline: true,
    skin_url: '/project/js/tinymce/skins/lightgray'
  }, success, failure);
});
开发者ID:aha-app,项目名称:tinymce-word-paste-filter,代码行数:35,代码来源:ClosedDialogScrollTest.ts

示例9: function

UnitTest.asynctest('browser.tinymce.plugins.link.SelectedLinkTest', function () {
  const success = arguments[arguments.length - 2];
  const failure = arguments[arguments.length - 1];

  ModernTheme();
  LinkPlugin();

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

    Pipeline.async({}, [
      Logger.t('should not get anchor info if not selected node', GeneralSteps.sequence([
        tinyApis.sSetContent('<p><a href="http://tinymce.com">tiny</a></p>'),
        tinyApis.sSetSelection([0], 1, [0], 1),
        tinyApis.sExecCommand('mcelink'),
        Chain.asStep({}, [
          tinyUi.cWaitForPopup('wait for link popup', 'div[role="dialog"][aria-label="Insert link"]'),
          UiFinder.cFindIn('label:contains("Url") + div > input'),
          UiControls.cGetValue,
          Assertions.cAssertEq('assert value is nothing', '')
        ])
      ]))
    ], onSuccess, onFailure);
  }, {
    plugins: 'link',
    toolbar: '',
    skin_url: '/project/js/tinymce/skins/lightgray'
  }, success, failure);
});
开发者ID:abstask,项目名称:tinymce,代码行数:30,代码来源:SelectedLinkTest.ts

示例10: ModernTheme

UnitTest.asynctest('browser.tinymce.plugins.link.UrlInputTest', (success, failure) => {
  ModernTheme();
  LinkPlugin();

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

    Pipeline.async({}, [
      Logger.t('insert url by typing', GeneralSteps.sequence([
        tinyUi.sClickOnToolbar('click on link button', 'div[aria-label="Insert/edit link"] > button'),
        Chain.asStep({}, [
          Chain.fromParent(tinyUi.cWaitForPopup('Wait for dialog', 'div[role="dialog"]'),
            [
              Chain.fromChains([
                UiFinder.cFindIn('div > label:contains("Url") + div > input'),
                UiControls.cSetValue('http://www.test.com/'),
                cFakeEvent('keyup')
              ]),
              Chain.fromChains([
                UiFinder.cFindIn('label:contains("Text to display") + input'),
                UiControls.cGetValue,
                Assertions.cAssertEq('should be the same url', 'http://www.test.com/')
              ]),
              cCloseDialog
            ]
          )
        ])

      ])),
      Logger.t('insert url by pasting', GeneralSteps.sequence([
        tinyUi.sClickOnToolbar('click on link button', 'div[aria-label="Insert/edit link"] > button'),
        Chain.asStep({}, [
          Chain.fromParent(tinyUi.cWaitForPopup('Wait for dialog', 'div[role="dialog"]'),
            [
              Chain.fromChains([
                UiFinder.cFindIn('div > label:contains("Url") + div > input'),
                UiControls.cSetValue('http://www.test.com/'),
                cFakeEvent('paste')
              ]),
              Chain.fromChains([
                UiFinder.cFindIn('label:contains("Text to display") + input'),
                UiControls.cGetValue,
                Assertions.cAssertEq('should be the same url', 'http://www.test.com/')
              ]),
              cCloseDialog
            ]
          )
        ])

      ]))
    ], onSuccess, onFailure);
  }, {
    plugins: 'link',
    toolbar: 'link',
    skin_url: '/project/js/tinymce/skins/lightgray'
  }, success, failure);
});
开发者ID:abstask,项目名称:tinymce,代码行数:57,代码来源:UrlInputTest.ts


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