本文整理汇总了TypeScript中@ephox/agar.UiControls.cSetValue方法的典型用法代码示例。如果您正苦于以下问题:TypeScript UiControls.cSetValue方法的具体用法?TypeScript UiControls.cSetValue怎么用?TypeScript UiControls.cSetValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类@ephox/agar.UiControls
的用法示例。
在下文中一共展示了UiControls.cSetValue方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: TinyUi
TinyLoader.setup(function (editor, onSuccess, onFailure) {
const tinyUi = TinyUi(editor);
Pipeline.async({}, [
Logger.t('insert url by typing', GeneralSteps.sequence([
tinyUi.sClickOnToolbar('click on link button', 'div[aria-label="Insert/edit link"] > button'),
Chain.asStep({}, [
Chain.fromParent(tinyUi.cWaitForPopup('Wait for dialog', 'div[role="dialog"]'),
[
Chain.fromChains([
UiFinder.cFindIn('div > label:contains("Url") + div > input'),
UiControls.cSetValue('http://www.test.com/'),
cFakeEvent('keyup')
]),
Chain.fromChains([
UiFinder.cFindIn('label:contains("Text to display") + input'),
UiControls.cGetValue,
Assertions.cAssertEq('should be the same url', 'http://www.test.com/')
]),
cCloseDialog
]
)
])
])),
Logger.t('insert url by pasting', GeneralSteps.sequence([
tinyUi.sClickOnToolbar('click on link button', 'div[aria-label="Insert/edit link"] > button'),
Chain.asStep({}, [
Chain.fromParent(tinyUi.cWaitForPopup('Wait for dialog', 'div[role="dialog"]'),
[
Chain.fromChains([
UiFinder.cFindIn('div > label:contains("Url") + div > input'),
UiControls.cSetValue('http://www.test.com/'),
cFakeEvent('paste')
]),
Chain.fromChains([
UiFinder.cFindIn('label:contains("Text to display") + input'),
UiControls.cGetValue,
Assertions.cAssertEq('should be the same url', 'http://www.test.com/')
]),
cCloseDialog
]
)
])
]))
], onSuccess, onFailure);
}, {
示例2: 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);
}, {
示例3: function
const sPasteTextareaValue = function (ui, value) {
return Chain.asStep({}, [
cFindTextarea(ui, 'Paste your embed code below:'),
UiControls.cSetValue(value),
cFakeEvent('paste')
]);
};
示例4: 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);
}, {
示例5:
const cSetInputValue = (section, newValue) => Chain.control(
Chain.fromChains([
UiFinder.cFindIn(`label:contains(${section}) + div > input`),
UiControls.cSetValue(newValue)
]),
Guard.addLogging('Set input value' + newValue)
);
示例6: cFindInDialog
const cSetValueOn = (selector: string, newValue: any) => (ui) => {
return Chain.control(
Chain.fromChains([
cFindInDialog(selector)(ui),
UiControls.cSetValue(newValue)
]),
Guard.addLogging('Set value')
);
};
示例7: function
const cSetSourceInput = function (ui, value) {
return Chain.control(
Chain.fromChains([
cFindFilepickerInput(ui),
UiControls.cSetValue(value)
]),
Guard.addLogging(`Set source input ${value}`)
);
};
示例8: TinyApis
TinyLoader.setup(function (editor, onSuccess, onFailure) {
const tinyApis = TinyApis(editor);
const tinyUi = TinyUi(editor);
Pipeline.async({},
Log.steps('TBA', 'SearchReplace: replace one of three found, undo and redo and assert there is no matcher spans in editor', [
tinyApis.sSetContent('<p>cats cats cats</p>'),
tinyUi.sClickOnToolbar('click on searchreplace button', 'button[aria-label="Find and replace"]'),
Chain.asStep({}, [
Chain.fromParent(tinyUi.cWaitForPopup('wait for dialog', 'div[role="dialog"]'), [
Chain.fromChains([
UiFinder.cFindIn('label:contains("Find") + input'),
UiControls.cSetValue('cats')
]),
Chain.fromChains([
UiFinder.cFindIn('label:contains("Replace with") + input'),
UiControls.cSetValue('dogs')
]),
Chain.fromChains([
UiFinder.cFindIn('button:contains("Find")'),
Mouse.cClick
]),
Chain.fromChains([
UiFinder.cWaitFor('wait for button to be enabled', 'button[disabled!="disabled"]:contains("Replace")')
]),
Chain.fromChains([
UiFinder.cFindIn('button:contains("Replace")'),
Mouse.cClick
]),
Chain.fromChains([
UiFinder.cFindIn('button[aria-label="Close"]'),
Mouse.cClick
])
])
]),
sUndo(editor),
tinyApis.sAssertContent('<p>cats cats cats</p>'),
sRedo(editor),
tinyApis.sAssertContentPresence({ 'span.mce-match-marker': 0 }),
tinyApis.sAssertContent('<p>dogs cats cats</p>')
])
, onSuccess, onFailure);
}, {
示例9: function
const sInsertLink = function (url) {
return Chain.asStep({}, [
Toolbar.cWaitForToolbar,
Toolbar.cClickButton('Insert/Edit link'),
Toolbar.cWaitForToolbar,
UiFinder.cFindIn('input'),
UiControls.cSetValue(url),
Toolbar.cWaitForToolbar,
Toolbar.cClickButton('Ok')
]);
};