jquery.fileupload-rails 1.0.0.alpha → 1.0.0.beta
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -1
- data/Readme.md +21 -11
- data/demo/.gitignore +15 -0
- data/demo/Gemfile +39 -0
- data/demo/README.rdoc +261 -0
- data/demo/Rakefile +7 -0
- data/demo/app/assets/images/rails.png +0 -0
- data/demo/app/assets/javascripts/application.js.coffee +9 -0
- data/demo/app/assets/stylesheets/application.css +13 -0
- data/demo/app/controllers/application_controller.rb +7 -0
- data/demo/app/helpers/application_helper.rb +2 -0
- data/demo/app/mailers/.gitkeep +0 -0
- data/demo/app/models/.gitkeep +0 -0
- data/demo/app/views/application/basic.html.erb +4 -0
- data/demo/app/views/application/create.html.erb +1 -0
- data/demo/app/views/application/ui.html.erb +1 -0
- data/demo/app/views/layouts/application.html.erb +14 -0
- data/demo/config.ru +4 -0
- data/demo/config/application.rb +62 -0
- data/demo/config/boot.rb +6 -0
- data/demo/config/database.yml +25 -0
- data/demo/config/environment.rb +5 -0
- data/demo/config/environments/development.rb +37 -0
- data/demo/config/environments/production.rb +67 -0
- data/demo/config/environments/test.rb +37 -0
- data/demo/config/initializers/backtrace_silencers.rb +7 -0
- data/demo/config/initializers/inflections.rb +15 -0
- data/demo/config/initializers/mime_types.rb +5 -0
- data/demo/config/initializers/secret_token.rb +7 -0
- data/demo/config/initializers/session_store.rb +8 -0
- data/demo/config/initializers/wrap_parameters.rb +14 -0
- data/demo/config/locales/en.yml +5 -0
- data/demo/config/routes.rb +6 -0
- data/demo/db/seeds.rb +7 -0
- data/demo/doc/README_FOR_APP +2 -0
- data/demo/lib/assets/.gitkeep +0 -0
- data/demo/lib/tasks/.gitkeep +0 -0
- data/demo/log/.gitkeep +0 -0
- data/demo/public/404.html +26 -0
- data/demo/public/422.html +26 -0
- data/demo/public/500.html +25 -0
- data/demo/public/favicon.ico +0 -0
- data/demo/public/robots.txt +5 -0
- data/demo/script/rails +6 -0
- data/demo/test/fixtures/.gitkeep +0 -0
- data/demo/test/functional/.gitkeep +0 -0
- data/demo/test/integration/.gitkeep +0 -0
- data/demo/test/performance/browsing_test.rb +12 -0
- data/demo/test/test_helper.rb +13 -0
- data/demo/test/unit/.gitkeep +0 -0
- data/demo/vendor/plugins/.gitkeep +0 -0
- data/lib/jquery.fileupload-rails.rb +3 -4
- data/lib/jquery.fileupload-rails/version.rb +1 -1
- data/vendor/assets/javascripts/jquery.fileupload.js +18 -10
- data/vendor/legacy_assets/javascripts/jquery.fileupload-fp.js +219 -0
- data/vendor/legacy_assets/javascripts/jquery.fileupload-ip.js +160 -0
- data/vendor/legacy_assets/javascripts/jquery.fileupload-ui.js +702 -0
- data/vendor/legacy_assets/javascripts/jquery.postmessage-transport.js +117 -0
- data/vendor/legacy_assets/javascripts/jquery.xdr-transport.js +85 -0
- data/vendor/legacy_assets/stylesheets/jquery.fileupload-ui.css +84 -0
- metadata +57 -2
@@ -0,0 +1,117 @@
|
|
1
|
+
/*
|
2
|
+
* jQuery postMessage Transport Plugin 1.1
|
3
|
+
* https://github.com/blueimp/jQuery-File-Upload
|
4
|
+
*
|
5
|
+
* Copyright 2011, Sebastian Tschan
|
6
|
+
* https://blueimp.net
|
7
|
+
*
|
8
|
+
* Licensed under the MIT license:
|
9
|
+
* http://www.opensource.org/licenses/MIT
|
10
|
+
*/
|
11
|
+
|
12
|
+
/*jslint unparam: true, nomen: true */
|
13
|
+
/*global define, window, document */
|
14
|
+
|
15
|
+
(function (factory) {
|
16
|
+
'use strict';
|
17
|
+
if (typeof define === 'function' && define.amd) {
|
18
|
+
// Register as an anonymous AMD module:
|
19
|
+
define(['jquery'], factory);
|
20
|
+
} else {
|
21
|
+
// Browser globals:
|
22
|
+
factory(window.jQuery);
|
23
|
+
}
|
24
|
+
}(function ($) {
|
25
|
+
'use strict';
|
26
|
+
|
27
|
+
var counter = 0,
|
28
|
+
names = [
|
29
|
+
'accepts',
|
30
|
+
'cache',
|
31
|
+
'contents',
|
32
|
+
'contentType',
|
33
|
+
'crossDomain',
|
34
|
+
'data',
|
35
|
+
'dataType',
|
36
|
+
'headers',
|
37
|
+
'ifModified',
|
38
|
+
'mimeType',
|
39
|
+
'password',
|
40
|
+
'processData',
|
41
|
+
'timeout',
|
42
|
+
'traditional',
|
43
|
+
'type',
|
44
|
+
'url',
|
45
|
+
'username'
|
46
|
+
],
|
47
|
+
convert = function (p) {
|
48
|
+
return p;
|
49
|
+
};
|
50
|
+
|
51
|
+
$.ajaxSetup({
|
52
|
+
converters: {
|
53
|
+
'postmessage text': convert,
|
54
|
+
'postmessage json': convert,
|
55
|
+
'postmessage html': convert
|
56
|
+
}
|
57
|
+
});
|
58
|
+
|
59
|
+
$.ajaxTransport('postmessage', function (options) {
|
60
|
+
if (options.postMessage && window.postMessage) {
|
61
|
+
var iframe,
|
62
|
+
loc = $('<a>').prop('href', options.postMessage)[0],
|
63
|
+
target = loc.protocol + '//' + loc.host,
|
64
|
+
xhrUpload = options.xhr().upload;
|
65
|
+
return {
|
66
|
+
send: function (_, completeCallback) {
|
67
|
+
var message = {
|
68
|
+
id: 'postmessage-transport-' + (counter += 1)
|
69
|
+
},
|
70
|
+
eventName = 'message.' + message.id;
|
71
|
+
iframe = $(
|
72
|
+
'<iframe style="display:none;" src="' +
|
73
|
+
options.postMessage + '" name="' +
|
74
|
+
message.id + '"></iframe>'
|
75
|
+
).bind('load', function () {
|
76
|
+
$.each(names, function (i, name) {
|
77
|
+
message[name] = options[name];
|
78
|
+
});
|
79
|
+
message.dataType = message.dataType.replace('postmessage ', '');
|
80
|
+
$(window).bind(eventName, function (e) {
|
81
|
+
e = e.originalEvent;
|
82
|
+
var data = e.data,
|
83
|
+
ev;
|
84
|
+
if (e.origin === target && data.id === message.id) {
|
85
|
+
if (data.type === 'progress') {
|
86
|
+
ev = document.createEvent('Event');
|
87
|
+
ev.initEvent(data.type, false, true);
|
88
|
+
$.extend(ev, data);
|
89
|
+
xhrUpload.dispatchEvent(ev);
|
90
|
+
} else {
|
91
|
+
completeCallback(
|
92
|
+
data.status,
|
93
|
+
data.statusText,
|
94
|
+
{postmessage: data.result},
|
95
|
+
data.headers
|
96
|
+
);
|
97
|
+
iframe.remove();
|
98
|
+
$(window).unbind(eventName);
|
99
|
+
}
|
100
|
+
}
|
101
|
+
});
|
102
|
+
iframe[0].contentWindow.postMessage(
|
103
|
+
message,
|
104
|
+
target
|
105
|
+
);
|
106
|
+
}).appendTo(document.body);
|
107
|
+
},
|
108
|
+
abort: function () {
|
109
|
+
if (iframe) {
|
110
|
+
iframe.remove();
|
111
|
+
}
|
112
|
+
}
|
113
|
+
};
|
114
|
+
}
|
115
|
+
});
|
116
|
+
|
117
|
+
}));
|
@@ -0,0 +1,85 @@
|
|
1
|
+
/*
|
2
|
+
* jQuery XDomainRequest Transport Plugin 1.1.2
|
3
|
+
* https://github.com/blueimp/jQuery-File-Upload
|
4
|
+
*
|
5
|
+
* Copyright 2011, Sebastian Tschan
|
6
|
+
* https://blueimp.net
|
7
|
+
*
|
8
|
+
* Licensed under the MIT license:
|
9
|
+
* http://www.opensource.org/licenses/MIT
|
10
|
+
*
|
11
|
+
* Based on Julian Aubourg's ajaxHooks xdr.js:
|
12
|
+
* https://github.com/jaubourg/ajaxHooks/
|
13
|
+
*/
|
14
|
+
|
15
|
+
/*jslint unparam: true */
|
16
|
+
/*global define, window, XDomainRequest */
|
17
|
+
|
18
|
+
(function (factory) {
|
19
|
+
'use strict';
|
20
|
+
if (typeof define === 'function' && define.amd) {
|
21
|
+
// Register as an anonymous AMD module:
|
22
|
+
define(['jquery'], factory);
|
23
|
+
} else {
|
24
|
+
// Browser globals:
|
25
|
+
factory(window.jQuery);
|
26
|
+
}
|
27
|
+
}(function ($) {
|
28
|
+
'use strict';
|
29
|
+
if (window.XDomainRequest && !$.support.cors) {
|
30
|
+
$.ajaxTransport(function (s) {
|
31
|
+
if (s.crossDomain && s.async) {
|
32
|
+
if (s.timeout) {
|
33
|
+
s.xdrTimeout = s.timeout;
|
34
|
+
delete s.timeout;
|
35
|
+
}
|
36
|
+
var xdr;
|
37
|
+
return {
|
38
|
+
send: function (headers, completeCallback) {
|
39
|
+
function callback(status, statusText, responses, responseHeaders) {
|
40
|
+
xdr.onload = xdr.onerror = xdr.ontimeout = $.noop;
|
41
|
+
xdr = null;
|
42
|
+
completeCallback(status, statusText, responses, responseHeaders);
|
43
|
+
}
|
44
|
+
xdr = new XDomainRequest();
|
45
|
+
// XDomainRequest only supports GET and POST:
|
46
|
+
if (s.type === 'DELETE') {
|
47
|
+
s.url = s.url + (/\?/.test(s.url) ? '&' : '?') +
|
48
|
+
'_method=DELETE';
|
49
|
+
s.type = 'POST';
|
50
|
+
} else if (s.type === 'PUT') {
|
51
|
+
s.url = s.url + (/\?/.test(s.url) ? '&' : '?') +
|
52
|
+
'_method=PUT';
|
53
|
+
s.type = 'POST';
|
54
|
+
}
|
55
|
+
xdr.open(s.type, s.url);
|
56
|
+
xdr.onload = function () {
|
57
|
+
callback(
|
58
|
+
200,
|
59
|
+
'OK',
|
60
|
+
{text: xdr.responseText},
|
61
|
+
'Content-Type: ' + xdr.contentType
|
62
|
+
);
|
63
|
+
};
|
64
|
+
xdr.onerror = function () {
|
65
|
+
callback(404, 'Not Found');
|
66
|
+
};
|
67
|
+
if (s.xdrTimeout) {
|
68
|
+
xdr.ontimeout = function () {
|
69
|
+
callback(0, 'timeout');
|
70
|
+
};
|
71
|
+
xdr.timeout = s.xdrTimeout;
|
72
|
+
}
|
73
|
+
xdr.send((s.hasContent && s.data) || null);
|
74
|
+
},
|
75
|
+
abort: function () {
|
76
|
+
if (xdr) {
|
77
|
+
xdr.onerror = $.noop();
|
78
|
+
xdr.abort();
|
79
|
+
}
|
80
|
+
}
|
81
|
+
};
|
82
|
+
}
|
83
|
+
});
|
84
|
+
}
|
85
|
+
}));
|
@@ -0,0 +1,84 @@
|
|
1
|
+
@charset 'UTF-8';
|
2
|
+
/*
|
3
|
+
* jQuery File Upload UI Plugin CSS 6.3
|
4
|
+
* https://github.com/blueimp/jQuery-File-Upload
|
5
|
+
*
|
6
|
+
* Copyright 2010, Sebastian Tschan
|
7
|
+
* https://blueimp.net
|
8
|
+
*
|
9
|
+
* Licensed under the MIT license:
|
10
|
+
* http://www.opensource.org/licenses/MIT
|
11
|
+
*/
|
12
|
+
|
13
|
+
.fileinput-button {
|
14
|
+
position: relative;
|
15
|
+
overflow: hidden;
|
16
|
+
float: left;
|
17
|
+
margin-right: 4px;
|
18
|
+
}
|
19
|
+
.fileinput-button input {
|
20
|
+
position: absolute;
|
21
|
+
top: 0;
|
22
|
+
right: 0;
|
23
|
+
margin: 0;
|
24
|
+
border: solid transparent;
|
25
|
+
border-width: 0 0 100px 200px;
|
26
|
+
opacity: 0;
|
27
|
+
filter: alpha(opacity=0);
|
28
|
+
-moz-transform: translate(-300px, 0) scale(4);
|
29
|
+
direction: ltr;
|
30
|
+
cursor: pointer;
|
31
|
+
}
|
32
|
+
.fileupload-buttonbar .btn,
|
33
|
+
.fileupload-buttonbar .toggle {
|
34
|
+
margin-bottom: 5px;
|
35
|
+
}
|
36
|
+
.files .progress {
|
37
|
+
width: 200px;
|
38
|
+
}
|
39
|
+
.progress-animated .bar {
|
40
|
+
background: url(../img/progressbar.gif) !important;
|
41
|
+
filter: none;
|
42
|
+
}
|
43
|
+
.fileupload-loading {
|
44
|
+
position: absolute;
|
45
|
+
left: 50%;
|
46
|
+
width: 128px;
|
47
|
+
height: 128px;
|
48
|
+
background: url(../img/loading.gif) center no-repeat;
|
49
|
+
display: none;
|
50
|
+
}
|
51
|
+
.fileupload-processing .fileupload-loading {
|
52
|
+
display: block;
|
53
|
+
}
|
54
|
+
|
55
|
+
/* Fix for IE 6: */
|
56
|
+
* html .fileinput-button {
|
57
|
+
line-height: 22px;
|
58
|
+
margin: 1px -3px 0 0;
|
59
|
+
}
|
60
|
+
|
61
|
+
/* Fix for IE 7: */
|
62
|
+
* + html .fileinput-button {
|
63
|
+
margin: 1px 0 0 0;
|
64
|
+
}
|
65
|
+
|
66
|
+
@media (max-width: 480px) {
|
67
|
+
.files .btn span {
|
68
|
+
display: none;
|
69
|
+
}
|
70
|
+
.files .preview * {
|
71
|
+
width: 40px;
|
72
|
+
}
|
73
|
+
.files .name * {
|
74
|
+
width: 80px;
|
75
|
+
display: inline-block;
|
76
|
+
word-wrap: break-word;
|
77
|
+
}
|
78
|
+
.files .progress {
|
79
|
+
width: 20px;
|
80
|
+
}
|
81
|
+
.files .delete {
|
82
|
+
width: 60px;
|
83
|
+
}
|
84
|
+
}
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jquery.fileupload-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0.
|
4
|
+
version: 1.0.0.beta
|
5
5
|
prerelease: 6
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-10-05 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: sprockets
|
@@ -56,12 +56,67 @@ files:
|
|
56
56
|
- Gemfile
|
57
57
|
- Rakefile
|
58
58
|
- Readme.md
|
59
|
+
- demo/.gitignore
|
60
|
+
- demo/Gemfile
|
61
|
+
- demo/README.rdoc
|
62
|
+
- demo/Rakefile
|
63
|
+
- demo/app/assets/images/rails.png
|
64
|
+
- demo/app/assets/javascripts/application.js.coffee
|
65
|
+
- demo/app/assets/stylesheets/application.css
|
66
|
+
- demo/app/controllers/application_controller.rb
|
67
|
+
- demo/app/helpers/application_helper.rb
|
68
|
+
- demo/app/mailers/.gitkeep
|
69
|
+
- demo/app/models/.gitkeep
|
70
|
+
- demo/app/views/application/basic.html.erb
|
71
|
+
- demo/app/views/application/create.html.erb
|
72
|
+
- demo/app/views/application/ui.html.erb
|
73
|
+
- demo/app/views/layouts/application.html.erb
|
74
|
+
- demo/config.ru
|
75
|
+
- demo/config/application.rb
|
76
|
+
- demo/config/boot.rb
|
77
|
+
- demo/config/database.yml
|
78
|
+
- demo/config/environment.rb
|
79
|
+
- demo/config/environments/development.rb
|
80
|
+
- demo/config/environments/production.rb
|
81
|
+
- demo/config/environments/test.rb
|
82
|
+
- demo/config/initializers/backtrace_silencers.rb
|
83
|
+
- demo/config/initializers/inflections.rb
|
84
|
+
- demo/config/initializers/mime_types.rb
|
85
|
+
- demo/config/initializers/secret_token.rb
|
86
|
+
- demo/config/initializers/session_store.rb
|
87
|
+
- demo/config/initializers/wrap_parameters.rb
|
88
|
+
- demo/config/locales/en.yml
|
89
|
+
- demo/config/routes.rb
|
90
|
+
- demo/db/seeds.rb
|
91
|
+
- demo/doc/README_FOR_APP
|
92
|
+
- demo/lib/assets/.gitkeep
|
93
|
+
- demo/lib/tasks/.gitkeep
|
94
|
+
- demo/log/.gitkeep
|
95
|
+
- demo/public/404.html
|
96
|
+
- demo/public/422.html
|
97
|
+
- demo/public/500.html
|
98
|
+
- demo/public/favicon.ico
|
99
|
+
- demo/public/robots.txt
|
100
|
+
- demo/script/rails
|
101
|
+
- demo/test/fixtures/.gitkeep
|
102
|
+
- demo/test/functional/.gitkeep
|
103
|
+
- demo/test/integration/.gitkeep
|
104
|
+
- demo/test/performance/browsing_test.rb
|
105
|
+
- demo/test/test_helper.rb
|
106
|
+
- demo/test/unit/.gitkeep
|
107
|
+
- demo/vendor/plugins/.gitkeep
|
59
108
|
- dependencies.json
|
60
109
|
- jquery.fileupload-rails.gemspec
|
61
110
|
- lib/jquery.fileupload-rails.rb
|
62
111
|
- lib/jquery.fileupload-rails/version.rb
|
63
112
|
- vendor/assets/javascripts/jquery.fileupload.js
|
64
113
|
- vendor/assets/javascripts/jquery.iframe-transport.js
|
114
|
+
- vendor/legacy_assets/javascripts/jquery.fileupload-fp.js
|
115
|
+
- vendor/legacy_assets/javascripts/jquery.fileupload-ip.js
|
116
|
+
- vendor/legacy_assets/javascripts/jquery.fileupload-ui.js
|
117
|
+
- vendor/legacy_assets/javascripts/jquery.postmessage-transport.js
|
118
|
+
- vendor/legacy_assets/javascripts/jquery.xdr-transport.js
|
119
|
+
- vendor/legacy_assets/stylesheets/jquery.fileupload-ui.css
|
65
120
|
homepage: https://github.com/semaperepelitsa/jquery.fileupload-rails
|
66
121
|
licenses: []
|
67
122
|
post_install_message:
|