a:36:{s:9:"#provides";s:24:"dojox.form.FileInputAuto";s:9:"#resource";s:21:"form/FileInputAuto.js";s:9:"#requires";a:2:{i:0;a:2:{i:0;s:6:"common";i:1;s:20:"dojox.form.FileInput";}i:1;a:3:{i:0;s:6:"common";i:1;s:14:"dojo.io.iframe";i:2;s:4:"dojo";}}s:24:"dojox.form.FileInputAuto";a:5:{s:4:"type";s:8:"Function";s:6:"chains";a:2:{s:9:"prototype";a:1:{i:0;s:20:"dojox.form.FileInput";}s:4:"call";a:1:{i:0;s:20:"dojox.form.FileInput";}}s:7:"summary";s:73:"An extension on dojox.form.FileInput providing background upload progress";s:11:"description";s:486:"An extended version of FileInput - when the user focuses away from the input the selected file is posted via dojo.io.iframe to the url. example implementation comes with PHP solution for handling upload, and returning required data. notes: the return data from the io.iframe is used to populate the input element with data regarding the results. it will be a JSON object, like: results = { size: "1024", filename: "file.txt" } all the parameters allowed to dojox.form.FileInput apply";s:9:"classlike";b:1;}s:28:"dojox.form.FileInputAuto.url";a:3:{s:9:"prototype";s:24:"dojox.form.FileInputAuto";s:4:"type";s:6:"String";s:7:"summary";s:52:"the URL where our background FileUpload will be sent";}s:34:"dojox.form.FileInputAuto.blurDelay";a:3:{s:9:"prototype";s:24:"dojox.form.FileInputAuto";s:4:"type";s:7:"Integer";s:7:"summary";s:127:"time in ms before an un-focused widget will wait before uploading the file to the url="" specified default: 2 seconds";}s:33:"dojox.form.FileInputAuto.duration";a:3:{s:9:"prototype";s:24:"dojox.form.FileInputAuto";s:4:"type";s:7:"Integer";s:7:"summary";s:120:"The time in ms to use as the generic timing mechanism for the animations set to 1 or 0 for "immediate respose"";}s:38:"dojox.form.FileInputAuto.uploadMessage";a:3:{s:9:"prototype";s:24:"dojox.form.FileInputAuto";s:4:"type";s:6:"String";s:7:"summary";s:21:" FIXME: i18n somehow?";}s:37:"dojox.form.FileInputAuto.triggerEvent";a:3:{s:9:"prototype";s:24:"dojox.form.FileInputAuto";s:4:"type";s:6:"String";s:7:"summary";s:215:"Event which triggers the upload. Defaults to onblur, sending the file selected 'blurDelay' milliseconds after losing focus. Set to "onchange" with a low blurDelay to send files immediately after uploading.";}s:30:"dojox.form.FileInputAuto._sent";a:4:{s:9:"prototype";s:24:"dojox.form.FileInputAuto";s:8:"instance";s:24:"dojox.form.FileInputAuto";s:7:"private";b:1;s:7:"summary";s:0:"";}s:37:"dojox.form.FileInputAuto.templatePath";a:2:{s:9:"prototype";s:24:"dojox.form.FileInputAuto";s:7:"summary";s:0:"";}s:32:"dojox.form.FileInputAuto.startup";a:4:{s:9:"prototype";s:24:"dojox.form.FileInputAuto";s:4:"type";s:8:"Function";s:6:"source";s:189:" this._blurListener = this.connect(this.fileInput, this.triggerEvent, "_onBlur"); this._focusListener = this.connect(this.fileInput, "onfocus", "_onFocus"); this.inherited(arguments);";s:7:"summary";s:28:"add our extra blur listeners";}s:33:"dojox.form.FileInputAuto._onFocus";a:5:{s:9:"prototype";s:24:"dojox.form.FileInputAuto";s:4:"type";s:8:"Function";s:6:"source";s:55:" if(this._blurTimer){ clearTimeout(this._blurTimer); }";s:7:"summary";s:22:"clear the upload timer";s:7:"private";b:1;}s:32:"dojox.form.FileInputAuto._onBlur";a:5:{s:9:"prototype";s:24:"dojox.form.FileInputAuto";s:4:"type";s:8:"Function";s:6:"source";s:158:" if(this._blurTimer){ clearTimeout(this._blurTimer); } if(!this._sent){ this._blurTimer = setTimeout(dojo.hitch(this,"_sendFile"),this.blurDelay); }";s:7:"summary";s:22:"start the upload timer";s:7:"private";b:1;}s:35:"dojox.form.FileInputAuto.setMessage";a:5:{s:9:"prototype";s:24:"dojox.form.FileInputAuto";s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:5:"title";a:1:{s:4:"type";s:6:"String";}}s:6:"source";s:112:" this.overlay.removeChild(this.overlay.firstChild); this.overlay.appendChild(document.createTextNode(title));";s:7:"summary";s:127:"set the text of the progressbar innerHTML throws errors in IE! so use DOM manipulation instead this.overlay.innerHTML = title;";}s:34:"dojox.form.FileInputAuto._sendFile";a:6:{s:9:"prototype";s:24:"dojox.form.FileInputAuto";s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:1:"e";a:1:{s:4:"type";s:5:"Event";}}s:6:"source";s:941:" if(this._sent || this._sending || !this.fileInput.value){ return; } this._sending = true; dojo.style(this.fakeNodeHolder,"display","none"); dojo.style(this.overlay,{ opacity:0, display:"block" }); this.setMessage(this.uploadMessage); dojo.fadeIn({ node: this.overlay, duration:this.duration }).play(); var _newForm; if(dojo.isIE){ // just to reiterate, IE is a steaming pile of code. _newForm = document.createElement('
'); _newForm.encoding = "multipart/form-data"; }else{ // this is how all other sane browsers do it _newForm = document.createElement('form'); _newForm.setAttribute("enctype","multipart/form-data"); } _newForm.appendChild(this.fileInput); dojo.body().appendChild(_newForm); dojo.io.iframe.send({ url: this.url, form: _newForm, handleAs: "json", handle: dojo.hitch(this,"_handleSend") });";s:7:"summary";s:71:"triggers the chain of events needed to upload a file in the background.";s:7:"private";b:1;}s:36:"dojox.form.FileInputAuto._handleSend";a:6:{s:9:"prototype";s:24:"dojox.form.FileInputAuto";s:4:"type";s:8:"Function";s:10:"parameters";a:2:{s:4:"data";a:1:{s:4:"type";s:0:"";}s:6:"ioArgs";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:4570:"dojo.provide("dojox.form.FileInputAuto"); dojo.require("dojox.form.FileInput"); dojo.require("dojo.io.iframe"); dojo.declare("dojox.form.FileInputAuto", dojox.form.FileInput, { // summary: An extension on dojox.form.FileInput providing background upload progress // // description: An extended version of FileInput - when the user focuses away from the input // the selected file is posted via dojo.io.iframe to the url. example implementation // comes with PHP solution for handling upload, and returning required data. // // notes: the return data from the io.iframe is used to populate the input element with // data regarding the results. it will be a JSON object, like: // // results = { size: "1024", filename: "file.txt" } // // all the parameters allowed to dojox.form.FileInput apply // url: String // the URL where our background FileUpload will be sent url: "", // blurDelay: Integer // time in ms before an un-focused widget will wait before uploading the file to the url="" specified // default: 2 seconds blurDelay: 2000, // duration: Integer // The time in ms to use as the generic timing mechanism for the animations // set to 1 or 0 for "immediate respose" duration: 500, // uploadMessage: String // // FIXME: i18n somehow? uploadMessage: "Uploading ...", // triggerEvent: String // Event which triggers the upload. Defaults to onblur, sending the file selected // 'blurDelay' milliseconds after losing focus. Set to "onchange" with a low blurDelay // to send files immediately after uploading. triggerEvent: "onblur", _sent: false, // small template changes, new attachpoint: overlay templatePath: dojo.moduleUrl("dojox.form","resources/FileInputAuto.html"), startup: function(){ // summary: add our extra blur listeners this._blurListener = this.connect(this.fileInput, this.triggerEvent, "_onBlur"); this._focusListener = this.connect(this.fileInput, "onfocus", "_onFocus"); this.inherited(arguments); }, _onFocus: function(){ // summary: clear the upload timer if(this._blurTimer){ clearTimeout(this._blurTimer); } }, _onBlur: function(){ // summary: start the upload timer if(this._blurTimer){ clearTimeout(this._blurTimer); } if(!this._sent){ this._blurTimer = setTimeout(dojo.hitch(this,"_sendFile"),this.blurDelay); } }, setMessage: function(/*String*/title){ // summary: set the text of the progressbar // innerHTML throws errors in IE! so use DOM manipulation instead //this.overlay.innerHTML = title; this.overlay.removeChild(this.overlay.firstChild); this.overlay.appendChild(document.createTextNode(title)); }, _sendFile: function(/* Event */e){ // summary: triggers the chain of events needed to upload a file in the background. if(this._sent || this._sending || !this.fileInput.value){ return; } this._sending = true; dojo.style(this.fakeNodeHolder,"display","none"); dojo.style(this.overlay,{ opacity:0, display:"block" }); this.setMessage(this.uploadMessage); dojo.fadeIn({ node: this.overlay, duration:this.duration }).play(); var _newForm; if(dojo.isIE){ // just to reiterate, IE is a steaming pile of code. _newForm = document.createElement(''); _newForm.encoding = "multipart/form-data"; }else{ // this is how all other sane browsers do it _newForm = document.createElement('form'); _newForm.setAttribute("enctype","multipart/form-data"); } _newForm.appendChild(this.fileInput); dojo.body().appendChild(_newForm); dojo.io.iframe.send({ url: this.url, form: _newForm, handleAs: "json", handle: dojo.hitch(this,"_handleSend") }); }, _handleSend: function(data,ioArgs){ // summary: The callback to toggle the progressbar, and fire the user-defined callback // innerHTML throws errors in IE! so use DOM manipulation instead this.overlay.removeChild(this.overlay.firstChild); this._sent = true; this._sending = false; dojo.style(this.overlay,{ opacity:0, border:"none", background:"none" }); this.overlay.style.backgroundImage = "none"; this.fileInput.style.display = "none"; this.fakeNodeHolder.style.display = "none"; dojo.fadeIn({ node:this.overlay, duration:this.duration }).play(250); this.disconnect(this._blurListener); this.disconnect(this._focusListener); //remove the form used to send the request dojo.body().removeChild(ioArgs.args.form); this.fileInput = null; this.onComplete(data,ioArgs,this);";s:7:"private";b:1;s:7:"summary";s:0:"";}s:30:"dojox.form.FileInputAuto.reset";a:5:{s:9:"prototype";s:24:"dojox.form.FileInputAuto";s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:1:"e";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:453:" if(this._blurTimer){ clearTimeout(this._blurTimer); } this.disconnect(this._blurListener); this.disconnect(this._focusListener); this.overlay.style.display = "none"; this.fakeNodeHolder.style.display = ""; this.inherited(arguments); this._sent = false; this._sending = false; this._blurListener = this.connect(this.fileInput, this.triggerEvent,"_onBlur"); this._focusListener = this.connect(this.fileInput,"onfocus","_onFocus"); ";s:7:"summary";s:35:"accomodate our extra focusListeners";}s:35:"dojox.form.FileInputAuto.onComplete";a:5:{s:9:"prototype";s:24:"dojox.form.FileInputAuto";s:4:"type";s:8:"Function";s:10:"parameters";a:3:{s:4:"data";a:2:{s:4:"type";s:3:"the";s:7:"summary";s:58:"raw data found in the first [TEXTAREA] tag of the post url";}s:6:"ioArgs";a:2:{s:4:"type";s:3:"the";s:7:"summary";s:57:"dojo.Deferred data being passed from the handle: callback";}s:9:"widgetRef";a:2:{s:4:"type";s:4:"this";s:7:"summary";s:79:"widget pointer, so you can set this.overlay to a completed/error message easily";}}s:6:"source";s:313:" // summary: stub function fired when an upload has finished. // data: the raw data found in the first [TEXTAREA] tag of the post url // ioArgs: the dojo.Deferred data being passed from the handle: callback // widgetRef: this widget pointer, so you can set this.overlay to a completed/error message easily";s:7:"summary";s:48:"stub function fired when an upload has finished.";}s:38:"dojox.form.FileInputAuto._blurListener";a:3:{s:8:"instance";s:24:"dojox.form.FileInputAuto";s:7:"private";b:1;s:7:"summary";s:0:"";}s:39:"dojox.form.FileInputAuto._focusListener";a:3:{s:8:"instance";s:24:"dojox.form.FileInputAuto";s:7:"private";b:1;s:7:"summary";s:0:"";}s:35:"dojox.form.FileInputAuto._blurTimer";a:3:{s:8:"instance";s:24:"dojox.form.FileInputAuto";s:7:"private";b:1;s:7:"summary";s:0:"";}s:33:"dojox.form.FileInputAuto._sending";a:3:{s:8:"instance";s:24:"dojox.form.FileInputAuto";s:7:"private";b:1;s:7:"summary";s:0:"";}s:54:"dojox.form.FileInputAuto.overlay.style.backgroundImage";a:2:{s:8:"instance";s:24:"dojox.form.FileInputAuto";s:7:"summary";s:0:"";}s:48:"dojox.form.FileInputAuto.fileInput.style.display";a:2:{s:8:"instance";s:24:"dojox.form.FileInputAuto";s:7:"summary";s:0:"";}s:53:"dojox.form.FileInputAuto.fakeNodeHolder.style.display";a:2:{s:8:"instance";s:24:"dojox.form.FileInputAuto";s:7:"summary";s:0:"";}s:34:"dojox.form.FileInputAuto.fileInput";a:2:{s:8:"instance";s:24:"dojox.form.FileInputAuto";s:7:"summary";s:0:"";}s:46:"dojox.form.FileInputAuto.overlay.style.display";a:2:{s:8:"instance";s:24:"dojox.form.FileInputAuto";s:7:"summary";s:0:"";}s:25:"dojox.form.FileInputBlind";a:4:{s:4:"type";s:8:"Function";s:6:"chains";a:2:{s:9:"prototype";a:1:{i:0;s:24:"dojox.form.FileInputAuto";}s:4:"call";a:1:{i:0;s:24:"dojox.form.FileInputAuto";}}s:7:"summary";s:155:"An extended version of dojox.form.FileInputAuto that does not display an input node, but rather only a button and otherwise behaves just like FileInputAuto";s:9:"classlike";b:1;}s:33:"dojox.form.FileInputBlind.startup";a:4:{s:9:"prototype";s:25:"dojox.form.FileInputBlind";s:4:"type";s:8:"Function";s:6:"source";s:142:" this.inherited(arguments); this._off = dojo.style(this.inputNode,"width"); this.inputNode.style.display = "none"; this._fixPosition();";s:7:"summary";s:30:"hide our fileInput input field";}s:38:"dojox.form.FileInputBlind._fixPosition";a:5:{s:9:"prototype";s:25:"dojox.form.FileInputBlind";s:4:"type";s:8:"Function";s:6:"source";s:133:" if(dojo.isIE){ dojo.style(this.fileInput,"width","1px"); }else{ dojo.style(this.fileInput,"left","-"+(this._off)+"px"); }";s:7:"summary";s:62:"in this case, set the button under where the visible button is";s:7:"private";b:1;}s:31:"dojox.form.FileInputBlind.reset";a:5:{s:9:"prototype";s:25:"dojox.form.FileInputBlind";s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:1:"e";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:52:" this.inherited(arguments); this._fixPosition(); ";s:7:"summary";s:76:"onclick, we need to reposition our newly created input type="file"";}s:30:"dojox.form.FileInputBlind._off";a:3:{s:8:"instance";s:25:"dojox.form.FileInputBlind";s:7:"private";b:1;s:7:"summary";s:0:"";}s:49:"dojox.form.FileInputBlind.inputNode.style.display";a:2:{s:8:"instance";s:25:"dojox.form.FileInputBlind";s:7:"summary";s:0:"";}s:10:"dojox.form";a:2:{s:4:"type";s:6:"Object";s:7:"summary";s:0:"";}s:5:"dojox";a:2:{s:4:"type";s:6:"Object";s:7:"summary";s:0:"";}}