1
|
/*
|
2
|
Copyright (c) 2004-2008, The Dojo Foundation All Rights Reserved.
|
3
|
Available via Academic Free License >= 2.1 OR the modified BSD license.
|
4
|
see: http://dojotoolkit.org/license for details
|
5
|
*/
|
6
|
|
7
|
|
8
|
if(!dojo._hasResource["dojo.robotx"]){
|
9
|
dojo._hasResource["dojo.robotx"]=true;
|
10
|
dojo.provide("dojo.robotx");
|
11
|
dojo.require("dojo.robot");
|
12
|
dojo.experimental("dojo.robotx");
|
13
|
(function(){
|
14
|
doh.robot._runsemaphore.lock.push("dojo.robotx.lock");
|
15
|
var _1=document.getElementById("robotapplication");
|
16
|
var _2=dojo.connect(doh,"_groupStarted",function(){
|
17
|
dojo.disconnect(_2);
|
18
|
if(!document.getElementById("robotconsole").childNodes.length){
|
19
|
document.body.removeChild(document.getElementById("robotconsole"));
|
20
|
_1.style.height="100%";
|
21
|
}
|
22
|
_1.style.visibility="visible";
|
23
|
});
|
24
|
var _3=function(){
|
25
|
doh.robot._updateDocument();
|
26
|
_3=null;
|
27
|
doh.run();
|
28
|
};
|
29
|
var _4=function(){
|
30
|
if(_3){
|
31
|
_3();
|
32
|
}
|
33
|
var _5=dojo.connect(dojo.body(),"onunload",function(){
|
34
|
dojo.doc=document;
|
35
|
dojo.disconnect(_5);
|
36
|
});
|
37
|
};
|
38
|
dojo.config.debugContainerId="robotconsole";
|
39
|
document.write("<div id=\"robotconsole\" style=\"position:absolute;left:0px;top:75%;width:100%; height:25%;\"></div>");
|
40
|
_1=document.createElement("iframe");
|
41
|
_1.setAttribute("ALLOWTRANSPARENCY","true");
|
42
|
dojo.style(_1,{visibility:"hidden",border:"0px none",padding:"0px",margin:"0px",position:"absolute",left:"0px",top:"0px",width:"100%",height:"75%",zIndex:"1"});
|
43
|
if(_1["attachEvent"]!==undefined){
|
44
|
_1.attachEvent("onload",_4);
|
45
|
}else{
|
46
|
dojo.connect(_1,"onload",_4);
|
47
|
}
|
48
|
dojo.mixin(doh.robot,{_updateDocument:function(){
|
49
|
dojo.doc=_1.contentWindow.document;
|
50
|
},initRobot:function(_6){
|
51
|
_1.src=_6;
|
52
|
dojo.addOnLoad(function(){
|
53
|
dojo.style(document.body,{width:"100%",height:"100%"});
|
54
|
document.body.appendChild(_1);
|
55
|
var _7=document.createElement("base");
|
56
|
_7.href=_6;
|
57
|
document.getElementsByTagName("head")[0].appendChild(_7);
|
58
|
});
|
59
|
},waitForPageToLoad:function(_8){
|
60
|
var d=new doh.Deferred();
|
61
|
_3=function(){
|
62
|
_3=null;
|
63
|
doh.robot._updateDocument();
|
64
|
d.callback(true);
|
65
|
};
|
66
|
_8();
|
67
|
return d;
|
68
|
}});
|
69
|
})();
|
70
|
}
|