refinerycms-6hoursdaily-photo-gallery 0.0.4.dev

Sign up to get free protection for your applications and to get access to all the features.
Files changed (165) hide show
  1. data/Gemfile +27 -0
  2. data/LICENSE.md +8 -0
  3. data/README.md +224 -0
  4. data/app/assets/images/refinery/photo_gallery/admin/chosen-sprite.png +0 -0
  5. data/app/assets/images/refinery/photo_gallery/admin/icons/album.png +0 -0
  6. data/app/assets/images/refinery/photo_gallery/admin/icons/album_add.png +0 -0
  7. data/app/assets/images/refinery/photo_gallery/admin/icons/album_edit.png +0 -0
  8. data/app/assets/images/refinery/photo_gallery/admin/icons/cog.png +0 -0
  9. data/app/assets/images/refinery/photo_gallery/admin/icons/down.gif +0 -0
  10. data/app/assets/images/refinery/photo_gallery/admin/icons/folder.png +0 -0
  11. data/app/assets/images/refinery/photo_gallery/admin/icons/folder_add.png +0 -0
  12. data/app/assets/images/refinery/photo_gallery/admin/icons/folder_edit.png +0 -0
  13. data/app/assets/images/refinery/photo_gallery/admin/icons/loading.gif +0 -0
  14. data/app/assets/images/refinery/photo_gallery/admin/icons/page_copy.png +0 -0
  15. data/app/assets/images/refinery/photo_gallery/admin/icons/photo.png +0 -0
  16. data/app/assets/images/refinery/photo_gallery/admin/icons/photo_add.png +0 -0
  17. data/app/assets/images/refinery/photo_gallery/admin/icons/photo_edit.png +0 -0
  18. data/app/assets/images/refinery/photo_gallery/admin/icons/up.gif +0 -0
  19. data/app/assets/images/refinery/photo_gallery/admin/plupload/jquery.plupload.queue/backgrounds.gif +0 -0
  20. data/app/assets/images/refinery/photo_gallery/admin/plupload/jquery.plupload.queue/buttons-disabled.png +0 -0
  21. data/app/assets/images/refinery/photo_gallery/admin/plupload/jquery.plupload.queue/buttons.png +0 -0
  22. data/app/assets/images/refinery/photo_gallery/admin/plupload/jquery.plupload.queue/delete.gif +0 -0
  23. data/app/assets/images/refinery/photo_gallery/admin/plupload/jquery.plupload.queue/done.gif +0 -0
  24. data/app/assets/images/refinery/photo_gallery/admin/plupload/jquery.plupload.queue/error.gif +0 -0
  25. data/app/assets/images/refinery/photo_gallery/admin/plupload/jquery.plupload.queue/throbber.gif +0 -0
  26. data/app/assets/images/refinery/photo_gallery/admin/plupload/jquery.plupload.queue/transp50.png +0 -0
  27. data/app/assets/images/refinery/photo_gallery/admin/plupload/jquery.ui.plupload/plupload-bw.png +0 -0
  28. data/app/assets/images/refinery/photo_gallery/admin/plupload/jquery.ui.plupload/plupload.png +0 -0
  29. data/app/assets/images/refinery/photo_gallery/admin/rss-feed.png +0 -0
  30. data/app/assets/images/refinery/photo_gallery/fancybox/blank.gif +0 -0
  31. data/app/assets/images/refinery/photo_gallery/fancybox/fancybox_loading.gif +0 -0
  32. data/app/assets/images/refinery/photo_gallery/fancybox/fancybox_sprite.png +0 -0
  33. data/app/assets/images/refinery/photo_gallery/fancybox/helpers/fancybox_buttons.png +0 -0
  34. data/app/assets/javascripts/refinery/photo_gallery/admin/jquery.chosen.min.js +10 -0
  35. data/app/assets/javascripts/refinery/photo_gallery/admin/photo_gallery.js +28 -0
  36. data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/changelog.txt +218 -0
  37. data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/cs.js +14 -0
  38. data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/da.js +12 -0
  39. data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/de.js +24 -0
  40. data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/el.js +14 -0
  41. data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/es.js +25 -0
  42. data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/et.js +33 -0
  43. data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/fi.js +33 -0
  44. data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/fr-ca.js +35 -0
  45. data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/fr.js +25 -0
  46. data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/hr.js +25 -0
  47. data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/hu.js +33 -0
  48. data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/it.js +24 -0
  49. data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/ja.js +37 -0
  50. data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/ko.js +36 -0
  51. data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/lv.js +33 -0
  52. data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/nl.js +21 -0
  53. data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/pl.js +24 -0
  54. data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/pt-br.js +35 -0
  55. data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/ro.js +24 -0
  56. data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/ru.js +21 -0
  57. data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/sk.js +37 -0
  58. data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/sr.js +14 -0
  59. data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/sv.js +12 -0
  60. data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/jquery.plupload.queue.js +195 -0
  61. data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/jquery.ui.plupload.js +383 -0
  62. data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/license.txt +339 -0
  63. data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/plupload.browserplus.js +1 -0
  64. data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/plupload.flash.js +226 -0
  65. data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/plupload.flash.swf +0 -0
  66. data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/plupload.full.js +2525 -0
  67. data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/plupload.full.js.default +2525 -0
  68. data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/plupload.gears.js +1 -0
  69. data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/plupload.html4.js +1 -0
  70. data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/plupload.html5.js +765 -0
  71. data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/plupload.html5.js.default +765 -0
  72. data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/plupload.js +618 -0
  73. data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/plupload.silverlight.js +1 -0
  74. data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/plupload.silverlight.xap +0 -0
  75. data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/readme.md +46 -0
  76. data/app/assets/javascripts/refinery/photo_gallery/fancybox/CHANGELOG.md +68 -0
  77. data/app/assets/javascripts/refinery/photo_gallery/fancybox/README.md +212 -0
  78. data/app/assets/javascripts/refinery/photo_gallery/fancybox/helpers/jquery.fancybox-buttons.js +115 -0
  79. data/app/assets/javascripts/refinery/photo_gallery/fancybox/helpers/jquery.fancybox-media.js +85 -0
  80. data/app/assets/javascripts/refinery/photo_gallery/fancybox/helpers/jquery.fancybox-thumbs.js +157 -0
  81. data/app/assets/javascripts/refinery/photo_gallery/fancybox/jquery.fancybox.js +1463 -0
  82. data/app/assets/javascripts/refinery/photo_gallery/fancybox/jquery.fancybox.pack.js +35 -0
  83. data/app/assets/javascripts/refinery/photo_gallery/fancybox/lib/jquery.mousewheel-3.0.6.pack.js +13 -0
  84. data/app/assets/stylesheets/refinery/photo_gallery/admin/chosen.css.scss +396 -0
  85. data/app/assets/stylesheets/refinery/photo_gallery/admin/photo_gallery.css.scss +109 -0
  86. data/app/assets/stylesheets/refinery/photo_gallery/admin/plupload/jquery.plupload.queue.css.scss +177 -0
  87. data/app/assets/stylesheets/refinery/photo_gallery/admin/plupload/jquery.ui.plupload.css.scss +147 -0
  88. data/app/assets/stylesheets/refinery/photo_gallery/fancybox/helpers/jquery.fancybox-buttons.css.scss +85 -0
  89. data/app/assets/stylesheets/refinery/photo_gallery/fancybox/helpers/jquery.fancybox-thumbs.css +54 -0
  90. data/app/assets/stylesheets/refinery/photo_gallery/fancybox/jquery.fancybox.css.scss +234 -0
  91. data/app/controllers/refinery/photo_gallery/admin/albums_controller.rb +23 -0
  92. data/app/controllers/refinery/photo_gallery/admin/collections_controller.rb +10 -0
  93. data/app/controllers/refinery/photo_gallery/admin/photos_controller.rb +67 -0
  94. data/app/controllers/refinery/photo_gallery/albums_controller.rb +23 -0
  95. data/app/controllers/refinery/photo_gallery/collections_controller.rb +28 -0
  96. data/app/helpers/refinery/photo_gallery/admin/photos_helper.rb +10 -0
  97. data/app/helpers/refinery/photo_gallery/albums_helper.rb +11 -0
  98. data/app/helpers/refinery/photo_gallery/photo_gallery_helper.rb +113 -0
  99. data/app/middleware/refinery/photo_gallery/admin/flash_session_cookie_middleware.rb +27 -0
  100. data/app/models/refinery/photo_gallery/album.rb +63 -0
  101. data/app/models/refinery/photo_gallery/collection.rb +29 -0
  102. data/app/models/refinery/photo_gallery/collection_album.rb +8 -0
  103. data/app/models/refinery/photo_gallery/photo.rb +63 -0
  104. data/app/uploaders/refinery/photo_gallery/admin/file_uploader.rb +122 -0
  105. data/app/views/refinery/photo_gallery/admin/_submenu.html.erb +44 -0
  106. data/app/views/refinery/photo_gallery/admin/albums/_album.html.erb +31 -0
  107. data/app/views/refinery/photo_gallery/admin/albums/_form.html.erb +78 -0
  108. data/app/views/refinery/photo_gallery/admin/albums/_sortable_list.html.erb +7 -0
  109. data/app/views/refinery/photo_gallery/admin/albums/edit.html.erb +2 -0
  110. data/app/views/refinery/photo_gallery/admin/albums/index.html.erb +28 -0
  111. data/app/views/refinery/photo_gallery/admin/albums/new.html.erb +2 -0
  112. data/app/views/refinery/photo_gallery/admin/collections/_collection.html.erb +23 -0
  113. data/app/views/refinery/photo_gallery/admin/collections/_form.html.erb +32 -0
  114. data/app/views/refinery/photo_gallery/admin/collections/_sortable_list.html.erb +7 -0
  115. data/app/views/refinery/photo_gallery/admin/collections/edit.html.erb +2 -0
  116. data/app/views/refinery/photo_gallery/admin/collections/index.html.erb +28 -0
  117. data/app/views/refinery/photo_gallery/admin/collections/new.html.erb +2 -0
  118. data/app/views/refinery/photo_gallery/admin/collections/test.html.erb +39 -0
  119. data/app/views/refinery/photo_gallery/admin/photos/_destroy.js.erb +15 -0
  120. data/app/views/refinery/photo_gallery/admin/photos/_form.html.erb +7 -0
  121. data/app/views/refinery/photo_gallery/admin/photos/_form_actions.html.erb +6 -0
  122. data/app/views/refinery/photo_gallery/admin/photos/_form_fields.html.erb +31 -0
  123. data/app/views/refinery/photo_gallery/admin/photos/_form_fields_actions.html.erb +15 -0
  124. data/app/views/refinery/photo_gallery/admin/photos/edit_multiple.html.erb +9 -0
  125. data/app/views/refinery/photo_gallery/admin/photos/upload.html.erb +87 -0
  126. data/app/views/refinery/photo_gallery/albums/show.html.erb +49 -0
  127. data/app/views/refinery/photo_gallery/collections/index.html.erb +13 -0
  128. data/app/views/refinery/photo_gallery/collections/show.html.erb +33 -0
  129. data/app/views/refinery/photo_gallery/shared/_layout.html.erb +22 -0
  130. data/app/views/refinery/photo_gallery/shared/_submenu.html.erb +5 -0
  131. data/config/initializers/carrierwave.rb +5 -0
  132. data/config/initializers/form_builder.rb +26 -0
  133. data/config/initializers/refinery/core.rb +10 -0
  134. data/config/initializers/s3.rb +11 -0
  135. data/config/initializers/session_store.rb +10 -0
  136. data/config/locales/en.yml +95 -0
  137. data/config/locales/sk.yml +94 -0
  138. data/config/routes.rb +37 -0
  139. data/db/migrate/20120804063842_create_albums.rb +18 -0
  140. data/db/migrate/20120805131321_create_collections.rb +14 -0
  141. data/db/migrate/20120805131547_create_collection_albums.rb +12 -0
  142. data/db/migrate/20120805165238_create_photos.rb +19 -0
  143. data/db/migrate/20120805222125_add_indexes.rb +24 -0
  144. data/db/seeds.rb +21 -0
  145. data/lib/generators/refinery/photo_gallery_generator.rb +25 -0
  146. data/lib/generators/refinery/templates/config/initializers/refinery/photo_gallery.rb.erb +40 -0
  147. data/lib/refinery/photo_gallery/configuration.rb +33 -0
  148. data/lib/refinery/photo_gallery/engine.rb +33 -0
  149. data/lib/refinery/photo_gallery/version.rb +17 -0
  150. data/lib/refinery/photo_gallery.rb +30 -0
  151. data/lib/refinerycms-photo-gallery.rb +1 -0
  152. data/refinerycms-6hoursdaily-photo-gallery.gemspec +38 -0
  153. data/screenshots/01_collections#index.png +0 -0
  154. data/screenshots/02_albums#create.png +0 -0
  155. data/screenshots/03_photos#upload.png +0 -0
  156. data/screenshots/04_photos#upload- chooser.png +0 -0
  157. data/screenshots/05_photo#upoad-queue.png +0 -0
  158. data/screenshots/06_photos#upload-uploading.png +0 -0
  159. data/screenshots/07_photos#upload-uploading_2.png +0 -0
  160. data/screenshots/08_photos#edit_multiple.png +0 -0
  161. data/screenshots/09_albums#index.png +0 -0
  162. data/screenshots/10_albums_EXIF_reading.png +0 -0
  163. data/screenshots/11_frontend_show.png +0 -0
  164. data/screenshots/12_show_photo_using_fancybox.png +0 -0
  165. metadata +353 -0
@@ -0,0 +1 @@
1
+ (function(){if(window.google&&google.gears){return}var a=null;if(typeof GearsFactory!="undefined"){a=new GearsFactory()}else{try{a=new ActiveXObject("Gears.Factory");if(a.getBuildInfo().indexOf("ie_mobile")!=-1){a.privateSetGlobalObject(this)}}catch(b){if((typeof navigator.mimeTypes!="undefined")&&navigator.mimeTypes["application/x-googlegears"]){a=document.createElement("object");a.style.display="none";a.width=0;a.height=0;a.type="application/x-googlegears";document.documentElement.appendChild(a)}}}if(!a){return}if(!window.google){window.google={}}if(!google.gears){google.gears={factory:a}}})();(function(e,b,c,d){var f={};function a(h,j,l){var g,i,k,n;i=google.gears.factory.create("beta.canvas");try{i.decode(h);if(!j.width){j.width=i.width}if(!j.height){j.height=i.height}n=Math.min(width/i.width,height/i.height);if(n<1||(n===1&&l==="image/jpeg")){i.resize(Math.round(i.width*n),Math.round(i.height*n));if(j.quality){return i.encode(l,{quality:j.quality/100})}return i.encode(l)}}catch(m){}return h}c.runtimes.Gears=c.addRuntime("gears",{getFeatures:function(){return{dragdrop:true,jpgresize:true,pngresize:true,chunks:true,progress:true,multipart:true,multi_selection:true}},init:function(k,m){var l,h,g=false;if(!e.google||!google.gears){return m({success:false})}try{l=google.gears.factory.create("beta.desktop")}catch(j){return m({success:false})}function i(p){var o,n,q=[],r;for(n=0;n<p.length;n++){o=p[n];r=c.guid();f[r]=o.blob;q.push(new c.File(r,o.name,o.blob.length))}k.trigger("FilesAdded",q)}k.bind("PostInit",function(){var o=k.settings,n=b.getElementById(o.drop_element);if(n){c.addEvent(n,"dragover",function(p){l.setDropEffect(p,"copy");p.preventDefault()},k.id);c.addEvent(n,"drop",function(q){var p=l.getDragData(q,"application/x-gears-files");if(p){i(p.files)}q.preventDefault()},k.id);n=0}c.addEvent(b.getElementById(o.browse_button),"click",function(t){var s=[],q,p,r;t.preventDefault();if(g){return}no_type_restriction:for(q=0;q<o.filters.length;q++){r=o.filters[q].extensions.split(",");for(p=0;p<r.length;p++){if(r[p]==="*"){s=[];break no_type_restriction}s.push("."+r[p])}}l.openFiles(i,{singleFile:!o.multi_selection,filter:s})},k.id)});k.bind("CancelUpload",function(){if(h.abort){h.abort()}});k.bind("UploadFile",function(t,q){var v=0,u,r,s=0,p=t.settings.resize,n;if(p&&/\.(png|jpg|jpeg)$/i.test(q.name)){f[q.id]=a(f[q.id],p,/\.png$/i.test(q.name)?"image/png":"image/jpeg")}q.size=f[q.id].length;r=t.settings.chunk_size;n=r>0;u=Math.ceil(q.size/r);if(!n){r=q.size;u=1}function o(){var B,x=t.settings.multipart,w=0,A={name:q.target_name||q.name},y=t.settings.url;function z(D){var C,I="----pluploadboundary"+c.guid(),F="--",H="\r\n",E,G;if(x){h.setRequestHeader("Content-Type","multipart/form-data; boundary="+I);C=google.gears.factory.create("beta.blobbuilder");c.each(c.extend(A,t.settings.multipart_params),function(K,J){C.append(F+I+H+'Content-Disposition: form-data; name="'+J+'"'+H+H);C.append(K+H)});G=c.mimeTypes[q.name.replace(/^.+\.([^.]+)/,"$1").toLowerCase()]||"application/octet-stream";C.append(F+I+H+'Content-Disposition: form-data; name="'+t.settings.file_data_name+'"; filename="'+q.name+'"'+H+"Content-Type: "+G+H+H);C.append(D);C.append(H+F+I+F+H);E=C.getAsBlob();w=E.length-D.length;D=E}h.send(D)}if(q.status==c.DONE||q.status==c.FAILED||t.state==c.STOPPED){return}if(n){A.chunk=v;A.chunks=u}B=Math.min(r,q.size-(v*r));if(!x){y=c.buildUrl(t.settings.url,A)}h=google.gears.factory.create("beta.httprequest");h.open("POST",y);if(!x){h.setRequestHeader("Content-Disposition",'attachment; filename="'+q.name+'"');h.setRequestHeader("Content-Type","application/octet-stream")}c.each(t.settings.headers,function(D,C){h.setRequestHeader(C,D)});h.upload.onprogress=function(C){q.loaded=s+C.loaded-w;t.trigger("UploadProgress",q)};h.onreadystatechange=function(){var C;if(h.readyState==4&&t.state!==c.STOPPED){if(h.status==200){C={chunk:v,chunks:u,response:h.responseText,status:h.status};t.trigger("ChunkUploaded",q,C);if(C.cancelled){q.status=c.FAILED;return}s+=B;if(++v>=u){q.status=c.DONE;t.trigger("FileUploaded",q,{response:h.responseText,status:h.status})}else{o()}}else{t.trigger("Error",{code:c.HTTP_ERROR,message:c.translate("HTTP Error."),file:q,chunk:v,chunks:u,status:h.status})}}};if(v<u){z(f[q.id].slice(v*r,B))}}o()});k.bind("DisableBrowse",function(n,o){g=o});k.bind("Destroy",function(n){var o,p,q={browseButton:n.settings.browse_button,dropElm:n.settings.drop_element};for(o in q){p=b.getElementById(q[o]);if(p){c.removeAllEvents(p,n.id)}}});m({success:true})}})})(window,document,plupload);
@@ -0,0 +1 @@
1
+ (function(d,a,b,c){function e(f){return a.getElementById(f)}b.runtimes.Html4=b.addRuntime("html4",{getFeatures:function(){return{multipart:true,triggerDialog:(b.ua.gecko&&d.FormData||b.ua.webkit)}},init:function(f,g){f.bind("Init",function(p){var j=a.body,n,h="javascript",k,x,q,z=[],r=/MSIE/.test(navigator.userAgent),t=[],m=p.settings.filters,o,l,s,w;no_type_restriction:for(o=0;o<m.length;o++){l=m[o].extensions.split(/,/);for(w=0;w<l.length;w++){if(l[w]==="*"){t=[];break no_type_restriction}s=b.mimeTypes[l[w]];if(s&&b.inArray(s,t)===-1){t.push(s)}}}t=t.join(",");function v(){var B,y,i,A;q=b.guid();z.push(q);B=a.createElement("form");B.setAttribute("id","form_"+q);B.setAttribute("method","post");B.setAttribute("enctype","multipart/form-data");B.setAttribute("encoding","multipart/form-data");B.setAttribute("target",p.id+"_iframe");B.style.position="absolute";y=a.createElement("input");y.setAttribute("id","input_"+q);y.setAttribute("type","file");y.setAttribute("accept",t);y.setAttribute("size",1);A=e(p.settings.browse_button);if(p.features.triggerDialog&&A){b.addEvent(e(p.settings.browse_button),"click",function(C){if(!y.disabled){y.click()}C.preventDefault()},p.id)}b.extend(y.style,{width:"100%",height:"100%",opacity:0,fontSize:"99px",cursor:"pointer"});b.extend(B.style,{overflow:"hidden"});i=p.settings.shim_bgcolor;if(i){B.style.background=i}if(r){b.extend(y.style,{filter:"alpha(opacity=0)"})}b.addEvent(y,"change",function(F){var D=F.target,C,E=[],G;if(D.value){e("form_"+q).style.top=-1048575+"px";C=D.value.replace(/\\/g,"/");C=C.substring(C.length,C.lastIndexOf("/")+1);E.push(new b.File(q,C));if(!p.features.triggerDialog){b.removeAllEvents(B,p.id)}else{b.removeEvent(A,"click",p.id)}b.removeEvent(y,"change",p.id);v();if(E.length){f.trigger("FilesAdded",E)}}},p.id);B.appendChild(y);j.appendChild(B);p.refresh()}function u(){var i=a.createElement("div");i.innerHTML='<iframe id="'+p.id+'_iframe" name="'+p.id+'_iframe" src="'+h+':&quot;&quot;" style="display:none"></iframe>';n=i.firstChild;j.appendChild(n);b.addEvent(n,"load",function(C){var D=C.target,B,y;if(!k){return}try{B=D.contentWindow.document||D.contentDocument||d.frames[D.id].document}catch(A){p.trigger("Error",{code:b.SECURITY_ERROR,message:b.translate("Security error."),file:k});return}y=B.body.innerHTML;if(y){k.status=b.DONE;k.loaded=1025;k.percent=100;p.trigger("UploadProgress",k);p.trigger("FileUploaded",k,{response:y})}},p.id)}if(p.settings.container){j=e(p.settings.container);if(b.getStyle(j,"position")==="static"){j.style.position="relative"}}p.bind("UploadFile",function(i,A){var B,y;if(A.status==b.DONE||A.status==b.FAILED||i.state==b.STOPPED){return}B=e("form_"+A.id);y=e("input_"+A.id);y.setAttribute("name",i.settings.file_data_name);B.setAttribute("action",i.settings.url);b.each(b.extend({name:A.target_name||A.name},i.settings.multipart_params),function(E,C){var D=a.createElement("input");b.extend(D,{type:"hidden",name:C,value:E});B.insertBefore(D,B.firstChild)});k=A;e("form_"+q).style.top=-1048575+"px";B.submit()});p.bind("FileUploaded",function(i){i.refresh()});p.bind("StateChanged",function(i){if(i.state==b.STARTED){u()}else{if(i.state==b.STOPPED){d.setTimeout(function(){b.removeEvent(n,"load",i.id);if(n.parentNode){n.parentNode.removeChild(n)}},0)}}b.each(i.files,function(A,y){if(A.status===b.DONE||A.status===b.FAILED){var B=e("form_"+A.id);if(B){B.parentNode.removeChild(B)}}})});p.bind("Refresh",function(y){var F,A,B,C,i,G,H,E,D;F=e(y.settings.browse_button);if(F){i=b.getPos(F,e(y.settings.container));G=b.getSize(F);H=e("form_"+q);E=e("input_"+q);b.extend(H.style,{top:i.y+"px",left:i.x+"px",width:G.w+"px",height:G.h+"px"});if(y.features.triggerDialog){if(b.getStyle(F,"position")==="static"){b.extend(F.style,{position:"relative"})}D=parseInt(F.style.zIndex,10);if(isNaN(D)){D=0}b.extend(F.style,{zIndex:D});b.extend(H.style,{zIndex:D-1})}B=y.settings.browse_button_hover;C=y.settings.browse_button_active;A=y.features.triggerDialog?F:H;if(B){b.addEvent(A,"mouseover",function(){b.addClass(F,B)},y.id);b.addEvent(A,"mouseout",function(){b.removeClass(F,B)},y.id)}if(C){b.addEvent(A,"mousedown",function(){b.addClass(F,C)},y.id);b.addEvent(a.body,"mouseup",function(){b.removeClass(F,C)},y.id)}}});f.bind("FilesRemoved",function(y,B){var A,C;for(A=0;A<B.length;A++){C=e("form_"+B[A].id);if(C){C.parentNode.removeChild(C)}}});f.bind("DisableBrowse",function(i,A){var y=a.getElementById("input_"+q);if(y){y.disabled=A}});f.bind("Destroy",function(i){var y,A,B,C={inputContainer:"form_"+q,inputFile:"input_"+q,browseButton:i.settings.browse_button};for(y in C){A=e(C[y]);if(A){b.removeAllEvents(A,i.id)}}b.removeAllEvents(a.body,i.id);b.each(z,function(E,D){B=e("form_"+E);if(B){j.removeChild(B)}})});v()});g({success:true})}})})(window,document,plupload);