jbasdf-uploader 0.1.8
Sign up to get free protection for your applications and to get access to all the features.
- data/MIT-LICENSE +20 -0
- data/README.rdoc +323 -0
- data/Rakefile +67 -0
- data/TODO +3 -0
- data/VERSION +1 -0
- data/app/controllers/uploader/uploads_controller.rb +126 -0
- data/app/helpers/uploader_helper.rb +17 -0
- data/app/views/uploads/_swf_javascript.html.erb +63 -0
- data/app/views/uploads/_swf_upload.html.erb +32 -0
- data/config/uploader_routes.rb +3 -0
- data/db/migrate/20090517040220_create_uploads.rb +38 -0
- data/lib/active_record/acts/uploader_upload.rb +234 -0
- data/lib/daemons/amazonaws.rb +36 -0
- data/lib/uploader.rb +24 -0
- data/lib/uploader/exceptions.rb +5 -0
- data/lib/uploader/initialize_routes.rb +8 -0
- data/lib/uploader/middleware/flash_session_cookie_middleware.rb +18 -0
- data/lib/uploader/mime_type_groups.rb +18 -0
- data/lib/uploader/tasks.rb +42 -0
- data/locales/ar.yml +17 -0
- data/locales/bg.yml +17 -0
- data/locales/ca.yml +17 -0
- data/locales/cs.yml +17 -0
- data/locales/da.yml +17 -0
- data/locales/de.yml +17 -0
- data/locales/el.yml +17 -0
- data/locales/en.yml +16 -0
- data/locales/es.yml +17 -0
- data/locales/fr.yml +17 -0
- data/locales/it.yml +17 -0
- data/locales/iw.yml +17 -0
- data/locales/ja.yml +17 -0
- data/locales/ko.yml +17 -0
- data/locales/lt.yml +17 -0
- data/locales/lv.yml +17 -0
- data/locales/nl.yml +17 -0
- data/locales/no.yml +18 -0
- data/locales/pl.yml +17 -0
- data/locales/pt.yml +17 -0
- data/locales/ro.yml +17 -0
- data/locales/ru.yml +17 -0
- data/locales/sk.yml +17 -0
- data/locales/sl.yml +17 -0
- data/locales/sr.yml +17 -0
- data/locales/sv.yml +17 -0
- data/locales/tl.yml +17 -0
- data/locales/uk.yml +17 -0
- data/locales/vi.yml +17 -0
- data/locales/zh-CN.yml +17 -0
- data/locales/zh-TW.yml +17 -0
- data/locales/zh.yml +17 -0
- data/public/images/SWFUploadButton.png +0 -0
- data/public/images/file_icons/excel.gif +0 -0
- data/public/images/file_icons/file.gif +0 -0
- data/public/images/file_icons/file.png +0 -0
- data/public/images/file_icons/file_aac.gif +0 -0
- data/public/images/file_icons/file_ai.gif +0 -0
- data/public/images/file_icons/file_avi.gif +0 -0
- data/public/images/file_icons/file_bin.gif +0 -0
- data/public/images/file_icons/file_bmp.gif +0 -0
- data/public/images/file_icons/file_cue.gif +0 -0
- data/public/images/file_icons/file_divx.gif +0 -0
- data/public/images/file_icons/file_doc.gif +0 -0
- data/public/images/file_icons/file_eps.gif +0 -0
- data/public/images/file_icons/file_flac.gif +0 -0
- data/public/images/file_icons/file_flv.gif +0 -0
- data/public/images/file_icons/file_gif.gif +0 -0
- data/public/images/file_icons/file_html.gif +0 -0
- data/public/images/file_icons/file_ical.gif +0 -0
- data/public/images/file_icons/file_indd.gif +0 -0
- data/public/images/file_icons/file_inx.gif +0 -0
- data/public/images/file_icons/file_iso.gif +0 -0
- data/public/images/file_icons/file_jpg.gif +0 -0
- data/public/images/file_icons/file_mov.gif +0 -0
- data/public/images/file_icons/file_mp3.gif +0 -0
- data/public/images/file_icons/file_mpg.gif +0 -0
- data/public/images/file_icons/file_pdf.gif +0 -0
- data/public/images/file_icons/file_php.gif +0 -0
- data/public/images/file_icons/file_png.gif +0 -0
- data/public/images/file_icons/file_pps.gif +0 -0
- data/public/images/file_icons/file_ppt.gif +0 -0
- data/public/images/file_icons/file_psd.gif +0 -0
- data/public/images/file_icons/file_qxd.gif +0 -0
- data/public/images/file_icons/file_qxp.gif +0 -0
- data/public/images/file_icons/file_raw.gif +0 -0
- data/public/images/file_icons/file_rtf.gif +0 -0
- data/public/images/file_icons/file_svg.gif +0 -0
- data/public/images/file_icons/file_tif.gif +0 -0
- data/public/images/file_icons/file_txt.gif +0 -0
- data/public/images/file_icons/file_vcf.gif +0 -0
- data/public/images/file_icons/file_wav.gif +0 -0
- data/public/images/file_icons/file_wma.gif +0 -0
- data/public/images/file_icons/file_xls.gif +0 -0
- data/public/images/file_icons/file_xml.gif +0 -0
- data/public/images/file_icons/mp3.gif +0 -0
- data/public/images/file_icons/pdf.gif +0 -0
- data/public/images/file_icons/pdf.png +0 -0
- data/public/images/file_icons/text.gif +0 -0
- data/public/images/file_icons/text.png +0 -0
- data/public/images/file_icons/word.gif +0 -0
- data/public/javascripts/swfupload/fileprogress.js +151 -0
- data/public/javascripts/swfupload/handlers.js +206 -0
- data/public/javascripts/swfupload/swfupload.cookies.js +53 -0
- data/public/javascripts/swfupload/swfupload.js +945 -0
- data/public/javascripts/swfupload/swfupload.queue.js +77 -0
- data/public/javascripts/swfupload/swfupload.swfobject.js +110 -0
- data/public/stylesheets/swfupload.css +26 -0
- data/public/swf/swfupload.swf +0 -0
- data/rails/init.rb +10 -0
- data/rdoc/classes/ActionController.html +107 -0
- data/rdoc/classes/ActionController/Routing.html +107 -0
- data/rdoc/classes/ActionController/Routing/RouteSet.html +148 -0
- data/rdoc/classes/ActiveRecord.html +105 -0
- data/rdoc/classes/ActiveRecord/Acts/UploaderUpload/ClassMethods.html +186 -0
- data/rdoc/classes/ActiveRecord/Acts/UploaderUpload/InstanceMethods.html +750 -0
- data/rdoc/classes/ActiveRecord/Acts/UploaderUpload/SingletonMethods.html +111 -0
- data/rdoc/classes/Uploader.html +126 -0
- data/rdoc/classes/Uploader/Exceptions.html +111 -0
- data/rdoc/classes/Uploader/Exceptions/MissingTemplateError.html +111 -0
- data/rdoc/classes/Uploader/FlashSessionCookieMiddleware.html +177 -0
- data/rdoc/classes/Uploader/MimeTypeGroups.html +143 -0
- data/rdoc/classes/Uploader/Tasks.html +146 -0
- data/rdoc/created.rid +1 -0
- data/rdoc/files/README_rdoc.html +501 -0
- data/rdoc/files/lib/active_record/acts/uploader_upload_rb.html +101 -0
- data/rdoc/files/lib/uploader/exceptions_rb.html +101 -0
- data/rdoc/files/lib/uploader/initialize_routes_rb.html +101 -0
- data/rdoc/files/lib/uploader/middleware/flash_session_cookie_middleware_rb.html +108 -0
- data/rdoc/files/lib/uploader/mime_type_groups_rb.html +101 -0
- data/rdoc/files/lib/uploader/tasks_rb.html +110 -0
- data/rdoc/files/lib/uploader_rb.html +112 -0
- data/rdoc/fr_class_index.html +39 -0
- data/rdoc/fr_file_index.html +35 -0
- data/rdoc/fr_method_index.html +54 -0
- data/rdoc/index.html +24 -0
- data/rdoc/rdoc-style.css +208 -0
- data/tasks/rails.rake +2 -0
- data/test/test_helper.rb +3 -0
- data/test/unit/upload_test.rb +5 -0
- data/uninstall.rb +0 -0
- data/uploader.gemspec +182 -0
- metadata +204 -0
@@ -0,0 +1,77 @@
|
|
1
|
+
/*
|
2
|
+
Queue Plug-in
|
3
|
+
|
4
|
+
Features:
|
5
|
+
*Adds a cancelQueue() method for cancelling the entire queue.
|
6
|
+
*All queued files are uploaded when startUpload() is called.
|
7
|
+
*If false is returned from uploadComplete then the queue upload is stopped.
|
8
|
+
If false is not returned (strict comparison) then the queue upload is continued.
|
9
|
+
*Adds a QueueComplete event that is fired when all the queued files have finished uploading.
|
10
|
+
Set the event handler with the queue_complete_handler setting.
|
11
|
+
|
12
|
+
*/
|
13
|
+
|
14
|
+
var SWFUpload;
|
15
|
+
if (typeof(SWFUpload) === "function") {
|
16
|
+
SWFUpload.queue = {};
|
17
|
+
|
18
|
+
SWFUpload.prototype.initSettings = (function (oldInitSettings) {
|
19
|
+
return function () {
|
20
|
+
if (typeof(oldInitSettings) === "function") {
|
21
|
+
oldInitSettings.call(this);
|
22
|
+
}
|
23
|
+
|
24
|
+
this.customSettings.queue_cancelled_flag = false;
|
25
|
+
this.customSettings.queue_upload_count = 0;
|
26
|
+
|
27
|
+
this.settings.user_upload_complete_handler = this.settings.upload_complete_handler;
|
28
|
+
this.settings.upload_complete_handler = SWFUpload.queue.uploadCompleteHandler;
|
29
|
+
|
30
|
+
this.settings.queue_complete_handler = this.settings.queue_complete_handler || null;
|
31
|
+
};
|
32
|
+
})(SWFUpload.prototype.initSettings);
|
33
|
+
|
34
|
+
SWFUpload.prototype.startUpload = function (fileID) {
|
35
|
+
this.customSettings.queue_cancelled_flag = false;
|
36
|
+
this.callFlash("StartUpload", false, [fileID]);
|
37
|
+
};
|
38
|
+
|
39
|
+
SWFUpload.prototype.cancelQueue = function () {
|
40
|
+
this.customSettings.queue_cancelled_flag = true;
|
41
|
+
this.stopUpload();
|
42
|
+
|
43
|
+
var stats = this.getStats();
|
44
|
+
while (stats.files_queued > 0) {
|
45
|
+
this.cancelUpload();
|
46
|
+
stats = this.getStats();
|
47
|
+
}
|
48
|
+
};
|
49
|
+
|
50
|
+
SWFUpload.queue.uploadCompleteHandler = function (file) {
|
51
|
+
var user_upload_complete_handler = this.settings.user_upload_complete_handler;
|
52
|
+
var continueUpload;
|
53
|
+
|
54
|
+
if (file.file_status === SWFUpload.FILE_STATUS.COMPLETE) {
|
55
|
+
this.customSettings.queue_upload_count++;
|
56
|
+
}
|
57
|
+
|
58
|
+
if (typeof(user_upload_complete_handler) === "function") {
|
59
|
+
continueUpload = (user_upload_complete_handler.call(this, file) === false) ? false : true;
|
60
|
+
} else {
|
61
|
+
continueUpload = true;
|
62
|
+
}
|
63
|
+
|
64
|
+
if (continueUpload) {
|
65
|
+
var stats = this.getStats();
|
66
|
+
if (stats.files_queued > 0 && this.customSettings.queue_cancelled_flag === false) {
|
67
|
+
this.startUpload();
|
68
|
+
} else if (this.customSettings.queue_cancelled_flag === false) {
|
69
|
+
this.queueEvent("queue_complete_handler", [this.customSettings.queue_upload_count]);
|
70
|
+
this.customSettings.queue_upload_count = 0;
|
71
|
+
} else {
|
72
|
+
this.customSettings.queue_cancelled_flag = false;
|
73
|
+
this.customSettings.queue_upload_count = 0;
|
74
|
+
}
|
75
|
+
}
|
76
|
+
};
|
77
|
+
}
|
@@ -0,0 +1,110 @@
|
|
1
|
+
/*
|
2
|
+
SWFUpload.SWFObject Plugin
|
3
|
+
|
4
|
+
Summary:
|
5
|
+
This plugin uses SWFObject to embed SWFUpload dynamically in the page. SWFObject provides accurate Flash Player detection and DOM Ready loading.
|
6
|
+
This plugin replaces the Graceful Degradation plugin.
|
7
|
+
|
8
|
+
Features:
|
9
|
+
* swfupload_load_failed_hander event
|
10
|
+
* swfupload_pre_load_handler event
|
11
|
+
* minimum_flash_version setting (default: "9.0.28")
|
12
|
+
* SWFUpload.onload event for early loading
|
13
|
+
|
14
|
+
Usage:
|
15
|
+
Provide handlers and settings as needed. When using the SWFUpload.SWFObject plugin you should initialize SWFUploading
|
16
|
+
in SWFUpload.onload rather than in window.onload. When initialized this way SWFUpload can load earlier preventing the UI flicker
|
17
|
+
that was seen using the Graceful Degradation plugin.
|
18
|
+
|
19
|
+
<script type="text/javascript">
|
20
|
+
var swfu;
|
21
|
+
SWFUpload.onload = function () {
|
22
|
+
swfu = new SWFUpload({
|
23
|
+
minimum_flash_version: "9.0.28",
|
24
|
+
swfupload_pre_load_handler: swfuploadPreLoad,
|
25
|
+
swfupload_load_failed_handler: swfuploadLoadFailed
|
26
|
+
});
|
27
|
+
};
|
28
|
+
</script>
|
29
|
+
|
30
|
+
Notes:
|
31
|
+
You must provide set minimum_flash_version setting to "8" if you are using SWFUpload for Flash Player 8.
|
32
|
+
The swfuploadLoadFailed event is only fired if the minimum version of Flash Player is not met. Other issues such as missing SWF files, browser bugs
|
33
|
+
or corrupt Flash Player installations will not trigger this event.
|
34
|
+
The swfuploadPreLoad event is fired as soon as the minimum version of Flash Player is found. It does not wait for SWFUpload to load and can
|
35
|
+
be used to prepare the SWFUploadUI and hide alternate content.
|
36
|
+
swfobject's onDomReady event is cross-browser safe but will default to the window.onload event when DOMReady is not supported by the browser.
|
37
|
+
Early DOM Loading is supported in major modern browsers but cannot be guaranteed for every browser ever made.
|
38
|
+
*/
|
39
|
+
|
40
|
+
|
41
|
+
/* SWFObject v2.0 rc4 <http://code.google.com/p/swfobject/>
|
42
|
+
Copyright (c) 2007 Geoff Stearns, Michael Williams, and Bobby van der Sluis
|
43
|
+
This software is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
|
44
|
+
*/
|
45
|
+
var swfobject=function(){var X="undefined",P="object",a="visibility:visible",e="visibility:hidden",B="Shockwave Flash",h="ShockwaveFlash.ShockwaveFlash",V="application/x-shockwave-flash",K="SWFObjectExprInst",G=window,g=document,N=navigator,f=[],H=[],Q=null,L=null,S=false,C=false;var Y=function(){var l=typeof g.getElementById!=X&&typeof g.getElementsByTagName!=X&&typeof g.createElement!=X&&typeof g.appendChild!=X&&typeof g.replaceChild!=X&&typeof g.removeChild!=X&&typeof g.cloneNode!=X,t=[0,0,0],n=null;if(typeof N.plugins!=X&&typeof N.plugins[B]==P){n=N.plugins[B].description;if(n){n=n.replace(/^.*\s+(\S+\s+\S+$)/,"$1");t[0]=parseInt(n.replace(/^(.*)\..*$/,"$1"),10);t[1]=parseInt(n.replace(/^.*\.(.*)\s.*$/,"$1"),10);t[2]=/r/.test(n)?parseInt(n.replace(/^.*r(.*)$/,"$1"),10):0}}else{if(typeof G.ActiveXObject!=X){var o=null,s=false;try{o=new ActiveXObject(h+".7")}catch(k){try{o=new ActiveXObject(h+".6");t=[6,0,21];o.AllowScriptAccess="always"}catch(k){if(t[0]==6){s=true}}if(!s){try{o=new ActiveXObject(h)}catch(k){}}}if(!s&&o){try{n=o.GetVariable("$version");if(n){n=n.split(" ")[1].split(",");t=[parseInt(n[0],10),parseInt(n[1],10),parseInt(n[2],10)]}}catch(k){}}}}var v=N.userAgent.toLowerCase(),j=N.platform.toLowerCase(),r=/webkit/.test(v)?parseFloat(v.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,i=false,q=j?/win/.test(j):/win/.test(v),m=j?/mac/.test(j):/mac/.test(v);/*@cc_on i=true;@if(@_win32)q=true;@elif(@_mac)m=true;@end@*/return{w3cdom:l,pv:t,webkit:r,ie:i,win:q,mac:m}}();var d=function(){if(!Y.w3cdom){return }J(I);if(Y.ie&&Y.win){try{g.write("<script id=__ie_ondomload defer=true src=//:><\/script>");var i=b("__ie_ondomload");if(i){i.onreadystatechange=function(){if(this.readyState=="complete"){this.parentNode.removeChild(this);U()}}}}catch(j){}}if(Y.webkit&&typeof g.readyState!=X){Q=setInterval(function(){if(/loaded|complete/.test(g.readyState)){U()}},10)}if(typeof g.addEventListener!=X){g.addEventListener("DOMContentLoaded",U,null)}M(U)}();function U(){if(S){return }if(Y.ie&&Y.win){var m=W("span");try{var l=g.getElementsByTagName("body")[0].appendChild(m);l.parentNode.removeChild(l)}catch(n){return }}S=true;if(Q){clearInterval(Q);Q=null}var j=f.length;for(var k=0;k<j;k++){f[k]()}}function J(i){if(S){i()}else{f[f.length]=i}}function M(j){if(typeof G.addEventListener!=X){G.addEventListener("load",j,false)}else{if(typeof g.addEventListener!=X){g.addEventListener("load",j,false)}else{if(typeof G.attachEvent!=X){G.attachEvent("onload",j)}else{if(typeof G.onload=="function"){var i=G.onload;G.onload=function(){i();j()}}else{G.onload=j}}}}}function I(){var l=H.length;for(var j=0;j<l;j++){var m=H[j].id;if(Y.pv[0]>0){var k=b(m);if(k){H[j].width=k.getAttribute("width")?k.getAttribute("width"):"0";H[j].height=k.getAttribute("height")?k.getAttribute("height"):"0";if(O(H[j].swfVersion)){if(Y.webkit&&Y.webkit<312){T(k)}}else{if(H[j].expressInstall&&!C&&O("6.0.65")&&(Y.win||Y.mac)){D(H[j])}else{c(k)}}}}A("#"+m,a)}}function T(m){var k=m.getElementsByTagName(P)[0];if(k){var p=W("embed"),r=k.attributes;if(r){var o=r.length;for(var n=0;n<o;n++){if(r[n].nodeName.toLowerCase()=="data"){p.setAttribute("src",r[n].nodeValue)}else{p.setAttribute(r[n].nodeName,r[n].nodeValue)}}}var q=k.childNodes;if(q){var s=q.length;for(var l=0;l<s;l++){if(q[l].nodeType==1&&q[l].nodeName.toLowerCase()=="param"){p.setAttribute(q[l].getAttribute("name"),q[l].getAttribute("value"))}}}m.parentNode.replaceChild(p,m)}}function F(i){if(Y.ie&&Y.win&&O("8.0.0")){G.attachEvent("onunload",function(){var k=b(i);for(var j in k){if(typeof k[j]=="function"){k[j]=function(){}}}k.parentNode.removeChild(k)})}}function D(j){C=true;var o=b(j.id);if(o){if(j.altContentId){var l=b(j.altContentId);if(l){L=l}}else{L=Z(o)}if(!(/%$/.test(j.width))&&parseInt(j.width,10)<310){j.width="310"}if(!(/%$/.test(j.height))&&parseInt(j.height,10)<137){j.height="137"}g.title=g.title.slice(0,47)+" - Flash Player Installation";var n=Y.ie&&Y.win?"ActiveX":"PlugIn",k=g.title,m="MMredirectURL="+G.location+"&MMplayerType="+n+"&MMdoctitle="+k,p=j.id;if(Y.ie&&Y.win&&o.readyState!=4){var i=W("div");p+="SWFObjectNew";i.setAttribute("id",p);o.parentNode.insertBefore(i,o);o.style.display="none";G.attachEvent("onload",function(){o.parentNode.removeChild(o)})}R({data:j.expressInstall,id:K,width:j.width,height:j.height},{flashvars:m},p)}}function c(j){if(Y.ie&&Y.win&&j.readyState!=4){var i=W("div");j.parentNode.insertBefore(i,j);i.parentNode.replaceChild(Z(j),i);j.style.display="none";G.attachEvent("onload",function(){j.parentNode.removeChild(j)})}else{j.parentNode.replaceChild(Z(j),j)}}function Z(n){var m=W("div");if(Y.win&&Y.ie){m.innerHTML=n.innerHTML}else{var k=n.getElementsByTagName(P)[0];if(k){var o=k.childNodes;if(o){var j=o.length;for(var l=0;l<j;l++){if(!(o[l].nodeType==1&&o[l].nodeName.toLowerCase()=="param")&&!(o[l].nodeType==8)){m.appendChild(o[l].cloneNode(true))}}}}}return m}function R(AE,AC,q){var p,t=b(q);if(typeof AE.id==X){AE.id=q}if(Y.ie&&Y.win){var AD="";for(var z in AE){if(AE[z]!=Object.prototype[z]){if(z=="data"){AC.movie=AE[z]}else{if(z.toLowerCase()=="styleclass"){AD+=' class="'+AE[z]+'"'}else{if(z!="classid"){AD+=" "+z+'="'+AE[z]+'"'}}}}}var AB="";for(var y in AC){if(AC[y]!=Object.prototype[y]){AB+='<param name="'+y+'" value="'+AC[y]+'" />'}}t.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+AD+">"+AB+"</object>";F(AE.id);p=b(AE.id)}else{if(Y.webkit&&Y.webkit<312){var AA=W("embed");AA.setAttribute("type",V);for(var x in AE){if(AE[x]!=Object.prototype[x]){if(x=="data"){AA.setAttribute("src",AE[x])}else{if(x.toLowerCase()=="styleclass"){AA.setAttribute("class",AE[x])}else{if(x!="classid"){AA.setAttribute(x,AE[x])}}}}}for(var w in AC){if(AC[w]!=Object.prototype[w]){if(w!="movie"){AA.setAttribute(w,AC[w])}}}t.parentNode.replaceChild(AA,t);p=AA}else{var s=W(P);s.setAttribute("type",V);for(var v in AE){if(AE[v]!=Object.prototype[v]){if(v.toLowerCase()=="styleclass"){s.setAttribute("class",AE[v])}else{if(v!="classid"){s.setAttribute(v,AE[v])}}}}for(var u in AC){if(AC[u]!=Object.prototype[u]&&u!="movie"){E(s,u,AC[u])}}t.parentNode.replaceChild(s,t);p=s}}return p}function E(k,i,j){var l=W("param");l.setAttribute("name",i);l.setAttribute("value",j);k.appendChild(l)}function b(i){return g.getElementById(i)}function W(i){return g.createElement(i)}function O(k){var j=Y.pv,i=k.split(".");i[0]=parseInt(i[0],10);i[1]=parseInt(i[1],10);i[2]=parseInt(i[2],10);return(j[0]>i[0]||(j[0]==i[0]&&j[1]>i[1])||(j[0]==i[0]&&j[1]==i[1]&&j[2]>=i[2]))?true:false}function A(m,j){if(Y.ie&&Y.mac){return }var l=g.getElementsByTagName("head")[0],k=W("style");k.setAttribute("type","text/css");k.setAttribute("media","screen");if(!(Y.ie&&Y.win)&&typeof g.createTextNode!=X){k.appendChild(g.createTextNode(m+" {"+j+"}"))}l.appendChild(k);if(Y.ie&&Y.win&&typeof g.styleSheets!=X&&g.styleSheets.length>0){var i=g.styleSheets[g.styleSheets.length-1];if(typeof i.addRule==P){i.addRule(m,j)}}}return{registerObject:function(l,i,k){if(!Y.w3cdom||!l||!i){return }var j={};j.id=l;j.swfVersion=i;j.expressInstall=k?k:false;H[H.length]=j;A("#"+l,e)},getObjectById:function(l){var i=null;if(Y.w3cdom&&S){var j=b(l);if(j){var k=j.getElementsByTagName(P)[0];if(!k||(k&&typeof j.SetVariable!=X)){i=j}else{if(typeof k.SetVariable!=X){i=k}}}}return i},embedSWF:function(n,u,r,t,j,m,k,p,s){if(!Y.w3cdom||!n||!u||!r||!t||!j){return }r+="";t+="";if(O(j)){A("#"+u,e);var q=(typeof s==P)?s:{};q.data=n;q.width=r;q.height=t;var o=(typeof p==P)?p:{};if(typeof k==P){for(var l in k){if(k[l]!=Object.prototype[l]){if(typeof o.flashvars!=X){o.flashvars+="&"+l+"="+k[l]}else{o.flashvars=l+"="+k[l]}}}}J(function(){R(q,o,u);A("#"+u,a)})}else{if(m&&!C&&O("6.0.65")&&(Y.win||Y.mac)){A("#"+u,e);J(function(){var i={};i.id=i.altContentId=u;i.width=r;i.height=t;i.expressInstall=m;D(i);A("#"+u,a)})}}},getFlashPlayerVersion:function(){return{major:Y.pv[0],minor:Y.pv[1],release:Y.pv[2]}},hasFlashPlayerVersion:O,createSWF:function(k,j,i){if(Y.w3cdom&&S){return R(k,j,i)}else{return undefined}},createCSS:function(j,i){if(Y.w3cdom){A(j,i)}},addDomLoadEvent:J,addLoadEvent:M,getQueryParamValue:function(m){var l=g.location.search||g.location.hash;if(m==null){return l}if(l){var k=l.substring(1).split("&");for(var j=0;j<k.length;j++){if(k[j].substring(0,k[j].indexOf("="))==m){return k[j].substring((k[j].indexOf("=")+1))}}}return""},expressInstallCallback:function(){if(C&&L){var i=b(K);if(i){i.parentNode.replaceChild(L,i);L=null;C=false}}}}}();
|
46
|
+
|
47
|
+
|
48
|
+
var SWFUpload;
|
49
|
+
if (typeof(SWFUpload) === "function") {
|
50
|
+
SWFUpload.onload = function () {};
|
51
|
+
|
52
|
+
swfobject.addDomLoadEvent(function () {
|
53
|
+
if (typeof(SWFUpload.onload) === "function") {
|
54
|
+
SWFUpload.onload.call(window);
|
55
|
+
}
|
56
|
+
});
|
57
|
+
|
58
|
+
SWFUpload.prototype.initSettings = (function (oldInitSettings) {
|
59
|
+
return function () {
|
60
|
+
if (typeof(oldInitSettings) === "function") {
|
61
|
+
oldInitSettings.call(this);
|
62
|
+
}
|
63
|
+
|
64
|
+
this.ensureDefault = function (settingName, defaultValue) {
|
65
|
+
this.settings[settingName] = (this.settings[settingName] == undefined) ? defaultValue : this.settings[settingName];
|
66
|
+
};
|
67
|
+
|
68
|
+
this.ensureDefault("minimum_flash_version", "9.0.28");
|
69
|
+
this.ensureDefault("swfupload_pre_load_handler", null);
|
70
|
+
this.ensureDefault("swfupload_load_failed_handler", null);
|
71
|
+
|
72
|
+
delete this.ensureDefault;
|
73
|
+
|
74
|
+
};
|
75
|
+
})(SWFUpload.prototype.initSettings);
|
76
|
+
|
77
|
+
|
78
|
+
SWFUpload.prototype.loadFlash = function (oldLoadFlash) {
|
79
|
+
return function () {
|
80
|
+
var hasFlash = swfobject.hasFlashPlayerVersion(this.settings.minimum_flash_version);
|
81
|
+
|
82
|
+
if (hasFlash) {
|
83
|
+
this.queueEvent("swfupload_pre_load_handler");
|
84
|
+
if (typeof(oldLoadFlash) === "function") {
|
85
|
+
oldLoadFlash.call(this);
|
86
|
+
}
|
87
|
+
} else {
|
88
|
+
this.queueEvent("swfupload_load_failed_handler");
|
89
|
+
}
|
90
|
+
};
|
91
|
+
|
92
|
+
}(SWFUpload.prototype.loadFlash);
|
93
|
+
|
94
|
+
SWFUpload.prototype.displayDebugInfo = function (oldDisplayDebugInfo) {
|
95
|
+
return function () {
|
96
|
+
if (typeof(oldDisplayDebugInfo) === "function") {
|
97
|
+
oldDisplayDebugInfo.call(this);
|
98
|
+
}
|
99
|
+
|
100
|
+
this.debug(
|
101
|
+
[
|
102
|
+
"SWFUpload.SWFObject Plugin settings:", "\n",
|
103
|
+
"\t", "minimum_flash_version: ", this.settings.minimum_flash_version, "\n",
|
104
|
+
"\t", "swfupload_pre_load_handler assigned: ", (typeof(this.settings.swfupload_pre_load_handler) === "function").toString(), "\n",
|
105
|
+
"\t", "swfupload_load_failed_handler assigned: ", (typeof(this.settings.swfupload_load_failed_handler) === "function").toString(), "\n",
|
106
|
+
].join("")
|
107
|
+
);
|
108
|
+
};
|
109
|
+
}(SWFUpload.prototype.displayDebugInfo);
|
110
|
+
}
|
@@ -0,0 +1,26 @@
|
|
1
|
+
div.uploadStatus{margin:5px;}
|
2
|
+
#swf_fs_upload_progress{font-size:1.3em;}
|
3
|
+
#deliver-uploads #upload-list{font-size:1.3em;}
|
4
|
+
#deliver-uploads #upload-list table {border-collapse:collapse;}
|
5
|
+
#deliver-uploads #upload-list td{padding:3px 6px;}
|
6
|
+
#deliver-uploads #upload-controls{width:365px;}
|
7
|
+
#deliver-uploads #swfupload_container .legend{color:#231F20;font-size:1.1em;font-weight:bold;}
|
8
|
+
|
9
|
+
#swfupload_container .progressWrapper{width:357px;overflow:hidden;}
|
10
|
+
#swfupload_container .progressContainer{margin:5px;padding:4px;border:solid 1px #E8E8E8;background-color:#F7F7F7;overflow:hidden;}
|
11
|
+
#swfupload_container .message{margin:1em 0;padding:10px 20px;border:solid 1px #FFDD99;background-color:#FFFFCC;overflow:hidden;}
|
12
|
+
#swfupload_container .red{border:solid 1px #B50000;background-color:#FFEBEB;}
|
13
|
+
#swfupload_container .green{border:solid 1px #DDF0DD;background-color:#EBFFEB;}
|
14
|
+
#swfupload_container .blue{border:solid 1px #CEE2F2;background-color:#F0F5FF;}
|
15
|
+
#swfupload_container .progressName{font-size:8pt;font-weight:700;color:#555;width:323px;height:14px;text-align:left;white-space:nowrap;overflow:hidden;}
|
16
|
+
#swfupload_container .progressBarInProgress,
|
17
|
+
#swfupload_container .progressBarComplete,
|
18
|
+
#swfupload_container .progressBarError{font-size:0;width:0%;height:2px;background-color:blue;margin-top:2px;}
|
19
|
+
#swfupload_container .progressBarComplete{width:100%;background-color:green;visibility:hidden;}
|
20
|
+
#swfupload_container .progressBarError{width:100%;background-color:red;visibility:hidden;}
|
21
|
+
#swfupload_container .progressBarStatus{margin-top:2px;width:337px;font-size:7pt;font-family:Arial;text-align:left;white-space:nowrap;}
|
22
|
+
#swfupload_container a.progressCancel{font-size:0;display:block;height:14px;width:14px;background-image:url(../images/cancelbutton.gif);background-repeat:no-repeat;background-position:-14px 0px;float:right;}
|
23
|
+
#swfupload_container a.progressCancel:hover{background-position:0px 0px;}
|
24
|
+
|
25
|
+
.swf-error-msg{background-color: #FFFF66; border-top: solid 4px #FF9966; border-bottom: solid 4px #FF9966; margin: 10px 25px; padding: 10px 15px;}
|
26
|
+
#swf_cancel_button{margin-left: 2px; height: 22px; font-size: 8pt;}
|
Binary file
|
data/rails/init.rb
ADDED
@@ -0,0 +1,10 @@
|
|
1
|
+
require 'uploader'
|
2
|
+
require 'uploader/initialize_routes'
|
3
|
+
|
4
|
+
ActiveRecord::Base.class_eval { include ActiveRecord::Acts::UploaderUpload }
|
5
|
+
ActionController::Base.send :helper, UploaderHelper
|
6
|
+
I18n.load_path += Dir[ File.join(File.dirname(__FILE__), '..', 'locales', '*.{rb,yml}') ]
|
7
|
+
|
8
|
+
config.after_initialize do
|
9
|
+
ActionController::Dispatcher.middleware.use Uploader::FlashSessionCookieMiddleware, ActionController::Base.session_options[:key]
|
10
|
+
end
|
@@ -0,0 +1,107 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
+
<head>
|
8
|
+
<title>Module: ActionController</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
+
<link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
|
12
|
+
<script type="text/javascript">
|
13
|
+
// <![CDATA[
|
14
|
+
|
15
|
+
function popupCode( url ) {
|
16
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
+
}
|
18
|
+
|
19
|
+
function toggleCode( id ) {
|
20
|
+
if ( document.getElementById )
|
21
|
+
elem = document.getElementById( id );
|
22
|
+
else if ( document.all )
|
23
|
+
elem = eval( "document.all." + id );
|
24
|
+
else
|
25
|
+
return false;
|
26
|
+
|
27
|
+
elemStyle = elem.style;
|
28
|
+
|
29
|
+
if ( elemStyle.display != "block" ) {
|
30
|
+
elemStyle.display = "block"
|
31
|
+
} else {
|
32
|
+
elemStyle.display = "none"
|
33
|
+
}
|
34
|
+
|
35
|
+
return true;
|
36
|
+
}
|
37
|
+
|
38
|
+
// Make codeblocks hidden by default
|
39
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
+
|
41
|
+
// ]]>
|
42
|
+
</script>
|
43
|
+
|
44
|
+
</head>
|
45
|
+
<body>
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
<div id="classHeader">
|
50
|
+
<table class="header-table">
|
51
|
+
<tr class="top-aligned-row">
|
52
|
+
<td><strong>Module</strong></td>
|
53
|
+
<td class="class-name-in-header">ActionController</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
</td>
|
59
|
+
</tr>
|
60
|
+
|
61
|
+
</table>
|
62
|
+
</div>
|
63
|
+
<!-- banner header -->
|
64
|
+
|
65
|
+
<div id="bodyContent">
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
<div id="contextContent">
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
</div>
|
74
|
+
|
75
|
+
|
76
|
+
</div>
|
77
|
+
|
78
|
+
|
79
|
+
<!-- if includes -->
|
80
|
+
|
81
|
+
<div id="section">
|
82
|
+
|
83
|
+
<div id="class-list">
|
84
|
+
<h3 class="section-bar">Classes and Modules</h3>
|
85
|
+
|
86
|
+
Module <a href="ActionController/Routing.html" class="link">ActionController::Routing</a><br />
|
87
|
+
|
88
|
+
</div>
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
|
96
|
+
<!-- if method_list -->
|
97
|
+
|
98
|
+
|
99
|
+
</div>
|
100
|
+
|
101
|
+
|
102
|
+
<div id="validator-badges">
|
103
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
104
|
+
</div>
|
105
|
+
|
106
|
+
</body>
|
107
|
+
</html>
|
@@ -0,0 +1,107 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
+
<head>
|
8
|
+
<title>Module: ActionController::Routing</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
+
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
12
|
+
<script type="text/javascript">
|
13
|
+
// <![CDATA[
|
14
|
+
|
15
|
+
function popupCode( url ) {
|
16
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
+
}
|
18
|
+
|
19
|
+
function toggleCode( id ) {
|
20
|
+
if ( document.getElementById )
|
21
|
+
elem = document.getElementById( id );
|
22
|
+
else if ( document.all )
|
23
|
+
elem = eval( "document.all." + id );
|
24
|
+
else
|
25
|
+
return false;
|
26
|
+
|
27
|
+
elemStyle = elem.style;
|
28
|
+
|
29
|
+
if ( elemStyle.display != "block" ) {
|
30
|
+
elemStyle.display = "block"
|
31
|
+
} else {
|
32
|
+
elemStyle.display = "none"
|
33
|
+
}
|
34
|
+
|
35
|
+
return true;
|
36
|
+
}
|
37
|
+
|
38
|
+
// Make codeblocks hidden by default
|
39
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
+
|
41
|
+
// ]]>
|
42
|
+
</script>
|
43
|
+
|
44
|
+
</head>
|
45
|
+
<body>
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
<div id="classHeader">
|
50
|
+
<table class="header-table">
|
51
|
+
<tr class="top-aligned-row">
|
52
|
+
<td><strong>Module</strong></td>
|
53
|
+
<td class="class-name-in-header">ActionController::Routing</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
</td>
|
59
|
+
</tr>
|
60
|
+
|
61
|
+
</table>
|
62
|
+
</div>
|
63
|
+
<!-- banner header -->
|
64
|
+
|
65
|
+
<div id="bodyContent">
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
<div id="contextContent">
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
</div>
|
74
|
+
|
75
|
+
|
76
|
+
</div>
|
77
|
+
|
78
|
+
|
79
|
+
<!-- if includes -->
|
80
|
+
|
81
|
+
<div id="section">
|
82
|
+
|
83
|
+
<div id="class-list">
|
84
|
+
<h3 class="section-bar">Classes and Modules</h3>
|
85
|
+
|
86
|
+
Class <a href="Routing/RouteSet.html" class="link">ActionController::Routing::RouteSet</a><br />
|
87
|
+
|
88
|
+
</div>
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
|
96
|
+
<!-- if method_list -->
|
97
|
+
|
98
|
+
|
99
|
+
</div>
|
100
|
+
|
101
|
+
|
102
|
+
<div id="validator-badges">
|
103
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
104
|
+
</div>
|
105
|
+
|
106
|
+
</body>
|
107
|
+
</html>
|
@@ -0,0 +1,148 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
+
<head>
|
8
|
+
<title>Class: ActionController::Routing::RouteSet</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
+
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
12
|
+
<script type="text/javascript">
|
13
|
+
// <![CDATA[
|
14
|
+
|
15
|
+
function popupCode( url ) {
|
16
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
+
}
|
18
|
+
|
19
|
+
function toggleCode( id ) {
|
20
|
+
if ( document.getElementById )
|
21
|
+
elem = document.getElementById( id );
|
22
|
+
else if ( document.all )
|
23
|
+
elem = eval( "document.all." + id );
|
24
|
+
else
|
25
|
+
return false;
|
26
|
+
|
27
|
+
elemStyle = elem.style;
|
28
|
+
|
29
|
+
if ( elemStyle.display != "block" ) {
|
30
|
+
elemStyle.display = "block"
|
31
|
+
} else {
|
32
|
+
elemStyle.display = "none"
|
33
|
+
}
|
34
|
+
|
35
|
+
return true;
|
36
|
+
}
|
37
|
+
|
38
|
+
// Make codeblocks hidden by default
|
39
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
+
|
41
|
+
// ]]>
|
42
|
+
</script>
|
43
|
+
|
44
|
+
</head>
|
45
|
+
<body>
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
<div id="classHeader">
|
50
|
+
<table class="header-table">
|
51
|
+
<tr class="top-aligned-row">
|
52
|
+
<td><strong>Class</strong></td>
|
53
|
+
<td class="class-name-in-header">ActionController::Routing::RouteSet</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../../../files/lib/uploader/initialize_routes_rb.html">
|
59
|
+
lib/uploader/initialize_routes.rb
|
60
|
+
</a>
|
61
|
+
<br />
|
62
|
+
</td>
|
63
|
+
</tr>
|
64
|
+
|
65
|
+
<tr class="top-aligned-row">
|
66
|
+
<td><strong>Parent:</strong></td>
|
67
|
+
<td>
|
68
|
+
Object
|
69
|
+
</td>
|
70
|
+
</tr>
|
71
|
+
</table>
|
72
|
+
</div>
|
73
|
+
<!-- banner header -->
|
74
|
+
|
75
|
+
<div id="bodyContent">
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
<div id="contextContent">
|
80
|
+
|
81
|
+
|
82
|
+
|
83
|
+
</div>
|
84
|
+
|
85
|
+
<div id="method-list">
|
86
|
+
<h3 class="section-bar">Methods</h3>
|
87
|
+
|
88
|
+
<div class="name-list">
|
89
|
+
<a href="#M000001">load_routes_with_uploader!</a>
|
90
|
+
</div>
|
91
|
+
</div>
|
92
|
+
|
93
|
+
</div>
|
94
|
+
|
95
|
+
|
96
|
+
<!-- if includes -->
|
97
|
+
|
98
|
+
<div id="section">
|
99
|
+
|
100
|
+
|
101
|
+
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
|
106
|
+
|
107
|
+
<!-- if method_list -->
|
108
|
+
<div id="methods">
|
109
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
110
|
+
|
111
|
+
<div id="method-M000001" class="method-detail">
|
112
|
+
<a name="M000001"></a>
|
113
|
+
|
114
|
+
<div class="method-heading">
|
115
|
+
<a href="#M000001" class="method-signature">
|
116
|
+
<span class="method-name">load_routes_with_uploader!</span><span class="method-args">()</span>
|
117
|
+
</a>
|
118
|
+
</div>
|
119
|
+
|
120
|
+
<div class="method-description">
|
121
|
+
<p><a class="source-toggle" href="#"
|
122
|
+
onclick="toggleCode('M000001-source');return false;">[Source]</a></p>
|
123
|
+
<div class="method-source-code" id="M000001-source">
|
124
|
+
<pre>
|
125
|
+
<span class="ruby-comment cmt"># File lib/uploader/initialize_routes.rb, line 2</span>
|
126
|
+
2: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">load_routes_with_uploader!</span>
|
127
|
+
3: <span class="ruby-identifier">uploader_routes</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">dirname</span>(<span class="ruby-keyword kw">__FILE__</span>), <span class="ruby-operator">*</span><span class="ruby-node">%w[.. .. config uploader_routes.rb]</span>)
|
128
|
+
4: <span class="ruby-identifier">add_configuration_file</span>(<span class="ruby-identifier">uploader_routes</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">configuration_files</span>.<span class="ruby-identifier">include?</span> <span class="ruby-identifier">uploader_routes</span>
|
129
|
+
5: <span class="ruby-identifier">load_routes_without_uploader!</span>
|
130
|
+
6: <span class="ruby-keyword kw">end</span>
|
131
|
+
</pre>
|
132
|
+
</div>
|
133
|
+
</div>
|
134
|
+
</div>
|
135
|
+
|
136
|
+
|
137
|
+
</div>
|
138
|
+
|
139
|
+
|
140
|
+
</div>
|
141
|
+
|
142
|
+
|
143
|
+
<div id="validator-badges">
|
144
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
145
|
+
</div>
|
146
|
+
|
147
|
+
</body>
|
148
|
+
</html>
|