Lines Matching defs:this

90     // compareposition returns false in this case
254 this._options = {
284 qq.extend(this._options, o);
287 this._filesInProgress = 0;
288 this._handler = this._createUploadHandler();
290 if (this._options.button){
291 this._button = this._createUploadButton(this._options.button);
294 this._preventLeaveInProgress();
299 this._options.params = params;
302 return this._filesInProgress;
305 var self = this;
309 multiple: this._options.multiple && qq.UploadHandlerXhr.isSupported(),
316 var self = this,
326 debug: this._options.debug,
327 action: this._options.action,
328 maxConnections: this._options.maxConnections,
346 var self = this;
359 this._filesInProgress++;
364 this._filesInProgress--;
366 this._options.showMessage(result.error);
370 this._filesInProgress--;
373 if (this._handler instanceof qq.UploadHandlerXhr){
374 this._uploadFileList(input.files);
376 if (this._validateFile(input)){
377 this._uploadFile(input);
380 this._button.reset();
384 if ( !this._validateFile(files[i])){
390 this._uploadFile(files[i]);
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);
415 if (! this._isAllowedExtension(name)){
416 this._error('typeError', name);
420 this._error('emptyError', name);
423 } else if (size && this._options.sizeLimit && size > this._options.sizeLimit){
424 this._error('sizeError', name);
427 } else if (size && size < this._options.minSizeLimit){
428 this._error('minSizeError', name);
435 var message = this._options.messages[code];
438 r('{file}', this._formatFileName(fileName));
439 r('{extensions}', this._options.allowedExtensions.join(', '));
440 r('{sizeLimit}', this._formatSize(this._options.sizeLimit));
441 r('{minSizeLimit}', this._formatSize(this._options.minSizeLimit));
443 this._options.showMessage(message);
453 var allowed = this._options.allowedExtensions;
481 qq.FileUploaderBasic.apply(this, arguments);
484 qq.extend(this._options, {
523 qq.extend(this._options, o);
525 this._element = this._options.element;
526 this._element.innerHTML = this._options.template;
527 this._listElement = this._options.listElement || this._find(this._element, 'list');
529 this._classes = this._options.classes;
531 this._button = this._createUploadButton(this._find(this._element, 'button'));
533 this._bindCancelEvent();
534 this._setupDragDrop();
542 * Gets one of the elements listed in this._options.classes
545 var element = qq.getByClass(parent, this._options.classes[type])[0];
553 var self = this,
554 dropArea = this._find(this._element, 'drop');
593 qq.FileUploaderBasic.prototype._onSubmit.apply(this, arguments);
594 this._addToList(id, fileName);
597 qq.FileUploaderBasic.prototype._onProgress.apply(this, arguments);
599 var item = this._getItemByFileId(id);
600 var size = this._find(item, 'size');
605 text = Math.round(loaded / total * 100) + '% from ' + this._formatSize(total);
607 text = this._formatSize(total);
613 qq.FileUploaderBasic.prototype._onComplete.apply(this, arguments);
616 var item = this._getItemByFileId(id);
617 qq.remove(this._find(item, 'cancel'));
618 qq.remove(this._find(item, 'spinner'));
621 qq.addClass(item, this._classes.success);
623 qq.addClass(item, this._classes.fail);
627 var item = qq.toElement(this._options.fileTemplate);
630 var fileElement = this._find(item, 'file');
631 qq.setText(fileElement, this._formatFileName(fileName));
632 this._find(item, 'size').style.display = 'none';
634 this._listElement.appendChild(item);
637 var item = this._listElement.firstChild;
650 var self = this,
651 list = this._listElement;
669 this._options = {
677 qq.extend(this._options, o);
679 this._element = this._options.element;
681 this._disableDropOutside();
682 this._attachEvents();
701 var self = this;
730 if (qq.contains(this, relatedTarget)) return;
756 this._options = {
767 qq.extend(this._options, o);
769 this._element = this._options.element;
772 qq.css(this._element, {
780 this._input = this._createInput();
786 return this._input;
790 if (this._input.parentNode){
791 qq.remove(this._input);
794 qq.removeClass(this._element, this._options.focusClass);
795 this._input = this._createInput();
800 if (this._options.multiple){
805 input.setAttribute("name", this._options.name);
815 // 4 persons reported this, the max values that worked for them were 243, 236, 236, 118
823 this._element.appendChild(input);
825 var self = this;
858 this._options = {
867 qq.extend(this._options, o);
869 this._queue = [];
871 this._params = [];
875 if (this._options.debug && window.console) console.log('[uploader] ' + str);
886 var len = this._queue.push(id);
890 this._params[id] = copy;
893 if (len <= this._options.maxConnections){
894 this._upload(id, this._params[id]);
901 this._cancel(id);
902 this._dequeue(id);
908 for (var i=0; i<this._queue.length; i++){
909 this._cancel(this._queue[i]);
911 this._queue = [];
926 return this._queue;
940 var i = qq.indexOf(this._queue, id);
941 this._queue.splice(i, 1);
943 var max = this._options.maxConnections;
945 if (this._queue.length >= max && i < max){
946 var nextId = this._queue[max-1];
947 this._upload(nextId, this._params[nextId]);
957 qq.UploadHandlerAbstract.apply(this, arguments);
959 this._inputs = {};
969 this._inputs[id] = fileInput;
980 return this._inputs[id].value.replace(/.*(\/|\\)/, "");
983 this._options.onCancel(id, this.getName(id));
985 delete this._inputs[id];
998 var input = this._inputs[id];
1004 var fileName = this.getName(id);
1006 var iframe = this._createIframe(id);
1007 var form = this._createForm(iframe, params);
1010 var self = this;
1011 this._attachLoadEvent(iframe, function(){
1062 this.log("converting iframe's innerHTML to JSON");
1063 this.log("innerHTML = " + doc.body.innerHTML);
1101 // Because in this case file won't be attached to request
1104 var queryString = qq.obj2url(params, this._options.action);
1120 qq.UploadHandlerAbstract.apply(this, arguments);
1122 this._files = [];
1123 this._xhrs = [];
1126 this._loaded = [];
1153 return this._files.push(file) - 1;
1156 var file = this._files[id];
1161 var file = this._files[id];
1168 return this._loaded[id] || 0;
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();
1182 var self = this;
1200 var queryString = qq.obj2url(params, this._options.action);
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);
1218 this.log("xhr - server response received");
1219 this.log("responseText = " + xhr.responseText);
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);
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;