本文整理汇总了TypeScript中@ephox/agar.NamedChain.read方法的典型用法代码示例。如果您正苦于以下问题:TypeScript NamedChain.read方法的具体用法?TypeScript NamedChain.read怎么用?TypeScript NamedChain.read使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类@ephox/agar.NamedChain
的用法示例。
在下文中一共展示了NamedChain.read方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: cInsertTable
const cUnmergeCellsMeasureTableWidth = (label, data) => {
return Log.chain('TBA', 'Merge and unmerge cells, 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 merge', NamedChain.write('widthBefore', TableTestUtils.cGetWidth)),
Chain.label('Merge table cells', NamedChain.read('editor', TableTestUtils.cMergeCells(data.select))),
Chain.label('Split table cells', NamedChain.read('editor', TableTestUtils.cSplitCells)),
Chain.label('Store width after merge/unmerge', NamedChain.write('widthAfter', TableTestUtils.cGetWidth)),
NamedChain.merge(['widthBefore', 'widthAfter'], 'widths'),
NamedChain.output('widths')
]
));
};
示例2: 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')
]
));
};
示例3: function
const cDragHandle = function (id, deltaH, deltaV) {
return NamedChain.asChain([
NamedChain.direct(NamedChain.inputName(), Chain.identity, 'editor'),
NamedChain.direct('editor', cGetBody, 'editorBody'),
NamedChain.read('editorBody', Chain.control(
UiFinder.cFindIn('#mceResizeHandle' + id),
Guard.tryUntil('wait for resize handlers', 100, 40000)
)),
NamedChain.read('editorBody', Chain.fromChains([
UiFinder.cFindIn('#mceResizeHandle' + id),
Mouse.cMouseDown,
Mouse.cMouseMoveTo(deltaH, deltaV),
Mouse.cMouseUp
])),
NamedChain.outputInput
]);
};
示例4:
const cSubmitDialog = () => Chain.control(
NamedChain.asChain([
NamedChain.writeValue('body', Body.body()),
NamedChain.read('body', Mouse.cClickOn('.tox-button:contains("Save")')),
NamedChain.outputInput
]),
Guard.addLogging('Submit dialog')
);
示例5: 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)
])
);
};
示例6:
const cAssertWhiteSpace = () => {
return NamedChain.asChain([
NamedChain.direct(NamedChain.inputName(), Chain.identity, 'editor'),
NamedChain.direct('editor', cOpenDialog, 'element'),
NamedChain.direct('element', cGetWhiteSpace, 'whitespace'),
NamedChain.read('whitespace', Chain.op((whitespace) => {
Assertions.assertEq('Textarea should have "white-space: pre-wrap"', 'pre-wrap', whitespace);
}))
]);
};
示例7: 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)
])
);
};
示例8: n
const step = Step.raw((_, next, die, initLogs) => {
NamedChain.pipeline([
NamedChain.write('container', Chain.async((input, n, die) => {
const container = Element.fromTag('div');
Attr.set(container, 'id', 'test-container-div');
Html.set(container, containerHtml);
Insert.append(Body.body(), container);
n(container);
})),
NamedChain.write('editor', cOnSelector('div.tinymce')),
NamedChain.direct('container', Chain.fromChains([
UiFinder.cFindIn('div.tinymce'),
Mouse.cMouseOver,
cNotExists(Body.body(), 'div[data-row="0"]')
]), '_'),
NamedChain.read('editor', Editor.cRemove),
NamedChain.read('container', Chain.op((div) => Remove.remove(div)))
], next, die, initLogs);
});
示例9: 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 ));
}))
]))
]);
};
示例10: 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')
]
);
};