Pārlūkot izejas kodu

Some old browsers (like mine :P) doesn't work in wysiwyg mode, so let's get rid of it
Copied standard styles to the css fiel

Signed-off-by: emanuele <[email protected]>

emanuele 12 gadi atpakaļ
vecāks
revīzija
057d7e2252

+ 14 - 3
Themes/default/GenericControls.template.php

@@ -85,6 +85,10 @@ function template_control_richedit($editor_id, $smileyContainer = null, $bbcCont
 
 						$(".sceditor-toolbar").append(content);
 					},
+					setTextMode: function () {
+						if (!this.inSourceMode())
+							this.toggleTextMode();
+					},
 					createPermanentDropDown: function() {
 							var	emoticons	= $.extend({}, this.options.emoticons.dropdown);
 							var popup_exists = false;
@@ -224,6 +228,7 @@ function template_control_richedit($editor_id, $smileyContainer = null, $bbcCont
 				$("#', $editor_id, '").sceditorBBCodePlugin({
 					style: "', $settings['default_theme_url'], '/css/jquery.sceditor.default.css",
 					emoticonsCompat: true,
+					supportedWysiwyg: (((is_ie5up && !is_ie50) || is_ff || is_opera95up || is_safari || is_chrome) && !(is_iphone || is_android)),
 					colors: "black,red,yellow,pink,green,orange,purple,blue,beige,brown,teal,navy,maroon,limegreen,white"';
 
 		// Show the smileys.
@@ -284,10 +289,16 @@ function template_control_richedit($editor_id, $smileyContainer = null, $bbcCont
 					toolbar: "emoticon,source",';
 
 		echo '
-				})
+				});
 				$("#', $editor_id, '").data("sceditor").createPermanentDropDown();
 				$(".sceditor-container").width("100%").height("100%");', 
-				/*$editor_context['rich_active'] ? '$("#' . $editor_id . '").toggleTextMode();' :*/ '', '
+				$editor_context['rich_active'] ? '' : '
+				$("#' . $editor_id . '").data("sceditor").setTextMode();', '
+				if (!(((is_ie5up && !is_ie50) || is_ff || is_opera95up || is_safari || is_chrome) && !(is_iphone || is_android)))
+				{
+					$("#' . $editor_id . '").data("sceditor").setTextMode();
+					$(".sceditor-button-source").hide();
+				}
 			});';
 
 		// Now for backward compatibility let's collect few infos in the good ol' style
@@ -306,7 +317,7 @@ function template_control_richedit($editor_id, $smileyContainer = null, $bbcCont
 					oSmileyBox: null,
 					oBBCBox: null
 				});
-// 				smf_editorArray[smf_editorArray.length] = oEditorHandle_', $editor_id, ';
+				smf_editorArray[smf_editorArray.length] = oEditorHandle_', $editor_id, ';
 			// ]]></script>';
 }
 

+ 80 - 0
Themes/default/css/jquery.sceditor.css

@@ -227,3 +227,83 @@ div.sceditor-dropdown, div.sceditor-dropdown div {
 
 			.sceditor-button-print div { background: url('../images/bbc/icons/printer.png'); }
 			.sceditor-button-source div { background: url('../images/bbc/icons/page_white_text.png'); }
+
+/* SMF buttons styles */
+			.sceditor-button-bold div {
+				background: url('../images/bbc/bold.png');
+			}
+			.sceditor-button-italic div {
+				background: url('../images/bbc/italicize.png');
+			}
+			.sceditor-button-underline div {
+				background: url('../images/bbc/underline.png');
+			}
+			.sceditor-button-strike div {
+				background: url('../images/bbc/strike.png');
+			}
+			.sceditor-button-pre div {
+				background: url('../images/bbc/pre.png');
+			}
+			.sceditor-button-left div {
+				background: url('../images/bbc/left.png');
+			}
+			.sceditor-button-center div {
+				background: url('../images/bbc/center.png');
+			}
+			.sceditor-button-right div {
+				background: url('../images/bbc/right.png');
+			}
+			.sceditor-button-image div {
+				background: url('../images/bbc/img.png');
+			}
+			.sceditor-button-link div {
+				background: url('../images/bbc/url.png');
+			}
+			.sceditor-button-email div {
+				background: url('../images/bbc/email.png');
+			}
+			.sceditor-button-ftp div {
+				background: url('../images/bbc/ftp.png');
+			}
+			.sceditor-button-glow div {
+				background: url('../images/bbc/glow.png');
+			}
+			.sceditor-button-shadow div {
+				background: url('../images/bbc/shadow.png');
+			}
+			.sceditor-button-move div {
+				background: url('../images/bbc/move.png');
+			}
+			.sceditor-button-superscript div {
+				background: url('../images/bbc/sup.png');
+			}
+			.sceditor-button-subscript div {
+				background: url('../images/bbc/sub.png');
+			}
+			.sceditor-button-tt div {
+				background: url('../images/bbc/tele.png');
+			}
+			.sceditor-button-table div {
+				background: url('../images/bbc/table.png');
+			}
+			.sceditor-button-code div {
+				background: url('../images/bbc/code.png');
+			}
+			.sceditor-button-quote div {
+				background: url('../images/bbc/quote.png');
+			}
+			.sceditor-button-bulletlist div {
+				background: url('../images/bbc/list.png');
+			}
+			.sceditor-button-orderedlist div {
+				background: url('../images/bbc/orderlist.png');
+			}
+			.sceditor-button-horizontalrule div {
+				background: url('../images/bbc/hr.png');
+			}
+			.sceditor-button-unformat div {
+				background: url('../images/bbc/unformat.png');
+			}
+			.sceditor-button-toggle div {
+				background: url('../images/bbc/toggle.png');
+			}