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


TypeScript Keys.space方法代碼示例

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


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

示例1: TinyApis

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

    Pipeline.async({}, [
      Logger.t('Press space at beginning of inline boundary', GeneralSteps.sequence([
        tinyApis.sFocus,
        tinyApis.sSetContent('<p>a <a href="#">b</a> c</p>'),
        tinyApis.sSetCursor([0, 1, 0], 0),
        tinyApis.sNodeChanged,
        tinyActions.sContentKeystroke(Keys.space(), {}),
        tinyApis.sAssertSelection([0, 1, 0], 1, [0, 1, 0], 1),
        tinyApis.sAssertContent('<p>a <a href="#">&nbsp;b</a> c</p>')
      ])),
      Logger.t('Press space at end of inline boundary', GeneralSteps.sequence([
        tinyApis.sFocus,
        tinyApis.sSetContent('<p>a <a href="#">b</a> c</p>'),
        tinyApis.sSetCursor([0, 1, 0], 1),
        tinyApis.sNodeChanged,
        tinyActions.sContentKeystroke(Keys.space(), {}),
        tinyApis.sAssertSelection([0, 1, 0], 2, [0, 1, 0], 2),
        tinyApis.sAssertContent('<p>a <a href="#">b&nbsp;</a> c</p>')
      ]))
    ], onSuccess, onFailure);
  }, {
開發者ID:aha-app,項目名稱:tinymce-word-paste-filter,代碼行數:25,代碼來源:SpaceKeyTest.ts

示例2: 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

示例3: 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

示例4: function

 const sContentActionTest = function (inputHtml, spath, soffset, fpath, foffset, expectedHtml, sAction) {
   return GeneralSteps.sequence([
     tinyApis.sSetContent(inputHtml),
     tinyApis.sSetSelection(spath, soffset, fpath, foffset),
     tinyActions.sContentKeystroke(Keys.space(), {}),
     sAction,
     tinyApis.sAssertContent(expectedHtml)
   ]);
 };
開發者ID:abstask,項目名稱:tinymce,代碼行數:9,代碼來源:ThemeTest.ts

示例5: function

 return function (tinyApis, tinyActions, content) {
   const padding = key === Keys.space() ? '\u00a0' : '';
   const extraOffset = padding === '' ? 0 : 1;
   return GeneralSteps.sequence([
     tinyApis.sSetContent('<p>' + content + padding + '</p>'),
     tinyApis.sFocus,
     tinyApis.sSetCursor(
       [0, 0],
       content.length + extraOffset
     ),
     tinyActions.sContentKeystroke(key, {})
   ]);
 };
開發者ID:aha-app,項目名稱:tinymce-word-paste-filter,代碼行數:13,代碼來源:Utils.ts

示例6: TinyUi

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

    Pipeline.async({}, [
      tinyApis.sSetContent('<p>a&nbsp;&nbsp;b</p>'),
      // Need to trigger a keydown event to get the visual chars to show after calling set content
      Keyboard.sKeydown(Element.fromDom(editor.getDoc()), Keys.space(), { }),
      Waiter.sTryUntil('Wait for visual chars to show', tinyApis.sAssertContentStructure(sAssertSpanStruct), 50, 1000),
      tinyUi.sClickOnToolbar('click on visualchars button', 'div[aria-label="Show invisible characters"] > button'),
      tinyApis.sAssertContentStructure(sAssertNbspStruct),
      tinyUi.sClickOnToolbar('click on visualchars button', 'div[aria-label="Show invisible characters"] > button'),
      tinyApis.sAssertContentStructure(sAssertSpanStruct)
    ], onSuccess, onFailure);
  }, {
開發者ID:danielpunkass,項目名稱:tinymce,代碼行數:15,代碼來源:DefaultStateTest.ts

示例7: TinyApis

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

    Pipeline.async({}, [
      tinyApis.sFocus,
      sSetupLinkableContent(tinyApis),
      tinyActions.sContentKeystroke(Keys.space(), {}),
      sSelectAutoCompleteLink(tinyApis, 'a'),
      tinyApis.sAssertContent(
        '<h1 id="a"><a href="#b">a</a>bc</h1>\n' +
        '<h2 id="b">abcd</h2>\n' +
        '<h3 id="c">abce</h3>'
      )
    ], onSuccess, onFailure);
  }, {
開發者ID:abstask,項目名稱:tinymce,代碼行數:16,代碼來源:AutoCompleteTest.ts

示例8: function

 const sSelectAutoCompleteLink = function (tinyApis, url) {
   return Chain.asStep({}, [
     Chain.fromParent(Toolbar.cWaitForToolbar, [
       Toolbar.cClickButton('Insert/Edit link')
     ]),
     Chain.fromParent(UiFinder.cFindIn('input'), [
       UiControls.cSetValue(url),
       cKeyStroke(Keys.space(), {}),
       cKeyStroke(Keys.down(), {})
     ]),
     Chain.inject(TinyDom.fromDom(document)),
     Chain.fromParent(FocusTools.cGetFocused, [
       cKeyStroke(Keys.down(), {}),
       cKeyStroke(Keys.enter(), {})
     ]),
     Chain.fromParent(Toolbar.cWaitForToolbar, [
       Toolbar.cClickButton('Ok')
     ])
   ]);
 };
開發者ID:abstask,項目名稱:tinymce,代碼行數:20,代碼來源:AutoCompleteTest.ts

示例9: TinyApis

  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);
  }, {
開發者ID:aha-app,項目名稱:tinymce-word-paste-filter,代碼行數:20,代碼來源:ClosedDialogScrollTest.ts

示例10:

 return Step.sync(function () {
   editor.getBody().innerHTML = '<p>' + str + '</p>';
   Keyboard.keystroke(Keys.space(), {}, TinyDom.fromDom(editor.getBody()));
 });
開發者ID:abstask,項目名稱:tinymce,代碼行數:4,代碼來源:PluginTest.ts


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