author | Dan |
Fri, 21 Dec 2007 18:21:20 -0500 | |
changeset 329 | 0437a7cf1acc |
parent 326 | ab66d6d1f1f4 |
child 335 | 67bd3121a12e |
permissions | -rw-r--r-- |
1 | 1 |
/* |
2 |
* AJAX applets |
|
3 |
*/ |
|
4 |
||
5 |
function ajaxGet(uri, f) { |
|
6 |
if (window.XMLHttpRequest) { |
|
7 |
ajax = new XMLHttpRequest(); |
|
8 |
} else { |
|
9 |
if (window.ActiveXObject) { |
|
10 |
ajax = new ActiveXObject("Microsoft.XMLHTTP"); |
|
11 |
} else { |
|
12 |
alert('Enano client-side runtime error: No AJAX support, unable to continue'); |
|
13 |
return; |
|
14 |
} |
|
15 |
} |
|
16 |
ajax.onreadystatechange = f; |
|
17 |
ajax.open('GET', uri, true); |
|
18 |
ajax.setRequestHeader( "If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT" ); |
|
19 |
ajax.send(null); |
|
20 |
} |
|
21 |
||
22 |
function ajaxPost(uri, parms, f) { |
|
23 |
if (window.XMLHttpRequest) { |
|
24 |
ajax = new XMLHttpRequest(); |
|
25 |
} else { |
|
26 |
if (window.ActiveXObject) { |
|
27 |
ajax = new ActiveXObject("Microsoft.XMLHTTP"); |
|
28 |
} else { |
|
29 |
alert('Enano client-side runtime error: No AJAX support, unable to continue'); |
|
30 |
return; |
|
31 |
} |
|
32 |
} |
|
33 |
ajax.onreadystatechange = f; |
|
34 |
ajax.open('POST', uri, true); |
|
35 |
ajax.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); |
|
40
723bb7acf914
Fixed a lot of bugs with Safari and Konqueror; improved Opera compatibility
Dan
parents:
32
diff
changeset
|
36 |
// Setting Content-length in Safari triggers a warning |
723bb7acf914
Fixed a lot of bugs with Safari and Konqueror; improved Opera compatibility
Dan
parents:
32
diff
changeset
|
37 |
if ( !is_Safari ) |
723bb7acf914
Fixed a lot of bugs with Safari and Konqueror; improved Opera compatibility
Dan
parents:
32
diff
changeset
|
38 |
{ |
723bb7acf914
Fixed a lot of bugs with Safari and Konqueror; improved Opera compatibility
Dan
parents:
32
diff
changeset
|
39 |
ajax.setRequestHeader("Content-length", parms.length); |
723bb7acf914
Fixed a lot of bugs with Safari and Konqueror; improved Opera compatibility
Dan
parents:
32
diff
changeset
|
40 |
} |
1 | 41 |
ajax.setRequestHeader("Connection", "close"); |
42 |
ajax.send(parms); |
|
43 |
} |
|
44 |
||
320
112debff64bd
SURPRISE! Preliminary PostgreSQL support added. The required schema file is not present in this commit and will be included at a later date. No installer support is implemented. Also in this commit: several fixes including <!-- SYSMSG ... --> was broken in template compiler; set fixed width on included images to prevent the thumbnail box from getting huge; added a much more friendly interface to AJAX responses that are invalid JSON
Dan
parents:
298
diff
changeset
|
45 |
/** |
112debff64bd
SURPRISE! Preliminary PostgreSQL support added. The required schema file is not present in this commit and will be included at a later date. No installer support is implemented. Also in this commit: several fixes including <!-- SYSMSG ... --> was broken in template compiler; set fixed width on included images to prevent the thumbnail box from getting huge; added a much more friendly interface to AJAX responses that are invalid JSON
Dan
parents:
298
diff
changeset
|
46 |
* Show a friendly error message depicting an AJAX response that is not valid JSON |
112debff64bd
SURPRISE! Preliminary PostgreSQL support added. The required schema file is not present in this commit and will be included at a later date. No installer support is implemented. Also in this commit: several fixes including <!-- SYSMSG ... --> was broken in template compiler; set fixed width on included images to prevent the thumbnail box from getting huge; added a much more friendly interface to AJAX responses that are invalid JSON
Dan
parents:
298
diff
changeset
|
47 |
* @param string Response text |
112debff64bd
SURPRISE! Preliminary PostgreSQL support added. The required schema file is not present in this commit and will be included at a later date. No installer support is implemented. Also in this commit: several fixes including <!-- SYSMSG ... --> was broken in template compiler; set fixed width on included images to prevent the thumbnail box from getting huge; added a much more friendly interface to AJAX responses that are invalid JSON
Dan
parents:
298
diff
changeset
|
48 |
* @param string Custom error message. If omitted, the default will be shown. |
112debff64bd
SURPRISE! Preliminary PostgreSQL support added. The required schema file is not present in this commit and will be included at a later date. No installer support is implemented. Also in this commit: several fixes including <!-- SYSMSG ... --> was broken in template compiler; set fixed width on included images to prevent the thumbnail box from getting huge; added a much more friendly interface to AJAX responses that are invalid JSON
Dan
parents:
298
diff
changeset
|
49 |
*/ |
112debff64bd
SURPRISE! Preliminary PostgreSQL support added. The required schema file is not present in this commit and will be included at a later date. No installer support is implemented. Also in this commit: several fixes including <!-- SYSMSG ... --> was broken in template compiler; set fixed width on included images to prevent the thumbnail box from getting huge; added a much more friendly interface to AJAX responses that are invalid JSON
Dan
parents:
298
diff
changeset
|
50 |
|
112debff64bd
SURPRISE! Preliminary PostgreSQL support added. The required schema file is not present in this commit and will be included at a later date. No installer support is implemented. Also in this commit: several fixes including <!-- SYSMSG ... --> was broken in template compiler; set fixed width on included images to prevent the thumbnail box from getting huge; added a much more friendly interface to AJAX responses that are invalid JSON
Dan
parents:
298
diff
changeset
|
51 |
function handle_invalid_json(response, customerror) |
112debff64bd
SURPRISE! Preliminary PostgreSQL support added. The required schema file is not present in this commit and will be included at a later date. No installer support is implemented. Also in this commit: several fixes including <!-- SYSMSG ... --> was broken in template compiler; set fixed width on included images to prevent the thumbnail box from getting huge; added a much more friendly interface to AJAX responses that are invalid JSON
Dan
parents:
298
diff
changeset
|
52 |
{ |
112debff64bd
SURPRISE! Preliminary PostgreSQL support added. The required schema file is not present in this commit and will be included at a later date. No installer support is implemented. Also in this commit: several fixes including <!-- SYSMSG ... --> was broken in template compiler; set fixed width on included images to prevent the thumbnail box from getting huge; added a much more friendly interface to AJAX responses that are invalid JSON
Dan
parents:
298
diff
changeset
|
53 |
var mainwin = $('ajaxEditContainer').object; |
112debff64bd
SURPRISE! Preliminary PostgreSQL support added. The required schema file is not present in this commit and will be included at a later date. No installer support is implemented. Also in this commit: several fixes including <!-- SYSMSG ... --> was broken in template compiler; set fixed width on included images to prevent the thumbnail box from getting huge; added a much more friendly interface to AJAX responses that are invalid JSON
Dan
parents:
298
diff
changeset
|
54 |
mainwin.innerHTML = ''; |
112debff64bd
SURPRISE! Preliminary PostgreSQL support added. The required schema file is not present in this commit and will be included at a later date. No installer support is implemented. Also in this commit: several fixes including <!-- SYSMSG ... --> was broken in template compiler; set fixed width on included images to prevent the thumbnail box from getting huge; added a much more friendly interface to AJAX responses that are invalid JSON
Dan
parents:
298
diff
changeset
|
55 |
|
112debff64bd
SURPRISE! Preliminary PostgreSQL support added. The required schema file is not present in this commit and will be included at a later date. No installer support is implemented. Also in this commit: several fixes including <!-- SYSMSG ... --> was broken in template compiler; set fixed width on included images to prevent the thumbnail box from getting huge; added a much more friendly interface to AJAX responses that are invalid JSON
Dan
parents:
298
diff
changeset
|
56 |
// Title |
112debff64bd
SURPRISE! Preliminary PostgreSQL support added. The required schema file is not present in this commit and will be included at a later date. No installer support is implemented. Also in this commit: several fixes including <!-- SYSMSG ... --> was broken in template compiler; set fixed width on included images to prevent the thumbnail box from getting huge; added a much more friendly interface to AJAX responses that are invalid JSON
Dan
parents:
298
diff
changeset
|
57 |
var h3 = document.createElement('h3'); |
112debff64bd
SURPRISE! Preliminary PostgreSQL support added. The required schema file is not present in this commit and will be included at a later date. No installer support is implemented. Also in this commit: several fixes including <!-- SYSMSG ... --> was broken in template compiler; set fixed width on included images to prevent the thumbnail box from getting huge; added a much more friendly interface to AJAX responses that are invalid JSON
Dan
parents:
298
diff
changeset
|
58 |
h3.appendChild(document.createTextNode('The site encountered an error while processing your request.')); |
112debff64bd
SURPRISE! Preliminary PostgreSQL support added. The required schema file is not present in this commit and will be included at a later date. No installer support is implemented. Also in this commit: several fixes including <!-- SYSMSG ... --> was broken in template compiler; set fixed width on included images to prevent the thumbnail box from getting huge; added a much more friendly interface to AJAX responses that are invalid JSON
Dan
parents:
298
diff
changeset
|
59 |
mainwin.appendChild(h3); |
112debff64bd
SURPRISE! Preliminary PostgreSQL support added. The required schema file is not present in this commit and will be included at a later date. No installer support is implemented. Also in this commit: several fixes including <!-- SYSMSG ... --> was broken in template compiler; set fixed width on included images to prevent the thumbnail box from getting huge; added a much more friendly interface to AJAX responses that are invalid JSON
Dan
parents:
298
diff
changeset
|
60 |
|
112debff64bd
SURPRISE! Preliminary PostgreSQL support added. The required schema file is not present in this commit and will be included at a later date. No installer support is implemented. Also in this commit: several fixes including <!-- SYSMSG ... --> was broken in template compiler; set fixed width on included images to prevent the thumbnail box from getting huge; added a much more friendly interface to AJAX responses that are invalid JSON
Dan
parents:
298
diff
changeset
|
61 |
if ( typeof(customerror) == 'string' ) |
112debff64bd
SURPRISE! Preliminary PostgreSQL support added. The required schema file is not present in this commit and will be included at a later date. No installer support is implemented. Also in this commit: several fixes including <!-- SYSMSG ... --> was broken in template compiler; set fixed width on included images to prevent the thumbnail box from getting huge; added a much more friendly interface to AJAX responses that are invalid JSON
Dan
parents:
298
diff
changeset
|
62 |
{ |
112debff64bd
SURPRISE! Preliminary PostgreSQL support added. The required schema file is not present in this commit and will be included at a later date. No installer support is implemented. Also in this commit: several fixes including <!-- SYSMSG ... --> was broken in template compiler; set fixed width on included images to prevent the thumbnail box from getting huge; added a much more friendly interface to AJAX responses that are invalid JSON
Dan
parents:
298
diff
changeset
|
63 |
var el = document.createElement('p'); |
112debff64bd
SURPRISE! Preliminary PostgreSQL support added. The required schema file is not present in this commit and will be included at a later date. No installer support is implemented. Also in this commit: several fixes including <!-- SYSMSG ... --> was broken in template compiler; set fixed width on included images to prevent the thumbnail box from getting huge; added a much more friendly interface to AJAX responses that are invalid JSON
Dan
parents:
298
diff
changeset
|
64 |
el.appendChild(document.createTextNode(customerror)); |
112debff64bd
SURPRISE! Preliminary PostgreSQL support added. The required schema file is not present in this commit and will be included at a later date. No installer support is implemented. Also in this commit: several fixes including <!-- SYSMSG ... --> was broken in template compiler; set fixed width on included images to prevent the thumbnail box from getting huge; added a much more friendly interface to AJAX responses that are invalid JSON
Dan
parents:
298
diff
changeset
|
65 |
mainwin.appendChild(el); |
112debff64bd
SURPRISE! Preliminary PostgreSQL support added. The required schema file is not present in this commit and will be included at a later date. No installer support is implemented. Also in this commit: several fixes including <!-- SYSMSG ... --> was broken in template compiler; set fixed width on included images to prevent the thumbnail box from getting huge; added a much more friendly interface to AJAX responses that are invalid JSON
Dan
parents:
298
diff
changeset
|
66 |
} |
112debff64bd
SURPRISE! Preliminary PostgreSQL support added. The required schema file is not present in this commit and will be included at a later date. No installer support is implemented. Also in this commit: several fixes including <!-- SYSMSG ... --> was broken in template compiler; set fixed width on included images to prevent the thumbnail box from getting huge; added a much more friendly interface to AJAX responses that are invalid JSON
Dan
parents:
298
diff
changeset
|
67 |
else |
112debff64bd
SURPRISE! Preliminary PostgreSQL support added. The required schema file is not present in this commit and will be included at a later date. No installer support is implemented. Also in this commit: several fixes including <!-- SYSMSG ... --> was broken in template compiler; set fixed width on included images to prevent the thumbnail box from getting huge; added a much more friendly interface to AJAX responses that are invalid JSON
Dan
parents:
298
diff
changeset
|
68 |
{ |
112debff64bd
SURPRISE! Preliminary PostgreSQL support added. The required schema file is not present in this commit and will be included at a later date. No installer support is implemented. Also in this commit: several fixes including <!-- SYSMSG ... --> was broken in template compiler; set fixed width on included images to prevent the thumbnail box from getting huge; added a much more friendly interface to AJAX responses that are invalid JSON
Dan
parents:
298
diff
changeset
|
69 |
customerror = 'We unexpectedly received the following response from the server. The response should have been in the JSON '; |
112debff64bd
SURPRISE! Preliminary PostgreSQL support added. The required schema file is not present in this commit and will be included at a later date. No installer support is implemented. Also in this commit: several fixes including <!-- SYSMSG ... --> was broken in template compiler; set fixed width on included images to prevent the thumbnail box from getting huge; added a much more friendly interface to AJAX responses that are invalid JSON
Dan
parents:
298
diff
changeset
|
70 |
customerror += 'serialization format, but the response wasn\'t composed only of the JSON response. There are three possible triggers'; |
112debff64bd
SURPRISE! Preliminary PostgreSQL support added. The required schema file is not present in this commit and will be included at a later date. No installer support is implemented. Also in this commit: several fixes including <!-- SYSMSG ... --> was broken in template compiler; set fixed width on included images to prevent the thumbnail box from getting huge; added a much more friendly interface to AJAX responses that are invalid JSON
Dan
parents:
298
diff
changeset
|
71 |
customerror += 'for this problem:'; |
112debff64bd
SURPRISE! Preliminary PostgreSQL support added. The required schema file is not present in this commit and will be included at a later date. No installer support is implemented. Also in this commit: several fixes including <!-- SYSMSG ... --> was broken in template compiler; set fixed width on included images to prevent the thumbnail box from getting huge; added a much more friendly interface to AJAX responses that are invalid JSON
Dan
parents:
298
diff
changeset
|
72 |
var el = document.createElement('p'); |
112debff64bd
SURPRISE! Preliminary PostgreSQL support added. The required schema file is not present in this commit and will be included at a later date. No installer support is implemented. Also in this commit: several fixes including <!-- SYSMSG ... --> was broken in template compiler; set fixed width on included images to prevent the thumbnail box from getting huge; added a much more friendly interface to AJAX responses that are invalid JSON
Dan
parents:
298
diff
changeset
|
73 |
el.appendChild(document.createTextNode(customerror)); |
112debff64bd
SURPRISE! Preliminary PostgreSQL support added. The required schema file is not present in this commit and will be included at a later date. No installer support is implemented. Also in this commit: several fixes including <!-- SYSMSG ... --> was broken in template compiler; set fixed width on included images to prevent the thumbnail box from getting huge; added a much more friendly interface to AJAX responses that are invalid JSON
Dan
parents:
298
diff
changeset
|
74 |
mainwin.appendChild(el); |
112debff64bd
SURPRISE! Preliminary PostgreSQL support added. The required schema file is not present in this commit and will be included at a later date. No installer support is implemented. Also in this commit: several fixes including <!-- SYSMSG ... --> was broken in template compiler; set fixed width on included images to prevent the thumbnail box from getting huge; added a much more friendly interface to AJAX responses that are invalid JSON
Dan
parents:
298
diff
changeset
|
75 |
var ul = document.createElement('ul'); |
112debff64bd
SURPRISE! Preliminary PostgreSQL support added. The required schema file is not present in this commit and will be included at a later date. No installer support is implemented. Also in this commit: several fixes including <!-- SYSMSG ... --> was broken in template compiler; set fixed width on included images to prevent the thumbnail box from getting huge; added a much more friendly interface to AJAX responses that are invalid JSON
Dan
parents:
298
diff
changeset
|
76 |
var li1 = document.createElement('li'); |
112debff64bd
SURPRISE! Preliminary PostgreSQL support added. The required schema file is not present in this commit and will be included at a later date. No installer support is implemented. Also in this commit: several fixes including <!-- SYSMSG ... --> was broken in template compiler; set fixed width on included images to prevent the thumbnail box from getting huge; added a much more friendly interface to AJAX responses that are invalid JSON
Dan
parents:
298
diff
changeset
|
77 |
var li2 = document.createElement('li'); |
112debff64bd
SURPRISE! Preliminary PostgreSQL support added. The required schema file is not present in this commit and will be included at a later date. No installer support is implemented. Also in this commit: several fixes including <!-- SYSMSG ... --> was broken in template compiler; set fixed width on included images to prevent the thumbnail box from getting huge; added a much more friendly interface to AJAX responses that are invalid JSON
Dan
parents:
298
diff
changeset
|
78 |
var li3 = document.createElement('li'); |
112debff64bd
SURPRISE! Preliminary PostgreSQL support added. The required schema file is not present in this commit and will be included at a later date. No installer support is implemented. Also in this commit: several fixes including <!-- SYSMSG ... --> was broken in template compiler; set fixed width on included images to prevent the thumbnail box from getting huge; added a much more friendly interface to AJAX responses that are invalid JSON
Dan
parents:
298
diff
changeset
|
79 |
li1.appendChild(document.createTextNode('The server sent back a bad HTTP response code and thus sent an error page instead of running Enano. This indicates a possible problem with your server, and is not likely to be a bug with Enano.')); |
112debff64bd
SURPRISE! Preliminary PostgreSQL support added. The required schema file is not present in this commit and will be included at a later date. No installer support is implemented. Also in this commit: several fixes including <!-- SYSMSG ... --> was broken in template compiler; set fixed width on included images to prevent the thumbnail box from getting huge; added a much more friendly interface to AJAX responses that are invalid JSON
Dan
parents:
298
diff
changeset
|
80 |
var osc_exception = ( window.location.hostname == 'demo.opensourcecms.com' ) ? ' This is KNOWN to be the case with the OpenSourceCMS.com demo version of Enano.' : ''; |
112debff64bd
SURPRISE! Preliminary PostgreSQL support added. The required schema file is not present in this commit and will be included at a later date. No installer support is implemented. Also in this commit: several fixes including <!-- SYSMSG ... --> was broken in template compiler; set fixed width on included images to prevent the thumbnail box from getting huge; added a much more friendly interface to AJAX responses that are invalid JSON
Dan
parents:
298
diff
changeset
|
81 |
li2.appendChild(document.createTextNode('The server sent back the expected JSON response, but also injected some code into the response that should not be there. Typically this consists of advertisement code. In this case, the administrator of this site will have to contact their web host to have advertisements disabled.' + osc_exception)); |
112debff64bd
SURPRISE! Preliminary PostgreSQL support added. The required schema file is not present in this commit and will be included at a later date. No installer support is implemented. Also in this commit: several fixes including <!-- SYSMSG ... --> was broken in template compiler; set fixed width on included images to prevent the thumbnail box from getting huge; added a much more friendly interface to AJAX responses that are invalid JSON
Dan
parents:
298
diff
changeset
|
82 |
li3.appendChild(document.createTextNode('It\'s possible that Enano triggered a PHP error or warning. In this case, you may be looking at a bug in Enano.')); |
112debff64bd
SURPRISE! Preliminary PostgreSQL support added. The required schema file is not present in this commit and will be included at a later date. No installer support is implemented. Also in this commit: several fixes including <!-- SYSMSG ... --> was broken in template compiler; set fixed width on included images to prevent the thumbnail box from getting huge; added a much more friendly interface to AJAX responses that are invalid JSON
Dan
parents:
298
diff
changeset
|
83 |
|
112debff64bd
SURPRISE! Preliminary PostgreSQL support added. The required schema file is not present in this commit and will be included at a later date. No installer support is implemented. Also in this commit: several fixes including <!-- SYSMSG ... --> was broken in template compiler; set fixed width on included images to prevent the thumbnail box from getting huge; added a much more friendly interface to AJAX responses that are invalid JSON
Dan
parents:
298
diff
changeset
|
84 |
ul.appendChild(li1); |
112debff64bd
SURPRISE! Preliminary PostgreSQL support added. The required schema file is not present in this commit and will be included at a later date. No installer support is implemented. Also in this commit: several fixes including <!-- SYSMSG ... --> was broken in template compiler; set fixed width on included images to prevent the thumbnail box from getting huge; added a much more friendly interface to AJAX responses that are invalid JSON
Dan
parents:
298
diff
changeset
|
85 |
ul.appendChild(li2); |
112debff64bd
SURPRISE! Preliminary PostgreSQL support added. The required schema file is not present in this commit and will be included at a later date. No installer support is implemented. Also in this commit: several fixes including <!-- SYSMSG ... --> was broken in template compiler; set fixed width on included images to prevent the thumbnail box from getting huge; added a much more friendly interface to AJAX responses that are invalid JSON
Dan
parents:
298
diff
changeset
|
86 |
ul.appendChild(li3); |
112debff64bd
SURPRISE! Preliminary PostgreSQL support added. The required schema file is not present in this commit and will be included at a later date. No installer support is implemented. Also in this commit: several fixes including <!-- SYSMSG ... --> was broken in template compiler; set fixed width on included images to prevent the thumbnail box from getting huge; added a much more friendly interface to AJAX responses that are invalid JSON
Dan
parents:
298
diff
changeset
|
87 |
mainwin.appendChild(ul); |
112debff64bd
SURPRISE! Preliminary PostgreSQL support added. The required schema file is not present in this commit and will be included at a later date. No installer support is implemented. Also in this commit: several fixes including <!-- SYSMSG ... --> was broken in template compiler; set fixed width on included images to prevent the thumbnail box from getting huge; added a much more friendly interface to AJAX responses that are invalid JSON
Dan
parents:
298
diff
changeset
|
88 |
} |
112debff64bd
SURPRISE! Preliminary PostgreSQL support added. The required schema file is not present in this commit and will be included at a later date. No installer support is implemented. Also in this commit: several fixes including <!-- SYSMSG ... --> was broken in template compiler; set fixed width on included images to prevent the thumbnail box from getting huge; added a much more friendly interface to AJAX responses that are invalid JSON
Dan
parents:
298
diff
changeset
|
89 |
|
112debff64bd
SURPRISE! Preliminary PostgreSQL support added. The required schema file is not present in this commit and will be included at a later date. No installer support is implemented. Also in this commit: several fixes including <!-- SYSMSG ... --> was broken in template compiler; set fixed width on included images to prevent the thumbnail box from getting huge; added a much more friendly interface to AJAX responses that are invalid JSON
Dan
parents:
298
diff
changeset
|
90 |
var p2 = document.createElement('p'); |
112debff64bd
SURPRISE! Preliminary PostgreSQL support added. The required schema file is not present in this commit and will be included at a later date. No installer support is implemented. Also in this commit: several fixes including <!-- SYSMSG ... --> was broken in template compiler; set fixed width on included images to prevent the thumbnail box from getting huge; added a much more friendly interface to AJAX responses that are invalid JSON
Dan
parents:
298
diff
changeset
|
91 |
p2.appendChild(document.createTextNode('The response received from the server is as follows:')); |
112debff64bd
SURPRISE! Preliminary PostgreSQL support added. The required schema file is not present in this commit and will be included at a later date. No installer support is implemented. Also in this commit: several fixes including <!-- SYSMSG ... --> was broken in template compiler; set fixed width on included images to prevent the thumbnail box from getting huge; added a much more friendly interface to AJAX responses that are invalid JSON
Dan
parents:
298
diff
changeset
|
92 |
mainwin.appendChild(p2); |
112debff64bd
SURPRISE! Preliminary PostgreSQL support added. The required schema file is not present in this commit and will be included at a later date. No installer support is implemented. Also in this commit: several fixes including <!-- SYSMSG ... --> was broken in template compiler; set fixed width on included images to prevent the thumbnail box from getting huge; added a much more friendly interface to AJAX responses that are invalid JSON
Dan
parents:
298
diff
changeset
|
93 |
|
112debff64bd
SURPRISE! Preliminary PostgreSQL support added. The required schema file is not present in this commit and will be included at a later date. No installer support is implemented. Also in this commit: several fixes including <!-- SYSMSG ... --> was broken in template compiler; set fixed width on included images to prevent the thumbnail box from getting huge; added a much more friendly interface to AJAX responses that are invalid JSON
Dan
parents:
298
diff
changeset
|
94 |
var pre = document.createElement('pre'); |
112debff64bd
SURPRISE! Preliminary PostgreSQL support added. The required schema file is not present in this commit and will be included at a later date. No installer support is implemented. Also in this commit: several fixes including <!-- SYSMSG ... --> was broken in template compiler; set fixed width on included images to prevent the thumbnail box from getting huge; added a much more friendly interface to AJAX responses that are invalid JSON
Dan
parents:
298
diff
changeset
|
95 |
pre.appendChild(document.createTextNode(response)); |
112debff64bd
SURPRISE! Preliminary PostgreSQL support added. The required schema file is not present in this commit and will be included at a later date. No installer support is implemented. Also in this commit: several fixes including <!-- SYSMSG ... --> was broken in template compiler; set fixed width on included images to prevent the thumbnail box from getting huge; added a much more friendly interface to AJAX responses that are invalid JSON
Dan
parents:
298
diff
changeset
|
96 |
mainwin.appendChild(pre); |
112debff64bd
SURPRISE! Preliminary PostgreSQL support added. The required schema file is not present in this commit and will be included at a later date. No installer support is implemented. Also in this commit: several fixes including <!-- SYSMSG ... --> was broken in template compiler; set fixed width on included images to prevent the thumbnail box from getting huge; added a much more friendly interface to AJAX responses that are invalid JSON
Dan
parents:
298
diff
changeset
|
97 |
|
112debff64bd
SURPRISE! Preliminary PostgreSQL support added. The required schema file is not present in this commit and will be included at a later date. No installer support is implemented. Also in this commit: several fixes including <!-- SYSMSG ... --> was broken in template compiler; set fixed width on included images to prevent the thumbnail box from getting huge; added a much more friendly interface to AJAX responses that are invalid JSON
Dan
parents:
298
diff
changeset
|
98 |
var p3 = document.createElement('p'); |
112debff64bd
SURPRISE! Preliminary PostgreSQL support added. The required schema file is not present in this commit and will be included at a later date. No installer support is implemented. Also in this commit: several fixes including <!-- SYSMSG ... --> was broken in template compiler; set fixed width on included images to prevent the thumbnail box from getting huge; added a much more friendly interface to AJAX responses that are invalid JSON
Dan
parents:
298
diff
changeset
|
99 |
p3.appendChild(document.createTextNode('You may also choose to view the response as HTML. ')); |
112debff64bd
SURPRISE! Preliminary PostgreSQL support added. The required schema file is not present in this commit and will be included at a later date. No installer support is implemented. Also in this commit: several fixes including <!-- SYSMSG ... --> was broken in template compiler; set fixed width on included images to prevent the thumbnail box from getting huge; added a much more friendly interface to AJAX responses that are invalid JSON
Dan
parents:
298
diff
changeset
|
100 |
var a = document.createElement('a'); |
112debff64bd
SURPRISE! Preliminary PostgreSQL support added. The required schema file is not present in this commit and will be included at a later date. No installer support is implemented. Also in this commit: several fixes including <!-- SYSMSG ... --> was broken in template compiler; set fixed width on included images to prevent the thumbnail box from getting huge; added a much more friendly interface to AJAX responses that are invalid JSON
Dan
parents:
298
diff
changeset
|
101 |
a.appendChild(document.createTextNode('View as HTML...')); |
112debff64bd
SURPRISE! Preliminary PostgreSQL support added. The required schema file is not present in this commit and will be included at a later date. No installer support is implemented. Also in this commit: several fixes including <!-- SYSMSG ... --> was broken in template compiler; set fixed width on included images to prevent the thumbnail box from getting huge; added a much more friendly interface to AJAX responses that are invalid JSON
Dan
parents:
298
diff
changeset
|
102 |
a._resp = response; |
112debff64bd
SURPRISE! Preliminary PostgreSQL support added. The required schema file is not present in this commit and will be included at a later date. No installer support is implemented. Also in this commit: several fixes including <!-- SYSMSG ... --> was broken in template compiler; set fixed width on included images to prevent the thumbnail box from getting huge; added a much more friendly interface to AJAX responses that are invalid JSON
Dan
parents:
298
diff
changeset
|
103 |
a.id = 'invalidjson_link'; |
112debff64bd
SURPRISE! Preliminary PostgreSQL support added. The required schema file is not present in this commit and will be included at a later date. No installer support is implemented. Also in this commit: several fixes including <!-- SYSMSG ... --> was broken in template compiler; set fixed width on included images to prevent the thumbnail box from getting huge; added a much more friendly interface to AJAX responses that are invalid JSON
Dan
parents:
298
diff
changeset
|
104 |
a.onclick = function() |
112debff64bd
SURPRISE! Preliminary PostgreSQL support added. The required schema file is not present in this commit and will be included at a later date. No installer support is implemented. Also in this commit: several fixes including <!-- SYSMSG ... --> was broken in template compiler; set fixed width on included images to prevent the thumbnail box from getting huge; added a much more friendly interface to AJAX responses that are invalid JSON
Dan
parents:
298
diff
changeset
|
105 |
{ |
112debff64bd
SURPRISE! Preliminary PostgreSQL support added. The required schema file is not present in this commit and will be included at a later date. No installer support is implemented. Also in this commit: several fixes including <!-- SYSMSG ... --> was broken in template compiler; set fixed width on included images to prevent the thumbnail box from getting huge; added a much more friendly interface to AJAX responses that are invalid JSON
Dan
parents:
298
diff
changeset
|
106 |
var mb = new messagebox(MB_YESNO | MB_ICONEXCLAMATION, 'Do you really want to view this response as HTML?', 'If the response was changed during transmission to include malicious code, you may be allowing that malicious code to run by viewing the response as HTML. Only do this if you have reviewed the response text and have found no suspicious code in it.'); |
112debff64bd
SURPRISE! Preliminary PostgreSQL support added. The required schema file is not present in this commit and will be included at a later date. No installer support is implemented. Also in this commit: several fixes including <!-- SYSMSG ... --> was broken in template compiler; set fixed width on included images to prevent the thumbnail box from getting huge; added a much more friendly interface to AJAX responses that are invalid JSON
Dan
parents:
298
diff
changeset
|
107 |
mb.onclick['Yes'] = function() |
112debff64bd
SURPRISE! Preliminary PostgreSQL support added. The required schema file is not present in this commit and will be included at a later date. No installer support is implemented. Also in this commit: several fixes including <!-- SYSMSG ... --> was broken in template compiler; set fixed width on included images to prevent the thumbnail box from getting huge; added a much more friendly interface to AJAX responses that are invalid JSON
Dan
parents:
298
diff
changeset
|
108 |
{ |
112debff64bd
SURPRISE! Preliminary PostgreSQL support added. The required schema file is not present in this commit and will be included at a later date. No installer support is implemented. Also in this commit: several fixes including <!-- SYSMSG ... --> was broken in template compiler; set fixed width on included images to prevent the thumbnail box from getting huge; added a much more friendly interface to AJAX responses that are invalid JSON
Dan
parents:
298
diff
changeset
|
109 |
var html = $('invalidjson_link').object._resp; |
112debff64bd
SURPRISE! Preliminary PostgreSQL support added. The required schema file is not present in this commit and will be included at a later date. No installer support is implemented. Also in this commit: several fixes including <!-- SYSMSG ... --> was broken in template compiler; set fixed width on included images to prevent the thumbnail box from getting huge; added a much more friendly interface to AJAX responses that are invalid JSON
Dan
parents:
298
diff
changeset
|
110 |
var win = window.open('about:blank', 'invalidjson_htmlwin', 'width=550,height=400,status=no,toolbars=no,toolbar=no,address=no,scroll=yes'); |
112debff64bd
SURPRISE! Preliminary PostgreSQL support added. The required schema file is not present in this commit and will be included at a later date. No installer support is implemented. Also in this commit: several fixes including <!-- SYSMSG ... --> was broken in template compiler; set fixed width on included images to prevent the thumbnail box from getting huge; added a much more friendly interface to AJAX responses that are invalid JSON
Dan
parents:
298
diff
changeset
|
111 |
win.document.write(html); |
112debff64bd
SURPRISE! Preliminary PostgreSQL support added. The required schema file is not present in this commit and will be included at a later date. No installer support is implemented. Also in this commit: several fixes including <!-- SYSMSG ... --> was broken in template compiler; set fixed width on included images to prevent the thumbnail box from getting huge; added a much more friendly interface to AJAX responses that are invalid JSON
Dan
parents:
298
diff
changeset
|
112 |
} |
112debff64bd
SURPRISE! Preliminary PostgreSQL support added. The required schema file is not present in this commit and will be included at a later date. No installer support is implemented. Also in this commit: several fixes including <!-- SYSMSG ... --> was broken in template compiler; set fixed width on included images to prevent the thumbnail box from getting huge; added a much more friendly interface to AJAX responses that are invalid JSON
Dan
parents:
298
diff
changeset
|
113 |
return false; |
112debff64bd
SURPRISE! Preliminary PostgreSQL support added. The required schema file is not present in this commit and will be included at a later date. No installer support is implemented. Also in this commit: several fixes including <!-- SYSMSG ... --> was broken in template compiler; set fixed width on included images to prevent the thumbnail box from getting huge; added a much more friendly interface to AJAX responses that are invalid JSON
Dan
parents:
298
diff
changeset
|
114 |
} |
112debff64bd
SURPRISE! Preliminary PostgreSQL support added. The required schema file is not present in this commit and will be included at a later date. No installer support is implemented. Also in this commit: several fixes including <!-- SYSMSG ... --> was broken in template compiler; set fixed width on included images to prevent the thumbnail box from getting huge; added a much more friendly interface to AJAX responses that are invalid JSON
Dan
parents:
298
diff
changeset
|
115 |
a.href = '#'; |
112debff64bd
SURPRISE! Preliminary PostgreSQL support added. The required schema file is not present in this commit and will be included at a later date. No installer support is implemented. Also in this commit: several fixes including <!-- SYSMSG ... --> was broken in template compiler; set fixed width on included images to prevent the thumbnail box from getting huge; added a much more friendly interface to AJAX responses that are invalid JSON
Dan
parents:
298
diff
changeset
|
116 |
p3.appendChild(a); |
112debff64bd
SURPRISE! Preliminary PostgreSQL support added. The required schema file is not present in this commit and will be included at a later date. No installer support is implemented. Also in this commit: several fixes including <!-- SYSMSG ... --> was broken in template compiler; set fixed width on included images to prevent the thumbnail box from getting huge; added a much more friendly interface to AJAX responses that are invalid JSON
Dan
parents:
298
diff
changeset
|
117 |
mainwin.appendChild(p3); |
112debff64bd
SURPRISE! Preliminary PostgreSQL support added. The required schema file is not present in this commit and will be included at a later date. No installer support is implemented. Also in this commit: several fixes including <!-- SYSMSG ... --> was broken in template compiler; set fixed width on included images to prevent the thumbnail box from getting huge; added a much more friendly interface to AJAX responses that are invalid JSON
Dan
parents:
298
diff
changeset
|
118 |
} |
112debff64bd
SURPRISE! Preliminary PostgreSQL support added. The required schema file is not present in this commit and will be included at a later date. No installer support is implemented. Also in this commit: several fixes including <!-- SYSMSG ... --> was broken in template compiler; set fixed width on included images to prevent the thumbnail box from getting huge; added a much more friendly interface to AJAX responses that are invalid JSON
Dan
parents:
298
diff
changeset
|
119 |
|
1 | 120 |
function ajaxEscape(text) |
121 |
{ |
|
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:
118
diff
changeset
|
122 |
/* |
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:
118
diff
changeset
|
123 |
text = escape(text); |
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:
118
diff
changeset
|
124 |
text = text.replace(/\+/g, '%2B', text); |
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:
118
diff
changeset
|
125 |
*/ |
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:
118
diff
changeset
|
126 |
text = window.encodeURIComponent(text); |
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:
118
diff
changeset
|
127 |
return text; |
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:
118
diff
changeset
|
128 |
} |
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:
118
diff
changeset
|
129 |
|
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:
118
diff
changeset
|
130 |
function ajaxAltEscape(text) |
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:
118
diff
changeset
|
131 |
{ |
1 | 132 |
text = escape(text); |
133 |
text = text.replace(/\+/g, '%2B', text); |
|
134 |
return text; |
|
135 |
} |
|
136 |
||
137 |
// Page editor |
|
138 |
||
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
|
139 |
function ajaxEditor() |
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
|
140 |
{ |
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
|
141 |
// IE <6 pseudo-compatibility |
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
|
142 |
if ( 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
|
143 |
return true; |
1 | 144 |
setAjaxLoading(); |
145 |
ajaxGet(stdAjaxPrefix+'&_mode=getsource', function() { |
|
146 |
if(ajax.readyState == 4) { |
|
147 |
unsetAjaxLoading(); |
|
148 |
if(edit_open) { |
|
213
1316404e4ea8
Localized history page and static HTML comment interface
Dan
parents:
211
diff
changeset
|
149 |
c=confirm($lang.get('editor_msg_revert_confirm')); |
1 | 150 |
if(!c) return; |
151 |
} |
|
152 |
edit_open = true; |
|
153 |
selectButtonMajor('article'); |
|
154 |
selectButtonMinor('edit'); |
|
155 |
if(in_array('ajaxEditArea', grippied_textareas)) |
|
156 |
{ |
|
157 |
// Allow the textarea grippifier to re-create the resizer control on the textarea |
|
158 |
grippied_textareas.pop(in_array('ajaxEditArea', grippied_textareas)); |
|
159 |
} |
|
213
1316404e4ea8
Localized history page and static HTML comment interface
Dan
parents:
211
diff
changeset
|
160 |
disableUnload($lang.get('editor_msg_unload')); |
1 | 161 |
var switcher = ( readCookie('enano_editor_mode') == 'tinymce' ) ? |
213
1316404e4ea8
Localized history page and static HTML comment interface
Dan
parents:
211
diff
changeset
|
162 |
'<a href="#" onclick="setEditorText(); return false;">' + $lang.get('editor_btn_wikitext') + '</a> | ' + $lang.get('editor_btn_graphical') : |
1316404e4ea8
Localized history page and static HTML comment interface
Dan
parents:
211
diff
changeset
|
163 |
$lang.get('editor_btn_wikitext') + ' | <a href="#" onclick="setEditorMCE(); return false;">' + $lang.get('editor_btn_graphical') + '</a>' ; |
1 | 164 |
document.getElementById('ajaxEditContainer').innerHTML = '\ |
165 |
<div id="mdgPreviewContainer"></div> \ |
|
166 |
<span id="switcher">' + switcher + '</span><br />\ |
|
167 |
<form name="mdgAjaxEditor" method="get" action="#" onsubmit="ajaxSavePage(); return false;">\ |
|
168 |
<textarea id="ajaxEditArea" rows="20" cols="60" style="display: block; margin: 1em 0 1em 1em; width: 96.5%;">'+ajax.responseText+'</textarea><br />\ |
|
213
1316404e4ea8
Localized history page and static HTML comment interface
Dan
parents:
211
diff
changeset
|
169 |
' + $lang.get('editor_lbl_edit_summary') + ' <input id="ajaxEditSummary" size="40" /><br />\ |
1316404e4ea8
Localized history page and static HTML comment interface
Dan
parents:
211
diff
changeset
|
170 |
<input id="ajaxEditMinor" name="minor" type="checkbox" /> <label for="ajaxEditMinor">' + $lang.get('editor_lbl_minor_edit') + '</label><br />\ |
1316404e4ea8
Localized history page and static HTML comment interface
Dan
parents:
211
diff
changeset
|
171 |
<a href="#" onclick="void(ajaxSavePage()); return false;">' + $lang.get('editor_btn_save') + '</a> | <a href="#" onclick="void(ajaxShowPreview()); return false;">' + $lang.get('editor_btn_preview') + '</a> | <a href="#" onclick="void(ajaxEditor()); return false;">' + $lang.get('editor_btn_revert') + '</a> | <a href="#" onclick="void(ajaxDiscard()); return false;">' + $lang.get('editor_btn_cancel') + '</a>\ |
1 | 172 |
<br />\ |
173 |
'+editNotice+'\ |
|
174 |
</form>'; |
|
175 |
// initTextareas(); |
|
176 |
if(readCookie('enano_editor_mode') == 'tinymce') |
|
177 |
{ |
|
178 |
$('ajaxEditArea').switchToMCE(); |
|
179 |
} |
|
180 |
} |
|
181 |
}); |
|
182 |
} |
|
183 |
||
184 |
function setEditorMCE() |
|
185 |
{ |
|
186 |
$('ajaxEditArea').switchToMCE(); |
|
187 |
createCookie('enano_editor_mode', 'tinymce', 365); |
|
213
1316404e4ea8
Localized history page and static HTML comment interface
Dan
parents:
211
diff
changeset
|
188 |
$('switcher').object.innerHTML = '<a href="#" onclick="setEditorText(); return false;">' + $lang.get('editor_btn_wikitext') + '</a> | ' + $lang.get('editor_btn_graphical'); |
1 | 189 |
} |
190 |
||
191 |
function setEditorText() |
|
192 |
{ |
|
193 |
$('ajaxEditArea').destroyMCE(); |
|
194 |
createCookie('enano_editor_mode', 'text', 365); |
|
213
1316404e4ea8
Localized history page and static HTML comment interface
Dan
parents:
211
diff
changeset
|
195 |
$('switcher').object.innerHTML = $lang.get('editor_btn_wikitext') + ' | <a href="#" onclick="setEditorMCE(); return false;">' + $lang.get('editor_btn_graphical') + '</a>'; |
1 | 196 |
} |
197 |
||
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
|
198 |
function ajaxViewSource() |
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
|
199 |
{ |
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
|
200 |
// IE <6 pseudo-compatibility |
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
|
201 |
if ( 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
|
202 |
return true; |
1 | 203 |
setAjaxLoading(); |
204 |
ajaxGet(stdAjaxPrefix+'&_mode=getsource', function() { |
|
205 |
if(ajax.readyState == 4) { |
|
206 |
unsetAjaxLoading(); |
|
214 | 207 |
edit_open = false; |
1 | 208 |
selectButtonMajor('article'); |
209 |
selectButtonMinor('edit'); |
|
210 |
if(in_array('ajaxEditArea', grippied_textareas)) |
|
211 |
{ |
|
212 |
// Allow the textarea grippifier to re-create the resizer control on the textarea |
|
213 |
grippied_textareas.pop(in_array('ajaxEditArea', grippied_textareas)); |
|
214 |
} |
|
215 |
document.getElementById('ajaxEditContainer').innerHTML = '\ |
|
216 |
<form method="get" action="#" onsubmit="ajaxSavePage(); return false;">\ |
|
217 |
<textarea readonly="readonly" id="ajaxEditArea" rows="20" cols="60" style="display: block; margin: 1em 0 1em 1em; width: 96.5%;">'+ajax.responseText+'</textarea><br />\ |
|
213
1316404e4ea8
Localized history page and static HTML comment interface
Dan
parents:
211
diff
changeset
|
218 |
<a href="#" onclick="void(ajaxReset()); return false;">' + $lang.get('editor_btn_closeviewer') + '</a>\ |
1 | 219 |
</form>'; |
220 |
initTextareas(); |
|
221 |
} |
|
222 |
}); |
|
223 |
} |
|
224 |
||
225 |
function ajaxShowPreview() |
|
226 |
{ |
|
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
|
227 |
// IE <6 pseudo-compatibility |
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
|
228 |
if ( 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
|
229 |
return true; |
1 | 230 |
goBusy('Loading preview...'); |
231 |
var text = ajaxEscape($('ajaxEditArea').getContent()); |
|
232 |
if(document.mdgAjaxEditor.minor.checked) minor='&minor'; |
|
233 |
else minor=''; |
|
234 |
ajaxPost(stdAjaxPrefix+'&_mode=preview', 'summary='+document.getElementById('ajaxEditSummary').value+minor+'&text='+text, function() { |
|
235 |
if(ajax.readyState == 4) { |
|
236 |
unBusy(); |
|
237 |
edit_open = false; |
|
238 |
document.getElementById('mdgPreviewContainer').innerHTML = ajax.responseText; |
|
239 |
} |
|
240 |
}); |
|
241 |
} |
|
242 |
||
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
|
243 |
function ajaxSavePage() |
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
|
244 |
{ |
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
|
245 |
// IE <6 pseudo-compatibility |
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
|
246 |
if ( 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
|
247 |
return true; |
78
4df25dfdde63
Modified Text_Wiki parser to fully support UTF-8 strings; several other UTF-8 fixes, international characters seem to work reasonably well now
Dan
parents:
76
diff
changeset
|
248 |
//goBusy('Saving page...'); |
1 | 249 |
var text = ajaxEscape($('ajaxEditArea').getContent()); |
250 |
if(document.mdgAjaxEditor.minor.checked) minor='&minor'; |
|
251 |
else minor=''; |
|
252 |
ajaxPost(stdAjaxPrefix+'&_mode=savepage', 'summary='+document.getElementById('ajaxEditSummary').value+minor+'&text='+text, function() { |
|
253 |
if(ajax.readyState == 4) { |
|
254 |
unBusy(); |
|
255 |
edit_open = false; |
|
256 |
document.getElementById('ajaxEditContainer').innerHTML = ajax.responseText; |
|
257 |
enableUnload(); |
|
258 |
unselectAllButtonsMinor(); |
|
259 |
} |
|
260 |
}); |
|
261 |
} |
|
262 |
||
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
|
263 |
function ajaxDiscard() |
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
|
264 |
{ |
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
|
265 |
// IE <6 pseudo-compatibility |
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
|
266 |
if ( 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
|
267 |
return true; |
213
1316404e4ea8
Localized history page and static HTML comment interface
Dan
parents:
211
diff
changeset
|
268 |
c = confirm($lang.get('editor_msg_discard_confirm')); |
1 | 269 |
if(!c) return; |
270 |
ajaxReset(); |
|
271 |
} |
|
272 |
||
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
|
273 |
function ajaxReset() |
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 |
{ |
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
|
275 |
// IE <6 pseudo-compatibility |
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
|
276 |
if ( 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
|
277 |
return true; |
221
e5302cb1945c
Localized a good part, if not all, of the registration page and a couple other things.
Dan
parents:
215
diff
changeset
|
278 |
var ns_id = strToPageID(title); |
e5302cb1945c
Localized a good part, if not all, of the registration page and a couple other things.
Dan
parents:
215
diff
changeset
|
279 |
if ( ns_id[1] == 'Special' || ns_id[1] == 'Admin' ) |
e5302cb1945c
Localized a good part, if not all, of the registration page and a couple other things.
Dan
parents:
215
diff
changeset
|
280 |
return false; |
1 | 281 |
enableUnload(); |
282 |
setAjaxLoading(); |
|
283 |
ajaxGet(stdAjaxPrefix+'&_mode=getpage&noheaders', function() { |
|
284 |
if(ajax.readyState == 4) { |
|
285 |
unsetAjaxLoading(); |
|
286 |
edit_open = false; |
|
287 |
document.getElementById('ajaxEditContainer').innerHTML = ajax.responseText; |
|
288 |
selectButtonMajor('article'); |
|
289 |
unselectAllButtonsMinor(); |
|
290 |
} |
|
291 |
}); |
|
292 |
} |
|
293 |
||
294 |
// Miscellaneous AJAX applets |
|
295 |
||
296 |
function ajaxProtect(l) { |
|
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
|
297 |
// IE <6 pseudo-compatibility |
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
|
298 |
if ( 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
|
299 |
return true; |
1 | 300 |
if(shift) { |
301 |
r = 'NO_REASON'; |
|
302 |
} else { |
|
214 | 303 |
r = prompt($lang.get('ajax_protect_prompt_reason')); |
1 | 304 |
if(!r || r=='') return; |
305 |
} |
|
306 |
setAjaxLoading(); |
|
307 |
document.getElementById('protbtn_0').style.textDecoration = 'none'; |
|
308 |
document.getElementById('protbtn_1').style.textDecoration = 'none'; |
|
309 |
document.getElementById('protbtn_2').style.textDecoration = 'none'; |
|
310 |
document.getElementById('protbtn_'+l).style.textDecoration = 'underline'; |
|
298
39c132e69781
Hopefully now all calls to escape() are replaced with ajaxEscape() in response to Tomasz's forum post; remove deprecated version of show_category_info() from functions.php
Dan
parents:
175
diff
changeset
|
311 |
ajaxPost(stdAjaxPrefix+'&_mode=protect', 'reason='+ajaxEscape(r)+'&level='+l, function() { |
1 | 312 |
if(ajax.readyState == 4) { |
313 |
unsetAjaxLoading(); |
|
314 |
if(ajax.responseText != 'good') |
|
315 |
alert(ajax.responseText); |
|
316 |
} |
|
317 |
}); |
|
318 |
} |
|
319 |
||
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
|
320 |
function ajaxRename() |
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
|
321 |
{ |
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
|
322 |
// IE <6 pseudo-compatibility |
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
|
323 |
if ( 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
|
324 |
return true; |
214 | 325 |
r = prompt($lang.get('ajax_rename_prompt')); |
1 | 326 |
if(!r || r=='') return; |
327 |
setAjaxLoading(); |
|
298
39c132e69781
Hopefully now all calls to escape() are replaced with ajaxEscape() in response to Tomasz's forum post; remove deprecated version of show_category_info() from functions.php
Dan
parents:
175
diff
changeset
|
328 |
ajaxPost(stdAjaxPrefix+'&_mode=rename', 'newtitle='+ajaxEscape(r), function() { |
1 | 329 |
if(ajax.readyState == 4) { |
330 |
unsetAjaxLoading(); |
|
331 |
alert(ajax.responseText); |
|
332 |
} |
|
333 |
}); |
|
334 |
} |
|
335 |
||
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
|
336 |
function ajaxMakePage() |
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
|
337 |
{ |
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
|
338 |
// IE <6 pseudo-compatibility |
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
|
339 |
if ( 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
|
340 |
return true; |
1 | 341 |
setAjaxLoading(); |
342 |
ajaxPost(ENANO_SPECIAL_CREATEPAGE, ENANO_CREATEPAGE_PARAMS, function() { |
|
343 |
if(ajax.readyState == 4) { |
|
344 |
unsetAjaxLoading(); |
|
345 |
window.location.reload(); |
|
346 |
} |
|
347 |
}); |
|
348 |
} |
|
349 |
||
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
|
350 |
function ajaxDeletePage() |
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
|
351 |
{ |
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
|
352 |
// IE <6 pseudo-compatibility |
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
|
353 |
if ( 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
|
354 |
return true; |
214 | 355 |
var reason = prompt($lang.get('ajax_delete_prompt_reason')); |
28 | 356 |
if ( !reason || reason == '' ) |
357 |
{ |
|
358 |
return false; |
|
359 |
} |
|
214 | 360 |
c = confirm($lang.get('ajax_delete_confirm')); |
28 | 361 |
if(!c) |
362 |
{ |
|
363 |
return; |
|
364 |
} |
|
1 | 365 |
setAjaxLoading(); |
298
39c132e69781
Hopefully now all calls to escape() are replaced with ajaxEscape() in response to Tomasz's forum post; remove deprecated version of show_category_info() from functions.php
Dan
parents:
175
diff
changeset
|
366 |
ajaxPost(stdAjaxPrefix+'&_mode=deletepage', 'reason=' + ajaxEscape(reason), function() { |
1 | 367 |
if(ajax.readyState == 4) { |
368 |
unsetAjaxLoading(); |
|
369 |
alert(ajax.responseText); |
|
370 |
window.location.reload(); |
|
371 |
} |
|
372 |
}); |
|
373 |
} |
|
374 |
||
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
|
375 |
function ajaxDelVote() |
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
|
376 |
{ |
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
|
377 |
// IE <6 pseudo-compatibility |
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
|
378 |
if ( 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
|
379 |
return true; |
214 | 380 |
c = confirm($lang.get('ajax_delvote_confirm')); |
1 | 381 |
if(!c) return; |
382 |
setAjaxLoading(); |
|
383 |
ajaxGet(stdAjaxPrefix+'&_mode=delvote', function() { |
|
384 |
if(ajax.readyState == 4) { |
|
385 |
unsetAjaxLoading(); |
|
386 |
alert(ajax.responseText); |
|
387 |
} |
|
388 |
}); |
|
389 |
} |
|
390 |
||
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
|
391 |
function ajaxResetDelVotes() |
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
|
392 |
{ |
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
|
393 |
// IE <6 pseudo-compatibility |
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
|
394 |
if ( 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
|
395 |
return true; |
214 | 396 |
c = confirm($lang.get('ajax_delvote_reset_confirm')); |
1 | 397 |
if(!c) return; |
398 |
setAjaxLoading(); |
|
399 |
ajaxGet(stdAjaxPrefix+'&_mode=resetdelvotes', function() { |
|
400 |
if(ajax.readyState == 4) { |
|
401 |
unsetAjaxLoading(); |
|
402 |
alert(ajax.responseText); |
|
403 |
item = document.getElementById('mdgDeleteVoteNoticeBox'); |
|
404 |
if(item) |
|
405 |
{ |
|
406 |
opacity('mdgDeleteVoteNoticeBox', 100, 0, 1000); |
|
407 |
setTimeout("document.getElementById('mdgDeleteVoteNoticeBox').style.display = 'none';", 1000); |
|
408 |
} |
|
409 |
} |
|
410 |
}); |
|
411 |
} |
|
412 |
||
413 |
function ajaxSetWikiMode(val) { |
|
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
|
414 |
// IE <6 pseudo-compatibility |
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
|
415 |
if ( 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
|
416 |
return true; |
1 | 417 |
setAjaxLoading(); |
418 |
document.getElementById('wikibtn_0').style.textDecoration = 'none'; |
|
419 |
document.getElementById('wikibtn_1').style.textDecoration = 'none'; |
|
420 |
document.getElementById('wikibtn_2').style.textDecoration = 'none'; |
|
421 |
document.getElementById('wikibtn_'+val).style.textDecoration = 'underline'; |
|
422 |
ajaxGet(stdAjaxPrefix+'&_mode=setwikimode&mode='+val, function() { |
|
423 |
if(ajax.readyState == 4) { |
|
424 |
unsetAjaxLoading(); |
|
425 |
if(ajax.responseText!='GOOD') |
|
426 |
{ |
|
427 |
alert(ajax.responseText); |
|
428 |
} |
|
429 |
} |
|
430 |
}); |
|
431 |
} |
|
432 |
||
433 |
// Editing/saving category information |
|
434 |
// This was not easy to write, I hope enjoy it, and dang I swear I'm gonna |
|
435 |
// find someone to work on just the Javascript part of Enano... |
|
436 |
||
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
|
437 |
function ajaxCatEdit() |
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
|
438 |
{ |
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
|
439 |
// IE <6 pseudo-compatibility |
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
|
440 |
if ( 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
|
441 |
return true; |
1 | 442 |
setAjaxLoading(); |
443 |
ajaxGet(stdAjaxPrefix+'&_mode=catedit', function() { |
|
444 |
if(ajax.readyState == 4) { |
|
445 |
unsetAjaxLoading(); |
|
446 |
edit_open = false; |
|
447 |
eval(ajax.responseText); |
|
448 |
} |
|
449 |
}); |
|
450 |
} |
|
451 |
||
452 |
function ajaxCatSave() |
|
453 |
{ |
|
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
|
454 |
// IE <6 pseudo-compatibility |
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
|
455 |
if ( 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
|
456 |
return true; |
1 | 457 |
if(!catlist) |
458 |
{ |
|
459 |
alert('Var catlist has no properties'); |
|
460 |
return; |
|
461 |
} |
|
462 |
query=''; |
|
463 |
for(i=0;i<catlist.length;i++) |
|
464 |
{ |
|
465 |
l = 'if(document.forms.mdgCatForm.mdgCat_'+catlist[i]+'.checked) s = true; else s = false;'; |
|
466 |
eval(l); |
|
467 |
if(s) query = query + '&' + catlist[i] + '=true'; |
|
468 |
} |
|
469 |
setAjaxLoading(); |
|
470 |
query = query.substring(1, query.length); |
|
471 |
ajaxPost(stdAjaxPrefix+'&_mode=catsave', query, function() { |
|
472 |
if(ajax.readyState == 4) { |
|
473 |
unsetAjaxLoading(); |
|
474 |
edit_open = false; |
|
475 |
if(ajax.responseText != 'GOOD') alert(ajax.responseText); |
|
476 |
ajaxReset(); |
|
477 |
} |
|
478 |
}); |
|
479 |
} |
|
480 |
||
481 |
// History stuff |
|
482 |
||
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
|
483 |
function ajaxHistory() |
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
|
484 |
{ |
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
|
485 |
// IE <6 pseudo-compatibility |
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
|
486 |
if ( 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
|
487 |
return true; |
1 | 488 |
setAjaxLoading(); |
489 |
ajaxGet(stdAjaxPrefix+'&_mode=histlist', function() { |
|
490 |
if(ajax.readyState == 4) { |
|
491 |
unsetAjaxLoading(); |
|
492 |
edit_open = false; |
|
493 |
selectButtonMajor('article'); |
|
494 |
selectButtonMinor('history'); |
|
495 |
document.getElementById('ajaxEditContainer').innerHTML = ajax.responseText; |
|
496 |
buildDiffList(); |
|
497 |
} |
|
498 |
}); |
|
499 |
} |
|
500 |
||
501 |
function ajaxHistView(oldid, tit) { |
|
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
|
502 |
// IE <6 pseudo-compatibility |
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
|
503 |
if ( 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
|
504 |
return true; |
1 | 505 |
if(!tit) tit=title; |
506 |
setAjaxLoading(); |
|
507 |
ajaxGet(append_sid(scriptPath+'/ajax.php?title='+tit+'&_mode=getpage&oldid='+oldid), function() { |
|
508 |
if(ajax.readyState == 4) { |
|
509 |
unsetAjaxLoading(); |
|
510 |
edit_open = false; |
|
511 |
document.getElementById('ajaxEditContainer').innerHTML = ajax.responseText; |
|
512 |
} |
|
513 |
}); |
|
514 |
} |
|
515 |
||
516 |
function ajaxRollback(id) { |
|
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
|
517 |
// IE <6 pseudo-compatibility |
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
|
518 |
if ( 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
|
519 |
return true; |
1 | 520 |
setAjaxLoading(); |
521 |
ajaxGet(stdAjaxPrefix+'&_mode=rollback&id='+id, function() { |
|
522 |
if(ajax.readyState == 4) { |
|
523 |
unsetAjaxLoading(); |
|
524 |
alert(ajax.responseText); |
|
525 |
} |
|
526 |
}); |
|
527 |
} |
|
528 |
||
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
|
529 |
function ajaxClearLogs() |
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
|
530 |
{ |
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
|
531 |
// IE <6 pseudo-compatibility |
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
|
532 |
if ( 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
|
533 |
return true; |
214 | 534 |
c = confirm($lang.get('ajax_clearlogs_confirm')); |
1 | 535 |
if(!c) return; |
214 | 536 |
c = confirm($lang.get('ajax_clearlogs_confirm_nag')); |
1 | 537 |
if(!c) return; |
538 |
setAjaxLoading(); |
|
539 |
ajaxGet(stdAjaxPrefix+'&_mode=flushlogs', function() { |
|
540 |
if(ajax.readyState == 4) { |
|
541 |
unsetAjaxLoading(); |
|
542 |
alert(ajax.responseText); |
|
543 |
window.location.reload(); |
|
544 |
} |
|
545 |
}); |
|
546 |
} |
|
547 |
||
548 |
var timelist; |
|
549 |
||
550 |
function buildDiffList() |
|
551 |
{ |
|
552 |
arrDiff1Buttons = getElementsByClassName(document, 'input', 'clsDiff1Radio'); |
|
553 |
arrDiff2Buttons = getElementsByClassName(document, 'input', 'clsDiff2Radio'); |
|
554 |
var len = arrDiff1Buttons.length; |
|
555 |
if ( len < 1 ) |
|
556 |
return false; |
|
557 |
timelist = new Array(); |
|
558 |
for ( var i = 0; i < len; i++ ) |
|
559 |
{ |
|
560 |
timelist.push( arrDiff2Buttons[i].id.substr(6) ); |
|
561 |
} |
|
562 |
timelist.push( arrDiff1Buttons[len-1].id.substr(6) ); |
|
563 |
delete(timelist.toJSONString); |
|
564 |
for ( var i = 1; i < timelist.length-1; i++ ) |
|
565 |
{ |
|
566 |
if ( i >= timelist.length ) break; |
|
567 |
arrDiff2Buttons[i].style.display = 'none'; |
|
568 |
} |
|
569 |
} |
|
570 |
||
571 |
function selectDiff1Button(obj) |
|
572 |
{ |
|
573 |
var this_time = obj.id.substr(6); |
|
574 |
var index = parseInt(in_array(this_time, timelist)); |
|
575 |
for ( var i = 0; i < timelist.length - 1; i++ ) |
|
576 |
{ |
|
577 |
if ( i < timelist.length - 1 ) |
|
578 |
{ |
|
579 |
var state = ( i < index ) ? 'inline' : 'none'; |
|
580 |
var id = 'diff2_' + timelist[i]; |
|
581 |
document.getElementById(id).style.display = state; |
|
582 |
||
583 |
// alert("Debug:\nIndex: "+index+"\nState: "+state+"\ni: "+i); |
|
584 |
} |
|
585 |
} |
|
586 |
} |
|
587 |
||
588 |
function selectDiff2Button(obj) |
|
589 |
{ |
|
590 |
var this_time = obj.id.substr(6); |
|
591 |
var index = parseInt(in_array(this_time, timelist)); |
|
592 |
for ( var i = 1; i < timelist.length; i++ ) |
|
593 |
{ |
|
594 |
if ( i < timelist.length - 1 ) |
|
595 |
{ |
|
596 |
var state = ( i > index ) ? 'inline' : 'none'; |
|
597 |
var id = 'diff1_' + timelist[i]; |
|
598 |
document.getElementById(id).style.display = state; |
|
599 |
||
600 |
// alert("Debug:\nIndex: "+index+"\nState: "+state+"\ni: "+i); |
|
601 |
} |
|
602 |
} |
|
603 |
} |
|
604 |
||
605 |
function ajaxHistDiff() |
|
606 |
{ |
|
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
|
607 |
// IE <6 pseudo-compatibility |
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
|
608 |
if ( 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
|
609 |
return true; |
1 | 610 |
var id1=false; |
611 |
var id2=false; |
|
612 |
for ( i = 0; i < arrDiff1Buttons.length; i++ ) |
|
613 |
{ |
|
614 |
k = i + ''; |
|
615 |
kpp = i + 1; |
|
616 |
kpp = kpp + ''; |
|
617 |
if(arrDiff1Buttons[k].checked) id1 = arrDiff1Buttons[k].id.substr(6); |
|
618 |
if(arrDiff2Buttons[k].checked) id2 = arrDiff2Buttons[k].id.substr(6); |
|
619 |
} |
|
620 |
if(!id1 || !id2) { alert('BUG: Couldn\'t get checked radiobutton state'); return; } |
|
621 |
setAjaxLoading(); |
|
622 |
ajaxGet(stdAjaxPrefix+'&_mode=pagediff&diff1='+id1+'&diff2='+id2, function() |
|
623 |
{ |
|
624 |
if(ajax.readyState==4) |
|
625 |
{ |
|
626 |
unsetAjaxLoading(); |
|
627 |
document.getElementById('ajaxEditContainer').innerHTML = ajax.responseText; |
|
628 |
} |
|
629 |
}); |
|
630 |
} |
|
631 |
||
632 |
// Change the user's preferred style/theme |
|
633 |
||
634 |
function ajaxChangeStyle() |
|
635 |
{ |
|
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
|
636 |
// IE <6 pseudo-compatibility |
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
|
637 |
if ( 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
|
638 |
return true; |
15
ad5986a53197
Fixed complicated SQL injection vulnerability in URL handler, updated license info for Tigra Tree Menu, and killed one XSS vulnerability
Dan
parents:
11
diff
changeset
|
639 |
var inner_html = ''; |
215 | 640 |
inner_html += '<p><label>' + $lang.get('ajax_changestyle_lbl_theme') + ' '; |
29
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
641 |
inner_html += ' <select id="chtheme_sel_theme" onchange="ajaxGetStyles(this.value);">'; |
214 | 642 |
inner_html += ' <option value="_blank" selected="selected">' + $lang.get('ajax_changestyle_select') + '</option>'; |
29
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
643 |
inner_html += ENANO_THEME_LIST; |
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
644 |
inner_html += ' </select>'; |
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
645 |
inner_html += '</label></p>'; |
214 | 646 |
var chtheme_mb = new messagebox(MB_OKCANCEL|MB_ICONQUESTION, $lang.get('ajax_changestyle_title'), inner_html); |
29
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
647 |
chtheme_mb.onbeforeclick['OK'] = ajaxChangeStyleComplete; |
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
648 |
} |
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
649 |
|
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
650 |
function ajaxGetStyles(id) |
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
651 |
{ |
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
|
652 |
// IE <6 pseudo-compatibility |
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
|
653 |
if ( 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
|
654 |
return true; |
29
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
655 |
var thediv = document.getElementById('chtheme_sel_style_parent'); |
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
656 |
if ( thediv ) |
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
657 |
{ |
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
658 |
thediv.parentNode.removeChild(thediv); |
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
659 |
} |
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
660 |
if ( id == '_blank' ) |
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
661 |
{ |
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
662 |
return null; |
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
663 |
} |
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
664 |
ajaxGet(stdAjaxPrefix + '&_mode=getstyles&id=' + id, function() { |
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
665 |
if ( ajax.readyState == 4 ) |
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
666 |
{ |
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
667 |
// IE doesn't like substr() on ajax.responseText |
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
668 |
var response = String(ajax.responseText + ' '); |
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
669 |
response = response.substr(0, response.length - 1); |
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
670 |
if ( response.substr(0,1) != '[' ) |
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
671 |
{ |
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
672 |
alert('Invalid or unexpected JSON response from server:\n' + response); |
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
673 |
return null; |
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
674 |
} |
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
675 |
|
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
676 |
// Build a selector and matching label |
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
677 |
var data = parseJSON(response); |
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
678 |
var options = new Array(); |
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
679 |
for( var i in data ) |
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
680 |
{ |
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
681 |
var item = data[i]; |
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
682 |
var title = themeid_to_title(item); |
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
683 |
var option = document.createElement('option'); |
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
684 |
option.value = item; |
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
685 |
option.appendChild(document.createTextNode(title)); |
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
686 |
options.push(option); |
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
687 |
} |
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
688 |
var p_parent = document.createElement('p'); |
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
689 |
var label = document.createElement('label'); |
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
690 |
p_parent.id = 'chtheme_sel_style_parent'; |
215 | 691 |
label.appendChild(document.createTextNode($lang.get('ajax_changestyle_lbl_style') + ' ')); |
29
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
692 |
var select = document.createElement('select'); |
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
693 |
select.id = 'chtheme_sel_style'; |
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
694 |
for ( var i in options ) |
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
695 |
{ |
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
696 |
select.appendChild(options[i]); |
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
697 |
} |
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
698 |
label.appendChild(select); |
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
699 |
p_parent.appendChild(label); |
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
700 |
|
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
701 |
// Stick it onto the messagebox |
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
702 |
var div = document.getElementById('messageBox'); |
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
703 |
var kid = div.firstChild.nextSibling; |
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
704 |
|
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
705 |
kid.appendChild(p_parent); |
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
706 |
|
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
707 |
} |
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
708 |
}); |
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
709 |
} |
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
710 |
|
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
711 |
function ajaxChangeStyleComplete() |
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
712 |
{ |
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
|
713 |
// IE <6 pseudo-compatibility |
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
|
714 |
if ( 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
|
715 |
return true; |
29
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
716 |
var theme = $('chtheme_sel_theme'); |
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
717 |
var style = $('chtheme_sel_style'); |
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
718 |
if ( !theme.object || !style.object ) |
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
719 |
{ |
214 | 720 |
alert($lang.get('ajax_changestyle_pleaseselect_theme')); |
29
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
721 |
return true; |
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
722 |
} |
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
723 |
var theme_id = theme.object.value; |
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
724 |
var style_id = style.object.value; |
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
725 |
|
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
726 |
if ( typeof(theme_id) != 'string' || typeof(style_id) != 'string' ) |
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
727 |
{ |
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
728 |
alert('Couldn\'t get theme or style ID'); |
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
729 |
return true; |
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
730 |
} |
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
731 |
|
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
732 |
if ( theme_id.length < 1 || style_id.length < 1 ) |
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
733 |
{ |
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
734 |
alert('Theme or style ID is zero length'); |
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
735 |
return true; |
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
736 |
} |
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
737 |
|
298
39c132e69781
Hopefully now all calls to escape() are replaced with ajaxEscape() in response to Tomasz's forum post; remove deprecated version of show_category_info() from functions.php
Dan
parents:
175
diff
changeset
|
738 |
ajaxPost(stdAjaxPrefix + '&_mode=change_theme', 'theme_id=' + ajaxEscape(theme_id) + '&style_id=' + ajaxEscape(style_id), function() |
29
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
739 |
{ |
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
740 |
if ( ajax.readyState == 4 ) |
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
741 |
{ |
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
742 |
if ( ajax.responseText == 'GOOD' ) |
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
743 |
{ |
214 | 744 |
var c = confirm($lang.get('ajax_changestyle_success')); |
29
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
745 |
if ( c ) |
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
746 |
window.location.reload(); |
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
747 |
} |
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
748 |
else |
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
749 |
{ |
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
750 |
alert('Error occurred during attempt to change theme:\n' + ajax.responseText); |
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
751 |
} |
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
752 |
} |
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
753 |
}); |
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
754 |
|
30 | 755 |
return false; |
29
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
756 |
|
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
757 |
} |
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
758 |
|
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
759 |
function themeid_to_title(id) |
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
760 |
{ |
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
761 |
if ( typeof(id) != 'string' ) |
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
762 |
return false; |
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
763 |
id = id.substr(0, 1).toUpperCase() + id.substr(1); |
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
764 |
id = id.replace(/_/g, ' '); |
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
765 |
id = id.replace(/-/g, ' '); |
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
766 |
return id; |
15
ad5986a53197
Fixed complicated SQL injection vulnerability in URL handler, updated license info for Tigra Tree Menu, and killed one XSS vulnerability
Dan
parents:
11
diff
changeset
|
767 |
} |
ad5986a53197
Fixed complicated SQL injection vulnerability in URL handler, updated license info for Tigra Tree Menu, and killed one XSS vulnerability
Dan
parents:
11
diff
changeset
|
768 |
|
ad5986a53197
Fixed complicated SQL injection vulnerability in URL handler, updated license info for Tigra Tree Menu, and killed one XSS vulnerability
Dan
parents:
11
diff
changeset
|
769 |
/* |
ad5986a53197
Fixed complicated SQL injection vulnerability in URL handler, updated license info for Tigra Tree Menu, and killed one XSS vulnerability
Dan
parents:
11
diff
changeset
|
770 |
function ajaxChangeStyle() |
ad5986a53197
Fixed complicated SQL injection vulnerability in URL handler, updated license info for Tigra Tree Menu, and killed one XSS vulnerability
Dan
parents:
11
diff
changeset
|
771 |
{ |
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
|
772 |
// IE <6 pseudo-compatibility |
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
|
773 |
if ( 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
|
774 |
return true; |
1 | 775 |
var win = document.getElementById("cn2"); |
776 |
win.innerHTML = ' \ |
|
777 |
<form action="'+ENANO_SPECIAL_CHANGESTYLE+'" onsubmit="jws.closeWin(\'root2\');" method="post" style="text-align: center"> \ |
|
778 |
<h3>Select a theme...</h3>\ |
|
779 |
<select id="mdgThemeID" name="theme" onchange="ajaxGetStyles(this.value);"> \ |
|
780 |
'+ENANO_THEME_LIST+' \ |
|
781 |
</select> \ |
|
782 |
<div id="styleSelector"></div>\ |
|
783 |
<br /><br />\ |
|
784 |
<input type="hidden" name="return_to" value="'+title+'" />\ |
|
785 |
<input id="styleSubmitter" type="submit" style="display: none; font-weight: bold" value="Change theme" /> \ |
|
786 |
<input type="button" value="Cancel" onclick="jws.closeWin(\'root2\');" /> \ |
|
787 |
</form> \ |
|
788 |
'; |
|
789 |
ajaxGetStyles(ENANO_CURRENT_THEME); |
|
790 |
jws.openWin('root2', 340, 300); |
|
791 |
} |
|
792 |
||
793 |
function ajaxGetStyles(id) { |
|
794 |
setAjaxLoading(); |
|
795 |
ajaxGet(stdAjaxPrefix+'&_mode=getstyles&id='+id, function() { |
|
796 |
if(ajax.readyState == 4) { |
|
797 |
unsetAjaxLoading(); |
|
798 |
eval(ajax.responseText); |
|
799 |
html = '<h3>And a style...</h3><select id="mdgStyleID" name="style">'; |
|
800 |
for(i=0;i<list.length;i++) { |
|
801 |
lname = list[i].substr(0, 1).toUpperCase() + list[i].substr(1, list[i].length); |
|
802 |
html = html + '<option value="'+list[i]+'">'+lname+'</option>'; |
|
803 |
} |
|
804 |
html = html + '</select>'; |
|
805 |
document.getElementById('styleSelector').innerHTML = html; |
|
806 |
document.getElementById('styleSubmitter').style.display = 'inline'; |
|
807 |
} |
|
808 |
}); |
|
809 |
} |
|
15
ad5986a53197
Fixed complicated SQL injection vulnerability in URL handler, updated license info for Tigra Tree Menu, and killed one XSS vulnerability
Dan
parents:
11
diff
changeset
|
810 |
*/ |
1 | 811 |
|
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
|
812 |
function ajaxSwapCSS() |
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
|
813 |
{ |
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
|
814 |
// IE <6 pseudo-compatibility |
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
|
815 |
if ( 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
|
816 |
return true; |
1 | 817 |
setAjaxLoading(); |
818 |
if(_css) { |
|
819 |
document.getElementById('mdgCss').href = main_css; |
|
820 |
_css = false; |
|
821 |
} else { |
|
822 |
document.getElementById('mdgCss').href = print_css; |
|
823 |
_css = true; |
|
824 |
} |
|
825 |
unsetAjaxLoading(); |
|
826 |
menuOff(); |
|
827 |
} |
|
828 |
||
829 |
function ajaxSetPassword() |
|
830 |
{ |
|
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
|
831 |
// IE <6 pseudo-compatibility |
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
|
832 |
if ( 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
|
833 |
return true; |
1 | 834 |
pass = hex_sha1(document.getElementById('mdgPassSetField').value); |
835 |
setAjaxLoading(); |
|
836 |
ajaxPost(stdAjaxPrefix+'&_mode=setpass', 'password='+pass, function() |
|
837 |
{ |
|
838 |
unsetAjaxLoading(); |
|
839 |
if(ajax.readyState==4) |
|
840 |
{ |
|
841 |
alert(ajax.responseText); |
|
842 |
} |
|
843 |
} |
|
844 |
); |
|
845 |
} |
|
846 |
||
847 |
function ajaxStartLogin() |
|
848 |
{ |
|
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
|
849 |
// IE <6 pseudo-compatibility |
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
|
850 |
if ( 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
|
851 |
return true; |
1 | 852 |
ajaxPromptAdminAuth(function(k) { |
853 |
window.location.reload(); |
|
60
71b50f8c8f85
Changed administration login request to use the AJAX login form; made high-level authentication more apparent in the AJAX box; recompiled Oxygen Mint
Dan
parents:
57
diff
changeset
|
854 |
}, USER_LEVEL_MEMBER); |
71b50f8c8f85
Changed administration login request to use the AJAX login form; made high-level authentication more apparent in the AJAX box; recompiled Oxygen Mint
Dan
parents:
57
diff
changeset
|
855 |
} |
71b50f8c8f85
Changed administration login request to use the AJAX login form; made high-level authentication more apparent in the AJAX box; recompiled Oxygen Mint
Dan
parents:
57
diff
changeset
|
856 |
|
71b50f8c8f85
Changed administration login request to use the AJAX login form; made high-level authentication more apparent in the AJAX box; recompiled Oxygen Mint
Dan
parents:
57
diff
changeset
|
857 |
function ajaxStartAdminLogin() |
71b50f8c8f85
Changed administration login request to use the AJAX login form; made high-level authentication more apparent in the AJAX box; recompiled Oxygen Mint
Dan
parents:
57
diff
changeset
|
858 |
{ |
71b50f8c8f85
Changed administration login request to use the AJAX login form; made high-level authentication more apparent in the AJAX box; recompiled Oxygen Mint
Dan
parents:
57
diff
changeset
|
859 |
// IE <6 pseudo-compatibility |
71b50f8c8f85
Changed administration login request to use the AJAX login form; made high-level authentication more apparent in the AJAX box; recompiled Oxygen Mint
Dan
parents:
57
diff
changeset
|
860 |
if ( KILL_SWITCH ) |
71b50f8c8f85
Changed administration login request to use the AJAX login form; made high-level authentication more apparent in the AJAX box; recompiled Oxygen Mint
Dan
parents:
57
diff
changeset
|
861 |
return true; |
71b50f8c8f85
Changed administration login request to use the AJAX login form; made high-level authentication more apparent in the AJAX box; recompiled Oxygen Mint
Dan
parents:
57
diff
changeset
|
862 |
if ( auth_level < USER_LEVEL_ADMIN ) |
71b50f8c8f85
Changed administration login request to use the AJAX login form; made high-level authentication more apparent in the AJAX box; recompiled Oxygen Mint
Dan
parents:
57
diff
changeset
|
863 |
{ |
71b50f8c8f85
Changed administration login request to use the AJAX login form; made high-level authentication more apparent in the AJAX box; recompiled Oxygen Mint
Dan
parents:
57
diff
changeset
|
864 |
ajaxPromptAdminAuth(function(k) { |
71b50f8c8f85
Changed administration login request to use the AJAX login form; made high-level authentication more apparent in the AJAX box; recompiled Oxygen Mint
Dan
parents:
57
diff
changeset
|
865 |
ENANO_SID = k; |
71b50f8c8f85
Changed administration login request to use the AJAX login form; made high-level authentication more apparent in the AJAX box; recompiled Oxygen Mint
Dan
parents:
57
diff
changeset
|
866 |
auth_level = USER_LEVEL_ADMIN; |
71b50f8c8f85
Changed administration login request to use the AJAX login form; made high-level authentication more apparent in the AJAX box; recompiled Oxygen Mint
Dan
parents:
57
diff
changeset
|
867 |
var loc = makeUrlNS('Special', 'Administration'); |
71b50f8c8f85
Changed administration login request to use the AJAX login form; made high-level authentication more apparent in the AJAX box; recompiled Oxygen Mint
Dan
parents:
57
diff
changeset
|
868 |
if ( (ENANO_SID + ' ').length > 1 ) |
71b50f8c8f85
Changed administration login request to use the AJAX login form; made high-level authentication more apparent in the AJAX box; recompiled Oxygen Mint
Dan
parents:
57
diff
changeset
|
869 |
window.location = loc; |
71b50f8c8f85
Changed administration login request to use the AJAX login form; made high-level authentication more apparent in the AJAX box; recompiled Oxygen Mint
Dan
parents:
57
diff
changeset
|
870 |
}, USER_LEVEL_ADMIN); |
71b50f8c8f85
Changed administration login request to use the AJAX login form; made high-level authentication more apparent in the AJAX box; recompiled Oxygen Mint
Dan
parents:
57
diff
changeset
|
871 |
return false; |
71b50f8c8f85
Changed administration login request to use the AJAX login form; made high-level authentication more apparent in the AJAX box; recompiled Oxygen Mint
Dan
parents:
57
diff
changeset
|
872 |
} |
71b50f8c8f85
Changed administration login request to use the AJAX login form; made high-level authentication more apparent in the AJAX box; recompiled Oxygen Mint
Dan
parents:
57
diff
changeset
|
873 |
var loc = makeUrlNS('Special', 'Administration'); |
71b50f8c8f85
Changed administration login request to use the AJAX login form; made high-level authentication more apparent in the AJAX box; recompiled Oxygen Mint
Dan
parents:
57
diff
changeset
|
874 |
window.location = loc; |
1 | 875 |
} |
876 |
||
877 |
function ajaxAdminPage() |
|
878 |
{ |
|
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
|
879 |
// IE <6 pseudo-compatibility |
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
|
880 |
if ( 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
|
881 |
return true; |
1 | 882 |
if ( auth_level < USER_LEVEL_ADMIN ) |
883 |
{ |
|
884 |
ajaxPromptAdminAuth(function(k) { |
|
885 |
ENANO_SID = k; |
|
886 |
auth_level = USER_LEVEL_ADMIN; |
|
887 |
var loc = String(window.location + ''); |
|
888 |
window.location = append_sid(loc); |
|
889 |
var loc = makeUrlNS('Special', 'Administration', 'module=' + namespace_list['Admin'] + 'PageManager&source=ajax&page_id=' + ajaxEscape(title)); |
|
890 |
if ( (ENANO_SID + ' ').length > 1 ) |
|
891 |
window.location = loc; |
|
892 |
}, 9); |
|
893 |
return false; |
|
894 |
} |
|
895 |
var loc = makeUrlNS('Special', 'Administration', 'module=' + namespace_list['Admin'] + 'PageManager&source=ajax&page_id=' + ajaxEscape(title)); |
|
896 |
window.location = loc; |
|
897 |
} |
|
898 |
||
175
1465f48faba0
AJAX login box is now used in userprefs panel; Spry shake effect and general UX on auth fail is smoother now; added ajaxLoginNavTo() JS function
Dan
parents:
170
diff
changeset
|
899 |
var navto_ns; |
1465f48faba0
AJAX login box is now used in userprefs panel; Spry shake effect and general UX on auth fail is smoother now; added ajaxLoginNavTo() JS function
Dan
parents:
170
diff
changeset
|
900 |
var navto_pg; |
1465f48faba0
AJAX login box is now used in userprefs panel; Spry shake effect and general UX on auth fail is smoother now; added ajaxLoginNavTo() JS function
Dan
parents:
170
diff
changeset
|
901 |
var navto_ul; |
1465f48faba0
AJAX login box is now used in userprefs panel; Spry shake effect and general UX on auth fail is smoother now; added ajaxLoginNavTo() JS function
Dan
parents:
170
diff
changeset
|
902 |
|
1465f48faba0
AJAX login box is now used in userprefs panel; Spry shake effect and general UX on auth fail is smoother now; added ajaxLoginNavTo() JS function
Dan
parents:
170
diff
changeset
|
903 |
function ajaxLoginNavTo(namespace, page_id, min_level) |
1465f48faba0
AJAX login box is now used in userprefs panel; Spry shake effect and general UX on auth fail is smoother now; added ajaxLoginNavTo() JS function
Dan
parents:
170
diff
changeset
|
904 |
{ |
1465f48faba0
AJAX login box is now used in userprefs panel; Spry shake effect and general UX on auth fail is smoother now; added ajaxLoginNavTo() JS function
Dan
parents:
170
diff
changeset
|
905 |
// IE <6 pseudo-compatibility |
1465f48faba0
AJAX login box is now used in userprefs panel; Spry shake effect and general UX on auth fail is smoother now; added ajaxLoginNavTo() JS function
Dan
parents:
170
diff
changeset
|
906 |
if ( KILL_SWITCH ) |
1465f48faba0
AJAX login box is now used in userprefs panel; Spry shake effect and general UX on auth fail is smoother now; added ajaxLoginNavTo() JS function
Dan
parents:
170
diff
changeset
|
907 |
return true; |
1465f48faba0
AJAX login box is now used in userprefs panel; Spry shake effect and general UX on auth fail is smoother now; added ajaxLoginNavTo() JS function
Dan
parents:
170
diff
changeset
|
908 |
navto_pg = page_id; |
1465f48faba0
AJAX login box is now used in userprefs panel; Spry shake effect and general UX on auth fail is smoother now; added ajaxLoginNavTo() JS function
Dan
parents:
170
diff
changeset
|
909 |
navto_ns = namespace; |
1465f48faba0
AJAX login box is now used in userprefs panel; Spry shake effect and general UX on auth fail is smoother now; added ajaxLoginNavTo() JS function
Dan
parents:
170
diff
changeset
|
910 |
navto_ul = min_level; |
1465f48faba0
AJAX login box is now used in userprefs panel; Spry shake effect and general UX on auth fail is smoother now; added ajaxLoginNavTo() JS function
Dan
parents:
170
diff
changeset
|
911 |
if ( auth_level < min_level ) |
1465f48faba0
AJAX login box is now used in userprefs panel; Spry shake effect and general UX on auth fail is smoother now; added ajaxLoginNavTo() JS function
Dan
parents:
170
diff
changeset
|
912 |
{ |
1465f48faba0
AJAX login box is now used in userprefs panel; Spry shake effect and general UX on auth fail is smoother now; added ajaxLoginNavTo() JS function
Dan
parents:
170
diff
changeset
|
913 |
ajaxPromptAdminAuth(function(k) { |
1465f48faba0
AJAX login box is now used in userprefs panel; Spry shake effect and general UX on auth fail is smoother now; added ajaxLoginNavTo() JS function
Dan
parents:
170
diff
changeset
|
914 |
ENANO_SID = k; |
1465f48faba0
AJAX login box is now used in userprefs panel; Spry shake effect and general UX on auth fail is smoother now; added ajaxLoginNavTo() JS function
Dan
parents:
170
diff
changeset
|
915 |
auth_level = navto_ul; |
1465f48faba0
AJAX login box is now used in userprefs panel; Spry shake effect and general UX on auth fail is smoother now; added ajaxLoginNavTo() JS function
Dan
parents:
170
diff
changeset
|
916 |
var loc = makeUrlNS(navto_ns, navto_pg); |
1465f48faba0
AJAX login box is now used in userprefs panel; Spry shake effect and general UX on auth fail is smoother now; added ajaxLoginNavTo() JS function
Dan
parents:
170
diff
changeset
|
917 |
if ( (ENANO_SID + ' ').length > 1 ) |
1465f48faba0
AJAX login box is now used in userprefs panel; Spry shake effect and general UX on auth fail is smoother now; added ajaxLoginNavTo() JS function
Dan
parents:
170
diff
changeset
|
918 |
window.location = loc; |
1465f48faba0
AJAX login box is now used in userprefs panel; Spry shake effect and general UX on auth fail is smoother now; added ajaxLoginNavTo() JS function
Dan
parents:
170
diff
changeset
|
919 |
}, min_level); |
1465f48faba0
AJAX login box is now used in userprefs panel; Spry shake effect and general UX on auth fail is smoother now; added ajaxLoginNavTo() JS function
Dan
parents:
170
diff
changeset
|
920 |
return false; |
1465f48faba0
AJAX login box is now used in userprefs panel; Spry shake effect and general UX on auth fail is smoother now; added ajaxLoginNavTo() JS function
Dan
parents:
170
diff
changeset
|
921 |
} |
1465f48faba0
AJAX login box is now used in userprefs panel; Spry shake effect and general UX on auth fail is smoother now; added ajaxLoginNavTo() JS function
Dan
parents:
170
diff
changeset
|
922 |
var loc = makeUrlNS(navto_ns, navto_pg); |
1465f48faba0
AJAX login box is now used in userprefs panel; Spry shake effect and general UX on auth fail is smoother now; added ajaxLoginNavTo() JS function
Dan
parents:
170
diff
changeset
|
923 |
window.location = loc; |
1465f48faba0
AJAX login box is now used in userprefs panel; Spry shake effect and general UX on auth fail is smoother now; added ajaxLoginNavTo() JS function
Dan
parents:
170
diff
changeset
|
924 |
} |
1465f48faba0
AJAX login box is now used in userprefs panel; Spry shake effect and general UX on auth fail is smoother now; added ajaxLoginNavTo() JS function
Dan
parents:
170
diff
changeset
|
925 |
|
103
a8891e108c95
Several major improvements: Memberlist page added (planned since about beta 2), page group support added for non-JS ACL editor (oops!), and attempting to view a page for which you lack read permissions will get you logged.
Dan
parents:
87
diff
changeset
|
926 |
function ajaxAdminUser(username) |
a8891e108c95
Several major improvements: Memberlist page added (planned since about beta 2), page group support added for non-JS ACL editor (oops!), and attempting to view a page for which you lack read permissions will get you logged.
Dan
parents:
87
diff
changeset
|
927 |
{ |
a8891e108c95
Several major improvements: Memberlist page added (planned since about beta 2), page group support added for non-JS ACL editor (oops!), and attempting to view a page for which you lack read permissions will get you logged.
Dan
parents:
87
diff
changeset
|
928 |
// IE <6 pseudo-compatibility |
a8891e108c95
Several major improvements: Memberlist page added (planned since about beta 2), page group support added for non-JS ACL editor (oops!), and attempting to view a page for which you lack read permissions will get you logged.
Dan
parents:
87
diff
changeset
|
929 |
if ( KILL_SWITCH ) |
a8891e108c95
Several major improvements: Memberlist page added (planned since about beta 2), page group support added for non-JS ACL editor (oops!), and attempting to view a page for which you lack read permissions will get you logged.
Dan
parents:
87
diff
changeset
|
930 |
return true; |
a8891e108c95
Several major improvements: Memberlist page added (planned since about beta 2), page group support added for non-JS ACL editor (oops!), and attempting to view a page for which you lack read permissions will get you logged.
Dan
parents:
87
diff
changeset
|
931 |
if ( auth_level < USER_LEVEL_ADMIN ) |
a8891e108c95
Several major improvements: Memberlist page added (planned since about beta 2), page group support added for non-JS ACL editor (oops!), and attempting to view a page for which you lack read permissions will get you logged.
Dan
parents:
87
diff
changeset
|
932 |
{ |
a8891e108c95
Several major improvements: Memberlist page added (planned since about beta 2), page group support added for non-JS ACL editor (oops!), and attempting to view a page for which you lack read permissions will get you logged.
Dan
parents:
87
diff
changeset
|
933 |
ajaxPromptAdminAuth(function(k) { |
a8891e108c95
Several major improvements: Memberlist page added (planned since about beta 2), page group support added for non-JS ACL editor (oops!), and attempting to view a page for which you lack read permissions will get you logged.
Dan
parents:
87
diff
changeset
|
934 |
ENANO_SID = k; |
a8891e108c95
Several major improvements: Memberlist page added (planned since about beta 2), page group support added for non-JS ACL editor (oops!), and attempting to view a page for which you lack read permissions will get you logged.
Dan
parents:
87
diff
changeset
|
935 |
auth_level = USER_LEVEL_ADMIN; |
a8891e108c95
Several major improvements: Memberlist page added (planned since about beta 2), page group support added for non-JS ACL editor (oops!), and attempting to view a page for which you lack read permissions will get you logged.
Dan
parents:
87
diff
changeset
|
936 |
var loc = String(window.location + ''); |
a8891e108c95
Several major improvements: Memberlist page added (planned since about beta 2), page group support added for non-JS ACL editor (oops!), and attempting to view a page for which you lack read permissions will get you logged.
Dan
parents:
87
diff
changeset
|
937 |
window.location = append_sid(loc); |
a8891e108c95
Several major improvements: Memberlist page added (planned since about beta 2), page group support added for non-JS ACL editor (oops!), and attempting to view a page for which you lack read permissions will get you logged.
Dan
parents:
87
diff
changeset
|
938 |
var loc = makeUrlNS('Special', 'Administration', 'module=' + namespace_list['Admin'] + 'UserManager&src=get&user=' + ajaxEscape(username)); |
a8891e108c95
Several major improvements: Memberlist page added (planned since about beta 2), page group support added for non-JS ACL editor (oops!), and attempting to view a page for which you lack read permissions will get you logged.
Dan
parents:
87
diff
changeset
|
939 |
if ( (ENANO_SID + ' ').length > 1 ) |
a8891e108c95
Several major improvements: Memberlist page added (planned since about beta 2), page group support added for non-JS ACL editor (oops!), and attempting to view a page for which you lack read permissions will get you logged.
Dan
parents:
87
diff
changeset
|
940 |
window.location = loc; |
a8891e108c95
Several major improvements: Memberlist page added (planned since about beta 2), page group support added for non-JS ACL editor (oops!), and attempting to view a page for which you lack read permissions will get you logged.
Dan
parents:
87
diff
changeset
|
941 |
}, 9); |
a8891e108c95
Several major improvements: Memberlist page added (planned since about beta 2), page group support added for non-JS ACL editor (oops!), and attempting to view a page for which you lack read permissions will get you logged.
Dan
parents:
87
diff
changeset
|
942 |
return false; |
a8891e108c95
Several major improvements: Memberlist page added (planned since about beta 2), page group support added for non-JS ACL editor (oops!), and attempting to view a page for which you lack read permissions will get you logged.
Dan
parents:
87
diff
changeset
|
943 |
} |
a8891e108c95
Several major improvements: Memberlist page added (planned since about beta 2), page group support added for non-JS ACL editor (oops!), and attempting to view a page for which you lack read permissions will get you logged.
Dan
parents:
87
diff
changeset
|
944 |
var loc = makeUrlNS('Special', 'Administration', 'module=' + namespace_list['Admin'] + 'UserManager&src=get&user=' + ajaxEscape(username)); |
a8891e108c95
Several major improvements: Memberlist page added (planned since about beta 2), page group support added for non-JS ACL editor (oops!), and attempting to view a page for which you lack read permissions will get you logged.
Dan
parents:
87
diff
changeset
|
945 |
window.location = loc; |
a8891e108c95
Several major improvements: Memberlist page added (planned since about beta 2), page group support added for non-JS ACL editor (oops!), and attempting to view a page for which you lack read permissions will get you logged.
Dan
parents:
87
diff
changeset
|
946 |
} |
a8891e108c95
Several major improvements: Memberlist page added (planned since about beta 2), page group support added for non-JS ACL editor (oops!), and attempting to view a page for which you lack read permissions will get you logged.
Dan
parents:
87
diff
changeset
|
947 |
|
11
ccad6026a168
Finalized permissions on files and directories; adding PHP shutoff button (actual shutoff not implemented)
Dan
parents:
1
diff
changeset
|
948 |
function ajaxDisableEmbeddedPHP() |
ccad6026a168
Finalized permissions on files and directories; adding PHP shutoff button (actual shutoff not implemented)
Dan
parents:
1
diff
changeset
|
949 |
{ |
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
|
950 |
// IE <6 pseudo-compatibility |
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
|
951 |
if ( 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
|
952 |
return true; |
214 | 953 |
if ( !confirm($lang.get('ajax_killphp_confirm')) ) |
11
ccad6026a168
Finalized permissions on files and directories; adding PHP shutoff button (actual shutoff not implemented)
Dan
parents:
1
diff
changeset
|
954 |
return false; |
ccad6026a168
Finalized permissions on files and directories; adding PHP shutoff button (actual shutoff not implemented)
Dan
parents:
1
diff
changeset
|
955 |
var $killdiv = $dynano('php_killer'); |
ccad6026a168
Finalized permissions on files and directories; adding PHP shutoff button (actual shutoff not implemented)
Dan
parents:
1
diff
changeset
|
956 |
if ( !$killdiv.object ) |
ccad6026a168
Finalized permissions on files and directories; adding PHP shutoff button (actual shutoff not implemented)
Dan
parents:
1
diff
changeset
|
957 |
{ |
ccad6026a168
Finalized permissions on files and directories; adding PHP shutoff button (actual shutoff not implemented)
Dan
parents:
1
diff
changeset
|
958 |
alert('Can\'t get kill div object'); |
ccad6026a168
Finalized permissions on files and directories; adding PHP shutoff button (actual shutoff not implemented)
Dan
parents:
1
diff
changeset
|
959 |
return false; |
ccad6026a168
Finalized permissions on files and directories; adding PHP shutoff button (actual shutoff not implemented)
Dan
parents:
1
diff
changeset
|
960 |
} |
ccad6026a168
Finalized permissions on files and directories; adding PHP shutoff button (actual shutoff not implemented)
Dan
parents:
1
diff
changeset
|
961 |
$killdiv.object.innerHTML = '<img alt="Loading..." src="' + scriptPath + '/images/loading-big.gif" /><br />Making request...'; |
ccad6026a168
Finalized permissions on files and directories; adding PHP shutoff button (actual shutoff not implemented)
Dan
parents:
1
diff
changeset
|
962 |
var url = makeUrlNS('Admin', 'Home', 'src=ajax'); |
ccad6026a168
Finalized permissions on files and directories; adding PHP shutoff button (actual shutoff not implemented)
Dan
parents:
1
diff
changeset
|
963 |
ajaxPost(url, 'act=kill_php', function() { |
ccad6026a168
Finalized permissions on files and directories; adding PHP shutoff button (actual shutoff not implemented)
Dan
parents:
1
diff
changeset
|
964 |
if ( ajax.readyState == 4 ) |
ccad6026a168
Finalized permissions on files and directories; adding PHP shutoff button (actual shutoff not implemented)
Dan
parents:
1
diff
changeset
|
965 |
{ |
ccad6026a168
Finalized permissions on files and directories; adding PHP shutoff button (actual shutoff not implemented)
Dan
parents:
1
diff
changeset
|
966 |
if ( ajax.responseText == '1' ) |
ccad6026a168
Finalized permissions on files and directories; adding PHP shutoff button (actual shutoff not implemented)
Dan
parents:
1
diff
changeset
|
967 |
{ |
ccad6026a168
Finalized permissions on files and directories; adding PHP shutoff button (actual shutoff not implemented)
Dan
parents:
1
diff
changeset
|
968 |
var $killdiv = $dynano('php_killer'); |
ccad6026a168
Finalized permissions on files and directories; adding PHP shutoff button (actual shutoff not implemented)
Dan
parents:
1
diff
changeset
|
969 |
//$killdiv.object.innerHTML = '<img alt="Success" src="' + scriptPath + '/images/error.png" /><br />Embedded PHP in pages has been disabled.'; |
ccad6026a168
Finalized permissions on files and directories; adding PHP shutoff button (actual shutoff not implemented)
Dan
parents:
1
diff
changeset
|
970 |
$killdiv.object.parentNode.removeChild($killdiv.object); |
ccad6026a168
Finalized permissions on files and directories; adding PHP shutoff button (actual shutoff not implemented)
Dan
parents:
1
diff
changeset
|
971 |
var newdiv = document.createElement('div'); |
ccad6026a168
Finalized permissions on files and directories; adding PHP shutoff button (actual shutoff not implemented)
Dan
parents:
1
diff
changeset
|
972 |
// newdiv.style = $killdiv.object.style; |
ccad6026a168
Finalized permissions on files and directories; adding PHP shutoff button (actual shutoff not implemented)
Dan
parents:
1
diff
changeset
|
973 |
newdiv.className = $killdiv.object.className; |
214 | 974 |
newdiv.innerHTML = '<img alt="Success" src="' + scriptPath + '/images/error.png" /><br />' + $lang.get('ajax_killphp_success'); |
11
ccad6026a168
Finalized permissions on files and directories; adding PHP shutoff button (actual shutoff not implemented)
Dan
parents:
1
diff
changeset
|
975 |
$killdiv.object.parentNode.appendChild(newdiv); |
ccad6026a168
Finalized permissions on files and directories; adding PHP shutoff button (actual shutoff not implemented)
Dan
parents:
1
diff
changeset
|
976 |
$killdiv.object.parentNode.removeChild($killdiv.object); |
ccad6026a168
Finalized permissions on files and directories; adding PHP shutoff button (actual shutoff not implemented)
Dan
parents:
1
diff
changeset
|
977 |
} |
ccad6026a168
Finalized permissions on files and directories; adding PHP shutoff button (actual shutoff not implemented)
Dan
parents:
1
diff
changeset
|
978 |
else |
ccad6026a168
Finalized permissions on files and directories; adding PHP shutoff button (actual shutoff not implemented)
Dan
parents:
1
diff
changeset
|
979 |
{ |
ccad6026a168
Finalized permissions on files and directories; adding PHP shutoff button (actual shutoff not implemented)
Dan
parents:
1
diff
changeset
|
980 |
var $killdiv = $dynano('php_killer'); |
ccad6026a168
Finalized permissions on files and directories; adding PHP shutoff button (actual shutoff not implemented)
Dan
parents:
1
diff
changeset
|
981 |
$killdiv.object.innerHTML = ajax.responseText; |
ccad6026a168
Finalized permissions on files and directories; adding PHP shutoff button (actual shutoff not implemented)
Dan
parents:
1
diff
changeset
|
982 |
} |
ccad6026a168
Finalized permissions on files and directories; adding PHP shutoff button (actual shutoff not implemented)
Dan
parents:
1
diff
changeset
|
983 |
} |
ccad6026a168
Finalized permissions on files and directories; adding PHP shutoff button (actual shutoff not implemented)
Dan
parents:
1
diff
changeset
|
984 |
}); |
ccad6026a168
Finalized permissions on files and directories; adding PHP shutoff button (actual shutoff not implemented)
Dan
parents:
1
diff
changeset
|
985 |
} |
ccad6026a168
Finalized permissions on files and directories; adding PHP shutoff button (actual shutoff not implemented)
Dan
parents:
1
diff
changeset
|
986 |
|
76
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
987 |
var catHTMLBuf = false; |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
988 |
|
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
989 |
function ajaxCatToTag() |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
990 |
{ |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
991 |
if ( KILL_SWITCH ) |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
992 |
return false; |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
993 |
setAjaxLoading(); |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
994 |
ajaxGet(stdAjaxPrefix + '&_mode=get_tags', function() |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
995 |
{ |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
996 |
if ( ajax.readyState == 4 ) |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
997 |
{ |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
998 |
unsetAjaxLoading(); |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
999 |
var resptext = String(ajax.responseText + ' '); |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
1000 |
resptext = resptext.substr(0, resptext.length-1); |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
1001 |
if ( resptext.substr(0, 1) != '{' ) |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
1002 |
{ |
320
112debff64bd
SURPRISE! Preliminary PostgreSQL support added. The required schema file is not present in this commit and will be included at a later date. No installer support is implemented. Also in this commit: several fixes including <!-- SYSMSG ... --> was broken in template compiler; set fixed width on included images to prevent the thumbnail box from getting huge; added a much more friendly interface to AJAX responses that are invalid JSON
Dan
parents:
298
diff
changeset
|
1003 |
handle_invalid_json(resptext); |
76
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
1004 |
return false; |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
1005 |
} |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
1006 |
var json = parseJSON(resptext); |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
1007 |
var catbox = document.getElementById('mdgCatBox'); |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
1008 |
if ( !catbox ) |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
1009 |
return false; |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
1010 |
var linkbox = catbox.parentNode.firstChild.firstChild.nextSibling; |
214 | 1011 |
linkbox.firstChild.nodeValue = $lang.get('catedit_catbox_link_showcategorization'); |
76
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
1012 |
linkbox.onclick = function() { ajaxTagToCat(); return false; }; |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
1013 |
catHTMLBuf = catbox.innerHTML; |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
1014 |
catbox.innerHTML = ''; |
214 | 1015 |
catbox.appendChild(document.createTextNode($lang.get('tags_lbl_page_tags')+' ')); |
76
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
1016 |
if ( json.tags.length < 1 ) |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
1017 |
{ |
214 | 1018 |
catbox.appendChild(document.createTextNode($lang.get('tags_lbl_no_tags'))); |
76
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
1019 |
} |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
1020 |
for ( var i = 0; i < json.tags.length; i++ ) |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
1021 |
{ |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
1022 |
catbox.appendChild(document.createTextNode(json.tags[i].name)); |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
1023 |
if ( json.tags[i].can_del ) |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
1024 |
{ |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
1025 |
catbox.appendChild(document.createTextNode(' ')); |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
1026 |
var a = document.createElement('a'); |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
1027 |
a.appendChild(document.createTextNode('[X]')); |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
1028 |
a.href = '#'; |
80
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1029 |
a._js_tag_id = json.tags[i].id; |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1030 |
a.onclick = function() { ajaxDeleteTag(this, this._js_tag_id); return false; } |
76
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
1031 |
catbox.appendChild(a); |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
1032 |
} |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
1033 |
if ( ( i + 1 ) < json.tags.length ) |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
1034 |
catbox.appendChild(document.createTextNode(', ')); |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
1035 |
} |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
1036 |
if ( json.can_add ) |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
1037 |
{ |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
1038 |
catbox.appendChild(document.createTextNode(' ')); |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
1039 |
var addlink = document.createElement('a'); |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
1040 |
addlink.href = '#'; |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
1041 |
addlink.onclick = function() { try { ajaxAddTagStage1(); } catch(e) { }; return false; }; |
214 | 1042 |
addlink.appendChild(document.createTextNode($lang.get('tags_btn_add_tag'))); |
76
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
1043 |
catbox.appendChild(addlink); |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
1044 |
} |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
1045 |
} |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
1046 |
}); |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
1047 |
} |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
1048 |
|
80
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1049 |
var addtag_open = false; |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1050 |
|
76
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
1051 |
function ajaxAddTagStage1() |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
1052 |
{ |
80
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1053 |
if ( addtag_open ) |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1054 |
return false; |
76
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
1055 |
var catbox = document.getElementById('mdgCatBox'); |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
1056 |
var adddiv = document.createElement('div'); |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
1057 |
var text = document.createElement('input'); |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
1058 |
var addlink = document.createElement('a'); |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
1059 |
addlink.href = '#'; |
80
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1060 |
addlink.onclick = function() { ajaxAddTagStage2(this.parentNode.firstChild.nextSibling.value, this.parentNode); return false; }; |
214 | 1061 |
addlink.appendChild(document.createTextNode($lang.get('tags_btn_add'))); |
76
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
1062 |
text.type = 'text'; |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
1063 |
text.size = '15'; |
80
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1064 |
text.onkeyup = function(e) |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1065 |
{ |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1066 |
if ( e.keyCode == 13 ) |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1067 |
{ |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1068 |
ajaxAddTagStage2(this.value, this.parentNode); |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1069 |
} |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1070 |
} |
76
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
1071 |
|
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
1072 |
adddiv.style.margin = '5px 0 0 0'; |
214 | 1073 |
adddiv.appendChild(document.createTextNode($lang.get('tags_lbl_add_tag')+' ')); |
76
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
1074 |
adddiv.appendChild(text); |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
1075 |
adddiv.appendChild(document.createTextNode(' ')); |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
1076 |
adddiv.appendChild(addlink); |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
1077 |
catbox.appendChild(adddiv); |
80
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1078 |
addtag_open = true; |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1079 |
} |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1080 |
|
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1081 |
var addtag_nukeme = false; |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1082 |
|
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1083 |
function ajaxAddTagStage2(tag, nukeme) |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1084 |
{ |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1085 |
if ( !addtag_open ) |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1086 |
return false; |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1087 |
if ( addtag_nukeme ) |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1088 |
return false; |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1089 |
addtag_nukeme = nukeme; |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1090 |
tag = ajaxEscape(tag); |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1091 |
setAjaxLoading(); |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1092 |
ajaxPost(stdAjaxPrefix + '&_mode=addtag', 'tag=' + tag, function() |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1093 |
{ |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1094 |
if ( ajax.readyState == 4 ) |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1095 |
{ |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1096 |
unsetAjaxLoading(); |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1097 |
var nukeme = addtag_nukeme; |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1098 |
addtag_nukeme = false; |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1099 |
var resptext = String(ajax.responseText + ' '); |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1100 |
resptext = resptext.substr(0, resptext.length-1); |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1101 |
if ( resptext.substr(0, 1) != '{' ) |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1102 |
{ |
320
112debff64bd
SURPRISE! Preliminary PostgreSQL support added. The required schema file is not present in this commit and will be included at a later date. No installer support is implemented. Also in this commit: several fixes including <!-- SYSMSG ... --> was broken in template compiler; set fixed width on included images to prevent the thumbnail box from getting huge; added a much more friendly interface to AJAX responses that are invalid JSON
Dan
parents:
298
diff
changeset
|
1103 |
handle_invalid_json(resptext); |
80
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1104 |
return false; |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1105 |
} |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1106 |
var json = parseJSON(resptext); |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1107 |
var parent = nukeme.parentNode; |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1108 |
parent.removeChild(nukeme); |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1109 |
addtag_open = false; |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1110 |
if ( json.success ) |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1111 |
{ |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1112 |
var node = parent.childNodes[1]; |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1113 |
var insertafter = false; |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1114 |
var nukeafter = false; |
214 | 1115 |
if ( node.nodeValue == $lang.get('tags_lbl_no_tags') ) |
80
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1116 |
{ |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1117 |
nukeafter = true; |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1118 |
} |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1119 |
insertafter = parent.childNodes[ parent.childNodes.length - 3 ]; |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1120 |
// these need to be inserted in reverse order |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1121 |
if ( json.can_del ) |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1122 |
{ |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1123 |
var a = document.createElement('a'); |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1124 |
a.appendChild(document.createTextNode('[X]')); |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1125 |
a.href = '#'; |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1126 |
a._js_tag_id = json.tag_id; |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1127 |
a.onclick = function() { ajaxDeleteTag(this, this._js_tag_id); return false; } |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1128 |
insertAfter(parent, a, insertafter); |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1129 |
insertAfter(parent, document.createTextNode(' '), insertafter); |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1130 |
} |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1131 |
insertAfter(parent, document.createTextNode(json.tag), insertafter); |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1132 |
if ( !nukeafter ) |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1133 |
{ |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1134 |
insertAfter(parent, document.createTextNode(', '), insertafter); |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1135 |
} |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1136 |
if ( nukeafter ) |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1137 |
{ |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1138 |
parent.removeChild(insertafter); |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1139 |
} |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1140 |
} |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1141 |
else |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1142 |
{ |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1143 |
alert(json.error); |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1144 |
} |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1145 |
} |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1146 |
}); |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1147 |
} |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1148 |
|
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1149 |
function ajaxDeleteTag(parentobj, tag_id) |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1150 |
{ |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1151 |
var arrDelete = [ parentobj, parentobj.previousSibling, parentobj.previousSibling.previousSibling ]; |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1152 |
var parent = parentobj.parentNode; |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1153 |
var writeNoTags = false; |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1154 |
if ( parentobj.previousSibling.previousSibling.previousSibling.nodeValue == ', ' ) |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1155 |
arrDelete.push(parentobj.previousSibling.previousSibling.previousSibling); |
214 | 1156 |
else if ( parentobj.previousSibling.previousSibling.previousSibling.nodeValue == $lang.get('tags_lbl_page_tags') + ' ' ) |
80
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1157 |
arrDelete.push(parentobj.nextSibling); |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1158 |
|
214 | 1159 |
if ( parentobj.previousSibling.previousSibling.previousSibling.nodeValue == $lang.get('tags_lbl_page_tags') + ' ' && |
80
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1160 |
parentobj.nextSibling.nextSibling.firstChild ) |
214 | 1161 |
if ( parentobj.nextSibling.nextSibling.firstChild.nodeValue == $lang.get('tags_btn_add_tag')) |
80
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1162 |
writeNoTags = true; |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1163 |
|
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1164 |
ajaxPost(stdAjaxPrefix + '&_mode=deltag', 'tag_id=' + String(tag_id), function() |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1165 |
{ |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1166 |
if ( ajax.readyState == 4 ) |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1167 |
{ |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1168 |
if ( ajax.responseText == 'success' ) |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1169 |
{ |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1170 |
for ( var i = 0; i < arrDelete.length; i++ ) |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1171 |
{ |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1172 |
try |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1173 |
{ |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1174 |
parent.removeChild(arrDelete[i]); |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1175 |
} catch(e) {} |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1176 |
} |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1177 |
if ( writeNoTags ) |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1178 |
{ |
214 | 1179 |
var node1 = document.createTextNode($lang.get('tags_lbl_no_tags')); |
80
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1180 |
var node2 = document.createTextNode(' '); |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1181 |
insertAfter(parent, node1, parent.firstChild); |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1182 |
insertAfter(parent, node2, node1); |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1183 |
} |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1184 |
} |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1185 |
else |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1186 |
{ |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1187 |
alert(ajax.responseText); |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1188 |
} |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1189 |
} |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
78
diff
changeset
|
1190 |
}); |
76
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
1191 |
} |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
1192 |
|
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
1193 |
function ajaxTagToCat() |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
1194 |
{ |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
1195 |
if ( !catHTMLBuf ) |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
1196 |
return false; |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
1197 |
var catbox = document.getElementById('mdgCatBox'); |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
1198 |
if ( !catbox ) |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
1199 |
return false; |
87
570f68c3fe36
Redid stupid fading button code and fixed several RC2 bugs in the upgrade schema; 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
1200 |
addtag_open = false; |
76
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
1201 |
var linkbox = catbox.parentNode.firstChild.firstChild.nextSibling; |
214 | 1202 |
linkbox.firstChild.nodeValue = $lang.get('tags_catbox_link'); |
76
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
1203 |
linkbox.onclick = function() { ajaxCatToTag(); return false; }; |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
1204 |
catbox.innerHTML = catHTMLBuf; |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
1205 |
catHTMLBuf = false; |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
1206 |
} |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
1207 |
|
118
0c5efda996bf
Added keep-alive function to admin panel (had been planned for some time) and a new hook, template_var_init_end
Dan
parents:
103
diff
changeset
|
1208 |
var keepalive_interval = false; |
0c5efda996bf
Added keep-alive function to admin panel (had been planned for some time) and a new hook, template_var_init_end
Dan
parents:
103
diff
changeset
|
1209 |
|
0c5efda996bf
Added keep-alive function to admin panel (had been planned for some time) and a new hook, template_var_init_end
Dan
parents:
103
diff
changeset
|
1210 |
function ajaxPingServer() |
0c5efda996bf
Added keep-alive function to admin panel (had been planned for some time) and a new hook, template_var_init_end
Dan
parents:
103
diff
changeset
|
1211 |
{ |
0c5efda996bf
Added keep-alive function to admin panel (had been planned for some time) and a new hook, template_var_init_end
Dan
parents:
103
diff
changeset
|
1212 |
ajaxGet(stdAjaxPrefix + '&_mode=ping', function() |
0c5efda996bf
Added keep-alive function to admin panel (had been planned for some time) and a new hook, template_var_init_end
Dan
parents:
103
diff
changeset
|
1213 |
{ |
0c5efda996bf
Added keep-alive function to admin panel (had been planned for some time) and a new hook, template_var_init_end
Dan
parents:
103
diff
changeset
|
1214 |
}); |
0c5efda996bf
Added keep-alive function to admin panel (had been planned for some time) and a new hook, template_var_init_end
Dan
parents:
103
diff
changeset
|
1215 |
} |
0c5efda996bf
Added keep-alive function to admin panel (had been planned for some time) and a new hook, template_var_init_end
Dan
parents:
103
diff
changeset
|
1216 |
|
0c5efda996bf
Added keep-alive function to admin panel (had been planned for some time) and a new hook, template_var_init_end
Dan
parents:
103
diff
changeset
|
1217 |
function ajaxToggleKeepalive() |
0c5efda996bf
Added keep-alive function to admin panel (had been planned for some time) and a new hook, template_var_init_end
Dan
parents:
103
diff
changeset
|
1218 |
{ |
0c5efda996bf
Added keep-alive function to admin panel (had been planned for some time) and a new hook, template_var_init_end
Dan
parents:
103
diff
changeset
|
1219 |
if ( readCookie('admin_keepalive') == '1' ) |
0c5efda996bf
Added keep-alive function to admin panel (had been planned for some time) and a new hook, template_var_init_end
Dan
parents:
103
diff
changeset
|
1220 |
{ |
0c5efda996bf
Added keep-alive function to admin panel (had been planned for some time) and a new hook, template_var_init_end
Dan
parents:
103
diff
changeset
|
1221 |
createCookie('admin_keepalive', '0', 3650); |
0c5efda996bf
Added keep-alive function to admin panel (had been planned for some time) and a new hook, template_var_init_end
Dan
parents:
103
diff
changeset
|
1222 |
if ( keepalive_interval ) |
0c5efda996bf
Added keep-alive function to admin panel (had been planned for some time) and a new hook, template_var_init_end
Dan
parents:
103
diff
changeset
|
1223 |
clearInterval(keepalive_interval); |
0c5efda996bf
Added keep-alive function to admin panel (had been planned for some time) and a new hook, template_var_init_end
Dan
parents:
103
diff
changeset
|
1224 |
var span = document.getElementById('keepalivestat'); |
211 | 1225 |
span.firstChild.nodeValue = $lang.get('adm_btn_keepalive_off'); |
118
0c5efda996bf
Added keep-alive function to admin panel (had been planned for some time) and a new hook, template_var_init_end
Dan
parents:
103
diff
changeset
|
1226 |
} |
0c5efda996bf
Added keep-alive function to admin panel (had been planned for some time) and a new hook, template_var_init_end
Dan
parents:
103
diff
changeset
|
1227 |
else |
0c5efda996bf
Added keep-alive function to admin panel (had been planned for some time) and a new hook, template_var_init_end
Dan
parents:
103
diff
changeset
|
1228 |
{ |
0c5efda996bf
Added keep-alive function to admin panel (had been planned for some time) and a new hook, template_var_init_end
Dan
parents:
103
diff
changeset
|
1229 |
createCookie('admin_keepalive', '1', 3650); |
0c5efda996bf
Added keep-alive function to admin panel (had been planned for some time) and a new hook, template_var_init_end
Dan
parents:
103
diff
changeset
|
1230 |
if ( !keepalive_interval ) |
0c5efda996bf
Added keep-alive function to admin panel (had been planned for some time) and a new hook, template_var_init_end
Dan
parents:
103
diff
changeset
|
1231 |
keepalive_interval = setInterval('ajaxPingServer();', 600000); |
0c5efda996bf
Added keep-alive function to admin panel (had been planned for some time) and a new hook, template_var_init_end
Dan
parents:
103
diff
changeset
|
1232 |
var span = document.getElementById('keepalivestat'); |
211 | 1233 |
span.firstChild.nodeValue = $lang.get('adm_btn_keepalive_on'); |
118
0c5efda996bf
Added keep-alive function to admin panel (had been planned for some time) and a new hook, template_var_init_end
Dan
parents:
103
diff
changeset
|
1234 |
ajaxPingServer(); |
0c5efda996bf
Added keep-alive function to admin panel (had been planned for some time) and a new hook, template_var_init_end
Dan
parents:
103
diff
changeset
|
1235 |
} |
0c5efda996bf
Added keep-alive function to admin panel (had been planned for some time) and a new hook, template_var_init_end
Dan
parents:
103
diff
changeset
|
1236 |
} |
0c5efda996bf
Added keep-alive function to admin panel (had been planned for some time) and a new hook, template_var_init_end
Dan
parents:
103
diff
changeset
|
1237 |
|
0c5efda996bf
Added keep-alive function to admin panel (had been planned for some time) and a new hook, template_var_init_end
Dan
parents:
103
diff
changeset
|
1238 |
var keepalive_onload = function() |
0c5efda996bf
Added keep-alive function to admin panel (had been planned for some time) and a new hook, template_var_init_end
Dan
parents:
103
diff
changeset
|
1239 |
{ |
0c5efda996bf
Added keep-alive function to admin panel (had been planned for some time) and a new hook, template_var_init_end
Dan
parents:
103
diff
changeset
|
1240 |
if ( readCookie('admin_keepalive') == '1' ) |
0c5efda996bf
Added keep-alive function to admin panel (had been planned for some time) and a new hook, template_var_init_end
Dan
parents:
103
diff
changeset
|
1241 |
{ |
0c5efda996bf
Added keep-alive function to admin panel (had been planned for some time) and a new hook, template_var_init_end
Dan
parents:
103
diff
changeset
|
1242 |
if ( !keepalive_interval ) |
0c5efda996bf
Added keep-alive function to admin panel (had been planned for some time) and a new hook, template_var_init_end
Dan
parents:
103
diff
changeset
|
1243 |
keepalive_interval = setInterval('ajaxPingServer();', 600000); |
0c5efda996bf
Added keep-alive function to admin panel (had been planned for some time) and a new hook, template_var_init_end
Dan
parents:
103
diff
changeset
|
1244 |
var span = document.getElementById('keepalivestat'); |
211 | 1245 |
span.firstChild.nodeValue = $lang.get('adm_btn_keepalive_on'); |
118
0c5efda996bf
Added keep-alive function to admin panel (had been planned for some time) and a new hook, template_var_init_end
Dan
parents:
103
diff
changeset
|
1246 |
} |
0c5efda996bf
Added keep-alive function to admin panel (had been planned for some time) and a new hook, template_var_init_end
Dan
parents:
103
diff
changeset
|
1247 |
else |
0c5efda996bf
Added keep-alive function to admin panel (had been planned for some time) and a new hook, template_var_init_end
Dan
parents:
103
diff
changeset
|
1248 |
{ |
0c5efda996bf
Added keep-alive function to admin panel (had been planned for some time) and a new hook, template_var_init_end
Dan
parents:
103
diff
changeset
|
1249 |
if ( keepalive_interval ) |
0c5efda996bf
Added keep-alive function to admin panel (had been planned for some time) and a new hook, template_var_init_end
Dan
parents:
103
diff
changeset
|
1250 |
clearInterval(keepalive_interval); |
0c5efda996bf
Added keep-alive function to admin panel (had been planned for some time) and a new hook, template_var_init_end
Dan
parents:
103
diff
changeset
|
1251 |
var span = document.getElementById('keepalivestat'); |
211 | 1252 |
span.firstChild.nodeValue = $lang.get('adm_btn_keepalive_off'); |
118
0c5efda996bf
Added keep-alive function to admin panel (had been planned for some time) and a new hook, template_var_init_end
Dan
parents:
103
diff
changeset
|
1253 |
} |
0c5efda996bf
Added keep-alive function to admin panel (had been planned for some time) and a new hook, template_var_init_end
Dan
parents:
103
diff
changeset
|
1254 |
}; |
0c5efda996bf
Added keep-alive function to admin panel (had been planned for some time) and a new hook, template_var_init_end
Dan
parents:
103
diff
changeset
|
1255 |
|
0c5efda996bf
Added keep-alive function to admin panel (had been planned for some time) and a new hook, template_var_init_end
Dan
parents:
103
diff
changeset
|
1256 |
function aboutKeepAlive() |
0c5efda996bf
Added keep-alive function to admin panel (had been planned for some time) and a new hook, template_var_init_end
Dan
parents:
103
diff
changeset
|
1257 |
{ |
211 | 1258 |
new messagebox(MB_OK|MB_ICONINFORMATION, $lang.get('user_keepalive_info_title'), $lang.get('user_keepalive_info_body')); |
118
0c5efda996bf
Added keep-alive function to admin panel (had been planned for some time) and a new hook, template_var_init_end
Dan
parents:
103
diff
changeset
|
1259 |
} |
0c5efda996bf
Added keep-alive function to admin panel (had been planned for some time) and a new hook, template_var_init_end
Dan
parents:
103
diff
changeset
|
1260 |
|
179
36b287f1d85c
[F] Added support for account lockouts. User is locked out or required to complete a CAPTCHA after specified threshold for specified period.
Dan
parents:
175
diff
changeset
|
1261 |
function ajaxShowCaptcha(code) |
36b287f1d85c
[F] Added support for account lockouts. User is locked out or required to complete a CAPTCHA after specified threshold for specified period.
Dan
parents:
175
diff
changeset
|
1262 |
{ |
36b287f1d85c
[F] Added support for account lockouts. User is locked out or required to complete a CAPTCHA after specified threshold for specified period.
Dan
parents:
175
diff
changeset
|
1263 |
var mydiv = document.createElement('div'); |
36b287f1d85c
[F] Added support for account lockouts. User is locked out or required to complete a CAPTCHA after specified threshold for specified period.
Dan
parents:
175
diff
changeset
|
1264 |
mydiv.style.backgroundColor = '#FFFFFF'; |
36b287f1d85c
[F] Added support for account lockouts. User is locked out or required to complete a CAPTCHA after specified threshold for specified period.
Dan
parents:
175
diff
changeset
|
1265 |
mydiv.style.padding = '10px'; |
36b287f1d85c
[F] Added support for account lockouts. User is locked out or required to complete a CAPTCHA after specified threshold for specified period.
Dan
parents:
175
diff
changeset
|
1266 |
mydiv.style.position = 'absolute'; |
36b287f1d85c
[F] Added support for account lockouts. User is locked out or required to complete a CAPTCHA after specified threshold for specified period.
Dan
parents:
175
diff
changeset
|
1267 |
mydiv.style.top = '0px'; |
36b287f1d85c
[F] Added support for account lockouts. User is locked out or required to complete a CAPTCHA after specified threshold for specified period.
Dan
parents:
175
diff
changeset
|
1268 |
mydiv.id = 'autoCaptcha'; |
209 | 1269 |
mydiv.style.zIndex = String( getHighestZ() + 1 ); |
179
36b287f1d85c
[F] Added support for account lockouts. User is locked out or required to complete a CAPTCHA after specified threshold for specified period.
Dan
parents:
175
diff
changeset
|
1270 |
var img = document.createElement('img'); |
36b287f1d85c
[F] Added support for account lockouts. User is locked out or required to complete a CAPTCHA after specified threshold for specified period.
Dan
parents:
175
diff
changeset
|
1271 |
img.onload = function() |
36b287f1d85c
[F] Added support for account lockouts. User is locked out or required to complete a CAPTCHA after specified threshold for specified period.
Dan
parents:
175
diff
changeset
|
1272 |
{ |
36b287f1d85c
[F] Added support for account lockouts. User is locked out or required to complete a CAPTCHA after specified threshold for specified period.
Dan
parents:
175
diff
changeset
|
1273 |
if ( this.loaded ) |
36b287f1d85c
[F] Added support for account lockouts. User is locked out or required to complete a CAPTCHA after specified threshold for specified period.
Dan
parents:
175
diff
changeset
|
1274 |
return true; |
36b287f1d85c
[F] Added support for account lockouts. User is locked out or required to complete a CAPTCHA after specified threshold for specified period.
Dan
parents:
175
diff
changeset
|
1275 |
var mydiv = document.getElementById('autoCaptcha'); |
36b287f1d85c
[F] Added support for account lockouts. User is locked out or required to complete a CAPTCHA after specified threshold for specified period.
Dan
parents:
175
diff
changeset
|
1276 |
var width = getWidth(); |
36b287f1d85c
[F] Added support for account lockouts. User is locked out or required to complete a CAPTCHA after specified threshold for specified period.
Dan
parents:
175
diff
changeset
|
1277 |
var divw = $(mydiv).Width(); |
36b287f1d85c
[F] Added support for account lockouts. User is locked out or required to complete a CAPTCHA after specified threshold for specified period.
Dan
parents:
175
diff
changeset
|
1278 |
var left = ( width / 2 ) - ( divw / 2 ); |
36b287f1d85c
[F] Added support for account lockouts. User is locked out or required to complete a CAPTCHA after specified threshold for specified period.
Dan
parents:
175
diff
changeset
|
1279 |
mydiv.style.left = left + 'px'; |
36b287f1d85c
[F] Added support for account lockouts. User is locked out or required to complete a CAPTCHA after specified threshold for specified period.
Dan
parents:
175
diff
changeset
|
1280 |
fly_in_top(mydiv, false, true); |
36b287f1d85c
[F] Added support for account lockouts. User is locked out or required to complete a CAPTCHA after specified threshold for specified period.
Dan
parents:
175
diff
changeset
|
1281 |
this.loaded = true; |
36b287f1d85c
[F] Added support for account lockouts. User is locked out or required to complete a CAPTCHA after specified threshold for specified period.
Dan
parents:
175
diff
changeset
|
1282 |
}; |
36b287f1d85c
[F] Added support for account lockouts. User is locked out or required to complete a CAPTCHA after specified threshold for specified period.
Dan
parents:
175
diff
changeset
|
1283 |
img.src = makeUrlNS('Special', 'Captcha/' + code); |
36b287f1d85c
[F] Added support for account lockouts. User is locked out or required to complete a CAPTCHA after specified threshold for specified period.
Dan
parents:
175
diff
changeset
|
1284 |
img.onclick = function() { this.src = this.src + '/a'; }; |
36b287f1d85c
[F] Added support for account lockouts. User is locked out or required to complete a CAPTCHA after specified threshold for specified period.
Dan
parents:
175
diff
changeset
|
1285 |
img.style.cursor = 'pointer'; |
36b287f1d85c
[F] Added support for account lockouts. User is locked out or required to complete a CAPTCHA after specified threshold for specified period.
Dan
parents:
175
diff
changeset
|
1286 |
mydiv.appendChild(img); |
36b287f1d85c
[F] Added support for account lockouts. User is locked out or required to complete a CAPTCHA after specified threshold for specified period.
Dan
parents:
175
diff
changeset
|
1287 |
domObjChangeOpac(0, mydiv); |
36b287f1d85c
[F] Added support for account lockouts. User is locked out or required to complete a CAPTCHA after specified threshold for specified period.
Dan
parents:
175
diff
changeset
|
1288 |
var body = document.getElementsByTagName('body')[0]; |
36b287f1d85c
[F] Added support for account lockouts. User is locked out or required to complete a CAPTCHA after specified threshold for specified period.
Dan
parents:
175
diff
changeset
|
1289 |
body.appendChild(mydiv); |
36b287f1d85c
[F] Added support for account lockouts. User is locked out or required to complete a CAPTCHA after specified threshold for specified period.
Dan
parents:
175
diff
changeset
|
1290 |
} |
36b287f1d85c
[F] Added support for account lockouts. User is locked out or required to complete a CAPTCHA after specified threshold for specified period.
Dan
parents:
175
diff
changeset
|
1291 |
|
329
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1292 |
function ajaxUpdateCheck(targetelement) |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1293 |
{ |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1294 |
if ( !document.getElementById(targetelement) ) |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1295 |
{ |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1296 |
return false; |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1297 |
} |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1298 |
var target = document.getElementById(targetelement); |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1299 |
target.innerHTML = ''; |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1300 |
var img = document.createElement('img'); |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1301 |
img.src = scriptPath + '/images/loading.gif'; |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1302 |
img.alt = 'Loading...'; |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1303 |
target.appendChild(img); |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1304 |
ajaxGet(makeUrlNS('Admin', 'Home/updates.xml'), function() |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1305 |
{ |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1306 |
if ( ajax.readyState == 4 ) |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1307 |
{ |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1308 |
var releases = new Array(); |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1309 |
var update_available = false; |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1310 |
if ( ajax.responseXML == null ) |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1311 |
{ |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1312 |
alert("Error fetching updates list:\n" + ajax.responseText); |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1313 |
return false; |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1314 |
} |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1315 |
if ( ajax.responseXML.firstChild.tagName == 'enano' ) |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1316 |
{ |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1317 |
var enanotag = ajax.responseXML.firstChild; |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1318 |
for ( var i in enanotag.childNodes ) |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1319 |
{ |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1320 |
if ( enanotag.childNodes[i].tagName == 'error' ) |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1321 |
{ |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1322 |
alert(enanotag.childNodes[i].firstChild.nodeValue); |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1323 |
} |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1324 |
else if ( enanotag.childNodes[i].tagName == 'latest' ) |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1325 |
{ |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1326 |
// got <latest> |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1327 |
var latesttag = enanotag.childNodes[i]; |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1328 |
for ( var i in latesttag.childNodes ) |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1329 |
{ |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1330 |
var node = latesttag.childNodes[i]; |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1331 |
if ( node.tagName == 'release' ) |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1332 |
{ |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1333 |
var releasedata = new Object(); |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1334 |
for ( var i in node.attributes ) |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1335 |
{ |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1336 |
releasedata[node.attributes[i].nodeName] = node.attributes[i].nodeValue; |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1337 |
} |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1338 |
releases.push(releasedata); |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1339 |
} |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1340 |
else if ( node.tagName == 'haveupdates' ) |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1341 |
{ |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1342 |
update_available = true; |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1343 |
} |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1344 |
} |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1345 |
break; |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1346 |
} |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1347 |
} |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1348 |
} |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1349 |
else |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1350 |
{ |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1351 |
if ( window.console ) |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1352 |
window.console.error('Invalid XML response'); |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1353 |
return false; |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1354 |
} |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1355 |
var thediv = document.getElementById(targetelement); |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1356 |
thediv.innerHTML = ''; |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1357 |
if ( !thediv ) |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1358 |
{ |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1359 |
if ( window.console ) |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1360 |
window.console.error('Can\'t get the div'); |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1361 |
return false; |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1362 |
} |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1363 |
if ( releases.length > 0 ) |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1364 |
{ |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1365 |
thediv.className = 'tblholder'; |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1366 |
if ( update_available ) |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1367 |
{ |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1368 |
var infobox = document.createElement('div'); |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1369 |
infobox.className = 'info-box-mini'; |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1370 |
infobox.appendChild(document.createTextNode('An update for Enano is available.')); |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1371 |
infobox.style.borderWidth = '0'; |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1372 |
infobox.style.margin = '0 0 0 0'; |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1373 |
thediv.appendChild(infobox); |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1374 |
} |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1375 |
else |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1376 |
{ |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1377 |
var infobox = document.createElement('div'); |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1378 |
infobox.className = 'info-box-mini'; |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1379 |
infobox.appendChild(document.createTextNode('No new updates are available.')); |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1380 |
infobox.style.borderWidth = '0'; |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1381 |
infobox.style.margin = '0 0 0 0'; |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1382 |
thediv.appendChild(infobox); |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1383 |
} |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1384 |
var table = document.createElement('table'); |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1385 |
table.border = '0'; |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1386 |
table.cellspacing = '1'; |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1387 |
table.cellpadding = '4'; |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1388 |
|
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1389 |
var tr = document.createElement('tr'); |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1390 |
|
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1391 |
var td1 = document.createElement('th'); |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1392 |
var td2 = document.createElement('th'); |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1393 |
var td3 = document.createElement('th'); |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1394 |
var td4 = document.createElement('th'); |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1395 |
|
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1396 |
td1.appendChild( document.createTextNode('Release type') ); |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1397 |
td2.appendChild( document.createTextNode('Version') ); |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1398 |
td3.appendChild( document.createTextNode('Code name') ); |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1399 |
td4.appendChild( document.createTextNode('Release notes') ); |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1400 |
|
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1401 |
tr.appendChild(td1); |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1402 |
tr.appendChild(td2); |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1403 |
tr.appendChild(td3); |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1404 |
tr.appendChild(td4); |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1405 |
|
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1406 |
table.appendChild(tr); |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1407 |
|
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1408 |
var cls = 'row2'; |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1409 |
|
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1410 |
var j = 0; |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1411 |
for ( var i in releases ) |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1412 |
{ |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1413 |
j++; |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1414 |
if ( j > 5 ) |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1415 |
break; |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1416 |
if ( update_available && j == 1 ) |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1417 |
cls = 'row1_green'; |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1418 |
else |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1419 |
cls = ( cls == 'row1' ) ? 'row2' : 'row1'; |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1420 |
var release = releases[i]; |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1421 |
var tr = document.createElement('tr'); |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1422 |
window.console.debug(release); |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1423 |
|
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1424 |
var td1 = document.createElement('td'); |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1425 |
var td2 = document.createElement('td'); |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1426 |
var td3 = document.createElement('td'); |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1427 |
var td4 = document.createElement('td'); |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1428 |
|
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1429 |
td1.className = cls; |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1430 |
td2.className = cls; |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1431 |
td3.className = cls; |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1432 |
td4.className = cls; |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1433 |
|
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1434 |
if ( release.tag ) |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1435 |
td1.appendChild( document.createTextNode(release.tag) ); |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1436 |
|
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1437 |
if ( release.version ) |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1438 |
td2.appendChild( document.createTextNode(release.version) ); |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1439 |
|
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1440 |
if ( release.codename ) |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1441 |
td3.appendChild( document.createTextNode(release.codename) ); |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1442 |
|
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1443 |
if ( release.relnotes ) |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1444 |
{ |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1445 |
var a = document.createElement('a'); |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1446 |
a.href = release.relnotes; |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1447 |
a.appendChild(document.createTextNode('View')); |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1448 |
td4.appendChild( a ); |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1449 |
} |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1450 |
|
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1451 |
tr.appendChild(td1); |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1452 |
tr.appendChild(td2); |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1453 |
tr.appendChild(td3); |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1454 |
tr.appendChild(td4); |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1455 |
|
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1456 |
table.appendChild(tr); |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1457 |
} |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1458 |
thediv.appendChild(table); |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1459 |
} |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1460 |
else |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1461 |
{ |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1462 |
thediv.appendChild(document.createTextNode('No releases available.')); |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1463 |
} |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1464 |
} |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1465 |
}); |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1466 |
} |
0437a7cf1acc
Added update-checking function (still a little rough around the edges); added support into admin user CP for changing avatars
Dan
parents:
326
diff
changeset
|
1467 |