mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-12-07 23:03:40 +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();
|
this.create();
|
||||||
};
|
};
|
||||||
|
|
||||||
exports.create = function() {
|
function create() {
|
||||||
return new ToolkitObject();
|
return new ToolkitObject();
|
||||||
};
|
}
|
||||||
|
|
||||||
exports.getInterface = function() {
|
function getInterface() {
|
||||||
return exports.create().getInterface();
|
return create().getInterface();
|
||||||
};
|
}
|
||||||
|
|
||||||
exports.sendClick = function(wName, x, y, retry) {
|
function sendClick(wName, x, y, retry) {
|
||||||
var i = 0;
|
var i = 0;
|
||||||
while (i < retry) {
|
while (i < retry) {
|
||||||
exports.getInterface().SendClick(wName, x, y);
|
getInterface().SendClick(wName, x, y);
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
exports.sendKeys = function(wName, s) {
|
function sendKeys(wName, s) {
|
||||||
return exports.getInterface().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
|
// https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html
|
||||||
|
|
||||||
exports.alert = function(message) {
|
function alert(message) {
|
||||||
return exports.getInterface().Alert(message);
|
return getInterface().Alert(message);
|
||||||
};
|
}
|
||||||
|
|
||||||
exports.confirm = function(message) {
|
function confirm(message) {
|
||||||
return exports.getInterface().Confirm(message);
|
return getInterface().Confirm(message);
|
||||||
};
|
}
|
||||||
|
|
||||||
exports.prompt = function(message, _default) {
|
function prompt(message, _default) {
|
||||||
return exports.getInterface().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