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.provide("dojo.widget.TaskBar");
|
|
|
14 |
dojo.require("dojo.widget.*");
|
|
|
15 |
dojo.require("dojo.widget.FloatingPane");
|
|
|
16 |
dojo.require("dojo.widget.HtmlWidget");
|
|
|
17 |
dojo.require("dojo.event.*");
|
|
|
18 |
dojo.require("dojo.html.selection");
|
|
|
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 () {
|
|
|
20 |
if (this.iconSrc) {
|
|
|
21 |
var img = document.createElement("img");
|
|
|
22 |
img.src = this.iconSrc;
|
|
|
23 |
this.domNode.appendChild(img);
|
|
|
24 |
}
|
|
|
25 |
this.domNode.appendChild(document.createTextNode(this.caption));
|
|
|
26 |
dojo.html.disableSelection(this.domNode);
|
|
|
27 |
}, postCreate:function () {
|
|
|
28 |
this.window = dojo.widget.getWidgetById(this.windowId);
|
|
|
29 |
this.window.explodeSrc = this.domNode;
|
|
|
30 |
dojo.event.connect(this.window, "destroy", this, "destroy");
|
|
|
31 |
}, onClick:function () {
|
|
|
32 |
this.window.toggleDisplay();
|
|
|
33 |
}});
|
|
|
34 |
dojo.widget.defineWidget("dojo.widget.TaskBar", dojo.widget.FloatingPane, function () {
|
|
|
35 |
this._addChildStack = [];
|
|
|
36 |
}, {resizable:false, titleBarDisplay:false, addChild:function (child) {
|
|
|
37 |
if (!this.containerNode) {
|
|
|
38 |
this._addChildStack.push(child);
|
|
|
39 |
} else {
|
|
|
40 |
if (this._addChildStack.length > 0) {
|
|
|
41 |
var oarr = this._addChildStack;
|
|
|
42 |
this._addChildStack = [];
|
|
|
43 |
dojo.lang.forEach(oarr, this.addChild, this);
|
|
|
44 |
}
|
|
|
45 |
}
|
|
|
46 |
var tbi = dojo.widget.createWidget("TaskBarItem", {windowId:child.widgetId, caption:child.title, iconSrc:child.iconSrc});
|
|
|
47 |
dojo.widget.TaskBar.superclass.addChild.call(this, tbi);
|
|
|
48 |
}});
|
|
|
49 |
|