Pārlūkot izejas kodu

If bbcode is disabled at least the switch to plain-text mode is necessary
The emoticons button should be always present (added and hidden by css) to handle toggles
Fixed the emoticons (forgot to add the replacement in plain-text mode

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

emanuele 13 gadi atpakaļ
vecāks
revīzija
bc0acf2bde

+ 1 - 1
Sources/Subs-Editor.php

@@ -1781,7 +1781,7 @@ function create_control_richedit($editorOptions)
 				if (!isset($context['disabled_tags']['color']))
 					$tagsRow[] = 'color';
 			}
-			elseif ($row == 1)
+			elseif ($row == 1 && empty($modSettings['disable_wysiwyg']))
 			{
 				$tmp = array();
 				$tagsRow[] = 'removeformat';

+ 6 - 2
Themes/default/GenericControls.template.php

@@ -76,7 +76,7 @@ function template_control_richedit($editor_id, $smileyContainer = null, $bbcCont
 									}
 
 									if (base.inSourceMode())
-										base.textEditorInsertText(start +  + end);
+										base.textEditorInsertText(\' \' + $(this).attr(\'alt\') + \' \');
 									else
 										base.wysiwygEditorInsertHtml(start + \'<img src="\' + $(this).attr("src") +
 											\'" data-sceditor-emoticon="\' + $(this).attr(\'alt\') + \'" />\' + end);
@@ -266,7 +266,7 @@ function template_control_richedit($editor_id, $smileyContainer = null, $bbcCont
 		if ($context['show_bbc'] && $bbcContainer !== null)
 		{
 			echo ',
-					toolbar: "';
+					toolbar: "emoticon,';
 			$count_tags = count($context['bbc_tags']);
 			foreach ($context['bbc_toolbar'] as $i => $buttonRow)
 			{
@@ -278,6 +278,10 @@ function template_control_richedit($editor_id, $smileyContainer = null, $bbcCont
 
 			echo '",';
 		}
+		else
+			echo ',
+					toolbar: "emoticon,source",';
+
 /*
 // 		// Now it's all drawn out we'll actually setup the box.
 // 		echo '

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

@@ -219,6 +219,7 @@ div.sceditor-dropdown, div.sceditor-dropdown div {
 
 			.sceditor-button-quote div { background: url('../images/bbc/icons/comment.png'); }
 
+			.sceditor-button-emoticon { display:none; }
 			.sceditor-button-emoticon div { background: url('../images/bbc/icons/emoticon_smile.png'); }
 			.sceditor-button-youtube div { background: url('../images/bbc/icons/youtube.png'); }
 			.sceditor-button-date div { background: url('../images/bbc/icons/date_add.png'); }