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


TypeScript Chain.label方法代碼示例

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


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

示例1: function

 const sAssertErrorMessage = function (html) {
   return Step.label('Check notification message', Chain.asStep(TinyDom.fromDom(document.body), [
     UiFinder.cWaitFor('Find notification', '.tox-notification__body > p'),
     Chain.label('Get notification HTML', Chain.mapper(Html.get)),
     Chain.label('Assert HTML matches expected', Assertions.cAssertHtml('Message html does not match', html))
   ]));
 };
開發者ID:tinymce,項目名稱:tinymce,代碼行數:7,代碼來源:ImageToolsErrorTest.ts

示例2: function

 const sTestIsXYInContentArea = function (editor, deltaX, deltaY) {
   const dx1 = - 25 - deltaX;
   const dy1 = -25 - deltaY;
   const dx2 = - 5 - deltaX;
   const dy2 = - 5 - deltaY;
   return Step.label('Check points relative to deltaX=' + deltaX + ' deltaY=' + deltaY, Chain.asStep({}, [
     Chain.fromParent(
       Chain.label(
         'Calculate bounding rectangle',
         Chain.injectThunked(() => getIframeClientRect(editor))
       ), [
         Chain.label(
           'Check 〈bottom right〉 + (' + dx1 + ', ' + dy1 + ') is inside editor',
           Chain.op((rect) => Assertions.assertEq(
             'Should be inside the area since the scrollbars are excluded',
             true,
             EditorView.isXYInContentArea(editor, rect.width + dx1, rect.height + dy1)
           ))
         ),
         Chain.label(
           'Check 〈bottom right〉 + (' + dx2 + ', ' + dy2 + ') is ' + (hiddenScrollbar ? 'inside' : 'outside') + ' editor',
           Chain.op((rect) => Assertions.assertEq(
             (hiddenScrollbar ?
               'Should be inside the area since the scrollbars are hidden' :
               'Should be outside the area since the cordinate is on the scrollbars'),
             hiddenScrollbar,
             EditorView.isXYInContentArea(editor, rect.width + dx2, rect.height + dy2)
           ))
         )
       ]
     )
   ]));
 };
開發者ID:tinymce,項目名稱:tinymce,代碼行數:33,代碼來源:EditorViewIframeTest.ts

示例3: cClickContextToolbarButton

 const cGetImageSources = (label) => {
   return NamedChain.asChain(
     [
       NamedChain.direct(NamedChain.inputName(), Chain.identity, 'editor'),
       Chain.label('Store img src before flip', NamedChain.write('srcBeforeFlip', cGetImageSrc)),
       Chain.label('Flip image', NamedChain.read('editor', cClickContextToolbarButton(label))),
       // Wait for image to flip
       Chain.wait(500),
       Chain.label('Store img src after flip', NamedChain.write('srcAfterFlip', cGetImageSrc)),
       NamedChain.merge(['srcBeforeFlip', 'srcAfterFlip'], 'urls'),
       NamedChain.output('urls')
     ]
   );
 };
開發者ID:tinymce,項目名稱:tinymce,代碼行數:14,代碼來源:ContextToolbarTest.ts

示例4: function

const cFakeEvent = function (name) {
  return Chain.label('Fake event',
    Chain.op(function (elm: Element) {
      const evt = document.createEvent('HTMLEvents');
      evt.initEvent(name, true, true);
      elm.dom().dispatchEvent(evt);
    })
  );
};
開發者ID:tinymce,項目名稱:tinymce,代碼行數:9,代碼來源:UrlInputTest.ts

示例5: cMergeResizeUnmergeMeasureWidth

 const cMergeResizeSplitAssertWidth = (label, data) => {
   return Chain.label(
     `Assert width of table ${label}`,
     NamedChain.asChain([
       NamedChain.direct(NamedChain.inputName(), Chain.identity, 'editor'),
       NamedChain.direct('editor', cMergeResizeUnmergeMeasureWidth(label, data), 'widths'),
       NamedChain.read('widths', cAssertWidths)
     ])
   );
 };
開發者ID:tinymce,項目名稱:tinymce,代碼行數:10,代碼來源:UnmergeCellTableResizeTest.ts

示例6: cInsertColumnMeasureWidth

 const cAssertWidth = (label, data) => {
   return Chain.label(
     `Assert width of table ${label} after inserting column`,
     NamedChain.asChain([
       NamedChain.direct(NamedChain.inputName(), Chain.identity, 'editor'),
       NamedChain.direct('editor', cInsertColumnMeasureWidth(label, data), 'widths'),
       NamedChain.read('widths', cAssertWidths)
     ])
   );
 };
開發者ID:tinymce,項目名稱:tinymce,代碼行數:10,代碼來源:InsertColumnTableResizeTest.ts

示例7: cGetImageSources

 const sAssertImageFlip = (label) => {
   return Chain.asStep({editor}, [
     Chain.label(`Assert ${label}`,
     NamedChain.asChain([
       NamedChain.direct(NamedChain.inputName(), Chain.identity, 'editor'),
       NamedChain.direct('editor', cGetImageSources(label), 'urls'),
       NamedChain.read('urls', Chain.op((urls) => {
         Assertions.assertEq(`Image should be flipped: ${label}`, true, ( urls.srcBeforeFlip !== urls.srcAfterFlip ));
       }))
     ]))
   ]);
 };
開發者ID:tinymce,項目名稱:tinymce,代碼行數:12,代碼來源:ContextToolbarTest.ts

示例8: function

  const cGetInlinePattern = function (patterns: InlinePattern[], space: boolean) {
    const asStr = (p: InlinePattern) => {
      if (p.type === 'inline-format') {
        return p.start + 'TEXT' + p.end + ' = ' + JSON.stringify(p.format);
      } else {
        const m = (p.start === '' || p.end === '') ? p.start + p.end : p.start + 'TEXT' + p.end;
        return m + ' = ' + p.cmd + '(' + JSON.stringify(p.value) + ')';
      }
    };

    return Chain.label('Get inline ' + Arr.map(patterns, asStr).join(', '),
      Chain.mapper<{root: HTMLElement, range: Range}, InlinePatternMatch[]>(function (input) {
        const dom = DOMUtils(input.root.ownerDocument, { root_element: input.root });
        return findNestedInlinePatterns(dom, patterns, input.range, space);
      })
    );
  };
開發者ID:tinymce,項目名稱:tinymce,代碼行數:17,代碼來源:FindInlinePatternTest.ts

示例9: cInsertTable

 const cMergeResizeUnmergeMeasureWidth = (label, data) => {
   return Log.chain('TBA', 'Merge cells and resize table, unmerge cells and measure table widths', NamedChain.asChain(
     [
       NamedChain.direct(NamedChain.inputName(), Chain.identity, 'editor'),
       Chain.label('Insert table', NamedChain.direct('editor', cInsertTable(label, data.html), 'element')),
       Chain.label('Drag SE (-100, 0)', NamedChain.read('editor', TableTestUtils.cDragHandle('se', -100, 0))),
       Chain.label('Merge table cells', NamedChain.read('editor', TableTestUtils.cMergeCells(data.select))),
       Chain.label('Drag SE (-100, 0)', NamedChain.read('editor', TableTestUtils.cDragHandle('se', -100, 0))),
       Chain.label('Store width before split', NamedChain.write('widthBefore', TableTestUtils.cGetWidth)),
       Chain.label('Split table cells', NamedChain.read('editor', TableTestUtils.cSplitCells)),
       Chain.label('Store width after split', NamedChain.write('widthAfter', TableTestUtils.cGetWidth)),
       NamedChain.merge(['widthBefore', 'widthAfter'], 'widths'),
       NamedChain.output('widths')
     ]
   ));
 };
開發者ID:tinymce,項目名稱:tinymce,代碼行數:16,代碼來源:UnmergeCellTableResizeTest.ts

示例10: cInsertTable

 const cInsertColumnMeasureWidth = (label, data) => {
   return Log.chain('TBA', 'Insert column before, insert column after, erase column and measure table widths', NamedChain.asChain(
     [
       NamedChain.direct(NamedChain.inputName(), Chain.identity, 'editor'),
       Chain.label('Insert table', NamedChain.direct('editor', cInsertTable(label, data.html), 'element')),
       Chain.label('Drag SE (-100, 0)', NamedChain.read('editor', TableTestUtils.cDragHandle('se', -100, 0))),
       Chain.label('Store width before split', NamedChain.write('widthBefore', TableTestUtils.cGetWidth)),
       Chain.label('Insert column before', NamedChain.read('editor', TableTestUtils.cInsertColumnBefore)),
       Chain.label('Insert column after', NamedChain.read('editor', TableTestUtils.cInsertColumnAfter)),
       Chain.label('Delete column', NamedChain.read('editor', TableTestUtils.cDeleteColumn)),
       Chain.label('Store width after split', NamedChain.write('widthAfter', TableTestUtils.cGetWidth)),
       NamedChain.merge(['widthBefore', 'widthAfter'], 'widths'),
       NamedChain.output('widths')
     ]
   ));
 };
開發者ID:tinymce,項目名稱:tinymce,代碼行數:16,代碼來源:InsertColumnTableResizeTest.ts


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