Browse code

Re-add TinyMCE 2.0.1 to the site settings list - TinyMCE directoy names changed - installer submission settings layout dirty fix

Clarissa Walker authored on 2026/07/27 11:20:38
Showing 1 changed files
1 1
deleted file mode 100644
... ...
@@ -1,142 +0,0 @@
1
-tinyMCEPopup.requireLangPack();
2
-
3
-var SearchReplaceDialog = {
4
-	init : function(ed) {
5
-		var t = this, f = document.forms[0], m = tinyMCEPopup.getWindowArg("mode");
6
-
7
-		t.switchMode(m);
8
-
9
-		f[m + '_panel_searchstring'].value = tinyMCEPopup.getWindowArg("search_string");
10
-
11
-		// Focus input field
12
-		f[m + '_panel_searchstring'].focus();
13
-		
14
-		mcTabs.onChange.add(function(tab_id, panel_id) {
15
-			t.switchMode(tab_id.substring(0, tab_id.indexOf('_')));
16
-		});
17
-	},
18
-
19
-	switchMode : function(m) {
20
-		var f, lm = this.lastMode;
21
-
22
-		if (lm != m) {
23
-			f = document.forms[0];
24
-
25
-			if (lm) {
26
-				f[m + '_panel_searchstring'].value = f[lm + '_panel_searchstring'].value;
27
-				f[m + '_panel_backwardsu'].checked = f[lm + '_panel_backwardsu'].checked;
28
-				f[m + '_panel_backwardsd'].checked = f[lm + '_panel_backwardsd'].checked;
29
-				f[m + '_panel_casesensitivebox'].checked = f[lm + '_panel_casesensitivebox'].checked;
30
-			}
31
-
32
-			mcTabs.displayTab(m + '_tab',  m + '_panel');
33
-			document.getElementById("replaceBtn").style.display = (m == "replace") ? "inline" : "none";
34
-			document.getElementById("replaceAllBtn").style.display = (m == "replace") ? "inline" : "none";
35
-			this.lastMode = m;
36
-		}
37
-	},
38
-
39
-	searchNext : function(a) {
40
-		var ed = tinyMCEPopup.editor, se = ed.selection, r = se.getRng(), f, m = this.lastMode, s, b, fl = 0, w = ed.getWin(), wm = ed.windowManager, fo = 0;
41
-
42
-		// Get input
43
-		f = document.forms[0];
44
-		s = f[m + '_panel_searchstring'].value;
45
-		b = f[m + '_panel_backwardsu'].checked;
46
-		ca = f[m + '_panel_casesensitivebox'].checked;
47
-		rs = f['replace_panel_replacestring'].value;
48
-
49
-		if (tinymce.isIE) {
50
-			r = ed.getDoc().selection.createRange();
51
-		}
52
-
53
-		if (s == '')
54
-			return;
55
-
56
-		function fix() {
57
-			// Correct Firefox graphics glitches
58
-			// TODO: Verify if this is actually needed any more, maybe it was for very old FF versions? 
59
-			r = se.getRng().cloneRange();
60
-			ed.getDoc().execCommand('SelectAll', false, null);
61
-			se.setRng(r);
62
-		};
63
-
64
-		function replace() {
65
-			ed.selection.setContent(rs); // Needs to be duplicated due to selection bug in IE
66
-		};
67
-
68
-		// IE flags
69
-		if (ca)
70
-			fl = fl | 4;
71
-
72
-		switch (a) {
73
-			case 'all':
74
-				// Move caret to beginning of text
75
-				ed.execCommand('SelectAll');
76
-				ed.selection.collapse(true);
77
-
78
-				if (tinymce.isIE) {
79
-					ed.focus();
80
-					r = ed.getDoc().selection.createRange();
81
-
82
-					while (r.findText(s, b ? -1 : 1, fl)) {
83
-						r.scrollIntoView();
84
-						r.select();
85
-						replace();
86
-						fo = 1;
87
-
88
-						if (b) {
89
-							r.moveEnd("character", -(rs.length)); // Otherwise will loop forever
90
-						}
91
-					}
92
-
93
-					tinyMCEPopup.storeSelection();
94
-				} else {
95
-					while (w.find(s, ca, b, false, false, false, false)) {
96
-						replace();
97
-						fo = 1;
98
-					}
99
-				}
100
-
101
-				if (fo)
102
-					tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.allreplaced'));
103
-				else
104
-					tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.notfound'));
105
-
106
-				return;
107
-
108
-			case 'current':
109
-				if (!ed.selection.isCollapsed())
110
-					replace();
111
-
112
-				break;
113
-		}
114
-
115
-		se.collapse(b);
116
-		r = se.getRng();
117
-
118
-		// Whats the point
119
-		if (!s)
120
-			return;
121
-
122
-		if (tinymce.isIE) {
123
-			ed.focus();
124
-			r = ed.getDoc().selection.createRange();
125
-
126
-			if (r.findText(s, b ? -1 : 1, fl)) {
127
-				r.scrollIntoView();
128
-				r.select();
129
-			} else
130
-				tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.notfound'));
131
-
132
-			tinyMCEPopup.storeSelection();
133
-		} else {
134
-			if (!w.find(s, ca, b, false, false, false, false))
135
-				tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.notfound'));
136
-			else
137
-				fix();
138
-		}
139
-	}
140
-};
141
-
142
-tinyMCEPopup.onInit.add(SearchReplaceDialog.init, SearchReplaceDialog);
Browse code

Actually use TinyMCE 3.4.8 for TinyMCE3 option instead of original 2.0.1; that version is moved to 'tinymce2' directory

Clarissa Walker authored on 2026/07/27 09:02:31
Showing 1 changed files
... ...
@@ -1,117 +1,142 @@
1
-tinyMCEPopup.requireLangPack();
2
-
3
-var SearchReplaceDialog = {
4
-	init : function(ed) {
5
-		var f = document.forms[0], m = tinyMCEPopup.getWindowArg("mode");
6
-
7
-		this.switchMode(m);
8
-
9
-		f[m + '_panel_searchstring'].value = tinyMCEPopup.getWindowArg("search_string");
10
-
11
-		// Focus input field
12
-		f[m + '_panel_searchstring'].focus();
13
-	},
14
-
15
-	switchMode : function(m) {
16
-		var f, lm = this.lastMode;
17
-
18
-		if (lm != m) {
19
-			f = document.forms[0];
20
-
21
-			if (lm) {
22
-				f[m + '_panel_searchstring'].value = f[lm + '_panel_searchstring'].value;
23
-				f[m + '_panel_backwardsu'].checked = f[lm + '_panel_backwardsu'].checked;
24
-				f[m + '_panel_backwardsd'].checked = f[lm + '_panel_backwardsd'].checked;
25
-				f[m + '_panel_casesensitivebox'].checked = f[lm + '_panel_casesensitivebox'].checked;
26
-			}
27
-
28
-			mcTabs.displayTab(m + '_tab',  m + '_panel');
29
-			document.getElementById("replaceBtn").style.display = (m == "replace") ? "inline" : "none";
30
-			document.getElementById("replaceAllBtn").style.display = (m == "replace") ? "inline" : "none";
31
-			this.lastMode = m;
32
-		}
33
-	},
34
-
35
-	searchNext : function(a) {
36
-		var ed = tinyMCEPopup.editor, se = ed.selection, r = se.getRng(), f, m = this.lastMode, s, b, fl = 0, w = ed.getWin(), wm = ed.windowManager, fo = 0;
37
-
38
-		// Get input
39
-		f = document.forms[0];
40
-		s = f[m + '_panel_searchstring'].value;
41
-		b = f[m + '_panel_backwardsu'].checked;
42
-		ca = f[m + '_panel_casesensitivebox'].checked;
43
-		rs = f['replace_panel_replacestring'].value;
44
-
45
-		function fix() {
46
-			// Correct Firefox graphics glitches
47
-			r = se.getRng().cloneRange();
48
-			ed.getDoc().execCommand('SelectAll', false, null);
49
-			se.setRng(r);
50
-		};
51
-
52
-		function replace() {
53
-			if (tinymce.isIE)
54
-				ed.selection.getRng().duplicate().pasteHTML(rs); // Needs to be duplicated due to selection bug in IE
55
-			else
56
-				ed.getDoc().execCommand('InsertHTML', false, rs);
57
-		};
58
-
59
-		// IE flags
60
-		if (ca)
61
-			fl = fl | 4;
62
-
63
-		switch (a) {
64
-			case 'all':
65
-				if (tinymce.isIE) {
66
-					while (r.findText(s, b ? -1 : 1, fl)) {
67
-						r.scrollIntoView();
68
-						r.select();
69
-						replace();
70
-						fo = 1;
71
-					}
72
-
73
-					tinyMCEPopup.storeSelection();
74
-				} else {
75
-					while (w.find(s, ca, b, false, false, false, false)) {
76
-						replace();
77
-						fo = 1;
78
-					}
79
-				}
80
-
81
-				if (fo)
82
-					wm.alert(ed.getLang('searchreplace_dlg.allreplaced'));
83
-				else
84
-					wm.alert(ed.getLang('searchreplace_dlg.notfound'));
85
-
86
-				return;
87
-
88
-			case 'current':
89
-				replace();
90
-				break;
91
-		}
92
-
93
-		se.collapse(b);
94
-		r = se.getRng();
95
-
96
-		// Whats the point
97
-		if (!s)
98
-			return;
99
-
100
-		if (tinymce.isIE) {
101
-			if (r.findText(s, b ? -1 : 1, fl)) {
102
-				r.scrollIntoView();
103
-				r.select();
104
-			} else
105
-				wm.alert(ed.getLang('searchreplace_dlg.notfound'));
106
-
107
-			tinyMCEPopup.storeSelection();
108
-		} else {
109
-			if (!w.find(s, ca, b, false, false, false, false))
110
-				wm.alert(ed.getLang('searchreplace_dlg.notfound'));
111
-			else
112
-				fix();
113
-		}
114
-	}
115
-};
116
-
117
-tinyMCEPopup.onInit.add(SearchReplaceDialog.init, SearchReplaceDialog);
1
+tinyMCEPopup.requireLangPack();
2
+
3
+var SearchReplaceDialog = {
4
+	init : function(ed) {
5
+		var t = this, f = document.forms[0], m = tinyMCEPopup.getWindowArg("mode");
6
+
7
+		t.switchMode(m);
8
+
9
+		f[m + '_panel_searchstring'].value = tinyMCEPopup.getWindowArg("search_string");
10
+
11
+		// Focus input field
12
+		f[m + '_panel_searchstring'].focus();
13
+		
14
+		mcTabs.onChange.add(function(tab_id, panel_id) {
15
+			t.switchMode(tab_id.substring(0, tab_id.indexOf('_')));
16
+		});
17
+	},
18
+
19
+	switchMode : function(m) {
20
+		var f, lm = this.lastMode;
21
+
22
+		if (lm != m) {
23
+			f = document.forms[0];
24
+
25
+			if (lm) {
26
+				f[m + '_panel_searchstring'].value = f[lm + '_panel_searchstring'].value;
27
+				f[m + '_panel_backwardsu'].checked = f[lm + '_panel_backwardsu'].checked;
28
+				f[m + '_panel_backwardsd'].checked = f[lm + '_panel_backwardsd'].checked;
29
+				f[m + '_panel_casesensitivebox'].checked = f[lm + '_panel_casesensitivebox'].checked;
30
+			}
31
+
32
+			mcTabs.displayTab(m + '_tab',  m + '_panel');
33
+			document.getElementById("replaceBtn").style.display = (m == "replace") ? "inline" : "none";
34
+			document.getElementById("replaceAllBtn").style.display = (m == "replace") ? "inline" : "none";
35
+			this.lastMode = m;
36
+		}
37
+	},
38
+
39
+	searchNext : function(a) {
40
+		var ed = tinyMCEPopup.editor, se = ed.selection, r = se.getRng(), f, m = this.lastMode, s, b, fl = 0, w = ed.getWin(), wm = ed.windowManager, fo = 0;
41
+
42
+		// Get input
43
+		f = document.forms[0];
44
+		s = f[m + '_panel_searchstring'].value;
45
+		b = f[m + '_panel_backwardsu'].checked;
46
+		ca = f[m + '_panel_casesensitivebox'].checked;
47
+		rs = f['replace_panel_replacestring'].value;
48
+
49
+		if (tinymce.isIE) {
50
+			r = ed.getDoc().selection.createRange();
51
+		}
52
+
53
+		if (s == '')
54
+			return;
55
+
56
+		function fix() {
57
+			// Correct Firefox graphics glitches
58
+			// TODO: Verify if this is actually needed any more, maybe it was for very old FF versions? 
59
+			r = se.getRng().cloneRange();
60
+			ed.getDoc().execCommand('SelectAll', false, null);
61
+			se.setRng(r);
62
+		};
63
+
64
+		function replace() {
65
+			ed.selection.setContent(rs); // Needs to be duplicated due to selection bug in IE
66
+		};
67
+
68
+		// IE flags
69
+		if (ca)
70
+			fl = fl | 4;
71
+
72
+		switch (a) {
73
+			case 'all':
74
+				// Move caret to beginning of text
75
+				ed.execCommand('SelectAll');
76
+				ed.selection.collapse(true);
77
+
78
+				if (tinymce.isIE) {
79
+					ed.focus();
80
+					r = ed.getDoc().selection.createRange();
81
+
82
+					while (r.findText(s, b ? -1 : 1, fl)) {
83
+						r.scrollIntoView();
84
+						r.select();
85
+						replace();
86
+						fo = 1;
87
+
88
+						if (b) {
89
+							r.moveEnd("character", -(rs.length)); // Otherwise will loop forever
90
+						}
91
+					}
92
+
93
+					tinyMCEPopup.storeSelection();
94
+				} else {
95
+					while (w.find(s, ca, b, false, false, false, false)) {
96
+						replace();
97
+						fo = 1;
98
+					}
99
+				}
100
+
101
+				if (fo)
102
+					tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.allreplaced'));
103
+				else
104
+					tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.notfound'));
105
+
106
+				return;
107
+
108
+			case 'current':
109
+				if (!ed.selection.isCollapsed())
110
+					replace();
111
+
112
+				break;
113
+		}
114
+
115
+		se.collapse(b);
116
+		r = se.getRng();
117
+
118
+		// Whats the point
119
+		if (!s)
120
+			return;
121
+
122
+		if (tinymce.isIE) {
123
+			ed.focus();
124
+			r = ed.getDoc().selection.createRange();
125
+
126
+			if (r.findText(s, b ? -1 : 1, fl)) {
127
+				r.scrollIntoView();
128
+				r.select();
129
+			} else
130
+				tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.notfound'));
131
+
132
+			tinyMCEPopup.storeSelection();
133
+		} else {
134
+			if (!w.find(s, ca, b, false, false, false, false))
135
+				tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.notfound'));
136
+			else
137
+				fix();
138
+		}
139
+	}
140
+};
141
+
142
+tinyMCEPopup.onInit.add(SearchReplaceDialog.init, SearchReplaceDialog);
Browse code

3.5.6 efiction version

Jimako authored on 2024/03/09 16:09:42
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,117 @@
1
+tinyMCEPopup.requireLangPack();
2
+
3
+var SearchReplaceDialog = {
4
+	init : function(ed) {
5
+		var f = document.forms[0], m = tinyMCEPopup.getWindowArg("mode");
6
+
7
+		this.switchMode(m);
8
+
9
+		f[m + '_panel_searchstring'].value = tinyMCEPopup.getWindowArg("search_string");
10
+
11
+		// Focus input field
12
+		f[m + '_panel_searchstring'].focus();
13
+	},
14
+
15
+	switchMode : function(m) {
16
+		var f, lm = this.lastMode;
17
+
18
+		if (lm != m) {
19
+			f = document.forms[0];
20
+
21
+			if (lm) {
22
+				f[m + '_panel_searchstring'].value = f[lm + '_panel_searchstring'].value;
23
+				f[m + '_panel_backwardsu'].checked = f[lm + '_panel_backwardsu'].checked;
24
+				f[m + '_panel_backwardsd'].checked = f[lm + '_panel_backwardsd'].checked;
25
+				f[m + '_panel_casesensitivebox'].checked = f[lm + '_panel_casesensitivebox'].checked;
26
+			}
27
+
28
+			mcTabs.displayTab(m + '_tab',  m + '_panel');
29
+			document.getElementById("replaceBtn").style.display = (m == "replace") ? "inline" : "none";
30
+			document.getElementById("replaceAllBtn").style.display = (m == "replace") ? "inline" : "none";
31
+			this.lastMode = m;
32
+		}
33
+	},
34
+
35
+	searchNext : function(a) {
36
+		var ed = tinyMCEPopup.editor, se = ed.selection, r = se.getRng(), f, m = this.lastMode, s, b, fl = 0, w = ed.getWin(), wm = ed.windowManager, fo = 0;
37
+
38
+		// Get input
39
+		f = document.forms[0];
40
+		s = f[m + '_panel_searchstring'].value;
41
+		b = f[m + '_panel_backwardsu'].checked;
42
+		ca = f[m + '_panel_casesensitivebox'].checked;
43
+		rs = f['replace_panel_replacestring'].value;
44
+
45
+		function fix() {
46
+			// Correct Firefox graphics glitches
47
+			r = se.getRng().cloneRange();
48
+			ed.getDoc().execCommand('SelectAll', false, null);
49
+			se.setRng(r);
50
+		};
51
+
52
+		function replace() {
53
+			if (tinymce.isIE)
54
+				ed.selection.getRng().duplicate().pasteHTML(rs); // Needs to be duplicated due to selection bug in IE
55
+			else
56
+				ed.getDoc().execCommand('InsertHTML', false, rs);
57
+		};
58
+
59
+		// IE flags
60
+		if (ca)
61
+			fl = fl | 4;
62
+
63
+		switch (a) {
64
+			case 'all':
65
+				if (tinymce.isIE) {
66
+					while (r.findText(s, b ? -1 : 1, fl)) {
67
+						r.scrollIntoView();
68
+						r.select();
69
+						replace();
70
+						fo = 1;
71
+					}
72
+
73
+					tinyMCEPopup.storeSelection();
74
+				} else {
75
+					while (w.find(s, ca, b, false, false, false, false)) {
76
+						replace();
77
+						fo = 1;
78
+					}
79
+				}
80
+
81
+				if (fo)
82
+					wm.alert(ed.getLang('searchreplace_dlg.allreplaced'));
83
+				else
84
+					wm.alert(ed.getLang('searchreplace_dlg.notfound'));
85
+
86
+				return;
87
+
88
+			case 'current':
89
+				replace();
90
+				break;
91
+		}
92
+
93
+		se.collapse(b);
94
+		r = se.getRng();
95
+
96
+		// Whats the point
97
+		if (!s)
98
+			return;
99
+
100
+		if (tinymce.isIE) {
101
+			if (r.findText(s, b ? -1 : 1, fl)) {
102
+				r.scrollIntoView();
103
+				r.select();
104
+			} else
105
+				wm.alert(ed.getLang('searchreplace_dlg.notfound'));
106
+
107
+			tinyMCEPopup.storeSelection();
108
+		} else {
109
+			if (!w.find(s, ca, b, false, false, false, false))
110
+				wm.alert(ed.getLang('searchreplace_dlg.notfound'));
111
+			else
112
+				fix();
113
+		}
114
+	}
115
+};
116
+
117
+tinyMCEPopup.onInit.add(SearchReplaceDialog.init, SearchReplaceDialog);