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