Ver Fonte

Increased a bit the size of the textarea and fixed insertQuoteFast

Signed-off-by: emanuele <[email protected]>
emanuele há 12 anos atrás
pai
commit
9500e4df2b
3 ficheiros alterados com 18 adições e 7 exclusões
  1. 1 1
      Sources/Post.php
  2. 3 3
      Sources/Subs-Editor.php
  3. 14 3
      Themes/default/Post.template.php

+ 1 - 1
Sources/Post.php

@@ -1046,7 +1046,7 @@ function Post($post_errors = array())
 			'post_button' => $context['submit_label'],
 		),
 		// add height and width for the editor
-		'height' => '175px',
+		'height' => '275px',
 		'width' => '100%',
 		// We do XML preview here.
 		'preview_type' => 2,

+ 3 - 3
Sources/Subs-Editor.php

@@ -1463,7 +1463,7 @@ function create_control_richedit($editorOptions)
 		<script type="text/javascript" src="' . $settings['default_theme_url'] . '/scripts/jquery.sceditor.js"></script>
 		<script type="text/javascript" src="' . $settings['default_theme_url'] . '/scripts/jquery.sceditor.bbcode.js"></script>
 		<script>$(document).ready(function() {
-			$("textarea").sceditorBBCodePlugin({
+			$("#' . $editorOptions['id'] . '").sceditorBBCodePlugin({
 				style: "' . $settings['default_theme_url'] . '/css/jquery.sceditor.default.css"
 			});
 		});</script>';
@@ -1501,9 +1501,9 @@ function create_control_richedit($editorOptions)
 		'rich_active' => empty($modSettings['disable_wysiwyg']) && (!empty($options['wysiwyg_default']) || !empty($editorOptions['force_rich']) || !empty($_REQUEST[$editorOptions['id'] . '_mode'])),
 		'disable_smiley_box' => !empty($editorOptions['disable_smiley_box']),
 		'columns' => isset($editorOptions['columns']) ? $editorOptions['columns'] : 60,
-		'rows' => isset($editorOptions['rows']) ? $editorOptions['rows'] : 12,
+		'rows' => isset($editorOptions['rows']) ? $editorOptions['rows'] : 18,
 		'width' => isset($editorOptions['width']) ? $editorOptions['width'] : '70%',
-		'height' => isset($editorOptions['height']) ? $editorOptions['height'] : '150px',
+		'height' => isset($editorOptions['height']) ? $editorOptions['height'] : '250px',
 		'form' => isset($editorOptions['form']) ? $editorOptions['form'] : 'postmodify',
 		'bbc_level' => !empty($editorOptions['bbc_level']) ? $editorOptions['bbc_level'] : 'full',
 		'preview_type' => isset($editorOptions['preview_type']) ? (int) $editorOptions['preview_type'] : 1,

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

@@ -841,17 +841,28 @@ function template_main()
 			function insertQuoteFast(messageid)
 			{
 				if (window.XMLHttpRequest)
-					getXMLDocument(smf_prepareScriptUrl(smf_scripturl) + \'action=quotefast;quote=\' + messageid + \';xml;pb=', $context['post_box_name'], ';mode=\' + (oEditorHandle_', $context['post_box_name'], '.bRichTextEnabled ? 1 : 0), onDocReceived);
+					getXMLDocument(smf_prepareScriptUrl(smf_scripturl) + \'action=quotefast;quote=\' + messageid + \';xml;pb=', $context['post_box_name'], ';mode=0\', onDocReceived);
 				else
-					reqWin(smf_prepareScriptUrl(smf_scripturl) + \'action=quotefast;quote=\' + messageid + \';pb=', $context['post_box_name'], ';mode=\' + (oEditorHandle_', $context['post_box_name'], '.bRichTextEnabled ? 1 : 0), 240, 90);
+					reqWin(smf_prepareScriptUrl(smf_scripturl) + \'action=quotefast;quote=\' + messageid + \';pb=', $context['post_box_name'], ';mode=0\', 240, 90);
+
 				return true;
 			}
 			function onDocReceived(XMLDoc)
 			{
 				var text = \'\';
+				var bIsSource = $("#', $context['post_box_name'], '").data("sceditor").inSourceMode();
+				var current_value = $("#', $context['post_box_name'], '").data("sceditor").getWysiwygEditorValue() + "\n" + text;
+
 				for (var i = 0, n = XMLDoc.getElementsByTagName(\'quote\')[0].childNodes.length; i < n; i++)
 					text += XMLDoc.getElementsByTagName(\'quote\')[0].childNodes[i].nodeValue;
-				oEditorHandle_', $context['post_box_name'], '.insertText(text, false, true);
+
+				if (!bIsSource)
+					$("#', $context['post_box_name'], '").data("sceditor").toggleTextMode();
+
+				$("#', $context['post_box_name'], '").data("sceditor").setTextareaValue(current_value);
+
+				if (!bIsSource)
+					$("#', $context['post_box_name'], '").data("sceditor").toggleTextMode();
 			}
 		// ]]></script>';
 	}