author | Dan |
Mon, 29 Oct 2007 22:19:06 -0400 | |
changeset 218 | e878bcf0227e |
parent 215 | 94db56b8124f |
child 221 | e5302cb1945c |
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 |
||
45 |
function ajaxEscape(text) |
|
46 |
{ |
|
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
|
47 |
/* |
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
|
48 |
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
|
49 |
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
|
50 |
*/ |
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
|
51 |
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
|
52 |
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
|
53 |
} |
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
|
54 |
|
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
|
55 |
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
|
56 |
{ |
1 | 57 |
text = escape(text); |
58 |
text = text.replace(/\+/g, '%2B', text); |
|
59 |
return text; |
|
60 |
} |
|
61 |
||
62 |
// Page editor |
|
63 |
||
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
|
64 |
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
|
65 |
{ |
b354deeaa4c4
Vastly improved compatibility with older versions of IE, particularly 5.0, through the use of a kill switch that turns off all AJAX functions
Dan
parents:
40
diff
changeset
|
66 |
// 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
|
67 |
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
|
68 |
return true; |
1 | 69 |
setAjaxLoading(); |
70 |
ajaxGet(stdAjaxPrefix+'&_mode=getsource', function() { |
|
71 |
if(ajax.readyState == 4) { |
|
72 |
unsetAjaxLoading(); |
|
73 |
if(edit_open) { |
|
213
1316404e4ea8
Localized history page and static HTML comment interface
Dan
parents:
211
diff
changeset
|
74 |
c=confirm($lang.get('editor_msg_revert_confirm')); |
1 | 75 |
if(!c) return; |
76 |
} |
|
77 |
edit_open = true; |
|
78 |
selectButtonMajor('article'); |
|
79 |
selectButtonMinor('edit'); |
|
80 |
if(in_array('ajaxEditArea', grippied_textareas)) |
|
81 |
{ |
|
82 |
// Allow the textarea grippifier to re-create the resizer control on the textarea |
|
83 |
grippied_textareas.pop(in_array('ajaxEditArea', grippied_textareas)); |
|
84 |
} |
|
213
1316404e4ea8
Localized history page and static HTML comment interface
Dan
parents:
211
diff
changeset
|
85 |
disableUnload($lang.get('editor_msg_unload')); |
1 | 86 |
var switcher = ( readCookie('enano_editor_mode') == 'tinymce' ) ? |
213
1316404e4ea8
Localized history page and static HTML comment interface
Dan
parents:
211
diff
changeset
|
87 |
'<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
|
88 |
$lang.get('editor_btn_wikitext') + ' | <a href="#" onclick="setEditorMCE(); return false;">' + $lang.get('editor_btn_graphical') + '</a>' ; |
1 | 89 |
document.getElementById('ajaxEditContainer').innerHTML = '\ |
90 |
<div id="mdgPreviewContainer"></div> \ |
|
91 |
<span id="switcher">' + switcher + '</span><br />\ |
|
92 |
<form name="mdgAjaxEditor" method="get" action="#" onsubmit="ajaxSavePage(); return false;">\ |
|
93 |
<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
|
94 |
' + $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
|
95 |
<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
|
96 |
<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 | 97 |
<br />\ |
98 |
'+editNotice+'\ |
|
99 |
</form>'; |
|
100 |
// initTextareas(); |
|
101 |
if(readCookie('enano_editor_mode') == 'tinymce') |
|
102 |
{ |
|
103 |
$('ajaxEditArea').switchToMCE(); |
|
104 |
} |
|
105 |
} |
|
106 |
}); |
|
107 |
} |
|
108 |
||
109 |
function setEditorMCE() |
|
110 |
{ |
|
111 |
$('ajaxEditArea').switchToMCE(); |
|
112 |
createCookie('enano_editor_mode', 'tinymce', 365); |
|
213
1316404e4ea8
Localized history page and static HTML comment interface
Dan
parents:
211
diff
changeset
|
113 |
$('switcher').object.innerHTML = '<a href="#" onclick="setEditorText(); return false;">' + $lang.get('editor_btn_wikitext') + '</a> | ' + $lang.get('editor_btn_graphical'); |
1 | 114 |
} |
115 |
||
116 |
function setEditorText() |
|
117 |
{ |
|
118 |
$('ajaxEditArea').destroyMCE(); |
|
119 |
createCookie('enano_editor_mode', 'text', 365); |
|
213
1316404e4ea8
Localized history page and static HTML comment interface
Dan
parents:
211
diff
changeset
|
120 |
$('switcher').object.innerHTML = $lang.get('editor_btn_wikitext') + ' | <a href="#" onclick="setEditorMCE(); return false;">' + $lang.get('editor_btn_graphical') + '</a>'; |
1 | 121 |
} |
122 |
||
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
|
123 |
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
|
124 |
{ |
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
|
125 |
// 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
|
126 |
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
|
127 |
return true; |
1 | 128 |
setAjaxLoading(); |
129 |
ajaxGet(stdAjaxPrefix+'&_mode=getsource', function() { |
|
130 |
if(ajax.readyState == 4) { |
|
131 |
unsetAjaxLoading(); |
|
214 | 132 |
edit_open = false; |
1 | 133 |
selectButtonMajor('article'); |
134 |
selectButtonMinor('edit'); |
|
135 |
if(in_array('ajaxEditArea', grippied_textareas)) |
|
136 |
{ |
|
137 |
// Allow the textarea grippifier to re-create the resizer control on the textarea |
|
138 |
grippied_textareas.pop(in_array('ajaxEditArea', grippied_textareas)); |
|
139 |
} |
|
140 |
document.getElementById('ajaxEditContainer').innerHTML = '\ |
|
141 |
<form method="get" action="#" onsubmit="ajaxSavePage(); return false;">\ |
|
142 |
<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
|
143 |
<a href="#" onclick="void(ajaxReset()); return false;">' + $lang.get('editor_btn_closeviewer') + '</a>\ |
1 | 144 |
</form>'; |
145 |
initTextareas(); |
|
146 |
} |
|
147 |
}); |
|
148 |
} |
|
149 |
||
150 |
function ajaxShowPreview() |
|
151 |
{ |
|
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
|
152 |
// 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
|
153 |
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
|
154 |
return true; |
1 | 155 |
goBusy('Loading preview...'); |
156 |
var text = ajaxEscape($('ajaxEditArea').getContent()); |
|
157 |
if(document.mdgAjaxEditor.minor.checked) minor='&minor'; |
|
158 |
else minor=''; |
|
159 |
ajaxPost(stdAjaxPrefix+'&_mode=preview', 'summary='+document.getElementById('ajaxEditSummary').value+minor+'&text='+text, function() { |
|
160 |
if(ajax.readyState == 4) { |
|
161 |
unBusy(); |
|
162 |
edit_open = false; |
|
163 |
document.getElementById('mdgPreviewContainer').innerHTML = ajax.responseText; |
|
164 |
} |
|
165 |
}); |
|
166 |
} |
|
167 |
||
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
|
168 |
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
|
169 |
{ |
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
|
170 |
// 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
|
171 |
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
|
172 |
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
|
173 |
//goBusy('Saving page...'); |
1 | 174 |
var text = ajaxEscape($('ajaxEditArea').getContent()); |
175 |
if(document.mdgAjaxEditor.minor.checked) minor='&minor'; |
|
176 |
else minor=''; |
|
177 |
ajaxPost(stdAjaxPrefix+'&_mode=savepage', 'summary='+document.getElementById('ajaxEditSummary').value+minor+'&text='+text, function() { |
|
178 |
if(ajax.readyState == 4) { |
|
179 |
unBusy(); |
|
180 |
edit_open = false; |
|
181 |
document.getElementById('ajaxEditContainer').innerHTML = ajax.responseText; |
|
182 |
enableUnload(); |
|
183 |
unselectAllButtonsMinor(); |
|
184 |
} |
|
185 |
}); |
|
186 |
} |
|
187 |
||
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
|
188 |
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
|
189 |
{ |
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
|
190 |
// 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
|
191 |
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
|
192 |
return true; |
213
1316404e4ea8
Localized history page and static HTML comment interface
Dan
parents:
211
diff
changeset
|
193 |
c = confirm($lang.get('editor_msg_discard_confirm')); |
1 | 194 |
if(!c) return; |
195 |
ajaxReset(); |
|
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 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
|
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 |
enableUnload(); |
204 |
setAjaxLoading(); |
|
205 |
ajaxGet(stdAjaxPrefix+'&_mode=getpage&noheaders', function() { |
|
206 |
if(ajax.readyState == 4) { |
|
207 |
unsetAjaxLoading(); |
|
208 |
edit_open = false; |
|
209 |
document.getElementById('ajaxEditContainer').innerHTML = ajax.responseText; |
|
210 |
selectButtonMajor('article'); |
|
211 |
unselectAllButtonsMinor(); |
|
212 |
} |
|
213 |
}); |
|
214 |
} |
|
215 |
||
216 |
// Miscellaneous AJAX applets |
|
217 |
||
218 |
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
|
219 |
// 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
|
220 |
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
|
221 |
return true; |
1 | 222 |
if(shift) { |
223 |
r = 'NO_REASON'; |
|
224 |
} else { |
|
214 | 225 |
r = prompt($lang.get('ajax_protect_prompt_reason')); |
1 | 226 |
if(!r || r=='') return; |
227 |
} |
|
228 |
setAjaxLoading(); |
|
229 |
document.getElementById('protbtn_0').style.textDecoration = 'none'; |
|
230 |
document.getElementById('protbtn_1').style.textDecoration = 'none'; |
|
231 |
document.getElementById('protbtn_2').style.textDecoration = 'none'; |
|
232 |
document.getElementById('protbtn_'+l).style.textDecoration = 'underline'; |
|
233 |
ajaxPost(stdAjaxPrefix+'&_mode=protect', 'reason='+escape(r)+'&level='+l, function() { |
|
234 |
if(ajax.readyState == 4) { |
|
235 |
unsetAjaxLoading(); |
|
236 |
if(ajax.responseText != 'good') |
|
237 |
alert(ajax.responseText); |
|
238 |
} |
|
239 |
}); |
|
240 |
} |
|
241 |
||
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
|
242 |
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
|
243 |
{ |
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 |
// 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
|
245 |
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
|
246 |
return true; |
214 | 247 |
r = prompt($lang.get('ajax_rename_prompt')); |
1 | 248 |
if(!r || r=='') return; |
249 |
setAjaxLoading(); |
|
250 |
ajaxPost(stdAjaxPrefix+'&_mode=rename', 'newtitle='+escape(r), function() { |
|
251 |
if(ajax.readyState == 4) { |
|
252 |
unsetAjaxLoading(); |
|
253 |
alert(ajax.responseText); |
|
254 |
} |
|
255 |
}); |
|
256 |
} |
|
257 |
||
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
|
258 |
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
|
259 |
{ |
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
|
260 |
// 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
|
261 |
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
|
262 |
return true; |
1 | 263 |
setAjaxLoading(); |
264 |
ajaxPost(ENANO_SPECIAL_CREATEPAGE, ENANO_CREATEPAGE_PARAMS, function() { |
|
265 |
if(ajax.readyState == 4) { |
|
266 |
unsetAjaxLoading(); |
|
267 |
window.location.reload(); |
|
268 |
} |
|
269 |
}); |
|
270 |
} |
|
271 |
||
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
|
272 |
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
|
273 |
{ |
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 |
// 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
|
275 |
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
|
276 |
return true; |
214 | 277 |
var reason = prompt($lang.get('ajax_delete_prompt_reason')); |
28 | 278 |
if ( !reason || reason == '' ) |
279 |
{ |
|
280 |
return false; |
|
281 |
} |
|
214 | 282 |
c = confirm($lang.get('ajax_delete_confirm')); |
28 | 283 |
if(!c) |
284 |
{ |
|
285 |
return; |
|
286 |
} |
|
1 | 287 |
setAjaxLoading(); |
28 | 288 |
ajaxPost(stdAjaxPrefix+'&_mode=deletepage', 'reason=' + escape(reason), function() { |
1 | 289 |
if(ajax.readyState == 4) { |
290 |
unsetAjaxLoading(); |
|
291 |
alert(ajax.responseText); |
|
292 |
window.location.reload(); |
|
293 |
} |
|
294 |
}); |
|
295 |
} |
|
296 |
||
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 |
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
|
298 |
{ |
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 |
// 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
|
300 |
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
|
301 |
return true; |
214 | 302 |
c = confirm($lang.get('ajax_delvote_confirm')); |
1 | 303 |
if(!c) return; |
304 |
setAjaxLoading(); |
|
305 |
ajaxGet(stdAjaxPrefix+'&_mode=delvote', function() { |
|
306 |
if(ajax.readyState == 4) { |
|
307 |
unsetAjaxLoading(); |
|
308 |
alert(ajax.responseText); |
|
309 |
} |
|
310 |
}); |
|
311 |
} |
|
312 |
||
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
|
313 |
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
|
314 |
{ |
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
|
315 |
// 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
|
316 |
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
|
317 |
return true; |
214 | 318 |
c = confirm($lang.get('ajax_delvote_reset_confirm')); |
1 | 319 |
if(!c) return; |
320 |
setAjaxLoading(); |
|
321 |
ajaxGet(stdAjaxPrefix+'&_mode=resetdelvotes', function() { |
|
322 |
if(ajax.readyState == 4) { |
|
323 |
unsetAjaxLoading(); |
|
324 |
alert(ajax.responseText); |
|
325 |
item = document.getElementById('mdgDeleteVoteNoticeBox'); |
|
326 |
if(item) |
|
327 |
{ |
|
328 |
opacity('mdgDeleteVoteNoticeBox', 100, 0, 1000); |
|
329 |
setTimeout("document.getElementById('mdgDeleteVoteNoticeBox').style.display = 'none';", 1000); |
|
330 |
} |
|
331 |
} |
|
332 |
}); |
|
333 |
} |
|
334 |
||
335 |
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
|
336 |
// 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
|
337 |
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
|
338 |
return true; |
1 | 339 |
setAjaxLoading(); |
340 |
document.getElementById('wikibtn_0').style.textDecoration = 'none'; |
|
341 |
document.getElementById('wikibtn_1').style.textDecoration = 'none'; |
|
342 |
document.getElementById('wikibtn_2').style.textDecoration = 'none'; |
|
343 |
document.getElementById('wikibtn_'+val).style.textDecoration = 'underline'; |
|
344 |
ajaxGet(stdAjaxPrefix+'&_mode=setwikimode&mode='+val, function() { |
|
345 |
if(ajax.readyState == 4) { |
|
346 |
unsetAjaxLoading(); |
|
347 |
if(ajax.responseText!='GOOD') |
|
348 |
{ |
|
349 |
alert(ajax.responseText); |
|
350 |
} |
|
351 |
} |
|
352 |
}); |
|
353 |
} |
|
354 |
||
355 |
// Editing/saving category information |
|
356 |
// This was not easy to write, I hope enjoy it, and dang I swear I'm gonna |
|
357 |
// find someone to work on just the Javascript part of Enano... |
|
358 |
||
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
|
359 |
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
|
360 |
{ |
b354deeaa4c4
Vastly improved compatibility with older versions of IE, particularly 5.0, through the use of a kill switch that turns off all AJAX functions
Dan
parents:
40
diff
changeset
|
361 |
// 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
|
362 |
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
|
363 |
return true; |
1 | 364 |
setAjaxLoading(); |
365 |
ajaxGet(stdAjaxPrefix+'&_mode=catedit', function() { |
|
366 |
if(ajax.readyState == 4) { |
|
367 |
unsetAjaxLoading(); |
|
368 |
edit_open = false; |
|
369 |
eval(ajax.responseText); |
|
370 |
} |
|
371 |
}); |
|
372 |
} |
|
373 |
||
374 |
function ajaxCatSave() |
|
375 |
{ |
|
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
|
376 |
// 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
|
377 |
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
|
378 |
return true; |
1 | 379 |
if(!catlist) |
380 |
{ |
|
381 |
alert('Var catlist has no properties'); |
|
382 |
return; |
|
383 |
} |
|
384 |
query=''; |
|
385 |
for(i=0;i<catlist.length;i++) |
|
386 |
{ |
|
387 |
l = 'if(document.forms.mdgCatForm.mdgCat_'+catlist[i]+'.checked) s = true; else s = false;'; |
|
388 |
eval(l); |
|
389 |
if(s) query = query + '&' + catlist[i] + '=true'; |
|
390 |
} |
|
391 |
setAjaxLoading(); |
|
392 |
query = query.substring(1, query.length); |
|
393 |
ajaxPost(stdAjaxPrefix+'&_mode=catsave', query, function() { |
|
394 |
if(ajax.readyState == 4) { |
|
395 |
unsetAjaxLoading(); |
|
396 |
edit_open = false; |
|
397 |
if(ajax.responseText != 'GOOD') alert(ajax.responseText); |
|
398 |
ajaxReset(); |
|
399 |
} |
|
400 |
}); |
|
401 |
} |
|
402 |
||
403 |
// History stuff |
|
404 |
||
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
|
405 |
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
|
406 |
{ |
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
|
407 |
// 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
|
408 |
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
|
409 |
return true; |
1 | 410 |
setAjaxLoading(); |
411 |
ajaxGet(stdAjaxPrefix+'&_mode=histlist', function() { |
|
412 |
if(ajax.readyState == 4) { |
|
413 |
unsetAjaxLoading(); |
|
414 |
edit_open = false; |
|
415 |
selectButtonMajor('article'); |
|
416 |
selectButtonMinor('history'); |
|
417 |
document.getElementById('ajaxEditContainer').innerHTML = ajax.responseText; |
|
418 |
buildDiffList(); |
|
419 |
} |
|
420 |
}); |
|
421 |
} |
|
422 |
||
423 |
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
|
424 |
// 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
|
425 |
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
|
426 |
return true; |
1 | 427 |
if(!tit) tit=title; |
428 |
setAjaxLoading(); |
|
429 |
ajaxGet(append_sid(scriptPath+'/ajax.php?title='+tit+'&_mode=getpage&oldid='+oldid), function() { |
|
430 |
if(ajax.readyState == 4) { |
|
431 |
unsetAjaxLoading(); |
|
432 |
edit_open = false; |
|
433 |
document.getElementById('ajaxEditContainer').innerHTML = ajax.responseText; |
|
434 |
} |
|
435 |
}); |
|
436 |
} |
|
437 |
||
438 |
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
|
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=rollback&id='+id, function() { |
|
444 |
if(ajax.readyState == 4) { |
|
445 |
unsetAjaxLoading(); |
|
446 |
alert(ajax.responseText); |
|
447 |
} |
|
448 |
}); |
|
449 |
} |
|
450 |
||
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
|
451 |
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
|
452 |
{ |
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
|
453 |
// 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
|
454 |
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
|
455 |
return true; |
214 | 456 |
c = confirm($lang.get('ajax_clearlogs_confirm')); |
1 | 457 |
if(!c) return; |
214 | 458 |
c = confirm($lang.get('ajax_clearlogs_confirm_nag')); |
1 | 459 |
if(!c) return; |
460 |
setAjaxLoading(); |
|
461 |
ajaxGet(stdAjaxPrefix+'&_mode=flushlogs', function() { |
|
462 |
if(ajax.readyState == 4) { |
|
463 |
unsetAjaxLoading(); |
|
464 |
alert(ajax.responseText); |
|
465 |
window.location.reload(); |
|
466 |
} |
|
467 |
}); |
|
468 |
} |
|
469 |
||
470 |
var timelist; |
|
471 |
||
472 |
function buildDiffList() |
|
473 |
{ |
|
474 |
arrDiff1Buttons = getElementsByClassName(document, 'input', 'clsDiff1Radio'); |
|
475 |
arrDiff2Buttons = getElementsByClassName(document, 'input', 'clsDiff2Radio'); |
|
476 |
var len = arrDiff1Buttons.length; |
|
477 |
if ( len < 1 ) |
|
478 |
return false; |
|
479 |
timelist = new Array(); |
|
480 |
for ( var i = 0; i < len; i++ ) |
|
481 |
{ |
|
482 |
timelist.push( arrDiff2Buttons[i].id.substr(6) ); |
|
483 |
} |
|
484 |
timelist.push( arrDiff1Buttons[len-1].id.substr(6) ); |
|
485 |
delete(timelist.toJSONString); |
|
486 |
for ( var i = 1; i < timelist.length-1; i++ ) |
|
487 |
{ |
|
488 |
if ( i >= timelist.length ) break; |
|
489 |
arrDiff2Buttons[i].style.display = 'none'; |
|
490 |
} |
|
491 |
} |
|
492 |
||
493 |
function selectDiff1Button(obj) |
|
494 |
{ |
|
495 |
var this_time = obj.id.substr(6); |
|
496 |
var index = parseInt(in_array(this_time, timelist)); |
|
497 |
for ( var i = 0; i < timelist.length - 1; i++ ) |
|
498 |
{ |
|
499 |
if ( i < timelist.length - 1 ) |
|
500 |
{ |
|
501 |
var state = ( i < index ) ? 'inline' : 'none'; |
|
502 |
var id = 'diff2_' + timelist[i]; |
|
503 |
document.getElementById(id).style.display = state; |
|
504 |
||
505 |
// alert("Debug:\nIndex: "+index+"\nState: "+state+"\ni: "+i); |
|
506 |
} |
|
507 |
} |
|
508 |
} |
|
509 |
||
510 |
function selectDiff2Button(obj) |
|
511 |
{ |
|
512 |
var this_time = obj.id.substr(6); |
|
513 |
var index = parseInt(in_array(this_time, timelist)); |
|
514 |
for ( var i = 1; i < timelist.length; i++ ) |
|
515 |
{ |
|
516 |
if ( i < timelist.length - 1 ) |
|
517 |
{ |
|
518 |
var state = ( i > index ) ? 'inline' : 'none'; |
|
519 |
var id = 'diff1_' + timelist[i]; |
|
520 |
document.getElementById(id).style.display = state; |
|
521 |
||
522 |
// alert("Debug:\nIndex: "+index+"\nState: "+state+"\ni: "+i); |
|
523 |
} |
|
524 |
} |
|
525 |
} |
|
526 |
||
527 |
function ajaxHistDiff() |
|
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 |
// 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
|
530 |
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
|
531 |
return true; |
1 | 532 |
var id1=false; |
533 |
var id2=false; |
|
534 |
for ( i = 0; i < arrDiff1Buttons.length; i++ ) |
|
535 |
{ |
|
536 |
k = i + ''; |
|
537 |
kpp = i + 1; |
|
538 |
kpp = kpp + ''; |
|
539 |
if(arrDiff1Buttons[k].checked) id1 = arrDiff1Buttons[k].id.substr(6); |
|
540 |
if(arrDiff2Buttons[k].checked) id2 = arrDiff2Buttons[k].id.substr(6); |
|
541 |
} |
|
542 |
if(!id1 || !id2) { alert('BUG: Couldn\'t get checked radiobutton state'); return; } |
|
543 |
setAjaxLoading(); |
|
544 |
ajaxGet(stdAjaxPrefix+'&_mode=pagediff&diff1='+id1+'&diff2='+id2, function() |
|
545 |
{ |
|
546 |
if(ajax.readyState==4) |
|
547 |
{ |
|
548 |
unsetAjaxLoading(); |
|
549 |
document.getElementById('ajaxEditContainer').innerHTML = ajax.responseText; |
|
550 |
} |
|
551 |
}); |
|
552 |
} |
|
553 |
||
554 |
// Change the user's preferred style/theme |
|
555 |
||
556 |
function ajaxChangeStyle() |
|
557 |
{ |
|
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
|
558 |
// 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
|
559 |
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
|
560 |
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
|
561 |
var inner_html = ''; |
215 | 562 |
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
|
563 |
inner_html += ' <select id="chtheme_sel_theme" onchange="ajaxGetStyles(this.value);">'; |
214 | 564 |
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
|
565 |
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
|
566 |
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
|
567 |
inner_html += '</label></p>'; |
214 | 568 |
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
|
569 |
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
|
570 |
} |
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
571 |
|
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
572 |
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
|
573 |
{ |
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
|
574 |
// 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
|
575 |
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
|
576 |
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
|
577 |
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
|
578 |
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
|
579 |
{ |
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
580 |
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
|
581 |
} |
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
582 |
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
|
583 |
{ |
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
584 |
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
|
585 |
} |
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
586 |
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
|
587 |
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
|
588 |
{ |
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
589 |
// 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
|
590 |
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
|
591 |
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
|
592 |
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
|
593 |
{ |
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
594 |
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
|
595 |
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
|
596 |
} |
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
597 |
|
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
598 |
// 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
|
599 |
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
|
600 |
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
|
601 |
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
|
602 |
{ |
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
603 |
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
|
604 |
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
|
605 |
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
|
606 |
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
|
607 |
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
|
608 |
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
|
609 |
} |
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
610 |
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
|
611 |
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
|
612 |
p_parent.id = 'chtheme_sel_style_parent'; |
215 | 613 |
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
|
614 |
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
|
615 |
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
|
616 |
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
|
617 |
{ |
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
618 |
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
|
619 |
} |
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
620 |
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
|
621 |
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
|
622 |
|
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
623 |
// 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
|
624 |
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
|
625 |
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
|
626 |
|
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
627 |
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
|
628 |
|
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
629 |
} |
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
630 |
}); |
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
631 |
} |
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
632 |
|
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
633 |
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
|
634 |
{ |
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
|
635 |
// 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
|
636 |
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
|
637 |
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
|
638 |
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
|
639 |
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
|
640 |
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
|
641 |
{ |
214 | 642 |
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
|
643 |
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
|
644 |
} |
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 |
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
|
646 |
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
|
647 |
|
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 |
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
|
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 |
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
|
651 |
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
|
652 |
} |
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
653 |
|
e5484a9e0818
Rewrote change theme dialog; a few minor stability fixes here and there; fixed IE + St Patty background image
Dan
parents:
28
diff
changeset
|
654 |
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
|
655 |
{ |
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 |
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
|
657 |
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
|
658 |
} |
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 |
ajaxPost(stdAjaxPrefix + '&_mode=change_theme', 'theme_id=' + escape(theme_id) + '&style_id=' + escape(style_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
|
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 |
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
|
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 |
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
|
665 |
{ |
214 | 666 |
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
|
667 |
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
|
668 |
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
|
669 |
} |
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 |
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
|
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('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
|
673 |
} |
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 |
|
30 | 677 |
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
|
678 |
|
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 |
} |
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 |
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
|
682 |
{ |
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 |
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
|
684 |
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
|
685 |
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
|
686 |
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
|
687 |
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
|
688 |
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
|
689 |
} |
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
|
690 |
|
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
|
691 |
/* |
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
|
692 |
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
|
693 |
{ |
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
|
694 |
// 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
|
695 |
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
|
696 |
return true; |
1 | 697 |
var win = document.getElementById("cn2"); |
698 |
win.innerHTML = ' \ |
|
699 |
<form action="'+ENANO_SPECIAL_CHANGESTYLE+'" onsubmit="jws.closeWin(\'root2\');" method="post" style="text-align: center"> \ |
|
700 |
<h3>Select a theme...</h3>\ |
|
701 |
<select id="mdgThemeID" name="theme" onchange="ajaxGetStyles(this.value);"> \ |
|
702 |
'+ENANO_THEME_LIST+' \ |
|
703 |
</select> \ |
|
704 |
<div id="styleSelector"></div>\ |
|
705 |
<br /><br />\ |
|
706 |
<input type="hidden" name="return_to" value="'+title+'" />\ |
|
707 |
<input id="styleSubmitter" type="submit" style="display: none; font-weight: bold" value="Change theme" /> \ |
|
708 |
<input type="button" value="Cancel" onclick="jws.closeWin(\'root2\');" /> \ |
|
709 |
</form> \ |
|
710 |
'; |
|
711 |
ajaxGetStyles(ENANO_CURRENT_THEME); |
|
712 |
jws.openWin('root2', 340, 300); |
|
713 |
} |
|
714 |
||
715 |
function ajaxGetStyles(id) { |
|
716 |
setAjaxLoading(); |
|
717 |
ajaxGet(stdAjaxPrefix+'&_mode=getstyles&id='+id, function() { |
|
718 |
if(ajax.readyState == 4) { |
|
719 |
unsetAjaxLoading(); |
|
720 |
eval(ajax.responseText); |
|
721 |
html = '<h3>And a style...</h3><select id="mdgStyleID" name="style">'; |
|
722 |
for(i=0;i<list.length;i++) { |
|
723 |
lname = list[i].substr(0, 1).toUpperCase() + list[i].substr(1, list[i].length); |
|
724 |
html = html + '<option value="'+list[i]+'">'+lname+'</option>'; |
|
725 |
} |
|
726 |
html = html + '</select>'; |
|
727 |
document.getElementById('styleSelector').innerHTML = html; |
|
728 |
document.getElementById('styleSubmitter').style.display = 'inline'; |
|
729 |
} |
|
730 |
}); |
|
731 |
} |
|
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
|
732 |
*/ |
1 | 733 |
|
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
|
734 |
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
|
735 |
{ |
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
|
736 |
// 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
|
737 |
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
|
738 |
return true; |
1 | 739 |
setAjaxLoading(); |
740 |
if(_css) { |
|
741 |
document.getElementById('mdgCss').href = main_css; |
|
742 |
_css = false; |
|
743 |
} else { |
|
744 |
document.getElementById('mdgCss').href = print_css; |
|
745 |
_css = true; |
|
746 |
} |
|
747 |
unsetAjaxLoading(); |
|
748 |
menuOff(); |
|
749 |
} |
|
750 |
||
751 |
function ajaxSetPassword() |
|
752 |
{ |
|
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
|
753 |
// 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
|
754 |
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
|
755 |
return true; |
1 | 756 |
pass = hex_sha1(document.getElementById('mdgPassSetField').value); |
757 |
setAjaxLoading(); |
|
758 |
ajaxPost(stdAjaxPrefix+'&_mode=setpass', 'password='+pass, function() |
|
759 |
{ |
|
760 |
unsetAjaxLoading(); |
|
761 |
if(ajax.readyState==4) |
|
762 |
{ |
|
763 |
alert(ajax.responseText); |
|
764 |
} |
|
765 |
} |
|
766 |
); |
|
767 |
} |
|
768 |
||
769 |
function ajaxStartLogin() |
|
770 |
{ |
|
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
|
771 |
// 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
|
772 |
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
|
773 |
return true; |
1 | 774 |
ajaxPromptAdminAuth(function(k) { |
775 |
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
|
776 |
}, 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
|
777 |
} |
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
|
778 |
|
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
|
779 |
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
|
780 |
{ |
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
|
781 |
// 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
|
782 |
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
|
783 |
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
|
784 |
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
|
785 |
{ |
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
|
786 |
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
|
787 |
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
|
788 |
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
|
789 |
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
|
790 |
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
|
791 |
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
|
792 |
}, 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
|
793 |
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
|
794 |
} |
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
|
795 |
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
|
796 |
window.location = loc; |
1 | 797 |
} |
798 |
||
799 |
function ajaxAdminPage() |
|
800 |
{ |
|
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
|
801 |
// 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
|
802 |
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
|
803 |
return true; |
1 | 804 |
if ( auth_level < USER_LEVEL_ADMIN ) |
805 |
{ |
|
806 |
ajaxPromptAdminAuth(function(k) { |
|
807 |
ENANO_SID = k; |
|
808 |
auth_level = USER_LEVEL_ADMIN; |
|
809 |
var loc = String(window.location + ''); |
|
810 |
window.location = append_sid(loc); |
|
811 |
var loc = makeUrlNS('Special', 'Administration', 'module=' + namespace_list['Admin'] + 'PageManager&source=ajax&page_id=' + ajaxEscape(title)); |
|
812 |
if ( (ENANO_SID + ' ').length > 1 ) |
|
813 |
window.location = loc; |
|
814 |
}, 9); |
|
815 |
return false; |
|
816 |
} |
|
817 |
var loc = makeUrlNS('Special', 'Administration', 'module=' + namespace_list['Admin'] + 'PageManager&source=ajax&page_id=' + ajaxEscape(title)); |
|
818 |
window.location = loc; |
|
819 |
} |
|
820 |
||
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
|
821 |
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
|
822 |
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
|
823 |
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
|
824 |
|
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
|
825 |
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
|
826 |
{ |
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
|
827 |
// 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
|
828 |
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
|
829 |
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
|
830 |
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
|
831 |
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
|
832 |
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
|
833 |
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
|
834 |
{ |
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
|
835 |
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
|
836 |
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
|
837 |
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
|
838 |
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
|
839 |
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
|
840 |
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
|
841 |
}, 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
|
842 |
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
|
843 |
} |
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
|
844 |
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
|
845 |
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
|
846 |
} |
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
|
847 |
|
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
|
848 |
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
|
849 |
{ |
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
|
850 |
// 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
|
851 |
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
|
852 |
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
|
853 |
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
|
854 |
{ |
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
|
855 |
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
|
856 |
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
|
857 |
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
|
858 |
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
|
859 |
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
|
860 |
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
|
861 |
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
|
862 |
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
|
863 |
}, 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
|
864 |
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
|
865 |
} |
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
|
866 |
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
|
867 |
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
|
868 |
} |
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
|
869 |
|
11
ccad6026a168
Finalized permissions on files and directories; adding PHP shutoff button (actual shutoff not implemented)
Dan
parents:
1
diff
changeset
|
870 |
function ajaxDisableEmbeddedPHP() |
ccad6026a168
Finalized permissions on files and directories; adding PHP shutoff button (actual shutoff not implemented)
Dan
parents:
1
diff
changeset
|
871 |
{ |
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
|
872 |
// 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
|
873 |
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
|
874 |
return true; |
214 | 875 |
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
|
876 |
return false; |
ccad6026a168
Finalized permissions on files and directories; adding PHP shutoff button (actual shutoff not implemented)
Dan
parents:
1
diff
changeset
|
877 |
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
|
878 |
if ( !$killdiv.object ) |
ccad6026a168
Finalized permissions on files and directories; adding PHP shutoff button (actual shutoff not implemented)
Dan
parents:
1
diff
changeset
|
879 |
{ |
ccad6026a168
Finalized permissions on files and directories; adding PHP shutoff button (actual shutoff not implemented)
Dan
parents:
1
diff
changeset
|
880 |
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
|
881 |
return false; |
ccad6026a168
Finalized permissions on files and directories; adding PHP shutoff button (actual shutoff not implemented)
Dan
parents:
1
diff
changeset
|
882 |
} |
ccad6026a168
Finalized permissions on files and directories; adding PHP shutoff button (actual shutoff not implemented)
Dan
parents:
1
diff
changeset
|
883 |
$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
|
884 |
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
|
885 |
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
|
886 |
if ( ajax.readyState == 4 ) |
ccad6026a168
Finalized permissions on files and directories; adding PHP shutoff button (actual shutoff not implemented)
Dan
parents:
1
diff
changeset
|
887 |
{ |
ccad6026a168
Finalized permissions on files and directories; adding PHP shutoff button (actual shutoff not implemented)
Dan
parents:
1
diff
changeset
|
888 |
if ( ajax.responseText == '1' ) |
ccad6026a168
Finalized permissions on files and directories; adding PHP shutoff button (actual shutoff not implemented)
Dan
parents:
1
diff
changeset
|
889 |
{ |
ccad6026a168
Finalized permissions on files and directories; adding PHP shutoff button (actual shutoff not implemented)
Dan
parents:
1
diff
changeset
|
890 |
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
|
891 |
//$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
|
892 |
$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
|
893 |
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
|
894 |
// 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
|
895 |
newdiv.className = $killdiv.object.className; |
214 | 896 |
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
|
897 |
$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
|
898 |
$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
|
899 |
} |
ccad6026a168
Finalized permissions on files and directories; adding PHP shutoff button (actual shutoff not implemented)
Dan
parents:
1
diff
changeset
|
900 |
else |
ccad6026a168
Finalized permissions on files and directories; adding PHP shutoff button (actual shutoff not implemented)
Dan
parents:
1
diff
changeset
|
901 |
{ |
ccad6026a168
Finalized permissions on files and directories; adding PHP shutoff button (actual shutoff not implemented)
Dan
parents:
1
diff
changeset
|
902 |
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
|
903 |
$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
|
904 |
} |
ccad6026a168
Finalized permissions on files and directories; adding PHP shutoff button (actual shutoff not implemented)
Dan
parents:
1
diff
changeset
|
905 |
} |
ccad6026a168
Finalized permissions on files and directories; adding PHP shutoff button (actual shutoff not implemented)
Dan
parents:
1
diff
changeset
|
906 |
}); |
ccad6026a168
Finalized permissions on files and directories; adding PHP shutoff button (actual shutoff not implemented)
Dan
parents:
1
diff
changeset
|
907 |
} |
ccad6026a168
Finalized permissions on files and directories; adding PHP shutoff button (actual shutoff not implemented)
Dan
parents:
1
diff
changeset
|
908 |
|
76
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
909 |
var catHTMLBuf = false; |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
910 |
|
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
911 |
function ajaxCatToTag() |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
912 |
{ |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
913 |
if ( KILL_SWITCH ) |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
914 |
return false; |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
915 |
setAjaxLoading(); |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
916 |
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
|
917 |
{ |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
918 |
if ( ajax.readyState == 4 ) |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
919 |
{ |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
920 |
unsetAjaxLoading(); |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
921 |
var resptext = String(ajax.responseText + ' '); |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
922 |
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
|
923 |
if ( resptext.substr(0, 1) != '{' ) |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
924 |
{ |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
925 |
alert('Invalid JSON response from server:\n' + resptext); |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
926 |
return false; |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
927 |
} |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
928 |
var json = parseJSON(resptext); |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
929 |
var catbox = document.getElementById('mdgCatBox'); |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
930 |
if ( !catbox ) |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
931 |
return false; |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
932 |
var linkbox = catbox.parentNode.firstChild.firstChild.nextSibling; |
214 | 933 |
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
|
934 |
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
|
935 |
catHTMLBuf = catbox.innerHTML; |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
936 |
catbox.innerHTML = ''; |
214 | 937 |
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
|
938 |
if ( json.tags.length < 1 ) |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
939 |
{ |
214 | 940 |
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
|
941 |
} |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
942 |
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
|
943 |
{ |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
944 |
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
|
945 |
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
|
946 |
{ |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
947 |
catbox.appendChild(document.createTextNode(' ')); |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
948 |
var a = document.createElement('a'); |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
949 |
a.appendChild(document.createTextNode('[X]')); |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
950 |
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
|
951 |
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
|
952 |
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
|
953 |
catbox.appendChild(a); |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
954 |
} |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
955 |
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
|
956 |
catbox.appendChild(document.createTextNode(', ')); |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
957 |
} |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
958 |
if ( json.can_add ) |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
959 |
{ |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
960 |
catbox.appendChild(document.createTextNode(' ')); |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
961 |
var addlink = document.createElement('a'); |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
962 |
addlink.href = '#'; |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
963 |
addlink.onclick = function() { try { ajaxAddTagStage1(); } catch(e) { }; return false; }; |
214 | 964 |
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
|
965 |
catbox.appendChild(addlink); |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
966 |
} |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
967 |
} |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
968 |
}); |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
969 |
} |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
970 |
|
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
|
971 |
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
|
972 |
|
76
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
973 |
function ajaxAddTagStage1() |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
974 |
{ |
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
|
975 |
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
|
976 |
return false; |
76
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
977 |
var catbox = document.getElementById('mdgCatBox'); |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
978 |
var adddiv = document.createElement('div'); |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
979 |
var text = document.createElement('input'); |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
980 |
var addlink = document.createElement('a'); |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
981 |
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
|
982 |
addlink.onclick = function() { ajaxAddTagStage2(this.parentNode.firstChild.nextSibling.value, this.parentNode); return false; }; |
214 | 983 |
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
|
984 |
text.type = 'text'; |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
985 |
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
|
986 |
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
|
987 |
{ |
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
|
988 |
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
|
989 |
{ |
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
|
990 |
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
|
991 |
} |
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
|
992 |
} |
76
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
993 |
|
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
994 |
adddiv.style.margin = '5px 0 0 0'; |
214 | 995 |
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
|
996 |
adddiv.appendChild(text); |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
997 |
adddiv.appendChild(document.createTextNode(' ')); |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
998 |
adddiv.appendChild(addlink); |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
999 |
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
|
1000 |
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
|
1001 |
} |
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
|
1002 |
|
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
|
1003 |
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
|
1004 |
|
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
|
1005 |
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
|
1006 |
{ |
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
|
1007 |
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
|
1008 |
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
|
1009 |
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
|
1010 |
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
|
1011 |
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
|
1012 |
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
|
1013 |
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
|
1014 |
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
|
1015 |
{ |
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
|
1016 |
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
|
1017 |
{ |
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
|
1018 |
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
|
1019 |
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
|
1020 |
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
|
1021 |
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
|
1022 |
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
|
1023 |
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
|
1024 |
{ |
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
|
1025 |
alert('Invalid JSON response from server:\n' + 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
|
1026 |
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
|
1027 |
} |
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
|
1028 |
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
|
1029 |
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
|
1030 |
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
|
1031 |
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
|
1032 |
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
|
1033 |
{ |
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
|
1034 |
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
|
1035 |
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
|
1036 |
var nukeafter = false; |
214 | 1037 |
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
|
1038 |
{ |
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
|
1039 |
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
|
1040 |
} |
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
|
1041 |
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
|
1042 |
// 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
|
1043 |
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
|
1044 |
{ |
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
|
1045 |
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
|
1046 |
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
|
1047 |
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
|
1048 |
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
|
1049 |
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
|
1050 |
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
|
1051 |
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
|
1052 |
} |
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 |
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
|
1054 |
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
|
1055 |
{ |
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
|
1056 |
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
|
1057 |
} |
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
|
1058 |
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
|
1059 |
{ |
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 |
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
|
1061 |
} |
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
|
1062 |
} |
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
|
1063 |
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
|
1064 |
{ |
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 |
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
|
1066 |
} |
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 |
}); |
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 |
|
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
|
1071 |
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
|
1072 |
{ |
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
|
1073 |
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
|
1074 |
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
|
1075 |
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
|
1076 |
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
|
1077 |
arrDelete.push(parentobj.previousSibling.previousSibling.previousSibling); |
214 | 1078 |
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
|
1079 |
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
|
1080 |
|
214 | 1081 |
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
|
1082 |
parentobj.nextSibling.nextSibling.firstChild ) |
214 | 1083 |
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
|
1084 |
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
|
1085 |
|
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 |
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
|
1087 |
{ |
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 |
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
|
1089 |
{ |
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 |
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
|
1091 |
{ |
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 |
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
|
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 |
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
|
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 |
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
|
1097 |
} 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
|
1098 |
} |
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 |
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
|
1100 |
{ |
214 | 1101 |
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
|
1102 |
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
|
1103 |
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
|
1104 |
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
|
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 |
} |
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 |
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
|
1108 |
{ |
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 |
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
|
1110 |
} |
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 |
}); |
76
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
1113 |
} |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
1114 |
|
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
1115 |
function ajaxTagToCat() |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
1116 |
{ |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
1117 |
if ( !catHTMLBuf ) |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
1118 |
return false; |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
1119 |
var catbox = document.getElementById('mdgCatBox'); |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
1120 |
if ( !catbox ) |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
1121 |
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
|
1122 |
addtag_open = false; |
76
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
1123 |
var linkbox = catbox.parentNode.firstChild.firstChild.nextSibling; |
214 | 1124 |
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
|
1125 |
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
|
1126 |
catbox.innerHTML = catHTMLBuf; |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
1127 |
catHTMLBuf = false; |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
1128 |
} |
608dee512bf0
Work started on page tags, still aways to go, but syncing to Nighthawk
Dan
parents:
60
diff
changeset
|
1129 |
|
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
|
1130 |
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
|
1131 |
|
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
|
1132 |
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
|
1133 |
{ |
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
|
1134 |
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
|
1135 |
{ |
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
|
1136 |
}); |
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
|
1137 |
} |
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
|
1138 |
|
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
|
1139 |
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
|
1140 |
{ |
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
|
1141 |
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
|
1142 |
{ |
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
|
1143 |
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
|
1144 |
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
|
1145 |
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
|
1146 |
var span = document.getElementById('keepalivestat'); |
211 | 1147 |
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
|
1148 |
} |
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
|
1149 |
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
|
1150 |
{ |
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
|
1151 |
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
|
1152 |
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
|
1153 |
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
|
1154 |
var span = document.getElementById('keepalivestat'); |
211 | 1155 |
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
|
1156 |
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
|
1157 |
} |
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
|
1158 |
} |
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
|
1159 |
|
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
|
1160 |
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
|
1161 |
{ |
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
|
1162 |
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
|
1163 |
{ |
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
|
1164 |
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
|
1165 |
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
|
1166 |
var span = document.getElementById('keepalivestat'); |
211 | 1167 |
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
|
1168 |
} |
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
|
1169 |
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
|
1170 |
{ |
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
|
1171 |
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
|
1172 |
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
|
1173 |
var span = document.getElementById('keepalivestat'); |
211 | 1174 |
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
|
1175 |
} |
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
|
1176 |
}; |
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
|
1177 |
|
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
|
1178 |
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
|
1179 |
{ |
211 | 1180 |
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
|
1181 |
} |
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
|
1182 |
|
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
|
1183 |
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
|
1184 |
{ |
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
|
1185 |
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
|
1186 |
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
|
1187 |
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
|
1188 |
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
|
1189 |
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
|
1190 |
mydiv.id = 'autoCaptcha'; |
209 | 1191 |
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
|
1192 |
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
|
1193 |
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
|
1194 |
{ |
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
|
1195 |
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
|
1196 |
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
|
1197 |
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
|
1198 |
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
|
1199 |
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
|
1200 |
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
|
1201 |
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
|
1202 |
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
|
1203 |
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
|
1204 |
}; |
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
|
1205 |
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
|
1206 |
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
|
1207 |
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
|
1208 |
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
|
1209 |
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
|
1210 |
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
|
1211 |
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
|
1212 |
} |
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
|
1213 |