source: DASISH/t5.6/client/chrome/markingcollection/content/markingcollection/templatefolderproperty.js @ 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.5 KB
Line 
1var mcPropService = {
2
3        get STRING()     { return document.getElementById("mcPropString"); },
4
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        item     : null,
12
13        init : function(){
14                try {
15                        this.item = window.arguments[0];
16                }catch(ex){
17                }
18                if(!this.item) return;
19                if(this.item.title){
20                        document.title = this.item.title;
21                        document.getElementById("mcPropTitle").value = this.item.title;
22                }
23                if(this.item.note) document.getElementById("mcPropNote").value = this.item.note;
24                try{document.getElementById("mcPropTitle").editor.transactionManager.clear();}catch(ex2){}
25                try{document.getElementById("mcPropNote").editor.transactionManager.clear();}catch(ex2){}
26                return;
27        },
28
29        accept : function(){
30                var newVals = {
31                        title : document.getElementById("mcPropTitle").value,
32                        note  : this.Common.escapeComment(document.getElementById("mcPropNote").value),
33                };
34                var props;
35                for(props in newVals){
36                        if(this.item[props] == newVals[props]) continue;
37                        window.arguments[0][props] = newVals[props];
38                        window.arguments[0].accept = true;
39                }
40        },
41
42        cancel : function(){
43                if(window.arguments[0]) window.arguments[0].accept = false;
44        },
45};
46
47function _dump(aString){
48        if(nsPreferences.getBoolPref("wiredmarker.debug", false)) window.dump(aString+"\n");
49}
50
Note: See TracBrowser for help on using the repository browser.