Index: richtext.js
===================================================================
RCS file: /cvsroot/encore/packages/gcms/www/resources/rte/richtext.js,v
retrieving revision 1.2
retrieving revision 1.4
diff -u -r1.2 -r1.4
--- richtext.js	13 Mar 2005 21:54:37 -0000	1.2
+++ richtext.js	16 Mar 2005 16:56:07 -0000	1.4
@@ -58,7 +58,7 @@
 	//isRichText = false;
 }
 
-function writeRichText(rte, html, width, height, buttons, readOnly) {
+function writeRichText(rte, html, width, height, buttons, readOnly, extra_content, on_fail) {
 	if (isRichText) {
 		if (allRTEs.length > 0) allRTEs += ";";
 		allRTEs += rte;
@@ -75,11 +75,14 @@
 		}
 		
 		document.writeln('<div class="rteDiv">');
+
+		if (!readOnly) document.writeln('<div style="width: ' + tablewidth + 'px;"><div class="rteCheck"><label for="chkSrc' + rte + '">Edit HTML</label>&nbsp;<input tabindex="100" type="checkbox" id="chkSrc' + rte + '" onclick="toggleHTMLSrc(\'' + rte + '\',' + buttons + ');" /></div></div>');
+
 		if (buttons == true) {
 			document.writeln('<table class="rteBack" cellpadding=2 cellspacing=0 id="Buttons1_' + rte + '" width="' + tablewidth + '">');
 			document.writeln('	<tr>');
 			document.writeln('		<td>');
-			document.writeln('			<select id="formatblock_' + rte + '" onchange="selectFont(\'' + rte + '\', this.id);">');
+			document.writeln('			<select tabindex="100" id="formatblock_' + rte + '" onchange="selectFont(\'' + rte + '\', this.id);">');
 			document.writeln('				<option value="">[Style]</option>');
 			document.writeln('				<option value="<p>">Paragraph &lt;p&gt;</option>');
 			document.writeln('				<option value="<h1>">Heading 1 &lt;h1&gt;</option>');
@@ -93,7 +96,7 @@
 			document.writeln('			</select>');
 			document.writeln('		</td>');
 			document.writeln('		<td>');
-			document.writeln('			<select id="fontname_' + rte + '" onchange="selectFont(\'' + rte + '\', this.id)">');
+			document.writeln('			<select tabindex="100" id="fontname_' + rte + '" onchange="selectFont(\'' + rte + '\', this.id)">');
 			document.writeln('				<option value="Font" selected>[Font]</option>');
 			document.writeln('				<option value="Arial, Helvetica, sans-serif">Arial</option>');
 			document.writeln('				<option value="Courier New, Courier, mono">Courier New</option>');
@@ -102,7 +105,7 @@
 			document.writeln('			</select>');
 			document.writeln('		</td>');
 			document.writeln('		<td>');
-			document.writeln('			<select unselectable="on" id="fontsize_' + rte + '" onchange="selectFont(\'' + rte + '\', this.id);">');
+			document.writeln('			<select tabindex="100" unselectable="on" id="fontsize_' + rte + '" onchange="selectFont(\'' + rte + '\', this.id);">');
 			document.writeln('				<option value="Size">[Size]</option>');
 			document.writeln('				<option value="1">1</option>');
 			document.writeln('				<option value="2">2</option>');
@@ -113,10 +116,11 @@
 			document.writeln('				<option value="7">7</option>');
 			document.writeln('			</select>');
 			document.writeln('		</td>');
-			document.writeln('		<td width="100%">');
+			document.writeln('		<td width="40%">');
 			document.writeln('		</td>');
 			document.writeln('	</tr>');
 			document.writeln('</table>');
+
 			document.writeln('<table class="rteBack" cellpadding="0" cellspacing="0" id="Buttons2_' + rte + '" width="' + tablewidth + '">');
 			document.writeln('	<tr>');
 			document.writeln('		<td><img id="bold" class="rteImage" src="' + imagesPath + 'bold.gif" width="25" height="24" alt="Bold" title="Bold" onClick="rteCommand(\'' + rte + '\', \'bold\', \'\')"></td>');
@@ -154,20 +158,30 @@
 			document.writeln('		<td width="100%"></td>');
 			document.writeln('	</tr>');
 			document.writeln('</table>');
+
 		}
+
 		document.writeln('<iframe id="' + rte + '" name="' + rte + '" width="' + width + 'px" height="' + height + 'px" src="' + includesPath + 'blank.htm"></iframe>');
-		if (!readOnly) document.writeln('<br /><input type="checkbox" id="chkSrc' + rte + '" onclick="toggleHTMLSrc(\'' + rte + '\',' + buttons + ');" />&nbsp;<label for="chkSrc' + rte + '">View Source</label>');
+
 		document.writeln('<iframe width="154" height="104" id="cp' + rte + '" src="' + includesPath + 'palette.htm" marginwidth="0" marginheight="0" scrolling="no" style="visibility:hidden; position: absolute;"></iframe>');
 		document.writeln('<input type="hidden" id="hdn' + rte + '" name="' + rte + '" value="">');
 		document.writeln('</div>');
 		
+		if (extra_content) {
+			document.writeln(extra_content);
+		}
+
 		document.getElementById('hdn' + rte).value = html;
 		enableDesignMode(rte, html, readOnly);
 	} else {
-		if (!readOnly) {
-			document.writeln('<textarea name="' + rte + '" id="' + rte + '" style="width: ' + width + 'px; height: ' + height + 'px;">' + html + '</textarea>');
+		if (on_fail) {
+			document.writeln(on_fail);
 		} else {
-			document.writeln('<textarea name="' + rte + '" id="' + rte + '" style="width: ' + width + 'px; height: ' + height + 'px;" readonly>' + html + '</textarea>');
+			if (!readOnly) {
+				document.writeln('<textarea name="' + rte + '" id="' + rte + '" style="width: ' + width + 'px; height: ' + height + 'px;">' + html + '</textarea>');
+			} else {
+				document.writeln('<textarea name="' + rte + '" id="' + rte + '" style="width: ' + width + 'px; height: ' + height + 'px;" readonly>' + html + '</textarea>');
+			}
 		}
 	}
 }
@@ -200,7 +214,9 @@
 		oRTE.close();
 		if (!readOnly) {
 			oRTE.designMode = "On";
-			frames[rte].document.attachEvent("onkeypress", function evt_ie_keypress(event) {ieKeyPress(event, rte);});
+			
+			function evt_ie_keypress(event) {ieKeyPress(event, rte);};
+			frames[rte].document.attachEvent("onkeypress",evt_ie_keypress);
 		}
 	} else {
 		try {
Index: rte.css
===================================================================
RCS file: /cvsroot/encore/packages/gcms/www/resources/rte/rte.css,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- rte.css	13 Mar 2005 21:54:37 -0000	1.2
+++ rte.css	14 Mar 2005 14:53:44 -0000	1.3
@@ -38,4 +38,8 @@
 .rteDiv {
 	display: block;
 	position: relative;
+}
+
+div.rteDiv div.rteCheck {
+	float: right;
 }
