PageRenderTime 36ms CodeModel.GetById 29ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 0ms

/source/Plug-in/fck/editor/dialog/fck_checkbox.html

http://prosporous.googlecode.com/
HTML | 110 lines | 75 code | 13 blank | 22 comment | 0 complexity | c169f3b9684d37acbed4b73a418e37a5 MD5 | raw file
  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 * Checkbox dialog window.
 23-->
 24<html>
 25	<head>
 26		<title>Checkbox Properties</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 == 'checkbox' )
 45	{
 46		GetE('txtName').value		= oActiveEl.name ;
 47		GetE('txtValue').value		= oEditor.FCKBrowserInfo.IsIE ? oActiveEl.value : GetAttribute( oActiveEl, 'value' ) ;
 48		GetE('txtSelected').checked	= oActiveEl.checked ;
 49	}
 50	else
 51		oActiveEl = null ;
 52
 53	window.parent.SetOkButton( true ) ;
 54	window.parent.SetAutoSize( true ) ;
 55}
 56
 57function Ok()
 58{
 59	oEditor.FCKUndo.SaveUndoStep() ;
 60	
 61	if ( !oActiveEl )
 62	{
 63		oActiveEl = oEditor.FCK.EditorDocument.createElement( 'INPUT' ) ;
 64		oActiveEl.type = 'checkbox' ;
 65		oActiveEl = oEditor.FCK.InsertElement( oActiveEl ) ;
 66	}
 67
 68	if ( GetE('txtName').value.length > 0 )
 69		oActiveEl.name = GetE('txtName').value ;
 70
 71	if ( oEditor.FCKBrowserInfo.IsIE )
 72		oActiveEl.value = GetE('txtValue').value ;
 73	else
 74		SetAttribute( oActiveEl, 'value', GetE('txtValue').value ) ;
 75
 76	var bIsChecked = GetE('txtSelected').checked ;
 77	SetAttribute( oActiveEl, 'checked', bIsChecked ? 'checked' : null ) ;	// For Firefox
 78	oActiveEl.checked = bIsChecked ;
 79
 80	return true ;
 81}
 82
 83		</script>
 84	</head>
 85	<body style="OVERFLOW: hidden" scroll="no">
 86		<table height="100%" width="100%">
 87			<tr>
 88				<td align="center">
 89					<table border="0" cellpadding="0" cellspacing="0" width="80%">
 90						<tr>
 91							<td>
 92								<span fckLang="DlgCheckboxName">Name</span><br>
 93								<input type="text" size="20" id="txtName" style="WIDTH: 100%">
 94							</td>
 95						</tr>
 96						<tr>
 97							<td>
 98								<span fckLang="DlgCheckboxValue">Value</span><br>
 99								<input type="text" size="20" id="txtValue" style="WIDTH: 100%">
100							</td>
101						</tr>
102						<tr>
103							<td><input type="checkbox" id="txtSelected"><label for="txtSelected" fckLang="DlgCheckboxSelected">Checked</label></td>
104						</tr>
105					</table>
106				</td>
107			</tr>
108		</table>
109	</body>
110</html>