Subversion Repositories Applications.papyrus

Rev

Rev 1372 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1372 Rev 1422
1
/*
1
/*
2
	Copyright (c) 2004-2006, The Dojo Foundation
2
	Copyright (c) 2004-2006, The Dojo Foundation
3
	All Rights Reserved.
3
	All Rights Reserved.
4
 
4
 
5
	Licensed under the Academic Free License version 2.1 or above OR the
5
	Licensed under the Academic Free License version 2.1 or above OR the
6
	modified BSD license. For more information on Dojo licensing, see:
6
	modified BSD license. For more information on Dojo licensing, see:
7
 
7
 
8
		http://dojotoolkit.org/community/licensing.shtml
8
		http://dojotoolkit.org/community/licensing.shtml
9
*/
9
*/
-
 
10
 
-
 
11
 
10
 
12
 
11
dojo.hostenv.name_ = "wsh";
13
dojo.hostenv.name_ = "wsh";
12
if (typeof WScript == "undefined") {
14
if (typeof WScript == "undefined") {
13
	dojo.raise("attempt to use WSH host environment when no WScript global");
15
	dojo.raise("attempt to use WSH host environment when no WScript global");
14
}
16
}
15
dojo.hostenv.println = WScript.Echo;
17
dojo.hostenv.println = WScript.Echo;
16
dojo.hostenv.getCurrentScriptUri = function () {
18
dojo.hostenv.getCurrentScriptUri = function () {
17
	return WScript.ScriptFullName();
19
	return WScript.ScriptFullName();
18
};
20
};
19
dojo.hostenv.getText = function (fpath) {
21
dojo.hostenv.getText = function (fpath) {
20
	var fso = new ActiveXObject("Scripting.FileSystemObject");
22
	var fso = new ActiveXObject("Scripting.FileSystemObject");
21
	var istream = fso.OpenTextFile(fpath, 1);
23
	var istream = fso.OpenTextFile(fpath, 1);
22
	if (!istream) {
24
	if (!istream) {
23
		return null;
25
		return null;
24
	}
26
	}
25
	var contents = istream.ReadAll();
27
	var contents = istream.ReadAll();
26
	istream.Close();
28
	istream.Close();
27
	return contents;
29
	return contents;
28
};
30
};
29
dojo.hostenv.exit = function (exitcode) {
31
dojo.hostenv.exit = function (exitcode) {
30
	WScript.Quit(exitcode);
32
	WScript.Quit(exitcode);
31
};
33
};
32
dojo.requireIf((djConfig["isDebug"] || djConfig["debugAtAllCosts"]), "dojo.debug");
34
dojo.requireIf((djConfig["isDebug"] || djConfig["debugAtAllCosts"]), "dojo.debug");
33
 
35