Update toolkit files

This commit is contained in:
Namhyeon Go 2022-10-21 04:03:06 +09:00
parent 4ef76576f8
commit 3090623121
2 changed files with 38 additions and 20 deletions

Binary file not shown.

View File

@ -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;