mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-05-11 20:21:03 +00:00
Update lib/toolkit.js, lib/chrome.js
This commit is contained in:
parent
4bc9669195
commit
255f9dab32
|
@ -10,6 +10,7 @@ var FILE = require("lib/file");
|
|||
var HTTP = require("lib/http");
|
||||
var Websocket = require("lib/websocket");
|
||||
var AutoIt = require("lib/autoit");
|
||||
var ToolKit = require("lib/toolkit");
|
||||
|
||||
// for remote debugging
|
||||
var pageEventId = 0;
|
||||
|
@ -41,6 +42,7 @@ var ChromeObject = function(interfaces) {
|
|||
|
||||
// dependencies
|
||||
this.oAutoIt = null;
|
||||
this.oToolkit = null;
|
||||
|
||||
// for remote debugging
|
||||
this.debuggingPort = 0;
|
||||
|
@ -55,6 +57,7 @@ var ChromeObject = function(interfaces) {
|
|||
|
||||
this.create = function() {
|
||||
this.oAutoIt = AutoIt.create();
|
||||
this.oToolkit = ToolKit.create();
|
||||
return this;
|
||||
};
|
||||
|
||||
|
@ -1170,14 +1173,18 @@ var ChromeObject = function(interfaces) {
|
|||
this.oAutoIt.callFunction("MouseMove", [screenPosition.x + x, screenPosition.y + y]);
|
||||
this.oAutoIt.callFunction("MouseClick", ["left"]);
|
||||
};
|
||||
|
||||
this.mouseWheelUp = function() {
|
||||
this.oAutoIt.callFunction("MouseWheel", ["up"]);
|
||||
};
|
||||
|
||||
this.mouseWheelDown = function() {
|
||||
this.oAutoIt.callFunction("MouseWheel", ["down"]);
|
||||
};
|
||||
this.vMouseClick = function(x, y) {
|
||||
this.oToolkit.sendClick(this.pageId.substring(0, 6), x, y, 1);
|
||||
};
|
||||
|
||||
this.mouseWheelUp = function() {
|
||||
this.oAutoIt.callFunction("MouseWheel", ["up"]);
|
||||
};
|
||||
|
||||
this.mouseWheelDown = function() {
|
||||
this.oAutoIt.callFunction("MouseWheel", ["down"]);
|
||||
};
|
||||
|
||||
this.create();
|
||||
};
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
|
|
@ -10,7 +10,7 @@ var ToolkitObject = function() {
|
|||
this.interface = CreateObject("WelsonJS.Toolkit");
|
||||
return this;
|
||||
} catch (e) {
|
||||
console.error("ToolkitObject.create() ->", e.message);
|
||||
console.warn("WelsonJS.Toolkit is disabled");
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user