Subversion Repositories Applications.papyrus

Rev

Rev 1318 | Details | Compare with Previous | 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
 
1422 alexandre_ 11
 
12
 
1318 alexandre_ 13
dojo.require("dojo.widget.DomWidget");
14
dojo.provide("dojo.widget.SvgWidget");
15
dojo.provide("dojo.widget.SVGWidget");
16
dojo.require("dojo.dom");
17
dojo.require("dojo.experimental");
18
dojo.experimental("dojo.widget.SvgWidget");
19
dojo.widget.declare("dojo.widget.SvgWidget", dojo.widget.DomWidget, {createNodesFromText:function (txt, wrap) {
20
	return dojo.svg.createNodesFromText(txt, wrap);
21
}});
22
dojo.widget.SVGWidget = dojo.widget.SvgWidget;
23
try {
24
	(function () {
25
		var tf = function () {
26
			var rw = new function () {
27
				dojo.widget.SvgWidget.call(this);
28
				this.buildRendering = function () {
29
					return;
30
				};
31
				this.destroyRendering = function () {
32
					return;
33
				};
34
				this.postInitialize = function () {
35
					return;
36
				};
37
				this.widgetType = "SVGRootWidget";
38
				this.domNode = document.documentElement;
39
			};
40
			var wm = dojo.widget.manager;
41
			wm.root = rw;
42
			wm.add(rw);
43
			wm.getWidgetFromNode = function (node) {
44
				var filter = function (x) {
45
					if (x.domNode == node) {
46
						return true;
47
					}
48
				};
49
				var widgets = [];
50
				while ((node) && (widgets.length < 1)) {
51
					widgets = this.getWidgetsByFilter(filter);
52
					node = node.parentNode;
53
				}
54
				if (widgets.length > 0) {
55
					return widgets[0];
56
				} else {
57
					return null;
58
				}
59
			};
60
			wm.getWidgetFromEvent = function (domEvt) {
61
				return this.getWidgetFromNode(domEvt.target);
62
			};
63
			wm.getWidgetFromPrimitive = wm.getWidgetFromNode;
64
		};
65
		dojo.event.connect(dojo.hostenv, "loaded", tf);
66
	})();
67
}
68
catch (e) {
69
	alert(e);
70
}
71