5 function request(url
, data
)
7 xmlhttp
= new XMLHttpRequest();
8 xmlhttp
.open("POST", url
, false);
10 window
.location
.reload()
13 function edit(id
, info
)
15 request("/edit_" + id
, info
)
20 var r
=confirm("Also delete files on master?");
23 request('/clear', '{"clear":true}');
25 request('/clear', '{"clear":false}');
29 function cancel_job(id
)
31 var r
=confirm("Also delete files on master?");
34 request('/cancel_' + id
, '{"clear":true}');
36 request('/cancel_' + id
, '{"clear":false}');
40 function balance_edit(id
, old_value
)
42 var new_value
= prompt("New limit", old_value
);
43 if (new_value
!= null && new_value
!= "") {
44 request("/balance_limit", '{"' + id
+ '":"' + new_value
+ '"}');
48 function balance_enable(id
, value
)
50 request("/balance_enable", '{"' + id
+ '":' + value
+ "}");
53 function showThumb(job
, frame
)
55 if (lastFrame
!= -1) {
57 if (maxFrame
!= -1 && minFrame
!= -1) {
58 if (frame
>= minFrame
&& frame
<= maxFrame
) {
59 for(i
= minFrame
; i
<= maxFrame
; i
=i
+1) {
65 } else if (frame
> maxFrame
) {
66 for(i
= maxFrame
+1; i
<= frame
; i
=i
+1) {
72 for(i
= frame
; i
<= minFrame
-1; i
=i
+1) {
78 } else if (frame
== lastFrame
) {
79 toggleThumb(job
, frame
);
80 } else if (frame
< lastFrame
) {
84 for(i
= minFrame
; i
<= maxFrame
-1; i
=i
+1) {
92 for(i
= minFrame
+1; i
<= maxFrame
; i
=i
+1) {
98 toggleThumb(job
, frame
);
102 function toggleThumb(job
, frame
)
104 img
= document
.images
["thumb" + frame
];
105 url
= "/thumb_" + job
+ "_" + frame
+ ".jpg"
107 if (img
.style
.display
== "block") {
108 img
.style
.display
= "none";
113 img
.style
.display
= "block";
118 function returnObjById( id
)
120 if (document
.getElementById
)
121 var returnVar
= document
.getElementById(id
);
122 else if (document
.all
)
123 var returnVar
= document
.all
[id
];
124 else if (document
.layers
)
125 var returnVar
= document
.layers
[id
];
129 function toggleDisplay( className
, value1
, value2
)
131 style
= getStyle(className
)
133 if (style
.style
["display"] == value1
) {
134 style
.style
["display"] = value2
;
136 style
.style
["display"] = value1
;
140 function getStyle(className
) {
141 var classes
= document
.styleSheets
[0].rules
|| document
.styleSheets
[0].cssRules
142 for(var x
=0;x
<classes
.length
;x
++) {
143 if(classes
[x
].selectorText
==className
) {