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
diff
changeset
+ − 12
* For more information about Enano, please visit http://enanocms.org/.
420
+ − 13
* Unless otherwise noted, all of the code in these script files may be used freely so long as the above license block
+ − 14
* is displayed and your modified code is distributed in compliance with the GPL. See the special page "About Enano" on
+ − 15
* this website for more information.
1
+ − 16
*/
+ − 17
+ − 18
if(typeof title != 'string')
+ − 19
{
555
ac4c6a7f01d8
Added user preference for disabling visual effects in Javascript applets; added re-import button to installed plugins
Dan
diff
changeset
+ − 20
alert('There was a problem loading the PHP-generated Javascript variables that control parameters for AJAX applets. Most on-page functionality will be very badly broken.\n\nTheme developers, ensure that you are using {JS_DYNAMIC_VARS} *before* you include jsres.php.');
1
+ − 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
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
+ − 39
var is_Opera = ( checkIt('opera') ) ? true : false;
509
175df10e0b56
Added a copy of Firebug Lite for debugging purposes. License is uncertain but being treated as MPL. (If is is not MPL then it is under something more permissive that permits relicensing anyway)
Dan
diff
changeset
+ − 40
var is_iPhone = ( checkIt('iphone') || checkIt('ipod') ) ? true : false;
555
ac4c6a7f01d8
Added user preference for disabling visual effects in Javascript applets; added re-import button to installed plugins
Dan
diff
changeset
+ − 41
var is_firefox2 = ( checkIt('firefox/2.') ) ? true : false;
117
+ − 42
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
diff
changeset
+ − 43
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
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
diff
changeset
+ − 45
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
diff
changeset
+ − 46
{
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
diff
changeset
+ − 47
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
diff
changeset
+ − 48
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
diff
changeset
+ − 49
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
diff
changeset
+ − 50
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
diff
changeset
+ − 51
{
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
diff
changeset
+ − 52
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
diff
changeset
+ − 53
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
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
diff
changeset
+ − 55
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
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
diff
changeset
+ − 57
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
diff
changeset
+ − 58
}
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
diff
changeset
+ − 59
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
diff
changeset
+ − 60
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
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
diff
changeset
+ − 62
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
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
diff
changeset
+ − 64
}
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
diff
changeset
+ − 65
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
diff
changeset
+ − 66
// 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
diff
changeset
+ − 67
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
diff
changeset
+ − 68
348
87e08a6e4fec
Welcome to the new Enano installer. Much distance still to be covered but the basics are there.
Dan
diff
changeset
+ − 69
if ( typeof(DISABLE_MCE) == undefined )
87e08a6e4fec
Welcome to the new Enano installer. Much distance still to be covered but the basics are there.
Dan
diff
changeset
+ − 70
{
87e08a6e4fec
Welcome to the new Enano installer. Much distance still to be covered but the basics are there.
Dan
diff
changeset
+ − 71
var DISABLE_MCE = false;
87e08a6e4fec
Welcome to the new Enano installer. Much distance still to be covered but the basics are there.
Dan
diff
changeset
+ − 72
}
87e08a6e4fec
Welcome to the new Enano installer. Much distance still to be covered but the basics are there.
Dan
diff
changeset
+ − 73
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
diff
changeset
+ − 74
// 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
diff
changeset
+ − 75
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
diff
changeset
+ − 76
21
663fcf528726
Updated all version numbers back to Banshee; a few preliminary steps towards full UTF-8 support in page URLs
Dan
diff
changeset
+ − 77
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
diff
changeset
+ − 78
1
+ − 79
var cmt_open;
+ − 80
var list;
+ − 81
var edit_open = false;
+ − 82
var catlist = new Array();
+ − 83
var arrDiff1Buttons = new Array();
+ − 84
var arrDiff2Buttons = new Array();
+ − 85
var arrTimeIdList = new Array();
+ − 86
var list;
+ − 87
var unObj;
+ − 88
var unSelectMenuOn = false;
+ − 89
var unObjDivCurrentId = false;
+ − 90
var unObjCurrentSelection = false;
+ − 91
var userlist = new Array();
+ − 92
var submitAuthorized = true;
+ − 93
var rDnsObj;
+ − 94
var rDnsBannerObj;
+ − 95
var ns4 = document.layers;
+ − 96
var op5 = (navigator.userAgent.indexOf("Opera 5")!=-1) ||(navigator.userAgent.indexOf("Opera/5")!=-1);
+ − 97
var op6 = (navigator.userAgent.indexOf("Opera 6")!=-1) ||(navigator.userAgent.indexOf("Opera/6")!=-1);
+ − 98
var agt=navigator.userAgent.toLowerCase();
+ − 99
var mac = (agt.indexOf("mac")!=-1);
+ − 100
var ie = (agt.indexOf("msie") != -1);
+ − 101
var mac_ie = mac && ie;
+ − 102
var mouseX = 0;
+ − 103
var mouseY = 0;
+ − 104
var menuheight;
+ − 105
var inertiabase = 1;
+ − 106
var inertiainc = 1;
+ − 107
var slideintervalinc = 20;
+ − 108
var inertiabaseoriginal = inertiabase;
+ − 109
var heightnow;
+ − 110
var targetheight;
+ − 111
var block;
+ − 112
var slideinterval;
+ − 113
var divheights = new Array();
+ − 114
var __menutimeout = false;
+ − 115
var startmouseX = false;
+ − 116
var startmouseY = false;
+ − 117
var startScroll = false;
+ − 118
var is_dragging = false;
+ − 119
var current_ta = false;
+ − 120
var startwidth = false;
+ − 121
var startheight = false;
+ − 122
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
diff
changeset
+ − 123
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
diff
changeset
+ − 124
var editor_use_modal_window = false;
1
+ − 125
+ − 126
// You have an NSIS coder in your midst...
+ − 127
var MB_OK = 1;
+ − 128
var MB_OKCANCEL = 2;
+ − 129
var MB_YESNO = 4;
+ − 130
var MB_YESNOCANCEL = 8;
+ − 131
var MB_ABORTRETRYIGNORE = 16;
+ − 132
var MB_ICONINFORMATION = 32;
+ − 133
var MB_ICONEXCLAMATION = 64;
+ − 134
var MB_ICONSTOP = 128;
+ − 135
var MB_ICONQUESTION = 256;
+ − 136
var MB_ICONLOCK = 512;
+ − 137
+ − 138
// Syntax:
+ − 139
// messagebox(MB_OK|MB_ICONINFORMATION, 'Title', 'Text');
+ − 140
// :-D
+ − 141
+ − 142
var main_css = document.getElementById('mdgCss').href;
+ − 143
if(main_css.indexOf('?') > -1) {
+ − 144
sep = '&';
+ − 145
} else sep = '?';
+ − 146
var _css = false;
+ − 147
var print_css = main_css + sep + 'printable';
+ − 148
+ − 149
var shift;
+ − 150
+ − 151
function makeUrl(page, query, html_friendly)
+ − 152
{
+ − 153
url = contentPath+page;
+ − 154
if(url.indexOf('?') > 0) sep = '&';
+ − 155
else sep = '?';
+ − 156
if(query)
+ − 157
{
+ − 158
url = url + sep + query;
+ − 159
}
+ − 160
if(html_friendly)
+ − 161
{
+ − 162
url = url.replace('&', '&');
+ − 163
url = url.replace('<', '<');
+ − 164
url = url.replace('>', '>');
+ − 165
}
+ − 166
return url;
+ − 167
}
+ − 168
+ − 169
function makeUrlNS(namespace, page, query, html_friendly)
+ − 170
{
+ − 171
var url = contentPath+namespace_list[namespace]+(page.replace(/ /g, '_'));
+ − 172
if(url.indexOf('?') > 0) sep = '&';
+ − 173
else sep = '?';
+ − 174
if(query)
+ − 175
{
+ − 176
url = url + sep + query;
+ − 177
}
+ − 178
if(html_friendly)
+ − 179
{
+ − 180
url = url.replace('&', '&');
+ − 181
url = url.replace('<', '<');
+ − 182
url = url.replace('>', '>');
+ − 183
}
+ − 184
return append_sid(url);
+ − 185
}
+ − 186
+ − 187
function strToPageID(string)
+ − 188
{
+ − 189
// Convert Special:UploadFile to ['UploadFile', 'Special'], but convert 'Image:Enano.png' to ['Enano.png', 'File']
+ − 190
for(var i in namespace_list)
+ − 191
if(namespace_list[i] != '')
+ − 192
if(namespace_list[i] == string.substr(0, namespace_list[i].length))
+ − 193
return [string.substr(namespace_list[i].length), i];
+ − 194
return [string, 'Article'];
+ − 195
}
+ − 196
+ − 197
function append_sid(url)
+ − 198
{
+ − 199
sep = ( url.indexOf('?') > 0 ) ? '&' : '?';
+ − 200
if(ENANO_SID.length > 10)
+ − 201
{
+ − 202
url = url + sep + 'auth=' + ENANO_SID;
+ − 203
sep = '&';
+ − 204
}
+ − 205
if ( pagepass.length > 0 )
+ − 206
{
+ − 207
url = url + sep + 'pagepass=' + pagepass;
+ − 208
}
+ − 209
return url;
+ − 210
}
+ − 211
+ − 212
var stdAjaxPrefix = append_sid(scriptPath+'/ajax.php?title='+title);
+ − 213
+ − 214
var $_REQUEST = new Object();
+ − 215
if ( window.location.hash )
+ − 216
{
+ − 217
var hash = String(window.location.hash);
+ − 218
hash = hash.substr(1);
+ − 219
var reqobj = hash.split(';');
+ − 220
var a, b;
+ − 221
for ( var i = 0; i < reqobj.length; i++ )
+ − 222
{
+ − 223
a = reqobj[i].substr(0, reqobj[i].indexOf(':'));
+ − 224
b = reqobj[i].substr( ( reqobj[i].indexOf(':') + 1 ) );
+ − 225
$_REQUEST[a] = b;
+ − 226
}
+ − 227
}
+ − 228
117
+ − 229
var onload_hooks = new Array();
+ − 230
+ − 231
function addOnloadHook(func)
+ − 232
{
+ − 233
if ( typeof ( func ) == 'function' )
+ − 234
{
+ − 235
if ( typeof(onload_hooks.push) == 'function' )
+ − 236
{
+ − 237
onload_hooks.push(func);
+ − 238
}
+ − 239
else
+ − 240
{
+ − 241
onload_hooks[onload_hooks.length] = func;
+ − 242
}
+ − 243
}
+ − 244
}
+ − 245
+ − 246
function runOnloadHooks(e)
+ − 247
{
+ − 248
var _errorTrapper = 0;
+ − 249
for ( var _oLc = 0; _oLc < onload_hooks.length; _oLc++ )
+ − 250
{
+ − 251
_errorTrapper++;
+ − 252
if ( _errorTrapper >= 1000 )
+ − 253
break;
+ − 254
var _f = onload_hooks[_oLc];
+ − 255
if ( typeof(_f) == 'function' )
+ − 256
{
+ − 257
_f(e);
+ − 258
}
+ − 259
}
+ − 260
}
+ − 261
1
+ − 262
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
diff
changeset
+ − 263
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
diff
changeset
+ − 264
{
461
+ − 265
if ( IE )
+ − 266
{
+ − 267
document.write('<script type="text/javascript" src="' + scriptPath + '/includes/clientside/tinymce/tiny_mce.js"></script>');
+ − 268
}
+ − 269
else
+ − 270
{
+ − 271
var script = document.createElement('script');
+ − 272
script.type="text/javascript";
544
+ − 273
script.src=scriptPath+"/includes/clientside/tinymce/tiny_mce_gzip.js";
+ − 274
script.onload = function(e)
+ − 275
{
+ − 276
tinyMCE_GZ.init(enano_tinymce_gz_options);
+ − 277
}
461
+ − 278
head.appendChild(script);
+ − 279
}
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
diff
changeset
+ − 280
}
1
+ − 281
509
175df10e0b56
Added a copy of Firebug Lite for debugging purposes. License is uncertain but being treated as MPL. (If is is not MPL then it is under something more permissive that permits relicensing anyway)
Dan
diff
changeset
+ − 282
var script = document.createElement('script');
175df10e0b56
Added a copy of Firebug Lite for debugging purposes. License is uncertain but being treated as MPL. (If is is not MPL then it is under something more permissive that permits relicensing anyway)
Dan
diff
changeset
+ − 283
script.type="text/javascript";
175df10e0b56
Added a copy of Firebug Lite for debugging purposes. License is uncertain but being treated as MPL. (If is is not MPL then it is under something more permissive that permits relicensing anyway)
Dan
diff
changeset
+ − 284
script.src=scriptPath+"/includes/clientside/firebug/firebug.js";
175df10e0b56
Added a copy of Firebug Lite for debugging purposes. License is uncertain but being treated as MPL. (If is is not MPL then it is under something more permissive that permits relicensing anyway)
Dan
diff
changeset
+ − 285
head.appendChild(script);
175df10e0b56
Added a copy of Firebug Lite for debugging purposes. License is uncertain but being treated as MPL. (If is is not MPL then it is under something more permissive that permits relicensing anyway)
Dan
diff
changeset
+ − 286
175df10e0b56
Added a copy of Firebug Lite for debugging purposes. License is uncertain but being treated as MPL. (If is is not MPL then it is under something more permissive that permits relicensing anyway)
Dan
diff
changeset
+ − 287
// placeholder for window.console - used if firebug isn't present
175df10e0b56
Added a copy of Firebug Lite for debugging purposes. License is uncertain but being treated as MPL. (If is is not MPL then it is under something more permissive that permits relicensing anyway)
Dan
diff
changeset
+ − 288
// http://getfirebug.com/firebug/firebugx.js
175df10e0b56
Added a copy of Firebug Lite for debugging purposes. License is uncertain but being treated as MPL. (If is is not MPL then it is under something more permissive that permits relicensing anyway)
Dan
diff
changeset
+ − 289
if (!window.console || !console.firebug)
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
diff
changeset
+ − 290
{
509
175df10e0b56
Added a copy of Firebug Lite for debugging purposes. License is uncertain but being treated as MPL. (If is is not MPL then it is under something more permissive that permits relicensing anyway)
Dan
diff
changeset
+ − 291
var names = ["log", "debug", "info", "warn", "error", "assert", "dir", "dirxml",
175df10e0b56
Added a copy of Firebug Lite for debugging purposes. License is uncertain but being treated as MPL. (If is is not MPL then it is under something more permissive that permits relicensing anyway)
Dan
diff
changeset
+ − 292
"group", "groupEnd", "time", "timeEnd", "count", "trace", "profile", "profileEnd"];
175df10e0b56
Added a copy of Firebug Lite for debugging purposes. License is uncertain but being treated as MPL. (If is is not MPL then it is under something more permissive that permits relicensing anyway)
Dan
diff
changeset
+ − 293
175df10e0b56
Added a copy of Firebug Lite for debugging purposes. License is uncertain but being treated as MPL. (If is is not MPL then it is under something more permissive that permits relicensing anyway)
Dan
diff
changeset
+ − 294
window.console = {};
175df10e0b56
Added a copy of Firebug Lite for debugging purposes. License is uncertain but being treated as MPL. (If is is not MPL then it is under something more permissive that permits relicensing anyway)
Dan
diff
changeset
+ − 295
for (var i = 0; i < names.length; ++i)
175df10e0b56
Added a copy of Firebug Lite for debugging purposes. License is uncertain but being treated as MPL. (If is is not MPL then it is under something more permissive that permits relicensing anyway)
Dan
diff
changeset
+ − 296
window.console[names[i]] = function() {}
175df10e0b56
Added a copy of Firebug Lite for debugging purposes. License is uncertain but being treated as MPL. (If is is not MPL then it is under something more permissive that permits relicensing anyway)
Dan
diff
changeset
+ − 297
}
175df10e0b56
Added a copy of Firebug Lite for debugging purposes. License is uncertain but being treated as MPL. (If is is not MPL then it is under something more permissive that permits relicensing anyway)
Dan
diff
changeset
+ − 298
175df10e0b56
Added a copy of Firebug Lite for debugging purposes. License is uncertain but being treated as MPL. (If is is not MPL then it is under something more permissive that permits relicensing anyway)
Dan
diff
changeset
+ − 299
// safari has window.console but not the .debug() method
175df10e0b56
Added a copy of Firebug Lite for debugging purposes. License is uncertain but being treated as MPL. (If is is not MPL then it is under something more permissive that permits relicensing anyway)
Dan
diff
changeset
+ − 300
if ( is_Safari && !window.console.debug )
175df10e0b56
Added a copy of Firebug Lite for debugging purposes. License is uncertain but being treated as MPL. (If is is not MPL then it is under something more permissive that permits relicensing anyway)
Dan
diff
changeset
+ − 301
{
175df10e0b56
Added a copy of Firebug Lite for debugging purposes. License is uncertain but being treated as MPL. (If is is not MPL then it is under something more permissive that permits relicensing anyway)
Dan
diff
changeset
+ − 302
window.console.debug = function() {};
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
diff
changeset
+ − 303
}
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
diff
changeset
+ − 304
420
+ − 305
// Do not remove the following comments, they are used by jsres.php.
+ − 306
/*!START_INCLUDER*/
+ − 307
1
+ − 308
// Start loading files
420
+ − 309
// The string from the [ to the ] needs to be valid JSON, it's parsed by jsres.php.
1
+ − 310
var thefiles = [
420
+ − 311
'dynano.js',
1
+ − 312
'misc.js',
436
+ − 313
'login.js',
1
+ − 314
'admin-menu.js',
+ − 315
'ajax.js',
+ − 316
'autocomplete.js',
184
+ − 317
'autofill.js',
1
+ − 318
'base64.js',
+ − 319
'dropdown.js',
+ − 320
'faders.js',
+ − 321
'fat.js',
+ − 322
'grippy.js',
+ − 323
'json.js',
+ − 324
'md5.js',
436
+ − 325
'libbigint.js',
+ − 326
'enanomath.js',
+ − 327
'diffiehellman.js',
+ − 328
'sha256.js',
1
+ − 329
'sliders.js',
+ − 330
'toolbar.js',
+ − 331
'rijndael.js',
210
2b283402e4e4
Added language export to JSON page and localization for Javascript using $lang.get(). Localized AJAX login interface.
Dan
diff
changeset
+ − 332
'l10n.js',
1
+ − 333
'template-compiler.js',
+ − 334
'acl.js',
+ − 335
'comments.js',
+ − 336
'editor.js',
+ − 337
'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
diff
changeset
+ − 338
'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
diff
changeset
+ − 339
'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
diff
changeset
+ − 340
'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
diff
changeset
+ − 341
'SpryEffects.js',
1
+ − 342
'loader.js'
+ − 343
];
+ − 344
+ − 345
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
diff
changeset
+ − 346
'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
diff
changeset
+ − 347
'template-compiler.js' : true
1
+ − 348
};
+ − 349
+ − 350
for(var f in thefiles)
+ − 351
{
+ − 352
if ( typeof(thefiles[f]) != 'string' )
+ − 353
continue;
+ − 354
var script = document.createElement('script');
+ − 355
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
diff
changeset
+ − 356
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
diff
changeset
+ − 357
{
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
diff
changeset
+ − 358
// 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
diff
changeset
+ − 359
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
diff
changeset
+ − 360
}
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
diff
changeset
+ − 361
script.src=scriptPath+"/includes/clientside/static/"+thefiles[f];
1
+ − 362
head.appendChild(script);
+ − 363
}
+ − 364
420
+ − 365
// Do not remove the following comment, it is used by jsres.php.
+ − 366
/*!END_INCLUDER*/
+ − 367
1
+ − 368
addOnloadHook(function() {
+ − 369
if ( $_REQUEST['do'] )
+ − 370
{
+ − 371
var act = $_REQUEST['do'];
+ − 372
switch(act)
+ − 373
{
+ − 374
case 'comments':
+ − 375
ajaxComments();
+ − 376
break;
+ − 377
case 'edit':
+ − 378
ajaxEditor();
+ − 379
break;
+ − 380
case 'login':
+ − 381
ajaxStartLogin();
+ − 382
break;
+ − 383
case 'history':
+ − 384
ajaxHistory();
+ − 385
break;
+ − 386
case 'catedit':
+ − 387
ajaxCatEdit();
+ − 388
break;
+ − 389
}
+ − 390
}
+ − 391
});
+ − 392
+ − 393
//*/