]> git.wh0rd.org - tt-rss.git/blame - lib/dojo/_base/_loader/hostenv_rhino.js
add dijit/dojo stuff; initial ui mockup
[tt-rss.git] / lib / dojo / _base / _loader / hostenv_rhino.js
CommitLineData
2f01fe57
AD
1/*
2 Copyright (c) 2004-2010, 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
8if(dojo.config["baseUrl"]){
9dojo.baseUrl=dojo.config["baseUrl"];
10}else{
11dojo.baseUrl="./";
12}
13dojo.locale=dojo.locale||String(java.util.Locale.getDefault().toString().replace("_","-").toLowerCase());
14dojo._name="rhino";
15dojo.isRhino=true;
16if(typeof print=="function"){
17console.debug=print;
18}
19if(!("byId" in dojo)){
20dojo.byId=function(id,_1){
21if(id&&(typeof id=="string"||id instanceof String)){
22if(!_1){
23_1=document;
24}
25return _1.getElementById(id);
26}
27return id;
28};
29}
30dojo._isLocalUrl=function(_2){
31var _3=(new java.io.File(_2)).exists();
32if(!_3){
33var _4;
34try{
35_4=(new java.net.URL(_2)).openStream();
36_4.close();
37}
38finally{
39if(_4&&_4.close){
40_4.close();
41}
42}
43}
44return _3;
45};
46dojo._loadUri=function(_5,cb){
47try{
48var _6;
49try{
50_6=dojo._isLocalUrl(_5);
51}
52catch(e){
53return false;
54}
55if(cb){
56var _7=(_6?readText:readUri)(_5,"UTF-8");
57if(!eval("'‏'").length){
58_7=String(_7).replace(/[\u200E\u200F\u202A-\u202E]/g,function(_8){
59return "\\u"+_8.charCodeAt(0).toString(16);
60});
61}
62cb(eval("("+_7+")"));
63}else{
64load(_5);
65}
66return true;
67}
68catch(e){
69return false;
70}
71};
72dojo.exit=function(_9){
73quit(_9);
74};
75function readText(_a,_b){
76_b=_b||"utf-8";
77var jf=new java.io.File(_a);
78var is=new java.io.FileInputStream(jf);
79return dj_readInputStream(is,_b);
80};
81function readUri(_c,_d){
82var _e=(new java.net.URL(_c)).openConnection();
83_d=_d||_e.getContentEncoding()||"utf-8";
84var is=_e.getInputStream();
85return dj_readInputStream(is,_d);
86};
87function dj_readInputStream(is,_f){
88var _10=new java.io.BufferedReader(new java.io.InputStreamReader(is,_f));
89try{
90var sb=new java.lang.StringBuffer();
91var _11="";
92while((_11=_10.readLine())!==null){
93sb.append(_11);
94sb.append(java.lang.System.getProperty("line.separator"));
95}
96return sb.toString();
97}
98finally{
99_10.close();
100}
101};
102dojo._getText=function(uri,_12){
103try{
104var _13=dojo._isLocalUrl(uri);
105var _14=(_13?readText:readUri)(uri,"UTF-8");
106if(_14!==null){
107_14+="";
108}
109return _14;
110}
111catch(e){
112if(_12){
113return null;
114}else{
115throw e;
116}
117}
118};
119dojo.doc=typeof document!="undefined"?document:null;
120dojo.body=function(){
121return document.body;
122};
123if(typeof setTimeout=="undefined"||typeof clearTimeout=="undefined"){
124dojo._timeouts=[];
125clearTimeout=function(idx){
126if(!dojo._timeouts[idx]){
127return;
128}
129dojo._timeouts[idx].stop();
130};
131setTimeout=function(_15,_16){
132var def={sleepTime:_16,hasSlept:false,run:function(){
133if(!this.hasSlept){
134this.hasSlept=true;
135java.lang.Thread.currentThread().sleep(this.sleepTime);
136}
137try{
138_15();
139}
140catch(e){
141}
142}};
143var _17=new java.lang.Runnable(def);
144var _18=new java.lang.Thread(_17);
145_18.start();
146return dojo._timeouts.push(_18)-1;
147};
148}
149if(dojo.config["modulePaths"]){
150for(var param in dojo.config["modulePaths"]){
151dojo.registerModulePath(param,dojo.config["modulePaths"][param]);
152}
153}