1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
3 * FCKeditor - The text editor for Internet - http://www.fckeditor.net
4 * Copyright (C) 2003-2010 Frederico Caldeira Knabben
8 * Licensed under the terms of any of the following licenses at your
11 * - GNU General Public License Version 2 or later (the "GPL")
12 * http://www.gnu.org/licenses/gpl.html
14 * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
15 * http://www.gnu.org/licenses/lgpl.html
17 * - Mozilla Public License Version 1.1 or later (the "MPL")
18 * http://www.mozilla.org/MPL/MPL-1.1.html
27 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" >
28 <meta content="noindex, nofollow" name="robots" >
29 <script src="common/fck_dialog_common.js" type="text/javascript"></script>
30 <script type="text/javascript">
32 var oEditor = window.parent.InnerDialogLoaded() ;
33 var FCK = oEditor.FCK ;
34 var FCKLang = oEditor.FCKLang ;
35 var FCKConfig = oEditor.FCKConfig ;
39 // Set the dialog tabs.
40 window.parent.AddTab( 'General' , FCKLang.DlgDocGeneralTab ) ;
41 window.parent.AddTab( 'Background' , FCKLang.DlgDocBackTab ) ;
42 window.parent.AddTab( 'Colors' , FCKLang.DlgDocColorsTab ) ;
43 window.parent.AddTab( 'Meta' , FCKLang.DlgDocMetaTab ) ;
45 // Function called when a dialog tag is selected.
46 function OnDialogTabChange( tabCode )
48 ShowE( 'divGeneral' , ( tabCode == 'General' ) ) ;
49 ShowE( 'divBackground' , ( tabCode == 'Background' ) ) ;
50 ShowE( 'divColors' , ( tabCode == 'Colors' ) ) ;
51 ShowE( 'divMeta' , ( tabCode == 'Meta' ) ) ;
53 ShowE( 'ePreview' , ( tabCode == 'Background' || tabCode == 'Colors' ) ) ;
56 //#### Get Base elements from the document: BEGIN
58 // The HTML element of the document.
59 var oHTML = FCK.EditorDocument.getElementsByTagName('html')[0] ;
61 // The HEAD element of the document.
62 var oHead = oHTML.getElementsByTagName('head')[0] ;
64 var oBody = FCK.EditorDocument.body ;
66 // This object contains all META tags defined in the document.
67 var oMetaTags = new Object() ;
69 // Get all META tags defined in the document.
70 AppendMetaCollection( oMetaTags, oHead.getElementsByTagName('meta') ) ;
71 AppendMetaCollection( oMetaTags, oHead.getElementsByTagName('fck:meta') ) ;
73 function AppendMetaCollection( targetObject, metaCollection )
75 // Loop throw all METAs and put it in the HashTable.
76 for ( var i = 0 ; i < metaCollection.length ; i++ )
78 // Try to get the "name" attribute.
79 var sName = GetAttribute( metaCollection[i], 'name', GetAttribute( metaCollection[i], '___fcktoreplace:name', '' ) ) ;
81 // If no "name", try with the "http-equiv" attribute.
82 if ( sName.length == 0 )
84 if ( oEditor.FCKBrowserInfo.IsIE )
86 // Get the http-equiv value from the outerHTML.
87 var oHttpEquivMatch = metaCollection[i].outerHTML.match( oEditor.FCKRegexLib.MetaHttpEquiv ) ;
88 if ( oHttpEquivMatch )
89 sName = oHttpEquivMatch[1] ;
92 sName = GetAttribute( metaCollection[i], 'http-equiv', '' ) ;
95 if ( sName.length > 0 )
96 targetObject[ sName.toLowerCase() ] = metaCollection[i] ;
102 // Set a META tag in the document.
103 function SetMetadata( name, content, isHttp )
105 if ( content.length == 0 )
107 RemoveMetadata( name ) ;
111 var oMeta = oMetaTags[ name.toLowerCase() ] ;
115 oMeta = oHead.appendChild( FCK.EditorDocument.createElement('META') ) ;
118 SetAttribute( oMeta, 'http-equiv', name ) ;
121 // On IE, it is not possible to set the "name" attribute of the META tag.
122 // So a temporary attribute is used and it is replaced when getting the
123 // editor's HTML/XHTML value. This is sad, I know :(
124 if ( oEditor.FCKBrowserInfo.IsIE )
125 SetAttribute( oMeta, '___fcktoreplace:name', name ) ;
127 SetAttribute( oMeta, 'name', name ) ;
130 oMetaTags[ name.toLowerCase() ] = oMeta ;
133 SetAttribute( oMeta, 'content', content ) ;
134 // oMeta.content = content ;
137 function RemoveMetadata( name )
139 var oMeta = oMetaTags[ name.toLowerCase() ] ;
141 if ( oMeta && oMeta != null )
143 oMeta.parentNode.removeChild( oMeta ) ;
144 oMetaTags[ name.toLowerCase() ] = null ;
148 function GetMetadata( name )
150 var oMeta = oMetaTags[ name.toLowerCase() ] ;
152 if ( oMeta && oMeta != null )
153 return oMeta.getAttribute( 'content', 2 ) ;
158 window.onload = function ()
160 // Show/Hide the "Browse Server" button.
161 GetE('tdBrowse').style.display = oEditor.FCKConfig.ImageBrowser ? "" : "none";
163 // First of all, translate the dialog box texts
164 oEditor.FCKLanguageManager.TranslatePage( document ) ;
170 // Show the "Ok" button.
171 window.parent.SetOkButton( true ) ;
173 window.parent.SetAutoSize( true ) ;
176 function FillFields()
179 GetE('txtPageTitle').value = FCK.EditorDocument.title ;
181 GetE('selDirection').value = GetAttribute( oHTML, 'dir', '' ) ;
182 GetE('txtLang').value = GetAttribute( oHTML, 'xml:lang', GetAttribute( oHTML, 'lang', '' ) ) ; // "xml:lang" takes precedence to "lang".
184 // Character Set Encoding.
185 // if ( oEditor.FCKBrowserInfo.IsIE )
186 // var sCharSet = FCK.EditorDocument.charset ;
188 var sCharSet = GetMetadata( 'Content-Type' ) ;
190 if ( sCharSet != null && sCharSet.length > 0 )
192 // if ( !oEditor.FCKBrowserInfo.IsIE )
193 sCharSet = sCharSet.match( /[^=]*$/ ) ;
195 GetE('selCharSet').value = sCharSet ;
197 if ( GetE('selCharSet').selectedIndex == -1 )
199 GetE('selCharSet').value = '...' ;
200 GetE('txtCustomCharSet').value = sCharSet ;
202 CheckOther( GetE('selCharSet'), 'txtCustomCharSet' ) ;
207 if ( FCK.DocTypeDeclaration && FCK.DocTypeDeclaration.length > 0 )
209 GetE('selDocType').value = FCK.DocTypeDeclaration ;
211 if ( GetE('selDocType').selectedIndex == -1 )
213 GetE('selDocType').value = '...' ;
214 GetE('txtDocType').value = FCK.DocTypeDeclaration ;
216 CheckOther( GetE('selDocType'), 'txtDocType' ) ;
221 GetE('chkIncXHTMLDecl').checked = ( FCK.XmlDeclaration && FCK.XmlDeclaration.length > 0 ) ;
224 GetE('txtBackColor').value = GetAttribute( oBody, 'bgColor' , '' ) ;
225 GetE('txtBackImage').value = GetAttribute( oBody, 'background' , '' ) ;
226 GetE('chkBackNoScroll').checked = ( GetAttribute( oBody, 'bgProperties', '' ).toLowerCase() == 'fixed' ) ;
229 GetE('txtColorText').value = GetAttribute( oBody, 'text' , '' ) ;
230 GetE('txtColorLink').value = GetAttribute( oBody, 'link' , '' ) ;
231 GetE('txtColorVisited').value = GetAttribute( oBody, 'vLink' , '' ) ;
232 GetE('txtColorActive').value = GetAttribute( oBody, 'aLink' , '' ) ;
235 GetE('txtMarginTop').value = GetAttribute( oBody, 'topMargin' , '' ) ;
236 GetE('txtMarginLeft').value = GetAttribute( oBody, 'leftMargin' , '' ) ;
237 GetE('txtMarginRight').value = GetAttribute( oBody, 'rightMargin' , '' ) ;
238 GetE('txtMarginBottom').value = GetAttribute( oBody, 'bottomMargin' , '' ) ;
241 GetE('txtMetaKeywords').value = GetMetadata( 'keywords' ) ;
242 GetE('txtMetaDescription').value = GetMetadata( 'description' ) ;
243 GetE('txtMetaAuthor').value = GetMetadata( 'author' ) ;
244 GetE('txtMetaCopyright').value = GetMetadata( 'copyright' ) ;
247 // Called when the "Ok" button is clicked.
251 FCK.EditorDocument.title = GetE('txtPageTitle').value ;
253 var oHTML = FCK.EditorDocument.getElementsByTagName('html')[0] ;
255 SetAttribute( oHTML, 'dir' , GetE('selDirection').value ) ;
256 SetAttribute( oHTML, 'lang' , GetE('txtLang').value ) ;
257 SetAttribute( oHTML, 'xml:lang' , GetE('txtLang').value ) ;
259 // Character Set Enconding.
260 var sCharSet = GetE('selCharSet').value ;
261 if ( sCharSet == '...' )
262 sCharSet = GetE('txtCustomCharSet').value ;
264 if ( sCharSet.length > 0 )
265 sCharSet = 'text/html; charset=' + sCharSet ;
267 // if ( oEditor.FCKBrowserInfo.IsIE )
268 // FCK.EditorDocument.charset = sCharSet ;
270 SetMetadata( 'Content-Type', sCharSet, true ) ;
273 var sDocType = GetE('selDocType').value ;
274 if ( sDocType == '...' )
275 sDocType = GetE('txtDocType').value ;
277 FCK.DocTypeDeclaration = sDocType ;
279 // XHTML Declarations.
280 if ( GetE('chkIncXHTMLDecl').checked )
282 if ( sCharSet.length == 0 )
285 FCK.XmlDeclaration = '<' + '?xml version="1.0" encoding="' + sCharSet + '"?>' ;
287 SetAttribute( oHTML, 'xmlns', 'http://www.w3.org/1999/xhtml' ) ;
291 FCK.XmlDeclaration = null ;
292 oHTML.removeAttribute( 'xmlns', 0 ) ;
296 SetAttribute( oBody, 'bgcolor' , GetE('txtBackColor').value ) ;
297 SetAttribute( oBody, 'background' , GetE('txtBackImage').value ) ;
298 SetAttribute( oBody, 'bgproperties' , GetE('chkBackNoScroll').checked ? 'fixed' : '' ) ;
301 SetAttribute( oBody, 'text' , GetE('txtColorText').value ) ;
302 SetAttribute( oBody, 'link' , GetE('txtColorLink').value ) ;
303 SetAttribute( oBody, 'vlink', GetE('txtColorVisited').value ) ;
304 SetAttribute( oBody, 'alink', GetE('txtColorActive').value ) ;
307 SetAttribute( oBody, 'topmargin' , GetE('txtMarginTop').value ) ;
308 SetAttribute( oBody, 'leftmargin' , GetE('txtMarginLeft').value ) ;
309 SetAttribute( oBody, 'rightmargin' , GetE('txtMarginRight').value ) ;
310 SetAttribute( oBody, 'bottommargin' , GetE('txtMarginBottom').value ) ;
313 SetMetadata( 'keywords' , GetE('txtMetaKeywords').value ) ;
314 SetMetadata( 'description' , GetE('txtMetaDescription').value ) ;
315 SetMetadata( 'author' , GetE('txtMetaAuthor').value ) ;
316 SetMetadata( 'copyright' , GetE('txtMetaCopyright').value ) ;
321 var bPreviewIsLoaded = false ;
325 // Called by the Preview page when loaded.
326 function OnPreviewLoad( previewWindow, previewBody )
328 oPreviewWindow = previewWindow ;
329 oPreviewBody = previewBody ;
331 bPreviewIsLoaded = true ;
335 function UpdatePreview()
337 if ( !bPreviewIsLoaded )
341 SetAttribute( oPreviewBody, 'bgcolor' , GetE('txtBackColor').value ) ;
342 SetAttribute( oPreviewBody, 'background' , GetE('txtBackImage').value ) ;
343 SetAttribute( oPreviewBody, 'bgproperties' , GetE('chkBackNoScroll').checked ? 'fixed' : '' ) ;
346 SetAttribute( oPreviewBody, 'text', GetE('txtColorText').value ) ;
348 oPreviewWindow.SetLinkColor( GetE('txtColorLink').value ) ;
349 oPreviewWindow.SetVisitedColor( GetE('txtColorVisited').value ) ;
350 oPreviewWindow.SetActiveColor( GetE('txtColorActive').value ) ;
353 function CheckOther( combo, txtField )
355 var bNotOther = ( combo.value != '...' ) ;
357 GetE(txtField).style.backgroundColor = ( bNotOther ? '#cccccc' : '' ) ;
358 GetE(txtField).disabled = bNotOther ;
361 function SetColor( inputId, color )
363 GetE( inputId ).value = color + '' ;
367 function SelectBackColor( color ) { SetColor('txtBackColor', color ) ; }
368 function SelectColorText( color ) { SetColor('txtColorText', color ) ; }
369 function SelectColorLink( color ) { SetColor('txtColorLink', color ) ; }
370 function SelectColorVisited( color ) { SetColor('txtColorVisited', color ) ; }
371 function SelectColorActive( color ) { SetColor('txtColorActive', color ) ; }
373 function SelectColor( wich )
377 case 'Back' : oEditor.FCKDialog.OpenDialog( 'FCKDialog_Color', FCKLang.DlgColorTitle, 'dialog/fck_colorselector.html', 410, 320, SelectBackColor ) ; return ;
378 case 'ColorText' : oEditor.FCKDialog.OpenDialog( 'FCKDialog_Color', FCKLang.DlgColorTitle, 'dialog/fck_colorselector.html', 410, 320, SelectColorText ) ; return ;
379 case 'ColorLink' : oEditor.FCKDialog.OpenDialog( 'FCKDialog_Color', FCKLang.DlgColorTitle, 'dialog/fck_colorselector.html', 410, 320, SelectColorLink ) ; return ;
380 case 'ColorVisited' : oEditor.FCKDialog.OpenDialog( 'FCKDialog_Color', FCKLang.DlgColorTitle, 'dialog/fck_colorselector.html', 410, 320, SelectColorVisited ) ; return ;
381 case 'ColorActive' : oEditor.FCKDialog.OpenDialog( 'FCKDialog_Color', FCKLang.DlgColorTitle, 'dialog/fck_colorselector.html', 410, 320, SelectColorActive ) ; return ;
385 function BrowseServerBack()
387 OpenFileBrowser( FCKConfig.ImageBrowserURL, FCKConfig.ImageBrowserWindowWidth, FCKConfig.ImageBrowserWindowHeight ) ;
390 function SetUrl( url )
392 GetE('txtBackImage').value = url ;
398 <body style="overflow: hidden">
399 <table cellspacing="0" cellpadding="0" width="100%" border="0" style="height: 100%">
401 <td valign="top" style="height: 100%">
402 <div id="divGeneral">
403 <span fcklang="DlgDocPageTitle">Page Title</span><br />
404 <input id="txtPageTitle" style="width: 100%" type="text" />
406 <table cellspacing="0" cellpadding="0" border="0">
409 <span fcklang="DlgDocLangDir">Language Direction</span><br />
410 <select id="selDirection">
411 <option value="" selected="selected"></option>
412 <option value="ltr" fcklang="DlgDocLangDirLTR">Left to Right (LTR)</option>
413 <option value="rtl" fcklang="DlgDocLangDirRTL">Right to Left (RTL)</option>
417 </td>
419 <span fcklang="DlgDocLangCode">Language Code</span><br />
420 <input id="txtLang" type="text" />
425 <table cellspacing="0" cellpadding="0" width="100%" border="0">
427 <td style="white-space: nowrap">
428 <span fcklang="DlgDocCharSet">Character Set Encoding</span><br />
429 <select id="selCharSet" onchange="CheckOther( this, 'txtCustomCharSet' );">
430 <option value="" selected="selected"></option>
431 <option value="us-ascii">ASCII</option>
432 <option fcklang="DlgDocCharSetCE" value="iso-8859-2">Central European</option>
433 <option fcklang="DlgDocCharSetCT" value="big5">Chinese Traditional (Big5)</option>
434 <option fcklang="DlgDocCharSetCR" value="iso-8859-5">Cyrillic</option>
435 <option fcklang="DlgDocCharSetGR" value="iso-8859-7">Greek</option>
436 <option fcklang="DlgDocCharSetJP" value="iso-2022-jp">Japanese</option>
437 <option fcklang="DlgDocCharSetKR" value="iso-2022-kr">Korean</option>
438 <option fcklang="DlgDocCharSetTR" value="iso-8859-9">Turkish</option>
439 <option fcklang="DlgDocCharSetUN" value="utf-8">Unicode (UTF-8)</option>
440 <option fcklang="DlgDocCharSetWE" value="iso-8859-1">Western European</option>
441 <option fcklang="DlgOpOther" value="..."><Other></option>
445 </td>
447 <span fcklang="DlgDocCharSetOther">Other Character Set Encoding</span><br />
448 <input id="txtCustomCharSet" style="width: 100%; background-color: #cccccc" disabled="disabled"
458 <span fcklang="DlgDocDocType">Document Type Heading</span><br />
459 <select id="selDocType" onchange="CheckOther( this, 'txtDocType' );">
460 <option value="" selected="selected"></option>
461 <option value='<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">'>HTML
462 4.01 Transitional</option>
463 <option value='<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">'>
464 HTML 4.01 Strict</option>
465 <option value='<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">'>
466 HTML 4.01 Frameset</option>
467 <option value='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'>
468 XHTML 1.0 Transitional</option>
469 <option value='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">'>
470 XHTML 1.0 Strict</option>
471 <option value='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">'>
472 XHTML 1.0 Frameset</option>
473 <option value='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">'>
475 <option value='<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">'>HTML 3.2</option>
476 <option value='<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">'>HTML 2.0</option>
477 <option value="..." fcklang="DlgOpOther"><Other></option>
483 <span fcklang="DlgDocDocTypeOther">Other Document Type Heading</span><br />
484 <input id="txtDocType" style="width: 100%; background-color: #cccccc" disabled="disabled"
490 <input id="chkIncXHTMLDecl" type="checkbox" />
491 <label for="chkIncXHTMLDecl" fcklang="DlgDocIncXHTML">
492 Include XHTML Declarations</label>
494 <div id="divBackground" style="display: none">
495 <span fcklang="DlgDocBgColor">Background Color</span><br />
496 <input id="txtBackColor" type="text" onchange="UpdatePreview();" onkeyup="UpdatePreview();" /> <input
497 id="btnSelBackColor" onclick="SelectColor( 'Back' )" type="button" value="Select..."
498 fcklang="DlgCellBtnSelect" /><br />
500 <span fcklang="DlgDocBgImage">Background Image URL</span><br />
501 <table cellspacing="0" cellpadding="0" width="100%" border="0">
504 <input id="txtBackImage" style="width: 100%" type="text" onchange="UpdatePreview();"
505 onkeyup="UpdatePreview();" /></td>
506 <td id="tdBrowse" nowrap="nowrap">
507 <input id="btnBrowse" onclick="BrowseServerBack();" type="button" fcklang="DlgBtnBrowseServer"
508 value="Browse Server" /></td>
511 <input id="chkBackNoScroll" type="checkbox" onclick="UpdatePreview();" />
512 <label for="chkBackNoScroll" fcklang="DlgDocBgNoScroll">
513 Nonscrolling Background</label>
515 <div id="divColors" style="display: none">
516 <table cellspacing="0" cellpadding="0" width="100%" border="0">
519 <span fcklang="DlgDocCText">Text</span><br />
520 <input id="txtColorText" type="text" onchange="UpdatePreview();" onkeyup="UpdatePreview();" /><input
521 onclick="SelectColor( 'ColorText' )" type="button" value="Select..." fcklang="DlgCellBtnSelect" />
523 <span fcklang="DlgDocCLink">Link</span><br />
524 <input id="txtColorLink" type="text" onchange="UpdatePreview();" onkeyup="UpdatePreview();" /><input
525 onclick="SelectColor( 'ColorLink' )" type="button" value="Select..." fcklang="DlgCellBtnSelect" />
527 <span fcklang="DlgDocCVisited">Visited Link</span><br />
528 <input id="txtColorVisited" type="text" onchange="UpdatePreview();" onkeyup="UpdatePreview();" /><input
529 onclick="SelectColor( 'ColorVisited' )" type="button" value="Select..." fcklang="DlgCellBtnSelect" />
531 <span fcklang="DlgDocCActive">Active Link</span><br />
532 <input id="txtColorActive" type="text" onchange="UpdatePreview();" onkeyup="UpdatePreview();" /><input
533 onclick="SelectColor( 'ColorActive' )" type="button" value="Select..." fcklang="DlgCellBtnSelect" />
535 <td valign="middle" align="center">
536 <table cellspacing="2" cellpadding="0" border="0">
539 <span fcklang="DlgDocMargins">Page Margins</span></td>
542 <td style="border: #000000 1px solid; padding: 5px">
543 <table cellpadding="0" cellspacing="0" border="0" dir="ltr">
545 <td align="center" colspan="3">
546 <span fcklang="DlgDocMaTop">Top</span><br />
547 <input id="txtMarginTop" type="text" size="3" />
552 <span fcklang="DlgDocMaLeft">Left</span><br />
553 <input id="txtMarginLeft" type="text" size="3" />
556 </td>
558 <span fcklang="DlgDocMaRight">Right</span><br />
559 <input id="txtMarginRight" type="text" size="3" />
563 <td align="center" colspan="3">
564 <span fcklang="DlgDocMaBottom">Bottom</span><br />
565 <input id="txtMarginBottom" type="text" size="3" />
576 <div id="divMeta" style="display: none">
577 <span fcklang="DlgDocMeIndex">Document Indexing Keywords (comma separated)</span><br />
578 <textarea id="txtMetaKeywords" style="width: 100%" rows="2" cols="20"></textarea>
580 <span fcklang="DlgDocMeDescr">Document Description</span><br />
581 <textarea id="txtMetaDescription" style="width: 100%" rows="4" cols="20"></textarea>
583 <span fcklang="DlgDocMeAuthor">Author</span><br />
584 <input id="txtMetaAuthor" style="width: 100%" type="text" /><br />
586 <span fcklang="DlgDocMeCopy">Copyright</span><br />
587 <input id="txtMetaCopyright" type="text" style="width: 100%" />
591 <tr id="ePreview" style="display: none">
593 <span fcklang="DlgDocPreview">Preview</span><br />
594 <iframe id="frmPreview" src="fck_docprops/fck_document_preview.html" width="100%"
595 height="100"></iframe>