Changeset 9b501a
- Timestamp:
- Apr 17, 2008, 4:25:49 PM (14 years ago)
- Branches:
- master
- Children:
- 8f022f
- Parents:
- e97c30
- Location:
- chrome/content/v_identity
- Files:
-
- 2 added
- 1 deleted
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
chrome/content/v_identity/vI_rdfDataEditor.js
re97c30 r9b501a 26 26 __rdfDatasource : null, 27 27 28 extras : new vI_storageExtras(resource, vI_rdfDatasource.__getRDFValue),28 storageExtras : null, 29 29 30 30 init : function() { … … 60 60 vI_smtpSelector.setMenuToKey(window.arguments[0]["smtpKey"]) 61 61 62 vI_rdfDataEditor.extras.setEditorValues(); 62 vI_rdfDataEditor.storageExtras = new vI_storageExtras() 63 vI_rdfDataEditor.storageExtras.setEditorValues(); 64 vI_storageExtrasHelper.hideUnusedEditorFields(); 63 65 }, 64 66 … … 75 77 vI_rdfDataEditor.__rdfDatasource.removeVIdentityFromRDF(window.arguments[0]["resource"]) 76 78 77 vI_rdfDataEditor. extras.readEditorValues();79 vI_rdfDataEditor.storageExtras.readEditorValues(); 78 80 vI_rdfDataEditor.__rdfDatasource.updateRDF( 79 81 document.getElementById("recipient").value, … … 82 84 document.getElementById("identity_list").selectedItem.getAttribute("value"), 83 85 document.getElementById("smtp_server_list").selectedItem.getAttribute("key"), 86 vI_rdfDataEditor.storageExtras 84 87 ) 85 88 }, -
chrome/content/v_identity/vI_rdfDataEditor.xul
re97c30 r9b501a 34 34 35 35 <script type="application/x-javascript" src="chrome://v_identity/content/vI_rdfDataEditor.js" /> 36 <script type="application/x-javascript" src="chrome://v_identity/content/vI_storageExtras.js" /> 36 37 <script type="application/x-javascript" src="chrome://v_identity/content/vI_helper.js" /> 37 38 <script type="application/x-javascript" src="chrome://v_identity/content/vI_smtpSelector.js" /> -
chrome/content/v_identity/vI_rdfDataTree.js
re97c30 r9b501a 48 48 vI_rdfDataTree.__getSMTPnames(); 49 49 vI_rdfDataTree.__getIDnames(); 50 vI_storageExtrasHelper.hideUnusedTreeCols(); 50 51 vI_rdfDataTree.loadTable(); 51 52 }, … … 93 94 idCol : idName, 94 95 idKey : values.id, 95 extras : values.extras,96 96 resource : resource } 97 97 98 values.extras.addPrefs(pref); 98 99 vI_rdfDataTree.__idData.push(pref); 99 100 }, -
chrome/content/v_identity/vI_rdfDataTree.xul
re97c30 r9b501a 42 42 <script type="application/x-javascript" src="chrome://v_identity/content/vI_helper.js" /> 43 43 <script type="application/x-javascript" src="chrome://v_identity/content/vI_rdfDatasource.js" /> 44 <script type="application/x-javascript" src="chrome://v_identity/content/vI_storageExtras.js" /> 44 45 <script type="application/x-javascript" src="chrome://v_identity/content/vI_notificationBar.js"/> 45 46 <script type="application/x-javascript" src="chrome://messenger/content/messengercompose/MsgComposeCommands.js"/> … … 103 104 persist="sortDirection sortResource" sortDirection="ascending" sortResource="recipientCol" 104 105 enableColumnDrag="true" context="configContext"> 105 <treecols >106 <treecols id="rdfDataTreeCols"> 106 107 <treecol id="recipientCol" label="&vI_rdfDataTree.recipientColumn.label;" flex="10" 107 108 class="sortDirectionIndicator" -
chrome/content/v_identity/vI_storageExtras.js
re97c30 r9b501a 22 22 * ***** END LICENSE BLOCK ***** */ 23 23 24 //~ vI_storageExtras = new __vI_storageExtras(); 24 vI_storageExtrasHelper = { 25 preferences : Components.classes["@mozilla.org/preferences-service;1"] 26 .getService(Components.interfaces.nsIPrefService) 27 .getBranch("extensions.virtualIdentity."), 28 29 hideUnusedTreeCols : function() { 30 var storageExtras = new vI_storageExtras(); 31 for( var i = 0; i < storageExtras.extras.length; i++ ) 32 if (!vI_storageExtrasHelper.preferences.getBoolPref(storageExtras.extras[i].option)) 33 document.getElementById(storageExtras.extras[i].field + "Col").setAttribute("hidden", "true"); 34 }, 35 36 hideUnusedEditorFields : function() { 37 var storageExtras = new vI_storageExtras(); 38 var hide = (document.getElementById("vI_storageExtras_hideUnusedEditorFields").getAttribute("checked") == "true") 39 for( var i = 0; i < storageExtras.extras.length; i++ ) 40 document.getElementById("vI_" + storageExtras.extras[i].option).setAttribute("hidden", 41 hide && !vI_storageExtrasHelper.preferences.getBoolPref(storageExtras.extras[i].option)) 42 } 43 } 25 44 26 45 function vI_storageExtras(callFunction, resource) { 27 this.extras = [ new vI_storageExtras_returnReciept, new vI_storageExtras_characterEncoding ] 46 this.extras = [ 47 new vI_storageExtras_checkbox( 48 "reciept", "storageExtras_returnReciept", "returnReceiptMenu", null, null), 49 new vI_storageExtras_characterEncoding(), 50 new vI_storageExtras_msgFormat(), 51 new vI_storageExtras_sMime_messageEncryption(), 52 new vI_storageExtras_checkbox( 53 "sMimeSig", "storageExtras_sMime_messageSignature", "menu_securitySign1", 54 (typeof(setSecuritySettings)=="function")?setSecuritySettings:null, 1), 55 new vI_storageExtras_checkbox( 56 "PGPEnc", "storageExtras_openPGP_messageEncryption", "enigmail_encrypted_send", 57 (typeof(enigSetMenuSettings)=="function")?enigSetMenuSettings:null, ''), 58 new vI_storageExtras_checkbox( 59 "PGPSig", "storageExtras_openPGP_messageSignature", "enigmail_signed_send", 60 (typeof(enigSetMenuSettings)=="function")?enigSetMenuSettings:null, ''), 61 new vI_storageExtras_checkbox( 62 "PGPMIME", "storageExtras_openPGP_PGPMIME", "enigmail_sendPGPMime", 63 (typeof(enigSetMenuSettings)=="function")?enigSetMenuSettings:null, '')] 28 64 if (callFunction) this.loopForRDF(callFunction, resource) 29 65 } … … 56 92 }, 57 93 setEditorValues : function() { 58 for( var i = 0; i < this.extras.length; i++ ) 94 for( var i = 0; i < this.extras.length; i++ ) { 95 this.extras[i].value = window.arguments[0][this.extras[i].field + "Col"] 59 96 this.extras[i].setEditorValue(); 97 } 60 98 }, 61 99 readEditorValues : function() { … … 63 101 this.extras[i].readEditorValue(); 64 102 }, 65 } 66 67 function vI_storageExtras_returnReciept() { } 68 vI_storageExtras_returnReciept.prototype = { 69 value : null, 70 field : "reciept", 71 option : "storageExtras_returnReciept", 72 // function to set or read the value from/to the MessageCompose Dialog 73 setValue : function() { 74 document.getElementById("returnReceiptMenu").setAttribute("checked", this.value) 75 }, 76 readValue : function() { 77 this.value = document.getElementById("returnReceiptMenu").getAttribute("checked"); 78 }, 79 // function to set or read the value from the rdfDataEditor 80 setEditorValue : function() { 81 alert("setEditorValue"); 82 }, 83 readEditorValue : function() { 84 alert("readEditorValue"); 85 } 86 } 87 103 addPrefs : function(pref) { 104 for( var i = 0; i < this.extras.length; i++ ) 105 pref[this.extras[i].field + "Col"] = this.extras[i].value; 106 }, 107 } 108 109 function vI_storageExtras_characterEncoding_setMenuMark() { 110 var maileditCharsetMenu = document.getElementById("maileditCharsetMenu") 111 var value = maileditCharsetMenu.getAttribute("unmarkedValue") 112 if (value) { 113 var menuitem = document.getElementById(value); 114 if (menuitem) menuitem.setAttribute('checked', 'true'); 115 maileditCharsetMenu.removeAttribute("unmarkedValue") 116 } 117 } 88 118 function vI_storageExtras_characterEncoding() { } 89 119 vI_storageExtras_characterEncoding.prototype = { … … 91 121 field : "charEnc", 92 122 option : "storageExtras_characterEncoding", 93 // function to set the value in the MessageCompose Dialog 94 setValue : function() { 95 alert("setValue") 96 }, 97 // function to store the selection of MessageCompose Dialog into value 98 readValue : function() { 99 alert("readValue Charset (not implemented)") 100 }, 123 // function to set or read the value from/to the MessageCompose Dialog 124 setValue : function() { 125 if (!this.value) return; 126 127 var menuitem = document.getElementById(this.value); 128 if (menuitem) menuitem.setAttribute('checked', 'true'); 129 else { // set menumark later if menu is not ready yet 130 var maileditCharsetMenu = document.getElementById("maileditCharsetMenu") 131 maileditCharsetMenu.setAttribute("unmarkedValue", this.value) 132 var onpopupshowing = maileditCharsetMenu.getAttribute("onpopupshowing") 133 document.getElementById("maileditCharsetMenu").setAttribute("onpopupshowing", 134 onpopupshowing + ";vI_storageExtras_characterEncoding_setMenuMark();") 135 } 136 gMsgCompose.compFields.characterSet = this.value; 137 SetDocumentCharacterSet(this.value); 138 vI_notificationBar.dump("## vI_storageExtras_characterEncoding setValue " + this.value + "\n"); 139 }, 140 readValue : function() { 141 this.value = gMsgCompose.compFields.characterSet; 142 if (gCharsetConvertManager) { 143 var charsetAlias = gCharsetConvertManager.getCharsetAlias(this.value); 144 if (charsetAlias == "us-ascii") this.value = "ISO-8859-1"; // no menu item for "us-ascii" 145 } 146 vI_notificationBar.dump("## vI_storageExtras_characterEncoding readValue " + this.value + "\n"); 147 }, 148 // function to set or read the value from the rdfDataEditor 101 149 setEditorValue : function() { 102 alert("setEditorValue"); 103 }, 104 readEditorValue : function() { 105 alert("readEditorValue"); 106 } 107 } 150 CreateMenu('mailedit'); 151 document.getElementById("maileditCharsetMenu").selectedItem = document.getElementById(this.value); 152 vI_notificationBar.dump("## vI_storageExtras_characterEncoding setEditorValue " + this.value + "\n"); 153 }, 154 readEditorValue : function() { 155 this.value = document.getElementById("maileditCharsetMenu").selectedItem.id 156 vI_notificationBar.dump("## vI_storageExtras_characterEncoding readEditorValue " + this.value + "\n"); 157 } 158 } 159 160 function vI_storageExtras_msgFormat() { } 161 vI_storageExtras_msgFormat.prototype = { 162 value : null, 163 field : "msgFormat", 164 option : "storageExtras_messageFormat", 165 // function to set or read the value from/to the MessageCompose Dialog 166 setValue : function() { 167 if (!this.value) return; 168 vI_notificationBar.dump("## vI_storageExtras_msgFormat setValue " + this.value + "\n"); 169 document.getElementById(this.value).setAttribute("checked","true"); 170 OutputFormatMenuSelect(document.getElementById(this.value)) 171 }, 172 readValue : function() { 173 switch (gSendFormat) { 174 case nsIMsgCompSendFormat.AskUser: this.value = "format_auto"; break; 175 case nsIMsgCompSendFormat.PlainText: this.value = "format_plain"; break; 176 case nsIMsgCompSendFormat.HTML: this.value = "format_html"; break; 177 case nsIMsgCompSendFormat.Both: this.value = "format_both"; break; 178 } 179 vI_notificationBar.dump("## vI_storageExtras_msgFormat readValue " + this.value + "\n"); 180 }, 181 // function to set or read the value from the rdfDataEditor 182 setEditorValue : function() { 183 //~ document.getElementById(this.value).setAttribute("checked","true"); 184 document.getElementById("outputFormatMenu").selectedItem = document.getElementById(this.value); 185 vI_notificationBar.dump("## vI_storageExtras_characterEncoding setEditorValue " + this.value + "\n"); 186 }, 187 readEditorValue : function() { 188 this.value = document.getElementById("outputFormatMenu").selectedItem.id 189 vI_notificationBar.dump("## vI_storageExtras_characterEncoding readEditorValue " + this.value + "\n"); 190 } 191 } 192 193 function vI_storageExtras_sMime_messageEncryption() { } 194 vI_storageExtras_sMime_messageEncryption.prototype = { 195 value : null, 196 field : "sMimeEnc", 197 option : "storageExtras_sMime_messageEncryption", 198 // function to set or read the value from/to the MessageCompose Dialog 199 setValue : function() { 200 vI_notificationBar.dump("## vI_storageExtras_sMime_messageEncryption setValue " + this.value + "\n"); 201 if (this.value == "true") var element = document.getElementById("menu_securityEncryptRequire1") 202 else var element = document.getElementById("menu_securityNoEncryption1") 203 element.setAttribute("checked", "true"); 204 element.doCommand(); 205 }, 206 readValue : function() { 207 setSecuritySettings(1) 208 this.value = (document.getElementById("menu_securityEncryptRequire1").getAttribute("checked") == "true")?"true":"false" 209 vI_notificationBar.dump("## vI_storageExtras_sMime_messageEncryption readValue " + this.value + "\n"); 210 }, 211 // function to set or read the value from the rdfDataEditor 212 setEditorValue : function() { 213 document.getElementById("vI_" + this.option).setAttribute("checked", this.value) }, 214 readEditorValue : function() { 215 var elementValue = document.getElementById("vI_" + this.option).getAttribute("checked"); 216 this.value = (elementValue == "true")?"true":"false" 217 } 218 } 219 220 function vI_storageExtras_checkbox(field, option, composeDialogElementID, updateFunction, updateFunctionParam1) { 221 this.field = field; 222 this.option = option; 223 this.composeDialogElementID = composeDialogElementID; 224 this.updateFunction = updateFunction; 225 this.updateFunctionParam1 = updateFunctionParam1; 226 } 227 vI_storageExtras_checkbox.prototype = { 228 value : null, 229 field : null, 230 option : null, 231 composeDialogElementID : null, 232 updateFunction : null, // some elements have to be updated before the can be read 233 updateFunctionParam1 : null, 234 235 // function to set or read the value from/to the MessageCompose Dialog 236 setValue : function() { 237 if (!this.value) return; 238 var element = document.getElementById(this.composeDialogElementID); 239 var elementValue = element.getAttribute("checked"); 240 if ((elementValue == "true") != (this.value == "true")) { 241 vI_notificationBar.dump("## vI_storageExtras_checkbox setValue " + this.composeDialogElementID + "=" + 242 this.value + " (was: " + elementValue + ").\n"); 243 if (this.value == "true") element.setAttribute("checked","true"); 244 else element.removeAttribute("checked"); 245 element.doCommand(); 246 } 247 }, 248 readValue : function() { 249 if (this.updateFunction) this.updateFunction(this.updateFunctionParam1); 250 var elementValue = document.getElementById(this.composeDialogElementID).getAttribute("checked"); 251 this.value = ((elementValue=="true")?"true":"false") 252 vI_notificationBar.dump("## vI_storageExtras_checkbox readValue " + this.composeDialogElementID + "=" + 253 this.value + "\n"); 254 255 }, 256 // function to set or read the value from the rdfDataEditor 257 setEditorValue : function() { 258 document.getElementById("vI_" + this.option).setAttribute("checked", this.value) }, 259 readEditorValue : function() { 260 var elementValue = document.getElementById("vI_" + this.option).getAttribute("checked"); 261 this.value = (elementValue == "true")?"true":"false" 262 } 263 } -
chrome/content/v_identity/vI_upgrade.xul
re97c30 r9b501a 45 45 <script type="application/x-javascript" src="chrome://v_identity/content/vI_notificationBar.js"/> 46 46 <script type="application/x-javascript" src="chrome://v_identity/content/vI_rdfDatasource.js" /> 47 <script type="application/x-javascript" src="chrome://v_identity/content/vI_storageExtras.js" /> 47 48 <script type="application/x-javascript" src="chrome://v_identity/content/vI_htmlTextBox.js" /> 48 49 -
chrome/content/v_identity/vI_upgradeOverlay.xul
re97c30 r9b501a 36 36 <script type="application/x-javascript" src="chrome://v_identity/content/vI_account.js" /> 37 37 <script type="application/x-javascript" src="chrome://v_identity/content/vI_rdfDatasource.js" /> 38 <script type="application/x-javascript" src="chrome://v_identity/content/vI_storageExtras.js" /> 38 39 <!-- following element just stores the Ext-Version, seamonkey has no extensionmanager --> 39 40 <vbox id="messagepanebox" >
Note: See TracChangeset
for help on using the changeset viewer.