annotate admin.php @ 591:f7078755dff5

Fix CSS paths for admin and print pages.
author Matti Hamalainen <ccr@tnsp.org>
date Fri, 17 Oct 2014 15:18:21 +0300
parents ce11ea112a65
children b09fdf99b54b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
8019b357cc03 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1 <?
136
aeebfedb5709 Add some copyright headers.
Matti Hamalainen <ccr@tnsp.org>
parents: 126
diff changeset
2 //
571
ce11ea112a65 Change the header blurb a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 565
diff changeset
3 // FAPWeb - Simple Web-based Demoparty Management System
136
aeebfedb5709 Add some copyright headers.
Matti Hamalainen <ccr@tnsp.org>
parents: 126
diff changeset
4 // Party administration page frontend module
565
ed2247111fdd Bump copyright years.
Matti Hamalainen <ccr@tnsp.org>
parents: 560
diff changeset
5 // (C) Copyright 2012-2014 Tecnic Software productions (TNSP)
136
aeebfedb5709 Add some copyright headers.
Matti Hamalainen <ccr@tnsp.org>
parents: 126
diff changeset
6 //
32
36392d1d6b5f Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
7 $sessionType = "admin";
175
8df523e6326a User require_once instead of require.
Matti Hamalainen <ccr@tnsp.org>
parents: 174
diff changeset
8 require_once "mconfig.inc.php";
8df523e6326a User require_once instead of require.
Matti Hamalainen <ccr@tnsp.org>
parents: 174
diff changeset
9 require_once "msite.inc.php";
8df523e6326a User require_once instead of require.
Matti Hamalainen <ccr@tnsp.org>
parents: 174
diff changeset
10 require_once "msession.inc.php";
384
357b81e39ab3 Rename majax.php -> majax.inc.php.
Matti Hamalainen <ccr@tnsp.org>
parents: 378
diff changeset
11 require_once "majax.inc.php";
32
36392d1d6b5f Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
12
14
e36c4d2b09c4 Fix settings to work, clean up the code, etc.
Matti Hamalainen <ccr@tnsp.org>
parents: 10
diff changeset
13 function stCreateSettingsData()
e36c4d2b09c4 Fix settings to work, clean up the code, etc.
Matti Hamalainen <ccr@tnsp.org>
parents: 10
diff changeset
14 {
e36c4d2b09c4 Fix settings to work, clean up the code, etc.
Matti Hamalainen <ccr@tnsp.org>
parents: 10
diff changeset
15 $args = array();
e36c4d2b09c4 Fix settings to work, clean up the code, etc.
Matti Hamalainen <ccr@tnsp.org>
parents: 10
diff changeset
16
e36c4d2b09c4 Fix settings to work, clean up the code, etc.
Matti Hamalainen <ccr@tnsp.org>
parents: 10
diff changeset
17 if (($res = stExecSQL("SELECT * FROM settings")) !== FALSE)
e36c4d2b09c4 Fix settings to work, clean up the code, etc.
Matti Hamalainen <ccr@tnsp.org>
parents: 10
diff changeset
18 {
e36c4d2b09c4 Fix settings to work, clean up the code, etc.
Matti Hamalainen <ccr@tnsp.org>
parents: 10
diff changeset
19 foreach ($res as $item)
e36c4d2b09c4 Fix settings to work, clean up the code, etc.
Matti Hamalainen <ccr@tnsp.org>
parents: 10
diff changeset
20 {
e36c4d2b09c4 Fix settings to work, clean up the code, etc.
Matti Hamalainen <ccr@tnsp.org>
parents: 10
diff changeset
21 switch ($item["vtype"])
e36c4d2b09c4 Fix settings to work, clean up the code, etc.
Matti Hamalainen <ccr@tnsp.org>
parents: 10
diff changeset
22 {
e36c4d2b09c4 Fix settings to work, clean up the code, etc.
Matti Hamalainen <ccr@tnsp.org>
parents: 10
diff changeset
23 case VT_STR:
298
2f35c4b90ee7 Fix site settings javascript generator.
Matti Hamalainen <ccr@tnsp.org>
parents: 289
diff changeset
24 case VT_TEXT: $type = 1; break;
2f35c4b90ee7 Fix site settings javascript generator.
Matti Hamalainen <ccr@tnsp.org>
parents: 289
diff changeset
25 case VT_INT: $type = 2; break;
14
e36c4d2b09c4 Fix settings to work, clean up the code, etc.
Matti Hamalainen <ccr@tnsp.org>
parents: 10
diff changeset
26 case VT_BOOL: $type = 3; break;
e36c4d2b09c4 Fix settings to work, clean up the code, etc.
Matti Hamalainen <ccr@tnsp.org>
parents: 10
diff changeset
27 }
e36c4d2b09c4 Fix settings to work, clean up the code, etc.
Matti Hamalainen <ccr@tnsp.org>
parents: 10
diff changeset
28 $args[] = "\"".$item["key"]."\":".$type;
e36c4d2b09c4 Fix settings to work, clean up the code, etc.
Matti Hamalainen <ccr@tnsp.org>
parents: 10
diff changeset
29 }
e36c4d2b09c4 Fix settings to work, clean up the code, etc.
Matti Hamalainen <ccr@tnsp.org>
parents: 10
diff changeset
30 }
e36c4d2b09c4 Fix settings to work, clean up the code, etc.
Matti Hamalainen <ccr@tnsp.org>
parents: 10
diff changeset
31
e36c4d2b09c4 Fix settings to work, clean up the code, etc.
Matti Hamalainen <ccr@tnsp.org>
parents: 10
diff changeset
32 echo
e36c4d2b09c4 Fix settings to work, clean up the code, etc.
Matti Hamalainen <ccr@tnsp.org>
parents: 10
diff changeset
33 "\n".
e36c4d2b09c4 Fix settings to work, clean up the code, etc.
Matti Hamalainen <ccr@tnsp.org>
parents: 10
diff changeset
34 "function updateSettings()\n".
e36c4d2b09c4 Fix settings to work, clean up the code, etc.
Matti Hamalainen <ccr@tnsp.org>
parents: 10
diff changeset
35 "{\n".
346
c922e5200c55 Rename makePostArgs() to jsMakePostArgs().
Matti Hamalainen <ccr@tnsp.org>
parents: 345
diff changeset
36 " var args = jsMakePostArgs({".implode(",", $args)."}, \"st\", \"\");\n".
342
3175ec252c73 Rename sendPOSTRequest() to jsSendPOSTRequest().
Matti Hamalainen <ccr@tnsp.org>
parents: 341
diff changeset
37 " jsSendPOSTRequest(\"action=update&type=settings&\"+args);\n".
14
e36c4d2b09c4 Fix settings to work, clean up the code, etc.
Matti Hamalainen <ccr@tnsp.org>
parents: 10
diff changeset
38 " return false;\n".
e36c4d2b09c4 Fix settings to work, clean up the code, etc.
Matti Hamalainen <ccr@tnsp.org>
parents: 10
diff changeset
39 "}\n";
e36c4d2b09c4 Fix settings to work, clean up the code, etc.
Matti Hamalainen <ccr@tnsp.org>
parents: 10
diff changeset
40 }
e36c4d2b09c4 Fix settings to work, clean up the code, etc.
Matti Hamalainen <ccr@tnsp.org>
parents: 10
diff changeset
41
347
1ef6cd391590 Move things around a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 346
diff changeset
42 function stAdminContent()
1ef6cd391590 Move things around a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 346
diff changeset
43 {
1ef6cd391590 Move things around a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 346
diff changeset
44 echo "<div id=\"adminContent\">\n";
1ef6cd391590 Move things around a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 346
diff changeset
45 }
1ef6cd391590 Move things around a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 346
diff changeset
46
1ef6cd391590 Move things around a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 346
diff changeset
47 // Switch to https first, if needed
1ef6cd391590 Move things around a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 346
diff changeset
48 if (!stCheckHTTPS())
1ef6cd391590 Move things around a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 346
diff changeset
49 {
1ef6cd391590 Move things around a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 346
diff changeset
50 header("Location: https://".$_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"]);
1ef6cd391590 Move things around a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 346
diff changeset
51 exit;
1ef6cd391590 Move things around a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 346
diff changeset
52 }
1ef6cd391590 Move things around a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 346
diff changeset
53
1ef6cd391590 Move things around a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 346
diff changeset
54 // Start output
591
f7078755dff5 Fix CSS paths for admin and print pages.
Matti Hamalainen <ccr@tnsp.org>
parents: 571
diff changeset
55 $pageCSS = "css/admin.css";
347
1ef6cd391590 Move things around a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 346
diff changeset
56 cmPrintPageHeader("FAPWeb Administration",
364
975938f83e59 Cosmetics.
Matti Hamalainen <ccr@tnsp.org>
parents: 350
diff changeset
57 " <meta http-equiv=\"Pragma\" content=\"no-cache\" />\n",
347
1ef6cd391590 Move things around a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 346
diff changeset
58 FALSE);
1ef6cd391590 Move things around a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 346
diff changeset
59
1ef6cd391590 Move things around a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 346
diff changeset
60
1ef6cd391590 Move things around a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 346
diff changeset
61 // Initiate SQL database connection
1ef6cd391590 Move things around a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 346
diff changeset
62 if (!stConnectSQLDB())
1ef6cd391590 Move things around a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 346
diff changeset
63 {
1ef6cd391590 Move things around a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 346
diff changeset
64 // Error occured, bail out early
1ef6cd391590 Move things around a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 346
diff changeset
65 cmPrintPageFooter();
1ef6cd391590 Move things around a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 346
diff changeset
66 exit;
1ef6cd391590 Move things around a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 346
diff changeset
67 }
1ef6cd391590 Move things around a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 346
diff changeset
68
1ef6cd391590 Move things around a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 346
diff changeset
69 // Fetch non-"hardcoded" settings from SQL database
1ef6cd391590 Move things around a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 346
diff changeset
70 stReloadSettings();
1ef6cd391590 Move things around a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 346
diff changeset
71
0
8019b357cc03 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
72 // Check if sessions are enabled
5
76c3b89d7b11 Improve voting, clean up the code, etc.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
73 if (!stChkSetting("admPassword"))
0
8019b357cc03 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
74 {
347
1ef6cd391590 Move things around a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 346
diff changeset
75 stAdminContent();
171
705dabdc37d4 Move administration interface page to separate layout, to make things less cramped.
Matti Hamalainen <ccr@tnsp.org>
parents: 136
diff changeset
76 echo
705dabdc37d4 Move administration interface page to separate layout, to make things less cramped.
Matti Hamalainen <ccr@tnsp.org>
parents: 136
diff changeset
77 "<h1>Oh noes, admin configuration not done!</h1>\n".
705dabdc37d4 Move administration interface page to separate layout, to make things less cramped.
Matti Hamalainen <ccr@tnsp.org>
parents: 136
diff changeset
78 "<p>Better go and prod that, so you get to use the fine admin interface.</p>\n";
347
1ef6cd391590 Move things around a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 346
diff changeset
79 cmPrintPageFooter();
1ef6cd391590 Move things around a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 346
diff changeset
80 exit;
0
8019b357cc03 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
81 }
8019b357cc03 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
82 else
107
6e076b3630a0 Cleanup the code a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 105
diff changeset
83 if (!stAdmSessionAuth(FALSE))
0
8019b357cc03 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
84 {
8019b357cc03 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
85 // Perform authentication if we are not in session already
347
1ef6cd391590 Move things around a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 346
diff changeset
86 stAdminContent();
5
76c3b89d7b11 Improve voting, clean up the code, etc.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
87 echo
76c3b89d7b11 Improve voting, clean up the code, etc.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
88 "<h1>Party admin login</h1>\n".
0
8019b357cc03 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
89 "<p>Please use illegal telepathy over HTTP to provide a password to enter the party administration systembolaget.</p>\n".
347
1ef6cd391590 Move things around a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 346
diff changeset
90 " ".stGetFormStart("admlogin", "admlogin.php").
1ef6cd391590 Move things around a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 346
diff changeset
91 " ".stGetFormHiddenInput("mode", "check")."\n".
1ef6cd391590 Move things around a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 346
diff changeset
92 " ".stGetFormPasswordInput("admpass", "", "", "autofocus=\"autofocus\"")."\n".
1ef6cd391590 Move things around a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 346
diff changeset
93 " ".stGetFormSubmitInput("submit", "Login")."\n".
1ef6cd391590 Move things around a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 346
diff changeset
94 " </form>\n";
1ef6cd391590 Move things around a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 346
diff changeset
95 cmPrintPageFooter();
1ef6cd391590 Move things around a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 346
diff changeset
96 exit;
0
8019b357cc03 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
97 }
107
6e076b3630a0 Cleanup the code a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 105
diff changeset
98 else
0
8019b357cc03 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
99 {
8019b357cc03 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
100 ?>
8019b357cc03 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
101 <script type="text/javascript">
445
cf7053f04e88 Move tab handling code to majax module.
Matti Hamalainen <ccr@tnsp.org>
parents: 438
diff changeset
102 // <? stCreateSettingsData(); stCommonAJAX("admajax.php", "admlogout.php", FALSE, TRUE); ?>
124
986c25c2e2bc Move some relevant javascript code from ajax.js to admin module.
Matti Hamalainen <ccr@tnsp.org>
parents: 107
diff changeset
103
986c25c2e2bc Move some relevant javascript code from ajax.js to admin module.
Matti Hamalainen <ccr@tnsp.org>
parents: 107
diff changeset
104
258
08b292dd12ff More work on entry admin.
Matti Hamalainen <ccr@tnsp.org>
parents: 256
diff changeset
105 var activeAttendee = -1, prevAttendee = -1;
08b292dd12ff More work on entry admin.
Matti Hamalainen <ccr@tnsp.org>
parents: 256
diff changeset
106 var activeTmp = "";
08b292dd12ff More work on entry admin.
Matti Hamalainen <ccr@tnsp.org>
parents: 256
diff changeset
107
08b292dd12ff More work on entry admin.
Matti Hamalainen <ccr@tnsp.org>
parents: 256
diff changeset
108
428
Matti Hamalainen <ccr@tnsp.org>
parents: 427
diff changeset
109 function jsCloseAdminPopup()
Matti Hamalainen <ccr@tnsp.org>
parents: 427
diff changeset
110 {
Matti Hamalainen <ccr@tnsp.org>
parents: 427
diff changeset
111 var nitem = document.getElementById("adminPopup");
Matti Hamalainen <ccr@tnsp.org>
parents: 427
diff changeset
112 if (nitem)
Matti Hamalainen <ccr@tnsp.org>
parents: 427
diff changeset
113 {
Matti Hamalainen <ccr@tnsp.org>
parents: 427
diff changeset
114 nitem.innerHTML = "";
Matti Hamalainen <ccr@tnsp.org>
parents: 427
diff changeset
115 nitem.style.display = "none";
Matti Hamalainen <ccr@tnsp.org>
parents: 427
diff changeset
116 }
Matti Hamalainen <ccr@tnsp.org>
parents: 427
diff changeset
117 }
Matti Hamalainen <ccr@tnsp.org>
parents: 427
diff changeset
118
Matti Hamalainen <ccr@tnsp.org>
parents: 427
diff changeset
119
Matti Hamalainen <ccr@tnsp.org>
parents: 427
diff changeset
120 function jsOpenAdminPopup(txt)
Matti Hamalainen <ccr@tnsp.org>
parents: 427
diff changeset
121 {
Matti Hamalainen <ccr@tnsp.org>
parents: 427
diff changeset
122 var nitem = document.getElementById("adminPopup");
Matti Hamalainen <ccr@tnsp.org>
parents: 427
diff changeset
123 if (nitem)
Matti Hamalainen <ccr@tnsp.org>
parents: 427
diff changeset
124 {
Matti Hamalainen <ccr@tnsp.org>
parents: 427
diff changeset
125 nitem.innerHTML = txt;
Matti Hamalainen <ccr@tnsp.org>
parents: 427
diff changeset
126 nitem.style.display = "block";
Matti Hamalainen <ccr@tnsp.org>
parents: 427
diff changeset
127 }
Matti Hamalainen <ccr@tnsp.org>
parents: 427
diff changeset
128 }
Matti Hamalainen <ccr@tnsp.org>
parents: 427
diff changeset
129
Matti Hamalainen <ccr@tnsp.org>
parents: 427
diff changeset
130
400
f0a09fbca728 Rename some functions.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
131 function jsRefreshItems(id,name,extra)
124
986c25c2e2bc Move some relevant javascript code from ajax.js to admin module.
Matti Hamalainen <ccr@tnsp.org>
parents: 107
diff changeset
132 {
986c25c2e2bc Move some relevant javascript code from ajax.js to admin module.
Matti Hamalainen <ccr@tnsp.org>
parents: 107
diff changeset
133 var msuccess = function(txt)
986c25c2e2bc Move some relevant javascript code from ajax.js to admin module.
Matti Hamalainen <ccr@tnsp.org>
parents: 107
diff changeset
134 {
986c25c2e2bc Move some relevant javascript code from ajax.js to admin module.
Matti Hamalainen <ccr@tnsp.org>
parents: 107
diff changeset
135 var nitem = document.getElementById(id);
201
a4be19c4d99d Modularize admin pages tab system.
Matti Hamalainen <ccr@tnsp.org>
parents: 189
diff changeset
136 if (nitem) nitem.innerHTML = txt;
124
986c25c2e2bc Move some relevant javascript code from ajax.js to admin module.
Matti Hamalainen <ccr@tnsp.org>
parents: 107
diff changeset
137 }
986c25c2e2bc Move some relevant javascript code from ajax.js to admin module.
Matti Hamalainen <ccr@tnsp.org>
parents: 107
diff changeset
138
342
3175ec252c73 Rename sendPOSTRequest() to jsSendPOSTRequest().
Matti Hamalainen <ccr@tnsp.org>
parents: 341
diff changeset
139 jsSendPOSTRequest("action=get&type="+name+extra, msuccess);
124
986c25c2e2bc Move some relevant javascript code from ajax.js to admin module.
Matti Hamalainen <ccr@tnsp.org>
parents: 107
diff changeset
140 }
986c25c2e2bc Move some relevant javascript code from ajax.js to admin module.
Matti Hamalainen <ccr@tnsp.org>
parents: 107
diff changeset
141
986c25c2e2bc Move some relevant javascript code from ajax.js to admin module.
Matti Hamalainen <ccr@tnsp.org>
parents: 107
diff changeset
142
400
f0a09fbca728 Rename some functions.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
143 function jsDeleteItem(id,prefix,type,func,dsc)
124
986c25c2e2bc Move some relevant javascript code from ajax.js to admin module.
Matti Hamalainen <ccr@tnsp.org>
parents: 107
diff changeset
144 {
986c25c2e2bc Move some relevant javascript code from ajax.js to admin module.
Matti Hamalainen <ccr@tnsp.org>
parents: 107
diff changeset
145 var msuccess = function(txt)
986c25c2e2bc Move some relevant javascript code from ajax.js to admin module.
Matti Hamalainen <ccr@tnsp.org>
parents: 107
diff changeset
146 {
986c25c2e2bc Move some relevant javascript code from ajax.js to admin module.
Matti Hamalainen <ccr@tnsp.org>
parents: 107
diff changeset
147 var item = document.getElementById(prefix+id);
986c25c2e2bc Move some relevant javascript code from ajax.js to admin module.
Matti Hamalainen <ccr@tnsp.org>
parents: 107
diff changeset
148 item.style.display = "none";
986c25c2e2bc Move some relevant javascript code from ajax.js to admin module.
Matti Hamalainen <ccr@tnsp.org>
parents: 107
diff changeset
149 setTimeout(func, 50);
986c25c2e2bc Move some relevant javascript code from ajax.js to admin module.
Matti Hamalainen <ccr@tnsp.org>
parents: 107
diff changeset
150 }
986c25c2e2bc Move some relevant javascript code from ajax.js to admin module.
Matti Hamalainen <ccr@tnsp.org>
parents: 107
diff changeset
151
986c25c2e2bc Move some relevant javascript code from ajax.js to admin module.
Matti Hamalainen <ccr@tnsp.org>
parents: 107
diff changeset
152 // Clearly mark the element when asking confirmation
986c25c2e2bc Move some relevant javascript code from ajax.js to admin module.
Matti Hamalainen <ccr@tnsp.org>
parents: 107
diff changeset
153 var item = document.getElementById(prefix+id);
986c25c2e2bc Move some relevant javascript code from ajax.js to admin module.
Matti Hamalainen <ccr@tnsp.org>
parents: 107
diff changeset
154 var tmp = item.style.background;
986c25c2e2bc Move some relevant javascript code from ajax.js to admin module.
Matti Hamalainen <ccr@tnsp.org>
parents: 107
diff changeset
155 item.style.background = "red";
986c25c2e2bc Move some relevant javascript code from ajax.js to admin module.
Matti Hamalainen <ccr@tnsp.org>
parents: 107
diff changeset
156
986c25c2e2bc Move some relevant javascript code from ajax.js to admin module.
Matti Hamalainen <ccr@tnsp.org>
parents: 107
diff changeset
157 // Ask confirmation for deletion
349
61c4dda0ec03 New message/confirmation boxes code done in JS + CSS instead of relying on
Matti Hamalainen <ccr@tnsp.org>
parents: 347
diff changeset
158 var mcb_ok = function (data)
124
986c25c2e2bc Move some relevant javascript code from ajax.js to admin module.
Matti Hamalainen <ccr@tnsp.org>
parents: 107
diff changeset
159 {
342
3175ec252c73 Rename sendPOSTRequest() to jsSendPOSTRequest().
Matti Hamalainen <ccr@tnsp.org>
parents: 341
diff changeset
160 jsSendPOSTRequest("action=delete&type="+type+"&id="+id, msuccess);
349
61c4dda0ec03 New message/confirmation boxes code done in JS + CSS instead of relying on
Matti Hamalainen <ccr@tnsp.org>
parents: 347
diff changeset
161 item.style.background = tmp;
124
986c25c2e2bc Move some relevant javascript code from ajax.js to admin module.
Matti Hamalainen <ccr@tnsp.org>
parents: 107
diff changeset
162 }
349
61c4dda0ec03 New message/confirmation boxes code done in JS + CSS instead of relying on
Matti Hamalainen <ccr@tnsp.org>
parents: 347
diff changeset
163
61c4dda0ec03 New message/confirmation boxes code done in JS + CSS instead of relying on
Matti Hamalainen <ccr@tnsp.org>
parents: 347
diff changeset
164 var mcb_cancel = function (data)
61c4dda0ec03 New message/confirmation boxes code done in JS + CSS instead of relying on
Matti Hamalainen <ccr@tnsp.org>
parents: 347
diff changeset
165 {
61c4dda0ec03 New message/confirmation boxes code done in JS + CSS instead of relying on
Matti Hamalainen <ccr@tnsp.org>
parents: 347
diff changeset
166 item.style.background = tmp;
61c4dda0ec03 New message/confirmation boxes code done in JS + CSS instead of relying on
Matti Hamalainen <ccr@tnsp.org>
parents: 347
diff changeset
167 }
61c4dda0ec03 New message/confirmation boxes code done in JS + CSS instead of relying on
Matti Hamalainen <ccr@tnsp.org>
parents: 347
diff changeset
168
61c4dda0ec03 New message/confirmation boxes code done in JS + CSS instead of relying on
Matti Hamalainen <ccr@tnsp.org>
parents: 347
diff changeset
169 jsConfirmBox("Are you sure you want to delete "+dsc+" #"+id+"?", mcb_ok, mcb_cancel, 0);
124
986c25c2e2bc Move some relevant javascript code from ajax.js to admin module.
Matti Hamalainen <ccr@tnsp.org>
parents: 107
diff changeset
170 }
0
8019b357cc03 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
171
8019b357cc03 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
172
253
bbe0d57d6ac9 Use a refresh function dispatcher.
Matti Hamalainen <ccr@tnsp.org>
parents: 250
diff changeset
173 function refreshDispatchCC(id)
0
8019b357cc03 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
174 {
253
bbe0d57d6ac9 Use a refresh function dispatcher.
Matti Hamalainen <ccr@tnsp.org>
parents: 250
diff changeset
175 switch (id)
bbe0d57d6ac9 Use a refresh function dispatcher.
Matti Hamalainen <ccr@tnsp.org>
parents: 250
diff changeset
176 {
400
f0a09fbca728 Rename some functions.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
177 case "Settings": jsRefreshItems("tabContCCSettings", "settings", ""); break;
f0a09fbca728 Rename some functions.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
178 case "News": jsRefreshItems("tabContCCNews", "news", ""); break;
f0a09fbca728 Rename some functions.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
179 case "Attendees": jsRefreshItems("tabContCCAttendees", "attendees", ""); break;
f0a09fbca728 Rename some functions.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
180 case "Voting": jsRefreshItems("tabContCCVoting", "voters", ""); break;
f0a09fbca728 Rename some functions.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
181 case "Compos": jsRefreshItems("tabContCCCompos", "compos", ""); break;
419
206a18bc603a Rename menu entry.
Matti Hamalainen <ccr@tnsp.org>
parents: 416
diff changeset
182 case "InfoSys": jsRefreshItems("tabContCCInfoSys", "infoMain", ""); break;
253
bbe0d57d6ac9 Use a refresh function dispatcher.
Matti Hamalainen <ccr@tnsp.org>
parents: 250
diff changeset
183 case "Entries": refreshCCEntries(); break;
bbe0d57d6ac9 Use a refresh function dispatcher.
Matti Hamalainen <ccr@tnsp.org>
parents: 250
diff changeset
184 }
0
8019b357cc03 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
185 }
8019b357cc03 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
186
8019b357cc03 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
187
255
16d453f1b23d Simplify refreshing function.
Matti Hamalainen <ccr@tnsp.org>
parents: 254
diff changeset
188 function refreshCCAttendee(id)
209
3870601c17c3 More work.
Matti Hamalainen <ccr@tnsp.org>
parents: 206
diff changeset
189 {
400
f0a09fbca728 Rename some functions.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
190 jsRefreshItems("attendee"+ id, "attendee", "&id="+ id);
209
3870601c17c3 More work.
Matti Hamalainen <ccr@tnsp.org>
parents: 206
diff changeset
191 }
3870601c17c3 More work.
Matti Hamalainen <ccr@tnsp.org>
parents: 206
diff changeset
192
3870601c17c3 More work.
Matti Hamalainen <ccr@tnsp.org>
parents: 206
diff changeset
193
201
a4be19c4d99d Modularize admin pages tab system.
Matti Hamalainen <ccr@tnsp.org>
parents: 189
diff changeset
194 function refreshCCEntries()
0
8019b357cc03 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
195 {
254
c26167a096bf Rename a callback function.
Matti Hamalainen <ccr@tnsp.org>
parents: 253
diff changeset
196 var msuccess = function(txt)
250
34f540cea1ff Some work on compo entry listing.
Matti Hamalainen <ccr@tnsp.org>
parents: 247
diff changeset
197 {
34f540cea1ff Some work on compo entry listing.
Matti Hamalainen <ccr@tnsp.org>
parents: 247
diff changeset
198 var nitem = document.getElementById("tabContCCEntries");
34f540cea1ff Some work on compo entry listing.
Matti Hamalainen <ccr@tnsp.org>
parents: 247
diff changeset
199 if (nitem)
34f540cea1ff Some work on compo entry listing.
Matti Hamalainen <ccr@tnsp.org>
parents: 247
diff changeset
200 {
299
617c44197983 Preserve generated content in sub-tabs.
Matti Hamalainen <ccr@tnsp.org>
parents: 298
diff changeset
201 if (nitem.innerHTML == "")
617c44197983 Preserve generated content in sub-tabs.
Matti Hamalainen <ccr@tnsp.org>
parents: 298
diff changeset
202 {
617c44197983 Preserve generated content in sub-tabs.
Matti Hamalainen <ccr@tnsp.org>
parents: 298
diff changeset
203 nitem.innerHTML =
617c44197983 Preserve generated content in sub-tabs.
Matti Hamalainen <ccr@tnsp.org>
parents: 298
diff changeset
204 "<div id=\"tabHeadersCM\" class=\"tabHeadersSub\"></div>" +
617c44197983 Preserve generated content in sub-tabs.
Matti Hamalainen <ccr@tnsp.org>
parents: 298
diff changeset
205 "<div id=\"tabContentsCM\" class=\"tabContentsSub\"></div>";
617c44197983 Preserve generated content in sub-tabs.
Matti Hamalainen <ccr@tnsp.org>
parents: 298
diff changeset
206 }
617c44197983 Preserve generated content in sub-tabs.
Matti Hamalainen <ccr@tnsp.org>
parents: 298
diff changeset
207
250
34f540cea1ff Some work on compo entry listing.
Matti Hamalainen <ccr@tnsp.org>
parents: 247
diff changeset
208 try {
34f540cea1ff Some work on compo entry listing.
Matti Hamalainen <ccr@tnsp.org>
parents: 247
diff changeset
209 var tmp = JSON.parse("{"+ txt +"}");
34f540cea1ff Some work on compo entry listing.
Matti Hamalainen <ccr@tnsp.org>
parents: 247
diff changeset
210 registeredTabs["CM"] = tmp;
445
cf7053f04e88 Move tab handling code to majax module.
Matti Hamalainen <ccr@tnsp.org>
parents: 438
diff changeset
211 jsUpdateTabList("CM", "");
260
6a1f1f2f2141 Make tab selection in subtabs persistent.
Matti Hamalainen <ccr@tnsp.org>
parents: 259
diff changeset
212 if (activeTabs["CM"])
445
cf7053f04e88 Move tab handling code to majax module.
Matti Hamalainen <ccr@tnsp.org>
parents: 438
diff changeset
213 jsSwitchActiveTab("CM", activeTabs["CM"]);
250
34f540cea1ff Some work on compo entry listing.
Matti Hamalainen <ccr@tnsp.org>
parents: 247
diff changeset
214 }
34f540cea1ff Some work on compo entry listing.
Matti Hamalainen <ccr@tnsp.org>
parents: 247
diff changeset
215 catch (err) {
343
e799da13c0f3 Rename messageBox() to jsMessageBox().
Matti Hamalainen <ccr@tnsp.org>
parents: 342
diff changeset
216 jsMessageBox("JSON.parse("+ txt +") failure: "+ err);
250
34f540cea1ff Some work on compo entry listing.
Matti Hamalainen <ccr@tnsp.org>
parents: 247
diff changeset
217 }
34f540cea1ff Some work on compo entry listing.
Matti Hamalainen <ccr@tnsp.org>
parents: 247
diff changeset
218 }
34f540cea1ff Some work on compo entry listing.
Matti Hamalainen <ccr@tnsp.org>
parents: 247
diff changeset
219 }
34f540cea1ff Some work on compo entry listing.
Matti Hamalainen <ccr@tnsp.org>
parents: 247
diff changeset
220
342
3175ec252c73 Rename sendPOSTRequest() to jsSendPOSTRequest().
Matti Hamalainen <ccr@tnsp.org>
parents: 341
diff changeset
221 jsSendPOSTRequest("action=get&type=compolist", msuccess);
0
8019b357cc03 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
222 }
8019b357cc03 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
223
8019b357cc03 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
224
256
ed8d8d016420 Add refreshCMEntry(id) function for updating one entry only.
Matti Hamalainen <ccr@tnsp.org>
parents: 255
diff changeset
225 function refreshCMEntry(id)
ed8d8d016420 Add refreshCMEntry(id) function for updating one entry only.
Matti Hamalainen <ccr@tnsp.org>
parents: 255
diff changeset
226 {
400
f0a09fbca728 Rename some functions.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
227 jsRefreshItems("entry"+ id, "entry", "&id="+ id);
256
ed8d8d016420 Add refreshCMEntry(id) function for updating one entry only.
Matti Hamalainen <ccr@tnsp.org>
parents: 255
diff changeset
228 }
ed8d8d016420 Add refreshCMEntry(id) function for updating one entry only.
Matti Hamalainen <ccr@tnsp.org>
parents: 255
diff changeset
229
ed8d8d016420 Add refreshCMEntry(id) function for updating one entry only.
Matti Hamalainen <ccr@tnsp.org>
parents: 255
diff changeset
230
253
bbe0d57d6ac9 Use a refresh function dispatcher.
Matti Hamalainen <ccr@tnsp.org>
parents: 250
diff changeset
231 function refreshDispatchCM(id)
0
8019b357cc03 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
232 {
400
f0a09fbca728 Rename some functions.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
233 jsRefreshItems("tabContCM"+ id, "entries", "&id="+ id);
0
8019b357cc03 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
234 }
8019b357cc03 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
235
8019b357cc03 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
236
8019b357cc03 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
237 function addNews()
8019b357cc03 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
238 {
346
c922e5200c55 Rename makePostArgs() to jsMakePostArgs().
Matti Hamalainen <ccr@tnsp.org>
parents: 345
diff changeset
239 var args = jsMakePostArgs({"title":1,"text":1,"author":1}, "nn", "");
0
8019b357cc03 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
240
8019b357cc03 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
241 var msuccess = function(txt)
8019b357cc03 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
242 {
253
bbe0d57d6ac9 Use a refresh function dispatcher.
Matti Hamalainen <ccr@tnsp.org>
parents: 250
diff changeset
243 setTimeout("refreshDispatchCC('News');", 50);
0
8019b357cc03 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
244 }
8019b357cc03 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
245
61
e85ed35585fc Work on attendee editing, etc.
Matti Hamalainen <ccr@tnsp.org>
parents: 59
diff changeset
246 if (args != "")
342
3175ec252c73 Rename sendPOSTRequest() to jsSendPOSTRequest().
Matti Hamalainen <ccr@tnsp.org>
parents: 341
diff changeset
247 jsSendPOSTRequest("action=add&type=news&"+args, msuccess);
61
e85ed35585fc Work on attendee editing, etc.
Matti Hamalainen <ccr@tnsp.org>
parents: 59
diff changeset
248
0
8019b357cc03 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
249 return false;
8019b357cc03 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
250 }
8019b357cc03 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
251
8019b357cc03 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
252
8019b357cc03 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
253 function deleteNews(id)
8019b357cc03 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
254 {
400
f0a09fbca728 Rename some functions.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
255 jsDeleteItem(id, "news", "news", "refreshDispatchCC('News');", "news item");
0
8019b357cc03 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
256 }
8019b357cc03 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
257
8019b357cc03 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
258
223
532704115290 Make it possible to update news entries.
Matti Hamalainen <ccr@tnsp.org>
parents: 219
diff changeset
259
532704115290 Make it possible to update news entries.
Matti Hamalainen <ccr@tnsp.org>
parents: 219
diff changeset
260 function updateNews(id)
532704115290 Make it possible to update news entries.
Matti Hamalainen <ccr@tnsp.org>
parents: 219
diff changeset
261 {
346
c922e5200c55 Rename makePostArgs() to jsMakePostArgs().
Matti Hamalainen <ccr@tnsp.org>
parents: 345
diff changeset
262 var args = jsMakePostArgs({"title":1,"text":1,"author":1}, "ne", id);
223
532704115290 Make it possible to update news entries.
Matti Hamalainen <ccr@tnsp.org>
parents: 219
diff changeset
263
532704115290 Make it possible to update news entries.
Matti Hamalainen <ccr@tnsp.org>
parents: 219
diff changeset
264 var msuccess = function(txt)
532704115290 Make it possible to update news entries.
Matti Hamalainen <ccr@tnsp.org>
parents: 219
diff changeset
265 {
400
f0a09fbca728 Rename some functions.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
266 jsRefreshItems("news"+id, "newsitem", "&id="+id);
223
532704115290 Make it possible to update news entries.
Matti Hamalainen <ccr@tnsp.org>
parents: 219
diff changeset
267 }
532704115290 Make it possible to update news entries.
Matti Hamalainen <ccr@tnsp.org>
parents: 219
diff changeset
268
532704115290 Make it possible to update news entries.
Matti Hamalainen <ccr@tnsp.org>
parents: 219
diff changeset
269 if (args != "")
342
3175ec252c73 Rename sendPOSTRequest() to jsSendPOSTRequest().
Matti Hamalainen <ccr@tnsp.org>
parents: 341
diff changeset
270 jsSendPOSTRequest("action=update&type=news&id="+id+"&"+args, msuccess);
223
532704115290 Make it possible to update news entries.
Matti Hamalainen <ccr@tnsp.org>
parents: 219
diff changeset
271 }
532704115290 Make it possible to update news entries.
Matti Hamalainen <ccr@tnsp.org>
parents: 219
diff changeset
272
532704115290 Make it possible to update news entries.
Matti Hamalainen <ccr@tnsp.org>
parents: 219
diff changeset
273
61
e85ed35585fc Work on attendee editing, etc.
Matti Hamalainen <ccr@tnsp.org>
parents: 59
diff changeset
274 function addAttendee()
e85ed35585fc Work on attendee editing, etc.
Matti Hamalainen <ccr@tnsp.org>
parents: 59
diff changeset
275 {
346
c922e5200c55 Rename makePostArgs() to jsMakePostArgs().
Matti Hamalainen <ccr@tnsp.org>
parents: 345
diff changeset
276 var args = jsMakePostArgs({"name":1,"groups":1,"oneliner":1,"email":1}, "ne", "x");
61
e85ed35585fc Work on attendee editing, etc.
Matti Hamalainen <ccr@tnsp.org>
parents: 59
diff changeset
277
e85ed35585fc Work on attendee editing, etc.
Matti Hamalainen <ccr@tnsp.org>
parents: 59
diff changeset
278 var msuccess = function(txt)
e85ed35585fc Work on attendee editing, etc.
Matti Hamalainen <ccr@tnsp.org>
parents: 59
diff changeset
279 {
253
bbe0d57d6ac9 Use a refresh function dispatcher.
Matti Hamalainen <ccr@tnsp.org>
parents: 250
diff changeset
280 setTimeout("refreshDispatchCC('Attendees');", 50);
61
e85ed35585fc Work on attendee editing, etc.
Matti Hamalainen <ccr@tnsp.org>
parents: 59
diff changeset
281 }
e85ed35585fc Work on attendee editing, etc.
Matti Hamalainen <ccr@tnsp.org>
parents: 59
diff changeset
282
e85ed35585fc Work on attendee editing, etc.
Matti Hamalainen <ccr@tnsp.org>
parents: 59
diff changeset
283 if (args != "")
342
3175ec252c73 Rename sendPOSTRequest() to jsSendPOSTRequest().
Matti Hamalainen <ccr@tnsp.org>
parents: 341
diff changeset
284 jsSendPOSTRequest("action=add&type=attendees&"+args, msuccess);
61
e85ed35585fc Work on attendee editing, etc.
Matti Hamalainen <ccr@tnsp.org>
parents: 59
diff changeset
285
e85ed35585fc Work on attendee editing, etc.
Matti Hamalainen <ccr@tnsp.org>
parents: 59
diff changeset
286 return false;
e85ed35585fc Work on attendee editing, etc.
Matti Hamalainen <ccr@tnsp.org>
parents: 59
diff changeset
287 }
e85ed35585fc Work on attendee editing, etc.
Matti Hamalainen <ccr@tnsp.org>
parents: 59
diff changeset
288
e85ed35585fc Work on attendee editing, etc.
Matti Hamalainen <ccr@tnsp.org>
parents: 59
diff changeset
289
0
8019b357cc03 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
290 function deleteAttendee(id)
8019b357cc03 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
291 {
400
f0a09fbca728 Rename some functions.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
292 jsDeleteItem(id, "attendee", "attendees", "refreshDispatchCC('Attendees');", "attendee");
0
8019b357cc03 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
293 }
8019b357cc03 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
294
8019b357cc03 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
295
8019b357cc03 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
296 function updateAttendee(id)
8019b357cc03 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
297 {
346
c922e5200c55 Rename makePostArgs() to jsMakePostArgs().
Matti Hamalainen <ccr@tnsp.org>
parents: 345
diff changeset
298 var args = jsMakePostArgs({"name":1,"groups":1,"oneliner":1,"email":1}, "at", id);
0
8019b357cc03 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
299
53
71256605546b More work on admin interface.
Matti Hamalainen <ccr@tnsp.org>
parents: 52
diff changeset
300 var msuccess = function(txt)
71256605546b More work on admin interface.
Matti Hamalainen <ccr@tnsp.org>
parents: 52
diff changeset
301 {
400
f0a09fbca728 Rename some functions.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
302 jsRefreshItems("attendee"+id, "attendee", "&id="+id+"&edit=1");
53
71256605546b More work on admin interface.
Matti Hamalainen <ccr@tnsp.org>
parents: 52
diff changeset
303 }
71256605546b More work on admin interface.
Matti Hamalainen <ccr@tnsp.org>
parents: 52
diff changeset
304
61
e85ed35585fc Work on attendee editing, etc.
Matti Hamalainen <ccr@tnsp.org>
parents: 59
diff changeset
305 if (args != "")
342
3175ec252c73 Rename sendPOSTRequest() to jsSendPOSTRequest().
Matti Hamalainen <ccr@tnsp.org>
parents: 341
diff changeset
306 jsSendPOSTRequest("action=update&type=attendees&id="+id+"&"+args, msuccess);
0
8019b357cc03 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
307 }
8019b357cc03 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
308
8019b357cc03 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
309
205
77d33161f8be More work on admin interface.
Matti Hamalainen <ccr@tnsp.org>
parents: 202
diff changeset
310 function activateAttendee(id)
52
cba0b944da79 Start combining "users" with "attendees".
Matti Hamalainen <ccr@tnsp.org>
parents: 33
diff changeset
311 {
205
77d33161f8be More work on admin interface.
Matti Hamalainen <ccr@tnsp.org>
parents: 202
diff changeset
312 var msuccess1 = function(txt)
77d33161f8be More work on admin interface.
Matti Hamalainen <ccr@tnsp.org>
parents: 202
diff changeset
313 {
217
d313f9907610 Fix active attendee handling.
Matti Hamalainen <ccr@tnsp.org>
parents: 215
diff changeset
314 var nitem = document.getElementById("attendee"+prevAttendee);
206
1fa109a0c583 Change active attendee entry's background color as indicator.
Matti Hamalainen <ccr@tnsp.org>
parents: 205
diff changeset
315 if (nitem)
1fa109a0c583 Change active attendee entry's background color as indicator.
Matti Hamalainen <ccr@tnsp.org>
parents: 205
diff changeset
316 {
1fa109a0c583 Change active attendee entry's background color as indicator.
Matti Hamalainen <ccr@tnsp.org>
parents: 205
diff changeset
317 nitem.innerHTML = txt;
1fa109a0c583 Change active attendee entry's background color as indicator.
Matti Hamalainen <ccr@tnsp.org>
parents: 205
diff changeset
318 nitem.style.background = activeTmp;
1fa109a0c583 Change active attendee entry's background color as indicator.
Matti Hamalainen <ccr@tnsp.org>
parents: 205
diff changeset
319 }
205
77d33161f8be More work on admin interface.
Matti Hamalainen <ccr@tnsp.org>
parents: 202
diff changeset
320 }
77d33161f8be More work on admin interface.
Matti Hamalainen <ccr@tnsp.org>
parents: 202
diff changeset
321
77d33161f8be More work on admin interface.
Matti Hamalainen <ccr@tnsp.org>
parents: 202
diff changeset
322 var msuccess2 = function(txt)
52
cba0b944da79 Start combining "users" with "attendees".
Matti Hamalainen <ccr@tnsp.org>
parents: 33
diff changeset
323 {
205
77d33161f8be More work on admin interface.
Matti Hamalainen <ccr@tnsp.org>
parents: 202
diff changeset
324 var nitem = document.getElementById("attendee"+id);
206
1fa109a0c583 Change active attendee entry's background color as indicator.
Matti Hamalainen <ccr@tnsp.org>
parents: 205
diff changeset
325 if (nitem)
1fa109a0c583 Change active attendee entry's background color as indicator.
Matti Hamalainen <ccr@tnsp.org>
parents: 205
diff changeset
326 {
1fa109a0c583 Change active attendee entry's background color as indicator.
Matti Hamalainen <ccr@tnsp.org>
parents: 205
diff changeset
327 nitem.innerHTML = txt;
1fa109a0c583 Change active attendee entry's background color as indicator.
Matti Hamalainen <ccr@tnsp.org>
parents: 205
diff changeset
328 activeTmp = nitem.style.background;
1fa109a0c583 Change active attendee entry's background color as indicator.
Matti Hamalainen <ccr@tnsp.org>
parents: 205
diff changeset
329 nitem.style.background = "green";
1fa109a0c583 Change active attendee entry's background color as indicator.
Matti Hamalainen <ccr@tnsp.org>
parents: 205
diff changeset
330 activeAttendee = id;
1fa109a0c583 Change active attendee entry's background color as indicator.
Matti Hamalainen <ccr@tnsp.org>
parents: 205
diff changeset
331 }
52
cba0b944da79 Start combining "users" with "attendees".
Matti Hamalainen <ccr@tnsp.org>
parents: 33
diff changeset
332 }
205
77d33161f8be More work on admin interface.
Matti Hamalainen <ccr@tnsp.org>
parents: 202
diff changeset
333
77d33161f8be More work on admin interface.
Matti Hamalainen <ccr@tnsp.org>
parents: 202
diff changeset
334 if (activeAttendee != id)
77d33161f8be More work on admin interface.
Matti Hamalainen <ccr@tnsp.org>
parents: 202
diff changeset
335 {
217
d313f9907610 Fix active attendee handling.
Matti Hamalainen <ccr@tnsp.org>
parents: 215
diff changeset
336 prevAttendee = activeAttendee;
d313f9907610 Fix active attendee handling.
Matti Hamalainen <ccr@tnsp.org>
parents: 215
diff changeset
337 activeAttendee = id;
d313f9907610 Fix active attendee handling.
Matti Hamalainen <ccr@tnsp.org>
parents: 215
diff changeset
338
d313f9907610 Fix active attendee handling.
Matti Hamalainen <ccr@tnsp.org>
parents: 215
diff changeset
339 if (prevAttendee != -1)
342
3175ec252c73 Rename sendPOSTRequest() to jsSendPOSTRequest().
Matti Hamalainen <ccr@tnsp.org>
parents: 341
diff changeset
340 jsSendPOSTRequest("action=get&type=attendee&id="+prevAttendee+"&edit=0", msuccess1);
205
77d33161f8be More work on admin interface.
Matti Hamalainen <ccr@tnsp.org>
parents: 202
diff changeset
341
342
3175ec252c73 Rename sendPOSTRequest() to jsSendPOSTRequest().
Matti Hamalainen <ccr@tnsp.org>
parents: 341
diff changeset
342 jsSendPOSTRequest("action=get&type=attendee&id="+id+"&edit=1", msuccess2);
205
77d33161f8be More work on admin interface.
Matti Hamalainen <ccr@tnsp.org>
parents: 202
diff changeset
343 }
52
cba0b944da79 Start combining "users" with "attendees".
Matti Hamalainen <ccr@tnsp.org>
parents: 33
diff changeset
344 }
cba0b944da79 Start combining "users" with "attendees".
Matti Hamalainen <ccr@tnsp.org>
parents: 33
diff changeset
345
cba0b944da79 Start combining "users" with "attendees".
Matti Hamalainen <ccr@tnsp.org>
parents: 33
diff changeset
346
0
8019b357cc03 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
347 function addCompo()
8019b357cc03 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
348 {
346
c922e5200c55 Rename makePostArgs() to jsMakePostArgs().
Matti Hamalainen <ccr@tnsp.org>
parents: 345
diff changeset
349 var args = jsMakePostArgs({"name":1, "description":1}, "nc", "");
0
8019b357cc03 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
350
8019b357cc03 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
351 var msuccess = function(txt)
8019b357cc03 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
352 {
253
bbe0d57d6ac9 Use a refresh function dispatcher.
Matti Hamalainen <ccr@tnsp.org>
parents: 250
diff changeset
353 setTimeout("refreshDispatchCC('Compos');", 50);
0
8019b357cc03 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
354 }
8019b357cc03 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
355
61
e85ed35585fc Work on attendee editing, etc.
Matti Hamalainen <ccr@tnsp.org>
parents: 59
diff changeset
356 if (args != "")
342
3175ec252c73 Rename sendPOSTRequest() to jsSendPOSTRequest().
Matti Hamalainen <ccr@tnsp.org>
parents: 341
diff changeset
357 jsSendPOSTRequest("action=add&type=compo&"+args, msuccess);
0
8019b357cc03 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
358 return false;
8019b357cc03 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
359 }
8019b357cc03 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
360
8019b357cc03 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
361
8019b357cc03 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
362 function updateCompo(id)
8019b357cc03 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
363 {
542
8c1a53532be0 Rename various database tables and column names for better SQL compatibility.
Matti Hamalainen <ccr@tnsp.org>
parents: 493
diff changeset
364 var args = jsMakePostArgs({"name":1, "description":1, "visible":3, "voting":3, "show_authors":3}, "co", id);
0
8019b357cc03 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
365
223
532704115290 Make it possible to update news entries.
Matti Hamalainen <ccr@tnsp.org>
parents: 219
diff changeset
366 var msuccess = function(txt)
532704115290 Make it possible to update news entries.
Matti Hamalainen <ccr@tnsp.org>
parents: 219
diff changeset
367 {
400
f0a09fbca728 Rename some functions.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
368 jsRefreshItems("compo"+id, "compo", "&id="+id);
223
532704115290 Make it possible to update news entries.
Matti Hamalainen <ccr@tnsp.org>
parents: 219
diff changeset
369 }
532704115290 Make it possible to update news entries.
Matti Hamalainen <ccr@tnsp.org>
parents: 219
diff changeset
370
61
e85ed35585fc Work on attendee editing, etc.
Matti Hamalainen <ccr@tnsp.org>
parents: 59
diff changeset
371 if (args != "")
342
3175ec252c73 Rename sendPOSTRequest() to jsSendPOSTRequest().
Matti Hamalainen <ccr@tnsp.org>
parents: 341
diff changeset
372 jsSendPOSTRequest("action=update&type=compo&id="+id+"&"+args, msuccess);
0
8019b357cc03 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
373 }
8019b357cc03 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
374
59
e5e38ed4e837 Work on compo entry addition and editing.
Matti Hamalainen <ccr@tnsp.org>
parents: 55
diff changeset
375
e5e38ed4e837 Work on compo entry addition and editing.
Matti Hamalainen <ccr@tnsp.org>
parents: 55
diff changeset
376 function addEntry(id)
e5e38ed4e837 Work on compo entry addition and editing.
Matti Hamalainen <ccr@tnsp.org>
parents: 55
diff changeset
377 {
346
c922e5200c55 Rename makePostArgs() to jsMakePostArgs().
Matti Hamalainen <ccr@tnsp.org>
parents: 345
diff changeset
378 var args = jsMakePostArgs({"name":1, "author":1, "filename":1, "info":1}, "ne", id);
59
e5e38ed4e837 Work on compo entry addition and editing.
Matti Hamalainen <ccr@tnsp.org>
parents: 55
diff changeset
379
e5e38ed4e837 Work on compo entry addition and editing.
Matti Hamalainen <ccr@tnsp.org>
parents: 55
diff changeset
380 var msuccess = function(txt)
e5e38ed4e837 Work on compo entry addition and editing.
Matti Hamalainen <ccr@tnsp.org>
parents: 55
diff changeset
381 {
256
ed8d8d016420 Add refreshCMEntry(id) function for updating one entry only.
Matti Hamalainen <ccr@tnsp.org>
parents: 255
diff changeset
382 setTimeout("refreshDispatchCM("+ id +");", 50);
59
e5e38ed4e837 Work on compo entry addition and editing.
Matti Hamalainen <ccr@tnsp.org>
parents: 55
diff changeset
383 }
e5e38ed4e837 Work on compo entry addition and editing.
Matti Hamalainen <ccr@tnsp.org>
parents: 55
diff changeset
384
61
e85ed35585fc Work on attendee editing, etc.
Matti Hamalainen <ccr@tnsp.org>
parents: 59
diff changeset
385 if (args != "")
342
3175ec252c73 Rename sendPOSTRequest() to jsSendPOSTRequest().
Matti Hamalainen <ccr@tnsp.org>
parents: 341
diff changeset
386 jsSendPOSTRequest("action=add&type=entry&compo_id="+id+"&"+args, msuccess);
289
b91e92f18cac Make changing of entry's compo_id to work in a somewhat more userfriendly manner.
Matti Hamalainen <ccr@tnsp.org>
parents: 286
diff changeset
387
59
e5e38ed4e837 Work on compo entry addition and editing.
Matti Hamalainen <ccr@tnsp.org>
parents: 55
diff changeset
388 return false;
e5e38ed4e837 Work on compo entry addition and editing.
Matti Hamalainen <ccr@tnsp.org>
parents: 55
diff changeset
389 }
e5e38ed4e837 Work on compo entry addition and editing.
Matti Hamalainen <ccr@tnsp.org>
parents: 55
diff changeset
390
e5e38ed4e837 Work on compo entry addition and editing.
Matti Hamalainen <ccr@tnsp.org>
parents: 55
diff changeset
391
289
b91e92f18cac Make changing of entry's compo_id to work in a somewhat more userfriendly manner.
Matti Hamalainen <ccr@tnsp.org>
parents: 286
diff changeset
392 function updateEntry(cid, id)
0
8019b357cc03 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
393 {
346
c922e5200c55 Rename makePostArgs() to jsMakePostArgs().
Matti Hamalainen <ccr@tnsp.org>
parents: 345
diff changeset
394 var args = jsMakePostArgs({"name":1, "author":1, "filename":1, "info":1, "compo_id":2}, "en", id);
289
b91e92f18cac Make changing of entry's compo_id to work in a somewhat more userfriendly manner.
Matti Hamalainen <ccr@tnsp.org>
parents: 286
diff changeset
395 var compo_id = lastPostArgs["compo_id"];
0
8019b357cc03 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
396
59
e5e38ed4e837 Work on compo entry addition and editing.
Matti Hamalainen <ccr@tnsp.org>
parents: 55
diff changeset
397 var msuccess = function(txt)
e5e38ed4e837 Work on compo entry addition and editing.
Matti Hamalainen <ccr@tnsp.org>
parents: 55
diff changeset
398 {
289
b91e92f18cac Make changing of entry's compo_id to work in a somewhat more userfriendly manner.
Matti Hamalainen <ccr@tnsp.org>
parents: 286
diff changeset
399 if (cid != compo_id)
b91e92f18cac Make changing of entry's compo_id to work in a somewhat more userfriendly manner.
Matti Hamalainen <ccr@tnsp.org>
parents: 286
diff changeset
400 {
b91e92f18cac Make changing of entry's compo_id to work in a somewhat more userfriendly manner.
Matti Hamalainen <ccr@tnsp.org>
parents: 286
diff changeset
401 var nitem = document.getElementById("entry"+ id);
b91e92f18cac Make changing of entry's compo_id to work in a somewhat more userfriendly manner.
Matti Hamalainen <ccr@tnsp.org>
parents: 286
diff changeset
402 if (nitem)
b91e92f18cac Make changing of entry's compo_id to work in a somewhat more userfriendly manner.
Matti Hamalainen <ccr@tnsp.org>
parents: 286
diff changeset
403 nitem.style.display = "none";
b91e92f18cac Make changing of entry's compo_id to work in a somewhat more userfriendly manner.
Matti Hamalainen <ccr@tnsp.org>
parents: 286
diff changeset
404 }
b91e92f18cac Make changing of entry's compo_id to work in a somewhat more userfriendly manner.
Matti Hamalainen <ccr@tnsp.org>
parents: 286
diff changeset
405 else
b91e92f18cac Make changing of entry's compo_id to work in a somewhat more userfriendly manner.
Matti Hamalainen <ccr@tnsp.org>
parents: 286
diff changeset
406 setTimeout("refreshCMEntry("+ id +");", 50);
59
e5e38ed4e837 Work on compo entry addition and editing.
Matti Hamalainen <ccr@tnsp.org>
parents: 55
diff changeset
407 }
e5e38ed4e837 Work on compo entry addition and editing.
Matti Hamalainen <ccr@tnsp.org>
parents: 55
diff changeset
408
61
e85ed35585fc Work on attendee editing, etc.
Matti Hamalainen <ccr@tnsp.org>
parents: 59
diff changeset
409 if (args != "")
342
3175ec252c73 Rename sendPOSTRequest() to jsSendPOSTRequest().
Matti Hamalainen <ccr@tnsp.org>
parents: 341
diff changeset
410 jsSendPOSTRequest("action=update&type=entry&id="+id+"&"+args, msuccess);
0
8019b357cc03 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
411 }
8019b357cc03 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
412
8019b357cc03 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
413
258
08b292dd12ff More work on entry admin.
Matti Hamalainen <ccr@tnsp.org>
parents: 256
diff changeset
414 function deleteEntry(cid, id)
0
8019b357cc03 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
415 {
400
f0a09fbca728 Rename some functions.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
416 jsDeleteItem(id, "entry", "entries", "refreshDispatchCM("+ cid +");", "entry");
0
8019b357cc03 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
417 }
8019b357cc03 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
418
8019b357cc03 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
419
350
2a12f5c72b66 Modularize a bit and add confirmation for deactivating of votekeys.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
420 function voteKeyRefresh(id)
321
9462a59d3ab3 Votekey activation usability improvements.
Matti Hamalainen <ccr@tnsp.org>
parents: 320
diff changeset
421 {
9462a59d3ab3 Votekey activation usability improvements.
Matti Hamalainen <ccr@tnsp.org>
parents: 320
diff changeset
422 var msuccess2 = function(txt)
9462a59d3ab3 Votekey activation usability improvements.
Matti Hamalainen <ccr@tnsp.org>
parents: 320
diff changeset
423 {
9462a59d3ab3 Votekey activation usability improvements.
Matti Hamalainen <ccr@tnsp.org>
parents: 320
diff changeset
424 var nitem = document.getElementById("vkey"+id);
9462a59d3ab3 Votekey activation usability improvements.
Matti Hamalainen <ccr@tnsp.org>
parents: 320
diff changeset
425 if (nitem)
9462a59d3ab3 Votekey activation usability improvements.
Matti Hamalainen <ccr@tnsp.org>
parents: 320
diff changeset
426 nitem.className = txt;
9462a59d3ab3 Votekey activation usability improvements.
Matti Hamalainen <ccr@tnsp.org>
parents: 320
diff changeset
427 }
9462a59d3ab3 Votekey activation usability improvements.
Matti Hamalainen <ccr@tnsp.org>
parents: 320
diff changeset
428
9462a59d3ab3 Votekey activation usability improvements.
Matti Hamalainen <ccr@tnsp.org>
parents: 320
diff changeset
429 var msuccess1 = function(txt)
9462a59d3ab3 Votekey activation usability improvements.
Matti Hamalainen <ccr@tnsp.org>
parents: 320
diff changeset
430 {
9462a59d3ab3 Votekey activation usability improvements.
Matti Hamalainen <ccr@tnsp.org>
parents: 320
diff changeset
431 var nitem = document.getElementById("vkey"+id);
9462a59d3ab3 Votekey activation usability improvements.
Matti Hamalainen <ccr@tnsp.org>
parents: 320
diff changeset
432 if (nitem)
9462a59d3ab3 Votekey activation usability improvements.
Matti Hamalainen <ccr@tnsp.org>
parents: 320
diff changeset
433 nitem.innerHTML = txt;
9462a59d3ab3 Votekey activation usability improvements.
Matti Hamalainen <ccr@tnsp.org>
parents: 320
diff changeset
434 }
9462a59d3ab3 Votekey activation usability improvements.
Matti Hamalainen <ccr@tnsp.org>
parents: 320
diff changeset
435
350
2a12f5c72b66 Modularize a bit and add confirmation for deactivating of votekeys.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
436 jsSendPOSTRequest("action=get&type=votekey&id="+id, msuccess1);
2a12f5c72b66 Modularize a bit and add confirmation for deactivating of votekeys.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
437 jsSendPOSTRequest("action=get&type=votekeyclass&id="+id, msuccess2);
2a12f5c72b66 Modularize a bit and add confirmation for deactivating of votekeys.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
438 }
2a12f5c72b66 Modularize a bit and add confirmation for deactivating of votekeys.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
439
2a12f5c72b66 Modularize a bit and add confirmation for deactivating of votekeys.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
440
435
7f950ab60be4 Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 432
diff changeset
441 function voteKeyUpdate(id, type, args)
350
2a12f5c72b66 Modularize a bit and add confirmation for deactivating of votekeys.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
442 {
321
9462a59d3ab3 Votekey activation usability improvements.
Matti Hamalainen <ccr@tnsp.org>
parents: 320
diff changeset
443 var msuccess = function(txt)
9462a59d3ab3 Votekey activation usability improvements.
Matti Hamalainen <ccr@tnsp.org>
parents: 320
diff changeset
444 {
350
2a12f5c72b66 Modularize a bit and add confirmation for deactivating of votekeys.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
445 voteKeyRefresh(id);
321
9462a59d3ab3 Votekey activation usability improvements.
Matti Hamalainen <ccr@tnsp.org>
parents: 320
diff changeset
446 }
9462a59d3ab3 Votekey activation usability improvements.
Matti Hamalainen <ccr@tnsp.org>
parents: 320
diff changeset
447
435
7f950ab60be4 Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 432
diff changeset
448 jsSendPOSTRequest("action=votekey&type="+type+"&id="+id+"&"+args, msuccess);
321
9462a59d3ab3 Votekey activation usability improvements.
Matti Hamalainen <ccr@tnsp.org>
parents: 320
diff changeset
449 }
9462a59d3ab3 Votekey activation usability improvements.
Matti Hamalainen <ccr@tnsp.org>
parents: 320
diff changeset
450
9462a59d3ab3 Votekey activation usability improvements.
Matti Hamalainen <ccr@tnsp.org>
parents: 320
diff changeset
451
320
a0a6131c37b4 Vote key activation.
Matti Hamalainen <ccr@tnsp.org>
parents: 319
diff changeset
452 function voteKeySetActive(id)
308
3cfd95758377 A bit of work on vote key management backend.
Matti Hamalainen <ccr@tnsp.org>
parents: 299
diff changeset
453 {
346
c922e5200c55 Rename makePostArgs() to jsMakePostArgs().
Matti Hamalainen <ccr@tnsp.org>
parents: 345
diff changeset
454 var args = jsMakePostArgs({"active":3}, "vk", id);
350
2a12f5c72b66 Modularize a bit and add confirmation for deactivating of votekeys.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
455
2a12f5c72b66 Modularize a bit and add confirmation for deactivating of votekeys.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
456 var mcb_ok = function (data)
2a12f5c72b66 Modularize a bit and add confirmation for deactivating of votekeys.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
457 {
2a12f5c72b66 Modularize a bit and add confirmation for deactivating of votekeys.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
458 voteKeyUpdate(id, "active", args);
2a12f5c72b66 Modularize a bit and add confirmation for deactivating of votekeys.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
459 }
2a12f5c72b66 Modularize a bit and add confirmation for deactivating of votekeys.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
460
2a12f5c72b66 Modularize a bit and add confirmation for deactivating of votekeys.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
461 var mcb_cancel = function (data)
2a12f5c72b66 Modularize a bit and add confirmation for deactivating of votekeys.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
462 {
2a12f5c72b66 Modularize a bit and add confirmation for deactivating of votekeys.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
463 voteKeyRefresh(id);
2a12f5c72b66 Modularize a bit and add confirmation for deactivating of votekeys.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
464 }
2a12f5c72b66 Modularize a bit and add confirmation for deactivating of votekeys.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
465
2a12f5c72b66 Modularize a bit and add confirmation for deactivating of votekeys.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
466 if (lastPostArgs["active"] == 0)
2a12f5c72b66 Modularize a bit and add confirmation for deactivating of votekeys.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
467 jsConfirmBox("Are you sure you want to deactivate vote key #"+id+"?", mcb_ok, mcb_cancel, 0);
2a12f5c72b66 Modularize a bit and add confirmation for deactivating of votekeys.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
468 else
2a12f5c72b66 Modularize a bit and add confirmation for deactivating of votekeys.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
469 mcb_ok(0);
308
3cfd95758377 A bit of work on vote key management backend.
Matti Hamalainen <ccr@tnsp.org>
parents: 299
diff changeset
470 }
3cfd95758377 A bit of work on vote key management backend.
Matti Hamalainen <ccr@tnsp.org>
parents: 299
diff changeset
471
3cfd95758377 A bit of work on vote key management backend.
Matti Hamalainen <ccr@tnsp.org>
parents: 299
diff changeset
472
319
623acd958944 Simplify things, add clear button to vote key assignation.
Matti Hamalainen <ccr@tnsp.org>
parents: 312
diff changeset
473 function voteKeyAssign(id, mode)
308
3cfd95758377 A bit of work on vote key management backend.
Matti Hamalainen <ccr@tnsp.org>
parents: 299
diff changeset
474 {
346
c922e5200c55 Rename makePostArgs() to jsMakePostArgs().
Matti Hamalainen <ccr@tnsp.org>
parents: 345
diff changeset
475 var args = jsMakePostArgs({"key_id":2}, "vk", id);
308
3cfd95758377 A bit of work on vote key management backend.
Matti Hamalainen <ccr@tnsp.org>
parents: 299
diff changeset
476
349
61c4dda0ec03 New message/confirmation boxes code done in JS + CSS instead of relying on
Matti Hamalainen <ccr@tnsp.org>
parents: 347
diff changeset
477 var mcb_ok = function (data)
319
623acd958944 Simplify things, add clear button to vote key assignation.
Matti Hamalainen <ccr@tnsp.org>
parents: 312
diff changeset
478 {
350
2a12f5c72b66 Modularize a bit and add confirmation for deactivating of votekeys.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
479 voteKeyUpdate(id, (mode ? "assign" : "clear"), args);
319
623acd958944 Simplify things, add clear button to vote key assignation.
Matti Hamalainen <ccr@tnsp.org>
parents: 312
diff changeset
480 }
349
61c4dda0ec03 New message/confirmation boxes code done in JS + CSS instead of relying on
Matti Hamalainen <ccr@tnsp.org>
parents: 347
diff changeset
481
61c4dda0ec03 New message/confirmation boxes code done in JS + CSS instead of relying on
Matti Hamalainen <ccr@tnsp.org>
parents: 347
diff changeset
482 if (mode == 0)
61c4dda0ec03 New message/confirmation boxes code done in JS + CSS instead of relying on
Matti Hamalainen <ccr@tnsp.org>
parents: 347
diff changeset
483 jsConfirmBox("Are you sure you want to clear vote key assign #"+id+"?", mcb_ok, 0, 0);
61c4dda0ec03 New message/confirmation boxes code done in JS + CSS instead of relying on
Matti Hamalainen <ccr@tnsp.org>
parents: 347
diff changeset
484 else
61c4dda0ec03 New message/confirmation boxes code done in JS + CSS instead of relying on
Matti Hamalainen <ccr@tnsp.org>
parents: 347
diff changeset
485 mcb_ok(0);
308
3cfd95758377 A bit of work on vote key management backend.
Matti Hamalainen <ccr@tnsp.org>
parents: 299
diff changeset
486 }
3cfd95758377 A bit of work on vote key management backend.
Matti Hamalainen <ccr@tnsp.org>
parents: 299
diff changeset
487
0
8019b357cc03 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
488
378
5722c37aba2a It has begun.
Matti Hamalainen <ccr@tnsp.org>
parents: 364
diff changeset
489 function performSystemCheck()
5722c37aba2a It has begun.
Matti Hamalainen <ccr@tnsp.org>
parents: 364
diff changeset
490 {
5722c37aba2a It has begun.
Matti Hamalainen <ccr@tnsp.org>
parents: 364
diff changeset
491 jsSendPOSTRequest("action=check", jsMessageBox);
5722c37aba2a It has begun.
Matti Hamalainen <ccr@tnsp.org>
parents: 364
diff changeset
492 }
5722c37aba2a It has begun.
Matti Hamalainen <ccr@tnsp.org>
parents: 364
diff changeset
493
5722c37aba2a It has begun.
Matti Hamalainen <ccr@tnsp.org>
parents: 364
diff changeset
494
5722c37aba2a It has begun.
Matti Hamalainen <ccr@tnsp.org>
parents: 364
diff changeset
495 function generateEntryPositions(id, patch)
5722c37aba2a It has begun.
Matti Hamalainen <ccr@tnsp.org>
parents: 364
diff changeset
496 {
385
8b8b0a83233b Add compo entry show position buttons to individual compos.
Matti Hamalainen <ccr@tnsp.org>
parents: 384
diff changeset
497 var msuccess = function (data)
8b8b0a83233b Add compo entry show position buttons to individual compos.
Matti Hamalainen <ccr@tnsp.org>
parents: 384
diff changeset
498 {
8b8b0a83233b Add compo entry show position buttons to individual compos.
Matti Hamalainen <ccr@tnsp.org>
parents: 384
diff changeset
499 refreshDispatchCM(id);
493
7061683be67e Refresh current entry and entrylist data in compo control if regenerating
Matti Hamalainen <ccr@tnsp.org>
parents: 472
diff changeset
500 refreshCurrEntryData();
7061683be67e Refresh current entry and entrylist data in compo control if regenerating
Matti Hamalainen <ccr@tnsp.org>
parents: 472
diff changeset
501 refreshCurrEntryListData();
385
8b8b0a83233b Add compo entry show position buttons to individual compos.
Matti Hamalainen <ccr@tnsp.org>
parents: 384
diff changeset
502 }
8b8b0a83233b Add compo entry show position buttons to individual compos.
Matti Hamalainen <ccr@tnsp.org>
parents: 384
diff changeset
503
378
5722c37aba2a It has begun.
Matti Hamalainen <ccr@tnsp.org>
parents: 364
diff changeset
504 var mcb_ok = function (data)
5722c37aba2a It has begun.
Matti Hamalainen <ccr@tnsp.org>
parents: 364
diff changeset
505 {
5722c37aba2a It has begun.
Matti Hamalainen <ccr@tnsp.org>
parents: 364
diff changeset
506 if (id == 0)
493
7061683be67e Refresh current entry and entrylist data in compo control if regenerating
Matti Hamalainen <ccr@tnsp.org>
parents: 472
diff changeset
507 jsSendPOSTRequest("action=randomize&type=all&patch="+patch, msuccess);
378
5722c37aba2a It has begun.
Matti Hamalainen <ccr@tnsp.org>
parents: 364
diff changeset
508 else
385
8b8b0a83233b Add compo entry show position buttons to individual compos.
Matti Hamalainen <ccr@tnsp.org>
parents: 384
diff changeset
509 jsSendPOSTRequest("action=randomize&type=compo&id="+id+"&patch="+patch, msuccess);
378
5722c37aba2a It has begun.
Matti Hamalainen <ccr@tnsp.org>
parents: 364
diff changeset
510 }
5722c37aba2a It has begun.
Matti Hamalainen <ccr@tnsp.org>
parents: 364
diff changeset
511
5722c37aba2a It has begun.
Matti Hamalainen <ccr@tnsp.org>
parents: 364
diff changeset
512 if (patch == 0)
385
8b8b0a83233b Add compo entry show position buttons to individual compos.
Matti Hamalainen <ccr@tnsp.org>
parents: 384
diff changeset
513 {
8b8b0a83233b Add compo entry show position buttons to individual compos.
Matti Hamalainen <ccr@tnsp.org>
parents: 384
diff changeset
514 jsConfirmBox("Are you <b>sure</b> you want to delete and regenerate entry show positions "+
8b8b0a83233b Add compo entry show position buttons to individual compos.
Matti Hamalainen <ccr@tnsp.org>
parents: 384
diff changeset
515 (id == 0 ? "for ALL compos" : "for this compo") +"? "+
8b8b0a83233b Add compo entry show position buttons to individual compos.
Matti Hamalainen <ccr@tnsp.org>
parents: 384
diff changeset
516 "<b>This will completely annihilate current show position numbers!</b>", mcb_ok, 0, 0);
8b8b0a83233b Add compo entry show position buttons to individual compos.
Matti Hamalainen <ccr@tnsp.org>
parents: 384
diff changeset
517 }
378
5722c37aba2a It has begun.
Matti Hamalainen <ccr@tnsp.org>
parents: 364
diff changeset
518 else
5722c37aba2a It has begun.
Matti Hamalainen <ccr@tnsp.org>
parents: 364
diff changeset
519 mcb_ok(0);
5722c37aba2a It has begun.
Matti Hamalainen <ccr@tnsp.org>
parents: 364
diff changeset
520 }
5722c37aba2a It has begun.
Matti Hamalainen <ccr@tnsp.org>
parents: 364
diff changeset
521
5722c37aba2a It has begun.
Matti Hamalainen <ccr@tnsp.org>
parents: 364
diff changeset
522
448
882de5f597da Cosmetics.
Matti Hamalainen <ccr@tnsp.org>
parents: 446
diff changeset
523 //
882de5f597da Cosmetics.
Matti Hamalainen <ccr@tnsp.org>
parents: 446
diff changeset
524 // Competition control
882de5f597da Cosmetics.
Matti Hamalainen <ccr@tnsp.org>
parents: 446
diff changeset
525 //
390
3257ae94ba1c Work on show display backend logic.
Matti Hamalainen <ccr@tnsp.org>
parents: 385
diff changeset
526 function setShowMode(mode)
378
5722c37aba2a It has begun.
Matti Hamalainen <ccr@tnsp.org>
parents: 364
diff changeset
527 {
390
3257ae94ba1c Work on show display backend logic.
Matti Hamalainen <ccr@tnsp.org>
parents: 385
diff changeset
528 jsSendPOSTRequest("action=ctrl&type=setShowMode&mode="+mode);
378
5722c37aba2a It has begun.
Matti Hamalainen <ccr@tnsp.org>
parents: 364
diff changeset
529 }
5722c37aba2a It has begun.
Matti Hamalainen <ccr@tnsp.org>
parents: 364
diff changeset
530
5722c37aba2a It has begun.
Matti Hamalainen <ccr@tnsp.org>
parents: 364
diff changeset
531
407
eaea1ae2bc3d Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 404
diff changeset
532 function refreshCurrEntryData()
eaea1ae2bc3d Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 404
diff changeset
533 {
eaea1ae2bc3d Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 404
diff changeset
534 jsRefreshItems("ctrlCurrEntryData", "infoCurrEntryData", "");
eaea1ae2bc3d Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 404
diff changeset
535 }
eaea1ae2bc3d Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 404
diff changeset
536
eaea1ae2bc3d Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 404
diff changeset
537
eaea1ae2bc3d Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 404
diff changeset
538 function refreshCurrEntryListData()
eaea1ae2bc3d Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 404
diff changeset
539 {
eaea1ae2bc3d Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 404
diff changeset
540 jsRefreshItems("ctrlEntryList", "infoCurrEntryList", "");
eaea1ae2bc3d Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 404
diff changeset
541 refreshCurrEntryData();
eaea1ae2bc3d Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 404
diff changeset
542 }
eaea1ae2bc3d Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 404
diff changeset
543
eaea1ae2bc3d Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 404
diff changeset
544
404
d454f7eebddd Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 400
diff changeset
545 function activateCompo()
d454f7eebddd Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 400
diff changeset
546 {
407
eaea1ae2bc3d Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 404
diff changeset
547 jsSendPOSTRequest("action=ctrl&type=setCompoID&id="+jsGetValue("ctrlCompoListSel", 4), refreshCurrEntryListData);
408
db85700cb258 And so on.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
548 }
404
d454f7eebddd Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 400
diff changeset
549
408
db85700cb258 And so on.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
550
db85700cb258 And so on.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
551 function setSelectedEntry()
db85700cb258 And so on.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
552 {
db85700cb258 And so on.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
553 jsSendPOSTRequest("action=ctrl&type=setEntry&index="+jsGetValue("ctrlEntryListSel", 4), refreshCurrEntryData);
db85700cb258 And so on.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
554 }
db85700cb258 And so on.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
555
db85700cb258 And so on.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
556
db85700cb258 And so on.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
557 function switchEntry(dir)
db85700cb258 And so on.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
558 {
db85700cb258 And so on.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
559 jsSendPOSTRequest("action=ctrl&type="+ (dir < 0 ? "prevEntry" : "nextEntry"), refreshCurrEntryListData);
db85700cb258 And so on.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
560 }
db85700cb258 And so on.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
561
db85700cb258 And so on.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
562
448
882de5f597da Cosmetics.
Matti Hamalainen <ccr@tnsp.org>
parents: 446
diff changeset
563 //
882de5f597da Cosmetics.
Matti Hamalainen <ccr@tnsp.org>
parents: 446
diff changeset
564 // Rotation list editing and handling
882de5f597da Cosmetics.
Matti Hamalainen <ccr@tnsp.org>
parents: 446
diff changeset
565 //
462
52d11e7e9d62 Refresh rotation list list when needed.
Matti Hamalainen <ccr@tnsp.org>
parents: 461
diff changeset
566 function refreshRotationListSel()
52d11e7e9d62 Refresh rotation list list when needed.
Matti Hamalainen <ccr@tnsp.org>
parents: 461
diff changeset
567 {
52d11e7e9d62 Refresh rotation list list when needed.
Matti Hamalainen <ccr@tnsp.org>
parents: 461
diff changeset
568 jsRefreshItems("ctrlRotationListsSel", "infoRotationLists", "");
52d11e7e9d62 Refresh rotation list list when needed.
Matti Hamalainen <ccr@tnsp.org>
parents: 461
diff changeset
569 }
52d11e7e9d62 Refresh rotation list list when needed.
Matti Hamalainen <ccr@tnsp.org>
parents: 461
diff changeset
570
52d11e7e9d62 Refresh rotation list list when needed.
Matti Hamalainen <ccr@tnsp.org>
parents: 461
diff changeset
571
459
Matti Hamalainen <ccr@tnsp.org>
parents: 457
diff changeset
572 function refreshRotationListEdit(id)
422
b7c395958728 Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 419
diff changeset
573 {
459
Matti Hamalainen <ccr@tnsp.org>
parents: 457
diff changeset
574 jsRefreshItems("ctrlRotationListEdit", "infoRotationListEdit", "&id="+id+"&full=0");
462
52d11e7e9d62 Refresh rotation list list when needed.
Matti Hamalainen <ccr@tnsp.org>
parents: 461
diff changeset
575 refreshRotationListSel();
422
b7c395958728 Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 419
diff changeset
576 }
b7c395958728 Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 419
diff changeset
577
b7c395958728 Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 419
diff changeset
578
455
a23441096913 And moar.
Matti Hamalainen <ccr@tnsp.org>
parents: 454
diff changeset
579 function refreshActiveRotationList()
a23441096913 And moar.
Matti Hamalainen <ccr@tnsp.org>
parents: 454
diff changeset
580 {
a23441096913 And moar.
Matti Hamalainen <ccr@tnsp.org>
parents: 454
diff changeset
581 jsRefreshItems("ctrlActiveRotationList", "infoActiveRotationList", "");
a23441096913 And moar.
Matti Hamalainen <ccr@tnsp.org>
parents: 454
diff changeset
582 }
a23441096913 And moar.
Matti Hamalainen <ccr@tnsp.org>
parents: 454
diff changeset
583
a23441096913 And moar.
Matti Hamalainen <ccr@tnsp.org>
parents: 454
diff changeset
584
450
c7cc689071aa Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 448
diff changeset
585 function setRotateDuration()
c7cc689071aa Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 448
diff changeset
586 {
c7cc689071aa Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 448
diff changeset
587 var duration = jsGetValue("ctrlRotSlideDuration", 2);
c7cc689071aa Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 448
diff changeset
588 jsSendPOSTRequest("action=ctrl&type=setRotateDuration&duration="+duration);
c7cc689071aa Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 448
diff changeset
589 }
c7cc689071aa Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 448
diff changeset
590
c7cc689071aa Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 448
diff changeset
591
454
ea7fc4e9f602 Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 453
diff changeset
592 function setActiveRotationList()
453
f2a0da566e30 Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 450
diff changeset
593 {
f2a0da566e30 Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 450
diff changeset
594 var id = jsGetValue("ctrlRotationListsSel", 4);
f2a0da566e30 Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 450
diff changeset
595 if (id > 0)
455
a23441096913 And moar.
Matti Hamalainen <ccr@tnsp.org>
parents: 454
diff changeset
596 jsSendPOSTRequest("action=ctrl&type=setActiveRotationList&id="+id, refreshActiveRotationList);
453
f2a0da566e30 Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 450
diff changeset
597 else
f2a0da566e30 Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 450
diff changeset
598 jsMessageBox("No rotation list selected?");
f2a0da566e30 Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 450
diff changeset
599 }
f2a0da566e30 Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 450
diff changeset
600
f2a0da566e30 Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 450
diff changeset
601
f2a0da566e30 Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 450
diff changeset
602 function updateRotationList(id)
f2a0da566e30 Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 450
diff changeset
603 {
f2a0da566e30 Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 450
diff changeset
604 var name = jsGetValue("ctrlEDRotationListName", 1);
f2a0da566e30 Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 450
diff changeset
605 jsSendPOSTRequest("action=ctrl&type=updateRotationList&id="+id+"&name="+name, refreshRotationListSel);
f2a0da566e30 Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 450
diff changeset
606 }
f2a0da566e30 Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 450
diff changeset
607
f2a0da566e30 Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 450
diff changeset
608
450
c7cc689071aa Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 448
diff changeset
609 function moveRotationListSlide(list_id, dir)
422
b7c395958728 Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 419
diff changeset
610 {
459
Matti Hamalainen <ccr@tnsp.org>
parents: 457
diff changeset
611 var msuccess = function(txt)
Matti Hamalainen <ccr@tnsp.org>
parents: 457
diff changeset
612 {
Matti Hamalainen <ccr@tnsp.org>
parents: 457
diff changeset
613 refreshRotationListEdit(list_id);
Matti Hamalainen <ccr@tnsp.org>
parents: 457
diff changeset
614 }
Matti Hamalainen <ccr@tnsp.org>
parents: 457
diff changeset
615
461
ac7357d52ff6 Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 459
diff changeset
616 var slide = jsGetValue("ctrlEDRotationListSel", 4);
ac7357d52ff6 Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 459
diff changeset
617 if (slide)
ac7357d52ff6 Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 459
diff changeset
618 {
ac7357d52ff6 Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 459
diff changeset
619 var str = slide.split("_");
ac7357d52ff6 Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 459
diff changeset
620 jsSendPOSTRequest("action=ctrl&type=moveRotationListSlide&list_id="+list_id+
ac7357d52ff6 Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 459
diff changeset
621 "&slide_id="+parseInt(str[0])+"&order_num="+parseInt(str[1])+"&dir="+dir, msuccess);
ac7357d52ff6 Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 459
diff changeset
622 }
450
c7cc689071aa Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 448
diff changeset
623 else
c7cc689071aa Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 448
diff changeset
624 jsMessageBox("No slide selected?");
422
b7c395958728 Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 419
diff changeset
625 }
b7c395958728 Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 419
diff changeset
626
b7c395958728 Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 419
diff changeset
627
450
c7cc689071aa Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 448
diff changeset
628 function addRotationListSlide(list_id)
422
b7c395958728 Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 419
diff changeset
629 {
459
Matti Hamalainen <ccr@tnsp.org>
parents: 457
diff changeset
630 var msuccess = function(txt)
Matti Hamalainen <ccr@tnsp.org>
parents: 457
diff changeset
631 {
Matti Hamalainen <ccr@tnsp.org>
parents: 457
diff changeset
632 refreshRotationListEdit(list_id);
Matti Hamalainen <ccr@tnsp.org>
parents: 457
diff changeset
633 }
Matti Hamalainen <ccr@tnsp.org>
parents: 457
diff changeset
634
Matti Hamalainen <ccr@tnsp.org>
parents: 457
diff changeset
635 var slide_id = jsGetValue("ctrlEDDisplaySlidesSel", 4);
450
c7cc689071aa Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 448
diff changeset
636 if (slide_id > 0)
459
Matti Hamalainen <ccr@tnsp.org>
parents: 457
diff changeset
637 jsSendPOSTRequest("action=ctrl&type=addRotationListSlide&list_id="+list_id+"&slide_id="+slide_id, msuccess);
450
c7cc689071aa Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 448
diff changeset
638 else
c7cc689071aa Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 448
diff changeset
639 jsMessageBox("No slide selected?");
422
b7c395958728 Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 419
diff changeset
640 }
b7c395958728 Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 419
diff changeset
641
b7c395958728 Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 419
diff changeset
642
461
ac7357d52ff6 Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 459
diff changeset
643 function removeRotationListSlide(list_id)
422
b7c395958728 Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 419
diff changeset
644 {
459
Matti Hamalainen <ccr@tnsp.org>
parents: 457
diff changeset
645 var msuccess = function(txt)
Matti Hamalainen <ccr@tnsp.org>
parents: 457
diff changeset
646 {
Matti Hamalainen <ccr@tnsp.org>
parents: 457
diff changeset
647 refreshRotationListEdit(list_id);
Matti Hamalainen <ccr@tnsp.org>
parents: 457
diff changeset
648 }
Matti Hamalainen <ccr@tnsp.org>
parents: 457
diff changeset
649
461
ac7357d52ff6 Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 459
diff changeset
650 var slide = jsGetValue("ctrlEDRotationListSel", 4);
ac7357d52ff6 Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 459
diff changeset
651 if (slide)
ac7357d52ff6 Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 459
diff changeset
652 {
ac7357d52ff6 Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 459
diff changeset
653 var str = slide.split("_");
ac7357d52ff6 Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 459
diff changeset
654 jsSendPOSTRequest("action=ctrl&type=removeRotationListSlide&list_id="+list_id+
ac7357d52ff6 Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 459
diff changeset
655 "&slide_id="+parseInt(str[0])+"&order_num="+parseInt(str[1]), msuccess);
ac7357d52ff6 Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 459
diff changeset
656 }
450
c7cc689071aa Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 448
diff changeset
657 else
c7cc689071aa Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 448
diff changeset
658 jsMessageBox("No slide selected?");
422
b7c395958728 Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 419
diff changeset
659 }
b7c395958728 Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 419
diff changeset
660
416
876846d8ed5b Rename some database things.
Matti Hamalainen <ccr@tnsp.org>
parents: 408
diff changeset
661
423
Matti Hamalainen <ccr@tnsp.org>
parents: 422
diff changeset
662 function editRotationList()
Matti Hamalainen <ccr@tnsp.org>
parents: 422
diff changeset
663 {
427
707213312891 Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 423
diff changeset
664 var id = jsGetValue("ctrlRotationListsSel", 4);
707213312891 Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 423
diff changeset
665 if (id > 0)
428
Matti Hamalainen <ccr@tnsp.org>
parents: 427
diff changeset
666 jsSendPOSTRequest("action=get&type=infoRotationListEdit&id="+id, jsOpenAdminPopup);
427
707213312891 Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 423
diff changeset
667 else
707213312891 Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 423
diff changeset
668 jsMessageBox("No rotation list selected?");
423
Matti Hamalainen <ccr@tnsp.org>
parents: 422
diff changeset
669 }
Matti Hamalainen <ccr@tnsp.org>
parents: 422
diff changeset
670
Matti Hamalainen <ccr@tnsp.org>
parents: 422
diff changeset
671
Matti Hamalainen <ccr@tnsp.org>
parents: 422
diff changeset
672 function newRotationList()
Matti Hamalainen <ccr@tnsp.org>
parents: 422
diff changeset
673 {
427
707213312891 Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 423
diff changeset
674 var msuccess = function(txt)
707213312891 Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 423
diff changeset
675 {
432
07d0dab94cdc Add confirmation for deleting rotation lists.
Matti Hamalainen <ccr@tnsp.org>
parents: 429
diff changeset
676 refreshRotationListSel();
428
Matti Hamalainen <ccr@tnsp.org>
parents: 427
diff changeset
677 jsOpenAdminPopup(txt);
427
707213312891 Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 423
diff changeset
678 }
707213312891 Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 423
diff changeset
679
707213312891 Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 423
diff changeset
680 jsSendPOSTRequest("action=ctrl&type=newRotationList", msuccess);
707213312891 Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 423
diff changeset
681 }
707213312891 Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 423
diff changeset
682
707213312891 Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 423
diff changeset
683
707213312891 Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 423
diff changeset
684 function deleteRotationList()
707213312891 Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 423
diff changeset
685 {
432
07d0dab94cdc Add confirmation for deleting rotation lists.
Matti Hamalainen <ccr@tnsp.org>
parents: 429
diff changeset
686 var mcb_ok = function(txt)
427
707213312891 Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 423
diff changeset
687 {
432
07d0dab94cdc Add confirmation for deleting rotation lists.
Matti Hamalainen <ccr@tnsp.org>
parents: 429
diff changeset
688 jsSendPOSTRequest("action=ctrl&type=deleteRotationList&id="+id, refreshRotationListSel);
427
707213312891 Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 423
diff changeset
689 }
707213312891 Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 423
diff changeset
690
707213312891 Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 423
diff changeset
691 var id = jsGetValue("ctrlRotationListsSel", 4);
707213312891 Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 423
diff changeset
692 if (id > 0)
432
07d0dab94cdc Add confirmation for deleting rotation lists.
Matti Hamalainen <ccr@tnsp.org>
parents: 429
diff changeset
693 {
07d0dab94cdc Add confirmation for deleting rotation lists.
Matti Hamalainen <ccr@tnsp.org>
parents: 429
diff changeset
694 jsConfirmBox("Are you <b>sure</b> you want to delete rotation list #"+id+"?",
07d0dab94cdc Add confirmation for deleting rotation lists.
Matti Hamalainen <ccr@tnsp.org>
parents: 429
diff changeset
695 mcb_ok, 0, 0);
07d0dab94cdc Add confirmation for deleting rotation lists.
Matti Hamalainen <ccr@tnsp.org>
parents: 429
diff changeset
696 }
427
707213312891 Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 423
diff changeset
697 else
707213312891 Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 423
diff changeset
698 jsMessageBox("No rotation list selected?");
423
Matti Hamalainen <ccr@tnsp.org>
parents: 422
diff changeset
699 }
Matti Hamalainen <ccr@tnsp.org>
parents: 422
diff changeset
700
Matti Hamalainen <ccr@tnsp.org>
parents: 422
diff changeset
701
446
b4aba28883a8 Cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 445
diff changeset
702 //
b4aba28883a8 Cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 445
diff changeset
703 // Display slide editing and handling
b4aba28883a8 Cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 445
diff changeset
704 //
b4aba28883a8 Cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 445
diff changeset
705 function refreshDisplaySlideListSel()
b4aba28883a8 Cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 445
diff changeset
706 {
b4aba28883a8 Cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 445
diff changeset
707 jsRefreshItems("ctrlDisplaySlidesSel", "infoDisplaySlides", "");
b4aba28883a8 Cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 445
diff changeset
708 }
b4aba28883a8 Cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 445
diff changeset
709
b4aba28883a8 Cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 445
diff changeset
710
438
48903fd966cd Things are starting to work.
Matti Hamalainen <ccr@tnsp.org>
parents: 435
diff changeset
711 function updateDisplaySlide(id)
408
db85700cb258 And so on.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
712 {
438
48903fd966cd Things are starting to work.
Matti Hamalainen <ccr@tnsp.org>
parents: 435
diff changeset
713 var vtitle = jsGetValue("ctrlDisplaySlideTitle", 1);
48903fd966cd Things are starting to work.
Matti Hamalainen <ccr@tnsp.org>
parents: 435
diff changeset
714 var vtext = jsGetValue("ctrlDisplaySlideText", 1);
48903fd966cd Things are starting to work.
Matti Hamalainen <ccr@tnsp.org>
parents: 435
diff changeset
715 jsSendPOSTRequest("action=ctrl&type=updateDisplaySlide&id="+id+"&title="+vtitle+"&text="+vtext, refreshDisplaySlideListSel);
428
Matti Hamalainen <ccr@tnsp.org>
parents: 427
diff changeset
716 jsCloseAdminPopup();
438
48903fd966cd Things are starting to work.
Matti Hamalainen <ccr@tnsp.org>
parents: 435
diff changeset
717 return false;
408
db85700cb258 And so on.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
718 }
db85700cb258 And so on.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
719
db85700cb258 And so on.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
720
422
b7c395958728 Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 419
diff changeset
721 function editDisplaySlide()
408
db85700cb258 And so on.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
722 {
438
48903fd966cd Things are starting to work.
Matti Hamalainen <ccr@tnsp.org>
parents: 435
diff changeset
723 var id = jsGetValue("ctrlDisplaySlidesSel", 4);
48903fd966cd Things are starting to work.
Matti Hamalainen <ccr@tnsp.org>
parents: 435
diff changeset
724 if (id > 0)
48903fd966cd Things are starting to work.
Matti Hamalainen <ccr@tnsp.org>
parents: 435
diff changeset
725 jsSendPOSTRequest("action=get&type=infoDisplaySlideEdit&id="+id, jsOpenAdminPopup);
48903fd966cd Things are starting to work.
Matti Hamalainen <ccr@tnsp.org>
parents: 435
diff changeset
726 else
48903fd966cd Things are starting to work.
Matti Hamalainen <ccr@tnsp.org>
parents: 435
diff changeset
727 jsMessageBox("No display slide selected?");
48903fd966cd Things are starting to work.
Matti Hamalainen <ccr@tnsp.org>
parents: 435
diff changeset
728 }
48903fd966cd Things are starting to work.
Matti Hamalainen <ccr@tnsp.org>
parents: 435
diff changeset
729
48903fd966cd Things are starting to work.
Matti Hamalainen <ccr@tnsp.org>
parents: 435
diff changeset
730
457
3b5184c6b36f Add slide copying function.
Matti Hamalainen <ccr@tnsp.org>
parents: 455
diff changeset
731 function copyDisplaySlide()
3b5184c6b36f Add slide copying function.
Matti Hamalainen <ccr@tnsp.org>
parents: 455
diff changeset
732 {
3b5184c6b36f Add slide copying function.
Matti Hamalainen <ccr@tnsp.org>
parents: 455
diff changeset
733 var msuccess = function(txt)
3b5184c6b36f Add slide copying function.
Matti Hamalainen <ccr@tnsp.org>
parents: 455
diff changeset
734 {
3b5184c6b36f Add slide copying function.
Matti Hamalainen <ccr@tnsp.org>
parents: 455
diff changeset
735 refreshDisplaySlideListSel();
3b5184c6b36f Add slide copying function.
Matti Hamalainen <ccr@tnsp.org>
parents: 455
diff changeset
736 jsOpenAdminPopup(txt);
3b5184c6b36f Add slide copying function.
Matti Hamalainen <ccr@tnsp.org>
parents: 455
diff changeset
737 }
3b5184c6b36f Add slide copying function.
Matti Hamalainen <ccr@tnsp.org>
parents: 455
diff changeset
738
3b5184c6b36f Add slide copying function.
Matti Hamalainen <ccr@tnsp.org>
parents: 455
diff changeset
739 var id = jsGetValue("ctrlDisplaySlidesSel", 4);
3b5184c6b36f Add slide copying function.
Matti Hamalainen <ccr@tnsp.org>
parents: 455
diff changeset
740 if (id > 0)
3b5184c6b36f Add slide copying function.
Matti Hamalainen <ccr@tnsp.org>
parents: 455
diff changeset
741 jsSendPOSTRequest("action=ctrl&type=copyDisplaySlide&id="+id, msuccess);
3b5184c6b36f Add slide copying function.
Matti Hamalainen <ccr@tnsp.org>
parents: 455
diff changeset
742 else
3b5184c6b36f Add slide copying function.
Matti Hamalainen <ccr@tnsp.org>
parents: 455
diff changeset
743 jsMessageBox("No display slide selected?");
3b5184c6b36f Add slide copying function.
Matti Hamalainen <ccr@tnsp.org>
parents: 455
diff changeset
744 }
3b5184c6b36f Add slide copying function.
Matti Hamalainen <ccr@tnsp.org>
parents: 455
diff changeset
745
3b5184c6b36f Add slide copying function.
Matti Hamalainen <ccr@tnsp.org>
parents: 455
diff changeset
746
408
db85700cb258 And so on.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
747 function newDisplaySlide()
db85700cb258 And so on.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
748 {
438
48903fd966cd Things are starting to work.
Matti Hamalainen <ccr@tnsp.org>
parents: 435
diff changeset
749 var msuccess = function(txt)
48903fd966cd Things are starting to work.
Matti Hamalainen <ccr@tnsp.org>
parents: 435
diff changeset
750 {
48903fd966cd Things are starting to work.
Matti Hamalainen <ccr@tnsp.org>
parents: 435
diff changeset
751 refreshDisplaySlideListSel();
48903fd966cd Things are starting to work.
Matti Hamalainen <ccr@tnsp.org>
parents: 435
diff changeset
752 jsOpenAdminPopup(txt);
48903fd966cd Things are starting to work.
Matti Hamalainen <ccr@tnsp.org>
parents: 435
diff changeset
753 }
48903fd966cd Things are starting to work.
Matti Hamalainen <ccr@tnsp.org>
parents: 435
diff changeset
754
48903fd966cd Things are starting to work.
Matti Hamalainen <ccr@tnsp.org>
parents: 435
diff changeset
755 jsSendPOSTRequest("action=ctrl&type=newDisplaySlide", msuccess);
48903fd966cd Things are starting to work.
Matti Hamalainen <ccr@tnsp.org>
parents: 435
diff changeset
756 }
48903fd966cd Things are starting to work.
Matti Hamalainen <ccr@tnsp.org>
parents: 435
diff changeset
757
48903fd966cd Things are starting to work.
Matti Hamalainen <ccr@tnsp.org>
parents: 435
diff changeset
758
48903fd966cd Things are starting to work.
Matti Hamalainen <ccr@tnsp.org>
parents: 435
diff changeset
759 function deleteDisplaySlide()
48903fd966cd Things are starting to work.
Matti Hamalainen <ccr@tnsp.org>
parents: 435
diff changeset
760 {
48903fd966cd Things are starting to work.
Matti Hamalainen <ccr@tnsp.org>
parents: 435
diff changeset
761 var msuccess = function(txt)
48903fd966cd Things are starting to work.
Matti Hamalainen <ccr@tnsp.org>
parents: 435
diff changeset
762 {
48903fd966cd Things are starting to work.
Matti Hamalainen <ccr@tnsp.org>
parents: 435
diff changeset
763 refreshDisplaySlideListSel();
48903fd966cd Things are starting to work.
Matti Hamalainen <ccr@tnsp.org>
parents: 435
diff changeset
764 refreshRotationListSel();
48903fd966cd Things are starting to work.
Matti Hamalainen <ccr@tnsp.org>
parents: 435
diff changeset
765 }
48903fd966cd Things are starting to work.
Matti Hamalainen <ccr@tnsp.org>
parents: 435
diff changeset
766
48903fd966cd Things are starting to work.
Matti Hamalainen <ccr@tnsp.org>
parents: 435
diff changeset
767 var mcb_ok = function(txt)
48903fd966cd Things are starting to work.
Matti Hamalainen <ccr@tnsp.org>
parents: 435
diff changeset
768 {
48903fd966cd Things are starting to work.
Matti Hamalainen <ccr@tnsp.org>
parents: 435
diff changeset
769 jsSendPOSTRequest("action=ctrl&type=deleteDisplaySlide&id="+id, msuccess);
48903fd966cd Things are starting to work.
Matti Hamalainen <ccr@tnsp.org>
parents: 435
diff changeset
770 }
48903fd966cd Things are starting to work.
Matti Hamalainen <ccr@tnsp.org>
parents: 435
diff changeset
771
48903fd966cd Things are starting to work.
Matti Hamalainen <ccr@tnsp.org>
parents: 435
diff changeset
772 var id = jsGetValue("ctrlDisplaySlidesSel", 4);
48903fd966cd Things are starting to work.
Matti Hamalainen <ccr@tnsp.org>
parents: 435
diff changeset
773 if (id > 0)
48903fd966cd Things are starting to work.
Matti Hamalainen <ccr@tnsp.org>
parents: 435
diff changeset
774 {
48903fd966cd Things are starting to work.
Matti Hamalainen <ccr@tnsp.org>
parents: 435
diff changeset
775 jsConfirmBox("Are you <b>sure</b> you want to delete slide list #"+id+"?",
48903fd966cd Things are starting to work.
Matti Hamalainen <ccr@tnsp.org>
parents: 435
diff changeset
776 mcb_ok, 0, 0);
48903fd966cd Things are starting to work.
Matti Hamalainen <ccr@tnsp.org>
parents: 435
diff changeset
777 }
48903fd966cd Things are starting to work.
Matti Hamalainen <ccr@tnsp.org>
parents: 435
diff changeset
778 else
48903fd966cd Things are starting to work.
Matti Hamalainen <ccr@tnsp.org>
parents: 435
diff changeset
779 jsMessageBox("No display slide selected?");
404
d454f7eebddd Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 400
diff changeset
780 }
d454f7eebddd Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 400
diff changeset
781
d454f7eebddd Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 400
diff changeset
782
429
2e4f20bd3b82 And moar.
Matti Hamalainen <ccr@tnsp.org>
parents: 428
diff changeset
783 function activateTempSlide()
2e4f20bd3b82 And moar.
Matti Hamalainen <ccr@tnsp.org>
parents: 428
diff changeset
784 {
2e4f20bd3b82 And moar.
Matti Hamalainen <ccr@tnsp.org>
parents: 428
diff changeset
785 var id = jsGetValue("ctrlDisplaySlidesSel", 4);
2e4f20bd3b82 And moar.
Matti Hamalainen <ccr@tnsp.org>
parents: 428
diff changeset
786 var duration = jsGetValue("ctrlTempSlideDuration", 2);
2e4f20bd3b82 And moar.
Matti Hamalainen <ccr@tnsp.org>
parents: 428
diff changeset
787 if (id > 0)
2e4f20bd3b82 And moar.
Matti Hamalainen <ccr@tnsp.org>
parents: 428
diff changeset
788 jsSendPOSTRequest("action=ctrl&type=setTempSlide&id="+id+"&duration="+duration, jsMessageBox);
2e4f20bd3b82 And moar.
Matti Hamalainen <ccr@tnsp.org>
parents: 428
diff changeset
789 else
2e4f20bd3b82 And moar.
Matti Hamalainen <ccr@tnsp.org>
parents: 428
diff changeset
790 jsMessageBox("No slide selected?");
2e4f20bd3b82 And moar.
Matti Hamalainen <ccr@tnsp.org>
parents: 428
diff changeset
791 }
2e4f20bd3b82 And moar.
Matti Hamalainen <ccr@tnsp.org>
parents: 428
diff changeset
792
472
1eabbd70cd25 Add skipping button.
Matti Hamalainen <ccr@tnsp.org>
parents: 462
diff changeset
793 function skipToNextSlide()
1eabbd70cd25 Add skipping button.
Matti Hamalainen <ccr@tnsp.org>
parents: 462
diff changeset
794 {
1eabbd70cd25 Add skipping button.
Matti Hamalainen <ccr@tnsp.org>
parents: 462
diff changeset
795 jsSendPOSTRequest("action=ctrl&type=skipToNextSlide");
1eabbd70cd25 Add skipping button.
Matti Hamalainen <ccr@tnsp.org>
parents: 462
diff changeset
796 }
1eabbd70cd25 Add skipping button.
Matti Hamalainen <ccr@tnsp.org>
parents: 462
diff changeset
797
0
8019b357cc03 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
798 </script>
8019b357cc03 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
799
5
76c3b89d7b11 Improve voting, clean up the code, etc.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
800 <!-- ========================== -->
0
8019b357cc03 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
801
427
707213312891 Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 423
diff changeset
802 <div id="adminPopup"></div>
345
7bb36c015926 Move adminContent div.
Matti Hamalainen <ccr@tnsp.org>
parents: 343
diff changeset
803 <div id="adminContent">
7bb36c015926 Move adminContent div.
Matti Hamalainen <ccr@tnsp.org>
parents: 343
diff changeset
804
5
76c3b89d7b11 Improve voting, clean up the code, etc.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
805 <div id="nstatus">-</div>
201
a4be19c4d99d Modularize admin pages tab system.
Matti Hamalainen <ccr@tnsp.org>
parents: 189
diff changeset
806 <div id="tabHeadersCC" class="tabHeaders"></div>
a4be19c4d99d Modularize admin pages tab system.
Matti Hamalainen <ccr@tnsp.org>
parents: 189
diff changeset
807 <div id="tabContentsCC" class="tabContents"></div>
171
705dabdc37d4 Move administration interface page to separate layout, to make things less cramped.
Matti Hamalainen <ccr@tnsp.org>
parents: 136
diff changeset
808
0
8019b357cc03 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
809 <script type="text/javascript">
445
cf7053f04e88 Move tab handling code to majax module.
Matti Hamalainen <ccr@tnsp.org>
parents: 438
diff changeset
810 jsRegisterTab("CC", "Settings", "Settings");
cf7053f04e88 Move tab handling code to majax module.
Matti Hamalainen <ccr@tnsp.org>
parents: 438
diff changeset
811 jsRegisterTab("CC", "News", "News");
cf7053f04e88 Move tab handling code to majax module.
Matti Hamalainen <ccr@tnsp.org>
parents: 438
diff changeset
812 jsRegisterTab("CC", "Attendees", "Attendees");
cf7053f04e88 Move tab handling code to majax module.
Matti Hamalainen <ccr@tnsp.org>
parents: 438
diff changeset
813 jsRegisterTab("CC", "Voting", "Voting");
cf7053f04e88 Move tab handling code to majax module.
Matti Hamalainen <ccr@tnsp.org>
parents: 438
diff changeset
814 jsRegisterTab("CC", "Compos", "Compos");
cf7053f04e88 Move tab handling code to majax module.
Matti Hamalainen <ccr@tnsp.org>
parents: 438
diff changeset
815 jsRegisterTab("CC", "Entries", "Entries");
cf7053f04e88 Move tab handling code to majax module.
Matti Hamalainen <ccr@tnsp.org>
parents: 438
diff changeset
816 jsRegisterTab("CC", "InfoSys", "Infosystem");
cf7053f04e88 Move tab handling code to majax module.
Matti Hamalainen <ccr@tnsp.org>
parents: 438
diff changeset
817 jsUpdateTabList("CC",
263
8c3922a65231 Work on entry admin looks.
Matti Hamalainen <ccr@tnsp.org>
parents: 260
diff changeset
818 "<a class=\"admin\" href=\"admlogout.php\">Logout</a> " +
201
a4be19c4d99d Modularize admin pages tab system.
Matti Hamalainen <ccr@tnsp.org>
parents: 189
diff changeset
819 "<a class=\"admin\" href=\"about\">Mainpage</a>");
445
cf7053f04e88 Move tab handling code to majax module.
Matti Hamalainen <ccr@tnsp.org>
parents: 438
diff changeset
820 jsSwitchActiveTab("CC", "Settings");
0
8019b357cc03 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
821 </script>
171
705dabdc37d4 Move administration interface page to separate layout, to make things less cramped.
Matti Hamalainen <ccr@tnsp.org>
parents: 136
diff changeset
822 <?
705dabdc37d4 Move administration interface page to separate layout, to make things less cramped.
Matti Hamalainen <ccr@tnsp.org>
parents: 136
diff changeset
823 }
705dabdc37d4 Move administration interface page to separate layout, to make things less cramped.
Matti Hamalainen <ccr@tnsp.org>
parents: 136
diff changeset
824
705dabdc37d4 Move administration interface page to separate layout, to make things less cramped.
Matti Hamalainen <ccr@tnsp.org>
parents: 136
diff changeset
825 cmPrintPageFooter();
705dabdc37d4 Move administration interface page to separate layout, to make things less cramped.
Matti Hamalainen <ccr@tnsp.org>
parents: 136
diff changeset
826 ?>