Browse Source

Another bit of clean up and reorganization of things

Signed-off-by: emanuele <[email protected]>
emanuele 12 years ago
parent
commit
52f9f90691
2 changed files with 8 additions and 17 deletions
  1. 4 9
      Sources/Subs-Editor.php
  2. 4 8
      Themes/default/GenericControls.template.php

+ 4 - 9
Sources/Subs-Editor.php

@@ -185,14 +185,9 @@ function create_control_richedit($editorOptions)
 		$context['html_headers'] .= '
 		<script type="text/javascript"><!-- // --><![CDATA[
 			var smf_smileys_url = \'' . $settings['smileys_url'] . '\';
-			var oEditorStrings= {
-				wont_work: \'' . addcslashes($txt['rich_edit_wont_work'], "'") . '\',
-				func_disabled: \'' . addcslashes($txt['rich_edit_function_disabled'], "'") . '\',
-				prompt_text_email: \'' . addcslashes($txt['prompt_text_email'], "'") . '\',
-				prompt_text_ftp: \'' . addcslashes($txt['prompt_text_ftp'], "'") . '\',
-				prompt_text_url: \'' . addcslashes($txt['prompt_text_url'], "'") . '\',
-				prompt_text_img: \'' . addcslashes($txt['prompt_text_img'], "'") . '\'
-			}
+			var bbc_quote_from = \'' . addcslashes($txt['quote_from'], "'") . '\';
+			var bbc_quote = \'' . addcslashes($txt['quote'], "'") . '\';
+			var bbc_search_on = \'' . addcslashes($txt['search_on'], "'") . '\';
 		// ]]></script>
 		<script type="text/javascript" src="' . $settings['default_theme_url'] . '/scripts/editor.js?alp21"></script>
 		<link rel="stylesheet" href="' . $settings['default_theme_url'] . '/css/jquery.sceditor.css" type="text/css" media="all" />
@@ -233,6 +228,7 @@ function create_control_richedit($editorOptions)
 		'bbc_level' => !empty($editorOptions['bbc_level']) ? $editorOptions['bbc_level'] : 'full',
 		'preview_type' => isset($editorOptions['preview_type']) ? (int) $editorOptions['preview_type'] : 1,
 		'labels' => !empty($editorOptions['labels']) ? $editorOptions['labels'] : array(),
+		'locale' => !empty($txt['lang_locale']) && substr($txt['lang_locale'], 0, 5) != 'en_US' ? $txt['lang_locale'] : '',
 	);
 
 	// Switch between default images and back... mostly in case you don't have an PersonalMessage template, but do have a Post template.
@@ -259,7 +255,6 @@ function create_control_richedit($editorOptions)
 				'after' => '[/b]',
 				'description' => $txt['bold'],
 			),
-
 		*/
 		$context['bbc_tags'] = array();
 		$context['bbc_tags'][] = array(

+ 4 - 8
Themes/default/GenericControls.template.php

@@ -13,7 +13,7 @@
 // This function displays all the stuff you get with a richedit box - BBC, smileys etc.
 function template_control_richedit($editor_id, $smileyContainer = null, $bbcContainer = null)
 {
-	global $context, $settings, $options, $txt, $modSettings, $scripturl, $boardurl;
+	global $context, $settings, $modSettings;
 
 	$editor_context = &$context['controls']['richedit'][$editor_id];
 
@@ -23,10 +23,6 @@ function template_control_richedit($editor_id, $smileyContainer = null, $bbcCont
 		</div>
 		<input type="hidden" name="', $editor_id, '_mode" id="', $editor_id, '_mode" value="0" />
 		<script type="text/javascript"><!-- // --><![CDATA[
-			var bbc_quote_from = \'', $txt['quote_from'], '\'
-			var bbc_quote = \'', $txt['quote'], '\'
-			var bbc_search_on = \'', $txt['search_on'], '\';
-
 			$(document).ready(function() {
 				', !empty($context['bbcodes_hanlders']) ? $context['bbcodes_hanlders'] : '', '
 
@@ -34,8 +30,8 @@ function template_control_richedit($editor_id, $smileyContainer = null, $bbcCont
 					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)),',
-					!empty($txt['lang_locale']) && substr($txt['lang_locale'], 0, 5) != 'en_US' ? '
-					locale: \'' . $txt['lang_locale'] . '\',' : '', '
+					!empty($editor_context['locale']) ? '
+					locale: \'' . $editor_context['locale'] . '\',' : '', '
 					colors: "black,red,yellow,pink,green,orange,purple,blue,beige,brown,teal,navy,maroon,limegreen,white"';
 
 		// Show the smileys.
@@ -63,7 +59,7 @@ function template_control_richedit($editor_id, $smileyContainer = null, $bbcCont
 					foreach ($smileyRow['smileys'] as $smiley)
 					{
 						echo '
-								', JavaScriptEscape($smiley['code']), ': ', JavaScriptEscape(str_replace($boardurl . '/', '', $settings['smileys_url'] . '/' . $smiley['filename'])), empty($smiley['isLast']) ? ',' : '';
+								', JavaScriptEscape($smiley['code']), ': ', JavaScriptEscape($settings['smileys_url'] . '/' . $smiley['filename']), empty($smiley['isLast']) ? ',' : '';
 					}
 					if (empty($smileyRow['isLast']) && $numRows != 1)
 						echo ',