Lines Matching defs:id

46     var id = 0;
47 return function(){ return id++; };
268 onSubmit: function(id, fileName){},
269 onProgress: function(id, fileName, loaded, total){},
270 onComplete: function(id, fileName, responseJSON){},
271 onCancel: function(id, fileName){},
329 onProgress: function(id, fileName, loaded, total){
330 self._onProgress(id, fileName, loaded, total);
331 self._options.onProgress(id, fileName, loaded, total);
333 onComplete: function(id, fileName, result){
334 self._onComplete(id, fileName, result);
335 self._options.onComplete(id, fileName, result);
337 onCancel: function(id, fileName){
338 self._onCancel(id, fileName);
339 self._options.onCancel(id, fileName);
358 _onSubmit: function(id, fileName){
361 _onProgress: function(id, fileName, loaded, total){
363 _onComplete: function(id, fileName, result){
369 _onCancel: function(id, fileName){
394 var id = this._handler.add(fileContainer);
395 var fileName = this._handler.getName(id);
397 if (this._options.onSubmit(id, fileName) !== false){
398 this._onSubmit(id, fileName);
399 this._handler.upload(id, this._options.params);
592 _onSubmit: function(id, fileName){
594 this._addToList(id, fileName);
596 _onProgress: function(id, fileName, loaded, total){
599 var item = this._getItemByFileId(id);
612 _onComplete: function(id, fileName, result){
616 var item = this._getItemByFileId(id);
626 _addToList: function(id, fileName){
628 item.qqFileId = id;
636 _getItemByFileId: function(id){
642 if (item.qqFileId == id) return item;
863 onProgress: function(id, fileName, loaded, total){},
864 onComplete: function(id, fileName, response){},
865 onCancel: function(id, fileName){}
879 * @returns id
883 * Sends the file identified by id and additional query params to the server
885 upload: function(id, params){
886 var len = this._queue.push(id);
890 this._params[id] = copy;
894 this._upload(id, this._params[id]);
898 * Cancels file upload by id
900 cancel: function(id){
901 this._cancel(id);
902 this._dequeue(id);
914 * Returns name of the file identified by id
916 getName: function(id){},
918 * Returns size of the file identified by id
920 getSize: function(id){},
922 * Returns id of files being uploaded or
931 _upload: function(id){},
935 _cancel: function(id){},
939 _dequeue: function(id){
940 var i = qq.indexOf(this._queue, id);
967 var id = 'qq-upload-handler-iframe' + qq.getUniqueId();
969 this._inputs[id] = fileInput;
976 return id;
978 getName: function(id){
980 return this._inputs[id].value.replace(/.*(\/|\\)/, "");
982 _cancel: function(id){
983 this._options.onCancel(id, this.getName(id));
985 delete this._inputs[id];
987 var iframe = document.getElementById(id);
997 _upload: function(id, params){
998 var input = this._inputs[id];
1001 throw new Error('file with passed id was not added, or already uploaded or cancelled');
1004 var fileName = this.getName(id);
1006 var iframe = this._createIframe(id);
1016 self._options.onComplete(id, fileName, response);
1017 self._dequeue(id);
1019 delete self._inputs[id];
1029 return id;
1076 _createIframe: function(id){
1081 // iframe.setAttribute('name', id);
1083 var iframe = qq.toElement('<iframe src="javascript:false;" name="' + id + '" />');
1086 iframe.setAttribute('id', id);
1146 * Returns id to use with upload, cancel
1155 getName: function(id){
1156 var file = this._files[id];
1160 getSize: function(id){
1161 var file = this._files[id];
1165 * Returns uploaded bytes for file identified by id
1167 getLoaded: function(id){
1168 return this._loaded[id] || 0;
1171 * Sends the file identified by id and additional query params to the server
1174 _upload: function(id, params){
1175 var file = this._files[id],
1176 name = this.getName(id),
1177 size = this.getSize(id);
1179 this._loaded[id] = 0;
1181 var xhr = this._xhrs[id] = new XMLHttpRequest();
1186 self._loaded[id] = e.loaded;
1187 self._options.onProgress(id, name, e.loaded, e.total);
1193 self._onComplete(id, xhr);
1208 _onComplete: function(id, xhr){
1210 if (!this._files[id]) return;
1212 var name = this.getName(id);
1213 var size = this.getSize(id);
1215 this._options.onProgress(id, name, size, size);
1229 this._options.onComplete(id, name, response);
1232 this._options.onComplete(id, name, {});
1235 this._files[id] = null;
1236 this._xhrs[id] = null;
1237 this._dequeue(id);
1239 _cancel: function(id){
1240 this._options.onCancel(id, this.getName(id));
1242 this._files[id] = null;
1244 if (this._xhrs[id]){
1245 this._xhrs[id].abort();
1246 this._xhrs[id] = null;