1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" > 2<!-- 3 * FCKeditor - The text editor for Internet - http://www.fckeditor.net 4 * Copyright (C) 2003-2007 Frederico Caldeira Knabben 5 * 6 * == BEGIN LICENSE == 7 * 8 * Licensed under the terms of any of the following licenses at your 9 * choice: 10 * 11 * - GNU General Public License Version 2 or later (the "GPL") 12 * http://www.gnu.org/licenses/gpl.html 13 * 14 * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") 15 * http://www.gnu.org/licenses/lgpl.html 16 * 17 * - Mozilla Public License Version 1.1 or later (the "MPL") 18 * http://www.mozilla.org/MPL/MPL-1.1.html 19 * 20 * == END LICENSE == 21 * 22 * Text field dialog window. 23--> 24<html xmlns="http://www.w3.org/1999/xhtml"> 25<head> 26 <title></title> 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"> 31 32var oEditor = window.parent.InnerDialogLoaded() ; 33 34// Gets the document DOM 35var oDOM = oEditor.FCK.EditorDocument ; 36 37var oActiveEl = oEditor.FCKSelection.GetSelectedElement() ; 38 39window.onload = function() 40{ 41 // First of all, translate the dialog box texts 42 oEditor.FCKLanguageManager.TranslatePage(document) ; 43 44 if ( oActiveEl && oActiveEl.tagName == 'INPUT' && ( oActiveEl.type == 'text' || oActiveEl.type == 'password' ) ) 45 { 46 GetE('txtName').value = oActiveEl.name ; 47 GetE('txtValue').value = oActiveEl.value ; 48 GetE('txtSize').value = GetAttribute( oActiveEl, 'size' ) ; 49 GetE('txtMax').value = GetAttribute( oActiveEl, 'maxLength' ) ; 50 GetE('txtType').value = oActiveEl.type ; 51 52 GetE('txtType').disabled = true ; 53 } 54 else 55 oActiveEl = null ; 56 57 window.parent.SetOkButton( true ) ; 58} 59 60function Ok() 61{ 62 if ( isNaN( GetE('txtMax').value ) || GetE('txtMax').value < 0 ) 63 { 64 alert( "Maximum characters must be a positive number." ) ; 65 GetE('txtMax').focus() ; 66 return false ; 67 } 68 else if( isNaN( GetE('txtSize').value ) || GetE('txtSize').value < 0 ) 69 { 70 alert( "Width must be a positive number." ) ; 71 GetE('txtSize').focus() ; 72 return false ; 73 } 74 75 if ( !oActiveEl ) 76 { 77 oActiveEl = oEditor.FCK.EditorDocument.createElement( 'INPUT' ) ; 78 oActiveEl.type = GetE('txtType').value ; 79 oActiveEl = oEditor.FCK.InsertElementAndGetIt( oActiveEl ) ; 80 } 81 82 oActiveEl.name = GetE('txtName').value ; 83 SetAttribute( oActiveEl, 'value' , GetE('txtValue').value ) ; 84 SetAttribute( oActiveEl, 'size' , GetE('txtSize').value ) ; 85 SetAttribute( oActiveEl, 'maxlength', GetE('txtMax').value ) ; 86 87 return true ; 88} 89 90 </script> 91</head> 92<body style="overflow: hidden"> 93 <table width="100%" style="height: 100%"> 94 <tr> 95 <td align="center"> 96 <table cellspacing="0" cellpadding="0" border="0"> 97 <tr> 98 <td> 99 <span fcklang="DlgTextName">Name</span><br /> 100 <input id="txtName" type="text" size="20" /> 101 </td> 102 <td> 103 </td> 104 <td> 105 <span fcklang="DlgTextValue">Value</span><br /> 106 <input id="txtValue" type="text" size="25" /> 107 </td> 108 </tr> 109 <tr> 110 <td> 111 <span fcklang="DlgTextCharWidth">Character Width</span><br /> 112 <input id="txtSize" type="text" size="5" /> 113 </td> 114 <td> 115 </td> 116 <td> 117 <span fcklang="DlgTextMaxChars">Maximum Characters</span><br /> 118 <input id="txtMax" type="text" size="5" /> 119 </td> 120 </tr> 121 <tr> 122 <td> 123 <span fcklang="DlgTextType">Type</span><br /> 124 <select id="txtType"> 125 <option value="text" selected="selected" fcklang="DlgTextTypeText">Text</option> 126 <option value="password" fcklang="DlgTextTypePass">Password</option> 127 </select> 128 </td> 129 <td> 130 </td> 131 <td> 132 </td> 133 </tr> 134 </table> 135 </td> 136 </tr> 137 </table> 138</body> 139</html> 140