本文整理汇总了TypeScript中@ephox/agar.Step.default方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Step.default方法的具体用法?TypeScript Step.default怎么用?TypeScript Step.default使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类@ephox/agar.Step
的用法示例。
在下文中一共展示了Step.default方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: TinyApis
TinyLoader.setup(function (editor, onSuccess, onFailure) {
const tinyApis = TinyApis(editor);
Pipeline.async({}, [
Logger.t('Insert image, size 100x100', GeneralSteps.sequence([
tinyApis.sSetContent('<p></p>'),
tinyApis.sSetCursor([0], 0),
sUpdateImageOrFigure(editor, {
src: 'image.png',
height: '100',
width: '100'
}),
sWaitForDragHandles(editor),
tinyApis.sAssertContentStructure(ApproxStructure.build(function (s, str) {
return s.element('div', {
children: [
s.element('p', {
children: [
s.element('img', {
attrs: {
src: str.is('image.png'),
alt: str.is(''),
width: str.is('100'),
height: str.is('100')
}
}),
s.element('br', {})
]
}),
s.element('div', { attrs: { id: str.is('mceResizeHandlenw') } }),
s.element('div', { attrs: { id: str.is('mceResizeHandlene') } }),
s.element('div', { attrs: { id: str.is('mceResizeHandlese') } }),
s.element('div', { attrs: { id: str.is('mceResizeHandlesw') } })
]
});
}))
])),
Logger.t('Insert figure, size 100x100', GeneralSteps.sequence([
tinyApis.sSetContent('<p></p>'),
tinyApis.sSetCursor([0], 0),
sUpdateImageOrFigure(editor, {
src: 'image.png',
caption: true,
height: '100',
width: '100'
}),
sWaitForDragHandles(editor),
tinyApis.sAssertContentStructure(ApproxStructure.build(function (s, str) {
return s.element('div', {
children: [
s.element('figure', {
attrs: {
class: str.is('image'),
contenteditable: str.is('false')
},
children: [
s.element('img', {
attrs: {
src: str.is('image.png'),
alt: str.is(''),
width: str.is('100'),
height: str.is('100')
}
}),
s.element('figcaption', {
attrs: {
contenteditable: str.is('true')
},
children: [
s.text(str.is('Caption'))
]
})
]
}),
s.element('p', {}),
s.anything(),
s.element('div', { attrs: { id: str.is('mceResizeHandlenw') } }),
s.element('div', { attrs: { id: str.is('mceResizeHandlene') } }),
s.element('div', { attrs: { id: str.is('mceResizeHandlese') } }),
s.element('div', { attrs: { id: str.is('mceResizeHandlesw') } })
]
});
}))
])),
Logger.t('Update figure, new dimensions and src', GeneralSteps.sequence([
tinyApis.sSetContent('<figure class="image" contenteditable="false">' +
'<img src="image.png" alt="" width="200" height="200">' +
'<figcaption contenteditable="true">Caption</figcaption>' +
'</figure>'),
tinyApis.sSelect('figure', []),
sUpdateImageOrFigure(editor, {
src: 'updated-image.png',
caption: true,
height: '100',
width: '100'
}),
sWaitForDragHandles(editor),
tinyApis.sAssertContentStructure(ApproxStructure.build(function (s, str) {
return s.element('div', {
children: [
//.........这里部分代码省略.........