1 2(function () { 3 4 // import library 5 eval( JELLY.unpack() ); 6 7 addDomReady( function () { 8 9 // Load our css 10 11 // Create a reusable tweening object 12 var tween = new Tween, 13 14 // event handlers, including blur/focus to 15 // restore keyboard navigation 16 onUploadChange = function ( e ) { 17 18 var status = retrieveData( this, 'upload-status' ); 19 20 if ( this.value ) { 21 // IE shows the whole system path, we're reducing it 22 // to the filename for consistency 23 var value = ''; 24 var files = this.files; 25 for (var i = 0; i < files.length-1; i++) 26 value =value+( browser.ie ? files[i].name.split('\\').pop() : files[i].name)+', '; 27 i = files.length-1; 28 value =value+( browser.ie ? files[i].name.split('\\').pop() : files[i].name); 29 status.innerHTML = value; 30 31 insertAfter( status, this.parentNode ); 32 // Only tween if we're responding to an event 33 if ( e ) { 34 tween.setElement( status ). 35 setOpacity( 0 ). 36 start({ 37 opacity: 1, duration: 500 38 }); 39 } 40 } 41 else if ( status && status.parentNode ) { 42 removeElement( status ); 43 } 44 }, 45 onUploadFocus = function () { 46 addClass( this.parentNode, 'focus' ); 47 }, 48 onUploadBlur = function () { 49 removeClass( this.parentNode, 'focus' ); 50 }; 51 52 53 Q( '.file-upload input[type=file]' ).each( function ( field ) { 54 55 // Create a status element, and store it 56 storeData( field, 'upload-status', createElement( 'span.file-upload-status' ) ); 57 58 // Bind events 59 addEvent( field, 'focus', onUploadFocus ); 60 addEvent( field, 'blur', onUploadBlur ); 61 addEvent( field, 'change', onUploadChange ); 62 63 // Set current state 64 onUploadChange.call( field ); 65 66 // Move the file input in Firefox / Opera so that the button part is 67 // in the hit area. Otherwise we get a text selection cursor 68 // which you cannot override with CSS 69 if ( browser.firefox || browser.opera ) { 70 field.style.left = '-800px'; 71 } 72 else if ( browser.ie ) { 73 // Minimizes the text input part in IE 74 field.style.width = '0'; 75 } 76 }); 77 }); 78 79})();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.