本文整理匯總了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: [
//.........這裏部分代碼省略.........