1 function $(s) { return document.querySelectorAll(s); }
2 function $$(s) { return document.querySelector(s); }
6 while (new Date() - date < msec)
12 var forms = $('form[name=cancel]');
13 var i, f, id, http, url, params, total;
15 for (i = 0; i < forms.length - 1 && i < max; ++i) {
19 id = f.querySelector('input[name=id]');
21 http = new XMLHttpRequest();
22 http.onreadystatechange = function(state) {
23 if (this.readyState == 4) {
25 window.location.reload();
26 console.log('finished one', this.status);
30 url = document.URL + '/cancelbuild';
31 params = 'id=' + id.value;
32 http.open('POST', url, true);
33 console.log('hitting url', url, params);
35 http.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
39 console.log('spawned ' + total);
40 if (total != forms.length) {
41 console.log('total available: ' + forms.length);
44 //i = 5 * forms.length;
45 //console.log('waiting', i, 'msecs');
47 //window.location.reload();