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
dojo.provide("dojo.widget.Editor2Toolbar");
12
dojo.require("dojo.lang.*");
13
dojo.require("dojo.widget.*");
14
dojo.require("dojo.event.*");
15
dojo.require("dojo.html.layout");
16
dojo.require("dojo.html.display");
17
dojo.require("dojo.widget.RichText");
18
dojo.require("dojo.widget.PopupContainer");
19
dojo.require("dojo.widget.ColorPalette");
20
dojo.lang.declare("dojo.widget.HandlerManager", null, function () {
21
	this._registeredHandlers = [];
22
}, {registerHandler:function (obj, func) {
23
	if (arguments.length == 2) {
24
		this._registeredHandlers.push(function () {
25
			return obj[func].apply(obj, arguments);
26
		});
27
	} else {
28
		this._registeredHandlers.push(obj);
29
	}
30
}, removeHandler:function (func) {
31
	for (var i = 0; i < this._registeredHandlers.length; i++) {
32
		if (func === this._registeredHandlers[i]) {
33
			delete this._registeredHandlers[i];
34
			return;
35
		}
36
	}
37
	dojo.debug("HandlerManager handler " + func + " is not registered, can not remove.");
38
}, destroy:function () {
39
	for (var i = 0; i < this._registeredHandlers.length; i++) {
40
		delete this._registeredHandlers[i];
41
	}
42
}});
43
dojo.widget.Editor2ToolbarItemManager = new dojo.widget.HandlerManager;
44
dojo.lang.mixin(dojo.widget.Editor2ToolbarItemManager, {getToolbarItem:function (name) {
45
	var item;
46
	name = name.toLowerCase();
47
	for (var i = 0; i < this._registeredHandlers.length; i++) {
48
		item = this._registeredHandlers[i](name);
49
		if (item) {
50
			return item;
51
		}
52
	}
53
	switch (name) {
54
	  case "bold":
55
	  case "copy":
56
	  case "cut":
57
	  case "delete":
58
	  case "indent":
59
	  case "inserthorizontalrule":
60
	  case "insertorderedlist":
61
	  case "insertunorderedlist":
62
	  case "italic":
63
	  case "justifycenter":
64
	  case "justifyfull":
65
	  case "justifyleft":
66
	  case "justifyright":
67
	  case "outdent":
68
	  case "paste":
69
	  case "redo":
70
	  case "removeformat":
71
	  case "selectall":
72
	  case "strikethrough":
73
	  case "subscript":
74
	  case "superscript":
75
	  case "underline":
76
	  case "undo":
77
	  case "unlink":
78
	  case "createlink":
79
	  case "insertimage":
80
	  case "htmltoggle":
81
		item = new dojo.widget.Editor2ToolbarButton(name);
82
		break;
83
	  case "forecolor":
84
	  case "hilitecolor":
85
		item = new dojo.widget.Editor2ToolbarColorPaletteButton(name);
86
		break;
87
	  case "plainformatblock":
88
		item = new dojo.widget.Editor2ToolbarFormatBlockPlainSelect("formatblock");
89
		break;
90
	  case "formatblock":
91
		item = new dojo.widget.Editor2ToolbarFormatBlockSelect("formatblock");
92
		break;
93
	  case "fontsize":
94
		item = new dojo.widget.Editor2ToolbarFontSizeSelect("fontsize");
95
		break;
96
	  case "fontname":
97
		item = new dojo.widget.Editor2ToolbarFontNameSelect("fontname");
98
		break;
99
	  case "inserttable":
100
	  case "insertcell":
101
	  case "insertcol":
102
	  case "insertrow":
103
	  case "deletecells":
104
	  case "deletecols":
105
	  case "deleterows":
106
	  case "mergecells":
107
	  case "splitcell":
108
		dojo.debug(name + " is implemented in dojo.widget.Editor2Plugin.TableOperation, please require it first.");
109
		break;
110
	  case "inserthtml":
111
	  case "blockdirltr":
112
	  case "blockdirrtl":
113
	  case "dirltr":
114
	  case "dirrtl":
115
	  case "inlinedirltr":
116
	  case "inlinedirrtl":
117
		dojo.debug("Not yet implemented toolbar item: " + name);
118
		break;
119
	  default:
120
		dojo.debug("dojo.widget.Editor2ToolbarItemManager.getToolbarItem: Unknown toolbar item: " + name);
121
	}
122
	return item;
123
}});
124
dojo.addOnUnload(dojo.widget.Editor2ToolbarItemManager, "destroy");
125
dojo.declare("dojo.widget.Editor2ToolbarButton", null, function (name) {
126
	this._name = name;
127
}, {create:function (node, toolbar, nohover) {
128
	this._domNode = node;
129
	var cmd = toolbar.parent.getCommand(this._name);
130
	if (cmd) {
131
		this._domNode.title = cmd.getText();
132
	}
133
	this.disableSelection(this._domNode);
134
	this._parentToolbar = toolbar;
135
	dojo.event.connect(this._domNode, "onclick", this, "onClick");
136
	if (!nohover) {
137
		dojo.event.connect(this._domNode, "onmouseover", this, "onMouseOver");
138
		dojo.event.connect(this._domNode, "onmouseout", this, "onMouseOut");
139
	}
140
}, disableSelection:function (rootnode) {
141
	dojo.html.disableSelection(rootnode);
142
	var nodes = rootnode.all || rootnode.getElementsByTagName("*");
143
	for (var x = 0; x < nodes.length; x++) {
144
		dojo.html.disableSelection(nodes[x]);
145
	}
146
}, onMouseOver:function () {
147
	var curInst = dojo.widget.Editor2Manager.getCurrentInstance();
148
	if (curInst) {
149
		var _command = curInst.getCommand(this._name);
150
		if (_command && _command.getState() != dojo.widget.Editor2Manager.commandState.Disabled) {
151
			this.highlightToolbarItem();
152
		}
153
	}
154
}, onMouseOut:function () {
155
	this.unhighlightToolbarItem();
156
}, destroy:function () {
157
	this._domNode = null;
158
	this._parentToolbar = null;
159
}, onClick:function (e) {
160
	if (this._domNode && !this._domNode.disabled && this._parentToolbar.checkAvailability()) {
161
		e.preventDefault();
162
		e.stopPropagation();
163
		var curInst = dojo.widget.Editor2Manager.getCurrentInstance();
164
		if (curInst) {
165
			var _command = curInst.getCommand(this._name);
166
			if (_command) {
167
				_command.execute();
168
			}
169
		}
170
	}
171
}, refreshState:function () {
172
	var curInst = dojo.widget.Editor2Manager.getCurrentInstance();
173
	var em = dojo.widget.Editor2Manager;
174
	if (curInst) {
175
		var _command = curInst.getCommand(this._name);
176
		if (_command) {
177
			var state = _command.getState();
178
			if (state != this._lastState) {
179
				switch (state) {
180
				  case em.commandState.Latched:
181
					this.latchToolbarItem();
182
					break;
183
				  case em.commandState.Enabled:
184
					this.enableToolbarItem();
185
					break;
186
				  case em.commandState.Disabled:
187
				  default:
188
					this.disableToolbarItem();
189
				}
190
				this._lastState = state;
191
			}
192
		}
193
	}
194
	return em.commandState.Enabled;
195
}, latchToolbarItem:function () {
196
	this._domNode.disabled = false;
197
	this.removeToolbarItemStyle(this._domNode);
198
	dojo.html.addClass(this._domNode, this._parentToolbar.ToolbarLatchedItemStyle);
199
}, enableToolbarItem:function () {
200
	this._domNode.disabled = false;
201
	this.removeToolbarItemStyle(this._domNode);
202
	dojo.html.addClass(this._domNode, this._parentToolbar.ToolbarEnabledItemStyle);
203
}, disableToolbarItem:function () {
204
	this._domNode.disabled = true;
205
	this.removeToolbarItemStyle(this._domNode);
206
	dojo.html.addClass(this._domNode, this._parentToolbar.ToolbarDisabledItemStyle);
207
}, highlightToolbarItem:function () {
208
	dojo.html.addClass(this._domNode, this._parentToolbar.ToolbarHighlightedItemStyle);
209
}, unhighlightToolbarItem:function () {
210
	dojo.html.removeClass(this._domNode, this._parentToolbar.ToolbarHighlightedItemStyle);
211
}, removeToolbarItemStyle:function () {
212
	dojo.html.removeClass(this._domNode, this._parentToolbar.ToolbarEnabledItemStyle);
213
	dojo.html.removeClass(this._domNode, this._parentToolbar.ToolbarLatchedItemStyle);
214
	dojo.html.removeClass(this._domNode, this._parentToolbar.ToolbarDisabledItemStyle);
215
	this.unhighlightToolbarItem();
216
}});
217
dojo.declare("dojo.widget.Editor2ToolbarDropDownButton", dojo.widget.Editor2ToolbarButton, {onClick:function () {
218
	if (this._domNode && !this._domNode.disabled && this._parentToolbar.checkAvailability()) {
219
		if (!this._dropdown) {
220
			this._dropdown = dojo.widget.createWidget("PopupContainer", {});
221
			this._domNode.appendChild(this._dropdown.domNode);
222
		}
223
		if (this._dropdown.isShowingNow) {
224
			this._dropdown.close();
225
		} else {
226
			this.onDropDownShown();
227
			this._dropdown.open(this._domNode, null, this._domNode);
228
		}
229
	}
230
}, destroy:function () {
231
	this.onDropDownDestroy();
232
	if (this._dropdown) {
233
		this._dropdown.destroy();
234
	}
235
	dojo.widget.Editor2ToolbarDropDownButton.superclass.destroy.call(this);
236
}, onDropDownShown:function () {
237
}, onDropDownDestroy:function () {
238
}});
239
dojo.declare("dojo.widget.Editor2ToolbarColorPaletteButton", dojo.widget.Editor2ToolbarDropDownButton, {onDropDownShown:function () {
240
	if (!this._colorpalette) {
241
		this._colorpalette = dojo.widget.createWidget("ColorPalette", {});
242
		this._dropdown.addChild(this._colorpalette);
243
		this.disableSelection(this._dropdown.domNode);
244
		this.disableSelection(this._colorpalette.domNode);
245
		dojo.event.connect(this._colorpalette, "onColorSelect", this, "setColor");
246
		dojo.event.connect(this._dropdown, "open", this, "latchToolbarItem");
247
		dojo.event.connect(this._dropdown, "close", this, "enableToolbarItem");
248
	}
249
}, setColor:function (color) {
250
	this._dropdown.close();
251
	var curInst = dojo.widget.Editor2Manager.getCurrentInstance();
252
	if (curInst) {
253
		var _command = curInst.getCommand(this._name);
254
		if (_command) {
255
			_command.execute(color);
256
		}
257
	}
258
}});
259
dojo.declare("dojo.widget.Editor2ToolbarFormatBlockPlainSelect", dojo.widget.Editor2ToolbarButton, {create:function (node, toolbar) {
260
	this._domNode = node;
261
	this._parentToolbar = toolbar;
262
	this._domNode = node;
263
	this.disableSelection(this._domNode);
264
	dojo.event.connect(this._domNode, "onchange", this, "onChange");
265
}, destroy:function () {
266
	this._domNode = null;
267
}, onChange:function () {
268
	if (this._parentToolbar.checkAvailability()) {
269
		var sv = this._domNode.value.toLowerCase();
270
		var curInst = dojo.widget.Editor2Manager.getCurrentInstance();
271
		if (curInst) {
272
			var _command = curInst.getCommand(this._name);
273
			if (_command) {
274
				_command.execute(sv);
275
			}
276
		}
277
	}
278
}, refreshState:function () {
279
	if (this._domNode) {
280
		dojo.widget.Editor2ToolbarFormatBlockPlainSelect.superclass.refreshState.call(this);
281
		var curInst = dojo.widget.Editor2Manager.getCurrentInstance();
282
		if (curInst) {
283
			var _command = curInst.getCommand(this._name);
284
			if (_command) {
285
				var format = _command.getValue();
286
				if (!format) {
287
					format = "";
288
				}
289
				dojo.lang.forEach(this._domNode.options, function (item) {
290
					if (item.value.toLowerCase() == format.toLowerCase()) {
291
						item.selected = true;
292
					}
293
				});
294
			}
295
		}
296
	}
297
}});
298
dojo.declare("dojo.widget.Editor2ToolbarComboItem", dojo.widget.Editor2ToolbarDropDownButton, {href:null, create:function (node, toolbar) {
299
	dojo.widget.Editor2ToolbarComboItem.superclass.create.apply(this, arguments);
300
	if (!this._contentPane) {
301
		dojo.require("dojo.widget.ContentPane");
302
		this._contentPane = dojo.widget.createWidget("ContentPane", {preload:"true"});
303
		this._contentPane.addOnLoad(this, "setup");
304
		this._contentPane.setUrl(this.href);
305
	}
306
}, onMouseOver:function (e) {
307
	if (this._lastState != dojo.widget.Editor2Manager.commandState.Disabled) {
308
		dojo.html.addClass(e.currentTarget, this._parentToolbar.ToolbarHighlightedSelectStyle);
309
	}
310
}, onMouseOut:function (e) {
311
	dojo.html.removeClass(e.currentTarget, this._parentToolbar.ToolbarHighlightedSelectStyle);
312
}, onDropDownShown:function () {
313
	if (!this._dropdown.__addedContentPage) {
314
		this._dropdown.addChild(this._contentPane);
315
		this._dropdown.__addedContentPage = true;
316
	}
317
}, setup:function () {
318
}, onChange:function (e) {
319
	if (this._parentToolbar.checkAvailability()) {
320
		var name = e.currentTarget.getAttribute("dropDownItemName");
321
		var curInst = dojo.widget.Editor2Manager.getCurrentInstance();
322
		if (curInst) {
323
			var _command = curInst.getCommand(this._name);
324
			if (_command) {
325
				_command.execute(name);
326
			}
327
		}
328
	}
329
	this._dropdown.close();
330
}, onMouseOverItem:function (e) {
331
	dojo.html.addClass(e.currentTarget, this._parentToolbar.ToolbarHighlightedSelectItemStyle);
332
}, onMouseOutItem:function (e) {
333
	dojo.html.removeClass(e.currentTarget, this._parentToolbar.ToolbarHighlightedSelectItemStyle);
334
}});
335
dojo.declare("dojo.widget.Editor2ToolbarFormatBlockSelect", dojo.widget.Editor2ToolbarComboItem, {href:dojo.uri.moduleUri("dojo.widget", "templates/Editor2/EditorToolbar_FormatBlock.html"), setup:function () {
336
	dojo.widget.Editor2ToolbarFormatBlockSelect.superclass.setup.call(this);
337
	var nodes = this._contentPane.domNode.all || this._contentPane.domNode.getElementsByTagName("*");
338
	this._blockNames = {};
339
	this._blockDisplayNames = {};
340
	for (var x = 0; x < nodes.length; x++) {
341
		var node = nodes[x];
342
		dojo.html.disableSelection(node);
343
		var name = node.getAttribute("dropDownItemName");
344
		if (name) {
345
			this._blockNames[name] = node;
346
			var childrennodes = node.getElementsByTagName(name);
347
			this._blockDisplayNames[name] = childrennodes[childrennodes.length - 1].innerHTML;
348
		}
349
	}
350
	for (var name in this._blockNames) {
351
		dojo.event.connect(this._blockNames[name], "onclick", this, "onChange");
352
		dojo.event.connect(this._blockNames[name], "onmouseover", this, "onMouseOverItem");
353
		dojo.event.connect(this._blockNames[name], "onmouseout", this, "onMouseOutItem");
354
	}
355
}, onDropDownDestroy:function () {
356
	if (this._blockNames) {
357
		for (var name in this._blockNames) {
358
			delete this._blockNames[name];
359
			delete this._blockDisplayNames[name];
360
		}
361
	}
362
}, refreshState:function () {
363
	dojo.widget.Editor2ToolbarFormatBlockSelect.superclass.refreshState.call(this);
364
	if (this._lastState != dojo.widget.Editor2Manager.commandState.Disabled) {
365
		var curInst = dojo.widget.Editor2Manager.getCurrentInstance();
366
		if (curInst) {
367
			var _command = curInst.getCommand(this._name);
368
			if (_command) {
369
				var format = _command.getValue();
370
				if (format == this._lastSelectedFormat && this._blockDisplayNames) {
371
					return this._lastState;
372
				}
373
				this._lastSelectedFormat = format;
374
				var label = this._domNode.getElementsByTagName("label")[0];
375
				var isSet = false;
376
				if (this._blockDisplayNames) {
377
					for (var name in this._blockDisplayNames) {
378
						if (name == format) {
379
							label.innerHTML = this._blockDisplayNames[name];
380
							isSet = true;
381
							break;
382
						}
383
					}
384
					if (!isSet) {
385
						label.innerHTML = "&nbsp;";
386
					}
387
				}
388
			}
389
		}
390
	}
391
	return this._lastState;
392
}});
393
dojo.declare("dojo.widget.Editor2ToolbarFontSizeSelect", dojo.widget.Editor2ToolbarComboItem, {href:dojo.uri.moduleUri("dojo.widget", "templates/Editor2/EditorToolbar_FontSize.html"), setup:function () {
394
	dojo.widget.Editor2ToolbarFormatBlockSelect.superclass.setup.call(this);
395
	var nodes = this._contentPane.domNode.all || this._contentPane.domNode.getElementsByTagName("*");
396
	this._fontsizes = {};
397
	this._fontSizeDisplayNames = {};
398
	for (var x = 0; x < nodes.length; x++) {
399
		var node = nodes[x];
400
		dojo.html.disableSelection(node);
401
		var name = node.getAttribute("dropDownItemName");
402
		if (name) {
403
			this._fontsizes[name] = node;
404
			this._fontSizeDisplayNames[name] = node.getElementsByTagName("font")[0].innerHTML;
405
		}
406
	}
407
	for (var name in this._fontsizes) {
408
		dojo.event.connect(this._fontsizes[name], "onclick", this, "onChange");
409
		dojo.event.connect(this._fontsizes[name], "onmouseover", this, "onMouseOverItem");
410
		dojo.event.connect(this._fontsizes[name], "onmouseout", this, "onMouseOutItem");
411
	}
412
}, onDropDownDestroy:function () {
413
	if (this._fontsizes) {
414
		for (var name in this._fontsizes) {
415
			delete this._fontsizes[name];
416
			delete this._fontSizeDisplayNames[name];
417
		}
418
	}
419
}, refreshState:function () {
420
	dojo.widget.Editor2ToolbarFormatBlockSelect.superclass.refreshState.call(this);
421
	if (this._lastState != dojo.widget.Editor2Manager.commandState.Disabled) {
422
		var curInst = dojo.widget.Editor2Manager.getCurrentInstance();
423
		if (curInst) {
424
			var _command = curInst.getCommand(this._name);
425
			if (_command) {
426
				var size = _command.getValue();
427
				if (size == this._lastSelectedSize && this._fontSizeDisplayNames) {
428
					return this._lastState;
429
				}
430
				this._lastSelectedSize = size;
431
				var label = this._domNode.getElementsByTagName("label")[0];
432
				var isSet = false;
433
				if (this._fontSizeDisplayNames) {
434
					for (var name in this._fontSizeDisplayNames) {
435
						if (name == size) {
436
							label.innerHTML = this._fontSizeDisplayNames[name];
437
							isSet = true;
438
							break;
439
						}
440
					}
441
					if (!isSet) {
442
						label.innerHTML = "&nbsp;";
443
					}
444
				}
445
			}
446
		}
447
	}
448
	return this._lastState;
449
}});
450
dojo.declare("dojo.widget.Editor2ToolbarFontNameSelect", dojo.widget.Editor2ToolbarFontSizeSelect, {href:dojo.uri.moduleUri("dojo.widget", "templates/Editor2/EditorToolbar_FontName.html")});
451
dojo.widget.defineWidget("dojo.widget.Editor2Toolbar", dojo.widget.HtmlWidget, function () {
452
	dojo.event.connect(this, "fillInTemplate", dojo.lang.hitch(this, function () {
453
		if (dojo.render.html.ie) {
454
			this.domNode.style.zoom = 1;
455
		}
456
	}));
457
}, {templateString:"<div dojoAttachPoint=\"domNode\" class=\"EditorToolbarDomNode\" unselectable=\"on\">\n\t<table cellpadding=\"3\" cellspacing=\"0\" border=\"0\">\n\t\t<!--\n\t\t\tour toolbar should look something like:\n\n\t\t\t+=======+=======+=======+=============================================+\n\t\t\t| w   w | style | copy  | bo | it | un | le | ce | ri |\n\t\t\t| w w w | style |=======|==============|==============|\n\t\t\t|  w w  | style | paste |  undo | redo | change style |\n\t\t\t+=======+=======+=======+=============================================+\n\t\t-->\n\t\t<tbody>\n\t\t\t<tr valign=\"top\">\n\t\t\t\t<td rowspan=\"2\">\n\t\t\t\t\t<div class=\"bigIcon\" dojoAttachPoint=\"wikiWordButton\"\n\t\t\t\t\t\tdojoOnClick=\"wikiWordClick; buttonClick;\">\n\t\t\t\t\t\t<span style=\"font-size: 30px; margin-left: 5px;\">\n\t\t\t\t\t\t\tW\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</div>\n\t\t\t\t</td>\n\t\t\t\t<td rowspan=\"2\">\n\t\t\t\t\t<div class=\"bigIcon\" dojoAttachPoint=\"styleDropdownButton\"\n\t\t\t\t\t\tdojoOnClick=\"styleDropdownClick; buttonClick;\">\n\t\t\t\t\t\t<span unselectable=\"on\"\n\t\t\t\t\t\t\tstyle=\"font-size: 30px; margin-left: 5px;\">\n\t\t\t\t\t\t\tS\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"StyleDropdownContainer\" style=\"display: none;\"\n\t\t\t\t\t\tdojoAttachPoint=\"styleDropdownContainer\">\n\t\t\t\t\t\t<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\"\n\t\t\t\t\t\t\theight=\"100%\" width=\"100%\">\n\t\t\t\t\t\t\t<tr valign=\"top\">\n\t\t\t\t\t\t\t\t<td rowspan=\"2\">\n\t\t\t\t\t\t\t\t\t<div style=\"height: 245px; overflow: auto;\">\n\t\t\t\t\t\t\t\t\t\t<div class=\"headingContainer\"\n\t\t\t\t\t\t\t\t\t\t\tunselectable=\"on\"\n\t\t\t\t\t\t\t\t\t\t\tdojoOnClick=\"normalTextClick\">normal</div>\n\t\t\t\t\t\t\t\t\t\t<h1 class=\"headingContainer\"\n\t\t\t\t\t\t\t\t\t\t\tunselectable=\"on\"\n\t\t\t\t\t\t\t\t\t\t\tdojoOnClick=\"h1TextClick\">Heading 1</h1>\n\t\t\t\t\t\t\t\t\t\t<h2 class=\"headingContainer\"\n\t\t\t\t\t\t\t\t\t\t\tunselectable=\"on\"\n\t\t\t\t\t\t\t\t\t\t\tdojoOnClick=\"h2TextClick\">Heading 2</h2>\n\t\t\t\t\t\t\t\t\t\t<h3 class=\"headingContainer\"\n\t\t\t\t\t\t\t\t\t\t\tunselectable=\"on\"\n\t\t\t\t\t\t\t\t\t\t\tdojoOnClick=\"h3TextClick\">Heading 3</h3>\n\t\t\t\t\t\t\t\t\t\t<h4 class=\"headingContainer\"\n\t\t\t\t\t\t\t\t\t\t\tunselectable=\"on\"\n\t\t\t\t\t\t\t\t\t\t\tdojoOnClick=\"h4TextClick\">Heading 4</h4>\n\t\t\t\t\t\t\t\t\t\t<div class=\"headingContainer\"\n\t\t\t\t\t\t\t\t\t\t\tunselectable=\"on\"\n\t\t\t\t\t\t\t\t\t\t\tdojoOnClick=\"blahTextClick\">blah</div>\n\t\t\t\t\t\t\t\t\t\t<div class=\"headingContainer\"\n\t\t\t\t\t\t\t\t\t\t\tunselectable=\"on\"\n\t\t\t\t\t\t\t\t\t\t\tdojoOnClick=\"blahTextClick\">blah</div>\n\t\t\t\t\t\t\t\t\t\t<div class=\"headingContainer\"\n\t\t\t\t\t\t\t\t\t\t\tunselectable=\"on\"\n\t\t\t\t\t\t\t\t\t\t\tdojoOnClick=\"blahTextClick\">blah</div>\n\t\t\t\t\t\t\t\t\t\t<div class=\"headingContainer\">blah</div>\n\t\t\t\t\t\t\t\t\t\t<div class=\"headingContainer\">blah</div>\n\t\t\t\t\t\t\t\t\t\t<div class=\"headingContainer\">blah</div>\n\t\t\t\t\t\t\t\t\t\t<div class=\"headingContainer\">blah</div>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t<!--\n\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t<span class=\"iconContainer\" dojoOnClick=\"buttonClick;\">\n\t\t\t\t\t\t\t\t\t\t<span class=\"icon justifyleft\" \n\t\t\t\t\t\t\t\t\t\t\tstyle=\"float: left;\">&nbsp;</span>\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t<span class=\"iconContainer\" dojoOnClick=\"buttonClick;\">\n\t\t\t\t\t\t\t\t\t\t<span class=\"icon justifycenter\" \n\t\t\t\t\t\t\t\t\t\t\tstyle=\"float: left;\">&nbsp;</span>\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t<span class=\"iconContainer\" dojoOnClick=\"buttonClick;\">\n\t\t\t\t\t\t\t\t\t\t<span class=\"icon justifyright\" \n\t\t\t\t\t\t\t\t\t\t\tstyle=\"float: left;\">&nbsp;</span>\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t<span class=\"iconContainer\" dojoOnClick=\"buttonClick;\">\n\t\t\t\t\t\t\t\t\t\t<span class=\"icon justifyfull\" \n\t\t\t\t\t\t\t\t\t\t\tstyle=\"float: left;\">&nbsp;</span>\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t-->\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t<tr valign=\"top\">\n\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\tthud\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</table>\n\t\t\t\t\t</div>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<!-- copy -->\n\t\t\t\t\t<span class=\"iconContainer\" dojoAttachPoint=\"copyButton\"\n\t\t\t\t\t\tunselectable=\"on\"\n\t\t\t\t\t\tdojoOnClick=\"copyClick; buttonClick;\">\n\t\t\t\t\t\t<span class=\"icon copy\" \n\t\t\t\t\t\t\tunselectable=\"on\"\n\t\t\t\t\t\t\tstyle=\"float: left;\">&nbsp;</span> copy\n\t\t\t\t\t</span>\n\t\t\t\t\t<!-- \"droppable\" options -->\n\t\t\t\t\t<span class=\"iconContainer\" dojoAttachPoint=\"boldButton\"\n\t\t\t\t\t\tunselectable=\"on\"\n\t\t\t\t\t\tdojoOnClick=\"boldClick; buttonClick;\">\n\t\t\t\t\t\t<span class=\"icon bold\" unselectable=\"on\">&nbsp;</span>\n\t\t\t\t\t</span>\n\t\t\t\t\t<span class=\"iconContainer\" dojoAttachPoint=\"italicButton\"\n\t\t\t\t\t\tdojoOnClick=\"italicClick; buttonClick;\">\n\t\t\t\t\t\t<span class=\"icon italic\" unselectable=\"on\">&nbsp;</span>\n\t\t\t\t\t</span>\n\t\t\t\t\t<span class=\"iconContainer\" dojoAttachPoint=\"underlineButton\"\n\t\t\t\t\t\tdojoOnClick=\"underlineClick; buttonClick;\">\n\t\t\t\t\t\t<span class=\"icon underline\" unselectable=\"on\">&nbsp;</span>\n\t\t\t\t\t</span>\n\t\t\t\t\t<span class=\"iconContainer\" dojoAttachPoint=\"leftButton\"\n\t\t\t\t\t\tdojoOnClick=\"leftClick; buttonClick;\">\n\t\t\t\t\t\t<span class=\"icon justifyleft\" unselectable=\"on\">&nbsp;</span>\n\t\t\t\t\t</span>\n\t\t\t\t\t<span class=\"iconContainer\" dojoAttachPoint=\"fullButton\"\n\t\t\t\t\t\tdojoOnClick=\"fullClick; buttonClick;\">\n\t\t\t\t\t\t<span class=\"icon justifyfull\" unselectable=\"on\">&nbsp;</span>\n\t\t\t\t\t</span>\n\t\t\t\t\t<span class=\"iconContainer\" dojoAttachPoint=\"rightButton\"\n\t\t\t\t\t\tdojoOnClick=\"rightClick; buttonClick;\">\n\t\t\t\t\t\t<span class=\"icon justifyright\" unselectable=\"on\">&nbsp;</span>\n\t\t\t\t\t</span>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td>\n\t\t\t\t\t<!-- paste -->\n\t\t\t\t\t<span class=\"iconContainer\" dojoAttachPoint=\"pasteButton\"\n\t\t\t\t\t\tdojoOnClick=\"pasteClick; buttonClick;\" unselectable=\"on\">\n\t\t\t\t\t\t<span class=\"icon paste\" style=\"float: left;\" unselectable=\"on\">&nbsp;</span> paste\n\t\t\t\t\t</span>\n\t\t\t\t\t<!-- \"droppable\" options -->\n\t\t\t\t\t<span class=\"iconContainer\" dojoAttachPoint=\"undoButton\"\n\t\t\t\t\t\tdojoOnClick=\"undoClick; buttonClick;\" unselectable=\"on\">\n\t\t\t\t\t\t<span class=\"icon undo\" style=\"float: left;\" unselectable=\"on\">&nbsp;</span> undo\n\t\t\t\t\t</span>\n\t\t\t\t\t<span class=\"iconContainer\" dojoAttachPoint=\"redoButton\"\n\t\t\t\t\t\tdojoOnClick=\"redoClick; buttonClick;\" unselectable=\"on\">\n\t\t\t\t\t\t<span class=\"icon redo\" style=\"float: left;\" unselectable=\"on\">&nbsp;</span> redo\n\t\t\t\t\t</span>\n\t\t\t\t</td>\t\n\t\t\t</tr>\n\t\t</tbody>\n\t</table>\n</div>\n", templateCssString:".StyleDropdownContainer {\n\tposition: absolute;\n\tz-index: 1000;\n\toverflow: auto;\n\tcursor: default;\n\twidth: 250px;\n\theight: 250px;\n\tbackground-color: white;\n\tborder: 1px solid black;\n}\n\n.ColorDropdownContainer {\n\tposition: absolute;\n\tz-index: 1000;\n\toverflow: auto;\n\tcursor: default;\n\twidth: 250px;\n\theight: 150px;\n\tbackground-color: white;\n\tborder: 1px solid black;\n}\n\n.EditorToolbarDomNode {\n\tbackground-image: url(buttons/bg-fade.png);\n\tbackground-repeat: repeat-x;\n\tbackground-position: 0px -50px;\n}\n\n.EditorToolbarSmallBg {\n\tbackground-image: url(images/toolbar-bg.gif);\n\tbackground-repeat: repeat-x;\n\tbackground-position: 0px 0px;\n}\n\n/*\nbody {\n\tbackground:url(images/blank.gif) fixed;\n}*/\n\n.IEFixedToolbar {\n\tposition:absolute;\n\t/* top:0; */\n\ttop: expression(eval((document.documentElement||document.body).scrollTop));\n}\n\ndiv.bigIcon {\n\twidth: 40px;\n\theight: 40px; \n\t/* background-color: white; */\n\t/* border: 1px solid #a6a7a3; */\n\tfont-family: Verdana, Trebuchet, Tahoma, Arial;\n}\n\n.iconContainer {\n\tfont-family: Verdana, Trebuchet, Tahoma, Arial;\n\tfont-size: 13px;\n\tfloat: left;\n\theight: 18px;\n\tdisplay: block;\n\t/* background-color: white; */\n\tcursor: pointer;\n\tpadding: 1px 4px 1px 1px; /* almost the same as a transparent border */\n\tborder: 0px;\n}\n\n.dojoE2TBIcon {\n\tdisplay: block;\n\ttext-align: center;\n\tmin-width: 18px;\n\twidth: 18px;\n\theight: 18px;\n\t/* background-color: #a6a7a3; */\n\tbackground-repeat: no-repeat;\n\tbackground-image: url(buttons/aggregate.gif);\n}\n\n\n.dojoE2TBIcon[class~=dojoE2TBIcon] {\n}\n\n.ToolbarButtonLatched {\n	border: #316ac5 1px solid; !important;\n	padding: 0px 3px 0px 0px; !important; /* make room for border */\n	background-color: #c1d2ee;\n}\n\n.ToolbarButtonHighlighted {\n	border: #316ac5 1px solid; !important;\n	padding: 0px 3px 0px 0px; !important; /* make room for border */\n	background-color: #dff1ff;\n}\n\n.ToolbarButtonDisabled{\n	filter: gray() alpha(opacity=30); /* IE */\n	opacity: 0.30; /* Safari, Opera and Mozilla */\n}\n\n.headingContainer {\n\twidth: 150px;\n\theight: 30px;\n\tmargin: 0px;\n\t/* padding-left: 5px; */\n\toverflow: hidden;\n\tline-height: 25px;\n\tborder-bottom: 1px solid black;\n\tborder-top: 1px solid white;\n}\n\n.EditorToolbarDomNode select {\n\tfont-size: 14px;\n}\n \n.dojoE2TBIcon_Sep { width: 5px; min-width: 5px; max-width: 5px; background-position: 0px 0px}\n.dojoE2TBIcon_Backcolor { background-position: -18px 0px}\n.dojoE2TBIcon_Bold { background-position: -36px 0px}\n.dojoE2TBIcon_Cancel { background-position: -54px 0px}\n.dojoE2TBIcon_Copy { background-position: -72px 0px}\n.dojoE2TBIcon_Link { background-position: -90px 0px}\n.dojoE2TBIcon_Cut { background-position: -108px 0px}\n.dojoE2TBIcon_Delete { background-position: -126px 0px}\n.dojoE2TBIcon_TextColor { background-position: -144px 0px}\n.dojoE2TBIcon_BackgroundColor { background-position: -162px 0px}\n.dojoE2TBIcon_Indent { background-position: -180px 0px}\n.dojoE2TBIcon_HorizontalLine { background-position: -198px 0px}\n.dojoE2TBIcon_Image { background-position: -216px 0px}\n.dojoE2TBIcon_NumberedList { background-position: -234px 0px}\n.dojoE2TBIcon_Table { background-position: -252px 0px}\n.dojoE2TBIcon_BulletedList { background-position: -270px 0px}\n.dojoE2TBIcon_Italic { background-position: -288px 0px}\n.dojoE2TBIcon_CenterJustify { background-position: -306px 0px}\n.dojoE2TBIcon_BlockJustify { background-position: -324px 0px}\n.dojoE2TBIcon_LeftJustify { background-position: -342px 0px}\n.dojoE2TBIcon_RightJustify { background-position: -360px 0px}\n.dojoE2TBIcon_left_to_right { background-position: -378px 0px}\n.dojoE2TBIcon_list_bullet_indent { background-position: -396px 0px}\n.dojoE2TBIcon_list_bullet_outdent { background-position: -414px 0px}\n.dojoE2TBIcon_list_num_indent { background-position: -432px 0px}\n.dojoE2TBIcon_list_num_outdent { background-position: -450px 0px}\n.dojoE2TBIcon_Outdent { background-position: -468px 0px}\n.dojoE2TBIcon_Paste { background-position: -486px 0px}\n.dojoE2TBIcon_Redo { background-position: -504px 0px}\ndojoE2TBIcon_RemoveFormat { background-position: -522px 0px}\n.dojoE2TBIcon_right_to_left { background-position: -540px 0px}\n.dojoE2TBIcon_Save { background-position: -558px 0px}\n.dojoE2TBIcon_Space { background-position: -576px 0px}\n.dojoE2TBIcon_StrikeThrough { background-position: -594px 0px}\n.dojoE2TBIcon_Subscript { background-position: -612px 0px}\n.dojoE2TBIcon_Superscript { background-position: -630px 0px}\n.dojoE2TBIcon_Underline { background-position: -648px 0px}\n.dojoE2TBIcon_Undo { background-position: -666px 0px}\n.dojoE2TBIcon_WikiWord { background-position: -684px 0px}\n\n", templateCssPath:dojo.uri.moduleUri("dojo.widget", "templates/EditorToolbar.css"), ToolbarLatchedItemStyle:"ToolbarButtonLatched", ToolbarEnabledItemStyle:"ToolbarButtonEnabled", ToolbarDisabledItemStyle:"ToolbarButtonDisabled", ToolbarHighlightedItemStyle:"ToolbarButtonHighlighted", ToolbarHighlightedSelectStyle:"ToolbarSelectHighlighted", ToolbarHighlightedSelectItemStyle:"ToolbarSelectHighlightedItem", postCreate:function () {
458
	var nodes = dojo.html.getElementsByClass("dojoEditorToolbarItem", this.domNode);
459
	this.items = {};
460
	for (var x = 0; x < nodes.length; x++) {
461
		var node = nodes[x];
462
		var itemname = node.getAttribute("dojoETItemName");
463
		if (itemname) {
464
			var item = dojo.widget.Editor2ToolbarItemManager.getToolbarItem(itemname);
465
			if (item) {
466
				item.create(node, this);
467
				this.items[itemname.toLowerCase()] = item;
468
			} else {
469
				node.style.display = "none";
470
			}
471
		}
472
	}
473
}, update:function () {
474
	for (var cmd in this.items) {
475
		this.items[cmd].refreshState();
476
	}
477
}, shareGroup:"", checkAvailability:function () {
478
	if (!this.shareGroup) {
479
		this.parent.focus();
480
		return true;
481
	}
482
	var curInst = dojo.widget.Editor2Manager.getCurrentInstance();
483
	if (this.shareGroup == curInst.toolbarGroup) {
484
		return true;
485
	}
486
	return false;
487
}, destroy:function () {
488
	for (var it in this.items) {
489
		this.items[it].destroy();
490
		delete this.items[it];
491
	}
492
	dojo.widget.Editor2Toolbar.superclass.destroy.call(this);
493
}});
494