~ubuntu-branches/ubuntu/oneiric/request-tracker3.8/oneiric-updates

« back to all changes in this revision

Viewing changes to share/html/NoAuth/RichText/FCKeditor/editor/dialog/fck_table.html

  • Committer: Bazaar Package Importer
  • Author(s): Dominic Hargreaves, Dominic Hargreaves, Christian Perrier
  • Date: 2009-06-16 21:46:59 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20090616214659-5ji9k1n3qyc2br3n
Tags: 3.8.4-1
[ Dominic Hargreaves ]
* Add missing comma in Depends (fixes FTBFS on etch)
* Update debconf translations: pt.po, ja.po, sv.po, it.po, cs.po, ru.po
  (Closes: #519885, #519922, #520603, #520759, #521199, #521926)
* Document preference for not using SQLite in production
  (Closes: #512750)

[ Christian Perrier ]
* Debconf templates and debian/control reviewed by the debian-l10n-
  english team as part of the Smith review project.
  (Closes: #522367, #520959)
* [Debconf translation updates]
  - Japanese. Closes: #522896
  - German. Closes: #520958
  - Portuguese. Closes: #523481
  - Galician. Closes: #524256
  - Galician. Closes: #524256
  - Spanish. Closes: #524449
  - Italian. Closes: #524715
  - Russian. Closes: #524894
  - Swedish. Closes: #525171
  - French. Closes: #525281

[ Dominic Hargreaves ]
* Don't tell dbconfig to comment out unused variables, since this
  breaks MySQL and Postgres database configuration (Closes: #523090)
* Update Standards-Version (no changes)
* Switch dependency on sysklogd to rsyslog (Closes: #526914)
* New upstream release; includes
  - Minor security fix (Closes: #533069)
  - Add missing Postgres index (Closes: #512653)
* Patch webmux.pl to provide a better error message when the wrong
  major version of RT is in @INC (for example in a mod_perl context).
  (Closes: #518692)
* Add some more example Exim 4 configuration (Closes: #238345)
* Don't apply database ACLs in databases managed by dbconfig-common.
* Remove unused ACL patch

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
2
2
<!--
3
3
 * FCKeditor - The text editor for Internet - http://www.fckeditor.net
4
 
 * Copyright (C) 2003-2008 Frederico Caldeira Knabben
 
4
 * Copyright (C) 2003-2009 Frederico Caldeira Knabben
5
5
 *
6
6
 * == BEGIN LICENSE ==
7
7
 *
31
31
 
32
32
var dialog      = window.parent ;
33
33
var oEditor = dialog.InnerDialogLoaded() ;
34
 
var dialogArguments = dialog.Args() ;
35
34
 
36
 
// Gets the document DOM
37
 
var oDOM = oEditor.FCK.EditorDocument ;
 
35
var FCKDomTools = oEditor.FCKDomTools ;
38
36
 
39
37
// Gets the table if there is one selected.
40
38
var table ;
41
39
var e = dialog.Selection.GetSelectedElement() ;
 
40
var hasColumnHeaders ;
42
41
 
43
42
if ( ( !e && document.location.search.substr(1) == 'Parent' ) || ( e && e.tagName != 'TABLE' ) )
44
43
        e = oEditor.FCKSelection.MoveToAncestorNode( 'TABLE' ) ;
88
87
                var eCaption = oEditor.FCKDomTools.GetFirstChild( table, 'CAPTION' ) ;
89
88
                if ( eCaption ) document.getElementById('txtCaption').value = eCaption.innerHTML ;
90
89
 
 
90
                hasColumnHeaders = true ;
 
91
                // Check if all the first cells in every row are TH
 
92
                for (var row=0; row<table.rows.length; row++)
 
93
                {
 
94
                        // If just one cell isn't a TH then it isn't a header column
 
95
                        if ( table.rows[row].cells[0].nodeName != 'TH' )
 
96
                        {
 
97
                                hasColumnHeaders = false ;
 
98
 
 
99
                                break;
 
100
                        }
 
101
                }
 
102
 
 
103
                // Check if the table contains <thead>
 
104
                if ((table.tHead !== null) )
 
105
                {
 
106
                        if (hasColumnHeaders)
 
107
                                GetE('selHeaders').value = 'both' ;
 
108
                        else
 
109
                                GetE('selHeaders').value = 'row' ;
 
110
                }
 
111
                else
 
112
                {
 
113
                        if (hasColumnHeaders)
 
114
                                GetE('selHeaders').value = 'col' ;
 
115
                        else
 
116
                                GetE('selHeaders').value = '' ;
 
117
                }
 
118
 
 
119
 
91
120
                document.getElementById('txtRows').disabled    = true ;
92
121
                document.getElementById('txtColumns').disabled = true ;
93
122
                SelectField( 'txtWidth' ) ;
104
133
{
105
134
        var bExists = ( table != null ) ;
106
135
 
 
136
        var oDoc = oEditor.FCK.EditorDocument ;
 
137
        oEditor.FCKUndo.SaveUndoStep() ;
 
138
 
107
139
        if ( ! bExists )
108
 
                table = oEditor.FCK.EditorDocument.createElement( "TABLE" ) ;
 
140
                table = oDoc.createElement( "TABLE" ) ;
109
141
 
110
142
        // Removes the Width and Height styles
111
143
        if ( bExists && table.style.width )             table.style.width = null ; //.removeAttribute("width") ;
129
161
        {
130
162
                if ( !eCaption )
131
163
                {
132
 
                        eCaption = oEditor.FCK.EditorDocument.createElement( 'CAPTION' ) ;
 
164
                        eCaption = oDoc.createElement( 'CAPTION' ) ;
133
165
                        table.insertBefore( eCaption, table.firstChild ) ;
134
166
                }
135
167
 
145
177
                        eCaption.parentNode.removeChild( eCaption ) ;
146
178
        }
147
179
 
 
180
        var headers = GetE('selHeaders').value ;
 
181
        if ( bExists )
 
182
        {
 
183
                // Should we make a <thead>?
 
184
                if ( table.tHead==null && (headers=='row' || headers=='both') )
 
185
                {
 
186
                        var oThead = table.createTHead() ;
 
187
                        var tbody = FCKDomTools.GetFirstChild( table, 'TBODY' ) ;
 
188
                        var theRow= FCKDomTools.GetFirstChild( tbody, 'TR' ) ;
 
189
 
 
190
                        //now change TD to TH:
 
191
                        for (var i = 0; i<theRow.childNodes.length ; i++)
 
192
                        {
 
193
                                var th = RenameNode(theRow.childNodes[i], 'TH') ;
 
194
                                if (th != null)
 
195
                                        th.scope='col' ;
 
196
                        }
 
197
                        oThead.appendChild( theRow ) ;
 
198
                }
 
199
 
 
200
                if ( table.tHead!==null && !(headers=='row' || headers=='both') )
 
201
                {
 
202
                        // Move the row out of the THead and put it in the TBody:
 
203
                        var tHead = table.tHead ;
 
204
                        var tbody = FCKDomTools.GetFirstChild( table, 'TBODY' ) ;
 
205
 
 
206
                        var previousFirstRow = tbody.firstChild ;
 
207
                        while ( tHead.firstChild )
 
208
                        {
 
209
                                var theRow = tHead.firstChild ;
 
210
                                for (var i = 0; i < theRow.childNodes.length ; i++ )
 
211
                                {
 
212
                                        var newCell = RenameNode( theRow.childNodes[i], 'TD' ) ;
 
213
                                        if ( newCell != null )
 
214
                                                newCell.removeAttribute( 'scope' ) ;
 
215
                                }
 
216
                                tbody.insertBefore( theRow, previousFirstRow ) ;
 
217
                        }
 
218
                        table.removeChild( tHead ) ;
 
219
                }
 
220
 
 
221
                // Should we make all first cells in a row TH?
 
222
                if ( (!hasColumnHeaders)  && (headers=='col' || headers=='both') )
 
223
                {
 
224
                        for( var row=0 ; row < table.rows.length ; row++ )
 
225
                        {
 
226
                                var newCell = RenameNode(table.rows[row].cells[0], 'TH') ;
 
227
                                if ( newCell != null )
 
228
                                        newCell.scope = 'row' ;
 
229
                        }
 
230
                }
 
231
 
 
232
                // Should we make all first TH-cells in a row make TD? If 'yes' we do it the other way round :-)
 
233
                if ( (hasColumnHeaders)  && !(headers=='col' || headers=='both') )
 
234
                {
 
235
                        for( var row=0 ; row < table.rows.length ; row++ )
 
236
                        {
 
237
                                var oRow = table.rows[row] ;
 
238
                                if ( oRow.parentNode.nodeName == 'TBODY' )
 
239
                                {
 
240
                                        var newCell = RenameNode(oRow.cells[0], 'TD') ;
 
241
                                        if (newCell != null)
 
242
                                                newCell.removeAttribute( 'scope' ) ;
 
243
                                }
 
244
                        }
 
245
                }
 
246
        }
 
247
 
148
248
        if (! bExists)
149
249
        {
150
 
                var iRows = document.getElementById('txtRows').value ;
151
 
                var iCols = document.getElementById('txtColumns').value ;
 
250
                var iRows = GetE('txtRows').value ;
 
251
                var iCols = GetE('txtColumns').value ;
152
252
 
153
 
                for ( var r = 0 ; r < iRows ; r++ )
 
253
                var startRow = 0 ;
 
254
                // Should we make a <thead> ?
 
255
                if (headers=='row' || headers=='both')
154
256
                {
 
257
                        startRow++ ;
 
258
                        var oThead = table.createTHead() ;
155
259
                        var oRow = table.insertRow(-1) ;
 
260
                        oThead.appendChild(oRow);
 
261
 
156
262
                        for ( var c = 0 ; c < iCols ; c++ )
157
263
                        {
158
 
                                var oCell = oRow.insertCell(-1) ;
 
264
                                var oThcell = oDoc.createElement( 'TH' ) ;
 
265
                                oThcell.scope = 'col' ;
 
266
                                oRow.appendChild( oThcell ) ;
 
267
                                if ( oEditor.FCKBrowserInfo.IsGeckoLike )
 
268
                                        oEditor.FCKTools.AppendBogusBr( oThcell ) ;
 
269
                        }
 
270
                }
 
271
 
 
272
                // Opera automatically creates a tbody when a thead has been added
 
273
                var oTbody = FCKDomTools.GetFirstChild( table, 'TBODY' ) ;
 
274
                if ( !oTbody )
 
275
                {
 
276
                        // make TBODY if it doesn't exist
 
277
                        oTbody = oDoc.createElement( 'TBODY' ) ;
 
278
                        table.appendChild( oTbody ) ;
 
279
                }
 
280
                for ( var r = startRow ; r < iRows; r++ )
 
281
                {
 
282
                        var oRow = oDoc.createElement( 'TR' ) ;
 
283
                        oTbody.appendChild(oRow) ;
 
284
 
 
285
                        var startCol = 0 ;
 
286
                        // Is the first column a header?
 
287
                        if (headers=='col' || headers=='both')
 
288
                        {
 
289
                                var oThcell = oDoc.createElement( 'TH' ) ;
 
290
                                oThcell.scope = 'row' ;
 
291
                                oRow.appendChild( oThcell ) ;
 
292
                                if ( oEditor.FCKBrowserInfo.IsGeckoLike )
 
293
                                        oEditor.FCKTools.AppendBogusBr( oThcell ) ;
 
294
 
 
295
                                startCol++ ;
 
296
                        }
 
297
                        for ( var c = startCol ; c < iCols ; c++ )
 
298
                        {
 
299
                                // IE will leave the TH at the end of the row if we use now oRow.insertCell(-1)
 
300
                                var oCell = oDoc.createElement( 'TD' ) ;
 
301
                                oRow.appendChild( oCell ) ;
159
302
                                if ( oEditor.FCKBrowserInfo.IsGeckoLike )
160
303
                                        oEditor.FCKTools.AppendBogusBr( oCell ) ;
161
304
                        }
162
305
                }
163
306
 
164
 
                oEditor.FCKUndo.SaveUndoStep() ;
165
 
 
166
307
                oEditor.FCK.InsertElement( table ) ;
167
308
        }
168
309
 
178
319
                                <table cellspacing="1" cellpadding="1" width="100%" border="0">
179
320
                                        <tr>
180
321
                                                <td valign="top">
181
 
                                                        <table cellspacing="0" cellpadding="0" border="0">
 
322
                                                        <table cellspacing="1" cellpadding="0" border="0">
182
323
                                                                <tr>
183
324
                                                                        <td>
184
325
                                                                                <span fcklang="DlgTableRows">Rows</span>:</td>
185
326
                                                                        <td>
186
 
                                                                                &nbsp;<input id="txtRows" type="text" maxlength="3" size="2" value="3" name="txtRows"
 
327
                                                                                &nbsp;<input id="txtRows" type="text" maxlength="3" size="2" value="3"
187
328
                                                                                        onkeypress="return IsDigit(event);" /></td>
188
329
                                                                </tr>
189
330
                                                                <tr>
190
331
                                                                        <td>
191
332
                                                                                <span fcklang="DlgTableColumns">Columns</span>:</td>
192
333
                                                                        <td>
193
 
                                                                                &nbsp;<input id="txtColumns" type="text" maxlength="2" size="2" value="2" name="txtColumns"
 
334
                                                                                &nbsp;<input id="txtColumns" type="text" maxlength="2" size="2" value="2"
194
335
                                                                                        onkeypress="return IsDigit(event);" /></td>
195
336
                                                                </tr>
196
337
                                                                <tr>
197
 
                                                                        <td>
198
 
                                                                                &nbsp;</td>
199
 
                                                                        <td>
200
 
                                                                                &nbsp;</td>
 
338
                                                                        <td><span fcklang="DlgTableHeaders">Headers</span>:</td>
 
339
                                                                        <td>
 
340
                                                                                &nbsp;<select id="selHeaders">
 
341
                                                                                        <option fcklang="DlgTableHeadersNone" value="">None</option>
 
342
                                                                                        <option fcklang="DlgTableHeadersRow" value="row">First row</option>
 
343
                                                                                        <option fcklang="DlgTableHeadersColumn" value="col">First column</option>
 
344
                                                                                        <option fcklang="DlgTableHeadersBoth" value="both">Both</option>
 
345
                                                                                </select>
 
346
                                                                        </td>
201
347
                                                                </tr>
202
348
                                                                <tr>
203
349
                                                                        <td>
204
350
                                                                                <span fcklang="DlgTableBorder">Border size</span>:</td>
205
351
                                                                        <td>
206
 
                                                                                &nbsp;<input id="txtBorder" type="text" maxlength="2" size="2" value="1" name="txtBorder"
 
352
                                                                                &nbsp;<input id="txtBorder" type="text" maxlength="2" size="2" value="1"
207
353
                                                                                        onkeypress="return IsDigit(event);" /></td>
208
354
                                                                </tr>
209
355
                                                                <tr>
210
356
                                                                        <td>
211
357
                                                                                <span fcklang="DlgTableAlign">Alignment</span>:</td>
212
358
                                                                        <td>
213
 
                                                                                &nbsp;<select id="selAlignment" name="selAlignment">
 
359
                                                                                &nbsp;<select id="selAlignment">
214
360
                                                                                        <option fcklang="DlgTableAlignNotSet" value="" selected="selected">&lt;Not set&gt;</option>
215
361
                                                                                        <option fcklang="DlgTableAlignLeft" value="left">Left</option>
216
362
                                                                                        <option fcklang="DlgTableAlignCenter" value="center">Center</option>
227
373
                                                                        <td>
228
374
                                                                                <span fcklang="DlgTableWidth">Width</span>:</td>
229
375
                                                                        <td>
230
 
                                                                                &nbsp;<input id="txtWidth" type="text" maxlength="4" size="3" value="200" name="txtWidth"
 
376
                                                                                &nbsp;<input id="txtWidth" type="text" maxlength="4" size="3" value="200"
231
377
                                                                                        onkeypress="return IsDigit(event);" /></td>
232
378
                                                                        <td>
233
 
                                                                                &nbsp;<select id="selWidthType" name="selWidthType">
 
379
                                                                                &nbsp;<select id="selWidthType">
234
380
                                                                                        <option fcklang="DlgTableWidthPx" value="pixels" selected="selected">pixels</option>
235
381
                                                                                        <option fcklang="DlgTableWidthPc" value="percent">percent</option>
236
382
                                                                                </select></td>
239
385
                                                                        <td>
240
386
                                                                                <span fcklang="DlgTableHeight">Height</span>:</td>
241
387
                                                                        <td>
242
 
                                                                                &nbsp;<input id="txtHeight" type="text" maxlength="4" size="3" name="txtHeight" onkeypress="return IsDigit(event);" /></td>
 
388
                                                                                &nbsp;<input id="txtHeight" type="text" maxlength="4" size="3" onkeypress="return IsDigit(event);" /></td>
243
389
                                                                        <td>
244
390
                                                                                &nbsp;<span fcklang="DlgTableWidthPx">pixels</span></td>
245
391
                                                                </tr>
246
392
                                                                <tr>
247
 
                                                                        <td>
248
 
                                                                                &nbsp;</td>
249
 
                                                                        <td>
250
 
                                                                                &nbsp;</td>
251
 
                                                                        <td>
252
 
                                                                                &nbsp;</td>
 
393
                                                                        <td colspan="3">&nbsp;</td>
253
394
                                                                </tr>
254
395
                                                                <tr>
255
396
                                                                        <td nowrap="nowrap">
256
397
                                                                                <span fcklang="DlgTableCellSpace">Cell spacing</span>:</td>
257
398
                                                                        <td>
258
 
                                                                                &nbsp;<input id="txtCellSpacing" type="text" maxlength="2" size="2" value="1" name="txtCellSpacing"
 
399
                                                                                &nbsp;<input id="txtCellSpacing" type="text" maxlength="2" size="2" value="1"
259
400
                                                                                        onkeypress="return IsDigit(event);" /></td>
260
401
                                                                        <td>
261
402
                                                                                &nbsp;</td>
264
405
                                                                        <td nowrap="nowrap">
265
406
                                                                                <span fcklang="DlgTableCellPad">Cell padding</span>:</td>
266
407
                                                                        <td>
267
 
                                                                                &nbsp;<input id="txtCellPadding" type="text" maxlength="2" size="2" value="1" name="txtCellPadding"
 
408
                                                                                &nbsp;<input id="txtCellPadding" type="text" maxlength="2" size="2" value="1"
268
409
                                                                                        onkeypress="return IsDigit(event);" /></td>
269
410
                                                                        <td>
270
411
                                                                                &nbsp;</td>