source: DASISH/t5.6/client/branches/webannotator-basic-current-xsd/chrome/markingcollection/content/markingcollection/tagoutputDialog.js @ 5703

Last change on this file since 5703 was 5703, checked in by stephanie.roth@snd.gu.se, 10 years ago

Initial commit of current status quo from GitHub. TODO: Adjust client code to work with updated xsd file.

  • Property svn:executable set to *
File size: 3.8 KB
Line 
1var tagoutputDialog = {
2
3/////////////////////////////////////////////////////////////////////
4        get STRING()     { return document.getElementById("tagoutputDialogString"); },
5        get DataSource() { return window.opener.top.bitsObjectMng.DataSource; },
6        get Common()     { return window.opener.top.bitsObjectMng.Common;     },
7        get XPath()      { return window.opener.top.bitsObjectMng.XPath;      },
8        get Database()   { return window.opener.top.bitsObjectMng.Database;   },
9        get gBrowser()   { return window.opener.top.bitsObjectMng.getBrowser();},
10
11        get DIALOG() { return document.getElementById("tagoutputDialog"); },
12        get STYLE_NO()   { return document.getElementById("no_style"); },
13        get STYLE_WITH() { return document.getElementById("with_style"); },
14        get VISIBILITY_VISIBLE() { return document.getElementById("visible"); },
15        get VISIBILITY_HIDDEN()  { return document.getElementById("hidden"); },
16        get FORMAT() { return document.getElementById("format"); },
17        get PATH() { return document.getElementById("path"); },
18
19/////////////////////////////////////////////////////////////////////
20        init : function(){
21                if(tagoutputDialog._init) return;
22
23                try {
24                        this.info = window.arguments[0];
25                }catch(ex){
26                }
27
28                if(this.info.hidden){
29                        this.VISIBILITY_HIDDEN.setAttribute("selected","true");
30                        this.VISIBILITY_VISIBLE.removeAttribute("selected");
31                }else{
32                        this.VISIBILITY_VISIBLE.setAttribute("selected","true");
33                        this.VISIBILITY_HIDDEN.removeAttribute("selected");
34                }
35
36                if(this.info.style){
37                        this.STYLE_WITH.setAttribute("selected","true");
38                        this.STYLE_NO.removeAttribute("selected");
39                }else{
40                        this.STYLE_NO.setAttribute("selected","true");
41                        this.STYLE_WITH.removeAttribute("selected");
42                }
43
44                this.setFormatString();
45
46                this.PATH.checked = this.info.rpath;
47
48                try{
49                        this._init = true;
50                }catch(ex){
51                        this.Common.alert("tagoutputDialog.init():"+ex);
52                }
53        },
54
55/////////////////////////////////////////////////////////////////////
56        done : function(event){
57                if(this._init){
58                        this._init = false;
59                }
60        },
61
62/////////////////////////////////////////////////////////////////////
63        setFormatString : function(){
64                if(this.STYLE_WITH.selected || this.VISIBILITY_HIDDEN.selected){
65                        this.FORMAT.setAttribute("value",this.STRING.getString("MSG_FILE_FORMAT_HTML"));
66                }else{
67                        this.FORMAT.setAttribute("value",this.STRING.getString("MSG_FILE_FORMAT_ORIGINAL"));
68                }
69        },
70
71/////////////////////////////////////////////////////////////////////
72        style : function(aEvent){
73                if(aEvent.target.value == 'with'){
74                        this.STYLE_WITH.setAttribute("selected","true");
75                        this.STYLE_NO.removeAttribute("selected");
76                        this.info.style = true;
77                }else{
78                        this.STYLE_NO.setAttribute("selected","true");
79                        this.STYLE_WITH.removeAttribute("selected");
80                        this.info.style = false;
81                }
82                this.setFormatString();
83        },
84
85/////////////////////////////////////////////////////////////////////
86        visibility : function(aEvent){
87                if(aEvent.target.value == 'hidden'){
88                        this.VISIBILITY_HIDDEN.setAttribute("selected","true");
89                        this.VISIBILITY_VISIBLE.removeAttribute("selected");
90                        this.info.hidden = true;
91                }else{
92                        this.VISIBILITY_VISIBLE.setAttribute("selected","true");
93                        this.VISIBILITY_HIDDEN.removeAttribute("selected");
94                        this.info.hidden = false;
95                }
96                this.setFormatString();
97        },
98
99/////////////////////////////////////////////////////////////////////
100        path : function(aEvent){
101                this.info.rpath = aEvent.target.checked;
102        },
103
104/////////////////////////////////////////////////////////////////////
105        accept : function(aEvent){
106                window.arguments[0].accept = true;
107                return true;
108        },
109
110/////////////////////////////////////////////////////////////////////
111        cancel : function(aEvent){
112                window.arguments[0].accept = false;
113                return true;
114        },
115
116/////////////////////////////////////////////////////////////////////
117        _dump : function(aString){
118                if(nsPreferences.getBoolPref("wiredmarker.debug", false)) window.dump(aString+"\n");
119        },
120};
Note: See TracBrowser for help on using the repository browser.