Browse code

tinymce inits: prevent html entity encoding from wrecking special characters in any text form it uses, especially in stories

Clarissa Walker authored on 2026/09/18 00:08:35
Showing 1 changed files
... ...
@@ -17,6 +17,7 @@ echo "
17 17
 		width: '580',
18 18
 		language: '$language',
19 19
 		convert_urls: 'false',
20
+		entity_encoding: 'raw',
20 21
 		mode: 'textareas',
21 22
 		extended_valid_elements: 'a[name|href|target|title]',
22 23
 		plugins: 'advhr,advimage,advlink,searchreplace,contextmenu,preview,fullscreen,paste" . ($current == "adminarea" ? ",codeprotect" : "") . "',
Browse code

more tinyMCE consistency changes - height: 300px, width: 580px, toolbars at the top like later releases, manually resized text windows are not saved - tinyMCE 4 init cleanup

Clarissa Walker authored on 2026/07/30 10:08:27
Showing 1 changed files
... ...
@@ -13,7 +13,8 @@ echo "
13 13
 			echo "
14 14
 	tinyMCE.init({ 
15 15
 		theme: 'advanced',
16
-		height: '250',
16
+		height: '300',
17
+		width: '580',
17 18
 		language: '$language',
18 19
 		convert_urls: 'false',
19 20
 		mode: 'textareas',
... ...
@@ -24,8 +25,9 @@ echo "
24 25
 		theme_advanced_buttons3_add_before: 'tablecontrols,separator',
25 26
 		theme_advanced_buttons3_add: 'advhr',
26 27
 		theme_advanced_toolbar_align: 'center',
27
-		theme_advanced_toolbar_location: 'bottom',
28
+		theme_advanced_toolbar_location: 'top',
28 29
 		theme_advanced_statusbar_location: 'bottom',
30
+		theme_advanced_resizing_use_cookie: false,
29 31
 		theme_advanced_path: 'false',
30 32
 		editor_deselector: 'mceNoEditor',
31 33
 ";
Browse code

Add options to change toolbar location in tinyMCE 2 and 3 - from tinyMCE 2.0 x to 3.4.x, it was located at the bottom by default; from 3.5.x onwards, the default was changed to be at the top

Clarissa Walker authored on 2026/07/29 21:46:06
Showing 1 changed files
... ...
@@ -24,6 +24,7 @@ echo "
24 24
 		theme_advanced_buttons3_add_before: 'tablecontrols,separator',
25 25
 		theme_advanced_buttons3_add: 'advhr',
26 26
 		theme_advanced_toolbar_align: 'center',
27
+		theme_advanced_toolbar_location: 'bottom',
27 28
 		theme_advanced_statusbar_location: 'bottom',
28 29
 		theme_advanced_path: 'false',
29 30
 		editor_deselector: 'mceNoEditor',
Browse code

TinyMCE version directories relocated to /tinymce/ directory, each with its own version numbers: 2, 3, 4 - Slight naming tweak to TinyMCE dropdown in site settings

Clarissa Walker authored on 2026/07/27 13:46:03
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,49 @@
1
+<?php
2
+
3
+echo "
4
+<script language=\"javascript\" type=\"text/javascript\"><!--";
5
+		$tinymessage = dbquery("SELECT message_text FROM " . TABLEPREFIX . "fanfiction_messages WHERE message_name = 'tinyMCE' LIMIT 1");
6
+		list($tinysettings) = dbrow($tinymessage);
7
+		if (!empty($tinysettings) && $current != "adminarea")
8
+		{
9
+			echo $tinysettings;
10
+		}
11
+		else
12
+		{
13
+			echo "
14
+	tinyMCE.init({ 
15
+		theme: 'advanced',
16
+		height: '250',
17
+		language: '$language',
18
+		convert_urls: 'false',
19
+		mode: 'textareas',
20
+		extended_valid_elements: 'a[name|href|target|title]',
21
+		plugins: 'advhr,advimage,advlink,searchreplace,contextmenu,preview,fullscreen,paste" . ($current == "adminarea" ? ",codeprotect" : "") . "',
22
+		theme_advanced_buttons1_add: 'fontsizeselect',
23
+		theme_advanced_buttons2_add: 'separator,pasteword,pastetext',
24
+		theme_advanced_buttons3_add_before: 'tablecontrols,separator',
25
+		theme_advanced_buttons3_add: 'advhr',
26
+		theme_advanced_toolbar_align: 'center',
27
+		theme_advanced_statusbar_location: 'bottom',
28
+		theme_advanced_path: 'false',
29
+		editor_deselector: 'mceNoEditor',
30
+";
31
+			if (USERUID)
32
+				echo "		external_image_list_url : '" . STORIESPATH . "/" . USERUID . "/images/imagelist.js',";
33
+			echo "
34
+		theme_advanced_resizing: true," . ($current == "adminarea" ? "\n\t\tentity_encoding: 'raw'" : "\n\t\tinvalid_elements: 'script,object,applet,iframe'") . "
35
+   });
36
+";
37
+		}
38
+		echo "
39
+var tinyMCEmode = true;
40
+	function toogleEditorMode(id) {
41
+		var elm = document.getElementById(id);
42
+
43
+		if (tinyMCE.getInstanceById(id) == null)
44
+			tinyMCE.execCommand('mceAddControl', false, id);
45
+		else
46
+			tinyMCE.execCommand('mceRemoveControl', false, id);
47
+	}
48
+";
49
+		echo " --></script>";