mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-03-12 00:45:14 +00:00
Update toolkit.js
This commit is contained in:
parent
1c799401ba
commit
52bfa45f9a
|
@ -13,41 +13,46 @@ var ToolkitObject = function() {
|
|||
console.warn("WelsonJS.Toolkit is disabled");
|
||||
}
|
||||
};
|
||||
|
||||
this.sendClick = function(wName, x, y, retry) {
|
||||
var i = 0;
|
||||
while (i < retry) {
|
||||
this.interface.SendClick(wName, x, y);
|
||||
i++;
|
||||
}
|
||||
};
|
||||
|
||||
this.sendKeys = function(wName, s) {
|
||||
return this.interface.SendKeys(wName, s);
|
||||
};
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html
|
||||
|
||||
this.alert = function(message) {
|
||||
return this.interface.Alert(message);
|
||||
};
|
||||
|
||||
this.confirm = function(message) {
|
||||
return this.interface.Confirm(message);
|
||||
};
|
||||
|
||||
this.prompt = function(message, _default) {
|
||||
return this.interface.Prompt(message, _default);
|
||||
};
|
||||
|
||||
this.getInterface = function() {
|
||||
return this.interface;
|
||||
};
|
||||
|
||||
this.create();
|
||||
};
|
||||
|
||||
var Toolkit = new ToolkitObject();
|
||||
|
||||
exports.create = Toolkit.create;
|
||||
exports.sendClick = Toolkit.sendClick;
|
||||
exports.sendKeys = Toolkit.sendKeys;
|
||||
exports.alert = Toolkit.alert;
|
||||
exports.confirm = Toolkit.confirm;
|
||||
exports.prompt = Toolkit.prompt;
|
||||
exports.create = function() {
|
||||
return new ToolkitObject();
|
||||
};
|
||||
|
||||
exports.getInterface = function() {
|
||||
return Toolkit.getInterface();
|
||||
};
|
||||
|
||||
exports.sendClick = function(wName, x, y, retry) {
|
||||
var i = 0;
|
||||
while (i < retry) {
|
||||
Toolkit.getInterface().SendClick(wName, x, y);
|
||||
i++;
|
||||
}
|
||||
};
|
||||
|
||||
exports.sendKeys = function(wName, s) {
|
||||
return Toolkit.getInterface().SendKeys(wName, s);
|
||||
};
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html
|
||||
|
||||
exports.alert = function(message) {
|
||||
return Toolkit.getInterface().Alert(message);
|
||||
};
|
||||
|
||||
exports.confirm = function(message) {
|
||||
return Toolkit.getInterface().Confirm(message);
|
||||
};
|
||||
|
||||
exports.prompt = function(message, _default) {
|
||||
return Toolkit.getInterface().Prompt(message, _default);
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue
Block a user