changed git call from https to git readonly
[atutor.git] / mods / wiki / tools / t_commander / index.html
1 <html>
2 <head>
3  <title>WikiCommander</title>
4  <!--
5    - you need a frames-capable browser (then-ex-lynx-fans should try w3m!)
6    - eventually becomes a real alternative to ewikictl
7  -->
8  <link rel="stylesheet" type="text/css" href="80x25.css">
9  <script type="text/javascript" language="JavaScript"><!--
10
11
12
13 var id = "";             // selected page id
14 var ls = new Array();    // list of selected pages (if ctrl key pressed)
15 var left_off = 0;        // state/disable flag for left/editor pane
16
17
18 function delete_page() {
19    if (id) {
20       ok = confirm("Really delete all versions of '"+id+"' page ?");
21       if (ok) {
22          window.page.location.href = 'action.php?id='+escape(id)+'&delete=1';
23       }
24    }
25    else if (ls) {
26       ok = confirm("Hey, what have those poor pages done to you?\n\n..."
27              + get_ls_param(", ")
28              + "\n\nClick OK if you really want to delete them, but keep in "
29              + "mind, that there is no way to restore them later."
30       );
31       if (ok) {
32          window.page.location.href = 'action.php?delete=1'
33             + get_ls_param("&ls[]=");
34       }
35    }
36 }
37
38 function rename_page() {
39    if (id) {
40       into = prompt("Rename page '"+id+"' into what?", id);
41       if (into) {
42          window.page.location.href='action.php?id='+escape(id)
43          + '&new_id='+escape(into)+"&rename=1";
44       }
45    }
46    else if (ls) {
47       alert("Sorry, we cannot rename multiple pages at once. Use ewikictl for such tasks.");
48    }
49 }
50
51
52 function copy_page() {
53    if (id) {
54       into = prompt("Duplicate page '"+id+"' (all versions, overwrites target) as", id);
55       if (into) {
56          window.page.location.href='action.php?id='+escape(id)
57          + '&new_id='+escape(into)+"&copy=1";
58       }
59    }
60    else if (ls) {
61       alert("Can only copy one page at a time.");
62    }
63 }
64
65
66 function new_page() {
67    if (!id) {
68       id = "";
69    }
70    id = prompt("Load new database entry page template in editor", id);
71    if (id) {
72       window.page.location.href='edit.php?create=1&id='+escape(id);
73    }
74 }
75
76
77 function show_filtered_list() {
78    fn = prompt("Filter page names in list (case-insensitive) after", "*");
79    window.list.location.href='list.php?filter='+escape(fn);
80 }
81
82
83
84
85 // - - - ui behaviour - - -
86
87 function select_id(e, tr, newid) {
88    if (e.ctrlKey) {
89       if (id) {
90          ls[id] = 1;
91          id = false;
92       }
93       if (ls[newid]) {
94          ls[newid] =  undefined;
95          tr.removeAttribute("class");
96       }
97       else {
98          ls[newid] = 1;
99          tr.setAttribute("class", "selected");
100       }
101       return false;   // do never reload left window
102    }
103    else {
104       ls = new Array();
105       id = newid;
106       if (document.getElementById) {
107          remove_class_settings("tr", tr);
108          tr.setAttribute("class", "selected");
109       }
110    }
111 }
112
113
114 function click_magic(e) {
115    // how to disable selection borders?
116    return (!left_off && !e.ctrlKey);
117 }
118
119
120 // select multiple rows in right pane by glob
121 function list_selection() {
122    var i, name, glob, a_list;
123    if (id) {
124       ls[id] = 1;
125       id = false;
126    }
127    glob = prompt("Filter regex (not case-insensitive, not anchored!) to select files in right pane by", ".*");
128    if (glob = new RegExp(glob)) {
129          a_list = list.document.getElementsByTagName("a");
130          for (i=0; i<a_list.length; i++) {
131                name = a_list[i].firstChild.data;
132                if (glob.test(name)) {
133                   ls[name] = 1;
134                   a_list[i].parentNode.parentNode.setAttribute("class", "selected");
135                }
136          }
137    }
138 }
139
140
141 function remove_class_settings(tagname, butnot) {
142    var i;
143    var ch;
144    ch = list.document.getElementsByTagName(tagname);
145    for (i=0; i<ch.length; i++) {
146       if (ch[i].getAttribute("class") && (ch[i] != butnot)) {
147          ch[i].removeAttribute("class");
148       }
149    }
150 }
151
152
153
154 function get_ls_param(sep) {
155    var str = "";
156    if (!sep) {
157       sep = "&ls[]=";
158    }
159    for (var id in ls) {
160       if (ls[id]) {
161          str = str + sep + escape(id);
162       }
163    }
164    return str;
165 }
166
167
168
169  //--></script>
170 </head>
171 <frameset rows="22,*,24,22" frameborder="0" style="border:0px">
172   <frame name="menu" title="FileMenu" src="filemenu.php" height="22" noresize scrolling="no" frameborder="0" marginwidth="0" marginheight="0">
173   <frameset name="panel" cols="50%,50%" border="10" frameborder="1">
174     <frame name="page" title="PageDetails" src="info.php" width="50%" frameborder="1" scrolling="auto" marginwidth="0" marginheight="0">
175     <frame name="list" title="PageList" src="list.php" width="50%" frameborder="1" scrolling="yes" marginwidth="0" marginheight="0">
176   </frameset>  
177   <frame style="border:0px;margin:0px;" name="line" title="CommandLine" src="commandline.php" height="24" noresize frameborder="0" scrolling="no" marginwidth="0" marginheight="0">
178   <frame style="border:0px;margin:0px;" name="keys" title="KeyMenu" src="keymenu.php" height="22" noresize frameborder="0" scrolling="no" marginwidth="0" marginheight="0">
179 </frameset>
180 <noframes>
181  Go to our <a href="list.php">PageList</a> to use this tool.
182  But you were better off using a frames-capable browser (try the text-only
183  <a href="http://google.com/search?q=w3m">w3m</a> today)!
184 </noframes>
185 </html>