431 |
ddelon |
1 |
/*
|
|
|
2 |
* FCKeditor - The text editor for internet
|
|
|
3 |
* Copyright (C) 2003-2005 Frederico Caldeira Knabben
|
|
|
4 |
*
|
|
|
5 |
* Licensed under the terms of the GNU Lesser General Public License:
|
|
|
6 |
* http://www.opensource.org/licenses/lgpl-license.php
|
|
|
7 |
*
|
|
|
8 |
* For further information visit:
|
|
|
9 |
* http://www.fckeditor.net/
|
|
|
10 |
*
|
|
|
11 |
* File Name: fcktoolbar.js
|
|
|
12 |
* FCKToolbar Class: represents a toolbar. A toolbar is not the complete
|
|
|
13 |
* toolbar set visible, but just a strip on it... a group of items.
|
|
|
14 |
*
|
|
|
15 |
* File Authors:
|
|
|
16 |
* Frederico Caldeira Knabben (fredck@fckeditor.net)
|
|
|
17 |
*/
|
|
|
18 |
|
|
|
19 |
var FCKToolbar = function()
|
|
|
20 |
{
|
|
|
21 |
this.Items = new Array() ;
|
|
|
22 |
|
|
|
23 |
this.DOMTable = document.createElement( 'table' ) ;
|
|
|
24 |
this.DOMTable.className = 'TB_Toolbar' ;
|
|
|
25 |
with ( this.DOMTable )
|
|
|
26 |
{
|
|
|
27 |
// Sets the toolbar direction. IE uses "styleFloat" and Gecko uses "cssFloat".
|
|
|
28 |
style.styleFloat = style.cssFloat = FCKLang.Dir == 'rtl' ? 'right' : 'left' ;
|
|
|
29 |
|
|
|
30 |
cellPadding = 0 ;
|
|
|
31 |
cellSpacing = 0 ;
|
|
|
32 |
border = 0 ;
|
|
|
33 |
}
|
|
|
34 |
|
|
|
35 |
this.DOMRow = this.DOMTable.insertRow(-1) ;
|
|
|
36 |
|
|
|
37 |
var oCell = this.DOMRow.insertCell(-1) ;
|
|
|
38 |
oCell.className = 'TB_Start' ;
|
|
|
39 |
oCell.innerHTML = '<img src="' + FCKConfig.SkinPath + 'images/toolbar.start.gif" width="7" height="21" style="VISIBILITY: hidden" onload="this.style.visibility = \'\';" unselectable="on">' ;
|
|
|
40 |
|
|
|
41 |
FCKToolbarSet.DOMElement.appendChild( this.DOMTable ) ;
|
|
|
42 |
}
|
|
|
43 |
|
|
|
44 |
FCKToolbar.prototype.AddItem = function( toolbarItem )
|
|
|
45 |
{
|
|
|
46 |
this.Items[ this.Items.length ] = toolbarItem ;
|
|
|
47 |
toolbarItem.CreateInstance( this ) ;
|
|
|
48 |
}
|
|
|
49 |
|
|
|
50 |
FCKToolbar.prototype.AddSeparator = function()
|
|
|
51 |
{
|
|
|
52 |
var oCell = this.DOMRow.insertCell(-1) ;
|
|
|
53 |
oCell.unselectable = 'on' ;
|
|
|
54 |
oCell.innerHTML = '<img src="' + FCKConfig.SkinPath + 'images/toolbar.separator.gif" width="5" height="21" style="VISIBILITY: hidden" onload="this.style.visibility = \'\';" unselectable="on">' ;
|
|
|
55 |
}
|
|
|
56 |
|
|
|
57 |
FCKToolbar.prototype.AddTerminator = function()
|
|
|
58 |
{
|
|
|
59 |
var oCell = this.DOMRow.insertCell(-1) ;
|
|
|
60 |
oCell.className = 'TB_End' ;
|
|
|
61 |
oCell.innerHTML = '<img src="' + FCKConfig.SkinPath + 'images/toolbar.end.gif" width="12" height="21" style="VISIBILITY: hidden" onload="this.style.visibility = \'\';" unselectable="on">' ;
|
|
|
62 |
}
|