/* Copyright (c) 2004-2012, The Dojo Foundation All Rights Reserved. Available via Academic Free License >= 2.1 OR the modified BSD license. see: http://dojotoolkit.org/license for details */ if(!dojo._hasResource["dojox.form.FileInputAuto"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code. dojo._hasResource["dojox.form.FileInputAuto"] = true; 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 templateString: dojo.cache("dojox.form", "resources/FileInputAuto.html", "