OSDN Git Service

c697258356b7350f07c02f0374fe690b47a76b21
[nucleus-jp/nucleus-jp-ancient.git] / nucleus / javascript / admin.js
1 /**
2   * Nucleus: PHP/MySQL Weblog CMS (http://nucleuscms.org/) 
3   * Copyright (C) 2002-2012 The Nucleus Group
4   *
5   * This program is free software; you can redistribute it and/or
6   * modify it under the terms of the GNU General Public License
7   * as published by the Free Software Foundation; either version 2
8   * of the License, or (at your option) any later version.
9   * (see nucleus/documentation/index.html#license for more info)
10   *  
11   * Some JavaScript code for the admin area
12   */
13
14 function help(url) {
15         popup = window.open(url,'helpwindow','status=no,toolbar=no,scrollbars=yes,resizable=yes,width=570,height=530,top=0,left=0');
16         if (popup.focus) popup.focus();
17         if (popup.GetAttention) popup.GetAttention();
18         return false;
19 }                               
20
21 var oldCellColor = "#000";
22 function focusRow(row) {
23         var cells = row.cells;
24         if (!cells) return;
25         oldCellColor = cells[0].style.backgroundColor;
26         for (var i=0;i<cells.length;i++) {
27                 cells[i].style.backgroundColor='whitesmoke';
28         }
29 }
30 function blurRow(row) {
31         var cells = row.cells;
32         if (!cells) return;
33         for (var i=0;i<cells.length;i++) {
34                 cells[i].style.backgroundColor=oldCellColor;
35         }
36 }
37 function batchSelectAll(what) {
38         var i = 0;
39         var el;
40         while (el = document.getElementById('batch' + i)) {
41                 el.checked = what?'checked':'';
42                 i++;
43         }
44         return false;                                   
45 }
46 function selectCanLogin(flag) {
47         if (flag) {
48                 window.document.memberedit.canlogin[0].checked=true;
49
50                 // don't disable canlogin[0], otherwise the value won't be passed.
51 //              window.document.memberedit.canlogin[0].disabled=true;
52                 window.document.memberedit.canlogin[1].disabled=true;
53         } else {
54                 window.document.memberedit.canlogin[0].disabled=false;
55                 window.document.memberedit.canlogin[1].disabled=false;
56         }
57 }