Changeset 1071
- Timestamp:
- 2008-09-08 23:31:49 (2 months ago)
- Files:
-
- trunk/chrome/content/common/bindings.xml (modified) (2 diffs)
- trunk/chrome/content/dta/addurl.js (modified) (6 diffs)
- trunk/chrome/content/dta/addurl.xul (modified) (1 diff)
- trunk/chrome/skin/add/style.css (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/chrome/content/common/bindings.xml
r1061 r1071 95 95 <content> 96 96 <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"> 98 98 <xul:menupopup anonid="popup" xbl:inherits="onselect=onchange,oncommand=onchange"/> 99 99 </xul:menulist> … … 276 276 <content> 277 277 <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"> 279 279 <xul:menupopup anonid="types"/> 280 280 </xul:menulist> trunk/chrome/content/dta/addurl.js
r1040 r1071 254 254 $('DownThemAll').getButton('help').hidden = !('openHelp' in window); 255 255 256 $('directory', 'renaming', 'URLaddress', 'hash').forEach(257 function(e) {258 e.oldColor = e.inputField.style.color;259 }260 );261 256 this.ddDirectory = $("directory"); 262 257 this.ddRenaming = $("renaming"); 263 var address = $(' URLaddress');258 var address = $('address'); 264 259 265 260 // if we've been called by DTA_AddingFunctions.saveSingleLink() … … 370 365 } 371 366 372 var address = $(' URLaddress');367 var address = $('address'); 373 368 var url = address.value; 374 369 if ('_realURL' in address) { … … 377 372 else { 378 373 try { 374 if (url == '') { 375 throw new Components.Exception("Empty url"); 376 } 379 377 let fs = Cc['@mozilla.org/docshell/urifixup;1'].getService(Ci.nsIURIFixup); 380 // throws if empty381 378 let uri = fs.createFixupURI(url, 0); 382 379 try { … … 386 383 url = uri.spec; 387 384 } 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)); 388 392 } 389 393 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 } 399 396 } 400 397 … … 407 404 } 408 405 409 $('directory', 'renaming', ' URLaddress', 'hash').forEach(406 $('directory', 'renaming', 'address', 'hash').forEach( 410 407 function(e) { 411 408 // 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 } 415 412 } 416 413 ); … … 419 416 errors.forEach( 420 417 function(e) { 421 var style = $(e).inputField.style; 422 style.backgroundColor = 'red'; 423 style.color = 'white'; 418 $(e).setAttribute('error', 'true'); 424 419 } 425 420 ); trunk/chrome/content/dta/addurl.xul
r1048 r1071 80 80 <rows> 81 81 <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"/> 84 84 </row> 85 85 <row align="center"> trunk/chrome/skin/add/style.css
r591 r1071 1 1 @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 2 5 3 6 dialog { … … 12 15 background-image: url('chrome://dta/skin/add/add.png') !important; 13 16 } 17 18 textbox[error="true"], 19 menulist[error="true"], 20 textbox[error="true"] > hbox, 21 menulist[error="true"] > hbox, 22 *[error="true"] html|input { 23 color: white; 24 background-color: red; 25 }
