Subversion Repositories Applications.papyrus

Rev

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

Rev 1318 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.TaskBar");
13
dojo.provide("dojo.widget.TaskBar");
12
dojo.require("dojo.widget.*");
14
dojo.require("dojo.widget.*");
13
dojo.require("dojo.widget.FloatingPane");
15
dojo.require("dojo.widget.FloatingPane");
14
dojo.require("dojo.widget.HtmlWidget");
16
dojo.require("dojo.widget.HtmlWidget");
15
dojo.require("dojo.event.*");
17
dojo.require("dojo.event.*");
16
dojo.require("dojo.html.selection");
18
dojo.require("dojo.html.selection");
17
dojo.widget.defineWidget("dojo.widget.TaskBarItem", dojo.widget.HtmlWidget, {iconSrc:"", caption:"Untitled", templateString:"<div class=\"dojoTaskBarItem\" dojoAttachEvent=\"onClick\">\n</div>\n", templateCssString:".dojoTaskBarItem {\n\tdisplay: inline-block;\n\tbackground-color: ThreeDFace;\n\tborder: outset 2px;\n\tmargin-right: 5px;\n\tcursor: pointer;\n\theight: 35px;\n\twidth: 100px;\n\tfont-size: 10pt;\n\twhite-space: nowrap;\n\ttext-align: center;\n\tfloat: left;\n\toverflow: hidden;\n}\n\n.dojoTaskBarItem img {\n\tvertical-align: middle;\n\tmargin-right: 5px;\n\tmargin-left: 5px;\t\n\theight: 32px;\n\twidth: 32px;\n}\n\n.dojoTaskBarItem a {\n\t color: black;\n\ttext-decoration: none;\n}\n\n\n", templateCssPath:dojo.uri.moduleUri("dojo.widget", "templates/TaskBar.css"), fillInTemplate:function () {
19
dojo.widget.defineWidget("dojo.widget.TaskBarItem", dojo.widget.HtmlWidget, {iconSrc:"", caption:"Untitled", templateString:"<div class=\"dojoTaskBarItem\" dojoAttachEvent=\"onClick\">\n</div>\n", templateCssString:".dojoTaskBarItem {\n\tdisplay: inline-block;\n\tbackground-color: ThreeDFace;\n\tborder: outset 2px;\n\tmargin-right: 5px;\n\tcursor: pointer;\n\theight: 35px;\n\twidth: 100px;\n\tfont-size: 10pt;\n\twhite-space: nowrap;\n\ttext-align: center;\n\tfloat: left;\n\toverflow: hidden;\n}\n\n.dojoTaskBarItem img {\n\tvertical-align: middle;\n\tmargin-right: 5px;\n\tmargin-left: 5px;\t\n\theight: 32px;\n\twidth: 32px;\n}\n\n.dojoTaskBarItem a {\n\t color: black;\n\ttext-decoration: none;\n}\n\n\n", templateCssPath:dojo.uri.moduleUri("dojo.widget", "templates/TaskBar.css"), fillInTemplate:function () {
18
	if (this.iconSrc) {
20
	if (this.iconSrc) {
19
		var img = document.createElement("img");
21
		var img = document.createElement("img");
20
		img.src = this.iconSrc;
22
		img.src = this.iconSrc;
21
		this.domNode.appendChild(img);
23
		this.domNode.appendChild(img);
22
	}
24
	}
23
	this.domNode.appendChild(document.createTextNode(this.caption));
25
	this.domNode.appendChild(document.createTextNode(this.caption));
24
	dojo.html.disableSelection(this.domNode);
26
	dojo.html.disableSelection(this.domNode);
25
}, postCreate:function () {
27
}, postCreate:function () {
26
	this.window = dojo.widget.getWidgetById(this.windowId);
28
	this.window = dojo.widget.getWidgetById(this.windowId);
27
	this.window.explodeSrc = this.domNode;
29
	this.window.explodeSrc = this.domNode;
28
	dojo.event.connect(this.window, "destroy", this, "destroy");
30
	dojo.event.connect(this.window, "destroy", this, "destroy");
29
}, onClick:function () {
31
}, onClick:function () {
30
	this.window.toggleDisplay();
32
	this.window.toggleDisplay();
31
}});
33
}});
32
dojo.widget.defineWidget("dojo.widget.TaskBar", dojo.widget.FloatingPane, function () {
34
dojo.widget.defineWidget("dojo.widget.TaskBar", dojo.widget.FloatingPane, function () {
33
	this._addChildStack = [];
35
	this._addChildStack = [];
34
}, {resizable:false, titleBarDisplay:false, addChild:function (child) {
36
}, {resizable:false, titleBarDisplay:false, addChild:function (child) {
35
	if (!this.containerNode) {
37
	if (!this.containerNode) {
36
		this._addChildStack.push(child);
38
		this._addChildStack.push(child);
37
	} else {
39
	} else {
38
		if (this._addChildStack.length > 0) {
40
		if (this._addChildStack.length > 0) {
39
			var oarr = this._addChildStack;
41
			var oarr = this._addChildStack;
40
			this._addChildStack = [];
42
			this._addChildStack = [];
41
			dojo.lang.forEach(oarr, this.addChild, this);
43
			dojo.lang.forEach(oarr, this.addChild, this);
42
		}
44
		}
43
	}
45
	}
44
	var tbi = dojo.widget.createWidget("TaskBarItem", {windowId:child.widgetId, caption:child.title, iconSrc:child.iconSrc});
46
	var tbi = dojo.widget.createWidget("TaskBarItem", {windowId:child.widgetId, caption:child.title, iconSrc:child.iconSrc});
45
	dojo.widget.TaskBar.superclass.addChild.call(this, tbi);
47
	dojo.widget.TaskBar.superclass.addChild.call(this, tbi);
46
}});
48
}});
47
 
49