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


TypeScript agar.UiControls类代码示例

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


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

示例1: TinyUi

  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);
  }, {
开发者ID:abstask,项目名称:tinymce,代码行数:48,代码来源:UrlInputTest.ts

示例2: TinyApis

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

    Pipeline.async({}, [
      tinyApis.sFocus,
      tinyApis.sSetContent('<p>abc 123</p>'),
      tinyApis.sSetSelection([0, 0], 4, [0, 0], 7),
      tinyActions.sContentKeystroke(Keys.space(), {}),
      tinyApis.sExecCommand('mceanchor'),
      Chain.asStep(Element.fromDom(document.body), [
        Chain.fromParent(UiFinder.cWaitForVisible('wait for dialog', 'div[aria-label="Anchor"][role="dialog"]'),
          [
            Chain.fromChains([
              UiFinder.cFindIn('input'),
              UiControls.cSetValue('abc')
            ]),
            Chain.fromChains([
              UiFinder.cFindIn('button:contains("Ok")'),
              Mouse.cClick
            ])
          ]
        )
      ]),
      tinyApis.sAssertContent('<p>abc <a id="abc"></a>123</p>')

    ], onSuccess, onFailure);
  }, {
开发者ID:aha-app,项目名称:tinymce-word-paste-filter,代码行数:28,代码来源:AnchorInlineTest.ts

示例3: function

const sPasteTextareaValue = function (ui, value) {
  return Chain.asStep({}, [
    cFindTextarea(ui, 'Paste your embed code below:'),
    UiControls.cSetValue(value),
    cFakeEvent('paste')
  ]);
};
开发者ID:danielpunkass,项目名称:tinymce,代码行数:7,代码来源:Utils.ts

示例4: TinyApis

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

    Pipeline.async({},
      Log.steps('TBA', 'Anchor: Add anchor by selecting text content, then check that anchor is inserted correctly', [
        tinyApis.sFocus,
        tinyApis.sSetContent('<p>abc 123</p>'),
        tinyApis.sSetSelection([0, 0], 4, [0, 0], 7),
        tinyActions.sContentKeystroke(Keys.space(), {}),
        tinyApis.sExecCommand('mceanchor'),
        Chain.asStep(Element.fromDom(document.body), [
          Chain.fromParent(UiFinder.cWaitForVisible('wait for dialog', 'div[role="dialog"].tox-dialog'),
            [
              Chain.fromChains([
                UiFinder.cFindIn('input'),
                UiControls.cSetValue('abc')
              ]),
              Chain.fromChains([
                UiFinder.cFindIn('button:contains("Save")'),
                Mouse.cClick
              ])
            ]
          )
        ]),
        tinyApis.sAssertContent('<p>abc <a id="abc"></a>123</p>')
    ])
    , onSuccess, onFailure);
  }, {
开发者ID:tinymce,项目名称:tinymce,代码行数:29,代码来源:AnchorInlineTest.ts

示例5:

const cSetInputValue = (section, newValue) =>  Chain.control(
  Chain.fromChains([
    UiFinder.cFindIn(`label:contains(${section}) + div > input`),
    UiControls.cSetValue(newValue)
  ]),
  Guard.addLogging('Set input value' + newValue)
);
开发者ID:tinymce,项目名称:tinymce,代码行数:7,代码来源:TableTestUtils.ts

示例6: function

const cSetSourceInput = function (ui, value) {
  return Chain.control(
    Chain.fromChains([
      cFindFilepickerInput(ui),
      UiControls.cSetValue(value)
    ]),
    Guard.addLogging(`Set source input ${value}`)
  );
};
开发者ID:tinymce,项目名称:tinymce,代码行数:9,代码来源:Utils.ts

示例7: cFindInDialog

const cSetValueOn = (selector: string, newValue: any) => (ui) => {
  return Chain.control(
    Chain.fromChains([
      cFindInDialog(selector)(ui),
      UiControls.cSetValue(newValue)
    ]),
    Guard.addLogging('Set value')
  );
};
开发者ID:tinymce,项目名称:tinymce,代码行数:9,代码来源:Utils.ts

示例8: TinyApis

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

    Pipeline.async({},
      Log.steps('TBA', 'SearchReplace: replace one of three found, undo and redo and assert there is no matcher spans in editor', [
        tinyApis.sSetContent('<p>cats cats cats</p>'),
        tinyUi.sClickOnToolbar('click on searchreplace button', 'button[aria-label="Find and replace"]'),
        Chain.asStep({}, [
          Chain.fromParent(tinyUi.cWaitForPopup('wait for dialog', 'div[role="dialog"]'), [
            Chain.fromChains([
              UiFinder.cFindIn('label:contains("Find") + input'),
              UiControls.cSetValue('cats')
            ]),
            Chain.fromChains([
              UiFinder.cFindIn('label:contains("Replace with") + input'),
              UiControls.cSetValue('dogs')
            ]),
            Chain.fromChains([
              UiFinder.cFindIn('button:contains("Find")'),
              Mouse.cClick
            ]),
            Chain.fromChains([
              UiFinder.cWaitFor('wait for button to be enabled', 'button[disabled!="disabled"]:contains("Replace")')
            ]),
            Chain.fromChains([
              UiFinder.cFindIn('button:contains("Replace")'),
              Mouse.cClick
            ]),
            Chain.fromChains([
              UiFinder.cFindIn('button[aria-label="Close"]'),
              Mouse.cClick
            ])
          ])
        ]),
        sUndo(editor),
        tinyApis.sAssertContent('<p>cats cats cats</p>'),
        sRedo(editor),
        tinyApis.sAssertContentPresence({ 'span.mce-match-marker': 0 }),
        tinyApis.sAssertContent('<p>dogs cats cats</p>')
      ])
    , onSuccess, onFailure);
  }, {
开发者ID:tinymce,项目名称:tinymce,代码行数:43,代码来源:UndoReplaceSpanTest.ts


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