redde 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (167) hide show
  1. data/.gitignore +20 -0
  2. data/.rspec +1 -0
  3. data/Gemfile +4 -0
  4. data/Guardfile +24 -0
  5. data/LICENSE +22 -0
  6. data/README.md +57 -0
  7. data/Rakefile +2 -0
  8. data/lib/generators/redde/deploy/deploy_generator.rb +34 -0
  9. data/lib/generators/redde/deploy/templates/Capfile +4 -0
  10. data/lib/generators/redde/deploy/templates/deploy.rb +33 -0
  11. data/lib/generators/redde/deploy/templates/recipes/base.rb +16 -0
  12. data/lib/generators/redde/deploy/templates/recipes/check.rb +13 -0
  13. data/lib/generators/redde/deploy/templates/recipes/database.rb +66 -0
  14. data/lib/generators/redde/deploy/templates/recipes/imagemagick.rb +8 -0
  15. data/lib/generators/redde/deploy/templates/recipes/memcached.rb +10 -0
  16. data/lib/generators/redde/deploy/templates/recipes/monit.rb +35 -0
  17. data/lib/generators/redde/deploy/templates/recipes/nginx.rb +26 -0
  18. data/lib/generators/redde/deploy/templates/recipes/nodejs.rb +10 -0
  19. data/lib/generators/redde/deploy/templates/recipes/postfix.rb +37 -0
  20. data/lib/generators/redde/deploy/templates/recipes/rbenv.rb +17 -0
  21. data/lib/generators/redde/deploy/templates/recipes/templates/database.yml.erb +8 -0
  22. data/lib/generators/redde/deploy/templates/recipes/templates/dkim-filter.conf.erb +57 -0
  23. data/lib/generators/redde/deploy/templates/recipes/templates/dkim-filter.defaults.erb +11 -0
  24. data/lib/generators/redde/deploy/templates/recipes/templates/dkim-keys.conf.erb +2 -0
  25. data/lib/generators/redde/deploy/templates/recipes/templates/gemrc.erb +1 -0
  26. data/lib/generators/redde/deploy/templates/recipes/templates/main.cf.erb +43 -0
  27. data/lib/generators/redde/deploy/templates/recipes/templates/memcached.erb +47 -0
  28. data/lib/generators/redde/deploy/templates/recipes/templates/monit_monitrc.erb +21 -0
  29. data/lib/generators/redde/deploy/templates/recipes/templates/monit_nginx.erb +5 -0
  30. data/lib/generators/redde/deploy/templates/recipes/templates/monit_unicorn.erb +14 -0
  31. data/lib/generators/redde/deploy/templates/recipes/templates/nginx_unicorn.erb +28 -0
  32. data/lib/generators/redde/deploy/templates/recipes/templates/unicorn.rb.erb +36 -0
  33. data/lib/generators/redde/deploy/templates/recipes/templates/unicorn_init.erb +84 -0
  34. data/lib/generators/redde/deploy/templates/recipes/unicorn.rb +27 -0
  35. data/lib/generators/redde/layout/layout_generator.rb +57 -0
  36. data/lib/generators/redde/layout/templates/assets/images/admin/addphoto.png +0 -0
  37. data/lib/generators/redde/layout/templates/assets/images/admin/ajaxloader2.gif +0 -0
  38. data/lib/generators/redde/layout/templates/assets/images/admin/arrow_down.png +0 -0
  39. data/lib/generators/redde/layout/templates/assets/images/admin/arrow_enter.png +0 -0
  40. data/lib/generators/redde/layout/templates/assets/images/admin/arrow_right.png +0 -0
  41. data/lib/generators/redde/layout/templates/assets/images/admin/coins.png +0 -0
  42. data/lib/generators/redde/layout/templates/assets/images/admin/confirm.png +0 -0
  43. data/lib/generators/redde/layout/templates/assets/images/admin/del.png +0 -0
  44. data/lib/generators/redde/layout/templates/assets/images/admin/delete.png +0 -0
  45. data/lib/generators/redde/layout/templates/assets/images/admin/email.png +0 -0
  46. data/lib/generators/redde/layout/templates/assets/images/admin/error.png +0 -0
  47. data/lib/generators/redde/layout/templates/assets/images/admin/fio.png +0 -0
  48. data/lib/generators/redde/layout/templates/assets/images/admin/folder.png +0 -0
  49. data/lib/generators/redde/layout/templates/assets/images/admin/folder_.png +0 -0
  50. data/lib/generators/redde/layout/templates/assets/images/admin/icon_eye.gif +0 -0
  51. data/lib/generators/redde/layout/templates/assets/images/admin/lightbox/css/jquery.lightbox-0.5.css +101 -0
  52. data/lib/generators/redde/layout/templates/assets/images/admin/lightbox/images/lightbox-blank.gif +0 -0
  53. data/lib/generators/redde/layout/templates/assets/images/admin/lightbox/images/lightbox-btn-close.gif +0 -0
  54. data/lib/generators/redde/layout/templates/assets/images/admin/lightbox/images/lightbox-btn-next.gif +0 -0
  55. data/lib/generators/redde/layout/templates/assets/images/admin/lightbox/images/lightbox-btn-prev.gif +0 -0
  56. data/lib/generators/redde/layout/templates/assets/images/admin/lightbox/images/lightbox-ico-loading.gif +0 -0
  57. data/lib/generators/redde/layout/templates/assets/images/admin/lightbox/js/jquery.js +32 -0
  58. data/lib/generators/redde/layout/templates/assets/images/admin/lightbox/js/jquery.lightbox-0.5.js +477 -0
  59. data/lib/generators/redde/layout/templates/assets/images/admin/lightbox/js/jquery.lightbox-0.5.min.js +42 -0
  60. data/lib/generators/redde/layout/templates/assets/images/admin/lightbox/js/jquery.lightbox-0.5.pack.js +14 -0
  61. data/lib/generators/redde/layout/templates/assets/images/admin/logo.png +0 -0
  62. data/lib/generators/redde/layout/templates/assets/images/admin/logo_reddeshop.png +0 -0
  63. data/lib/generators/redde/layout/templates/assets/images/admin/move_handler.png +0 -0
  64. data/lib/generators/redde/layout/templates/assets/images/admin/phone.png +0 -0
  65. data/lib/generators/redde/layout/templates/assets/images/admin/photo_ico.png +0 -0
  66. data/lib/generators/redde/layout/templates/assets/images/admin/print.png +0 -0
  67. data/lib/generators/redde/layout/templates/assets/images/admin/redactor/css/docstyle.css +123 -0
  68. data/lib/generators/redde/layout/templates/assets/images/admin/redactor/css/redactor.css +369 -0
  69. data/lib/generators/redde/layout/templates/assets/images/admin/redactor/css/style.css +119 -0
  70. data/lib/generators/redde/layout/templates/assets/images/admin/redactor/css/wym.css +136 -0
  71. data/lib/generators/redde/layout/templates/assets/images/admin/redactor/img/icons.png +0 -0
  72. data/lib/generators/redde/layout/templates/assets/images/admin/redactor/langs/by.js +72 -0
  73. data/lib/generators/redde/layout/templates/assets/images/admin/redactor/langs/de.js +75 -0
  74. data/lib/generators/redde/layout/templates/assets/images/admin/redactor/langs/en.js +76 -0
  75. data/lib/generators/redde/layout/templates/assets/images/admin/redactor/langs/es.js +76 -0
  76. data/lib/generators/redde/layout/templates/assets/images/admin/redactor/langs/fr.js +74 -0
  77. data/lib/generators/redde/layout/templates/assets/images/admin/redactor/langs/hu.js +76 -0
  78. data/lib/generators/redde/layout/templates/assets/images/admin/redactor/langs/it.js +76 -0
  79. data/lib/generators/redde/layout/templates/assets/images/admin/redactor/langs/ja.js +76 -0
  80. data/lib/generators/redde/layout/templates/assets/images/admin/redactor/langs/lv.js +74 -0
  81. data/lib/generators/redde/layout/templates/assets/images/admin/redactor/langs/nl.js +76 -0
  82. data/lib/generators/redde/layout/templates/assets/images/admin/redactor/langs/pl.js +75 -0
  83. data/lib/generators/redde/layout/templates/assets/images/admin/redactor/langs/pt_br.js +81 -0
  84. data/lib/generators/redde/layout/templates/assets/images/admin/redactor/langs/ru.js +75 -0
  85. data/lib/generators/redde/layout/templates/assets/images/admin/redactor/langs/sq.js +76 -0
  86. data/lib/generators/redde/layout/templates/assets/images/admin/redactor/langs/tr.js +76 -0
  87. data/lib/generators/redde/layout/templates/assets/images/admin/redactor/langs/ua.js +75 -0
  88. data/lib/generators/redde/layout/templates/assets/images/admin/redactor/langs/zh_cn.js +77 -0
  89. data/lib/generators/redde/layout/templates/assets/images/admin/redactor/plugins/file.html +3 -0
  90. data/lib/generators/redde/layout/templates/assets/images/admin/redactor/plugins/image.html +39 -0
  91. data/lib/generators/redde/layout/templates/assets/images/admin/redactor/plugins/image_edit.html +35 -0
  92. data/lib/generators/redde/layout/templates/assets/images/admin/redactor/plugins/link.html +74 -0
  93. data/lib/generators/redde/layout/templates/assets/images/admin/redactor/plugins/table.html +25 -0
  94. data/lib/generators/redde/layout/templates/assets/images/admin/redactor/plugins/video.html +15 -0
  95. data/lib/generators/redde/layout/templates/assets/images/admin/redactor/redactor.js.erb +2260 -0
  96. data/lib/generators/redde/layout/templates/assets/images/admin/redactor/redactor.min.js +1 -0
  97. data/lib/generators/redde/layout/templates/assets/images/admin/redactor/toolbars/default.js +219 -0
  98. data/lib/generators/redde/layout/templates/assets/images/admin/redactor/toolbars/mini.js +103 -0
  99. data/lib/generators/redde/layout/templates/assets/images/admin/reddebox/_jquery.reddebox.js.erb +214 -0
  100. data/lib/generators/redde/layout/templates/assets/images/admin/reddebox/close.png +0 -0
  101. data/lib/generators/redde/layout/templates/assets/images/admin/reddebox/jquery.reddebox.js.erb +246 -0
  102. data/lib/generators/redde/layout/templates/assets/images/admin/reddebox/jquery.reddebox.scss +31 -0
  103. data/lib/generators/redde/layout/templates/assets/images/admin/reddebox/next.png +0 -0
  104. data/lib/generators/redde/layout/templates/assets/images/admin/reddebox/prev.png +0 -0
  105. data/lib/generators/redde/layout/templates/assets/images/admin/refresh.png +0 -0
  106. data/lib/generators/redde/layout/templates/assets/images/admin/submit.png +0 -0
  107. data/lib/generators/redde/layout/templates/assets/images/admin/submit_hover.png +0 -0
  108. data/lib/generators/redde/layout/templates/assets/images/admin/uploadifive/change-log.txt +19 -0
  109. data/lib/generators/redde/layout/templates/assets/images/admin/uploadifive/check-exists.php +15 -0
  110. data/lib/generators/redde/layout/templates/assets/images/admin/uploadifive/index.php +50 -0
  111. data/lib/generators/redde/layout/templates/assets/images/admin/uploadifive/jquery.uploadifive.js +888 -0
  112. data/lib/generators/redde/layout/templates/assets/images/admin/uploadifive/jquery.uploadifive.min.js +6 -0
  113. data/lib/generators/redde/layout/templates/assets/images/admin/uploadifive/license-standard.txt +71 -0
  114. data/lib/generators/redde/layout/templates/assets/images/admin/uploadifive/uploadifive-cancel.png +0 -0
  115. data/lib/generators/redde/layout/templates/assets/images/admin/uploadifive/uploadifive-image-only.php +66 -0
  116. data/lib/generators/redde/layout/templates/assets/images/admin/uploadifive/uploadifive.css +100 -0
  117. data/lib/generators/redde/layout/templates/assets/images/admin/uploadifive/uploadifive.php +33 -0
  118. data/lib/generators/redde/layout/templates/assets/images/admin/uploadify/#swfobject.js +4 -0
  119. data/lib/generators/redde/layout/templates/assets/images/admin/uploadify/cancel.png +0 -0
  120. data/lib/generators/redde/layout/templates/assets/images/admin/uploadify/jquery.uploadify.min.js +315 -0
  121. data/lib/generators/redde/layout/templates/assets/images/admin/uploadify/uploadify-cancel.png +0 -0
  122. data/lib/generators/redde/layout/templates/assets/images/admin/uploadify/uploadify.css +66 -0
  123. data/lib/generators/redde/layout/templates/assets/images/admin/uploadify/uploadify.swf +0 -0
  124. data/lib/generators/redde/layout/templates/assets/images/admin/view.png +0 -0
  125. data/lib/generators/redde/layout/templates/assets/images/admin/view_mk.png +0 -0
  126. data/lib/generators/redde/layout/templates/assets/javascripts/admin/jquery.ui.nestedSortable.js +390 -0
  127. data/lib/generators/redde/layout/templates/assets/javascripts/admin/swfobject.js +4 -0
  128. data/lib/generators/redde/layout/templates/assets/javascripts/admin/zen_textarea.min.js +17 -0
  129. data/lib/generators/redde/layout/templates/assets/javascripts/admin.js +88 -0
  130. data/lib/generators/redde/layout/templates/assets/stylesheets/admin/_reset.scss +32 -0
  131. data/lib/generators/redde/layout/templates/assets/stylesheets/admin/blocks/_list.scss +22 -0
  132. data/lib/generators/redde/layout/templates/assets/stylesheets/admin/blocks/_notice.scss +39 -0
  133. data/lib/generators/redde/layout/templates/assets/stylesheets/admin/blocks/_orders.scss +22 -0
  134. data/lib/generators/redde/layout/templates/assets/stylesheets/admin/blocks/_partners.scss +15 -0
  135. data/lib/generators/redde/layout/templates/assets/stylesheets/admin/blocks/_photos.scss +31 -0
  136. data/lib/generators/redde/layout/templates/assets/stylesheets/admin/blocks/_sortable.scss +17 -0
  137. data/lib/generators/redde/layout/templates/assets/stylesheets/admin/default.scss +127 -0
  138. data/lib/generators/redde/layout/templates/assets/stylesheets/admin/defaults/_input.scss +43 -0
  139. data/lib/generators/redde/layout/templates/assets/stylesheets/admin/defaults/_table.scss +24 -0
  140. data/lib/generators/redde/layout/templates/assets/stylesheets/admin/layouts/_header.scss +57 -0
  141. data/lib/generators/redde/layout/templates/assets/stylesheets/admin/layouts/_launchbar.scss +35 -0
  142. data/lib/generators/redde/layout/templates/assets/stylesheets/admin/layouts/_login.scss +10 -0
  143. data/lib/generators/redde/layout/templates/assets/stylesheets/admin/layouts/_main.scss +59 -0
  144. data/lib/generators/redde/layout/templates/assets/stylesheets/admin/layouts/_sidebar.scss +35 -0
  145. data/lib/generators/redde/layout/templates/assets/stylesheets/admin/shop/_filter.scss +16 -0
  146. data/lib/generators/redde/layout/templates/assets/stylesheets/admin/shop/_order-sh.scss +59 -0
  147. data/lib/generators/redde/layout/templates/assets/stylesheets/admin/shop/_pe.scss +43 -0
  148. data/lib/generators/redde/layout/templates/assets/stylesheets/admin.scss +12 -0
  149. data/lib/generators/redde/layout/templates/controllers/base_controller.rb +6 -0
  150. data/lib/generators/redde/layout/templates/helpers/admin_helper.rb +37 -0
  151. data/lib/generators/redde/layout/templates/layouts/admin.html.haml +30 -0
  152. data/lib/generators/redde/layout/templates/layouts/login.html.haml +32 -0
  153. data/lib/generators/redde/layout/templates/shared/_header.html.haml +13 -0
  154. data/lib/generators/redde/layout/templates/shared/_launchbar.html.haml +9 -0
  155. data/lib/generators/redde/layout/templates/shared/_sidebar.html.haml +23 -0
  156. data/lib/generators/redde/scaffold/scaffold_generator.rb +114 -0
  157. data/lib/generators/redde/scaffold/templates/controllers/controller.rb +55 -0
  158. data/lib/generators/redde/scaffold/templates/edit.html.haml +36 -0
  159. data/lib/generators/redde/scaffold/templates/index.html.haml +37 -0
  160. data/lib/redde/version.rb +3 -0
  161. data/lib/redde.rb +4 -0
  162. data/redde.gemspec +26 -0
  163. data/spec/deploy_generator_spec.rb +29 -0
  164. data/spec/layout_generator_spec.rb +41 -0
  165. data/spec/scaffold_generator_spec.rb +25 -0
  166. data/spec/spec_helper.rb +10 -0
  167. metadata +327 -0
@@ -0,0 +1,6 @@
1
+ /*
2
+ UploadiFive 1.0.4
3
+ Copyright (c) 2012 Reactive Apps, Ronnie Garcia
4
+ Released under the UploadiFive Standard License <http://www.uploadify.com/uploadifive-standard-license>
5
+ */
6
+ ;(function(b){var a={init:function(c){return this.each(function(){var g=b(this);g.data("uploadifive",{inputs:{},inputCount:0,fileID:0,queue:{count:0,selected:0,replaced:0,errors:0,queued:0,cancelled:0},uploads:{current:0,attempts:0,successful:0,errors:0,count:0}});var d=g.data("uploadifive");var f=d.settings=b.extend({auto:true,buttonClass:false,buttonText:"Select Files",checkScript:false,dnd:true,dropTarget:false,fileSizeLimit:0,fileType:false,formData:{},height:30,method:"post",multi:true,overrideEvents:[],queueID:false,queueSizeLimit:0,removeCompleted:false,simUploadLimit:0,truncateLength:0,uploadLimit:0,uploadScript:"uploadifive.php",width:100,},c);if(isNaN(f.fileSizeLimit)){var e=parseInt(f.fileSizeLimit)*1.024;if(f.fileSizeLimit.indexOf("KB")>-1){f.fileSizeLimit=e*1000;}else{if(f.fileSizeLimit.indexOf("MB")>-1){f.fileSizeLimit=e*1000000;}else{if(f.fileSizeLimit.indexOf("GB")>-1){f.fileSizeLimit=e*1000000000;}}}}else{f.fileSizeLimit=f.fileSizeLimit*1024;}d.inputTemplate=b('<input type="file">').css({opacity:0,position:"absolute","z-index":999});d.createInput=function(){var j=d.inputTemplate.clone();var k=j.name="input"+d.inputCount++;if(f.multi){j.attr("multiple",true);}j.bind("change",function(){d.queue.selected=0;d.queue.replaced=0;d.queue.errors=0;d.queue.queued=0;var l=this.files.length;d.queue.selected=l;if((d.queue.count+l)>f.queueSizeLimit&&f.queueSizeLimit!==0){if(b.inArray("onError",f.overrideEvents)<0){alert("The maximum number of queue items has been reached ("+f.queueSizeLimit+"). Please select fewer files.");}if(typeof f.onError==="function"){f.onError.call(g,"QUEUE_LIMIT_EXCEEDED");}}else{for(var m=0;m<l;m++){file=this.files[m];d.addQueueItem(file);}d.inputs[k]=this;d.createInput();}if(f.auto){a.upload.call(g);}if(typeof f.onSelect==="function"){f.onSelect.apply(g,d.queue);}});if(d.currentInput){d.currentInput.hide();}d.button.append(j);d.currentInput=j;};d.destroyInput=function(j){b(d.inputs[j]).remove();delete d.inputs[j];d.inputCount--;};d.drop=function(m){d.queue.selected=0;d.queue.replaced=0;d.queue.errors=0;d.queue.queued=0;var l=m.dataTransfer;var k=l.name="input"+d.inputCount++;var j=l.files.length;d.queue.selected=j;if((d.queue.count+j)>f.queueSizeLimit&&f.queueSizeLimit!==0){if(b.inArray("onError",f.overrideEvents)<0){alert("The maximum number of queue items has been reached ("+f.queueSizeLimit+"). Please select fewer files.");}if(typeof f.onError==="function"){f.onError.call(g,"QUEUE_LIMIT_EXCEEDED");}}else{for(var o=0;o<j;o++){file=l.files[o];d.addQueueItem(file);}d.inputs[k]=l;}if(f.auto){a.upload.call(g);}if(typeof f.onDrop==="function"){f.onDrop.call(g,l.files,l.files.length);}m.preventDefault();m.stopPropagation();};d.fileExistsInQueue=function(k){for(var j in d.inputs){input=d.inputs[j];limit=input.files.length;for(var l=0;l<limit;l++){existingFile=input.files[l];if(existingFile.name==k.name&&!existingFile.complete){return true;}}}return false;};d.removeExistingFile=function(k){for(var j in d.inputs){input=d.inputs[j];limit=input.files.length;for(var l=0;l<limit;l++){existingFile=input.files[l];if(existingFile.name==k.name&&!existingFile.complete){d.queue.replaced++;a.cancel.call(g,existingFile,true);}}}};d.queueItem=b('<div class="uploadifive-queue-item"> <a class="close" href="#">X</a> <div><span class="filename"></span><span class="fileinfo"></span></div> <div class="progress"> <div class="progress-bar"></div> </div> </div>');d.addQueueItem=function(k){if(b.inArray("onAddQueueItem",f.overrideEvents)<0){d.removeExistingFile(k);k.queueItem=d.queueItem.clone();k.queueItem.attr("id",f.id+"-file-"+d.fileID++);k.queueItem.find(".close").bind("click",function(){a.cancel.call(g,k);return false;});var m=k.name;if(m.length>f.truncateLength&&f.truncateLength!=0){m=m.substring(0,f.truncateLength)+"...";}k.queueItem.find(".filename").html(m);k.queueItem.data("file",k);d.queueEl.append(k.queueItem);}if(typeof f.onAddQueueItem==="function"){f.onAddQueueItem.call(g,k);}if(f.fileType){if(b.isArray(f.fileType)){var j=false;for(var l=0;l<f.fileType.length;l++){if(k.type.indexOf(f.fileType[l])>-1){j=true;}}if(!j){d.error("FORBIDDEN_FILE_TYPE",k);}}else{if(k.type.indexOf(f.fileType)<0){d.error("FORBIDDEN_FILE_TYPE",k);}}}if(k.size>f.fileSizeLimit&&f.fileSizeLimit!=0){d.error("FILE_SIZE_LIMIT_EXCEEDED",k);}else{d.queue.queued++;d.queue.count++;}};d.removeQueueItem=function(m,l,k){if(!k){k=0;}var j=l?0:500;if(m.queueItem){if(m.queueItem.find(".fileinfo").html()!=" - Completed"){m.queueItem.find(".fileinfo").html(" - Cancelled");}m.queueItem.find(".progress-bar").width(0);m.queueItem.delay(k).fadeOut(j,function(){b(this).remove();});delete m.queueItem;d.queue.count--;}};d.filesToUpload=function(){var k=0;for(var j in d.inputs){input=d.inputs[j];limit=input.files.length;for(var l=0;l<limit;l++){file=input.files[l];if(!file.skip&&!file.complete){k++;}}}return k;};d.checkExists=function(k){if(b.inArray("onCheck",f.overrideEvents)<0){b.ajaxSetup({async:false});var j=b.extend(f.formData,{filename:k.name});b.post(f.checkScript,j,function(l){k.exists=parseInt(l);});if(k.exists){if(!confirm("A file named "+k.name+" already exists in the upload folder.\nWould you like to replace it?")){a.cancel.call(g,k);return true;}}}if(typeof f.onCheck==="function"){f.onCheck.call(g,k,k.exists);}return false;};d.uploadFile=function(k,l){if(!k.skip&&!k.complete&&!k.uploading){k.uploading=true;d.uploads.current++;d.uploads.attempted++;xhr=k.xhr=new XMLHttpRequest();if(typeof FormData==="function"||typeof FormData==="object"){var m=new FormData();m.append("Filedata",k);for(i in f.formData){m.append(i,f.formData[i]);}xhr.open(f.method,f.uploadScript,true);xhr.upload.addEventListener("progress",function(n){if(n.lengthComputable){d.progress(n,k);}},false);xhr.addEventListener("load",function(n){if(this.readyState==4){k.uploading=false;if(this.status==200){if(k.xhr.responseText!=="Invalid file type."){d.uploadComplete(n,k,l);}else{d.error(k.xhr.responseText,k,l);}}else{if(this.status==404){d.error("404_FILE_NOT_FOUND",k,l);}else{if(this.status==403){d.error("403_FORBIDDEN",k,uplaodAll);}else{d.error("Unknown Error",k,l);}}}}});xhr.send(m);}else{var j=new FileReader();j.onload=function(q){var t="-------------------------"+(new Date).getTime(),p="--",o="\r\n",s="";s+=p+t+o;s+='Content-Disposition: form-data; name="Filedata"';if(k.name){s+='; filename="'+k.name+'"';}s+=o;s+="Content-Type: application/octet-stream"+o+o;s+=q.target.result+o;for(key in f.formData){s+=p+t+o;s+='Content-Disposition: form-data; name="'+key+'"'+o+o;s+=f.formData[key]+o;}s+=p+t+p+o;xhr.upload.addEventListener("progress",function(u){d.progress(u,k);},false);xhr.addEventListener("load",function(v){k.uploading=false;var u=this.status;if(u==404){d.error("404_FILE_NOT_FOUND",k,l);}else{if(k.xhr.responseText!="Invalid file type."){d.uploadComplete(v,k,l);}else{d.error(k.xhr.responseText,k,l);}}},false);var n=f.uploadScript;if(f.method=="get"){var r=b(f.formData).param();n+=r;}xhr.open(f.method,f.uploadScript,true);xhr.setRequestHeader("Content-Type","multipart/form-data; boundary="+t);if(typeof f.onUploadFile==="function"){f.onUploadFile.call(g,k);}xhr.sendAsBinary(s);};j.readAsBinaryString(k);}}};d.progress=function(l,j){if(b.inArray("onProgress",f.overrideEvents)<0){if(l.lengthComputable){var k=Math.round((l.loaded/l.total)*100);}j.queueItem.find(".fileinfo").html(" - "+k+"%");j.queueItem.find(".progress-bar").css("width",k+"%");}if(typeof f.onProgress==="function"){f.onProgress.call(g,j,l);}};d.error=function(l,j,k){if(b.inArray("onError",f.overrideEvents)<0){switch(l){case"404_FILE_NOT_FOUND":errorMsg="404 Error";break;case"403_FORBIDDEN":errorMsg="403 Forbidden";break;case"FORBIDDEN_FILE_TYPE":errorMsg="Forbidden File Type";break;case"FILE_SIZE_LIMIT_EXCEEDED":errorMsg="File Too Large";break;default:errorMsg="Unknown Error";break;}j.queueItem.addClass("error").find(".fileinfo").html(" - "+errorMsg);j.queueItem.find(".progress").remove();}if(typeof f.onError==="function"){f.onError.call(g,l,j);}j.skip=true;if(l=="404_FILE_NOT_FOUND"){d.uploads.errors++;}else{d.queue.errors++;}if(k){a.upload.call(g,null,true);}};d.uploadComplete=function(l,j,k){if(b.inArray("onUploadComplete",f.overrideEvents)<0){j.queueItem.find(".progress-bar").css("width","100%");j.queueItem.find(".fileinfo").html(" - Completed");j.queueItem.find(".progress").slideUp(250);j.queueItem.addClass("complete");}if(typeof f.onUploadComplete==="function"){f.onUploadComplete.call(g,j,j.xhr.responseText);}if(f.removeCompleted){setTimeout(function(){a.cancel.call(g,j);},3000);}j.complete=true;d.uploads.successful++;d.uploads.count++;d.uploads.current--;delete j.xhr;if(k){a.upload.call(g,null,true);}};d.queueComplete=function(){if(typeof f.onQueueComplete==="function"){f.onQueueComplete.call(g,d.uploads);}};if(window.File&&window.FileList&&window.Blob&&(window.FileReader||window.FormData)){f.id="uploadifive-"+g.attr("id");d.button=b('<div id="'+f.id+'" class="uploadifive-button">'+f.buttonText+"</div>");if(f.buttonClass){d.button.addClass(f.buttonClass);}d.button.css({height:f.height,"line-height":f.height+"px",overflow:"hidden",position:"relative","text-align":"center",width:f.width});g.before(d.button).appendTo(d.button).hide();d.createInput.call(g);d.button.mousemove(function(j){var k=d.button.offset();d.currentInput.css({left:j.pageX-k.left-g.width()+10,top:j.pageY-k.top-g.height()+10});});if(!f.queueID){f.queueID=f.id+"-queue";d.queueEl=b('<div id="'+f.queueID+'" class="uploadifive-queue" />');d.button.after(d.queueEl);}else{d.queueEl=b("#"+f.queueID);}if(f.dnd){var h=f.dropTarget?b(f.dropTarget):d.queueEl.get(0);h.addEventListener("dragleave",function(j){j.preventDefault();j.stopPropagation();},false);h.addEventListener("dragenter",function(j){j.preventDefault();j.stopPropagation();},false);h.addEventListener("dragover",function(j){j.preventDefault();j.stopPropagation();},false);h.addEventListener("drop",d.drop,false);}if(!XMLHttpRequest.prototype.sendAsBinary){XMLHttpRequest.prototype.sendAsBinary=function(k){function l(n){return n.charCodeAt(0)&255;}var m=Array.prototype.map.call(k,l);var j=new Uint8Array(m);this.send(j.buffer);};}if(typeof f.onInit==="function"){f.onInit.call(g);}}else{if(typeof f.onFallback==="function"){f.onFallback.call(g);}return false;}});},debug:function(){return this.each(function(){console.log(b(this).data("uploadifive"));});},clearQueue:function(){this.each(function(){var f=b(this),c=f.data("uploadifive"),e=c.settings;for(var d in c.inputs){input=c.inputs[d];limit=input.files.length;for(i=0;i<limit;i++){file=input.files[i];a.cancel.call(f,file);}}if(typeof e.onClearQueue==="function"){e.onClearQueue.call(f,b("#"+c.options.queueID));}});},cancel:function(d,c){this.each(function(){var g=b(this),e=g.data("uploadifive"),f=e.settings;if(typeof d==="string"){if(!isNaN(d)){fileID="uploadifive-"+b(this).attr("id")+"-file-"+d;}d=b("#"+fileID).data("file");}d.skip=true;e.filesCancelled++;if(d.uploading){e.uploads.current--;d.uploading=false;d.xhr.abort();delete d.xhr;a.upload.call(g);}if(b.inArray("onCancel",f.overrideEvents)<0){e.removeQueueItem(d,c);}if(typeof f.onCancel==="function"){f.onCancel.call(g,d);}});},upload:function(c,d){this.each(function(){var h=b(this),e=h.data("uploadifive"),f=e.settings;if(c){e.uploadFile.call(h,c);}else{if((e.uploads.count+e.uploads.current)<f.uploadLimit||f.uploadLimit==0){if(!d){e.uploads.attempted=0;e.uploads.successsful=0;e.uploads.errors=0;var g=e.filesToUpload();if(typeof f.onUpload==="function"){f.onUpload.call(h,g);}}b("#"+f.queueID).find(".uploadifive-queue-item").not(".error, .complete").each(function(){_file=b(this).data("file");if((e.uploads.current>=f.simUploadLimit&&f.simUploadLimit!==0)||(e.uploads.current>=f.uploadLimit&&f.uploadLimit!==0)||(e.uploads.count>=f.uploadLimit&&f.uploadLimit!==0)){return false;}if(f.checkScript){_file.checking=true;skipFile=e.checkExists(_file);_file.checking=false;if(!skipFile){e.uploadFile(_file,true);}}else{e.uploadFile(_file,true);}});if(b("#"+f.queueID).find(".uploadifive-queue-item").not(".error, .complete").size()==0){e.queueComplete();}}else{if(e.uploads.current==0){if(b.inArray("onError",f.overrideEvents)<0){if(e.filesToUpload()>0&&f.uploadLimit!=0){alert("The maximum upload limit has been reached.");}}if(typeof f.onError==="function"){f.onError.call(h,"UPLOAD_LIMIT_EXCEEDED",e.filesToUpload());}}}}});},destroy:function(){this.each(function(){var e=b(this),c=e.data("uploadifive"),d=c.settings;a.clearQueue.call(e);if(!d.queueID){b("#"+d.queueID).remove();}e.siblings("input").remove();e.show().insertBefore(c.button);c.button.remove();if(typeof d.onDestroy==="function"){d.onDestroy.call(e);}});}};b.fn.uploadifive=function(c){if(a[c]){return a[c].apply(this,Array.prototype.slice.call(arguments,1));}else{if(typeof c==="object"||!c){return a.init.apply(this,arguments);}else{b.error("The method "+c+" does not exist in $.uploadify");}}};})(jQuery);
@@ -0,0 +1,71 @@
1
+ UploadiFive Standard License
2
+ UploadiFive (c) 2012 Reactive Apps, Ronnie Garcia
3
+ <http://www.uploadify.com/uploadifive-standard-license>
4
+
5
+ Last Updated April 23, 2012
6
+
7
+ Preamble
8
+
9
+ This License governs Your use of the Work. This License is intended to allow developers to use the Source Code provided as part of the Work in any non-commercial application.
10
+
11
+ The main points subject to the terms of the License are:
12
+ • Source Code cannot be used in commercial applications;
13
+ • Source Code cannot be redistributed; and
14
+ • Source Code can be modified to create derivative works.
15
+ • No claim of suitability, guarantee, or any warranty whatsoever is provided. The software is provided "as-is".
16
+ • The Article(s) accompanying the Work may not be distributed or republished without the Author's consent
17
+
18
+ This License is entered between You, the individual or other entity reading or otherwise making use of the Work licensed pursuant to this License and the individual or other entity which offers the Work under the terms of this License ("Author").
19
+
20
+ License
21
+
22
+ THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS LICENSE ("LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.
23
+ BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HEREIN, YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. THE AUTHOR GRANTS YOU THE RIGHTS CONTAINED HEREIN IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS. IF YOU DO NOT AGREE TO ACCEPT AND BE BOUND BY THE TERMS OF THIS LICENSE, YOU CANNOT MAKE ANY USE OF THE WORK.
24
+
25
+ 1. Definitions.
26
+ a. "Articles" means, collectively, all articles written by Author which describes how the Source Code for the Work may be used by a user.
27
+ b. "Author" means the individual or entity that offers the Work under the terms of this License.
28
+ c. "Derivative Work" means a work based upon the Work or upon the Work and other pre-existing works.
29
+ d. "Publisher" means the provider of the website by which the Work is obtained by You (Reactive Apps).
30
+ e. "Source Code" refers to the collection of source code and configuration files used to create the software.
31
+ f. "Standard Version" refers to such a Work if it has not been modified, or has been modified in accordance with the consent of the Author, such consent being in the full discretion of the Author.
32
+ g. "Work" refers to the collection of files distributed by the Publisher, including the Source Code, Executable Files, binaries, data files, documentation, whitepapers and the Articles.
33
+ h. "You" is you, an individual or entity wishing to use the Work and exercise your rights under this License.
34
+
35
+ 2. Fair Use/Fair Use Rights. Nothing in this License is intended to reduce, limit, or restrict any rights arising from fair use, fair dealing, first sale or other limitations on the exclusive rights of the copyright owner under copyright law or other applicable laws.
36
+
37
+ 3. License Grant. Subject to the terms and conditions of this License, the Author hereby grants You a worldwide, royalty-free, non-exclusive, perpetual (for the duration of the applicable copyright) license to exercise the rights in the Work as stated below:
38
+ a. You may use the standard version of the Source Code in Your own non-commercial applications.
39
+ b. You may apply bug fixes, portability fixes and other modifications obtained from the Public Domain or from the Author. A Work modified in such a way shall still be considered the standard version and will be subject to this License.
40
+ c. You may otherwise modify Your copy of this Work (excluding the Articles) in any way to create a Derivative Work, provided that You insert a prominent notice in each changed file stating how, when and where You changed that file.
41
+ d. You may use the standard version or any derivative version of the Source Code in any software that is provided as a free service on your website so long as the standard version or any derivative version of the Source Code is not made available for download in any way other that those methods allowed by the Author.
42
+ e. The Articles discussing the Work published in any form by the author may not be distributed or republished without the Author's consent. The author retains copyright to any such Articles. You may use the Source Code pursuant to this License but you may not repost or republish or otherwise distribute or make available the Articles, without the prior written consent of the Author.
43
+
44
+ Any add-ons or modules supplied by You and linked into the Source Code of this Work shall not be considered part of this Work and will not be subject to the terms of this License.
45
+
46
+ 4. Restrictions. The license granted in Section 3 above is expressly made subject to and limited by the following restrictions:
47
+ a. You agree not to remove any of the original copyright, patent, trademark, and attribution notices and associated disclaimers that may appear in the Source Code.
48
+ b. You may not distribute the standard version of the Source Code or Derivative Work in aggregate with other (possibly commercial) programs as part of a larger (possibly commercial) software distribution.
49
+ c. You agree not to advertise or in any way imply that this Work is a product of Your own.
50
+ d. The name of the Author may not be used to endorse or promote products derived from the Work without the prior written consent of the Author.
51
+ e. You agree not to sell, lease, or rent any part of the Work. The Work by itself cannot be sold, leased or rented.
52
+ f. You agree not to use the Work for illegal, immoral or improper purposes, or on pages containing illegal, immoral or improper material. The Work is subject to applicable export laws. You agree to comply with all such laws and regulations that may apply to the Work after Your receipt of the Work.
53
+
54
+ 5. Representations, Warranties and Disclaimer. THIS WORK IS PROVIDED "AS IS", "WHERE IS" AND "AS AVAILABLE", WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES OR CONDITIONS OR GUARANTEES. YOU, THE USER, ASSUME ALL RISK IN ITS USE, INCLUDING COPYRIGHT INFRINGEMENT, PATENT INFRINGEMENT, SUITABILITY, ETC. AUTHOR EXPRESSLY DISCLAIMS ALL EXPRESS, IMPLIED OR STATUTORY WARRANTIES OR CONDITIONS, INCLUDING WITHOUT LIMITATION, WARRANTIES OR CONDITIONS OF MERCHANTABILITY, MERCHANTABLE QUALITY OR FITNESS FOR A PARTICULAR PURPOSE, OR ANY WARRANTY OF TITLE OR NON-INFRINGEMENT, OR THAT THE WORK (OR ANY PORTION THEREOF) IS CORRECT, USEFUL, BUG-FREE OR FREE OF VIRUSES. YOU MUST PASS THIS DISCLAIMER ON WHENEVER YOU DISTRIBUTE THE WORK OR DERIVATIVE WORKS.
55
+
56
+ 6. Indemnity. You agree to defend, indemnify and hold harmless the Author and the Publisher from and against any claims, suits, losses, damages, liabilities, costs, and expenses (including reasonable legal or attorneys’ fees) resulting from or relating to any use of the Work by You.
57
+
58
+ 7. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, IN NO EVENT WILL THE AUTHOR OR THE PUBLISHER BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK OR OTHERWISE, EVEN IF THE AUTHOR OR THE PUBLISHER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
59
+
60
+ 8. Termination.
61
+ a. This License and the rights granted hereunder will terminate automatically upon any breach by You of any term of this License. Individuals or entities who have received Derivative Works from You under this License, however, will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses. Sections 1, 2, 5, 6, 7, 8, 9 and 10 will survive any termination of this License.
62
+ b. If You bring a copyright, trademark, patent or any other infringement claim against any contributor over infringements You claim are made by the Work, your License from such contributor to the Work ends automatically.
63
+ c. Subject to the above terms and conditions, this License is perpetual (for the duration of the applicable copyright in the Work). Notwithstanding the above, the Author reserves the right to release the Work under different license terms or to stop distributing the Work at any time; provided, however that any such election will not serve to withdraw this License (or any other license that has been, or is required to be, granted under the terms of this License), and this License will continue in full force and effect unless terminated as stated above.
64
+
65
+ 9. Publisher. The parties hereby confirm that the Publisher shall not, under any circumstances, be responsible for and shall not have any liability in respect of the subject matter of this License. The Publisher makes no warranty whatsoever in connection with the Work and shall not be liable to You or any party on any legal theory for any damages whatsoever, including without limitation any general, special, incidental or consequential damages arising in connection to this license. The Publisher reserves the right to cease making the Work available to You at any time without notice.
66
+
67
+ 10. Miscellaneous
68
+ a. This License shall be governed by the laws of the location of the head office of the Author or if the Author is an individual, the laws of location of the principal place of residence of the Author.
69
+ b. If any provision of this License is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this License, and without further action by the parties to this License, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
70
+ c. No term or provision of this License shall be deemed waived and no breach consented to unless such waiver or consent shall be in writing and signed by the party to be charged with such waiver or consent.
71
+ d. This License constitutes the entire agreement between the parties with respect to the Work licensed herein. There are no understandings, agreements or representations with respect to the Work not specified herein. The Author shall not be bound by any additional provisions that may appear in any communication from You. This License may not be modified without the mutual written agreement of the Author and You.
@@ -0,0 +1,66 @@
1
+ <?php
2
+ /*
3
+ UploadiFive
4
+ Copyright (c) 2012 Reactive Apps, Ronnie Garcia
5
+ */
6
+
7
+ /*
8
+ IMPORTANT: This script requires the PHP GD library
9
+ */
10
+
11
+ // Set the uplaod directory
12
+ $uploadDir = '/uploads/';
13
+
14
+ function errorHandler($errno, $errstr, $errfile, $errline) {
15
+ // In this script, the silently suppress any error generated by getimagesize
16
+ // which will throw an error if the "image" isn't an image
17
+ // ie doesn't have a valid width / height
18
+
19
+ /* Don't execute PHP internal error handler */
20
+ return true;
21
+ }
22
+
23
+ $old_error_handler = set_error_handler("errorHandler");
24
+
25
+ // Check if the file has a width and height
26
+ function isImage($tempFile) {
27
+
28
+ // Get the size of the image
29
+ $size = getimagesize($tempFile);
30
+
31
+ if (isset($size) && $size[0] && $size[1] && $size[0] * $size[1] > 0) {
32
+ return true;
33
+ } else {
34
+ return false;
35
+ }
36
+
37
+ }
38
+
39
+ if (!empty($_FILES)) {
40
+
41
+ $fileData = $_FILES['Filedata'];
42
+
43
+ if ($fileData) {
44
+ $tempFile = $fileData['tmp_name'];
45
+ $uploadDir = $_SERVER['DOCUMENT_ROOT'] . $uploadDir;
46
+ $targetFile = $uploadDir . $fileData['name'];
47
+
48
+ // Validate the file type
49
+ $fileTypes = array('jpg', 'jpeg', 'gif', 'png'); // Allowed file extensions
50
+ $fileParts = pathinfo($fileData['name']);
51
+
52
+ // Validate the filetype
53
+ if (in_array(strtolower($fileParts['extension']), $fileTypes) && filesize($tempFile) > 0 && isImage($tempFile)) {
54
+
55
+ // Save the file
56
+ move_uploaded_file($tempFile, $targetFile);
57
+ echo 1;
58
+
59
+ } else {
60
+
61
+ // The file type wasn't allowed
62
+ echo 'Invalid file type.';
63
+ }
64
+ }
65
+ }
66
+ ?>
@@ -0,0 +1,100 @@
1
+ /*
2
+ UploadiFive
3
+ Copyright (c) 2012 Reactive Apps, Ronnie Garcia
4
+ */
5
+
6
+ .uploadifive-button {
7
+
8
+ float: left;
9
+
10
+ margin-right: 10px;
11
+
12
+ }
13
+
14
+ #queue {
15
+
16
+ border: 1px solid #E5E5E5;
17
+
18
+ min-height: 177px;
19
+
20
+ overflow: auto;
21
+
22
+ margin-bottom: 10px;
23
+
24
+ padding: 0 3px 3px;
25
+
26
+
27
+ }
28
+
29
+ .uploadifive-button {
30
+ background-color: #505050;
31
+ background-image: linear-gradient(bottom, #505050 0%, #707070 100%);
32
+ background-image: -o-linear-gradient(bottom, #505050 0%, #707070 100%);
33
+ background-image: -moz-linear-gradient(bottom, #505050 0%, #707070 100%);
34
+ background-image: -webkit-linear-gradient(bottom, #505050 0%, #707070 100%);
35
+ background-image: -ms-linear-gradient(bottom, #505050 0%, #707070 100%);
36
+ background-image: -webkit-gradient(
37
+ linear,
38
+ left bottom,
39
+ left top,
40
+ color-stop(0, #505050),
41
+ color-stop(1, #707070)
42
+ );
43
+ background-position: center top;
44
+ background-repeat: no-repeat;
45
+ -webkit-border-radius: 30px;
46
+ -moz-border-radius: 30px;
47
+ border-radius: 30px;
48
+ border: 2px solid #808080;
49
+ color: #FFF;
50
+ font: bold 12px Arial, Helvetica, sans-serif;
51
+ text-align: center;
52
+ text-shadow: 0 -1px 0 rgba(0,0,0,0.25);
53
+ text-transform: uppercase;
54
+ width: 100%;
55
+ }
56
+ .uploadifive-button:hover {
57
+ background-color: #606060;
58
+ background-image: linear-gradient(top, #606060 0%, #808080 100%);
59
+ background-image: -o-linear-gradient(top, #606060 0%, #808080 100%);
60
+ background-image: -moz-linear-gradient(top, #606060 0%, #808080 100%);
61
+ background-image: -webkit-linear-gradient(top, #606060 0%, #808080 100%);
62
+ background-image: -ms-linear-gradient(top, #606060 0%, #808080 100%);
63
+ background-image: -webkit-gradient(
64
+ linear,
65
+ left bottom,
66
+ left top,
67
+ color-stop(0, #606060),
68
+ color-stop(1, #808080)
69
+ );
70
+ background-position: center bottom;
71
+ }
72
+ .uploadifive-queue-item {
73
+ background-color: #F5F5F5;
74
+ border-bottom: 1px dotted #D5D5D5;
75
+ -webkit-border-radius: 5px;
76
+ -moz-border-radius: 5px;
77
+ border-radius: 5px;
78
+ font: 12px Arial, Helvetica, Sans-serif;
79
+ margin-top: 3px;
80
+ padding: 15px;
81
+ }
82
+ .uploadifive-queue-item .close {
83
+ background: url('uploadifive-cancel.png') 0 0 no-repeat;
84
+ display: block;
85
+ float: right;
86
+ height: 16px;
87
+ text-indent: -9999px;
88
+ width: 16px;
89
+ }
90
+ .uploadifive-queue-item .progress {
91
+ border: 1px solid #D0D0D0;
92
+ height: 3px;
93
+ margin-top: 5px;
94
+ width: 100%;
95
+ }
96
+ .uploadifive-queue-item .progress-bar {
97
+ background-color: #0072BC;
98
+ height: 3px;
99
+ width: 0;
100
+ }
@@ -0,0 +1,33 @@
1
+ <?php
2
+ /*
3
+ UploadiFive
4
+ Copyright (c) 2012 Reactive Apps, Ronnie Garcia
5
+ */
6
+
7
+ // Set the uplaod directory
8
+ $uploadDir = '/uploads/';
9
+
10
+ // Set the allowed file extensions
11
+ $fileTypes = array('jpg', 'jpeg', 'gif', 'png'); // Allowed file extensions
12
+
13
+ if (!empty($_FILES)) {
14
+ $tempFile = $_FILES['Filedata']['tmp_name'];
15
+ $uploadDir = $_SERVER['DOCUMENT_ROOT'] . $uploadDir;
16
+ $targetFile = $uploadDir . $_FILES['Filedata']['name'];
17
+
18
+ // Validate the filetype
19
+ $fileParts = pathinfo($_FILES['Filedata']['name']);
20
+ if (in_array(strtolower($fileParts['extension']), $fileTypes)) {
21
+
22
+ // Save the file
23
+ move_uploaded_file($tempFile,$targetFile);
24
+ echo 1;
25
+
26
+ } else {
27
+
28
+ // The file type wasn't allowed
29
+ echo 'Invalid file type.';
30
+
31
+ }
32
+ }
33
+ ?>
@@ -0,0 +1,4 @@
1
+ /* SWFObject v2.2 <http://code.google.com/p/swfobject/>
2
+ is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
3
+ */
4
+ var swfobject=function(){var D="undefined",r="object",S="Shockwave Flash",W="ShockwaveFlash.ShockwaveFlash",q="application/x-shockwave-flash",R="SWFObjectExprInst",x="onreadystatechange",O=window,j=document,t=navigator,T=false,U=[h],o=[],N=[],I=[],l,Q,E,B,J=false,a=false,n,G,m=true,M=function(){var aa=typeof j.getElementById!=D&&typeof j.getElementsByTagName!=D&&typeof j.createElement!=D,ah=t.userAgent.toLowerCase(),Y=t.platform.toLowerCase(),ae=Y?/win/.test(Y):/win/.test(ah),ac=Y?/mac/.test(Y):/mac/.test(ah),af=/webkit/.test(ah)?parseFloat(ah.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,X=!+"\v1",ag=[0,0,0],ab=null;if(typeof t.plugins!=D&&typeof t.plugins[S]==r){ab=t.plugins[S].description;if(ab&&!(typeof t.mimeTypes!=D&&t.mimeTypes[q]&&!t.mimeTypes[q].enabledPlugin)){T=true;X=false;ab=ab.replace(/^.*\s+(\S+\s+\S+$)/,"$1");ag[0]=parseInt(ab.replace(/^(.*)\..*$/,"$1"),10);ag[1]=parseInt(ab.replace(/^.*\.(.*)\s.*$/,"$1"),10);ag[2]=/[a-zA-Z]/.test(ab)?parseInt(ab.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}}else{if(typeof O.ActiveXObject!=D){try{var ad=new ActiveXObject(W);if(ad){ab=ad.GetVariable("$version");if(ab){X=true;ab=ab.split(" ")[1].split(",");ag=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}}catch(Z){}}}return{w3:aa,pv:ag,wk:af,ie:X,win:ae,mac:ac}}(),k=function(){if(!M.w3){return}if((typeof j.readyState!=D&&j.readyState=="complete")||(typeof j.readyState==D&&(j.getElementsByTagName("body")[0]||j.body))){f()}if(!J){if(typeof j.addEventListener!=D){j.addEventListener("DOMContentLoaded",f,false)}if(M.ie&&M.win){j.attachEvent(x,function(){if(j.readyState=="complete"){j.detachEvent(x,arguments.callee);f()}});if(O==top){(function(){if(J){return}try{j.documentElement.doScroll("left")}catch(X){setTimeout(arguments.callee,0);return}f()})()}}if(M.wk){(function(){if(J){return}if(!/loaded|complete/.test(j.readyState)){setTimeout(arguments.callee,0);return}f()})()}s(f)}}();function f(){if(J){return}try{var Z=j.getElementsByTagName("body")[0].appendChild(C("span"));Z.parentNode.removeChild(Z)}catch(aa){return}J=true;var X=U.length;for(var Y=0;Y<X;Y++){U[Y]()}}function K(X){if(J){X()}else{U[U.length]=X}}function s(Y){if(typeof O.addEventListener!=D){O.addEventListener("load",Y,false)}else{if(typeof j.addEventListener!=D){j.addEventListener("load",Y,false)}else{if(typeof O.attachEvent!=D){i(O,"onload",Y)}else{if(typeof O.onload=="function"){var X=O.onload;O.onload=function(){X();Y()}}else{O.onload=Y}}}}}function h(){if(T){V()}else{H()}}function V(){var X=j.getElementsByTagName("body")[0];var aa=C(r);aa.setAttribute("type",q);var Z=X.appendChild(aa);if(Z){var Y=0;(function(){if(typeof Z.GetVariable!=D){var ab=Z.GetVariable("$version");if(ab){ab=ab.split(" ")[1].split(",");M.pv=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}else{if(Y<10){Y++;setTimeout(arguments.callee,10);return}}X.removeChild(aa);Z=null;H()})()}else{H()}}function H(){var ag=o.length;if(ag>0){for(var af=0;af<ag;af++){var Y=o[af].id;var ab=o[af].callbackFn;var aa={success:false,id:Y};if(M.pv[0]>0){var ae=c(Y);if(ae){if(F(o[af].swfVersion)&&!(M.wk&&M.wk<312)){w(Y,true);if(ab){aa.success=true;aa.ref=z(Y);ab(aa)}}else{if(o[af].expressInstall&&A()){var ai={};ai.data=o[af].expressInstall;ai.width=ae.getAttribute("width")||"0";ai.height=ae.getAttribute("height")||"0";if(ae.getAttribute("class")){ai.styleclass=ae.getAttribute("class")}if(ae.getAttribute("align")){ai.align=ae.getAttribute("align")}var ah={};var X=ae.getElementsByTagName("param");var ac=X.length;for(var ad=0;ad<ac;ad++){if(X[ad].getAttribute("name").toLowerCase()!="movie"){ah[X[ad].getAttribute("name")]=X[ad].getAttribute("value")}}P(ai,ah,Y,ab)}else{p(ae);if(ab){ab(aa)}}}}}else{w(Y,true);if(ab){var Z=z(Y);if(Z&&typeof Z.SetVariable!=D){aa.success=true;aa.ref=Z}ab(aa)}}}}}function z(aa){var X=null;var Y=c(aa);if(Y&&Y.nodeName=="OBJECT"){if(typeof Y.SetVariable!=D){X=Y}else{var Z=Y.getElementsByTagName(r)[0];if(Z){X=Z}}}return X}function A(){return !a&&F("6.0.65")&&(M.win||M.mac)&&!(M.wk&&M.wk<312)}function P(aa,ab,X,Z){a=true;E=Z||null;B={success:false,id:X};var ae=c(X);if(ae){if(ae.nodeName=="OBJECT"){l=g(ae);Q=null}else{l=ae;Q=X}aa.id=R;if(typeof aa.width==D||(!/%$/.test(aa.width)&&parseInt(aa.width,10)<310)){aa.width="310"}if(typeof aa.height==D||(!/%$/.test(aa.height)&&parseInt(aa.height,10)<137)){aa.height="137"}j.title=j.title.slice(0,47)+" - Flash Player Installation";var ad=M.ie&&M.win?"ActiveX":"PlugIn",ac="MMredirectURL="+O.location.toString().replace(/&/g,"%26")+"&MMplayerType="+ad+"&MMdoctitle="+j.title;if(typeof ab.flashvars!=D){ab.flashvars+="&"+ac}else{ab.flashvars=ac}if(M.ie&&M.win&&ae.readyState!=4){var Y=C("div");X+="SWFObjectNew";Y.setAttribute("id",X);ae.parentNode.insertBefore(Y,ae);ae.style.display="none";(function(){if(ae.readyState==4){ae.parentNode.removeChild(ae)}else{setTimeout(arguments.callee,10)}})()}u(aa,ab,X)}}function p(Y){if(M.ie&&M.win&&Y.readyState!=4){var X=C("div");Y.parentNode.insertBefore(X,Y);X.parentNode.replaceChild(g(Y),X);Y.style.display="none";(function(){if(Y.readyState==4){Y.parentNode.removeChild(Y)}else{setTimeout(arguments.callee,10)}})()}else{Y.parentNode.replaceChild(g(Y),Y)}}function g(ab){var aa=C("div");if(M.win&&M.ie){aa.innerHTML=ab.innerHTML}else{var Y=ab.getElementsByTagName(r)[0];if(Y){var ad=Y.childNodes;if(ad){var X=ad.length;for(var Z=0;Z<X;Z++){if(!(ad[Z].nodeType==1&&ad[Z].nodeName=="PARAM")&&!(ad[Z].nodeType==8)){aa.appendChild(ad[Z].cloneNode(true))}}}}}return aa}function u(ai,ag,Y){var X,aa=c(Y);if(M.wk&&M.wk<312){return X}if(aa){if(typeof ai.id==D){ai.id=Y}if(M.ie&&M.win){var ah="";for(var ae in ai){if(ai[ae]!=Object.prototype[ae]){if(ae.toLowerCase()=="data"){ag.movie=ai[ae]}else{if(ae.toLowerCase()=="styleclass"){ah+=' class="'+ai[ae]+'"'}else{if(ae.toLowerCase()!="classid"){ah+=" "+ae+'="'+ai[ae]+'"'}}}}}var af="";for(var ad in ag){if(ag[ad]!=Object.prototype[ad]){af+='<param name="'+ad+'" value="'+ag[ad]+'" />'}}aa.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+ah+">"+af+"</object>";N[N.length]=ai.id;X=c(ai.id)}else{var Z=C(r);Z.setAttribute("type",q);for(var ac in ai){if(ai[ac]!=Object.prototype[ac]){if(ac.toLowerCase()=="styleclass"){Z.setAttribute("class",ai[ac])}else{if(ac.toLowerCase()!="classid"){Z.setAttribute(ac,ai[ac])}}}}for(var ab in ag){if(ag[ab]!=Object.prototype[ab]&&ab.toLowerCase()!="movie"){e(Z,ab,ag[ab])}}aa.parentNode.replaceChild(Z,aa);X=Z}}return X}function e(Z,X,Y){var aa=C("param");aa.setAttribute("name",X);aa.setAttribute("value",Y);Z.appendChild(aa)}function y(Y){var X=c(Y);if(X&&X.nodeName=="OBJECT"){if(M.ie&&M.win){X.style.display="none";(function(){if(X.readyState==4){b(Y)}else{setTimeout(arguments.callee,10)}})()}else{X.parentNode.removeChild(X)}}}function b(Z){var Y=c(Z);if(Y){for(var X in Y){if(typeof Y[X]=="function"){Y[X]=null}}Y.parentNode.removeChild(Y)}}function c(Z){var X=null;try{X=j.getElementById(Z)}catch(Y){}return X}function C(X){return j.createElement(X)}function i(Z,X,Y){Z.attachEvent(X,Y);I[I.length]=[Z,X,Y]}function F(Z){var Y=M.pv,X=Z.split(".");X[0]=parseInt(X[0],10);X[1]=parseInt(X[1],10)||0;X[2]=parseInt(X[2],10)||0;return(Y[0]>X[0]||(Y[0]==X[0]&&Y[1]>X[1])||(Y[0]==X[0]&&Y[1]==X[1]&&Y[2]>=X[2]))?true:false}function v(ac,Y,ad,ab){if(M.ie&&M.mac){return}var aa=j.getElementsByTagName("head")[0];if(!aa){return}var X=(ad&&typeof ad=="string")?ad:"screen";if(ab){n=null;G=null}if(!n||G!=X){var Z=C("style");Z.setAttribute("type","text/css");Z.setAttribute("media",X);n=aa.appendChild(Z);if(M.ie&&M.win&&typeof j.styleSheets!=D&&j.styleSheets.length>0){n=j.styleSheets[j.styleSheets.length-1]}G=X}if(M.ie&&M.win){if(n&&typeof n.addRule==r){n.addRule(ac,Y)}}else{if(n&&typeof j.createTextNode!=D){n.appendChild(j.createTextNode(ac+" {"+Y+"}"))}}}function w(Z,X){if(!m){return}var Y=X?"visible":"hidden";if(J&&c(Z)){c(Z).style.visibility=Y}else{v("#"+Z,"visibility:"+Y)}}function L(Y){var Z=/[\\\"<>\.;]/;var X=Z.exec(Y)!=null;return X&&typeof encodeURIComponent!=D?encodeURIComponent(Y):Y}var d=function(){if(M.ie&&M.win){window.attachEvent("onunload",function(){var ac=I.length;for(var ab=0;ab<ac;ab++){I[ab][0].detachEvent(I[ab][1],I[ab][2])}var Z=N.length;for(var aa=0;aa<Z;aa++){y(N[aa])}for(var Y in M){M[Y]=null}M=null;for(var X in swfobject){swfobject[X]=null}swfobject=null})}}();return{registerObject:function(ab,X,aa,Z){if(M.w3&&ab&&X){var Y={};Y.id=ab;Y.swfVersion=X;Y.expressInstall=aa;Y.callbackFn=Z;o[o.length]=Y;w(ab,false)}else{if(Z){Z({success:false,id:ab})}}},getObjectById:function(X){if(M.w3){return z(X)}},embedSWF:function(ab,ah,ae,ag,Y,aa,Z,ad,af,ac){var X={success:false,id:ah};if(M.w3&&!(M.wk&&M.wk<312)&&ab&&ah&&ae&&ag&&Y){w(ah,false);K(function(){ae+="";ag+="";var aj={};if(af&&typeof af===r){for(var al in af){aj[al]=af[al]}}aj.data=ab;aj.width=ae;aj.height=ag;var am={};if(ad&&typeof ad===r){for(var ak in ad){am[ak]=ad[ak]}}if(Z&&typeof Z===r){for(var ai in Z){if(typeof am.flashvars!=D){am.flashvars+="&"+ai+"="+Z[ai]}else{am.flashvars=ai+"="+Z[ai]}}}if(F(Y)){var an=u(aj,am,ah);if(aj.id==ah){w(ah,true)}X.success=true;X.ref=an}else{if(aa&&A()){aj.data=aa;P(aj,am,ah,ac);return}else{w(ah,true)}}if(ac){ac(X)}})}else{if(ac){ac(X)}}},switchOffAutoHideShow:function(){m=false},ua:M,getFlashPlayerVersion:function(){return{major:M.pv[0],minor:M.pv[1],release:M.pv[2]}},hasFlashPlayerVersion:F,createSWF:function(Z,Y,X){if(M.w3){return u(Z,Y,X)}else{return undefined}},showExpressInstall:function(Z,aa,X,Y){if(M.w3&&A()){P(Z,aa,X,Y)}},removeSWF:function(X){if(M.w3){y(X)}},createCSS:function(aa,Z,Y,X){if(M.w3){v(aa,Z,Y,X)}},addDomLoadEvent:K,addLoadEvent:s,getQueryParamValue:function(aa){var Z=j.location.search||j.location.hash;if(Z){if(/\?/.test(Z)){Z=Z.split("?")[1]}if(aa==null){return L(Z)}var Y=Z.split("&");for(var X=0;X<Y.length;X++){if(Y[X].substring(0,Y[X].indexOf("="))==aa){return L(Y[X].substring((Y[X].indexOf("=")+1)))}}}return""},expressInstallCallback:function(){if(a){var X=c(R);if(X&&l){X.parentNode.replaceChild(l,X);if(Q){w(Q,true);if(M.ie&&M.win){l.style.display="block"}}if(E){E(B)}}a=false}}}}();
@@ -0,0 +1,315 @@
1
+ /*
2
+ Uploadify v2.1.0
3
+ Release Date: August 24, 2009
4
+
5
+ Copyright (c) 2009 Ronnie Garcia, Travis Nickels
6
+
7
+ Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ of this software and associated documentation files (the "Software"), to deal
9
+ in the Software without restriction, including without limitation the rights
10
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ copies of the Software, and to permit persons to whom the Software is
12
+ furnished to do so, subject to the following conditions:
13
+
14
+ The above copyright notice and this permission notice shall be included in
15
+ all copies or substantial portions of the Software.
16
+
17
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
+ THE SOFTWARE.
24
+ */
25
+
26
+ if(jQuery) {(function(a) {
27
+ a.extend(a.fn, {
28
+ uploadify : function(b) {
29
+ a(this).each(function() {
30
+ settings = a.extend({
31
+ id : a(this).attr("id"),
32
+ uploader : "uploadify.swf",
33
+ script : "uploadify.php",
34
+ expressInstall : null,
35
+ folder : "",
36
+ height : 30,
37
+ width : 110,
38
+ cancelImg : "cancel.png",
39
+ wmode : "opaque",
40
+ scriptAccess : "sameDomain",
41
+ fileDataName : "Filedata",
42
+ method : "POST",
43
+ queueSizeLimit : 999,
44
+ simUploadLimit : 1,
45
+ queueID : false,
46
+ displayData : "percentage",
47
+ onInit : function() {
48
+ },
49
+ onSelect : function() {
50
+ },
51
+ onQueueFull : function() {
52
+ },
53
+ onCheck : function() {
54
+ },
55
+ onCancel : function() {
56
+ },
57
+ onError : function() {
58
+ },
59
+ onProgress : function() {
60
+ },
61
+ onComplete : function() {
62
+ },
63
+ onAllComplete : function() {
64
+ }
65
+ }, b);
66
+ var e = location.pathname;
67
+ e = e.split("/");
68
+ e.pop();
69
+ e = e.join("/") + "/";
70
+ var f = {};
71
+ f.uploadifyID = settings.id;
72
+ f.pagepath = e;
73
+ if(settings.buttonImg) {
74
+ f.buttonImg = escape(settings.buttonImg)
75
+ }
76
+ if(settings.buttonText) {
77
+ f.buttonText = escape(settings.buttonText)
78
+ }
79
+ if(settings.rollover) {
80
+ f.rollover = true
81
+ }
82
+ f.script = settings.script;
83
+ f.folder = escape(settings.folder);
84
+ if(settings.scriptData) {
85
+ var g = "";
86
+ for(var d in settings.scriptData) {
87
+ g += "&" + d + "=" + settings.scriptData[d]
88
+ }
89
+ f.scriptData = escape(g.substr(1))
90
+ }
91
+ f.width = settings.width;
92
+ f.height = settings.height;
93
+ f.wmode = settings.wmode;
94
+ f.method = settings.method;
95
+ f.queueSizeLimit = settings.queueSizeLimit;
96
+ f.simUploadLimit = settings.simUploadLimit;
97
+ if(settings.hideButton) {
98
+ f.hideButton = true
99
+ }
100
+ if(settings.fileDesc) {
101
+ f.fileDesc = settings.fileDesc
102
+ }
103
+ if(settings.fileExt) {
104
+ f.fileExt = settings.fileExt
105
+ }
106
+ if(settings.multi) {
107
+ f.multi = true
108
+ }
109
+ if(settings.auto) {
110
+ f.auto = true
111
+ }
112
+ if(settings.sizeLimit) {
113
+ f.sizeLimit = settings.sizeLimit
114
+ }
115
+ if(settings.checkScript) {
116
+ f.checkScript = settings.checkScript
117
+ }
118
+ if(settings.fileDataName) {
119
+ f.fileDataName = settings.fileDataName
120
+ }
121
+ if(settings.queueID) {
122
+ f.queueID = settings.queueID
123
+ }
124
+ if(settings.onInit() !== false) {
125
+ a(this).css("display", "none");
126
+ a(this).after('<div id="' + a(this).attr("id") + 'Uploader"></div>');
127
+ swfobject.embedSWF(settings.uploader, settings.id + "Uploader", settings.width, settings.height, "9.0.24", settings.expressInstall, f, {
128
+ quality : "high",
129
+ wmode : settings.wmode,
130
+ allowScriptAccess : settings.scriptAccess
131
+ });
132
+ if(settings.queueID == false) {
133
+ a("#" + a(this).attr("id") + "Uploader").after('<div id="' + a(this).attr("id") + 'Queue" class="uploadifyQueue"></div>')
134
+ }
135
+ }
136
+ if( typeof (settings.onOpen) == "function") {
137
+ a(this).bind("uploadifyOpen", settings.onOpen)
138
+ }
139
+ a(this).bind("uploadifySelect", {
140
+ action : settings.onSelect,
141
+ queueID : settings.queueID
142
+ }, function(j, h, i) {
143
+ if(j.data.action(j, h, i) !== false) {
144
+ var k = Math.round(i.size / 1024 * 100) * 0.01;
145
+ var l = "KB";
146
+ if(k > 1000) {
147
+ k = Math.round(k * 0.001 * 100) * 0.01;
148
+ l = "MB"
149
+ }
150
+ var m = k.toString().split(".");
151
+ if(m.length > 1) {
152
+ k = m[0] + "." + m[1].substr(0, 2)
153
+ } else {
154
+ k = m[0]
155
+ }
156
+ if(i.name.length > 20) {
157
+ fileName = i.name.substr(0, 20) + "..."
158
+ } else {
159
+ fileName = i.name
160
+ }
161
+ queue = "#" + a(this).attr("id") + "Queue";
162
+ if(j.data.queueID) {
163
+ queue = "#" + j.data.queueID
164
+ }
165
+ a(queue).append('<div id="' + a(this).attr("id") + h + '" class="uploadifyQueueItem"><div class="cancel"><a href="javascript:jQuery(\'#' + a(this).attr("id") + "').uploadifyCancel('" + h + '\')"><img src="' + settings.cancelImg + '" border="0" /></a></div><span class="fileName">' + fileName + " (" + k + l + ')</span><span class="percentage"></span><div class="uploadifyProgress"><div id="' + a(this).attr("id") + h + 'ProgressBar" class="uploadifyProgressBar"><!--Progress Bar--></div></div></div>')
166
+ }
167
+ });
168
+ if( typeof (settings.onSelectOnce) == "function") {
169
+ a(this).bind("uploadifySelectOnce", settings.onSelectOnce)
170
+ }
171
+ a(this).bind("uploadifyQueueFull", {
172
+ action : settings.onQueueFull
173
+ }, function(h, i) {
174
+ if(h.data.action(h, i) !== false) {
175
+ alert("The queue is full. The max size is " + i + ".")
176
+ }
177
+ });
178
+ a(this).bind("uploadifyCheckExist", {
179
+ action : settings.onCheck
180
+ }, function(m, l, k, j, o) {
181
+ var i = new Object();
182
+ i = k;
183
+ i.folder = e + j;
184
+ if(o) {
185
+ for(var h in k) {
186
+ var n = h
187
+ }
188
+ }
189
+ a.post(l, i, function(r) {
190
+ for(var p in r) {
191
+ if(m.data.action(m, l, k, j, o) !== false) {
192
+ var q = confirm("Do you want to replace the file " + r[p] + "?");
193
+ if(!q) {
194
+ document.getElementById(a(m.target).attr("id") + "Uploader").cancelFileUpload(p, true, true)
195
+ }
196
+ }
197
+ }
198
+ if(o) {
199
+ document.getElementById(a(m.target).attr("id") + "Uploader").startFileUpload(n, true)
200
+ } else {
201
+ document.getElementById(a(m.target).attr("id") + "Uploader").startFileUpload(null, true)
202
+ }
203
+ }, "json")
204
+ });
205
+ a(this).bind("uploadifyCancel", {
206
+ action : settings.onCancel
207
+ }, function(l, h, k, m, j) {
208
+ if(l.data.action(l, h, k, m, j) !== false) {
209
+ var i = (j == true) ? 0 : 250;
210
+ a("#" + a(this).attr("id") + h).fadeOut(i, function() {
211
+ a(this).remove()
212
+ })
213
+ }
214
+ });
215
+ if( typeof (settings.onClearQueue) == "function") {
216
+ a(this).bind("uploadifyClearQueue", settings.onClearQueue)
217
+ }
218
+ var c = [];
219
+ a(this).bind("uploadifyError", {
220
+ action : settings.onError
221
+ }, function(l, h, k, j) {
222
+ if(l.data.action(l, h, k, j) !== false) {
223
+ var i = new Array(h, k, j);
224
+ c.push(i);
225
+ a("#" + a(this).attr("id") + h + " .percentage").text(" - " + j.type + " Error");
226
+ a("#" + a(this).attr("id") + h).addClass("uploadifyError")
227
+ }
228
+ });
229
+ a(this).bind("uploadifyProgress", {
230
+ action : settings.onProgress,
231
+ toDisplay : settings.displayData
232
+ }, function(j, h, i, k) {
233
+ if(j.data.action(j, h, i, k) !== false) {
234
+ a("#" + a(this).attr("id") + h + "ProgressBar").css("width", k.percentage + "%");
235
+ if(j.data.toDisplay == "percentage") {
236
+ displayData = " - " + k.percentage + "%"
237
+ }
238
+ if(j.data.toDisplay == "speed") {
239
+ displayData = " - " + k.speed + "KB/s"
240
+ }
241
+ if(j.data.toDisplay == null) {
242
+ displayData = " "
243
+ }
244
+ a("#" + a(this).attr("id") + h + " .percentage").text(displayData)
245
+ }
246
+ });
247
+ a(this).bind("uploadifyComplete", {
248
+ action : settings.onComplete
249
+ }, function(k, h, j, i, l) {
250
+ if(k.data.action(k, h, j, unescape(i), l) !== false) {
251
+ a("#" + a(this).attr("id") + h + " .percentage").text(" - Completed");
252
+ a("#" + a(this).attr("id") + h).fadeOut(250, function() {
253
+ a(this).remove()
254
+ })
255
+ }
256
+ });
257
+ if( typeof (settings.onAllComplete) == "function") {
258
+ a(this).bind("uploadifyAllComplete", {
259
+ action : settings.onAllComplete
260
+ }, function(h, i) {
261
+ if(h.data.action(h, i) !== false) {
262
+ c = []
263
+ }
264
+ })
265
+ }
266
+ })
267
+ },
268
+ uploadifySettings : function(f, j, c) {
269
+ var g = false;
270
+ a(this).each(function() {
271
+ if(f == "scriptData" && j != null) {
272
+ if(c) {
273
+ var i = j
274
+ } else {
275
+ var i = a.extend(settings.scriptData, j)
276
+ }
277
+ var l = "";
278
+ for(var k in i) {
279
+ l += "&" + k + "=" + escape(i[k])
280
+ }
281
+ j = l.substr(1)
282
+ }
283
+ g = document.getElementById(a(this).attr("id") + "Uploader").updateSettings(f, j)
284
+ });
285
+ if(j == null) {
286
+ if(f == "scriptData") {
287
+ var b = unescape(g).split("&");
288
+ var e = new Object();
289
+ for(var d = 0; d < b.length; d++) {
290
+ var h = b[d].split("=");
291
+ e[h[0]] = h[1]
292
+ }
293
+ g = e
294
+ }
295
+ return g
296
+ }
297
+ },
298
+ uploadifyUpload : function(b) {
299
+ a(this).each(function() {
300
+ document.getElementById(a(this).attr("id") + "Uploader").startFileUpload(b, false)
301
+ })
302
+ },
303
+ uploadifyCancel : function(b) {
304
+ a(this).each(function() {
305
+ document.getElementById(a(this).attr("id") + "Uploader").cancelFileUpload(b, true, false)
306
+ })
307
+ },
308
+ uploadifyClearQueue : function() {
309
+ a(this).each(function() {
310
+ document.getElementById(a(this).attr("id") + "Uploader").clearFileUploadQueue(false)
311
+ })
312
+ }
313
+ })
314
+ })(jQuery)
315
+ };