source: DASISH/t5.6/client/branches/webannotator-basic-current-xsd/chrome/markingcollection/content/markingcollection/confirmDialog.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.1 KB
Line 
1var spmConfirmDialog = {
2
3/////////////////////////////////////////////////////////////////////
4        get STRING()     { return document.getElementById("spmConfirmDialogString"); },
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 S_TITLE()    { return document.getElementById("spmSrcTitle"); },
12        get S_NODE()     { return document.getElementById("spmSrcNote"); },
13        get D_TITLE()    { return document.getElementById("spmDstTitle"); },
14        get D_NODE()     { return document.getElementById("spmDstNote"); },
15        get SAMEPROCESS(){ return document.getElementById("spmConfirmSameProcessing"); },
16
17/////////////////////////////////////////////////////////////////////
18        init : function(){
19                if(spmConfirmDialog._init) return;
20
21                try {
22                        this.info = window.arguments[0];
23                }catch(ex){
24                }
25
26                this.S_TITLE.value = this.info.src.title;
27                this.S_NODE.value  = this.info.src.note;
28                this.D_TITLE.value = this.info.dst.title;
29                this.D_NODE.value  = this.info.dst.note;
30
31                try{
32                        this._init = true;
33                }catch(ex){
34                        this.Common.alert("spmConfirmDialog.init():"+ex);
35                }
36        },
37
38/////////////////////////////////////////////////////////////////////
39        done : function(event){
40                if(this._init){
41                        this._init = false;
42                }
43        },
44
45/////////////////////////////////////////////////////////////////////
46        commandCondition : function(aEvent){
47                this.prefs.conditionMerge = this.ConditionMarker.value;
48        },
49
50/////////////////////////////////////////////////////////////////////
51        commandConfirm : function(aEvent){
52                this.prefs.confirmMerge = this.ConfirmMerge.checked;
53        },
54
55/////////////////////////////////////////////////////////////////////
56        getSameProcessing : function(){
57                return (this.SAMEPROCESS.getAttribute("checked")=="true"?true:false);
58        },
59
60/////////////////////////////////////////////////////////////////////
61        merge : function(aEvent){
62                window.arguments[1].accept = 1;
63                window.arguments[1].sameprocessing = spmConfirmDialog.getSameProcessing();
64        },
65
66/////////////////////////////////////////////////////////////////////
67        overwrite : function(aEvent){
68                window.arguments[1].accept = 2;
69                window.arguments[1].sameprocessing = spmConfirmDialog.getSameProcessing();
70                window.close();
71        },
72
73/////////////////////////////////////////////////////////////////////
74        destruction : function(aEvent){
75                window.arguments[1].accept = 3;
76                window.arguments[1].sameprocessing = spmConfirmDialog.getSameProcessing();
77                window.close();
78        },
79
80/////////////////////////////////////////////////////////////////////
81        cancel : function(aEvent){
82                window.arguments[1].accept = 0;
83                window.arguments[1].sameprocessing = spmConfirmDialog.getSameProcessing();
84        },
85
86/////////////////////////////////////////////////////////////////////
87        _dump : function(aString){
88                if(nsPreferences.getBoolPref("wiredmarker.debug", false)) window.dump(aString+"\n");
89        },
90};
Note: See TracBrowser for help on using the repository browser.