Changeset 1071

Show
Ignore:
Timestamp:
2008-09-08 23:31:49 (2 months ago)
Author:
MaierMan
Message:

#850: Text in editable boxes is unreadable, if theme text is white

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/chrome/content/common/bindings.xml

    r1061 r1071  
    9595                <content> 
    9696                        <xul:vbox flex="1"> 
    97                         <xul:menulist anonid="list" editable="true" xbl:inherits="readonly,disabled,flex,tooltiptext,oninput=onchange,onselect=onchange"> 
     97                        <xul:menulist anonid="list" editable="true" xbl:inherits="readonly,disabled,flex,tooltiptext,oninput=onchange,onselect=onchange,error"> 
    9898                                <xul:menupopup anonid="popup" xbl:inherits="onselect=onchange,oncommand=onchange"/> 
    9999                        </xul:menulist> 
     
    276276                <content> 
    277277                        <xul:hbox flex="1"> 
    278                                 <xul:menulist anonid="type" readonly="true" xbl:inherits="disabled"> 
     278                                <xul:menulist anonid="type" readonly="true" xbl:inherits="disabled,error"> 
    279279                                        <xul:menupopup anonid="types"/> 
    280280                                </xul:menulist> 
  • trunk/chrome/content/dta/addurl.js

    r1040 r1071  
    254254                        $('DownThemAll').getButton('help').hidden = !('openHelp' in window); 
    255255                         
    256                         $('directory', 'renaming', 'URLaddress', 'hash').forEach( 
    257                                 function(e) { 
    258                                         e.oldColor = e.inputField.style.color; 
    259                                 } 
    260                         ); 
    261256                        this.ddDirectory = $("directory"); 
    262257                        this.ddRenaming = $("renaming");                         
    263                         var address = $('URLaddress'); 
     258                        var address = $('address'); 
    264259                         
    265260                        // if we've been called by DTA_AddingFunctions.saveSingleLink() 
     
    370365                } 
    371366                 
    372                 var address = $('URLaddress'); 
     367                var address = $('address'); 
    373368                var url = address.value; 
    374369                if ('_realURL' in address) { 
     
    377372                else { 
    378373                        try { 
     374                                if (url == '') { 
     375                                        throw new Components.Exception("Empty url"); 
     376                                } 
    379377                                let fs = Cc['@mozilla.org/docshell/urifixup;1'].getService(Ci.nsIURIFixup); 
    380                                 // throws if empty 
    381378                                let uri = fs.createFixupURI(url, 0); 
    382379                                try { 
     
    386383                                        url = uri.spec; 
    387384                                } 
     385                                var hash = DTA_getLinkPrintHash(url); 
     386                                if (hash) { 
     387                                        $('hash').value = hash; 
     388                                } 
     389                                url = url.replace(/#.*$/, ''); 
     390                                address.value = url; 
     391                                url = new DTA_URL(IOService.newURI(url, null, null));                            
    388392                        } 
    389393                        catch (ex) { 
    390                                 errors.push('URLaddress'); 
    391                         } 
    392                         var hash = DTA_getLinkPrintHash(url); 
    393                         if (hash) { 
    394                                 $('hash').value = hash; 
    395                         } 
    396                         url = url.replace(/#.*$/, ''); 
    397                         address.value = url; 
    398                         url = new DTA_URL(IOService.newURI(url, null, null)); 
     394                                errors.push('address'); 
     395                        } 
    399396                } 
    400397                 
     
    407404                } 
    408405 
    409                 $('directory', 'renaming', 'URLaddress', 'hash').forEach( 
     406                $('directory', 'renaming', 'address', 'hash').forEach( 
    410407                        function(e) { 
    411408                                // reset the styles 
    412                                 var style = e.inputField.style; 
    413                                 style.backgroundColor = 'transparent'
    414                                 style.color = e.oldColor; 
     409                                if (e.hasAttribute('error')) { 
     410                                       e.removeAttribute('error')
     411                                } 
    415412                        } 
    416413                ); 
     
    419416                        errors.forEach( 
    420417                                function(e) { 
    421                                         var style = $(e).inputField.style; 
    422                                         style.backgroundColor = 'red'; 
    423                                         style.color = 'white'; 
     418                                        $(e).setAttribute('error', 'true'); 
    424419                                } 
    425420                        ); 
  • trunk/chrome/content/dta/addurl.xul

    r1048 r1071  
    8080                <rows> 
    8181                        <row align="center"> 
    82                                 <label control="URLaddress" id="URLaddressTitle" value="&url.value;:"/> 
    83                                 <textbox id="URLaddress" type="autocomplete" autocompletesearch="history" completedefaultindex="true" height="21"/> 
     82                                <label control="address" value="&url.value;:"/> 
     83                                <textbox id="address" type="autocomplete" autocompletesearch="history" completedefaultindex="true" height="21"/> 
    8484                        </row> 
    8585                        <row align="center"> 
  • trunk/chrome/skin/add/style.css

    r591 r1071  
    11@import 'chrome://dta/skin/common/style.css'; 
     2@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); 
     3@namespace html url("http://www.w3.org/1999/xhtml"); 
     4 
    25 
    36dialog { 
     
    1215        background-image: url('chrome://dta/skin/add/add.png') !important; 
    1316} 
     17 
     18textbox[error="true"], 
     19menulist[error="true"], 
     20textbox[error="true"] > hbox, 
     21menulist[error="true"] > hbox, 
     22*[error="true"] html|input { 
     23        color: white; 
     24        background-color: red; 
     25}