Changeset 039e6e


Ignore:
Timestamp:
Jul 17, 2009, 9:52:25 PM (12 years ago)
Author:
rene <rene@…>
Branches:
lite_0.1, multiEdit, ng_0.6, ng_0.6_help, ng_0.8, ng_0.9
Children:
193c97
Parents:
e7fe3d
Message:

reorganized prefDialog

Location:
chrome
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • chrome/content/v_identity/vI_prefDialog.js

    re7fe3d r039e6e  
    108108            }
    109109        },
    110        
     110
    111111        savePrefs : function() {
    112112            for( var i = 0; i < vI_prefDialog.base._elementIDs.length; i++ ) {
     
    132132        },
    133133       
    134         idSelectionConstraint : function() {
     134        modifyAttribute : function(elemID, attribute, value) {
     135            if (value) document.getElementById(elemID).removeAttribute(attribute);
     136            else document.getElementById(elemID).setAttribute(attribute, "true");
     137        },
     138
     139        constraints : function() {
    135140            var storage = document.getElementById("VIdent_identity.storage").checked;
    136141            var smartDraft = document.getElementById("VIdent_identity.smart_draft").checked;
    137142            var smartReply = document.getElementById("VIdent_identity.smart_reply").checked;
    138             vI_prefDialog.base.idSelectionConstraint1(storage && smartReply);
    139             vI_prefDialog.base.idSelectionConstraint2(storage || smartReply || smartDraft);
    140             if (storage || smartReply || smartDraft) vI_prefDialog.base.idSelectionResultConstraint()
    141         },
    142 
    143         idSelectionConstraint1 : function(checked) {
    144             var elementIDs = [
    145                 "VIdent_identity.idSelection_storage_prefer_smart_reply",
    146                 "VIdent_identity.idSelection_storage_ignore_smart_reply"];
    147             for( var i = 0; i < elementIDs.length; i++ ) {
    148                 if (checked) document.getElementById(elementIDs[i]).removeAttribute("disabled");
    149                 else document.getElementById(elementIDs[i]).setAttribute("disabled", "true");
    150             }
    151         },
    152 
    153         idSelectionConstraint2 : function(checked) {
    154             var elementIDs = [
    155                 "VIdent_identity.idSelection_ask",
    156                 "VIdent_identity.idSelection_ask_always",
    157                 "VIdent_identity.idSelection_autocreate",
    158                 "VIdent_identity.idSelection_autocreate.desc",];
    159             for( var i = 0; i < elementIDs.length; i++ ) {
    160                 if (checked) document.getElementById(elementIDs[i]).removeAttribute("disabled");
    161                 else document.getElementById(elementIDs[i]).setAttribute("disabled", "true");
    162             }
    163         },
    164 
    165         smartReplyConstraint : function(element) {
    166             var elementIDs = [
    167                 "VIdent_identity.smart_reply_for_newsgroups",
    168                 "VIdent_identity.smart_reply_headers",
    169                 "VIdent_identity.smart_reply_filter",
    170                 "VIdent_identity.smart_reply_defaultFullName",
    171                 "VIdent_identity.smart_reply_ignoreFullName",
    172                 "VIdent_identity.smart_reply_headers_reset",
    173                 "VIdent_identity.smart_detectByReceivedHeader"];
    174             for( var i = 0; i < elementIDs.length; i++ ) {
    175                 if (element.checked) document.getElementById(elementIDs[i]).removeAttribute("disabled");
    176                 else document.getElementById(elementIDs[i]).setAttribute("disabled", "true");
    177             }
    178             vI_prefDialog.base.idSelectionConstraint();
    179         },
    180        
     143            var mAttr = vI_prefDialog.base.modifyAttribute;
     144
     145            // idSelectionConstraint
     146            var idSelectionConstraint = (storage || smartReply || smartDraft);
     147            mAttr("VIdent_identity.idSelection_ask","disabled",idSelectionConstraint);
     148            mAttr("VIdent_identity.idSelection_ask_always","disabled",idSelectionConstraint);
     149            mAttr("VIdent_identity.idSelection_autocreate","disabled",idSelectionConstraint);
     150            mAttr("VIdent_identity.idSelection_autocreate.desc","disabled",idSelectionConstraint);
     151            mAttr("selection","featureDisabled",idSelectionConstraint);
     152            mAttr("toCompose","featureDisabled",idSelectionConstraint);
     153
     154            // idSelectionInputConstraint
     155            var idSelectionInputConstraint = (storage && smartReply);
     156            mAttr("VIdent_identity.idSelection_storage_prefer_smart_reply","disabled",idSelectionInputConstraint);
     157            mAttr("VIdent_identity.idSelection_storage_ignore_smart_reply","disabled",idSelectionInputConstraint);
     158            if (idSelectionInputConstraint) vI_prefDialog.base.idSelectionResultConstraint();
     159
     160            // sourceEmailConstraint
     161            var sourceEmailConstraint = (smartReply || smartDraft);
     162            mAttr("sourceEmail","featureDisabled",sourceEmailConstraint);
     163            mAttr("toSelection","featureDisabled",sourceEmailConstraint);
     164
     165        },
     166
    181167        idSelectionResultConstraint : function() {
    182168            var ask = document.getElementById("VIdent_identity.idSelection_ask")
     
    188174            autocreate_desc.setAttribute("disabled", (ask.checked && ask_always.checked))
    189175            autocreate_desc.setAttribute("hidden", !ask.checked)
     176        },
     177
     178        smartReplyConstraint : function(element) {
     179            var mAttr = vI_prefDialog.base.modifyAttribute;
     180            mAttr("VIdent_identity.smart_reply_for_newsgroups","disabled",element.checked);
     181            mAttr("VIdent_identity.smart_reply_headers","disabled",element.checked);
     182            mAttr("VIdent_identity.smart_reply_filter","disabled",element.checked);
     183            mAttr("VIdent_identity.smart_reply_defaultFullName","disabled",element.checked);
     184            mAttr("VIdent_identity.smart_reply_ignoreFullName","disabled",element.checked);
     185            mAttr("VIdent_identity.smart_reply_headers_reset","disabled",element.checked);
     186            mAttr("VIdent_identity.smart_detectByReceivedHeader","disabled",element.checked);
     187            vI_prefDialog.base.constraints();
    190188        },
    191189       
     
    222220       
    223221        storageConstraint : function(element) {
    224             var elementIDs = [
    225                 "VIdent_identity.storage_storedefault",
    226                 "VIdent_identity.storage_store_base_id",
    227                 "VIdent_identity.storage_dont_update_multiple",
    228                 "VIdent_identity.storage_show_switch",
    229                 "VIdent_identity.storage_warn_update",
    230                 "VIdent_identity.storage_warn_vI_replace",
    231                 "VIdent_identity.storage_notification",
    232                 "VIdent_identity.storage_getOneOnly",
    233                 "VIdent_identity.storageExtras_returnReciept",
    234                 "VIdent_identity.storageExtras_characterEncoding",
    235                 "VIdent_identity.storageExtras_messageFormat",
    236                 "VIdent_identity.storageExtras_sMime_messageEncryption",
    237                 "VIdent_identity.storageExtras_sMime_messageSignature",
    238                 "VIdent_identity.storageExtras_openPGP_messageEncryption",
    239                 "VIdent_identity.storageExtras_openPGP_messageSignature",
    240                 "VIdent_identity.storageExtras_openPGP_PGPMIME"];
    241             for( var i = 0; i < elementIDs.length; i++ ) {
    242                 if (element.checked) document.getElementById(elementIDs[i]).removeAttribute("disabled");
    243                 else document.getElementById(elementIDs[i]).setAttribute("disabled", "true");
    244             }
    245             var imageIDs = ["storageOut", "storageUp", "storageUpDown"];
    246             for( var i = 0; i < imageIDs.length; i++ ) {
    247                 if (element.checked) document.getElementById(imageIDs[i]).removeAttribute("feature");
    248                 else document.getElementById(imageIDs[i]).setAttribute("feature", "off");
    249             }
    250             vI_prefDialog.base.idSelectionConstraint();
     222            var mAttr = vI_prefDialog.base.modifyAttribute;
     223            mAttr("VIdent_identity.storage_storedefault","disabled",element.checked);
     224            mAttr("VIdent_identity.storage_store_base_id","disabled",element.checked);
     225            mAttr("VIdent_identity.storage_dont_update_multiple","disabled",element.checked);
     226            mAttr("VIdent_identity.storage_show_switch","disabled",element.checked);
     227            mAttr("VIdent_identity.storage_warn_update","disabled",element.checked);
     228            mAttr("VIdent_identity.storage_warn_vI_replace","disabled",element.checked);
     229            mAttr("VIdent_identity.storage_notification","disabled",element.checked);
     230            mAttr("VIdent_identity.storage_getOneOnly","disabled",element.checked);
     231            mAttr("VIdent_identity.storageExtras_returnReciept","disabled",element.checked);
     232            mAttr("VIdent_identity.storageExtras_characterEncoding","disabled",element.checked);
     233            mAttr("VIdent_identity.storageExtras_messageFormat","disabled",element.checked);
     234            mAttr("VIdent_identity.storageExtras_sMime_messageEncryption","disabled",element.checked);
     235            mAttr("VIdent_identity.storageExtras_sMime_messageSignature","disabled",element.checked);
     236            mAttr("VIdent_identity.storageExtras_openPGP_messageEncryption","disabled",element.checked);
     237            mAttr("VIdent_identity.storageExtras_openPGP_messageSignature","disabled",element.checked);
     238            mAttr("VIdent_identity.storageExtras_openPGP_PGPMIME","disabled",element.checked);
     239            mAttr("storageOut","featureDisabled",element.checked);
     240            mAttr("storageUp","featureDisabled",element.checked);
     241            mAttr("storageUpDown","featureDisabled",element.checked);
     242            vI_prefDialog.base.constraints();
    251243        }
    252244    },
     
    276268        vI_prefDialog.base.smartReplyHideSignature();
    277269        vI_prefDialog.base.storageConstraint(document.getElementById("VIdent_identity.storage"));
    278         vI_prefDialog.base.idSelectionConstraint();
     270        vI_prefDialog.base.constraints();
    279271        if (vI_storageExtrasHelper.seamonkey_to_old())
    280272            document.getElementById("storageTab2").setAttribute("hidden", "true")
  • chrome/content/v_identity/vI_prefDialog.xul

    re7fe3d r039e6e  
    8989                oncommand="document.getElementById('prefTabbox').selectedIndex = 1;"
    9090                tooltiptext="&vI_prefDialog.tabbox.tab1.label;" />
    91             <vbox><spacer flex="1"/><image class="arrow" id="toSelection" /><spacer flex="1"/></vbox>
     91            <vbox><spacer flex="1"/><image class="arrow" id="toCompose" /><spacer flex="1"/></vbox>
    9292            <radio pane="source" id="composeDialog"
    9393                oncommand="document.getElementById('prefTabbox').selectedIndex = 2;"
    9494                tooltiptext="&vI_prefDialog.tabbox.tab2.label;" />
    95             <vbox><spacer flex="1"/><image class="arrow" id="toSelection" /><spacer flex="1"/></vbox>
     95            <vbox><spacer flex="1"/><image class="arrow" id="toSend" /><spacer flex="1"/></vbox>
    9696            <radio pane="source" id="emailOut"
    9797                oncommand="document.getElementById('prefTabbox').selectedIndex = 3;"
     
    162162                <checkbox id="VIdent_identity.smart_draft" label="&vI_prefDialog.smartDraft.label;"
    163163                    tooltiptext="&vI_prefDialog.smartDraft.tooltiptext;" prefstring="smart_draft"
    164                     oncommand="vI_prefDialog.base.idSelectionConstraint();" />
     164                    oncommand="vI_prefDialog.base.constraints();" />
    165165                </groupbox>
    166166                <groupbox>
     
    221221                    <hbox>
    222222                    <description class="widthX">&vI_prefDialog.smartReply.defaultFullname.label;</description>
    223                     <vbox><spacer flex="1"/><textbox id="VIdent_identity.smart_reply_defaultFullName" flex="1"
     223                    <vbox><spacer flex="1"/><textbox id="VIdent_identity.smart_reply_defaultFullName"
    224224                        prefstring="smart_reply_defaultFullName" size="20" /><spacer flex="1"/></vbox>
    225225                    </hbox>
  • chrome/skin/classic/v_identity/v_identity.css

    re7fe3d r039e6e  
    4949
    5050radio#sourceEmail           { -moz-image-region: rect(0px, 338px, 52px, 280px) }
    51 radio#sourceEmail[feature="off"]    { -moz-image-region: rect(104px, 338px, 156px, 280px) }
     51radio#sourceEmail[featureDisabled="true"]   { -moz-image-region: rect(104px, 338px, 156px, 280px) }
    5252radio#sourceEmail:hover         { -moz-image-region: rect(52px, 338px, 104px, 280px) }
    5353radio#selection         { -moz-image-region: rect(0px, 168px, 52px, 112px) }
    54 radio#selection[feature="off"]  { -moz-image-region: rect(104px, 168px, 156px, 112px) }
     54radio#selection[featureDisabled="true"]     { -moz-image-region: rect(104px, 168px, 156px, 112px) }
    5555radio#selection:hover       { -moz-image-region: rect(52px, 168px, 104px, 112px) }
    5656radio#composeDialog             { -moz-image-region: rect(0px, 112px, 52px, 56px) }
    57 radio#composeDialog[feature="off"]  { -moz-image-region: rect(104px, 112px, 156px, 56px) }
     57radio#composeDialog[featureDisabled="true"]     { -moz-image-region: rect(104px, 112px, 156px, 56px) }
    5858radio#composeDialog:hover       { -moz-image-region: rect(52px, 112px, 104px, 56px) }
    5959radio#emailOut          { -moz-image-region: rect(0px, 56px, 52px, 0px) }
    60 radio#emailOut[feature="off"]   { -moz-image-region: rect(104px, 56px, 156px, 0px) }
     60radio#emailOut[featureDisabled="true"]  { -moz-image-region: rect(104px, 56px, 156px, 0px) }
    6161radio#emailOut:hover        { -moz-image-region: rect(52px, 56px, 104px, 0px) }
    6262radio#storageOut            { -moz-image-region: rect(0px, 280px, 52px, 224px) }
    63 radio#storageOut[feature="off"]     { -moz-image-region: rect(104px, 280px, 156px, 224px) }
     63radio#storageOut[featureDisabled="true"]    { -moz-image-region: rect(104px, 280px, 156px, 224px) }
    6464radio#storageOut:hover          { -moz-image-region: rect(52px, 280px, 104px, 224px) }
    6565radio#options           { -moz-image-region: rect(0px, 393px, 52px, 335px) }
    66 radio#options[feature="off"]    { -moz-image-region: rect(104px, 393px, 156px, 335px) }
     66radio#options[featureDisabled="true"]   { -moz-image-region: rect(104px, 393px, 156px, 335px) }
    6767radio#options:hover         { -moz-image-region: rect(52px, 393px, 104px, 335px) }
    6868
     
    7171}
    7272
    73 image#toSelection           { -moz-image-region: rect(0px, 64px, 30px, 47px) }
    74 image#toSelection[feature="off"]    { -moz-image-region: rect(30px, 64px, 60px, 47px) }
     73image#toSelection, image#toCompose, image#toSend { -moz-image-region: rect(0px, 64px, 30px, 47px) }
     74image#toSelection[featureDisabled="true"], image#toCompose[featureDisabled="true"], image#toSend[featureDisabled="true"]    { -moz-image-region: rect(30px, 64px, 60px, 47px) }
    7575image#storageUpDown             { -moz-image-region: rect(0px, 30px, 30px, -1px) }
    76 image#storageUpDown[feature="off"]  { -moz-image-region: rect(30px, 30px, 60px, -1px) }
     76image#storageUpDown[featureDisabled="true"]     { -moz-image-region: rect(30px, 30px, 60px, -1px) }
    7777image#storageUp             { -moz-image-region: rect(0px, 48px, 30px, 30px) }
    78 image#storageUp[feature="off"]      { -moz-image-region: rect(30px, 48px, 60px, 30px) }
     78image#storageUp[featureDisabled="true"]     { -moz-image-region: rect(30px, 48px, 60px, 30px) }
    7979
    8080
Note: See TracChangeset for help on using the changeset viewer.