1 | <?xml version="1.0" encoding="UTF-8" ?> |
---|
2 | <!DOCTYPE overlay [ |
---|
3 | <!ENTITY % markingcollectionDTD SYSTEM "chrome://markingcollection/locale/markingcollection.dtd" > |
---|
4 | %markingcollectionDTD; |
---|
5 | <!ENTITY % metaDTD SYSTEM "chrome://markingcollection/locale/meta.dtd" > |
---|
6 | %metaDTD; |
---|
7 | ]> |
---|
8 | <overlay |
---|
9 | id="pubmedcentralDialogOverlay" |
---|
10 | xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" |
---|
11 | xmlns:html="http://www.w3.org/1999/xhtml"> |
---|
12 | <script type="application/x-javascript" src="chrome://global/content/nsUserSettings.js" /> |
---|
13 | <script type="application/x-javascript"> |
---|
14 | <![CDATA[ |
---|
15 | function _pubmedcentralDialogOverlayInit(aEvent){ |
---|
16 | |
---|
17 | var info = Components.classes["@mozilla.org/xre/app-info;1"].getService(Components.interfaces.nsIXULAppInfo); |
---|
18 | this._app_version = parseInt(info.version); |
---|
19 | if(this._app_version>=3){ |
---|
20 | var confirm = nsPreferences.getBoolPref("wiredmarker.pubmedcentral.capture.confirm", true); |
---|
21 | document.getElementById("mcPubmedCentralConfirm").checked = confirm; |
---|
22 | |
---|
23 | var substitution = nsPreferences.getBoolPref("wiredmarker.pubmedcentral.capture.substitution.confirm", true); |
---|
24 | document.getElementById("mcPubmedCentralSubstitution").checked = substitution; |
---|
25 | |
---|
26 | document.getElementById("mcPubmedCentralSubstitutionText").value = nsPreferences.copyUnicharPref("wiredmarker.pubmedcentral.capture.substitution.format"); |
---|
27 | }else{ |
---|
28 | document.getElementById("mcPubmedCentralConfirm").disabled = true; |
---|
29 | document.getElementById("mcPubmedCentralConfirm").checked = false; |
---|
30 | document.getElementById("mcPubmedCentralSubstitution").checked = false; |
---|
31 | document.getElementById("mcPubmedCentralSubstitutionText").value = ""; |
---|
32 | } |
---|
33 | _pubmedcentralConfirmCommand(); |
---|
34 | } |
---|
35 | function _pubmedcentralDialogOverlayDone(aEvent){ |
---|
36 | |
---|
37 | } |
---|
38 | function _pubmedcentralConfirmCommand(aEvent){ |
---|
39 | var checked = document.getElementById("mcPubmedCentralConfirm").checked; |
---|
40 | nsPreferences.setBoolPref("wiredmarker.pubmedcentral.capture.confirm", checked); |
---|
41 | |
---|
42 | document.getElementById("mcPubmedCentralSubstitution").disabled = !checked; |
---|
43 | _pubmedcentralSubstitutionCommand(); |
---|
44 | } |
---|
45 | |
---|
46 | function _pubmedcentralSubstitutionCommand(aEvent){ |
---|
47 | var checked = document.getElementById("mcPubmedCentralSubstitution").checked; |
---|
48 | var disabled = document.getElementById("mcPubmedCentralSubstitution").disabled; |
---|
49 | nsPreferences.setBoolPref("wiredmarker.pubmedcentral.capture.substitution.confirm", checked); |
---|
50 | |
---|
51 | document.getElementById("mcPubmedCentralSubstitutionTokensPMCIDTextbox").disabled = (!checked || disabled); |
---|
52 | document.getElementById("mcPubmedCentralSubstitutionTokensPMIDTextbox").disabled = (!checked || disabled); |
---|
53 | document.getElementById("mcPubmedCentralSubstitutionTokensSOTextbox").disabled = (!checked || disabled); |
---|
54 | document.getElementById("mcPubmedCentralSubstitutionText").disabled = (!checked || disabled); |
---|
55 | } |
---|
56 | |
---|
57 | function _pubmedcentralSubstitutionTextChange(aEvent){ |
---|
58 | nsPreferences.setUnicharPref("wiredmarker.pubmedcentral.capture.substitution.format", aEvent.target.value); |
---|
59 | } |
---|
60 | |
---|
61 | window.addEventListener("load", _pubmedcentralDialogOverlayInit, false); |
---|
62 | window.addEventListener("unload", _pubmedcentralDialogOverlayDone, false); |
---|
63 | ]]> |
---|
64 | </script> |
---|
65 | <tabbox id="mcSettingTabbox"> |
---|
66 | <tabpanels id="mcSettingTabPanels"> |
---|
67 | <tabbox id="mcMenuTabbox"> |
---|
68 | <tabs id="mcMenuTabs"> |
---|
69 | <tab id="mcPubmedCentralTab" label="&markingcollection.setting.pubmedcentral;" image="chrome://markingcollection/skin/PMC.png"/> |
---|
70 | </tabs> |
---|
71 | <tabpanels id="mcMenuTabPanels"> |
---|
72 | <tabpanel id="mcPubmedCentralTabPanel" orient="vertical" flex="1"> |
---|
73 | <groupbox id="mcPubmedCentralTabGroupBox"> |
---|
74 | <caption label="&meta.dialog.pubmedcentral.pdf.groupbox.caption;" style="background-color:#fff;"/> |
---|
75 | <checkbox id="mcPubmedCentralConfirm" label="&meta.dialog.pubmedcentral.pdf.capture.checkbox.confirm;" oncommand="_pubmedcentralConfirmCommand(event)"/> |
---|
76 | <checkbox id="mcPubmedCentralSubstitution" label="&meta.dialog.pubmedcentral.pdf.substitution.checkbox.confirm;" oncommand="_pubmedcentralSubstitutionCommand(event)"/> |
---|
77 | <hbox> |
---|
78 | <groupbox id="mcPubmedCentralSubstitutionTokensGroupBox" flex="1"> |
---|
79 | <caption label="Tokes of MEDLINE:" style="background-color:#fff;"/> |
---|
80 | <grid> |
---|
81 | <columns> |
---|
82 | <column /> |
---|
83 | <column flex="1"/> |
---|
84 | <column /> |
---|
85 | <column flex="1"/> |
---|
86 | </columns> |
---|
87 | <rows> |
---|
88 | <row align="center"> |
---|
89 | <hbox flex="1" pack="end"> |
---|
90 | <label value="PubMed Central ID:" style="color:#666;" /> |
---|
91 | </hbox> |
---|
92 | <textbox id="mcPubmedCentralSubstitutionTokensPMCIDTextbox" readonly="true" size="7" onfocus="this.select()" value="MEDLINE.PMCID"/> |
---|
93 | <hbox flex="1" pack="end"> |
---|
94 | <label value="PubMed ID:" style="color:#666;" /> |
---|
95 | </hbox> |
---|
96 | <textbox id="mcPubmedCentralSubstitutionTokensPMIDTextbox" readonly="true" size="7" onfocus="this.select()" value="MEDLINE.PMID"/> |
---|
97 | </row> |
---|
98 | <row align="center"> |
---|
99 | </row> |
---|
100 | <row align="center"> |
---|
101 | <label/> |
---|
102 | <label/> |
---|
103 | <hbox flex="1" pack="end"> |
---|
104 | <label value="Source:" style="color:#666;" /> |
---|
105 | </hbox> |
---|
106 | <textbox id="mcPubmedCentralSubstitutionTokensSOTextbox" readonly="true" size="7" onfocus="this.select()" value="MEDLINE.SO"/> |
---|
107 | </row> |
---|
108 | </rows> |
---|
109 | </grid> |
---|
110 | </groupbox> |
---|
111 | </hbox> |
---|
112 | <hbox align="center"> |
---|
113 | <label id="mcPubmedCentralSubstitutionLabel" value="Format :"/> |
---|
114 | <textbox id="mcPubmedCentralSubstitutionText" value="" flex="1" onchange="_pubmedcentralSubstitutionTextChange(event)"/> |
---|
115 | </hbox> |
---|
116 | </groupbox> |
---|
117 | </tabpanel> |
---|
118 | </tabpanels> |
---|
119 | </tabbox> |
---|
120 | </tabpanels> |
---|
121 | </tabbox> |
---|
122 | </overlay> |
---|