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.
Files changed (89) hide show
  1. checksums.yaml +15 -0
  2. data/.gitignore +2 -0
  3. data/Gemfile +5 -0
  4. data/README.md +83 -0
  5. data/Rakefile +44 -0
  6. data/berkshelf-store.gemspec +26 -0
  7. data/bin/berkshelf-store +49 -0
  8. data/lib/berkshelf-store/backends/filesystem.rb +138 -0
  9. data/lib/berkshelf-store/backends.rb +5 -0
  10. data/lib/berkshelf-store/webservice.rb +100 -0
  11. data/lib/berkshelf-store.rb +5 -0
  12. data/test/data/arbo/cookbooks/apache2/1.10.4/data.json +1 -0
  13. data/test/data/arbo/cookbooks/couchbase/1.1.0/data.json +1 -0
  14. data/test/data/arbo/cookbooks/couchbase/1.2.0/data.json +1 -0
  15. data/test/data/catalog.json +69 -0
  16. data/test/data/tarballs/apache2-v1.10.4.tar.gz +0 -0
  17. data/test/data/tarballs/couchbase-v1.1.0.tar.gz +0 -0
  18. data/test/data/tarballs/couchbase-v1.2.0.tar.gz +0 -0
  19. data/test/data/tarballs/not_a_cookbook.tgz +0 -0
  20. data/test/test_berkshelf-store_backends_filesystem.rb +76 -0
  21. data/ui/static/bootstrap/css/bootstrap-theme.css +347 -0
  22. data/ui/static/bootstrap/css/bootstrap-theme.css.map +1 -0
  23. data/ui/static/bootstrap/css/bootstrap-theme.min.css +7 -0
  24. data/ui/static/bootstrap/css/bootstrap.css +5785 -0
  25. data/ui/static/bootstrap/css/bootstrap.css.map +1 -0
  26. data/ui/static/bootstrap/css/bootstrap.min.css +7 -0
  27. data/ui/static/bootstrap/fonts/glyphicons-halflings-regular.eot +0 -0
  28. data/ui/static/bootstrap/fonts/glyphicons-halflings-regular.svg +229 -0
  29. data/ui/static/bootstrap/fonts/glyphicons-halflings-regular.ttf +0 -0
  30. data/ui/static/bootstrap/fonts/glyphicons-halflings-regular.woff +0 -0
  31. data/ui/static/bootstrap/js/bootstrap.js +1951 -0
  32. data/ui/static/bootstrap/js/bootstrap.min.js +6 -0
  33. data/ui/static/jquery/jquery.min.js +4 -0
  34. data/ui/static/jquery_file_upload/CONTRIBUTING.md +42 -0
  35. data/ui/static/jquery_file_upload/Gruntfile.js +37 -0
  36. data/ui/static/jquery_file_upload/README.md +123 -0
  37. data/ui/static/jquery_file_upload/angularjs.html +211 -0
  38. data/ui/static/jquery_file_upload/basic-plus.html +226 -0
  39. data/ui/static/jquery_file_upload/basic.html +136 -0
  40. data/ui/static/jquery_file_upload/blueimp-file-upload.jquery.json +50 -0
  41. data/ui/static/jquery_file_upload/bower.json +85 -0
  42. data/ui/static/jquery_file_upload/cors/postmessage.html +75 -0
  43. data/ui/static/jquery_file_upload/cors/result.html +24 -0
  44. data/ui/static/jquery_file_upload/css/demo-ie8.css +21 -0
  45. data/ui/static/jquery_file_upload/css/demo.css +67 -0
  46. data/ui/static/jquery_file_upload/css/jquery.fileupload-noscript.css +22 -0
  47. data/ui/static/jquery_file_upload/css/jquery.fileupload-ui-noscript.css +17 -0
  48. data/ui/static/jquery_file_upload/css/jquery.fileupload-ui.css +57 -0
  49. data/ui/static/jquery_file_upload/css/jquery.fileupload.css +36 -0
  50. data/ui/static/jquery_file_upload/css/style.css +15 -0
  51. data/ui/static/jquery_file_upload/img/loading.gif +0 -0
  52. data/ui/static/jquery_file_upload/img/progressbar.gif +0 -0
  53. data/ui/static/jquery_file_upload/index.html +255 -0
  54. data/ui/static/jquery_file_upload/jquery-ui.html +250 -0
  55. data/ui/static/jquery_file_upload/js/app.js +101 -0
  56. data/ui/static/jquery_file_upload/js/cors/jquery.postmessage-transport.js +117 -0
  57. data/ui/static/jquery_file_upload/js/cors/jquery.xdr-transport.js +86 -0
  58. data/ui/static/jquery_file_upload/js/jquery.fileupload-angular.js +429 -0
  59. data/ui/static/jquery_file_upload/js/jquery.fileupload-audio.js +106 -0
  60. data/ui/static/jquery_file_upload/js/jquery.fileupload-image.js +315 -0
  61. data/ui/static/jquery_file_upload/js/jquery.fileupload-jquery-ui.js +152 -0
  62. data/ui/static/jquery_file_upload/js/jquery.fileupload-process.js +172 -0
  63. data/ui/static/jquery_file_upload/js/jquery.fileupload-ui.js +699 -0
  64. data/ui/static/jquery_file_upload/js/jquery.fileupload-validate.js +119 -0
  65. data/ui/static/jquery_file_upload/js/jquery.fileupload-video.js +106 -0
  66. data/ui/static/jquery_file_upload/js/jquery.fileupload.js +1426 -0
  67. data/ui/static/jquery_file_upload/js/jquery.iframe-transport.js +214 -0
  68. data/ui/static/jquery_file_upload/js/main.js +75 -0
  69. data/ui/static/jquery_file_upload/js/vendor/jquery.ui.widget.js +530 -0
  70. data/ui/static/jquery_file_upload/package.json +54 -0
  71. data/ui/static/jquery_file_upload/server/gae-go/app/main.go +296 -0
  72. data/ui/static/jquery_file_upload/server/gae-go/app.yaml +12 -0
  73. data/ui/static/jquery_file_upload/server/gae-go/static/favicon.ico +0 -0
  74. data/ui/static/jquery_file_upload/server/gae-go/static/robots.txt +2 -0
  75. data/ui/static/jquery_file_upload/server/gae-python/app.yaml +16 -0
  76. data/ui/static/jquery_file_upload/server/gae-python/main.py +170 -0
  77. data/ui/static/jquery_file_upload/server/gae-python/static/favicon.ico +0 -0
  78. data/ui/static/jquery_file_upload/server/gae-python/static/robots.txt +2 -0
  79. data/ui/static/jquery_file_upload/server/node/package.json +41 -0
  80. data/ui/static/jquery_file_upload/server/node/server.js +292 -0
  81. data/ui/static/jquery_file_upload/server/php/UploadHandler.php +1330 -0
  82. data/ui/static/jquery_file_upload/server/php/index.php +15 -0
  83. data/ui/static/jquery_file_upload/test/index.html +166 -0
  84. data/ui/static/jquery_file_upload/test/test.js +1288 -0
  85. data/ui/views/catalog.erb +20 -0
  86. data/ui/views/doc.erb +23 -0
  87. data/ui/views/layout.erb +47 -0
  88. data/ui/views/upload.erb +46 -0
  89. metadata +210 -0
@@ -0,0 +1,255 @@
1
+ <!DOCTYPE HTML>
2
+ <!--
3
+ /*
4
+ * jQuery File Upload Plugin Demo 9.0.1
5
+ * https://github.com/blueimp/jQuery-File-Upload
6
+ *
7
+ * Copyright 2010, Sebastian Tschan
8
+ * https://blueimp.net
9
+ *
10
+ * Licensed under the MIT license:
11
+ * http://www.opensource.org/licenses/MIT
12
+ */
13
+ -->
14
+ <html lang="en">
15
+ <head>
16
+ <!-- Force latest IE rendering engine or ChromeFrame if installed -->
17
+ <!--[if IE]>
18
+ <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
19
+ <![endif]-->
20
+ <meta charset="utf-8">
21
+ <title>jQuery File Upload Demo</title>
22
+ <meta name="description" content="File Upload widget with multiple file selection, drag&amp;drop support, progress bars, validation and preview images, audio and video for jQuery. Supports cross-domain, chunked and resumable file uploads and client-side image resizing. Works with any server-side platform (PHP, Python, Ruby on Rails, Java, Node.js, Go etc.) that supports standard HTML form file uploads.">
23
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
24
+ <!-- Bootstrap styles -->
25
+ <link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">
26
+ <!-- Generic page styles -->
27
+ <link rel="stylesheet" href="css/style.css">
28
+ <!-- blueimp Gallery styles -->
29
+ <link rel="stylesheet" href="http://blueimp.github.io/Gallery/css/blueimp-gallery.min.css">
30
+ <!-- CSS to style the file input field as button and adjust the Bootstrap progress bars -->
31
+ <link rel="stylesheet" href="css/jquery.fileupload.css">
32
+ <link rel="stylesheet" href="css/jquery.fileupload-ui.css">
33
+ <!-- CSS adjustments for browsers with JavaScript disabled -->
34
+ <noscript><link rel="stylesheet" href="css/jquery.fileupload-noscript.css"></noscript>
35
+ <noscript><link rel="stylesheet" href="css/jquery.fileupload-ui-noscript.css"></noscript>
36
+ </head>
37
+ <body>
38
+ <div class="navbar navbar-default navbar-fixed-top">
39
+ <div class="container">
40
+ <div class="navbar-header">
41
+ <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-fixed-top .navbar-collapse">
42
+ <span class="icon-bar"></span>
43
+ <span class="icon-bar"></span>
44
+ <span class="icon-bar"></span>
45
+ </button>
46
+ <a class="navbar-brand" href="https://github.com/blueimp/jQuery-File-Upload">jQuery File Upload</a>
47
+ </div>
48
+ <div class="navbar-collapse collapse">
49
+ <ul class="nav navbar-nav">
50
+ <li><a href="https://github.com/blueimp/jQuery-File-Upload/tags">Download</a></li>
51
+ <li><a href="https://github.com/blueimp/jQuery-File-Upload">Source Code</a></li>
52
+ <li><a href="https://github.com/blueimp/jQuery-File-Upload/wiki">Documentation</a></li>
53
+ <li><a href="https://blueimp.net">&copy; Sebastian Tschan</a></li>
54
+ </ul>
55
+ </div>
56
+ </div>
57
+ </div>
58
+ <div class="container">
59
+ <h1>jQuery File Upload Demo</h1>
60
+ <h2 class="lead">Basic Plus UI version</h2>
61
+ <ul class="nav nav-tabs">
62
+ <li><a href="basic.html">Basic</a></li>
63
+ <li><a href="basic-plus.html">Basic Plus</a></li>
64
+ <li class="active"><a href="index.html">Basic Plus UI</a></li>
65
+ <li><a href="angularjs.html">AngularJS</a></li>
66
+ <li><a href="jquery-ui.html">jQuery UI</a></li>
67
+ </ul>
68
+ <br>
69
+ <blockquote>
70
+ <p>File Upload widget with multiple file selection, drag&amp;drop support, progress bars, validation and preview images, audio and video for jQuery.<br>
71
+ Supports cross-domain, chunked and resumable file uploads and client-side image resizing.<br>
72
+ Works with any server-side platform (PHP, Python, Ruby on Rails, Java, Node.js, Go etc.) that supports standard HTML form file uploads.</p>
73
+ </blockquote>
74
+ <br>
75
+ <!-- The file upload form used as target for the file upload widget -->
76
+ <form id="fileupload" action="//jquery-file-upload.appspot.com/" method="POST" enctype="multipart/form-data">
77
+ <!-- Redirect browsers with JavaScript disabled to the origin page -->
78
+ <noscript><input type="hidden" name="redirect" value="http://blueimp.github.io/jQuery-File-Upload/"></noscript>
79
+ <!-- The fileupload-buttonbar contains buttons to add/delete files and start/cancel the upload -->
80
+ <div class="row fileupload-buttonbar">
81
+ <div class="col-lg-7">
82
+ <!-- The fileinput-button span is used to style the file input field as button -->
83
+ <span class="btn btn-success fileinput-button">
84
+ <i class="glyphicon glyphicon-plus"></i>
85
+ <span>Add files...</span>
86
+ <input type="file" name="files[]" multiple>
87
+ </span>
88
+ <button type="submit" class="btn btn-primary start">
89
+ <i class="glyphicon glyphicon-upload"></i>
90
+ <span>Start upload</span>
91
+ </button>
92
+ <button type="reset" class="btn btn-warning cancel">
93
+ <i class="glyphicon glyphicon-ban-circle"></i>
94
+ <span>Cancel upload</span>
95
+ </button>
96
+ <button type="button" class="btn btn-danger delete">
97
+ <i class="glyphicon glyphicon-trash"></i>
98
+ <span>Delete</span>
99
+ </button>
100
+ <input type="checkbox" class="toggle">
101
+ <!-- The global file processing state -->
102
+ <span class="fileupload-process"></span>
103
+ </div>
104
+ <!-- The global progress state -->
105
+ <div class="col-lg-5 fileupload-progress fade">
106
+ <!-- The global progress bar -->
107
+ <div class="progress progress-striped active" role="progressbar" aria-valuemin="0" aria-valuemax="100">
108
+ <div class="progress-bar progress-bar-success" style="width:0%;"></div>
109
+ </div>
110
+ <!-- The extended global progress state -->
111
+ <div class="progress-extended">&nbsp;</div>
112
+ </div>
113
+ </div>
114
+ <!-- The table listing the files available for upload/download -->
115
+ <table role="presentation" class="table table-striped"><tbody class="files"></tbody></table>
116
+ </form>
117
+ <br>
118
+ <div class="panel panel-default">
119
+ <div class="panel-heading">
120
+ <h3 class="panel-title">Demo Notes</h3>
121
+ </div>
122
+ <div class="panel-body">
123
+ <ul>
124
+ <li>The maximum file size for uploads in this demo is <strong>5 MB</strong> (default file size is unlimited).</li>
125
+ <li>Only image files (<strong>JPG, GIF, PNG</strong>) are allowed in this demo (by default there is no file type restriction).</li>
126
+ <li>Uploaded files will be deleted automatically after <strong>5 minutes</strong> (demo setting).</li>
127
+ <li>You can <strong>drag &amp; drop</strong> files from your desktop on this webpage (see <a href="https://github.com/blueimp/jQuery-File-Upload/wiki/Browser-support">Browser support</a>).</li>
128
+ <li>Please refer to the <a href="https://github.com/blueimp/jQuery-File-Upload">project website</a> and <a href="https://github.com/blueimp/jQuery-File-Upload/wiki">documentation</a> for more information.</li>
129
+ <li>Built with Twitter's <a href="http://twitter.github.com/bootstrap/">Bootstrap</a> CSS framework and Icons from <a href="http://glyphicons.com/">Glyphicons</a>.</li>
130
+ </ul>
131
+ </div>
132
+ </div>
133
+ </div>
134
+ <!-- The blueimp Gallery widget -->
135
+ <div id="blueimp-gallery" class="blueimp-gallery blueimp-gallery-controls" data-filter=":even">
136
+ <div class="slides"></div>
137
+ <h3 class="title"></h3>
138
+ <a class="prev">‹</a>
139
+ <a class="next">›</a>
140
+ <a class="close">×</a>
141
+ <a class="play-pause"></a>
142
+ <ol class="indicator"></ol>
143
+ </div>
144
+ <!-- The template to display files available for upload -->
145
+ <script id="template-upload" type="text/x-tmpl">
146
+ {% for (var i=0, file; file=o.files[i]; i++) { %}
147
+ <tr class="template-upload fade">
148
+ <td>
149
+ <span class="preview"></span>
150
+ </td>
151
+ <td>
152
+ <p class="name">{%=file.name%}</p>
153
+ <strong class="error text-danger"></strong>
154
+ </td>
155
+ <td>
156
+ <p class="size">Processing...</p>
157
+ <div class="progress progress-striped active" role="progressbar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0"><div class="progress-bar progress-bar-success" style="width:0%;"></div></div>
158
+ </td>
159
+ <td>
160
+ {% if (!i && !o.options.autoUpload) { %}
161
+ <button class="btn btn-primary start" disabled>
162
+ <i class="glyphicon glyphicon-upload"></i>
163
+ <span>Start</span>
164
+ </button>
165
+ {% } %}
166
+ {% if (!i) { %}
167
+ <button class="btn btn-warning cancel">
168
+ <i class="glyphicon glyphicon-ban-circle"></i>
169
+ <span>Cancel</span>
170
+ </button>
171
+ {% } %}
172
+ </td>
173
+ </tr>
174
+ {% } %}
175
+ </script>
176
+ <!-- The template to display files available for download -->
177
+ <script id="template-download" type="text/x-tmpl">
178
+ {% for (var i=0, file; file=o.files[i]; i++) { %}
179
+ <tr class="template-download fade">
180
+ <td>
181
+ <span class="preview">
182
+ {% if (file.thumbnailUrl) { %}
183
+ <a href="{%=file.url%}" title="{%=file.name%}" download="{%=file.name%}" data-gallery><img src="{%=file.thumbnailUrl%}"></a>
184
+ {% } %}
185
+ </span>
186
+ </td>
187
+ <td>
188
+ <p class="name">
189
+ {% if (file.url) { %}
190
+ <a href="{%=file.url%}" title="{%=file.name%}" download="{%=file.name%}" {%=file.thumbnailUrl?'data-gallery':''%}>{%=file.name%}</a>
191
+ {% } else { %}
192
+ <span>{%=file.name%}</span>
193
+ {% } %}
194
+ </p>
195
+ {% if (file.error) { %}
196
+ <div><span class="label label-danger">Error</span> {%=file.error%}</div>
197
+ {% } %}
198
+ </td>
199
+ <td>
200
+ <span class="size">{%=o.formatFileSize(file.size)%}</span>
201
+ </td>
202
+ <td>
203
+ {% if (file.deleteUrl) { %}
204
+ <button class="btn btn-danger delete" data-type="{%=file.deleteType%}" data-url="{%=file.deleteUrl%}"{% if (file.deleteWithCredentials) { %} data-xhr-fields='{"withCredentials":true}'{% } %}>
205
+ <i class="glyphicon glyphicon-trash"></i>
206
+ <span>Delete</span>
207
+ </button>
208
+ <input type="checkbox" name="delete" value="1" class="toggle">
209
+ {% } else { %}
210
+ <button class="btn btn-warning cancel">
211
+ <i class="glyphicon glyphicon-ban-circle"></i>
212
+ <span>Cancel</span>
213
+ </button>
214
+ {% } %}
215
+ </td>
216
+ </tr>
217
+ {% } %}
218
+ </script>
219
+ <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
220
+ <!-- The jQuery UI widget factory, can be omitted if jQuery UI is already included -->
221
+ <script src="js/vendor/jquery.ui.widget.js"></script>
222
+ <!-- The Templates plugin is included to render the upload/download listings -->
223
+ <script src="http://blueimp.github.io/JavaScript-Templates/js/tmpl.min.js"></script>
224
+ <!-- The Load Image plugin is included for the preview images and image resizing functionality -->
225
+ <script src="http://blueimp.github.io/JavaScript-Load-Image/js/load-image.min.js"></script>
226
+ <!-- The Canvas to Blob plugin is included for image resizing functionality -->
227
+ <script src="http://blueimp.github.io/JavaScript-Canvas-to-Blob/js/canvas-to-blob.min.js"></script>
228
+ <!-- Bootstrap JS is not required, but included for the responsive demo navigation -->
229
+ <script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
230
+ <!-- blueimp Gallery script -->
231
+ <script src="http://blueimp.github.io/Gallery/js/jquery.blueimp-gallery.min.js"></script>
232
+ <!-- The Iframe Transport is required for browsers without support for XHR file uploads -->
233
+ <script src="js/jquery.iframe-transport.js"></script>
234
+ <!-- The basic File Upload plugin -->
235
+ <script src="js/jquery.fileupload.js"></script>
236
+ <!-- The File Upload processing plugin -->
237
+ <script src="js/jquery.fileupload-process.js"></script>
238
+ <!-- The File Upload image preview & resize plugin -->
239
+ <script src="js/jquery.fileupload-image.js"></script>
240
+ <!-- The File Upload audio preview plugin -->
241
+ <script src="js/jquery.fileupload-audio.js"></script>
242
+ <!-- The File Upload video preview plugin -->
243
+ <script src="js/jquery.fileupload-video.js"></script>
244
+ <!-- The File Upload validation plugin -->
245
+ <script src="js/jquery.fileupload-validate.js"></script>
246
+ <!-- The File Upload user interface plugin -->
247
+ <script src="js/jquery.fileupload-ui.js"></script>
248
+ <!-- The main application script -->
249
+ <script src="js/main.js"></script>
250
+ <!-- The XDomainRequest Transport is included for cross-domain file deletion for IE 8 and IE 9 -->
251
+ <!--[if (gte IE 8)&(lt IE 10)]>
252
+ <script src="js/cors/jquery.xdr-transport.js"></script>
253
+ <![endif]-->
254
+ </body>
255
+ </html>
@@ -0,0 +1,250 @@
1
+ <!DOCTYPE HTML>
2
+ <!--
3
+ /*
4
+ * jQuery File Upload Plugin jQuery UI Demo 9.0.1
5
+ * https://github.com/blueimp/jQuery-File-Upload
6
+ *
7
+ * Copyright 2013, Sebastian Tschan
8
+ * https://blueimp.net
9
+ *
10
+ * Licensed under the MIT license:
11
+ * http://www.opensource.org/licenses/MIT
12
+ */
13
+ -->
14
+ <html lang="en">
15
+ <head>
16
+ <!-- Force latest IE rendering engine or ChromeFrame if installed -->
17
+ <!--[if IE]>
18
+ <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
19
+ <![endif]-->
20
+ <meta charset="utf-8">
21
+ <title>jQuery File Upload Demo - jQuery UI version</title>
22
+ <meta name="description" content="File Upload widget with multiple file selection, drag&amp;drop support, progress bars, validation and preview images, audio and video for jQuery. Supports cross-domain, chunked and resumable file uploads and client-side image resizing. Works with any server-side platform (PHP, Python, Ruby on Rails, Java, Node.js, Go etc.) that supports standard HTML form file uploads.">
23
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
24
+ <!-- jQuery UI styles -->
25
+ <link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/themes/dark-hive/jquery-ui.css" id="theme">
26
+ <!-- Demo styles -->
27
+ <link rel="stylesheet" href="css/demo.css">
28
+ <!--[if lte IE 8]>
29
+ <link rel="stylesheet" href="css/demo-ie8.css">
30
+ <![endif]-->
31
+ <style>
32
+ /* Adjust the jQuery UI widget font-size: */
33
+ .ui-widget {
34
+ font-size: 0.95em;
35
+ }
36
+ </style>
37
+ <!-- blueimp Gallery styles -->
38
+ <link rel="stylesheet" href="http://blueimp.github.io/Gallery/css/blueimp-gallery.min.css">
39
+ <!-- CSS to style the file input field as button and adjust the Bootstrap progress bars -->
40
+ <link rel="stylesheet" href="css/jquery.fileupload.css">
41
+ <link rel="stylesheet" href="css/jquery.fileupload-ui.css">
42
+ <!-- CSS adjustments for browsers with JavaScript disabled -->
43
+ <noscript><link rel="stylesheet" href="css/jquery.fileupload-noscript.css"></noscript>
44
+ <noscript><link rel="stylesheet" href="css/jquery.fileupload-ui-noscript.css"></noscript>
45
+ </head>
46
+ <body>
47
+ <ul class="navigation">
48
+ <li><h3><a href="https://github.com/blueimp/jQuery-File-Upload">jQuery File Upload</a></h3></li>
49
+ <li><a href="https://github.com/blueimp/jQuery-File-Upload/tags">Download</a></li>
50
+ <li><a href="https://github.com/blueimp/jQuery-File-Upload">Source Code</a></li>
51
+ <li><a href="https://github.com/blueimp/jQuery-File-Upload/wiki">Documentation</a></li>
52
+ <li><a href="https://blueimp.net">&copy; blueimp.net</a></li>
53
+ </ul>
54
+ <h1>jQuery File Upload Demo</h1>
55
+ <h2>jQuery UI version</h2>
56
+ <form>
57
+ <label for="theme-switcher">Theme:</label>
58
+ <select id="theme-switcher" class="pull-right">
59
+ <option value="black-tie">Black Tie</option>
60
+ <option value="blitzer">Blitzer</option>
61
+ <option value="cupertino">Cupertino</option>
62
+ <option value="dark-hive" selected>Dark Hive</option>
63
+ <option value="dot-luv">Dot Luv</option>
64
+ <option value="eggplant">Eggplant</option>
65
+ <option value="excite-bike">Excite Bike</option>
66
+ <option value="flick">Flick</option>
67
+ <option value="hot-sneaks">Hot sneaks</option>
68
+ <option value="humanity">Humanity</option>
69
+ <option value="le-frog">Le Frog</option>
70
+ <option value="mint-choc">Mint Choc</option>
71
+ <option value="overcast">Overcast</option>
72
+ <option value="pepper-grinder">Pepper Grinder</option>
73
+ <option value="redmond">Redmond</option>
74
+ <option value="smoothness">Smoothness</option>
75
+ <option value="south-street">South Street</option>
76
+ <option value="start">Start</option>
77
+ <option value="sunny">Sunny</option>
78
+ <option value="swanky-purse">Swanky Purse</option>
79
+ <option value="trontastic">Trontastic</option>
80
+ <option value="ui-darkness">UI Darkness</option>
81
+ <option value="ui-lightness">UI Lightness</option>
82
+ <option value="vader">Vader</option>
83
+ </select>
84
+ </form>
85
+ <ul class="navigation">
86
+ <li><a href="basic.html">Basic</a></li>
87
+ <li><a href="basic-plus.html">Basic Plus</a></li>
88
+ <li><a href="index.html">Basic Plus UI</a></li>
89
+ <li><a href="angularjs.html">AngularJS</a></li>
90
+ <li class="active"><a href="jquery-ui.html">jQuery UI</a></li>
91
+ </ul>
92
+ <blockquote>
93
+ <p>File Upload widget with multiple file selection, drag&amp;drop support, progress bars, validation and preview images, audio and video for jQuery UI.<br>
94
+ Supports cross-domain, chunked and resumable file uploads and client-side image resizing.<br>
95
+ Works with any server-side platform (PHP, Python, Ruby on Rails, Java, Node.js, Go etc.) that supports standard HTML form file uploads.</p>
96
+ </blockquote>
97
+ <!-- The file upload form used as target for the file upload widget -->
98
+ <form id="fileupload" action="//jquery-file-upload.appspot.com/" method="POST" enctype="multipart/form-data">
99
+ <!-- Redirect browsers with JavaScript disabled to the origin page -->
100
+ <noscript><input type="hidden" name="redirect" value="http://blueimp.github.io/jQuery-File-Upload/"></noscript>
101
+ <!-- The fileupload-buttonbar contains buttons to add/delete files and start/cancel the upload -->
102
+ <div class="fileupload-buttonbar">
103
+ <div class="fileupload-buttons">
104
+ <!-- The fileinput-button span is used to style the file input field as button -->
105
+ <span class="fileinput-button">
106
+ <span>Add files...</span>
107
+ <input type="file" name="files[]" multiple>
108
+ </span>
109
+ <button type="submit" class="start">Start upload</button>
110
+ <button type="reset" class="cancel">Cancel upload</button>
111
+ <button type="button" class="delete">Delete</button>
112
+ <input type="checkbox" class="toggle">
113
+ <!-- The global file processing state -->
114
+ <span class="fileupload-process"></span>
115
+ </div>
116
+ <!-- The global progress state -->
117
+ <div class="fileupload-progress fade" style="display:none">
118
+ <!-- The global progress bar -->
119
+ <div class="progress" role="progressbar" aria-valuemin="0" aria-valuemax="100"></div>
120
+ <!-- The extended global progress state -->
121
+ <div class="progress-extended">&nbsp;</div>
122
+ </div>
123
+ </div>
124
+ <!-- The table listing the files available for upload/download -->
125
+ <table role="presentation"><tbody class="files"></tbody></table>
126
+ </form>
127
+ <br>
128
+ <h3>Demo Notes</h3>
129
+ <ul>
130
+ <li>The maximum file size for uploads in this demo is <strong>5 MB</strong> (default file size is unlimited).</li>
131
+ <li>Only image files (<strong>JPG, GIF, PNG</strong>) are allowed in this demo (by default there is no file type restriction).</li>
132
+ <li>Uploaded files will be deleted automatically after <strong>5 minutes</strong> (demo setting).</li>
133
+ <li>You can <strong>drag &amp; drop</strong> files from your desktop on this webpage (see <a href="https://github.com/blueimp/jQuery-File-Upload/wiki/Browser-support">Browser support</a>).</li>
134
+ <li>Please refer to the <a href="https://github.com/blueimp/jQuery-File-Upload">project website</a> and <a href="https://github.com/blueimp/jQuery-File-Upload/wiki">documentation</a> for more information.</li>
135
+ <li>Built with <a href="http://jqueryui.com">jQuery UI</a>.</li>
136
+ </ul>
137
+ <!-- The blueimp Gallery widget -->
138
+ <div id="blueimp-gallery" class="blueimp-gallery blueimp-gallery-controls" data-filter=":even">
139
+ <div class="slides"></div>
140
+ <h3 class="title"></h3>
141
+ <a class="prev">‹</a>
142
+ <a class="next">›</a>
143
+ <a class="close">×</a>
144
+ <a class="play-pause"></a>
145
+ <ol class="indicator"></ol>
146
+ </div>
147
+ <!-- The template to display files available for upload -->
148
+ <script id="template-upload" type="text/x-tmpl">
149
+ {% for (var i=0, file; file=o.files[i]; i++) { %}
150
+ <tr class="template-upload fade">
151
+ <td>
152
+ <span class="preview"></span>
153
+ </td>
154
+ <td>
155
+ <p class="name">{%=file.name%}</p>
156
+ <strong class="error"></strong>
157
+ </td>
158
+ <td>
159
+ <p class="size">Processing...</p>
160
+ <div class="progress"></div>
161
+ </td>
162
+ <td>
163
+ {% if (!i && !o.options.autoUpload) { %}
164
+ <button class="start" disabled>Start</button>
165
+ {% } %}
166
+ {% if (!i) { %}
167
+ <button class="cancel">Cancel</button>
168
+ {% } %}
169
+ </td>
170
+ </tr>
171
+ {% } %}
172
+ </script>
173
+ <!-- The template to display files available for download -->
174
+ <script id="template-download" type="text/x-tmpl">
175
+ {% for (var i=0, file; file=o.files[i]; i++) { %}
176
+ <tr class="template-download fade">
177
+ <td>
178
+ <span class="preview">
179
+ {% if (file.thumbnailUrl) { %}
180
+ <a href="{%=file.url%}" title="{%=file.name%}" download="{%=file.name%}" data-gallery><img src="{%=file.thumbnailUrl%}"></a>
181
+ {% } %}
182
+ </span>
183
+ </td>
184
+ <td>
185
+ <p class="name">
186
+ <a href="{%=file.url%}" title="{%=file.name%}" download="{%=file.name%}" {%=file.thumbnailUrl?'data-gallery':''%}>{%=file.name%}</a>
187
+ </p>
188
+ {% if (file.error) { %}
189
+ <div><span class="error">Error</span> {%=file.error%}</div>
190
+ {% } %}
191
+ </td>
192
+ <td>
193
+ <span class="size">{%=o.formatFileSize(file.size)%}</span>
194
+ </td>
195
+ <td>
196
+ <button class="delete" data-type="{%=file.deleteType%}" data-url="{%=file.deleteUrl%}"{% if (file.deleteWithCredentials) { %} data-xhr-fields='{"withCredentials":true}'{% } %}>Delete</button>
197
+ <input type="checkbox" name="delete" value="1" class="toggle">
198
+ </td>
199
+ </tr>
200
+ {% } %}
201
+ </script>
202
+ <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
203
+ <script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/jquery-ui.min.js"></script>
204
+ <!-- The Templates plugin is included to render the upload/download listings -->
205
+ <script src="http://blueimp.github.io/JavaScript-Templates/js/tmpl.min.js"></script>
206
+ <!-- The Load Image plugin is included for the preview images and image resizing functionality -->
207
+ <script src="http://blueimp.github.io/JavaScript-Load-Image/js/load-image.min.js"></script>
208
+ <!-- The Canvas to Blob plugin is included for image resizing functionality -->
209
+ <script src="http://blueimp.github.io/JavaScript-Canvas-to-Blob/js/canvas-to-blob.min.js"></script>
210
+ <!-- blueimp Gallery script -->
211
+ <script src="http://blueimp.github.io/Gallery/js/jquery.blueimp-gallery.min.js"></script>
212
+ <!-- The Iframe Transport is required for browsers without support for XHR file uploads -->
213
+ <script src="js/jquery.iframe-transport.js"></script>
214
+ <!-- The basic File Upload plugin -->
215
+ <script src="js/jquery.fileupload.js"></script>
216
+ <!-- The File Upload processing plugin -->
217
+ <script src="js/jquery.fileupload-process.js"></script>
218
+ <!-- The File Upload image preview & resize plugin -->
219
+ <script src="js/jquery.fileupload-image.js"></script>
220
+ <!-- The File Upload audio preview plugin -->
221
+ <script src="js/jquery.fileupload-audio.js"></script>
222
+ <!-- The File Upload video preview plugin -->
223
+ <script src="js/jquery.fileupload-video.js"></script>
224
+ <!-- The File Upload validation plugin -->
225
+ <script src="js/jquery.fileupload-validate.js"></script>
226
+ <!-- The File Upload user interface plugin -->
227
+ <script src="js/jquery.fileupload-ui.js"></script>
228
+ <!-- The File Upload jQuery UI plugin -->
229
+ <script src="js/jquery.fileupload-jquery-ui.js"></script>
230
+ <!-- The main application script -->
231
+ <script src="js/main.js"></script>
232
+ <script>
233
+ // Initialize the jQuery UI theme switcher:
234
+ $('#theme-switcher').change(function () {
235
+ var theme = $('#theme');
236
+ theme.prop(
237
+ 'href',
238
+ theme.prop('href').replace(
239
+ /[\w\-]+\/jquery-ui.css/,
240
+ $(this).val() + '/jquery-ui.css'
241
+ )
242
+ );
243
+ });
244
+ </script>
245
+ <!-- The XDomainRequest Transport is included for cross-domain file deletion for IE 8 and IE 9 -->
246
+ <!--[if (gte IE 8)&(lt IE 10)]>
247
+ <script src="js/cors/jquery.xdr-transport.js"></script>
248
+ <![endif]-->
249
+ </body>
250
+ </html>
@@ -0,0 +1,101 @@
1
+ /*
2
+ * jQuery File Upload Plugin Angular JS Example 1.2.1
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 window, angular */
14
+
15
+ (function () {
16
+ 'use strict';
17
+
18
+ var isOnGitHub = window.location.hostname === 'blueimp.github.io',
19
+ url = isOnGitHub ? '//jquery-file-upload.appspot.com/' : 'server/php/';
20
+
21
+ angular.module('demo', [
22
+ 'blueimp.fileupload'
23
+ ])
24
+ .config([
25
+ '$httpProvider', 'fileUploadProvider',
26
+ function ($httpProvider, fileUploadProvider) {
27
+ delete $httpProvider.defaults.headers.common['X-Requested-With'];
28
+ fileUploadProvider.defaults.redirect = window.location.href.replace(
29
+ /\/[^\/]*$/,
30
+ '/cors/result.html?%s'
31
+ );
32
+ if (isOnGitHub) {
33
+ // Demo settings:
34
+ angular.extend(fileUploadProvider.defaults, {
35
+ // Enable image resizing, except for Android and Opera,
36
+ // which actually support image resizing, but fail to
37
+ // send Blob objects via XHR requests:
38
+ disableImageResize: /Android(?!.*Chrome)|Opera/
39
+ .test(window.navigator.userAgent),
40
+ maxFileSize: 5000000,
41
+ acceptFileTypes: /(\.|\/)(gif|jpe?g|png)$/i
42
+ });
43
+ }
44
+ }
45
+ ])
46
+
47
+ .controller('DemoFileUploadController', [
48
+ '$scope', '$http', '$filter', '$window',
49
+ function ($scope, $http) {
50
+ $scope.options = {
51
+ url: url
52
+ };
53
+ if (!isOnGitHub) {
54
+ $scope.loadingFiles = true;
55
+ $http.get(url)
56
+ .then(
57
+ function (response) {
58
+ $scope.loadingFiles = false;
59
+ $scope.queue = response.data.files || [];
60
+ },
61
+ function () {
62
+ $scope.loadingFiles = false;
63
+ }
64
+ );
65
+ }
66
+ }
67
+ ])
68
+
69
+ .controller('FileDestroyController', [
70
+ '$scope', '$http',
71
+ function ($scope, $http) {
72
+ var file = $scope.file,
73
+ state;
74
+ if (file.url) {
75
+ file.$state = function () {
76
+ return state;
77
+ };
78
+ file.$destroy = function () {
79
+ state = 'pending';
80
+ return $http({
81
+ url: file.deleteUrl,
82
+ method: file.deleteType
83
+ }).then(
84
+ function () {
85
+ state = 'resolved';
86
+ $scope.clear(file);
87
+ },
88
+ function () {
89
+ state = 'rejected';
90
+ }
91
+ );
92
+ };
93
+ } else if (!file.$cancel && !file._index) {
94
+ file.$cancel = function () {
95
+ $scope.clear(file);
96
+ };
97
+ }
98
+ }
99
+ ]);
100
+
101
+ }());