Subversion Repositories Applications.papyrus

Rev

Rev 1688 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1688 Rev 1921
Line -... Line 1...
-
 
1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
1
<!--
2
<!--
2
 * FCKeditor - The text editor for internet
3
 * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
 * Copyright (C) 2003-2006 Frederico Caldeira Knabben
4
 * Copyright (C) 2003-2008 Frederico Caldeira Knabben
-
 
5
 *
-
 
6
 * == BEGIN LICENSE ==
4
 * 
7
 *
5
 * Licensed under the terms of the GNU Lesser General Public License:
8
 * Licensed under the terms of any of the following licenses at your
6
 * 		http://www.opensource.org/licenses/lgpl-license.php
9
 * choice:
7
 * 
10
 *
8
 * For further information visit:
11
 *  - GNU General Public License Version 2 or later (the "GPL")
9
 * 		http://www.fckeditor.net/
12
 *    http://www.gnu.org/licenses/gpl.html
10
 * 
13
 *
11
 * "Support Open Source software. What about a donation today?"
14
 *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
-
 
15
 *    http://www.gnu.org/licenses/lgpl.html
12
 * 
16
 *
13
 * File Name: fck_table.html
17
 *  - Mozilla Public License Version 1.1 or later (the "MPL")
14
 * 	Table dialog window.
18
 *    http://www.mozilla.org/MPL/MPL-1.1.html
15
 * 
19
 *
16
 * File Authors:
20
 * == END LICENSE ==
-
 
21
 *
17
 * 		Frederico Caldeira Knabben (fredck@fckeditor.net)
22
 * Table dialog window.
18
-->
23
-->
19
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
-
 
20
<html xmlns="http://www.w3.org/1999/xhtml">
24
<html xmlns="http://www.w3.org/1999/xhtml">
21
<head>
25
<head>
22
	<title>Table Properties</title>
26
	<title>Table Properties</title>
23
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
27
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
24
	<meta name="robots" content="noindex, nofollow" />
28
	<meta name="robots" content="noindex, nofollow" />
-
 
29
	<script src="common/fck_dialog_common.js" type="text/javascript"></script>
25
	<script type="text/javascript">
30
	<script type="text/javascript">
Line -... Line 31...
-
 
31
 
26
 
32
var dialog	= window.parent ;
-
 
33
var oEditor = dialog.InnerDialogLoaded() ;
Line 27... Line 34...
27
var oEditor = window.parent.InnerDialogLoaded() ;
34
var dialogArguments = dialog.Args() ;
28
 
35
 
Line 29... Line 36...
29
// Gets the document DOM
36
// Gets the document DOM
30
var oDOM = oEditor.FCK.EditorDocument ;
37
var oDOM = oEditor.FCK.EditorDocument ;
31
 
38
 
Line 32... Line 39...
32
// Gets the table if there is one selected.
39
// Gets the table if there is one selected.
33
var table ;
40
var table ;
Line 34... Line 41...
34
var e = oEditor.FCKSelection.GetSelectedElement() ;
41
var e = dialog.Selection.GetSelectedElement() ;
Line 55... Line 62...
55
		var iWidth  = (table.style.width  ? table.style.width  : table.width ) ;
62
		var iWidth  = (table.style.width  ? table.style.width  : table.width ) ;
56
		var iHeight = (table.style.height ? table.style.height : table.height ) ;
63
		var iHeight = (table.style.height ? table.style.height : table.height ) ;
Line 57... Line 64...
57
 
64
 
58
		if (iWidth.indexOf('%') >= 0)			// Percentual = %
65
		if (iWidth.indexOf('%') >= 0)			// Percentual = %
59
		{
66
		{
60
			iWidth = parseInt( iWidth.substr(0,iWidth.length - 1) ) ;
67
			iWidth = parseInt( iWidth.substr(0,iWidth.length - 1), 10 ) ;
61
			document.getElementById('selWidthType').value = "percent" ;
68
			document.getElementById('selWidthType').value = "percent" ;
62
		}
69
		}
63
		else if (iWidth.indexOf('px') >= 0)		// Style Pixel = px
70
		else if (iWidth.indexOf('px') >= 0)		// Style Pixel = px
64
		{																										  //
71
		{																										  //
65
			iWidth = iWidth.substr(0,iWidth.length - 2);
72
			iWidth = iWidth.substr(0,iWidth.length - 2);
66
			document.getElementById('selWidthType').value = "pixels" ;
73
			document.getElementById('selWidthType').value = "pixels" ;
67
		}
74
		}
68
		
75
 
69
		if (iHeight && iHeight.indexOf('px') >= 0)		// Style Pixel = px
76
		if (iHeight && iHeight.indexOf('px') >= 0)		// Style Pixel = px
70
			iHeight = iHeight.substr(0,iHeight.length - 2);
77
			iHeight = iHeight.substr(0,iHeight.length - 2);
71
		
78
 
72
		document.getElementById('txtWidth').value		= iWidth ;
79
		document.getElementById('txtWidth').value		= iWidth || '' ;
73
		document.getElementById('txtHeight').value		= iHeight ;
80
		document.getElementById('txtHeight').value		= iHeight || '' ;
74
		document.getElementById('txtBorder').value		= table.border ;
81
		document.getElementById('txtBorder').value		= GetAttribute( table, 'border', '' ) ;
75
		document.getElementById('selAlignment').value	= table.align ;
82
		document.getElementById('selAlignment').value	= GetAttribute( table, 'align', '' ) ;
76
		document.getElementById('txtCellPadding').value	= table.cellPadding	;
83
		document.getElementById('txtCellPadding').value	= GetAttribute( table, 'cellPadding', '' ) ;
77
		document.getElementById('txtCellSpacing').value	= table.cellSpacing	;
84
		document.getElementById('txtCellSpacing').value	= GetAttribute( table, 'cellSpacing', '' ) ;
78
		document.getElementById('txtSummary').value     = table.summary;
85
		document.getElementById('txtSummary').value     = GetAttribute( table, 'summary', '' ) ;
Line -... Line 86...
-
 
86
//		document.getElementById('cmbFontStyle').value	= table.className ;
79
//		document.getElementById('cmbFontStyle').value	= table.className ;
87
 
80
 
88
		var eCaption = oEditor.FCKDomTools.GetFirstChild( table, 'CAPTION' ) ;
81
		if (table.caption) document.getElementById('txtCaption').value = table.caption.innerHTML ;
89
		if ( eCaption ) document.getElementById('txtCaption').value = eCaption.innerHTML ;
82
		
90
 
-
 
91
		document.getElementById('txtRows').disabled    = true ;
83
		document.getElementById('txtRows').disabled    = true ;
92
		document.getElementById('txtColumns').disabled = true ;
-
 
93
		SelectField( 'txtWidth' ) ;
-
 
94
	}
84
		document.getElementById('txtColumns').disabled = true ;
95
	else
85
	}
96
		SelectField( 'txtRows' ) ;
86
	
97
 
87
	window.parent.SetOkButton( true ) ;	
98
	dialog.SetOkButton( true ) ;
Line 88... Line 99...
88
	window.parent.SetAutoSize( true ) ;	
99
	dialog.SetAutoSize( true ) ;
89
}
100
}
90
 
101
 
91
// Fired when the user press the OK button
102
// Fired when the user press the OK button
92
function Ok()
103
function Ok()
93
{
104
{
94
	var bExists = ( table != null ) ;
-
 
95
	
105
	var bExists = ( table != null ) ;
96
	if ( ! bExists )
-
 
Line 97... Line 106...
97
	{
106
 
98
		table = oEditor.FCK.EditorDocument.createElement( "TABLE" ) ;
107
	if ( ! bExists )
99
	}
108
		table = oEditor.FCK.EditorDocument.createElement( "TABLE" ) ;
100
 
109
 
-
 
110
	// Removes the Width and Height styles
101
	// Removes the Width and Height styles
111
	if ( bExists && table.style.width )		table.style.width = null ; //.removeAttribute("width") ;
-
 
112
	if ( bExists && table.style.height )	table.style.height = null ; //.removeAttribute("height") ;
-
 
113
 
-
 
114
	var sWidth = GetE('txtWidth').value ;
102
	if ( bExists && table.style.width )		table.style.width = null ; //.removeAttribute("width") ;
115
	if ( sWidth.length > 0 && GetE('selWidthType').value == 'percent' )
103
	if ( bExists && table.style.height )	table.style.height = null ; //.removeAttribute("height") ;
116
		sWidth += '%' ;
104
	
117
 
105
	table.width			= document.getElementById('txtWidth').value + ( document.getElementById('selWidthType').value == "percent" ? "%" : "") ;
118
	SetAttribute( table, 'width'		, sWidth ) ;
106
	table.height		= document.getElementById('txtHeight').value ;
119
	SetAttribute( table, 'height'		, GetE('txtHeight').value ) ;
107
	table.border		= document.getElementById('txtBorder').value ;
120
	SetAttribute( table, 'border'		, GetE('txtBorder').value ) ;
-
 
121
	SetAttribute( table, 'align'		, GetE('selAlignment').value ) ;
108
	table.align			= document.getElementById('selAlignment').value ;
122
	SetAttribute( table, 'cellPadding'	, GetE('txtCellPadding').value ) ;
109
	table.cellPadding	= document.getElementById('txtCellPadding').value ;
123
	SetAttribute( table, 'cellSpacing'	, GetE('txtCellSpacing').value ) ;
110
	table.cellSpacing	= document.getElementById('txtCellSpacing').value ;
124
	SetAttribute( table, 'summary'		, GetE('txtSummary').value ) ;
111
	table.summary       = document.getElementById('txtSummary').value ;
125
 
-
 
126
	var eCaption = oEditor.FCKDomTools.GetFirstChild( table, 'CAPTION' ) ;
-
 
127
 
-
 
128
	if ( document.getElementById('txtCaption').value != '')
112
//	table.className		= cmbFontStyle.value ;
129
	{
-
 
130
		if ( !eCaption )
-
 
131
		{
113
	
132
			eCaption = oEditor.FCK.EditorDocument.createElement( 'CAPTION' ) ;
114
	if ( document.getElementById('txtCaption').value != '')
133
			table.insertBefore( eCaption, table.firstChild ) ;
115
	{
134
		}
116
		if (! table.caption) table.createCaption() ;
135
 
-
 
136
		eCaption.innerHTML = document.getElementById('txtCaption').value ;
-
 
137
	}
117
		table.caption.innerHTML = document.getElementById('txtCaption').value ;
138
	else if ( bExists && eCaption )
118
	}
139
	{
119
	else if ( bExists && table.caption )
140
		// TODO: It causes an IE internal error if using removeChild or
120
	{
141
		// table.deleteCaption() (see #505).
121
		if ( document.all )
142
		if ( oEditor.FCKBrowserInfo.IsIE )
122
			table.caption.innerHTML = '' ;	// TODO: It causes an IE internal error if using removeChild.
143
			eCaption.innerHTML = '' ;
123
		else
144
		else
124
			table.caption.parentNode.removeChild( table.caption ) ;
145
			eCaption.parentNode.removeChild( eCaption ) ;
125
	}
146
	}
126
		
147
 
127
	if (! bExists)
148
	if (! bExists)
128
	{
149
	{
129
		var iRows = document.getElementById('txtRows').value ;
150
		var iRows = document.getElementById('txtRows').value ;
130
		var iCols = document.getElementById('txtColumns').value ;
151
		var iCols = document.getElementById('txtColumns').value ;
131
		
152
 
132
		for ( var r = 0 ; r < iRows ; r++ )
153
		for ( var r = 0 ; r < iRows ; r++ )
133
		{
154
		{
134
			var oRow = table.insertRow(-1) ;
155
			var oRow = table.insertRow(-1) ;
135
			for ( var c = 0 ; c < iCols ; c++ )
156
			for ( var c = 0 ; c < iCols ; c++ )
136
			{
-
 
137
				var oCell = oRow.insertCell(-1) ;
157
			{
138
				if ( oEditor.FCKBrowserInfo.IsGecko )
158
				var oCell = oRow.insertCell(-1) ;
139
					oCell.innerHTML = '<br _moz_editor_bogus_node="TRUE">' ;
159
				if ( oEditor.FCKBrowserInfo.IsGeckoLike )
140
				//oCell.innerHTML = "&nbsp;" ;
160
					oEditor.FCKTools.AppendBogusBr( oCell ) ;
141
			}
161
			}
142
		}
-
 
143
		
-
 
144
		oEditor.FCKUndo.SaveUndoStep() ;
-
 
145
		
-
 
146
		// START iCM MODIFICATIONS	
-
 
147
		// Amended to ensure that newly inserted tables are not incorrectly nested in P tags, etc
-
 
148
		// We insert the table first and then rectify any nestings afterwards so we can re-use the
-
 
149
		// FCKTablesProcessor function that corrects tables on SetHTML()
-
 
150
		/*
-
 
151
		table = oEditor.FCK.InsertElementAndGetIt( table ) ;
-
 
152
		if ( !oEditor.FCKConfig.UseBROnCarriageReturn )
-
 
153
		{
-
 
154
			oEditor.FCKTablesProcessor.CheckTableNesting( table ) ;
-
 
155
		}
162
		}
156
		*/
163
 
157
		// END iCM MODIFICATIONS	
-
 
158
		
-
 
159
		oEditor.FCK.InsertElement( table ) ;
-
 
Line 160... Line -...
160
	}
-
 
161
	
-
 
162
	return true ;
-
 
163
}
-
 
164
 
164
		oEditor.FCKUndo.SaveUndoStep() ;
165
function IsDigit( e )
-
 
166
{
-
 
167
	e = e || event ;
-
 
168
	var iCode = ( e.keyCode || e.charCode ) ;
-
 
169
	return 
-
 
170
		(
-
 
171
			( iCode >= 48 && iCode <= 57 )		// Numbers
165
 
Line 172... Line 166...
172
			|| (iCode >= 37 && iCode <= 40)		// Arrows
166
		oEditor.FCK.InsertElement( table ) ;
173
			|| iCode == 8		// Backspace
167
	}
174
			|| iCode == 46		// Delete
168
 
Line 278... Line 272...
278
							</table>
272
							</table>
279
						</td>
273
						</td>
280
					</tr>
274
					</tr>
281
				</table>
275
				</table>
282
				<table cellspacing="0" cellpadding="0" width="100%" border="0">
276
				<table cellspacing="0" cellpadding="0" width="100%" border="0">
283
					<!--
-
 
284
						<tr>
-
 
285
						<td nowrap>
-
 
286
						<span fcklang="DlgClassName">Class Name</span>:</td>
-
 
287
							<td>&nbsp;</td>
-
 
288
										<td>
-
 
289
										<script type="text/javascript">
-
 
290
//											var tbstyles = new TBCombo( "FontStyle"		, "null"			, "", oEditor.config.StyleNames, oEditor.config.StyleValues, 'CheckStyle("cmbFontStyle")');
-
 
291
//											document.write(tbstyles.GetHTML());
-
 
292
										</script></td>
-
 
293
						</tr>
-
 
294
					-->
-
 
295
					<tr>
277
					<tr>
296
						<td nowrap="nowrap">
278
						<td nowrap="nowrap">
297
							<span fcklang="DlgTableCaption">Caption</span>:&nbsp;</td>
279
							<span fcklang="DlgTableCaption">Caption</span>:&nbsp;</td>
298
						<td>
280
						<td>
299
							&nbsp;</td>
281
							&nbsp;</td>