source: DASISH/t5.6/client/chrome/markingcollection/content/markingcollection/progress.xul @ 2709

Last change on this file since 2709 was 2709, checked in by sroth, 11 years ago

Wired-Marker initial source code with minor adjustments.

  • Property svn:executable set to *
File size: 1.7 KB
Line 
1<?xml version="1.0" encoding="UTF-8" ?>
2<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
3<window
4        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
5        hidechrome="true"
6        onload="onLoad();"
7        onblur="onBlur();"
8>
9<script><![CDATA[
10  var gStatus,gStatus2, gProgressMeter, gBlur;
11  var maxProgress = 100;
12  function onLoad() {
13    gBlur = false;
14    setWindowSize();
15    gStatus = document.getElementById("status");
16    gProgressMeter = document.getElementById("progressmeter");
17
18    if("arguments" in window && window.arguments.length > 0) {
19      setStatus(window.arguments[0].status);
20    }
21    setWindowSize();
22  }
23
24  function onBlur() {
25    if(!gBlur){
26      window.focus();
27      setWindowSize();
28    }
29  }
30
31  function setProgress(value) {
32    if(!gProgressMeter) return;
33    gProgressMeter.value = 100 * value / maxProgress;
34  }
35
36  function setStatus(text) {
37    if(!gStatus) return;
38    gStatus.value = "Status: " + text;
39    setWindowSize();
40  }
41
42  function setWindowSize(){
43    try{ window.sizeToContent(); }catch(e){}
44    if(gBlur){
45      var x = screen.width - window.outerWidth;
46      var y = screen.height - window.outerHeight;
47      window.moveTo(x,y);
48    }else{
49      if(window.opener){
50        var x = (window.opener.screenX + (window.opener.outerWidth/2)) - (window.outerWidth/2);
51        var y = (window.opener.screenY + (window.opener.outerHeight/2)) - (window.outerHeight/2);
52        window.moveTo(x,y);
53      }
54    }
55  }
56
57]]></script>
58<vbox style="border: 2px solid #c3d1df">
59        <hbox flex="1">
60                <label id="status" value="(No status)"/>
61        </hbox>
62        <hbox flex="1" id="hbox">
63          <progressmeter id="progressmeter" mode="undetermined" flex="1"/>
64        </hbox>
65</vbox>
66</window>
Note: See TracBrowser for help on using the repository browser.