Lines Matching defs:qq
14 var qq = qq || {};
19 qq.extend = function(first, second){
29 qq.indexOf = function(arr, elt, from){
45 qq.getUniqueId = (function(){
53 qq.attach = function(element, type, fn){
60 qq.detach = function(element, type, fn){
68 qq.preventDefault = function(e){
82 qq.insertBefore = function(a, b){
85 qq.remove = function(element){
89 qq.contains = function(parent, descendant){
104 qq.toElement = (function(){
121 qq.css = function(element, styles){
127 qq.extend(element.style, styles);
129 qq.hasClass = function(element, name){
133 qq.addClass = function(element, name){
134 if (!qq.hasClass(element, name)){
138 qq.removeClass = function(element, name){
142 qq.setText = function(element, text){
150 qq.children = function(element){
164 qq.getByClass = function(element, className){
174 if (qq.hasClass(candidates[i], className)){
187 * `qq.obj2url({a:'b',c:'d'},'http://any.url/upload?otherParam=value');`
197 qq.obj2url = function(obj, temp, prefixDone){
209 ? qq.obj2url(nextObj, nextTemp, true)
220 uristrings.push(qq.obj2url(obj));
248 var qq = qq || {};
253 qq.FileUploaderBasic = function(o){
284 qq.extend(this._options, o);
297 qq.FileUploaderBasic.prototype = {
307 return new qq.UploadButton({
309 multiple: this._options.multiple && qq.UploadHandlerXhr.isSupported(),
319 if(qq.UploadHandlerXhr.isSupported()){
325 var handler = new qq[handlerClass]({
348 qq.attach(window, 'beforeunload', function(e){
373 if (this._handler instanceof qq.UploadHandlerXhr){
477 * @inherits qq.FileUploaderBasic
479 qq.FileUploader = function(o){
481 qq.FileUploaderBasic.apply(this, arguments);
484 qq.extend(this._options, {
486 // if set, will be used instead of qq-upload-list in template
489 template: '<div class="qq-uploader">' +
490 '<div class="qq-upload-drop-area"><span>Drop files here to upload</span></div>' +
491 '<div class="qq-upload-button">Upload a file</div>' +
492 '<ul class="qq-upload-list"></ul>' +
497 '<span class="qq-upload-file"></span>' +
498 '<span class="qq-upload-spinner"></span>' +
499 '<span class="qq-upload-size"></span>' +
500 '<a class="qq-upload-cancel" href="#">Cancel</a>' +
501 '<span class="qq-upload-failed-text">Failed</span>' +
506 button: 'qq-upload-button',
507 drop: 'qq-upload-drop-area',
508 dropActive: 'qq-upload-drop-area-active',
509 list: 'qq-upload-list',
511 file: 'qq-upload-file',
512 spinner: 'qq-upload-spinner',
513 size: 'qq-upload-size',
514 cancel: 'qq-upload-cancel',
518 success: 'qq-upload-success',
519 fail: 'qq-upload-fail'
523 qq.extend(this._options, o);
538 qq.extend(qq.FileUploader.prototype, qq.FileUploaderBasic.prototype);
540 qq.extend(qq.FileUploader.prototype, {
545 var element = qq.getByClass(parent, this._options.classes[type])[0];
556 var dz = new qq.UploadDropZone({
559 qq.addClass(dropArea, self._classes.dropActive);
566 qq.removeClass(dropArea, self._classes.dropActive);
570 qq.removeClass(dropArea, self._classes.dropActive);
577 qq.attach(document, 'dragenter', function(e){
582 qq.attach(document, 'dragleave', function(e){
593 qq.FileUploaderBasic.prototype._onSubmit.apply(this, arguments);
597 qq.FileUploaderBasic.prototype._onProgress.apply(this, arguments);
610 qq.setText(size, text);
613 qq.FileUploaderBasic.prototype._onComplete.apply(this, arguments);
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);
631 qq.setText(fileElement, this._formatFileName(fileName));
653 qq.attach(list, 'click', function(e){
657 if (qq.hasClass(target, self._classes.cancel)){
658 qq.preventDefault(e);
662 qq.remove(item);
668 qq.UploadDropZone = function(o){
677 qq.extend(this._options, o);
685 qq.UploadDropZone.prototype = {
688 if (!qq.UploadDropZone.dropOutsideDisabled ){
690 qq.attach(document, 'dragover', function(e){
697 qq.UploadDropZone.dropOutsideDisabled = true;
703 qq.attach(self._element, 'dragover', function(e){
717 qq.attach(self._element, 'dragenter', function(e){
723 qq.attach(self._element, 'dragleave', function(e){
730 if (qq.contains(this, relatedTarget)) return;
735 qq.attach(self._element, 'drop', function(e){
755 qq.UploadButton = function(o){
763 hoverClass: 'qq-upload-button-hover',
764 focusClass: 'qq-upload-button-focus'
767 qq.extend(this._options, o);
772 qq.css(this._element, {
783 qq.UploadButton.prototype = {
791 qq.remove(this._input);
794 qq.removeClass(this._element, this._options.focusClass);
807 qq.css(input, {
826 qq.attach(input, 'change', function(){
830 qq.attach(input, 'mouseover', function(){
831 qq.addClass(self._element, self._options.hoverClass);
833 qq.attach(input, 'mouseout', function(){
834 qq.removeClass(self._element, self._options.hoverClass);
836 qq.attach(input, 'focus', function(){
837 qq.addClass(self._element, self._options.focusClass);
839 qq.attach(input, 'blur', function(){
840 qq.removeClass(self._element, self._options.focusClass);
857 qq.UploadHandlerAbstract = function(o){
867 qq.extend(this._options, o);
873 qq.UploadHandlerAbstract.prototype = {
889 qq.extend(copy, params);
940 var i = qq.indexOf(this._queue, id);
954 * @inherits qq.UploadHandlerAbstract
956 qq.UploadHandlerForm = function(o){
957 qq.UploadHandlerAbstract.apply(this, arguments);
961 // @inherits qq.UploadHandlerAbstract
962 qq.extend(qq.UploadHandlerForm.prototype, qq.UploadHandlerAbstract.prototype);
964 qq.extend(qq.UploadHandlerForm.prototype, {
967 var id = 'qq-upload-handler-iframe' + qq.getUniqueId();
973 qq.remove(fileInput);
994 qq.remove(iframe);
1022 qq.remove(iframe);
1027 qq.remove(form);
1032 qq.attach(iframe, 'load', function(){
1083 var iframe = qq.toElement('<iframe src="javascript:false;" name="' + id + '" />');
1102 var form = qq.toElement('<form method="post" enctype="multipart/form-data"></form>');
1104 var queryString = qq.obj2url(params, this._options.action);
1117 * @inherits qq.UploadHandlerAbstract
1119 qq.UploadHandlerXhr = function(o){
1120 qq.UploadHandlerAbstract.apply(this, arguments);
1130 qq.UploadHandlerXhr.isSupported = function(){
1140 // @inherits qq.UploadHandlerAbstract
1141 qq.extend(qq.UploadHandlerXhr.prototype, qq.UploadHandlerAbstract.prototype);
1143 qq.extend(qq.UploadHandlerXhr.prototype, {
1150 throw new Error('Passed obj in not a File (in qq.UploadHandlerXhr)');
1200 var queryString = qq.obj2url(params, this._options.action);