]> code.citadel.org Git - citadel.git/blobdiff - webcit/static/wclib.js
HTML Styleguide fixing.
[citadel.git] / webcit / static / wclib.js
index 792928d7969e0dc7d44c5abca52860a9603b8569..c338cb055792c97b83f54a648567f85ed03dcefa 100644 (file)
@@ -1,19 +1,19 @@
 /*
  * JavaScript function library for WebCit.
  *
- * Copyright (c) 2005-2011 by the citadel.org team
+ * Copyright (c) 2005-2012 by the citadel.org team
  *
  * This program is open source software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
+ * it under the terms of the GNU General Public License, version 3.
  * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
+ * 
  *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
- * You should have received a copy of the GNU General Public License
+ * 
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
@@ -54,7 +54,28 @@ function strcmp ( str1, str2 ) {
     return ( ( str1 == str2 ) ? 0 : ( ( str1 > str2 ) ? 1 : -1 ) );
 }
 
-
+function CtdlMarkLog($Which, $Status)
+{
+    if ($Status)
+       document.getElementById($Which).checked == false;
+    else
+       document.getElementById($Which).checked == true;
+}
+function ToggleLogEnable($Which)
+{
+    var p;
+    var Status = !document.getElementById($Which).checked;
+    if (Status)
+       p= encodeURI('g_cmd=LOGS ' + $Which + '|0');
+    else
+       p= encodeURI('g_cmd=LOGS ' + $Which + '|1');
+    new Ajax.Request('ajax_servcmd', {
+       method: 'post',
+       parameters: p,
+       onComplete: CtdlMarkLog($Which, Status)
+    });
+}
 
 function ToggleVisibility ($Which)
 {