Subversion Repositories Applications.papyrus

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1318 alexandre_ 1
/*
2
	Copyright (c) 2004-2006, The Dojo Foundation
3
	All Rights Reserved.
4
 
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:
7
 
8
		http://dojotoolkit.org/community/licensing.shtml
9
*/
10
 
11
var dj_global = this;
12
var dj_currentContext = this;
13
function dj_undef(name, object) {
14
	return (typeof (object || dj_currentContext)[name] == "undefined");
15
}
16
if (dj_undef("djConfig", this)) {
17
	var djConfig = {};
18
}
19
if (dj_undef("dojo", this)) {
20
	var dojo = {};
21
}
22
dojo.global = function () {
23
	return dj_currentContext;
24
};
25
dojo.locale = djConfig.locale;
26
dojo.version = {major:0, minor:4, patch:2, flag:"", revision:Number("$Rev: 7616 $".match(/[0-9]+/)[0]), toString:function () {
27
	with (dojo.version) {
28
		return major + "." + minor + "." + patch + flag + " (" + revision + ")";
29
	}
30
}};
31
dojo.evalProp = function (name, object, create) {
32
	if ((!object) || (!name)) {
33
		return undefined;
34
	}
35
	if (!dj_undef(name, object)) {
36
		return object[name];
37
	}
38
	return (create ? (object[name] = {}) : undefined);
39
};
40
dojo.parseObjPath = function (path, context, create) {
41
	var object = (context || dojo.global());
42
	var names = path.split(".");
43
	var prop = names.pop();
44
	for (var i = 0, l = names.length; i < l && object; i++) {
45
		object = dojo.evalProp(names[i], object, create);
46
	}
47
	return {obj:object, prop:prop};
48
};
49
dojo.evalObjPath = function (path, create) {
50
	if (typeof path != "string") {
51
		return dojo.global();
52
	}
53
	if (path.indexOf(".") == -1) {
54
		return dojo.evalProp(path, dojo.global(), create);
55
	}
56
	var ref = dojo.parseObjPath(path, dojo.global(), create);
57
	if (ref) {
58
		return dojo.evalProp(ref.prop, ref.obj, create);
59
	}
60
	return null;
61
};
62
dojo.errorToString = function (exception) {
63
	if (!dj_undef("message", exception)) {
64
		return exception.message;
65
	} else {
66
		if (!dj_undef("description", exception)) {
67
			return exception.description;
68
		} else {
69
			return exception;
70
		}
71
	}
72
};
73
dojo.raise = function (message, exception) {
74
	if (exception) {
75
		message = message + ": " + dojo.errorToString(exception);
76
	} else {
77
		message = dojo.errorToString(message);
78
	}
79
	try {
80
		if (djConfig.isDebug) {
81
			dojo.hostenv.println("FATAL exception raised: " + message);
82
		}
83
	}
84
	catch (e) {
85
	}
86
	throw exception || Error(message);
87
};
88
dojo.debug = function () {
89
};
90
dojo.debugShallow = function (obj) {
91
};
92
dojo.profile = {start:function () {
93
}, end:function () {
94
}, stop:function () {
95
}, dump:function () {
96
}};
97
function dj_eval(scriptFragment) {
98
	return dj_global.eval ? dj_global.eval(scriptFragment) : eval(scriptFragment);
99
}
100
dojo.unimplemented = function (funcname, extra) {
101
	var message = "'" + funcname + "' not implemented";
102
	if (extra != null) {
103
		message += " " + extra;
104
	}
105
	dojo.raise(message);
106
};
107
dojo.deprecated = function (behaviour, extra, removal) {
108
	var message = "DEPRECATED: " + behaviour;
109
	if (extra) {
110
		message += " " + extra;
111
	}
112
	if (removal) {
113
		message += " -- will be removed in version: " + removal;
114
	}
115
	dojo.debug(message);
116
};
117
dojo.render = (function () {
118
	function vscaffold(prefs, names) {
119
		var tmp = {capable:false, support:{builtin:false, plugin:false}, prefixes:prefs};
120
		for (var i = 0; i < names.length; i++) {
121
			tmp[names[i]] = false;
122
		}
123
		return tmp;
124
	}
125
	return {name:"", ver:dojo.version, os:{win:false, linux:false, osx:false}, html:vscaffold(["html"], ["ie", "opera", "khtml", "safari", "moz"]), svg:vscaffold(["svg"], ["corel", "adobe", "batik"]), vml:vscaffold(["vml"], ["ie"]), swf:vscaffold(["Swf", "Flash", "Mm"], ["mm"]), swt:vscaffold(["Swt"], ["ibm"])};
126
})();
127
dojo.hostenv = (function () {
128
	var config = {isDebug:false, allowQueryConfig:false, baseScriptUri:"", baseRelativePath:"", libraryScriptUri:"", iePreventClobber:false, ieClobberMinimal:true, preventBackButtonFix:true, delayMozLoadingFix:false, searchIds:[], parseWidgets:true};
129
	if (typeof djConfig == "undefined") {
130
		djConfig = config;
131
	} else {
132
		for (var option in config) {
133
			if (typeof djConfig[option] == "undefined") {
134
				djConfig[option] = config[option];
135
			}
136
		}
137
	}
138
	return {name_:"(unset)", version_:"(unset)", getName:function () {
139
		return this.name_;
140
	}, getVersion:function () {
141
		return this.version_;
142
	}, getText:function (uri) {
143
		dojo.unimplemented("getText", "uri=" + uri);
144
	}};
145
})();
146
dojo.hostenv.getBaseScriptUri = function () {
147
	if (djConfig.baseScriptUri.length) {
148
		return djConfig.baseScriptUri;
149
	}
150
	var uri = new String(djConfig.libraryScriptUri || djConfig.baseRelativePath);
151
	if (!uri) {
152
		dojo.raise("Nothing returned by getLibraryScriptUri(): " + uri);
153
	}
154
	var lastslash = uri.lastIndexOf("/");
155
	djConfig.baseScriptUri = djConfig.baseRelativePath;
156
	return djConfig.baseScriptUri;
157
};
158