summaryrefslogtreecommitdiff
path: root/httemplate/elements/fckeditor/editor/css/behaviors/showtableborders.htc
blob: 77418b9ec35341cdafc62e144e8495fb6aca51e7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<public:component lightweight="true">

<public:attach event="oncontentready" onevent="ShowBorders()" />
<public:attach event="onpropertychange" onevent="OnPropertyChange()" />

<script language="javascript">

var oClassRegex = /\s*FCK__ShowTableBorders/ ;

function ShowBorders()
{
	if ( this.border == 0 )
	{
		if ( !oClassRegex.test( this.className ) )
			this.className += ' FCK__ShowTableBorders' ;
	}
	else
	{
		if ( oClassRegex.test( this.className ) )
		{
			this.className = this.className.replace( oClassRegex, '' ) ;
			if ( this.className.length == 0 )
				this.removeAttribute( 'className', 0 ) ;
		}
	}
}

function OnPropertyChange()
{
	if ( event.propertyName == 'border' || event.propertyName == 'className' )
		ShowBorders.call(this) ;
}

</script>

</public:component>