author | Dan |
Thu, 06 Mar 2008 20:45:46 -0500 | |
changeset 475 | 51386f1852b8 |
parent 473 | 518bc2b214f1 |
child 509 | 175df10e0b56 |
permissions | -rw-r--r-- |
1 | 1 |
/* |
2 |
* Enano - an open source wiki-like CMS |
|
3 |
* Copyright (C) 2006-2007 Dan Fuhry |
|
4 |
* Javascript client library |
|
5 |
* |
|
6 |
* This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License |
|
7 |
* as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. |
|
8 |
* |
|
9 |
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied |
|
10 |
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for details. |
|
11 |
* |
|
86
c162ca39db8f
Finished pagination code (was incomplete in previous revision) and added a few hacks for an upcoming theme
Dan
parents:
85
diff
changeset
|
12 |
* For more information about Enano, please visit http://enanocms.org/. |
420
301f546688d1
Re-enabled, debugged, and optimized Javascript compression code
Dan
parents:
348
diff
changeset
|
13 |
* Unless otherwise noted, all of the code in these script files may be used freely so long as the above license block |
301f546688d1
Re-enabled, debugged, and optimized Javascript compression code
Dan
parents:
348
diff
changeset
|
14 |
* is displayed and your modified code is distributed in compliance with the GPL. See the special page "About Enano" on |
301f546688d1
Re-enabled, debugged, and optimized Javascript compression code
Dan
parents:
348
diff
changeset
|
15 |
* this website for more information. |
1 | 16 |
*/ |
17 |
||
18 |
if(typeof title != 'string') |
|
19 |
{ |
|
20 |
alert('Uh-oh! The required dynamic (PHP-generated) Javascript variables don\'t seem to be available. Javascript is going to be seriously broken.'); |
|
21 |
} |
|
22 |
||
23 |
// Run-time variables |
|
24 |
||
25 |
var detect = navigator.userAgent.toLowerCase(); |
|
26 |
var IE; |
|
21
663fcf528726
Updated all version numbers back to Banshee; a few preliminary steps towards full UTF-8 support in page URLs
Dan
parents:
1
diff
changeset
|
27 |
var is_Safari; |
1 | 28 |
|
29 |
// Detect whether the user is running the Evil One or not... |
|
30 |
||
31 |
function checkIt(string) { |
|
32 |
place = detect.indexOf(string) + 1; |
|
33 |
thestring = string; |
|
34 |
return place; |
|
35 |
} |
|
36 |
if (checkIt('msie')) IE = true; |
|
37 |
else IE = false; |
|
38 |
||
117
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
86
diff
changeset
|
39 |
var is_Opera = ( checkIt('opera') ) ? true : false; |
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
86
diff
changeset
|
40 |
|
57
b354deeaa4c4
Vastly improved compatibility with older versions of IE, particularly 5.0, through the use of a kill switch that turns off all AJAX functions
Dan
parents:
40
diff
changeset
|
41 |
var KILL_SWITCH = false; |
b354deeaa4c4
Vastly improved compatibility with older versions of IE, particularly 5.0, through the use of a kill switch that turns off all AJAX functions
Dan
parents:
40
diff
changeset
|
42 |
|
b354deeaa4c4
Vastly improved compatibility with older versions of IE, particularly 5.0, through the use of a kill switch that turns off all AJAX functions
Dan
parents:
40
diff
changeset
|
43 |
if ( IE ) |
b354deeaa4c4
Vastly improved compatibility with older versions of IE, particularly 5.0, through the use of a kill switch that turns off all AJAX functions
Dan
parents:
40
diff
changeset
|
44 |
{ |
b354deeaa4c4
Vastly improved compatibility with older versions of IE, particularly 5.0, through the use of a kill switch that turns off all AJAX functions
Dan
parents:
40
diff
changeset
|
45 |
var version = window.navigator.appVersion; |
b354deeaa4c4
Vastly improved compatibility with older versions of IE, particularly 5.0, through the use of a kill switch that turns off all AJAX functions
Dan
parents:
40
diff
changeset
|
46 |
version = version.substr( ( version.indexOf('MSIE') + 5 ) ); |
b354deeaa4c4
Vastly improved compatibility with older versions of IE, particularly 5.0, through the use of a kill switch that turns off all AJAX functions
Dan
parents:
40
diff
changeset
|
47 |
var rawversion = ''; |
b354deeaa4c4
Vastly improved compatibility with older versions of IE, particularly 5.0, through the use of a kill switch that turns off all AJAX functions
Dan
parents:
40
diff
changeset
|
48 |
for ( var i = 0; i < version.length; i++ ) |
b354deeaa4c4
Vastly improved compatibility with older versions of IE, particularly 5.0, through the use of a kill switch that turns off all AJAX functions
Dan
parents:
40
diff
changeset
|
49 |
{ |
b354deeaa4c4
Vastly improved compatibility with older versions of IE, particularly 5.0, through the use of a kill switch that turns off all AJAX functions
Dan
parents:
40
diff
changeset
|
50 |
var chr = version.substr(i, 1); |
b354deeaa4c4
Vastly improved compatibility with older versions of IE, particularly 5.0, through the use of a kill switch that turns off all AJAX functions
Dan
parents:
40
diff
changeset
|
51 |
if ( !chr.match(/[0-9\.]/) ) |
b354deeaa4c4
Vastly improved compatibility with older versions of IE, particularly 5.0, through the use of a kill switch that turns off all AJAX functions
Dan
parents:
40
diff
changeset
|
52 |
{ |
b354deeaa4c4
Vastly improved compatibility with older versions of IE, particularly 5.0, through the use of a kill switch that turns off all AJAX functions
Dan
parents:
40
diff
changeset
|
53 |
break; |
b354deeaa4c4
Vastly improved compatibility with older versions of IE, particularly 5.0, through the use of a kill switch that turns off all AJAX functions
Dan
parents:
40
diff
changeset
|
54 |
} |
b354deeaa4c4
Vastly improved compatibility with older versions of IE, particularly 5.0, through the use of a kill switch that turns off all AJAX functions
Dan
parents:
40
diff
changeset
|
55 |
rawversion += chr; |
b354deeaa4c4
Vastly improved compatibility with older versions of IE, particularly 5.0, through the use of a kill switch that turns off all AJAX functions
Dan
parents:
40
diff
changeset
|
56 |
} |
b354deeaa4c4
Vastly improved compatibility with older versions of IE, particularly 5.0, through the use of a kill switch that turns off all AJAX functions
Dan
parents:
40
diff
changeset
|
57 |
rawversion = parseInt(rawversion); |
b354deeaa4c4
Vastly improved compatibility with older versions of IE, particularly 5.0, through the use of a kill switch that turns off all AJAX functions
Dan
parents:
40
diff
changeset
|
58 |
if ( rawversion < 6 ) |
b354deeaa4c4
Vastly improved compatibility with older versions of IE, particularly 5.0, through the use of a kill switch that turns off all AJAX functions
Dan
parents:
40
diff
changeset
|
59 |
{ |
b354deeaa4c4
Vastly improved compatibility with older versions of IE, particularly 5.0, through the use of a kill switch that turns off all AJAX functions
Dan
parents:
40
diff
changeset
|
60 |
KILL_SWITCH = true; |
b354deeaa4c4
Vastly improved compatibility with older versions of IE, particularly 5.0, through the use of a kill switch that turns off all AJAX functions
Dan
parents:
40
diff
changeset
|
61 |
} |
b354deeaa4c4
Vastly improved compatibility with older versions of IE, particularly 5.0, through the use of a kill switch that turns off all AJAX functions
Dan
parents:
40
diff
changeset
|
62 |
} |
b354deeaa4c4
Vastly improved compatibility with older versions of IE, particularly 5.0, through the use of a kill switch that turns off all AJAX functions
Dan
parents:
40
diff
changeset
|
63 |
|
b354deeaa4c4
Vastly improved compatibility with older versions of IE, particularly 5.0, through the use of a kill switch that turns off all AJAX functions
Dan
parents:
40
diff
changeset
|
64 |
// dummy tinyMCE object |
b354deeaa4c4
Vastly improved compatibility with older versions of IE, particularly 5.0, through the use of a kill switch that turns off all AJAX functions
Dan
parents:
40
diff
changeset
|
65 |
var tinyMCE = new Object(); |
b354deeaa4c4
Vastly improved compatibility with older versions of IE, particularly 5.0, through the use of a kill switch that turns off all AJAX functions
Dan
parents:
40
diff
changeset
|
66 |
|
348
87e08a6e4fec
Welcome to the new Enano installer. Much distance still to be covered but the basics are there.
Dan
parents:
335
diff
changeset
|
67 |
if ( typeof(DISABLE_MCE) == undefined ) |
87e08a6e4fec
Welcome to the new Enano installer. Much distance still to be covered but the basics are there.
Dan
parents:
335
diff
changeset
|
68 |
{ |
87e08a6e4fec
Welcome to the new Enano installer. Much distance still to be covered but the basics are there.
Dan
parents:
335
diff
changeset
|
69 |
var DISABLE_MCE = false; |
87e08a6e4fec
Welcome to the new Enano installer. Much distance still to be covered but the basics are there.
Dan
parents:
335
diff
changeset
|
70 |
} |
87e08a6e4fec
Welcome to the new Enano installer. Much distance still to be covered but the basics are there.
Dan
parents:
335
diff
changeset
|
71 |
|
57
b354deeaa4c4
Vastly improved compatibility with older versions of IE, particularly 5.0, through the use of a kill switch that turns off all AJAX functions
Dan
parents:
40
diff
changeset
|
72 |
// Obsolete JSON kill switch |
b354deeaa4c4
Vastly improved compatibility with older versions of IE, particularly 5.0, through the use of a kill switch that turns off all AJAX functions
Dan
parents:
40
diff
changeset
|
73 |
function disableJSONExts() { }; |
b354deeaa4c4
Vastly improved compatibility with older versions of IE, particularly 5.0, through the use of a kill switch that turns off all AJAX functions
Dan
parents:
40
diff
changeset
|
74 |
|
21
663fcf528726
Updated all version numbers back to Banshee; a few preliminary steps towards full UTF-8 support in page URLs
Dan
parents:
1
diff
changeset
|
75 |
is_Safari = checkIt('safari') ? true : false; |
663fcf528726
Updated all version numbers back to Banshee; a few preliminary steps towards full UTF-8 support in page URLs
Dan
parents:
1
diff
changeset
|
76 |
|
1 | 77 |
var cmt_open; |
78 |
var list; |
|
79 |
var edit_open = false; |
|
80 |
var catlist = new Array(); |
|
81 |
var arrDiff1Buttons = new Array(); |
|
82 |
var arrDiff2Buttons = new Array(); |
|
83 |
var arrTimeIdList = new Array(); |
|
84 |
var list; |
|
85 |
var unObj; |
|
86 |
var unSelectMenuOn = false; |
|
87 |
var unObjDivCurrentId = false; |
|
88 |
var unObjCurrentSelection = false; |
|
89 |
var userlist = new Array(); |
|
90 |
var submitAuthorized = true; |
|
91 |
var rDnsObj; |
|
92 |
var rDnsBannerObj; |
|
93 |
var ns4 = document.layers; |
|
94 |
var op5 = (navigator.userAgent.indexOf("Opera 5")!=-1) ||(navigator.userAgent.indexOf("Opera/5")!=-1); |
|
95 |
var op6 = (navigator.userAgent.indexOf("Opera 6")!=-1) ||(navigator.userAgent.indexOf("Opera/6")!=-1); |
|
96 |
var agt=navigator.userAgent.toLowerCase(); |
|
97 |
var mac = (agt.indexOf("mac")!=-1); |
|
98 |
var ie = (agt.indexOf("msie") != -1); |
|
99 |
var mac_ie = mac && ie; |
|
100 |
var mouseX = 0; |
|
101 |
var mouseY = 0; |
|
102 |
var menuheight; |
|
103 |
var inertiabase = 1; |
|
104 |
var inertiainc = 1; |
|
105 |
var slideintervalinc = 20; |
|
106 |
var inertiabaseoriginal = inertiabase; |
|
107 |
var heightnow; |
|
108 |
var targetheight; |
|
109 |
var block; |
|
110 |
var slideinterval; |
|
111 |
var divheights = new Array(); |
|
112 |
var __menutimeout = false; |
|
113 |
var startmouseX = false; |
|
114 |
var startmouseY = false; |
|
115 |
var startScroll = false; |
|
116 |
var is_dragging = false; |
|
117 |
var current_ta = false; |
|
118 |
var startwidth = false; |
|
119 |
var startheight = false; |
|
120 |
var do_width = false; |
|
200
63fddf1335d9
Nothing real special. The AJAX loading icon can be changed using the Javascript variable ajax_load_icon in header.tpl.
Dan
parents:
184
diff
changeset
|
121 |
var ajax_load_icon = scriptPath + '/images/loading.gif'; |
473
518bc2b214f1
Added modal dialog support for page editor; added customizability for breadcrumbs (thanks to Manoj for idea)
Dan
parents:
472
diff
changeset
|
122 |
var editor_use_modal_window = false; |
1 | 123 |
|
124 |
// You have an NSIS coder in your midst... |
|
125 |
var MB_OK = 1; |
|
126 |
var MB_OKCANCEL = 2; |
|
127 |
var MB_YESNO = 4; |
|
128 |
var MB_YESNOCANCEL = 8; |
|
129 |
var MB_ABORTRETRYIGNORE = 16; |
|
130 |
var MB_ICONINFORMATION = 32; |
|
131 |
var MB_ICONEXCLAMATION = 64; |
|
132 |
var MB_ICONSTOP = 128; |
|
133 |
var MB_ICONQUESTION = 256; |
|
134 |
var MB_ICONLOCK = 512; |
|
135 |
||
136 |
// Syntax: |
|
137 |
// messagebox(MB_OK|MB_ICONINFORMATION, 'Title', 'Text'); |
|
138 |
// :-D |
|
139 |
||
140 |
var main_css = document.getElementById('mdgCss').href; |
|
141 |
if(main_css.indexOf('?') > -1) { |
|
142 |
sep = '&'; |
|
143 |
} else sep = '?'; |
|
144 |
var _css = false; |
|
145 |
var print_css = main_css + sep + 'printable'; |
|
146 |
||
147 |
var shift; |
|
148 |
||
149 |
function makeUrl(page, query, html_friendly) |
|
150 |
{ |
|
151 |
url = contentPath+page; |
|
152 |
if(url.indexOf('?') > 0) sep = '&'; |
|
153 |
else sep = '?'; |
|
154 |
if(query) |
|
155 |
{ |
|
156 |
url = url + sep + query; |
|
157 |
} |
|
158 |
if(html_friendly) |
|
159 |
{ |
|
160 |
url = url.replace('&', '&'); |
|
161 |
url = url.replace('<', '<'); |
|
162 |
url = url.replace('>', '>'); |
|
163 |
} |
|
164 |
return url; |
|
165 |
} |
|
166 |
||
167 |
function makeUrlNS(namespace, page, query, html_friendly) |
|
168 |
{ |
|
169 |
var url = contentPath+namespace_list[namespace]+(page.replace(/ /g, '_')); |
|
170 |
if(url.indexOf('?') > 0) sep = '&'; |
|
171 |
else sep = '?'; |
|
172 |
if(query) |
|
173 |
{ |
|
174 |
url = url + sep + query; |
|
175 |
} |
|
176 |
if(html_friendly) |
|
177 |
{ |
|
178 |
url = url.replace('&', '&'); |
|
179 |
url = url.replace('<', '<'); |
|
180 |
url = url.replace('>', '>'); |
|
181 |
} |
|
182 |
return append_sid(url); |
|
183 |
} |
|
184 |
||
185 |
function strToPageID(string) |
|
186 |
{ |
|
187 |
// Convert Special:UploadFile to ['UploadFile', 'Special'], but convert 'Image:Enano.png' to ['Enano.png', 'File'] |
|
188 |
for(var i in namespace_list) |
|
189 |
if(namespace_list[i] != '') |
|
190 |
if(namespace_list[i] == string.substr(0, namespace_list[i].length)) |
|
191 |
return [string.substr(namespace_list[i].length), i]; |
|
192 |
return [string, 'Article']; |
|
193 |
} |
|
194 |
||
195 |
function append_sid(url) |
|
196 |
{ |
|
197 |
sep = ( url.indexOf('?') > 0 ) ? '&' : '?'; |
|
198 |
if(ENANO_SID.length > 10) |
|
199 |
{ |
|
200 |
url = url + sep + 'auth=' + ENANO_SID; |
|
201 |
sep = '&'; |
|
202 |
} |
|
203 |
if ( pagepass.length > 0 ) |
|
204 |
{ |
|
205 |
url = url + sep + 'pagepass=' + pagepass; |
|
206 |
} |
|
207 |
return url; |
|
208 |
} |
|
209 |
||
210 |
var stdAjaxPrefix = append_sid(scriptPath+'/ajax.php?title='+title); |
|
211 |
||
212 |
var $_REQUEST = new Object(); |
|
213 |
if ( window.location.hash ) |
|
214 |
{ |
|
215 |
var hash = String(window.location.hash); |
|
216 |
hash = hash.substr(1); |
|
217 |
var reqobj = hash.split(';'); |
|
218 |
var a, b; |
|
219 |
for ( var i = 0; i < reqobj.length; i++ ) |
|
220 |
{ |
|
221 |
a = reqobj[i].substr(0, reqobj[i].indexOf(':')); |
|
222 |
b = reqobj[i].substr( ( reqobj[i].indexOf(':') + 1 ) ); |
|
223 |
$_REQUEST[a] = b; |
|
224 |
} |
|
225 |
} |
|
226 |
||
117
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
86
diff
changeset
|
227 |
var onload_hooks = new Array(); |
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
86
diff
changeset
|
228 |
|
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
86
diff
changeset
|
229 |
function addOnloadHook(func) |
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
86
diff
changeset
|
230 |
{ |
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
86
diff
changeset
|
231 |
if ( typeof ( func ) == 'function' ) |
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
86
diff
changeset
|
232 |
{ |
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
86
diff
changeset
|
233 |
if ( typeof(onload_hooks.push) == 'function' ) |
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
86
diff
changeset
|
234 |
{ |
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
86
diff
changeset
|
235 |
onload_hooks.push(func); |
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
86
diff
changeset
|
236 |
} |
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
86
diff
changeset
|
237 |
else |
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
86
diff
changeset
|
238 |
{ |
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
86
diff
changeset
|
239 |
onload_hooks[onload_hooks.length] = func; |
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
86
diff
changeset
|
240 |
} |
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
86
diff
changeset
|
241 |
} |
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
86
diff
changeset
|
242 |
} |
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
86
diff
changeset
|
243 |
|
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
86
diff
changeset
|
244 |
function runOnloadHooks(e) |
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
86
diff
changeset
|
245 |
{ |
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
86
diff
changeset
|
246 |
var _errorTrapper = 0; |
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
86
diff
changeset
|
247 |
for ( var _oLc = 0; _oLc < onload_hooks.length; _oLc++ ) |
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
86
diff
changeset
|
248 |
{ |
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
86
diff
changeset
|
249 |
_errorTrapper++; |
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
86
diff
changeset
|
250 |
if ( _errorTrapper >= 1000 ) |
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
86
diff
changeset
|
251 |
break; |
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
86
diff
changeset
|
252 |
var _f = onload_hooks[_oLc]; |
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
86
diff
changeset
|
253 |
if ( typeof(_f) == 'function' ) |
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
86
diff
changeset
|
254 |
{ |
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
86
diff
changeset
|
255 |
_f(e); |
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
86
diff
changeset
|
256 |
} |
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
86
diff
changeset
|
257 |
} |
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
86
diff
changeset
|
258 |
} |
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
86
diff
changeset
|
259 |
|
1 | 260 |
var head = document.getElementsByTagName('head')[0]; |
348
87e08a6e4fec
Welcome to the new Enano installer. Much distance still to be covered but the basics are there.
Dan
parents:
335
diff
changeset
|
261 |
if ( !KILL_SWITCH && !DISABLE_MCE ) |
57
b354deeaa4c4
Vastly improved compatibility with older versions of IE, particularly 5.0, through the use of a kill switch that turns off all AJAX functions
Dan
parents:
40
diff
changeset
|
262 |
{ |
461 | 263 |
if ( IE ) |
264 |
{ |
|
265 |
document.write('<script type="text/javascript" src="' + scriptPath + '/includes/clientside/tinymce/tiny_mce.js"></script>'); |
|
266 |
} |
|
267 |
else |
|
268 |
{ |
|
269 |
var script = document.createElement('script'); |
|
270 |
script.type="text/javascript"; |
|
271 |
script.src=scriptPath+"/includes/clientside/tinymce/tiny_mce.js"; |
|
272 |
head.appendChild(script); |
|
273 |
} |
|
57
b354deeaa4c4
Vastly improved compatibility with older versions of IE, particularly 5.0, through the use of a kill switch that turns off all AJAX functions
Dan
parents:
40
diff
changeset
|
274 |
} |
1 | 275 |
|
472
bc4b58034f4d
Implemented password reset (albeit hackishly) into the new login API; added dummy window.console object to hopefully reduce errors when Firebug isn't around; fixed the longstanding ACL dismiss/close button bug; fixed a couple undefined variables in mailer; fixed PHP error on attempted opening of /dev/(u)random in rijndael.php; clarified documentation for PageProcessor::update_page(); fixed some logic problems in theme ACL code; disabled CAPTCHA debug
Dan
parents:
461
diff
changeset
|
276 |
// wrapper for window.console |
bc4b58034f4d
Implemented password reset (albeit hackishly) into the new login API; added dummy window.console object to hopefully reduce errors when Firebug isn't around; fixed the longstanding ACL dismiss/close button bug; fixed a couple undefined variables in mailer; fixed PHP error on attempted opening of /dev/(u)random in rijndael.php; clarified documentation for PageProcessor::update_page(); fixed some logic problems in theme ACL code; disabled CAPTCHA debug
Dan
parents:
461
diff
changeset
|
277 |
if ( !window.console ) |
bc4b58034f4d
Implemented password reset (albeit hackishly) into the new login API; added dummy window.console object to hopefully reduce errors when Firebug isn't around; fixed the longstanding ACL dismiss/close button bug; fixed a couple undefined variables in mailer; fixed PHP error on attempted opening of /dev/(u)random in rijndael.php; clarified documentation for PageProcessor::update_page(); fixed some logic problems in theme ACL code; disabled CAPTCHA debug
Dan
parents:
461
diff
changeset
|
278 |
{ |
bc4b58034f4d
Implemented password reset (albeit hackishly) into the new login API; added dummy window.console object to hopefully reduce errors when Firebug isn't around; fixed the longstanding ACL dismiss/close button bug; fixed a couple undefined variables in mailer; fixed PHP error on attempted opening of /dev/(u)random in rijndael.php; clarified documentation for PageProcessor::update_page(); fixed some logic problems in theme ACL code; disabled CAPTCHA debug
Dan
parents:
461
diff
changeset
|
279 |
window.console = { |
bc4b58034f4d
Implemented password reset (albeit hackishly) into the new login API; added dummy window.console object to hopefully reduce errors when Firebug isn't around; fixed the longstanding ACL dismiss/close button bug; fixed a couple undefined variables in mailer; fixed PHP error on attempted opening of /dev/(u)random in rijndael.php; clarified documentation for PageProcessor::update_page(); fixed some logic problems in theme ACL code; disabled CAPTCHA debug
Dan
parents:
461
diff
changeset
|
280 |
log: function() {}, |
bc4b58034f4d
Implemented password reset (albeit hackishly) into the new login API; added dummy window.console object to hopefully reduce errors when Firebug isn't around; fixed the longstanding ACL dismiss/close button bug; fixed a couple undefined variables in mailer; fixed PHP error on attempted opening of /dev/(u)random in rijndael.php; clarified documentation for PageProcessor::update_page(); fixed some logic problems in theme ACL code; disabled CAPTCHA debug
Dan
parents:
461
diff
changeset
|
281 |
debug: function() {}, |
bc4b58034f4d
Implemented password reset (albeit hackishly) into the new login API; added dummy window.console object to hopefully reduce errors when Firebug isn't around; fixed the longstanding ACL dismiss/close button bug; fixed a couple undefined variables in mailer; fixed PHP error on attempted opening of /dev/(u)random in rijndael.php; clarified documentation for PageProcessor::update_page(); fixed some logic problems in theme ACL code; disabled CAPTCHA debug
Dan
parents:
461
diff
changeset
|
282 |
info: function() {}, |
bc4b58034f4d
Implemented password reset (albeit hackishly) into the new login API; added dummy window.console object to hopefully reduce errors when Firebug isn't around; fixed the longstanding ACL dismiss/close button bug; fixed a couple undefined variables in mailer; fixed PHP error on attempted opening of /dev/(u)random in rijndael.php; clarified documentation for PageProcessor::update_page(); fixed some logic problems in theme ACL code; disabled CAPTCHA debug
Dan
parents:
461
diff
changeset
|
283 |
warn: function() {}, |
bc4b58034f4d
Implemented password reset (albeit hackishly) into the new login API; added dummy window.console object to hopefully reduce errors when Firebug isn't around; fixed the longstanding ACL dismiss/close button bug; fixed a couple undefined variables in mailer; fixed PHP error on attempted opening of /dev/(u)random in rijndael.php; clarified documentation for PageProcessor::update_page(); fixed some logic problems in theme ACL code; disabled CAPTCHA debug
Dan
parents:
461
diff
changeset
|
284 |
warning: function() {}, |
bc4b58034f4d
Implemented password reset (albeit hackishly) into the new login API; added dummy window.console object to hopefully reduce errors when Firebug isn't around; fixed the longstanding ACL dismiss/close button bug; fixed a couple undefined variables in mailer; fixed PHP error on attempted opening of /dev/(u)random in rijndael.php; clarified documentation for PageProcessor::update_page(); fixed some logic problems in theme ACL code; disabled CAPTCHA debug
Dan
parents:
461
diff
changeset
|
285 |
error: function() {}, |
bc4b58034f4d
Implemented password reset (albeit hackishly) into the new login API; added dummy window.console object to hopefully reduce errors when Firebug isn't around; fixed the longstanding ACL dismiss/close button bug; fixed a couple undefined variables in mailer; fixed PHP error on attempted opening of /dev/(u)random in rijndael.php; clarified documentation for PageProcessor::update_page(); fixed some logic problems in theme ACL code; disabled CAPTCHA debug
Dan
parents:
461
diff
changeset
|
286 |
write: function() {} |
bc4b58034f4d
Implemented password reset (albeit hackishly) into the new login API; added dummy window.console object to hopefully reduce errors when Firebug isn't around; fixed the longstanding ACL dismiss/close button bug; fixed a couple undefined variables in mailer; fixed PHP error on attempted opening of /dev/(u)random in rijndael.php; clarified documentation for PageProcessor::update_page(); fixed some logic problems in theme ACL code; disabled CAPTCHA debug
Dan
parents:
461
diff
changeset
|
287 |
} |
bc4b58034f4d
Implemented password reset (albeit hackishly) into the new login API; added dummy window.console object to hopefully reduce errors when Firebug isn't around; fixed the longstanding ACL dismiss/close button bug; fixed a couple undefined variables in mailer; fixed PHP error on attempted opening of /dev/(u)random in rijndael.php; clarified documentation for PageProcessor::update_page(); fixed some logic problems in theme ACL code; disabled CAPTCHA debug
Dan
parents:
461
diff
changeset
|
288 |
} |
bc4b58034f4d
Implemented password reset (albeit hackishly) into the new login API; added dummy window.console object to hopefully reduce errors when Firebug isn't around; fixed the longstanding ACL dismiss/close button bug; fixed a couple undefined variables in mailer; fixed PHP error on attempted opening of /dev/(u)random in rijndael.php; clarified documentation for PageProcessor::update_page(); fixed some logic problems in theme ACL code; disabled CAPTCHA debug
Dan
parents:
461
diff
changeset
|
289 |
|
420
301f546688d1
Re-enabled, debugged, and optimized Javascript compression code
Dan
parents:
348
diff
changeset
|
290 |
// Do not remove the following comments, they are used by jsres.php. |
301f546688d1
Re-enabled, debugged, and optimized Javascript compression code
Dan
parents:
348
diff
changeset
|
291 |
/*!START_INCLUDER*/ |
301f546688d1
Re-enabled, debugged, and optimized Javascript compression code
Dan
parents:
348
diff
changeset
|
292 |
|
1 | 293 |
// Start loading files |
420
301f546688d1
Re-enabled, debugged, and optimized Javascript compression code
Dan
parents:
348
diff
changeset
|
294 |
// The string from the [ to the ] needs to be valid JSON, it's parsed by jsres.php. |
1 | 295 |
var thefiles = [ |
420
301f546688d1
Re-enabled, debugged, and optimized Javascript compression code
Dan
parents:
348
diff
changeset
|
296 |
'dynano.js', |
1 | 297 |
'misc.js', |
436
242353360e37
Added support for Diffie-Hellman key exchange during login. w00t!
Dan
parents:
430
diff
changeset
|
298 |
'login.js', |
1 | 299 |
'admin-menu.js', |
300 |
'ajax.js', |
|
301 |
'autocomplete.js', |
|
184
d74ff822acc9
Replaced autocompleting username with a much more efficient algorithm and caching system
Dan
parents:
174
diff
changeset
|
302 |
'autofill.js', |
1 | 303 |
'base64.js', |
304 |
'dropdown.js', |
|
305 |
'faders.js', |
|
306 |
'fat.js', |
|
307 |
'grippy.js', |
|
308 |
'json.js', |
|
309 |
'md5.js', |
|
436
242353360e37
Added support for Diffie-Hellman key exchange during login. w00t!
Dan
parents:
430
diff
changeset
|
310 |
'libbigint.js', |
242353360e37
Added support for Diffie-Hellman key exchange during login. w00t!
Dan
parents:
430
diff
changeset
|
311 |
'enanomath.js', |
242353360e37
Added support for Diffie-Hellman key exchange during login. w00t!
Dan
parents:
430
diff
changeset
|
312 |
'diffiehellman.js', |
242353360e37
Added support for Diffie-Hellman key exchange during login. w00t!
Dan
parents:
430
diff
changeset
|
313 |
'sha256.js', |
1 | 314 |
'sliders.js', |
315 |
'toolbar.js', |
|
316 |
'rijndael.js', |
|
210
2b283402e4e4
Added language export to JSON page and localization for Javascript using $lang.get(). Localized AJAX login interface.
Dan
parents:
200
diff
changeset
|
317 |
'l10n.js', |
1 | 318 |
'template-compiler.js', |
319 |
'acl.js', |
|
320 |
'comments.js', |
|
321 |
'editor.js', |
|
322 |
'flyin.js', |
|
85
7c68a18a27be
AJAX comments are now paginated; plugin manager can now show system plugins; typo in installer corrected; links in oxygen/stpatty/admin footers changed to "About Enano" page; 1.0.1 release candidate
Dan
parents:
59
diff
changeset
|
323 |
'paginate.js', |
133
af0f6ec48de3
Fully implemented password complexity enforcement; added encryption for passwords on registration form; some baby steps taken towards supporting international usernames - this is not working very well, we might need a hackish fix; TODO: implement password strength meter into installer UI and get international usernames 100% working
Dan
parents:
117
diff
changeset
|
324 |
'pwstrength.js', |
430
ec90736b9cb9
Started (but disabled) work on the new theme manager, 1.1.2 is being released with this thing halfway done.
Dan
parents:
420
diff
changeset
|
325 |
'theme-manager.js', |
174
4c5c2b66a34d
SECURITY: remove debug message in session manager; implemented alternate MediaWiki syntax for template embedding; added Adobe Spry for "shake" effect on unsuccessful login
Dan
parents:
133
diff
changeset
|
326 |
'SpryEffects.js', |
1 | 327 |
'loader.js' |
328 |
]; |
|
329 |
||
330 |
var problem_scripts = { |
|
57
b354deeaa4c4
Vastly improved compatibility with older versions of IE, particularly 5.0, through the use of a kill switch that turns off all AJAX functions
Dan
parents:
40
diff
changeset
|
331 |
'json.js' : true, |
b354deeaa4c4
Vastly improved compatibility with older versions of IE, particularly 5.0, through the use of a kill switch that turns off all AJAX functions
Dan
parents:
40
diff
changeset
|
332 |
'template-compiler.js' : true |
1 | 333 |
}; |
334 |
||
335 |
for(var f in thefiles) |
|
336 |
{ |
|
337 |
if ( typeof(thefiles[f]) != 'string' ) |
|
338 |
continue; |
|
339 |
var script = document.createElement('script'); |
|
340 |
script.type="text/javascript"; |
|
57
b354deeaa4c4
Vastly improved compatibility with older versions of IE, particularly 5.0, through the use of a kill switch that turns off all AJAX functions
Dan
parents:
40
diff
changeset
|
341 |
if ( problem_scripts[thefiles[f]] && KILL_SWITCH ) |
b354deeaa4c4
Vastly improved compatibility with older versions of IE, particularly 5.0, through the use of a kill switch that turns off all AJAX functions
Dan
parents:
40
diff
changeset
|
342 |
{ |
b354deeaa4c4
Vastly improved compatibility with older versions of IE, particularly 5.0, through the use of a kill switch that turns off all AJAX functions
Dan
parents:
40
diff
changeset
|
343 |
// alert('kill switch and problem script'); |
b354deeaa4c4
Vastly improved compatibility with older versions of IE, particularly 5.0, through the use of a kill switch that turns off all AJAX functions
Dan
parents:
40
diff
changeset
|
344 |
continue; |
b354deeaa4c4
Vastly improved compatibility with older versions of IE, particularly 5.0, through the use of a kill switch that turns off all AJAX functions
Dan
parents:
40
diff
changeset
|
345 |
} |
b354deeaa4c4
Vastly improved compatibility with older versions of IE, particularly 5.0, through the use of a kill switch that turns off all AJAX functions
Dan
parents:
40
diff
changeset
|
346 |
script.src=scriptPath+"/includes/clientside/static/"+thefiles[f]; |
1 | 347 |
head.appendChild(script); |
348 |
} |
|
349 |
||
420
301f546688d1
Re-enabled, debugged, and optimized Javascript compression code
Dan
parents:
348
diff
changeset
|
350 |
// Do not remove the following comment, it is used by jsres.php. |
301f546688d1
Re-enabled, debugged, and optimized Javascript compression code
Dan
parents:
348
diff
changeset
|
351 |
/*!END_INCLUDER*/ |
301f546688d1
Re-enabled, debugged, and optimized Javascript compression code
Dan
parents:
348
diff
changeset
|
352 |
|
1 | 353 |
addOnloadHook(function() { |
354 |
if ( $_REQUEST['do'] ) |
|
355 |
{ |
|
356 |
var act = $_REQUEST['do']; |
|
357 |
switch(act) |
|
358 |
{ |
|
359 |
case 'comments': |
|
360 |
ajaxComments(); |
|
361 |
break; |
|
362 |
case 'edit': |
|
363 |
ajaxEditor(); |
|
364 |
break; |
|
365 |
case 'login': |
|
366 |
ajaxStartLogin(); |
|
367 |
break; |
|
368 |
case 'history': |
|
369 |
ajaxHistory(); |
|
370 |
break; |
|
371 |
case 'catedit': |
|
372 |
ajaxCatEdit(); |
|
373 |
break; |
|
374 |
} |
|
375 |
} |
|
376 |
}); |
|
377 |
||
378 |
//*/ |