Mercurial > hg > fapweb
annotate admin.js @ 644:de35a9743557
Implement changing of compo type.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Mon, 03 Nov 2014 02:14:54 +0200 |
parents | c78e11aa3162 |
children | 1005de5ee3f0 |
rev | line source |
---|---|
599
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1 // |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2 // FAPWeb - Simple Web-based Demoparty Management System |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
3 // Party administration page frontend module |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
4 // (C) Copyright 2012-2014 Tecnic Software productions (TNSP) |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
5 // |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
6 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
7 var activeAttendee = -1, prevAttendee = -1; |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
8 var activeTmp = ""; |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
9 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
10 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
11 function jsCloseAdminPopup() |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
12 { |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
13 var nitem = document.getElementById("adminPopup"); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
14 if (nitem) |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
15 { |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
16 nitem.innerHTML = ""; |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
17 nitem.style.display = "none"; |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
18 } |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
19 } |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
20 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
21 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
22 function jsOpenAdminPopup(txt) |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
23 { |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
24 var nitem = document.getElementById("adminPopup"); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
25 if (nitem) |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
26 { |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
27 nitem.innerHTML = txt; |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
28 nitem.style.display = "block"; |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
29 } |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
30 } |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
31 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
32 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
33 function jsRefreshItems(id,name,extra) |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
34 { |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
35 var msuccess = function(txt) |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
36 { |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
37 var nitem = document.getElementById(id); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
38 if (nitem) nitem.innerHTML = txt; |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
39 } |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
40 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
41 jsSendPOSTRequest("action=get&type="+name+extra, msuccess); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
42 } |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
43 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
44 |
608
7d676c77e3f8
Add functionality for deleting a compo.
Matti Hamalainen <ccr@tnsp.org>
parents:
602
diff
changeset
|
45 function jsDeleteItem(id,prefix,type,func,dsc,dsc2) |
599
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
46 { |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
47 var msuccess = function(txt) |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
48 { |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
49 var item = document.getElementById(prefix+id); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
50 item.style.display = "none"; |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
51 setTimeout(func, 50); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
52 } |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
53 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
54 // Clearly mark the element when asking confirmation |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
55 var item = document.getElementById(prefix+id); |
618
0508fb0c1304
Improve deletion warnings in admin interface.
Matti Hamalainen <ccr@tnsp.org>
parents:
608
diff
changeset
|
56 var tmp = item.className; |
0508fb0c1304
Improve deletion warnings in admin interface.
Matti Hamalainen <ccr@tnsp.org>
parents:
608
diff
changeset
|
57 item.className += " deleteWarning"; |
599
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
58 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
59 // Ask confirmation for deletion |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
60 var mcb_ok = function (data) |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
61 { |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
62 jsSendPOSTRequest("action=delete&type="+type+"&id="+id, msuccess); |
618
0508fb0c1304
Improve deletion warnings in admin interface.
Matti Hamalainen <ccr@tnsp.org>
parents:
608
diff
changeset
|
63 item.className = tmp; |
599
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
64 } |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
65 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
66 var mcb_cancel = function (data) |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
67 { |
618
0508fb0c1304
Improve deletion warnings in admin interface.
Matti Hamalainen <ccr@tnsp.org>
parents:
608
diff
changeset
|
68 item.className = tmp; |
599
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
69 } |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
70 |
608
7d676c77e3f8
Add functionality for deleting a compo.
Matti Hamalainen <ccr@tnsp.org>
parents:
602
diff
changeset
|
71 if (dsc) |
7d676c77e3f8
Add functionality for deleting a compo.
Matti Hamalainen <ccr@tnsp.org>
parents:
602
diff
changeset
|
72 jsConfirmBox("Are you sure you want to delete "+dsc+" #"+id+"?", mcb_ok, mcb_cancel, 0); |
7d676c77e3f8
Add functionality for deleting a compo.
Matti Hamalainen <ccr@tnsp.org>
parents:
602
diff
changeset
|
73 else |
7d676c77e3f8
Add functionality for deleting a compo.
Matti Hamalainen <ccr@tnsp.org>
parents:
602
diff
changeset
|
74 jsConfirmBox(dsc2, mcb_ok, mcb_cancel, 0); |
599
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
75 } |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
76 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
77 |
632 | 78 function jsRefreshPanels(id, tab, args, set_default) |
79 { | |
80 var msuccess = function(txt) | |
81 { | |
82 var nitem = document.getElementById(tab); | |
83 if (nitem) | |
84 { | |
85 if (nitem.innerHTML == "") | |
86 { | |
87 nitem.innerHTML = | |
88 "<div id=\"tabHeaders"+id+"\" class=\"tabHeadersSub\"></div>" + | |
89 "<div id=\"tabContents"+id+"\" class=\"tabContentsSub\"></div>"; | |
90 } | |
91 | |
92 try { | |
93 var tmp = JSON.parse("{"+ txt +"}"); | |
94 registeredTabs[id] = tmp; | |
95 jsUpdateTabList(id, ""); | |
96 if (activeTabs[id]) | |
97 jsSwitchActiveTab(id, activeTabs[id]); | |
98 else | |
99 if (set_default == "*") | |
100 { | |
101 for (var nid in registeredTabs[id]) | |
102 { | |
103 jsSwitchActiveTab(id, nid); | |
104 break; | |
105 } | |
106 } | |
107 else | |
108 if (set_default != "") | |
109 jsSwitchActiveTab(id, set_default); | |
110 } | |
111 catch (err) { | |
112 jsMessageBox("JSON.parse("+ txt +") failure: "+ err); | |
113 } | |
114 } | |
115 } | |
116 | |
117 jsSendPOSTRequest("action=get&type="+args, msuccess); | |
118 } | |
119 | |
120 | |
599
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
121 function refreshDispatchCC(id) |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
122 { |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
123 switch (id) |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
124 { |
624
aad32d21091f
Some work on settings groups.
Matti Hamalainen <ccr@tnsp.org>
parents:
618
diff
changeset
|
125 case "Settings" : refreshCCSettings(); break; |
602 | 126 case "News" : jsRefreshItems("tabContCCNews", "news", ""); break; |
618
0508fb0c1304
Improve deletion warnings in admin interface.
Matti Hamalainen <ccr@tnsp.org>
parents:
608
diff
changeset
|
127 case "Attendees" : jsRefreshItems("tabContCCAttendees", "attendees", ""); activeAttendee = -1; break; |
602 | 128 case "Voting" : jsRefreshItems("tabContCCVoting", "voters", ""); break; |
129 case "Compos" : jsRefreshItems("tabContCCCompos", "compos", ""); break; | |
130 case "InfoSys" : jsRefreshItems("tabContCCInfoSys", "infoMain", ""); break; | |
131 case "Entries" : refreshCCEntries(); break; | |
599
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
132 } |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
133 } |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
134 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
135 |
624
aad32d21091f
Some work on settings groups.
Matti Hamalainen <ccr@tnsp.org>
parents:
618
diff
changeset
|
136 function refreshCCSettings() |
aad32d21091f
Some work on settings groups.
Matti Hamalainen <ccr@tnsp.org>
parents:
618
diff
changeset
|
137 { |
632 | 138 jsRefreshPanels("CS", "tabContCCSettings", "settingslist", "*"); |
624
aad32d21091f
Some work on settings groups.
Matti Hamalainen <ccr@tnsp.org>
parents:
618
diff
changeset
|
139 } |
aad32d21091f
Some work on settings groups.
Matti Hamalainen <ccr@tnsp.org>
parents:
618
diff
changeset
|
140 |
aad32d21091f
Some work on settings groups.
Matti Hamalainen <ccr@tnsp.org>
parents:
618
diff
changeset
|
141 |
aad32d21091f
Some work on settings groups.
Matti Hamalainen <ccr@tnsp.org>
parents:
618
diff
changeset
|
142 function refreshDispatchCS(id) |
aad32d21091f
Some work on settings groups.
Matti Hamalainen <ccr@tnsp.org>
parents:
618
diff
changeset
|
143 { |
aad32d21091f
Some work on settings groups.
Matti Hamalainen <ccr@tnsp.org>
parents:
618
diff
changeset
|
144 jsRefreshItems("tabContCS"+ id, "settings", "&id="+ id); |
aad32d21091f
Some work on settings groups.
Matti Hamalainen <ccr@tnsp.org>
parents:
618
diff
changeset
|
145 } |
aad32d21091f
Some work on settings groups.
Matti Hamalainen <ccr@tnsp.org>
parents:
618
diff
changeset
|
146 |
aad32d21091f
Some work on settings groups.
Matti Hamalainen <ccr@tnsp.org>
parents:
618
diff
changeset
|
147 |
599
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
148 function refreshCCAttendee(id) |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
149 { |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
150 jsRefreshItems("attendee"+ id, "attendee", "&id="+ id); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
151 } |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
152 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
153 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
154 function refreshCCEntries() |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
155 { |
632 | 156 jsRefreshPanels("CM", "tabContCCEntries", "compolist", ""); |
599
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
157 } |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
158 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
159 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
160 function refreshCMEntry(id) |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
161 { |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
162 jsRefreshItems("entry"+ id, "entry", "&id="+ id); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
163 } |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
164 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
165 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
166 function refreshDispatchCM(id) |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
167 { |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
168 jsRefreshItems("tabContCM"+ id, "entries", "&id="+ id); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
169 } |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
170 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
171 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
172 function addNews() |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
173 { |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
174 var args = jsMakePostArgs({"title":1,"text":1,"author":1}, "nn", ""); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
175 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
176 var msuccess = function(txt) |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
177 { |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
178 setTimeout("refreshDispatchCC('News');", 50); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
179 } |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
180 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
181 if (args != "") |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
182 jsSendPOSTRequest("action=add&type=news&"+args, msuccess); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
183 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
184 return false; |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
185 } |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
186 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
187 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
188 function deleteNews(id) |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
189 { |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
190 jsDeleteItem(id, "news", "news", "refreshDispatchCC('News');", "news item"); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
191 } |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
192 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
193 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
194 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
195 function updateNews(id) |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
196 { |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
197 var args = jsMakePostArgs({"title":1,"text":1,"author":1}, "ne", id); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
198 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
199 var msuccess = function(txt) |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
200 { |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
201 jsRefreshItems("news"+id, "newsitem", "&id="+id); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
202 } |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
203 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
204 if (args != "") |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
205 jsSendPOSTRequest("action=update&type=news&id="+id+"&"+args, msuccess); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
206 } |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
207 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
208 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
209 function addAttendee() |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
210 { |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
211 var args = jsMakePostArgs({"name":1,"groups":1,"oneliner":1,"email":1}, "ne", "x"); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
212 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
213 var msuccess = function(txt) |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
214 { |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
215 setTimeout("refreshDispatchCC('Attendees');", 50); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
216 } |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
217 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
218 if (args != "") |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
219 jsSendPOSTRequest("action=add&type=attendees&"+args, msuccess); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
220 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
221 return false; |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
222 } |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
223 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
224 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
225 function deleteAttendee(id) |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
226 { |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
227 jsDeleteItem(id, "attendee", "attendees", "refreshDispatchCC('Attendees');", "attendee"); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
228 } |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
229 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
230 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
231 function updateAttendee(id) |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
232 { |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
233 var args = jsMakePostArgs({"name":1,"groups":1,"oneliner":1,"email":1}, "at", id); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
234 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
235 var msuccess = function(txt) |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
236 { |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
237 jsRefreshItems("attendee"+id, "attendee", "&id="+id+"&edit=1"); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
238 } |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
239 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
240 if (args != "") |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
241 jsSendPOSTRequest("action=update&type=attendees&id="+id+"&"+args, msuccess); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
242 } |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
243 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
244 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
245 function activateAttendee(id) |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
246 { |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
247 var msuccess1 = function(txt) |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
248 { |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
249 var nitem = document.getElementById("attendee"+prevAttendee); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
250 if (nitem) |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
251 { |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
252 nitem.innerHTML = txt; |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
253 nitem.style.background = activeTmp; |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
254 } |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
255 } |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
256 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
257 var msuccess2 = function(txt) |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
258 { |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
259 var nitem = document.getElementById("attendee"+id); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
260 if (nitem) |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
261 { |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
262 nitem.innerHTML = txt; |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
263 activeTmp = nitem.style.background; |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
264 nitem.style.background = "green"; |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
265 activeAttendee = id; |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
266 } |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
267 } |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
268 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
269 if (activeAttendee != id) |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
270 { |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
271 prevAttendee = activeAttendee; |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
272 activeAttendee = id; |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
273 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
274 if (prevAttendee != -1) |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
275 jsSendPOSTRequest("action=get&type=attendee&id="+prevAttendee+"&edit=0", msuccess1); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
276 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
277 jsSendPOSTRequest("action=get&type=attendee&id="+id+"&edit=1", msuccess2); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
278 } |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
279 } |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
280 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
281 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
282 function addCompo() |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
283 { |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
284 var args = jsMakePostArgs({"name":1, "description":1}, "nc", ""); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
285 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
286 var msuccess = function(txt) |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
287 { |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
288 setTimeout("refreshDispatchCC('Compos');", 50); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
289 } |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
290 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
291 if (args != "") |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
292 jsSendPOSTRequest("action=add&type=compo&"+args, msuccess); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
293 return false; |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
294 } |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
295 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
296 |
644
de35a9743557
Implement changing of compo type.
Matti Hamalainen <ccr@tnsp.org>
parents:
640
diff
changeset
|
297 function updateCompoType(id) |
de35a9743557
Implement changing of compo type.
Matti Hamalainen <ccr@tnsp.org>
parents:
640
diff
changeset
|
298 { |
de35a9743557
Implement changing of compo type.
Matti Hamalainen <ccr@tnsp.org>
parents:
640
diff
changeset
|
299 var msuccess = function(txt) |
de35a9743557
Implement changing of compo type.
Matti Hamalainen <ccr@tnsp.org>
parents:
640
diff
changeset
|
300 { |
de35a9743557
Implement changing of compo type.
Matti Hamalainen <ccr@tnsp.org>
parents:
640
diff
changeset
|
301 jsRefreshItems("compo"+id, "compo", "&id="+id); |
de35a9743557
Implement changing of compo type.
Matti Hamalainen <ccr@tnsp.org>
parents:
640
diff
changeset
|
302 } |
de35a9743557
Implement changing of compo type.
Matti Hamalainen <ccr@tnsp.org>
parents:
640
diff
changeset
|
303 |
de35a9743557
Implement changing of compo type.
Matti Hamalainen <ccr@tnsp.org>
parents:
640
diff
changeset
|
304 jsSendPOSTRequest("action=update&type=compotype&id="+id+"&ctype="+jsGetValue("cotype"+id+"Sel", 4), msuccess); |
de35a9743557
Implement changing of compo type.
Matti Hamalainen <ccr@tnsp.org>
parents:
640
diff
changeset
|
305 } |
de35a9743557
Implement changing of compo type.
Matti Hamalainen <ccr@tnsp.org>
parents:
640
diff
changeset
|
306 |
de35a9743557
Implement changing of compo type.
Matti Hamalainen <ccr@tnsp.org>
parents:
640
diff
changeset
|
307 |
599
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
308 function updateCompo(id) |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
309 { |
640
c78e11aa3162
Rename a database field, so that it does not conflict with AJAX request item
Matti Hamalainen <ccr@tnsp.org>
parents:
635
diff
changeset
|
310 var args = jsMakePostArgs({"name":1, "description":1, "visible":3, "voting":3, "show_authors":3, "cpath":1}, "co", id); |
599
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
311 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
312 var msuccess = function(txt) |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
313 { |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
314 jsRefreshItems("compo"+id, "compo", "&id="+id); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
315 } |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
316 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
317 if (args != "") |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
318 jsSendPOSTRequest("action=update&type=compo&id="+id+"&"+args, msuccess); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
319 } |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
320 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
321 |
608
7d676c77e3f8
Add functionality for deleting a compo.
Matti Hamalainen <ccr@tnsp.org>
parents:
602
diff
changeset
|
322 function deleteCompo(id) |
7d676c77e3f8
Add functionality for deleting a compo.
Matti Hamalainen <ccr@tnsp.org>
parents:
602
diff
changeset
|
323 { |
7d676c77e3f8
Add functionality for deleting a compo.
Matti Hamalainen <ccr@tnsp.org>
parents:
602
diff
changeset
|
324 jsDeleteItem(id, "compo", "compo", "refreshDispatchCC('Compos');", 0, |
7d676c77e3f8
Add functionality for deleting a compo.
Matti Hamalainen <ccr@tnsp.org>
parents:
602
diff
changeset
|
325 "Are you ABSOLUTELY sure you want to delete compo #"+id+"? "+ |
7d676c77e3f8
Add functionality for deleting a compo.
Matti Hamalainen <ccr@tnsp.org>
parents:
602
diff
changeset
|
326 "This will delete all votes AND entries related to it!"); |
7d676c77e3f8
Add functionality for deleting a compo.
Matti Hamalainen <ccr@tnsp.org>
parents:
602
diff
changeset
|
327 } |
7d676c77e3f8
Add functionality for deleting a compo.
Matti Hamalainen <ccr@tnsp.org>
parents:
602
diff
changeset
|
328 |
7d676c77e3f8
Add functionality for deleting a compo.
Matti Hamalainen <ccr@tnsp.org>
parents:
602
diff
changeset
|
329 |
599
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
330 function addEntry(id) |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
331 { |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
332 var args = jsMakePostArgs({"name":1, "author":1, "filename":1, "info":1}, "ne", id); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
333 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
334 var msuccess = function(txt) |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
335 { |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
336 setTimeout("refreshDispatchCM("+ id +");", 50); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
337 } |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
338 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
339 if (args != "") |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
340 jsSendPOSTRequest("action=add&type=entry&compo_id="+id+"&"+args, msuccess); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
341 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
342 return false; |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
343 } |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
344 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
345 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
346 function updateEntry(cid, id) |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
347 { |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
348 var args = jsMakePostArgs({"name":1, "author":1, "filename":1, "info":1, "compo_id":2}, "en", id); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
349 var compo_id = lastPostArgs["compo_id"]; |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
350 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
351 var msuccess = function(txt) |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
352 { |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
353 if (cid != compo_id) |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
354 { |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
355 var nitem = document.getElementById("entry"+ id); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
356 if (nitem) |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
357 nitem.style.display = "none"; |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
358 } |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
359 else |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
360 setTimeout("refreshCMEntry("+ id +");", 50); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
361 } |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
362 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
363 if (args != "") |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
364 jsSendPOSTRequest("action=update&type=entry&id="+id+"&"+args, msuccess); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
365 } |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
366 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
367 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
368 function deleteEntry(cid, id) |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
369 { |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
370 jsDeleteItem(id, "entry", "entries", "refreshDispatchCM("+ cid +");", "entry"); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
371 } |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
372 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
373 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
374 function voteKeyRefresh(id) |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
375 { |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
376 var msuccess2 = function(txt) |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
377 { |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
378 var nitem = document.getElementById("vkey"+id); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
379 if (nitem) |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
380 nitem.className = txt; |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
381 } |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
382 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
383 var msuccess1 = function(txt) |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
384 { |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
385 var nitem = document.getElementById("vkey"+id); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
386 if (nitem) |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
387 nitem.innerHTML = txt; |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
388 } |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
389 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
390 jsSendPOSTRequest("action=get&type=votekey&id="+id, msuccess1); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
391 jsSendPOSTRequest("action=get&type=votekeyclass&id="+id, msuccess2); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
392 } |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
393 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
394 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
395 function voteKeyUpdate(id, type, args) |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
396 { |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
397 var msuccess = function(txt) |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
398 { |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
399 voteKeyRefresh(id); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
400 } |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
401 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
402 jsSendPOSTRequest("action=votekey&type="+type+"&id="+id+"&"+args, msuccess); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
403 } |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
404 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
405 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
406 function voteKeySetActive(id) |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
407 { |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
408 var args = jsMakePostArgs({"active":3}, "vk", id); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
409 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
410 var mcb_ok = function (data) |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
411 { |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
412 voteKeyUpdate(id, "active", args); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
413 } |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
414 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
415 var mcb_cancel = function (data) |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
416 { |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
417 voteKeyRefresh(id); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
418 } |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
419 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
420 if (lastPostArgs["active"] == 0) |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
421 jsConfirmBox("Are you sure you want to deactivate vote key #"+id+"?", mcb_ok, mcb_cancel, 0); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
422 else |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
423 mcb_ok(0); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
424 } |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
425 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
426 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
427 function voteKeyAssign(id, mode) |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
428 { |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
429 var args = jsMakePostArgs({"key_id":2}, "vk", id); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
430 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
431 var mcb_ok = function (data) |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
432 { |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
433 voteKeyUpdate(id, (mode ? "assign" : "clear"), args); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
434 } |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
435 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
436 if (mode == 0) |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
437 jsConfirmBox("Are you sure you want to clear vote key assign #"+id+"?", mcb_ok, 0, 0); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
438 else |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
439 mcb_ok(0); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
440 } |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
441 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
442 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
443 function performSystemCheck() |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
444 { |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
445 jsSendPOSTRequest("action=check", jsMessageBox); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
446 } |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
447 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
448 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
449 function generateEntryPositions(id, patch) |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
450 { |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
451 var msuccess = function (data) |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
452 { |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
453 refreshDispatchCM(id); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
454 refreshCurrEntryData(); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
455 refreshCurrEntryListData(); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
456 } |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
457 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
458 var mcb_ok = function (data) |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
459 { |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
460 if (id == 0) |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
461 jsSendPOSTRequest("action=randomize&type=all&patch="+patch, msuccess); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
462 else |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
463 jsSendPOSTRequest("action=randomize&type=compo&id="+id+"&patch="+patch, msuccess); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
464 } |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
465 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
466 if (patch == 0) |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
467 { |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
468 jsConfirmBox("Are you <b>sure</b> you want to delete and regenerate entry show positions "+ |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
469 (id == 0 ? "for ALL compos" : "for this compo") +"? "+ |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
470 "<b>This will completely annihilate current show position numbers!</b>", mcb_ok, 0, 0); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
471 } |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
472 else |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
473 mcb_ok(0); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
474 } |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
475 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
476 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
477 // |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
478 // Competition control |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
479 // |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
480 function setShowMode(mode) |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
481 { |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
482 jsSendPOSTRequest("action=ctrl&type=setShowMode&mode="+mode); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
483 } |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
484 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
485 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
486 function refreshCurrEntryData() |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
487 { |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
488 jsRefreshItems("ctrlCurrEntryData", "infoCurrEntryData", ""); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
489 } |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
490 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
491 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
492 function refreshCurrEntryListData() |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
493 { |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
494 jsRefreshItems("ctrlEntryList", "infoCurrEntryList", ""); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
495 refreshCurrEntryData(); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
496 } |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
497 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
498 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
499 function activateCompo() |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
500 { |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
501 jsSendPOSTRequest("action=ctrl&type=setCompoID&id="+jsGetValue("ctrlCompoListSel", 4), refreshCurrEntryListData); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
502 } |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
503 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
504 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
505 function setSelectedEntry() |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
506 { |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
507 jsSendPOSTRequest("action=ctrl&type=setEntry&index="+jsGetValue("ctrlEntryListSel", 4), refreshCurrEntryData); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
508 } |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
509 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
510 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
511 function switchEntry(dir) |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
512 { |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
513 jsSendPOSTRequest("action=ctrl&type="+ (dir < 0 ? "prevEntry" : "nextEntry"), refreshCurrEntryListData); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
514 } |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
515 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
516 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
517 // |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
518 // Rotation list editing and handling |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
519 // |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
520 function refreshRotationListSel() |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
521 { |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
522 jsRefreshItems("ctrlRotationListsSel", "infoRotationLists", ""); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
523 } |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
524 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
525 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
526 function refreshRotationListEdit(id) |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
527 { |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
528 jsRefreshItems("ctrlRotationListEdit", "infoRotationListEdit", "&id="+id+"&full=0"); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
529 refreshRotationListSel(); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
530 } |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
531 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
532 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
533 function refreshActiveRotationList() |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
534 { |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
535 jsRefreshItems("ctrlActiveRotationList", "infoActiveRotationList", ""); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
536 } |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
537 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
538 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
539 function setRotateDuration() |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
540 { |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
541 var duration = jsGetValue("ctrlRotSlideDuration", 2); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
542 jsSendPOSTRequest("action=ctrl&type=setRotateDuration&duration="+duration); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
543 } |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
544 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
545 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
546 function setActiveRotationList() |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
547 { |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
548 var id = jsGetValue("ctrlRotationListsSel", 4); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
549 if (id > 0) |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
550 jsSendPOSTRequest("action=ctrl&type=setActiveRotationList&id="+id, refreshActiveRotationList); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
551 else |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
552 jsMessageBox("No rotation list selected?"); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
553 } |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
554 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
555 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
556 function updateRotationList(id) |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
557 { |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
558 var name = jsGetValue("ctrlEDRotationListName", 1); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
559 jsSendPOSTRequest("action=ctrl&type=updateRotationList&id="+id+"&name="+name, refreshRotationListSel); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
560 } |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
561 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
562 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
563 function moveRotationListSlide(list_id, dir) |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
564 { |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
565 var msuccess = function(txt) |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
566 { |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
567 refreshRotationListEdit(list_id); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
568 } |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
569 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
570 var slide = jsGetValue("ctrlEDRotationListSel", 4); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
571 if (slide) |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
572 { |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
573 var str = slide.split("_"); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
574 jsSendPOSTRequest("action=ctrl&type=moveRotationListSlide&list_id="+list_id+ |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
575 "&slide_id="+parseInt(str[0])+"&order_num="+parseInt(str[1])+"&dir="+dir, msuccess); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
576 } |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
577 else |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
578 jsMessageBox("No slide selected?"); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
579 } |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
580 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
581 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
582 function addRotationListSlide(list_id) |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
583 { |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
584 var msuccess = function(txt) |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
585 { |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
586 refreshRotationListEdit(list_id); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
587 } |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
588 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
589 var slide_id = jsGetValue("ctrlEDDisplaySlidesSel", 4); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
590 if (slide_id > 0) |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
591 jsSendPOSTRequest("action=ctrl&type=addRotationListSlide&list_id="+list_id+"&slide_id="+slide_id, msuccess); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
592 else |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
593 jsMessageBox("No slide selected?"); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
594 } |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
595 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
596 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
597 function removeRotationListSlide(list_id) |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
598 { |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
599 var msuccess = function(txt) |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
600 { |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
601 refreshRotationListEdit(list_id); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
602 } |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
603 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
604 var slide = jsGetValue("ctrlEDRotationListSel", 4); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
605 if (slide) |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
606 { |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
607 var str = slide.split("_"); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
608 jsSendPOSTRequest("action=ctrl&type=removeRotationListSlide&list_id="+list_id+ |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
609 "&slide_id="+parseInt(str[0])+"&order_num="+parseInt(str[1]), msuccess); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
610 } |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
611 else |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
612 jsMessageBox("No slide selected?"); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
613 } |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
614 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
615 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
616 function editRotationList() |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
617 { |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
618 var id = jsGetValue("ctrlRotationListsSel", 4); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
619 if (id > 0) |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
620 jsSendPOSTRequest("action=get&type=infoRotationListEdit&id="+id, jsOpenAdminPopup); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
621 else |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
622 jsMessageBox("No rotation list selected?"); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
623 } |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
624 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
625 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
626 function newRotationList() |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
627 { |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
628 var msuccess = function(txt) |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
629 { |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
630 refreshRotationListSel(); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
631 jsOpenAdminPopup(txt); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
632 } |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
633 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
634 jsSendPOSTRequest("action=ctrl&type=newRotationList", msuccess); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
635 } |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
636 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
637 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
638 function deleteRotationList() |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
639 { |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
640 var mcb_ok = function(txt) |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
641 { |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
642 jsSendPOSTRequest("action=ctrl&type=deleteRotationList&id="+id, refreshRotationListSel); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
643 } |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
644 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
645 var id = jsGetValue("ctrlRotationListsSel", 4); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
646 if (id > 0) |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
647 { |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
648 jsConfirmBox("Are you <b>sure</b> you want to delete rotation list #"+id+"?", |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
649 mcb_ok, 0, 0); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
650 } |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
651 else |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
652 jsMessageBox("No rotation list selected?"); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
653 } |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
654 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
655 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
656 // |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
657 // Display slide editing and handling |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
658 // |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
659 function refreshDisplaySlideListSel() |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
660 { |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
661 jsRefreshItems("ctrlDisplaySlidesSel", "infoDisplaySlides", ""); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
662 } |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
663 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
664 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
665 function updateDisplaySlide(id) |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
666 { |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
667 var vtitle = jsGetValue("ctrlDisplaySlideTitle", 1); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
668 var vtext = jsGetValue("ctrlDisplaySlideText", 1); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
669 jsSendPOSTRequest("action=ctrl&type=updateDisplaySlide&id="+id+"&title="+vtitle+"&text="+vtext, refreshDisplaySlideListSel); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
670 jsCloseAdminPopup(); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
671 return false; |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
672 } |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
673 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
674 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
675 function editDisplaySlide() |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
676 { |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
677 var id = jsGetValue("ctrlDisplaySlidesSel", 4); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
678 if (id > 0) |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
679 jsSendPOSTRequest("action=get&type=infoDisplaySlideEdit&id="+id, jsOpenAdminPopup); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
680 else |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
681 jsMessageBox("No display slide selected?"); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
682 } |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
683 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
684 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
685 function copyDisplaySlide() |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
686 { |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
687 var msuccess = function(txt) |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
688 { |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
689 refreshDisplaySlideListSel(); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
690 jsOpenAdminPopup(txt); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
691 } |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
692 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
693 var id = jsGetValue("ctrlDisplaySlidesSel", 4); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
694 if (id > 0) |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
695 jsSendPOSTRequest("action=ctrl&type=copyDisplaySlide&id="+id, msuccess); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
696 else |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
697 jsMessageBox("No display slide selected?"); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
698 } |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
699 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
700 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
701 function newDisplaySlide() |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
702 { |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
703 var msuccess = function(txt) |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
704 { |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
705 refreshDisplaySlideListSel(); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
706 jsOpenAdminPopup(txt); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
707 } |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
708 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
709 jsSendPOSTRequest("action=ctrl&type=newDisplaySlide", msuccess); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
710 } |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
711 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
712 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
713 function deleteDisplaySlide() |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
714 { |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
715 var msuccess = function(txt) |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
716 { |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
717 refreshDisplaySlideListSel(); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
718 refreshRotationListSel(); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
719 } |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
720 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
721 var mcb_ok = function(txt) |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
722 { |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
723 jsSendPOSTRequest("action=ctrl&type=deleteDisplaySlide&id="+id, msuccess); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
724 } |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
725 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
726 var id = jsGetValue("ctrlDisplaySlidesSel", 4); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
727 if (id > 0) |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
728 { |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
729 jsConfirmBox("Are you <b>sure</b> you want to delete slide list #"+id+"?", |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
730 mcb_ok, 0, 0); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
731 } |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
732 else |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
733 jsMessageBox("No display slide selected?"); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
734 } |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
735 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
736 |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
737 function activateTempSlide() |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
738 { |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
739 var id = jsGetValue("ctrlDisplaySlidesSel", 4); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
740 var duration = jsGetValue("ctrlTempSlideDuration", 2); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
741 if (id > 0) |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
742 jsSendPOSTRequest("action=ctrl&type=setTempSlide&id="+id+"&duration="+duration, jsMessageBox); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
743 else |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
744 jsMessageBox("No slide selected?"); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
745 } |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
746 |
618
0508fb0c1304
Improve deletion warnings in admin interface.
Matti Hamalainen <ccr@tnsp.org>
parents:
608
diff
changeset
|
747 |
599
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
748 function skipToNextSlide() |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
749 { |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
750 jsSendPOSTRequest("action=ctrl&type=skipToNextSlide"); |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
751 } |
eebbc96d7fe5
Move javascript code from admin.php to a separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
752 |