mirror of
https://github.com/gnh1201/welsonjs.git
synced 2024-11-26 07:21:43 +00:00
Update toolkit files
This commit is contained in:
parent
4ef76576f8
commit
3090623121
Binary file not shown.
|
@ -22,36 +22,54 @@ var ToolkitObject = function() {
|
|||
this.create();
|
||||
};
|
||||
|
||||
exports.create = function() {
|
||||
function create() {
|
||||
return new ToolkitObject();
|
||||
};
|
||||
}
|
||||
|
||||
exports.getInterface = function() {
|
||||
return exports.create().getInterface();
|
||||
};
|
||||
function getInterface() {
|
||||
return create().getInterface();
|
||||
}
|
||||
|
||||
exports.sendClick = function(wName, x, y, retry) {
|
||||
function sendClick(wName, x, y, retry) {
|
||||
var i = 0;
|
||||
while (i < retry) {
|
||||
exports.getInterface().SendClick(wName, x, y);
|
||||
getInterface().SendClick(wName, x, y);
|
||||
i++;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
exports.sendKeys = function(wName, s) {
|
||||
return exports.getInterface().SendKeys(wName, s);
|
||||
};
|
||||
function sendKeys(wName, s) {
|
||||
return getInterface().SendKeys(wName, s);
|
||||
}
|
||||
|
||||
function sendFnKey(wName, num) {
|
||||
return getInterface().SendFnKey(wName, num);
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html
|
||||
|
||||
exports.alert = function(message) {
|
||||
return exports.getInterface().Alert(message);
|
||||
};
|
||||
function alert(message) {
|
||||
return getInterface().Alert(message);
|
||||
}
|
||||
|
||||
exports.confirm = function(message) {
|
||||
return exports.getInterface().Confirm(message);
|
||||
};
|
||||
function confirm(message) {
|
||||
return getInterface().Confirm(message);
|
||||
}
|
||||
|
||||
exports.prompt = function(message, _default) {
|
||||
return exports.getInterface().Prompt(message, _default);
|
||||
};
|
||||
function prompt(message, _default) {
|
||||
return getInterface().Prompt(message, _default);
|
||||
}
|
||||
|
||||
exports.create = create;
|
||||
exports.getInterface = getInterface;
|
||||
exports.sendClick = sendClick;
|
||||
exports.sendKeys = sendKeys;
|
||||
exports.sendFnKey = sendFnKey;
|
||||
exports.alert = alert;
|
||||
exports.confirm = confirm;
|
||||
exports.prompt = prompt;
|
||||
|
||||
exports.VERSIONINFO = "WelsonJS.Toolkit API version 0.3";
|
||||
exports.AUTHOR = "catswords@protonmail.com";
|
||||
exports.global = global;
|
||||
exports.require = global.require;
|
||||
|
|
Loading…
Reference in New Issue
Block a user