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.provide("dojo.widget.FloatingPane");
13
dojo.provide("dojo.widget.FloatingPane");
12
dojo.require("dojo.widget.*");
14
dojo.require("dojo.widget.*");
13
dojo.require("dojo.widget.Manager");
15
dojo.require("dojo.widget.Manager");
14
dojo.require("dojo.html.*");
16
dojo.require("dojo.html.*");
15
dojo.require("dojo.html.layout");
17
dojo.require("dojo.html.layout");
16
dojo.require("dojo.html.iframe");
18
dojo.require("dojo.html.iframe");
17
dojo.require("dojo.html.selection");
19
dojo.require("dojo.html.selection");
18
dojo.require("dojo.lfx.shadow");
20
dojo.require("dojo.lfx.shadow");
19
dojo.require("dojo.widget.html.layout");
21
dojo.require("dojo.widget.html.layout");
20
dojo.require("dojo.widget.ContentPane");
22
dojo.require("dojo.widget.ContentPane");
21
dojo.require("dojo.dnd.HtmlDragMove");
23
dojo.require("dojo.dnd.HtmlDragMove");
22
dojo.require("dojo.widget.Dialog");
24
dojo.require("dojo.widget.Dialog");
23
dojo.require("dojo.widget.ResizeHandle");
25
dojo.require("dojo.widget.ResizeHandle");
24
dojo.declare("dojo.widget.FloatingPaneBase", null, {title:"", iconSrc:"", hasShadow:false, constrainToContainer:false, taskBarId:"", resizable:true, titleBarDisplay:true, windowState:"normal", displayCloseAction:false, displayMinimizeAction:false, displayMaximizeAction:false, _max_taskBarConnectAttempts:5, _taskBarConnectAttempts:0, templateString:"<div id=\"${this.widgetId}\" dojoAttachEvent=\"onMouseDown\" class=\"dojoFloatingPane\">\n\t<div dojoAttachPoint=\"titleBar\" class=\"dojoFloatingPaneTitleBar\"  style=\"display:none\">\n\t  \t<img dojoAttachPoint=\"titleBarIcon\"  class=\"dojoFloatingPaneTitleBarIcon\">\n\t\t<div dojoAttachPoint=\"closeAction\" dojoAttachEvent=\"onClick:closeWindow\"\n   \t  \t\tclass=\"dojoFloatingPaneCloseIcon\"></div>\n\t\t<div dojoAttachPoint=\"restoreAction\" dojoAttachEvent=\"onClick:restoreWindow\"\n   \t  \t\tclass=\"dojoFloatingPaneRestoreIcon\"></div>\n\t\t<div dojoAttachPoint=\"maximizeAction\" dojoAttachEvent=\"onClick:maximizeWindow\"\n   \t  \t\tclass=\"dojoFloatingPaneMaximizeIcon\"></div>\n\t\t<div dojoAttachPoint=\"minimizeAction\" dojoAttachEvent=\"onClick:minimizeWindow\"\n   \t  \t\tclass=\"dojoFloatingPaneMinimizeIcon\"></div>\n\t  \t<div dojoAttachPoint=\"titleBarText\" class=\"dojoFloatingPaneTitleText\">${this.title}</div>\n\t</div>\n\n\t<div id=\"${this.widgetId}_container\" dojoAttachPoint=\"containerNode\" class=\"dojoFloatingPaneClient\"></div>\n\n\t<div dojoAttachPoint=\"resizeBar\" class=\"dojoFloatingPaneResizebar\" style=\"display:none\"></div>\n</div>\n", templateCssString:"\n/********** Outer Window ***************/\n\n.dojoFloatingPane {\n\t/* essential css */\n\tposition: absolute;\n\toverflow: visible;\t\t/* so drop shadow is displayed */\n\tz-index: 10;\n\n\t/* styling css */\n\tborder: 1px solid;\n\tborder-color: ThreeDHighlight ThreeDShadow ThreeDShadow ThreeDHighlight;\n\tbackground-color: ThreeDFace;\n}\n\n\n/********** Title Bar ****************/\n\n.dojoFloatingPaneTitleBar {\n\tvertical-align: top;\n\tmargin: 2px 2px 2px 2px;\n\tz-index: 10;\n\tbackground-color: #7596c6;\n\tcursor: default;\n\toverflow: hidden;\n\tborder-color: ThreeDHighlight ThreeDShadow ThreeDShadow ThreeDHighlight;\n\tvertical-align: middle;\n}\n\n.dojoFloatingPaneTitleText {\n\tfloat: left;\n\tpadding: 2px 4px 2px 2px;\n\twhite-space: nowrap;\n\tcolor: CaptionText;\n\tfont: small-caption;\n}\n\n.dojoTitleBarIcon {\n\tfloat: left;\n\theight: 22px;\n\twidth: 22px;\n\tvertical-align: middle;\n\tmargin-right: 5px;\n\tmargin-left: 5px;\n}\n\n.dojoFloatingPaneActions{\n\tfloat: right;\n\tposition: absolute;\n\tright: 2px;\n\ttop: 2px;\n\tvertical-align: middle;\n}\n\n\n.dojoFloatingPaneActionItem {\n\tvertical-align: middle;\n\tmargin-right: 1px;\n\theight: 22px;\n\twidth: 22px;\n}\n\n\n.dojoFloatingPaneTitleBarIcon {\n\t/* essential css */\n\tfloat: left;\n\n\t/* styling css */\n\tmargin-left: 2px;\n\tmargin-right: 4px;\n\theight: 22px;\n}\n\n/* minimize/maximize icons are specified by CSS only */\n.dojoFloatingPaneMinimizeIcon,\n.dojoFloatingPaneMaximizeIcon,\n.dojoFloatingPaneRestoreIcon,\n.dojoFloatingPaneCloseIcon {\n\tvertical-align: middle;\n\theight: 22px;\n\twidth: 22px;\n\tfloat: right;\n}\n.dojoFloatingPaneMinimizeIcon {\n\tbackground-image: url(images/floatingPaneMinimize.gif);\n}\n.dojoFloatingPaneMaximizeIcon {\n\tbackground-image: url(images/floatingPaneMaximize.gif);\n}\n.dojoFloatingPaneRestoreIcon {\n\tbackground-image: url(images/floatingPaneRestore.gif);\n}\n.dojoFloatingPaneCloseIcon {\n\tbackground-image: url(images/floatingPaneClose.gif);\n}\n\n/* bar at bottom of window that holds resize handle */\n.dojoFloatingPaneResizebar {\n\tz-index: 10;\n\theight: 13px;\n\tbackground-color: ThreeDFace;\n}\n\n/************* Client Area ***************/\n\n.dojoFloatingPaneClient {\n\tposition: relative;\n\tz-index: 10;\n\tborder: 1px solid;\n\tborder-color: ThreeDShadow ThreeDHighlight ThreeDHighlight ThreeDShadow;\n\tmargin: 2px;\n\tbackground-color: ThreeDFace;\n\tpadding: 8px;\n\tfont-family: Verdana, Helvetica, Garamond, sans-serif;\n\tfont-size: 12px;\n\toverflow: auto;\n}\n\n", templateCssPath:dojo.uri.moduleUri("dojo.widget", "templates/FloatingPane.css"), fillInFloatingPaneTemplate:function (args, frag) {
26
dojo.declare("dojo.widget.FloatingPaneBase", null, {title:"", iconSrc:"", hasShadow:false, constrainToContainer:false, taskBarId:"", resizable:true, titleBarDisplay:true, windowState:"normal", displayCloseAction:false, displayMinimizeAction:false, displayMaximizeAction:false, _max_taskBarConnectAttempts:5, _taskBarConnectAttempts:0, templateString:"<div id=\"${this.widgetId}\" dojoAttachEvent=\"onMouseDown\" class=\"dojoFloatingPane\">\n\t<div dojoAttachPoint=\"titleBar\" class=\"dojoFloatingPaneTitleBar\"  style=\"display:none\">\n\t  \t<img dojoAttachPoint=\"titleBarIcon\"  class=\"dojoFloatingPaneTitleBarIcon\">\n\t\t<div dojoAttachPoint=\"closeAction\" dojoAttachEvent=\"onClick:closeWindow\"\n   \t  \t\tclass=\"dojoFloatingPaneCloseIcon\"></div>\n\t\t<div dojoAttachPoint=\"restoreAction\" dojoAttachEvent=\"onClick:restoreWindow\"\n   \t  \t\tclass=\"dojoFloatingPaneRestoreIcon\"></div>\n\t\t<div dojoAttachPoint=\"maximizeAction\" dojoAttachEvent=\"onClick:maximizeWindow\"\n   \t  \t\tclass=\"dojoFloatingPaneMaximizeIcon\"></div>\n\t\t<div dojoAttachPoint=\"minimizeAction\" dojoAttachEvent=\"onClick:minimizeWindow\"\n   \t  \t\tclass=\"dojoFloatingPaneMinimizeIcon\"></div>\n\t  \t<div dojoAttachPoint=\"titleBarText\" class=\"dojoFloatingPaneTitleText\">${this.title}</div>\n\t</div>\n\n\t<div id=\"${this.widgetId}_container\" dojoAttachPoint=\"containerNode\" class=\"dojoFloatingPaneClient\"></div>\n\n\t<div dojoAttachPoint=\"resizeBar\" class=\"dojoFloatingPaneResizebar\" style=\"display:none\"></div>\n</div>\n", templateCssString:"\n/********** Outer Window ***************/\n\n.dojoFloatingPane {\n\t/* essential css */\n\tposition: absolute;\n\toverflow: visible;\t\t/* so drop shadow is displayed */\n\tz-index: 10;\n\n\t/* styling css */\n\tborder: 1px solid;\n\tborder-color: ThreeDHighlight ThreeDShadow ThreeDShadow ThreeDHighlight;\n\tbackground-color: ThreeDFace;\n}\n\n\n/********** Title Bar ****************/\n\n.dojoFloatingPaneTitleBar {\n\tvertical-align: top;\n\tmargin: 2px 2px 2px 2px;\n\tz-index: 10;\n\tbackground-color: #7596c6;\n\tcursor: default;\n\toverflow: hidden;\n\tborder-color: ThreeDHighlight ThreeDShadow ThreeDShadow ThreeDHighlight;\n\tvertical-align: middle;\n}\n\n.dojoFloatingPaneTitleText {\n\tfloat: left;\n\tpadding: 2px 4px 2px 2px;\n\twhite-space: nowrap;\n\tcolor: CaptionText;\n\tfont: small-caption;\n}\n\n.dojoTitleBarIcon {\n\tfloat: left;\n\theight: 22px;\n\twidth: 22px;\n\tvertical-align: middle;\n\tmargin-right: 5px;\n\tmargin-left: 5px;\n}\n\n.dojoFloatingPaneActions{\n\tfloat: right;\n\tposition: absolute;\n\tright: 2px;\n\ttop: 2px;\n\tvertical-align: middle;\n}\n\n\n.dojoFloatingPaneActionItem {\n\tvertical-align: middle;\n\tmargin-right: 1px;\n\theight: 22px;\n\twidth: 22px;\n}\n\n\n.dojoFloatingPaneTitleBarIcon {\n\t/* essential css */\n\tfloat: left;\n\n\t/* styling css */\n\tmargin-left: 2px;\n\tmargin-right: 4px;\n\theight: 22px;\n}\n\n/* minimize/maximize icons are specified by CSS only */\n.dojoFloatingPaneMinimizeIcon,\n.dojoFloatingPaneMaximizeIcon,\n.dojoFloatingPaneRestoreIcon,\n.dojoFloatingPaneCloseIcon {\n\tvertical-align: middle;\n\theight: 22px;\n\twidth: 22px;\n\tfloat: right;\n}\n.dojoFloatingPaneMinimizeIcon {\n\tbackground-image: url(images/floatingPaneMinimize.gif);\n}\n.dojoFloatingPaneMaximizeIcon {\n\tbackground-image: url(images/floatingPaneMaximize.gif);\n}\n.dojoFloatingPaneRestoreIcon {\n\tbackground-image: url(images/floatingPaneRestore.gif);\n}\n.dojoFloatingPaneCloseIcon {\n\tbackground-image: url(images/floatingPaneClose.gif);\n}\n\n/* bar at bottom of window that holds resize handle */\n.dojoFloatingPaneResizebar {\n\tz-index: 10;\n\theight: 13px;\n\tbackground-color: ThreeDFace;\n}\n\n/************* Client Area ***************/\n\n.dojoFloatingPaneClient {\n\tposition: relative;\n\tz-index: 10;\n\tborder: 1px solid;\n\tborder-color: ThreeDShadow ThreeDHighlight ThreeDHighlight ThreeDShadow;\n\tmargin: 2px;\n\tbackground-color: ThreeDFace;\n\tpadding: 8px;\n\tfont-family: Verdana, Helvetica, Garamond, sans-serif;\n\tfont-size: 12px;\n\toverflow: auto;\n}\n\n", templateCssPath:dojo.uri.moduleUri("dojo.widget", "templates/FloatingPane.css"), fillInFloatingPaneTemplate:function (args, frag) {
25
	var source = this.getFragNodeRef(frag);
27
	var source = this.getFragNodeRef(frag);
26
	dojo.html.copyStyle(this.domNode, source);
28
	dojo.html.copyStyle(this.domNode, source);
27
	dojo.body().appendChild(this.domNode);
29
	dojo.body().appendChild(this.domNode);
28
	if (!this.isShowing()) {
30
	if (!this.isShowing()) {
29
		this.windowState = "minimized";
31
		this.windowState = "minimized";
30
	}
32
	}
31
	if (this.iconSrc == "") {
33
	if (this.iconSrc == "") {
32
		dojo.html.removeNode(this.titleBarIcon);
34
		dojo.html.removeNode(this.titleBarIcon);
33
	} else {
35
	} else {
34
		this.titleBarIcon.src = this.iconSrc.toString();
36
		this.titleBarIcon.src = this.iconSrc.toString();
35
	}
37
	}
36
	if (this.titleBarDisplay) {
38
	if (this.titleBarDisplay) {
37
		this.titleBar.style.display = "";
39
		this.titleBar.style.display = "";
38
		dojo.html.disableSelection(this.titleBar);
40
		dojo.html.disableSelection(this.titleBar);
39
		this.titleBarIcon.style.display = (this.iconSrc == "" ? "none" : "");
41
		this.titleBarIcon.style.display = (this.iconSrc == "" ? "none" : "");
40
		this.minimizeAction.style.display = (this.displayMinimizeAction ? "" : "none");
42
		this.minimizeAction.style.display = (this.displayMinimizeAction ? "" : "none");
41
		this.maximizeAction.style.display = (this.displayMaximizeAction && this.windowState != "maximized" ? "" : "none");
43
		this.maximizeAction.style.display = (this.displayMaximizeAction && this.windowState != "maximized" ? "" : "none");
42
		this.restoreAction.style.display = (this.displayMaximizeAction && this.windowState == "maximized" ? "" : "none");
44
		this.restoreAction.style.display = (this.displayMaximizeAction && this.windowState == "maximized" ? "" : "none");
43
		this.closeAction.style.display = (this.displayCloseAction ? "" : "none");
45
		this.closeAction.style.display = (this.displayCloseAction ? "" : "none");
44
		this.drag = new dojo.dnd.HtmlDragMoveSource(this.domNode);
46
		this.drag = new dojo.dnd.HtmlDragMoveSource(this.domNode);
45
		if (this.constrainToContainer) {
47
		if (this.constrainToContainer) {
46
			this.drag.constrainTo();
48
			this.drag.constrainTo();
47
		}
49
		}
48
		this.drag.setDragHandle(this.titleBar);
50
		this.drag.setDragHandle(this.titleBar);
49
		var self = this;
51
		var self = this;
50
		dojo.event.topic.subscribe("dragMove", function (info) {
52
		dojo.event.topic.subscribe("dragMove", function (info) {
51
			if (info.source.domNode == self.domNode) {
53
			if (info.source.domNode == self.domNode) {
52
				dojo.event.topic.publish("floatingPaneMove", {source:self});
54
				dojo.event.topic.publish("floatingPaneMove", {source:self});
53
			}
55
			}
54
		});
56
		});
55
	}
57
	}
56
	if (this.resizable) {
58
	if (this.resizable) {
57
		this.resizeBar.style.display = "";
59
		this.resizeBar.style.display = "";
58
		this.resizeHandle = dojo.widget.createWidget("ResizeHandle", {targetElmId:this.widgetId, id:this.widgetId + "_resize"});
60
		this.resizeHandle = dojo.widget.createWidget("ResizeHandle", {targetElmId:this.widgetId, id:this.widgetId + "_resize"});
59
		this.resizeBar.appendChild(this.resizeHandle.domNode);
61
		this.resizeBar.appendChild(this.resizeHandle.domNode);
60
	}
62
	}
61
	if (this.hasShadow) {
63
	if (this.hasShadow) {
62
		this.shadow = new dojo.lfx.shadow(this.domNode);
64
		this.shadow = new dojo.lfx.shadow(this.domNode);
63
	}
65
	}
64
	this.bgIframe = new dojo.html.BackgroundIframe(this.domNode);
66
	this.bgIframe = new dojo.html.BackgroundIframe(this.domNode);
65
	if (this.taskBarId) {
67
	if (this.taskBarId) {
66
		this._taskBarSetup();
68
		this._taskBarSetup();
67
	}
69
	}
68
	dojo.body().removeChild(this.domNode);
70
	dojo.body().removeChild(this.domNode);
69
}, postCreate:function () {
71
}, postCreate:function () {
70
	if (dojo.hostenv.post_load_) {
72
	if (dojo.hostenv.post_load_) {
71
		this._setInitialWindowState();
73
		this._setInitialWindowState();
72
	} else {
74
	} else {
73
		dojo.addOnLoad(this, "_setInitialWindowState");
75
		dojo.addOnLoad(this, "_setInitialWindowState");
74
	}
76
	}
75
}, maximizeWindow:function (evt) {
77
}, maximizeWindow:function (evt) {
76
	var mb = dojo.html.getMarginBox(this.domNode);
78
	var mb = dojo.html.getMarginBox(this.domNode);
77
	this.previous = {width:mb.width || this.width, height:mb.height || this.height, left:this.domNode.style.left, top:this.domNode.style.top, bottom:this.domNode.style.bottom, right:this.domNode.style.right};
79
	this.previous = {width:mb.width || this.width, height:mb.height || this.height, left:this.domNode.style.left, top:this.domNode.style.top, bottom:this.domNode.style.bottom, right:this.domNode.style.right};
78
	if (this.domNode.parentNode.style.overflow.toLowerCase() != "hidden") {
80
	if (this.domNode.parentNode.style.overflow.toLowerCase() != "hidden") {
79
		this.parentPrevious = {overflow:this.domNode.parentNode.style.overflow};
81
		this.parentPrevious = {overflow:this.domNode.parentNode.style.overflow};
80
		dojo.debug(this.domNode.parentNode.style.overflow);
82
		dojo.debug(this.domNode.parentNode.style.overflow);
81
		this.domNode.parentNode.style.overflow = "hidden";
83
		this.domNode.parentNode.style.overflow = "hidden";
82
	}
84
	}
83
	this.domNode.style.left = dojo.html.getPixelValue(this.domNode.parentNode, "padding-left", true) + "px";
85
	this.domNode.style.left = dojo.html.getPixelValue(this.domNode.parentNode, "padding-left", true) + "px";
84
	this.domNode.style.top = dojo.html.getPixelValue(this.domNode.parentNode, "padding-top", true) + "px";
86
	this.domNode.style.top = dojo.html.getPixelValue(this.domNode.parentNode, "padding-top", true) + "px";
85
	if ((this.domNode.parentNode.nodeName.toLowerCase() == "body")) {
87
	if ((this.domNode.parentNode.nodeName.toLowerCase() == "body")) {
86
		var viewport = dojo.html.getViewport();
88
		var viewport = dojo.html.getViewport();
87
		var padding = dojo.html.getPadding(dojo.body());
89
		var padding = dojo.html.getPadding(dojo.body());
88
		this.resizeTo(viewport.width - padding.width, viewport.height - padding.height);
90
		this.resizeTo(viewport.width - padding.width, viewport.height - padding.height);
89
	} else {
91
	} else {
90
		var content = dojo.html.getContentBox(this.domNode.parentNode);
92
		var content = dojo.html.getContentBox(this.domNode.parentNode);
91
		this.resizeTo(content.width, content.height);
93
		this.resizeTo(content.width, content.height);
92
	}
94
	}
93
	this.maximizeAction.style.display = "none";
95
	this.maximizeAction.style.display = "none";
94
	this.restoreAction.style.display = "";
96
	this.restoreAction.style.display = "";
95
	if (this.resizeHandle) {
97
	if (this.resizeHandle) {
96
		this.resizeHandle.domNode.style.display = "none";
98
		this.resizeHandle.domNode.style.display = "none";
97
	}
99
	}
98
	this.drag.setDragHandle(null);
100
	this.drag.setDragHandle(null);
99
	this.windowState = "maximized";
101
	this.windowState = "maximized";
100
}, minimizeWindow:function (evt) {
102
}, minimizeWindow:function (evt) {
101
	this.hide();
103
	this.hide();
102
	for (var attr in this.parentPrevious) {
104
	for (var attr in this.parentPrevious) {
103
		this.domNode.parentNode.style[attr] = this.parentPrevious[attr];
105
		this.domNode.parentNode.style[attr] = this.parentPrevious[attr];
104
	}
106
	}
105
	this.lastWindowState = this.windowState;
107
	this.lastWindowState = this.windowState;
106
	this.windowState = "minimized";
108
	this.windowState = "minimized";
107
}, restoreWindow:function (evt) {
109
}, restoreWindow:function (evt) {
108
	if (this.windowState == "minimized") {
110
	if (this.windowState == "minimized") {
109
		this.show();
111
		this.show();
110
		if (this.lastWindowState == "maximized") {
112
		if (this.lastWindowState == "maximized") {
111
			this.domNode.parentNode.style.overflow = "hidden";
113
			this.domNode.parentNode.style.overflow = "hidden";
112
			this.windowState = "maximized";
114
			this.windowState = "maximized";
113
		} else {
115
		} else {
114
			this.windowState = "normal";
116
			this.windowState = "normal";
115
		}
117
		}
116
	} else {
118
	} else {
117
		if (this.windowState == "maximized") {
119
		if (this.windowState == "maximized") {
118
			for (var attr in this.previous) {
120
			for (var attr in this.previous) {
119
				this.domNode.style[attr] = this.previous[attr];
121
				this.domNode.style[attr] = this.previous[attr];
120
			}
122
			}
121
			for (var attr in this.parentPrevious) {
123
			for (var attr in this.parentPrevious) {
122
				this.domNode.parentNode.style[attr] = this.parentPrevious[attr];
124
				this.domNode.parentNode.style[attr] = this.parentPrevious[attr];
123
			}
125
			}
124
			this.resizeTo(this.previous.width, this.previous.height);
126
			this.resizeTo(this.previous.width, this.previous.height);
125
			this.previous = null;
127
			this.previous = null;
126
			this.parentPrevious = null;
128
			this.parentPrevious = null;
127
			this.restoreAction.style.display = "none";
129
			this.restoreAction.style.display = "none";
128
			this.maximizeAction.style.display = this.displayMaximizeAction ? "" : "none";
130
			this.maximizeAction.style.display = this.displayMaximizeAction ? "" : "none";
129
			if (this.resizeHandle) {
131
			if (this.resizeHandle) {
130
				this.resizeHandle.domNode.style.display = "";
132
				this.resizeHandle.domNode.style.display = "";
131
			}
133
			}
132
			this.drag.setDragHandle(this.titleBar);
134
			this.drag.setDragHandle(this.titleBar);
133
			this.windowState = "normal";
135
			this.windowState = "normal";
134
		} else {
136
		} else {
135
		}
137
		}
136
	}
138
	}
137
}, toggleDisplay:function () {
139
}, toggleDisplay:function () {
138
	if (this.windowState == "minimized") {
140
	if (this.windowState == "minimized") {
139
		this.restoreWindow();
141
		this.restoreWindow();
140
	} else {
142
	} else {
141
		this.minimizeWindow();
143
		this.minimizeWindow();
142
	}
144
	}
143
}, closeWindow:function (evt) {
145
}, closeWindow:function (evt) {
144
	dojo.html.removeNode(this.domNode);
146
	dojo.html.removeNode(this.domNode);
145
	this.destroy();
147
	this.destroy();
146
}, onMouseDown:function (evt) {
148
}, onMouseDown:function (evt) {
147
	this.bringToTop();
149
	this.bringToTop();
148
}, bringToTop:function () {
150
}, bringToTop:function () {
149
	var floatingPanes = dojo.widget.manager.getWidgetsByType(this.widgetType);
151
	var floatingPanes = dojo.widget.manager.getWidgetsByType(this.widgetType);
150
	var windows = [];
152
	var windows = [];
151
	for (var x = 0; x < floatingPanes.length; x++) {
153
	for (var x = 0; x < floatingPanes.length; x++) {
152
		if (this.widgetId != floatingPanes[x].widgetId) {
154
		if (this.widgetId != floatingPanes[x].widgetId) {
153
			windows.push(floatingPanes[x]);
155
			windows.push(floatingPanes[x]);
154
		}
156
		}
155
	}
157
	}
156
	windows.sort(function (a, b) {
158
	windows.sort(function (a, b) {
157
		return a.domNode.style.zIndex - b.domNode.style.zIndex;
159
		return a.domNode.style.zIndex - b.domNode.style.zIndex;
158
	});
160
	});
159
	windows.push(this);
161
	windows.push(this);
160
	var floatingPaneStartingZ = 100;
162
	var floatingPaneStartingZ = 100;
161
	for (x = 0; x < windows.length; x++) {
163
	for (x = 0; x < windows.length; x++) {
162
		windows[x].domNode.style.zIndex = floatingPaneStartingZ + x * 2;
164
		windows[x].domNode.style.zIndex = floatingPaneStartingZ + x * 2;
163
	}
165
	}
164
}, _setInitialWindowState:function () {
166
}, _setInitialWindowState:function () {
165
	if (this.isShowing()) {
167
	if (this.isShowing()) {
166
		this.width = -1;
168
		this.width = -1;
167
		var mb = dojo.html.getMarginBox(this.domNode);
169
		var mb = dojo.html.getMarginBox(this.domNode);
168
		this.resizeTo(mb.width, mb.height);
170
		this.resizeTo(mb.width, mb.height);
169
	}
171
	}
170
	if (this.windowState == "maximized") {
172
	if (this.windowState == "maximized") {
171
		this.maximizeWindow();
173
		this.maximizeWindow();
172
		this.show();
174
		this.show();
173
		return;
175
		return;
174
	}
176
	}
175
	if (this.windowState == "normal") {
177
	if (this.windowState == "normal") {
176
		this.show();
178
		this.show();
177
		return;
179
		return;
178
	}
180
	}
179
	if (this.windowState == "minimized") {
181
	if (this.windowState == "minimized") {
180
		this.hide();
182
		this.hide();
181
		return;
183
		return;
182
	}
184
	}
183
	this.windowState = "minimized";
185
	this.windowState = "minimized";
184
}, _taskBarSetup:function () {
186
}, _taskBarSetup:function () {
185
	var taskbar = dojo.widget.getWidgetById(this.taskBarId);
187
	var taskbar = dojo.widget.getWidgetById(this.taskBarId);
186
	if (!taskbar) {
188
	if (!taskbar) {
187
		if (this._taskBarConnectAttempts < this._max_taskBarConnectAttempts) {
189
		if (this._taskBarConnectAttempts < this._max_taskBarConnectAttempts) {
188
			dojo.lang.setTimeout(this, this._taskBarSetup, 50);
190
			dojo.lang.setTimeout(this, this._taskBarSetup, 50);
189
			this._taskBarConnectAttempts++;
191
			this._taskBarConnectAttempts++;
190
		} else {
192
		} else {
191
			dojo.debug("Unable to connect to the taskBar");
193
			dojo.debug("Unable to connect to the taskBar");
192
		}
194
		}
193
		return;
195
		return;
194
	}
196
	}
195
	taskbar.addChild(this);
197
	taskbar.addChild(this);
196
}, showFloatingPane:function () {
198
}, showFloatingPane:function () {
197
	this.bringToTop();
199
	this.bringToTop();
198
}, onFloatingPaneShow:function () {
200
}, onFloatingPaneShow:function () {
199
	var mb = dojo.html.getMarginBox(this.domNode);
201
	var mb = dojo.html.getMarginBox(this.domNode);
200
	this.resizeTo(mb.width, mb.height);
202
	this.resizeTo(mb.width, mb.height);
201
}, resizeTo:function (width, height) {
203
}, resizeTo:function (width, height) {
202
	dojo.html.setMarginBox(this.domNode, {width:width, height:height});
204
	dojo.html.setMarginBox(this.domNode, {width:width, height:height});
203
	dojo.widget.html.layout(this.domNode, [{domNode:this.titleBar, layoutAlign:"top"}, {domNode:this.resizeBar, layoutAlign:"bottom"}, {domNode:this.containerNode, layoutAlign:"client"}]);
205
	dojo.widget.html.layout(this.domNode, [{domNode:this.titleBar, layoutAlign:"top"}, {domNode:this.resizeBar, layoutAlign:"bottom"}, {domNode:this.containerNode, layoutAlign:"client"}]);
204
	dojo.widget.html.layout(this.containerNode, this.children, "top-bottom");
206
	dojo.widget.html.layout(this.containerNode, this.children, "top-bottom");
205
	this.bgIframe.onResized();
207
	this.bgIframe.onResized();
206
	if (this.shadow) {
208
	if (this.shadow) {
207
		this.shadow.size(width, height);
209
		this.shadow.size(width, height);
208
	}
210
	}
209
	this.onResized();
211
	this.onResized();
210
}, checkSize:function () {
212
}, checkSize:function () {
211
}, destroyFloatingPane:function () {
213
}, destroyFloatingPane:function () {
212
	if (this.resizeHandle) {
214
	if (this.resizeHandle) {
213
		this.resizeHandle.destroy();
215
		this.resizeHandle.destroy();
214
		this.resizeHandle = null;
216
		this.resizeHandle = null;
215
	}
217
	}
216
}});
218
}});
217
dojo.widget.defineWidget("dojo.widget.FloatingPane", [dojo.widget.ContentPane, dojo.widget.FloatingPaneBase], {fillInTemplate:function (args, frag) {
219
dojo.widget.defineWidget("dojo.widget.FloatingPane", [dojo.widget.ContentPane, dojo.widget.FloatingPaneBase], {fillInTemplate:function (args, frag) {
218
	this.fillInFloatingPaneTemplate(args, frag);
220
	this.fillInFloatingPaneTemplate(args, frag);
219
	dojo.widget.FloatingPane.superclass.fillInTemplate.call(this, args, frag);
221
	dojo.widget.FloatingPane.superclass.fillInTemplate.call(this, args, frag);
220
}, postCreate:function () {
222
}, postCreate:function () {
221
	dojo.widget.FloatingPaneBase.prototype.postCreate.apply(this, arguments);
223
	dojo.widget.FloatingPaneBase.prototype.postCreate.apply(this, arguments);
222
	dojo.widget.FloatingPane.superclass.postCreate.apply(this, arguments);
224
	dojo.widget.FloatingPane.superclass.postCreate.apply(this, arguments);
223
}, show:function () {
225
}, show:function () {
224
	dojo.widget.FloatingPane.superclass.show.apply(this, arguments);
226
	dojo.widget.FloatingPane.superclass.show.apply(this, arguments);
225
	this.showFloatingPane();
227
	this.showFloatingPane();
226
}, onShow:function () {
228
}, onShow:function () {
227
	dojo.widget.FloatingPane.superclass.onShow.call(this);
229
	dojo.widget.FloatingPane.superclass.onShow.call(this);
228
	this.onFloatingPaneShow();
230
	this.onFloatingPaneShow();
229
}, destroy:function () {
231
}, destroy:function () {
230
	this.destroyFloatingPane();
232
	this.destroyFloatingPane();
231
	dojo.widget.FloatingPane.superclass.destroy.apply(this, arguments);
233
	dojo.widget.FloatingPane.superclass.destroy.apply(this, arguments);
232
}});
234
}});
233
dojo.widget.defineWidget("dojo.widget.ModalFloatingPane", [dojo.widget.FloatingPane, dojo.widget.ModalDialogBase], {windowState:"minimized", displayCloseAction:true, postCreate:function () {
235
dojo.widget.defineWidget("dojo.widget.ModalFloatingPane", [dojo.widget.FloatingPane, dojo.widget.ModalDialogBase], {windowState:"minimized", displayCloseAction:true, postCreate:function () {
234
	dojo.widget.ModalDialogBase.prototype.postCreate.call(this);
236
	dojo.widget.ModalDialogBase.prototype.postCreate.call(this);
235
	dojo.widget.ModalFloatingPane.superclass.postCreate.call(this);
237
	dojo.widget.ModalFloatingPane.superclass.postCreate.call(this);
236
}, show:function () {
238
}, show:function () {
237
	this.showModalDialog();
239
	this.showModalDialog();
238
	dojo.widget.ModalFloatingPane.superclass.show.apply(this, arguments);
240
	dojo.widget.ModalFloatingPane.superclass.show.apply(this, arguments);
239
	this.bg.style.zIndex = this.domNode.style.zIndex - 1;
241
	this.bg.style.zIndex = this.domNode.style.zIndex - 1;
240
}, hide:function () {
242
}, hide:function () {
241
	this.hideModalDialog();
243
	this.hideModalDialog();
242
	dojo.widget.ModalFloatingPane.superclass.hide.apply(this, arguments);
244
	dojo.widget.ModalFloatingPane.superclass.hide.apply(this, arguments);
243
}, closeWindow:function () {
245
}, closeWindow:function () {
244
	this.hide();
246
	this.hide();
245
	dojo.widget.ModalFloatingPane.superclass.closeWindow.apply(this, arguments);
247
	dojo.widget.ModalFloatingPane.superclass.closeWindow.apply(this, arguments);
246
}});
248
}});
247
 
249