berkshelf-store 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +15 -0
- data/.gitignore +2 -0
- data/Gemfile +5 -0
- data/README.md +83 -0
- data/Rakefile +44 -0
- data/berkshelf-store.gemspec +26 -0
- data/bin/berkshelf-store +49 -0
- data/lib/berkshelf-store/backends/filesystem.rb +138 -0
- data/lib/berkshelf-store/backends.rb +5 -0
- data/lib/berkshelf-store/webservice.rb +100 -0
- data/lib/berkshelf-store.rb +5 -0
- data/test/data/arbo/cookbooks/apache2/1.10.4/data.json +1 -0
- data/test/data/arbo/cookbooks/couchbase/1.1.0/data.json +1 -0
- data/test/data/arbo/cookbooks/couchbase/1.2.0/data.json +1 -0
- data/test/data/catalog.json +69 -0
- data/test/data/tarballs/apache2-v1.10.4.tar.gz +0 -0
- data/test/data/tarballs/couchbase-v1.1.0.tar.gz +0 -0
- data/test/data/tarballs/couchbase-v1.2.0.tar.gz +0 -0
- data/test/data/tarballs/not_a_cookbook.tgz +0 -0
- data/test/test_berkshelf-store_backends_filesystem.rb +76 -0
- data/ui/static/bootstrap/css/bootstrap-theme.css +347 -0
- data/ui/static/bootstrap/css/bootstrap-theme.css.map +1 -0
- data/ui/static/bootstrap/css/bootstrap-theme.min.css +7 -0
- data/ui/static/bootstrap/css/bootstrap.css +5785 -0
- data/ui/static/bootstrap/css/bootstrap.css.map +1 -0
- data/ui/static/bootstrap/css/bootstrap.min.css +7 -0
- data/ui/static/bootstrap/fonts/glyphicons-halflings-regular.eot +0 -0
- data/ui/static/bootstrap/fonts/glyphicons-halflings-regular.svg +229 -0
- data/ui/static/bootstrap/fonts/glyphicons-halflings-regular.ttf +0 -0
- data/ui/static/bootstrap/fonts/glyphicons-halflings-regular.woff +0 -0
- data/ui/static/bootstrap/js/bootstrap.js +1951 -0
- data/ui/static/bootstrap/js/bootstrap.min.js +6 -0
- data/ui/static/jquery/jquery.min.js +4 -0
- data/ui/static/jquery_file_upload/CONTRIBUTING.md +42 -0
- data/ui/static/jquery_file_upload/Gruntfile.js +37 -0
- data/ui/static/jquery_file_upload/README.md +123 -0
- data/ui/static/jquery_file_upload/angularjs.html +211 -0
- data/ui/static/jquery_file_upload/basic-plus.html +226 -0
- data/ui/static/jquery_file_upload/basic.html +136 -0
- data/ui/static/jquery_file_upload/blueimp-file-upload.jquery.json +50 -0
- data/ui/static/jquery_file_upload/bower.json +85 -0
- data/ui/static/jquery_file_upload/cors/postmessage.html +75 -0
- data/ui/static/jquery_file_upload/cors/result.html +24 -0
- data/ui/static/jquery_file_upload/css/demo-ie8.css +21 -0
- data/ui/static/jquery_file_upload/css/demo.css +67 -0
- data/ui/static/jquery_file_upload/css/jquery.fileupload-noscript.css +22 -0
- data/ui/static/jquery_file_upload/css/jquery.fileupload-ui-noscript.css +17 -0
- data/ui/static/jquery_file_upload/css/jquery.fileupload-ui.css +57 -0
- data/ui/static/jquery_file_upload/css/jquery.fileupload.css +36 -0
- data/ui/static/jquery_file_upload/css/style.css +15 -0
- data/ui/static/jquery_file_upload/img/loading.gif +0 -0
- data/ui/static/jquery_file_upload/img/progressbar.gif +0 -0
- data/ui/static/jquery_file_upload/index.html +255 -0
- data/ui/static/jquery_file_upload/jquery-ui.html +250 -0
- data/ui/static/jquery_file_upload/js/app.js +101 -0
- data/ui/static/jquery_file_upload/js/cors/jquery.postmessage-transport.js +117 -0
- data/ui/static/jquery_file_upload/js/cors/jquery.xdr-transport.js +86 -0
- data/ui/static/jquery_file_upload/js/jquery.fileupload-angular.js +429 -0
- data/ui/static/jquery_file_upload/js/jquery.fileupload-audio.js +106 -0
- data/ui/static/jquery_file_upload/js/jquery.fileupload-image.js +315 -0
- data/ui/static/jquery_file_upload/js/jquery.fileupload-jquery-ui.js +152 -0
- data/ui/static/jquery_file_upload/js/jquery.fileupload-process.js +172 -0
- data/ui/static/jquery_file_upload/js/jquery.fileupload-ui.js +699 -0
- data/ui/static/jquery_file_upload/js/jquery.fileupload-validate.js +119 -0
- data/ui/static/jquery_file_upload/js/jquery.fileupload-video.js +106 -0
- data/ui/static/jquery_file_upload/js/jquery.fileupload.js +1426 -0
- data/ui/static/jquery_file_upload/js/jquery.iframe-transport.js +214 -0
- data/ui/static/jquery_file_upload/js/main.js +75 -0
- data/ui/static/jquery_file_upload/js/vendor/jquery.ui.widget.js +530 -0
- data/ui/static/jquery_file_upload/package.json +54 -0
- data/ui/static/jquery_file_upload/server/gae-go/app/main.go +296 -0
- data/ui/static/jquery_file_upload/server/gae-go/app.yaml +12 -0
- data/ui/static/jquery_file_upload/server/gae-go/static/favicon.ico +0 -0
- data/ui/static/jquery_file_upload/server/gae-go/static/robots.txt +2 -0
- data/ui/static/jquery_file_upload/server/gae-python/app.yaml +16 -0
- data/ui/static/jquery_file_upload/server/gae-python/main.py +170 -0
- data/ui/static/jquery_file_upload/server/gae-python/static/favicon.ico +0 -0
- data/ui/static/jquery_file_upload/server/gae-python/static/robots.txt +2 -0
- data/ui/static/jquery_file_upload/server/node/package.json +41 -0
- data/ui/static/jquery_file_upload/server/node/server.js +292 -0
- data/ui/static/jquery_file_upload/server/php/UploadHandler.php +1330 -0
- data/ui/static/jquery_file_upload/server/php/index.php +15 -0
- data/ui/static/jquery_file_upload/test/index.html +166 -0
- data/ui/static/jquery_file_upload/test/test.js +1288 -0
- data/ui/views/catalog.erb +20 -0
- data/ui/views/doc.erb +23 -0
- data/ui/views/layout.erb +47 -0
- data/ui/views/upload.erb +46 -0
- metadata +210 -0
@@ -0,0 +1,119 @@
|
|
1
|
+
/*
|
2
|
+
* jQuery File Upload Validation Plugin 1.1.2
|
3
|
+
* https://github.com/blueimp/jQuery-File-Upload
|
4
|
+
*
|
5
|
+
* Copyright 2013, Sebastian Tschan
|
6
|
+
* https://blueimp.net
|
7
|
+
*
|
8
|
+
* Licensed under the MIT license:
|
9
|
+
* http://www.opensource.org/licenses/MIT
|
10
|
+
*/
|
11
|
+
|
12
|
+
/* global define, window */
|
13
|
+
|
14
|
+
(function (factory) {
|
15
|
+
'use strict';
|
16
|
+
if (typeof define === 'function' && define.amd) {
|
17
|
+
// Register as an anonymous AMD module:
|
18
|
+
define([
|
19
|
+
'jquery',
|
20
|
+
'./jquery.fileupload-process'
|
21
|
+
], factory);
|
22
|
+
} else {
|
23
|
+
// Browser globals:
|
24
|
+
factory(
|
25
|
+
window.jQuery
|
26
|
+
);
|
27
|
+
}
|
28
|
+
}(function ($) {
|
29
|
+
'use strict';
|
30
|
+
|
31
|
+
// Append to the default processQueue:
|
32
|
+
$.blueimp.fileupload.prototype.options.processQueue.push(
|
33
|
+
{
|
34
|
+
action: 'validate',
|
35
|
+
// Always trigger this action,
|
36
|
+
// even if the previous action was rejected:
|
37
|
+
always: true,
|
38
|
+
// Options taken from the global options map:
|
39
|
+
acceptFileTypes: '@',
|
40
|
+
maxFileSize: '@',
|
41
|
+
minFileSize: '@',
|
42
|
+
maxNumberOfFiles: '@',
|
43
|
+
disabled: '@disableValidation'
|
44
|
+
}
|
45
|
+
);
|
46
|
+
|
47
|
+
// The File Upload Validation plugin extends the fileupload widget
|
48
|
+
// with file validation functionality:
|
49
|
+
$.widget('blueimp.fileupload', $.blueimp.fileupload, {
|
50
|
+
|
51
|
+
options: {
|
52
|
+
/*
|
53
|
+
// The regular expression for allowed file types, matches
|
54
|
+
// against either file type or file name:
|
55
|
+
acceptFileTypes: /(\.|\/)(gif|jpe?g|png)$/i,
|
56
|
+
// The maximum allowed file size in bytes:
|
57
|
+
maxFileSize: 10000000, // 10 MB
|
58
|
+
// The minimum allowed file size in bytes:
|
59
|
+
minFileSize: undefined, // No minimal file size
|
60
|
+
// The limit of files to be uploaded:
|
61
|
+
maxNumberOfFiles: 10,
|
62
|
+
*/
|
63
|
+
|
64
|
+
// Function returning the current number of files,
|
65
|
+
// has to be overriden for maxNumberOfFiles validation:
|
66
|
+
getNumberOfFiles: $.noop,
|
67
|
+
|
68
|
+
// Error and info messages:
|
69
|
+
messages: {
|
70
|
+
maxNumberOfFiles: 'Maximum number of files exceeded',
|
71
|
+
acceptFileTypes: 'File type not allowed',
|
72
|
+
maxFileSize: 'File is too large',
|
73
|
+
minFileSize: 'File is too small'
|
74
|
+
}
|
75
|
+
},
|
76
|
+
|
77
|
+
processActions: {
|
78
|
+
|
79
|
+
validate: function (data, options) {
|
80
|
+
if (options.disabled) {
|
81
|
+
return data;
|
82
|
+
}
|
83
|
+
var dfd = $.Deferred(),
|
84
|
+
settings = this.options,
|
85
|
+
file = data.files[data.index],
|
86
|
+
fileSize;
|
87
|
+
if (options.minFileSize || options.maxFileSize) {
|
88
|
+
fileSize = file.size;
|
89
|
+
}
|
90
|
+
if ($.type(options.maxNumberOfFiles) === 'number' &&
|
91
|
+
(settings.getNumberOfFiles() || 0) + data.files.length >
|
92
|
+
options.maxNumberOfFiles) {
|
93
|
+
file.error = settings.i18n('maxNumberOfFiles');
|
94
|
+
} else if (options.acceptFileTypes &&
|
95
|
+
!(options.acceptFileTypes.test(file.type) ||
|
96
|
+
options.acceptFileTypes.test(file.name))) {
|
97
|
+
file.error = settings.i18n('acceptFileTypes');
|
98
|
+
} else if (fileSize > options.maxFileSize) {
|
99
|
+
file.error = settings.i18n('maxFileSize');
|
100
|
+
} else if ($.type(fileSize) === 'number' &&
|
101
|
+
fileSize < options.minFileSize) {
|
102
|
+
file.error = settings.i18n('minFileSize');
|
103
|
+
} else {
|
104
|
+
delete file.error;
|
105
|
+
}
|
106
|
+
if (file.error || data.files.error) {
|
107
|
+
data.files.error = true;
|
108
|
+
dfd.rejectWith(this, [data]);
|
109
|
+
} else {
|
110
|
+
dfd.resolveWith(this, [data]);
|
111
|
+
}
|
112
|
+
return dfd.promise();
|
113
|
+
}
|
114
|
+
|
115
|
+
}
|
116
|
+
|
117
|
+
});
|
118
|
+
|
119
|
+
}));
|
@@ -0,0 +1,106 @@
|
|
1
|
+
/*
|
2
|
+
* jQuery File Upload Video Preview Plugin 1.0.3
|
3
|
+
* https://github.com/blueimp/jQuery-File-Upload
|
4
|
+
*
|
5
|
+
* Copyright 2013, Sebastian Tschan
|
6
|
+
* https://blueimp.net
|
7
|
+
*
|
8
|
+
* Licensed under the MIT license:
|
9
|
+
* http://www.opensource.org/licenses/MIT
|
10
|
+
*/
|
11
|
+
|
12
|
+
/* jshint nomen:false */
|
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([
|
20
|
+
'jquery',
|
21
|
+
'load-image',
|
22
|
+
'./jquery.fileupload-process'
|
23
|
+
], factory);
|
24
|
+
} else {
|
25
|
+
// Browser globals:
|
26
|
+
factory(
|
27
|
+
window.jQuery,
|
28
|
+
window.loadImage
|
29
|
+
);
|
30
|
+
}
|
31
|
+
}(function ($, loadImage) {
|
32
|
+
'use strict';
|
33
|
+
|
34
|
+
// Prepend to the default processQueue:
|
35
|
+
$.blueimp.fileupload.prototype.options.processQueue.unshift(
|
36
|
+
{
|
37
|
+
action: 'loadVideo',
|
38
|
+
// Use the action as prefix for the "@" options:
|
39
|
+
prefix: true,
|
40
|
+
fileTypes: '@',
|
41
|
+
maxFileSize: '@',
|
42
|
+
disabled: '@disableVideoPreview'
|
43
|
+
},
|
44
|
+
{
|
45
|
+
action: 'setVideo',
|
46
|
+
name: '@videoPreviewName',
|
47
|
+
disabled: '@disableVideoPreview'
|
48
|
+
}
|
49
|
+
);
|
50
|
+
|
51
|
+
// The File Upload Video Preview plugin extends the fileupload widget
|
52
|
+
// with video preview functionality:
|
53
|
+
$.widget('blueimp.fileupload', $.blueimp.fileupload, {
|
54
|
+
|
55
|
+
options: {
|
56
|
+
// The regular expression for the types of video files to load,
|
57
|
+
// matched against the file type:
|
58
|
+
loadVideoFileTypes: /^video\/.*$/
|
59
|
+
},
|
60
|
+
|
61
|
+
_videoElement: document.createElement('video'),
|
62
|
+
|
63
|
+
processActions: {
|
64
|
+
|
65
|
+
// Loads the video file given via data.files and data.index
|
66
|
+
// as video element if the browser supports playing it.
|
67
|
+
// Accepts the options fileTypes (regular expression)
|
68
|
+
// and maxFileSize (integer) to limit the files to load:
|
69
|
+
loadVideo: function (data, options) {
|
70
|
+
if (options.disabled) {
|
71
|
+
return data;
|
72
|
+
}
|
73
|
+
var file = data.files[data.index],
|
74
|
+
url,
|
75
|
+
video;
|
76
|
+
if (this._videoElement.canPlayType &&
|
77
|
+
this._videoElement.canPlayType(file.type) &&
|
78
|
+
($.type(options.maxFileSize) !== 'number' ||
|
79
|
+
file.size <= options.maxFileSize) &&
|
80
|
+
(!options.fileTypes ||
|
81
|
+
options.fileTypes.test(file.type))) {
|
82
|
+
url = loadImage.createObjectURL(file);
|
83
|
+
if (url) {
|
84
|
+
video = this._videoElement.cloneNode(false);
|
85
|
+
video.src = url;
|
86
|
+
video.controls = true;
|
87
|
+
data.video = video;
|
88
|
+
return data;
|
89
|
+
}
|
90
|
+
}
|
91
|
+
return data;
|
92
|
+
},
|
93
|
+
|
94
|
+
// Sets the video element as a property of the file object:
|
95
|
+
setVideo: function (data, options) {
|
96
|
+
if (data.video && !options.disabled) {
|
97
|
+
data.files[data.index][options.name || 'preview'] = data.video;
|
98
|
+
}
|
99
|
+
return data;
|
100
|
+
}
|
101
|
+
|
102
|
+
}
|
103
|
+
|
104
|
+
});
|
105
|
+
|
106
|
+
}));
|