card-mod-format 0.14.1 → 0.15.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (119) hide show
  1. checksums.yaml +4 -4
  2. data/assets/script/decko/clicks_and_hovers.js.coffee +49 -0
  3. data/assets/script/decko/decko.js.coffee +32 -0
  4. data/assets/script/decko/decko_jquery.js.coffee +25 -0
  5. data/assets/script/decko/slot.js.coffee +150 -0
  6. data/assets/script/decko/slot_ready.js.coffee +11 -0
  7. data/assets/script/decko/slotter.js.coffee +208 -0
  8. data/assets/script/jquery/jquery-ui.min.js +13 -0
  9. data/assets/script/jquery/jquery.autosize.js +274 -0
  10. data/assets/script/jquery/jquery.ui.autocomplete.html.js +41 -0
  11. data/assets/script/manifest.yml +38 -0
  12. data/assets/style/common.scss +73 -0
  13. data/assets/style/logo_and_credit.scss +24 -0
  14. data/assets/style/menu.scss +43 -0
  15. data/assets/style/messaging.scss +59 -0
  16. data/assets/style/misc.scss +90 -0
  17. data/assets/style/open_and_closed.scss +68 -0
  18. data/data/files/credit_image.svg +59 -0
  19. data/data/files/mod_format_script_asset_output/file.js +66 -0
  20. data/data/real.yml +67 -0
  21. data/lib/card/format/html_format.rb +0 -2
  22. data/lib/card/mod/format.rb +4 -0
  23. data/lib/card/path.rb +20 -20
  24. data/set/all/base.rb +1 -11
  25. data/set/all/content.rb +3 -11
  26. data/set/all/csv.rb +22 -74
  27. data/set/all/data.rb +2 -2
  28. data/set/all/demo.rb +6 -2
  29. data/set/all/error.rb +1 -1
  30. data/set/all/html/error.rb +1 -1
  31. data/set/all/html/head.rb +22 -12
  32. data/set/all/html/header.rb +10 -40
  33. data/set/all/html/header_wrap.haml +3 -4
  34. data/set/all/html/labeled.haml +1 -1
  35. data/set/all/html/menu.rb +36 -12
  36. data/set/all/html/views.rb +8 -17
  37. data/set/all/html/wrap.rb +5 -4
  38. data/set/all/html.rb +2 -3
  39. data/set/all/json.rb +1 -5
  40. data/set/right/head.rb +1 -0
  41. data/set/type/cardtype.rb +4 -6
  42. data/set/type/json.rb +1 -1
  43. data/set/type/number.rb +1 -16
  44. data/vendor/jquery_file_upload/LICENSE.txt +20 -0
  45. data/vendor/jquery_file_upload/README.md +224 -0
  46. data/vendor/jquery_file_upload/SECURITY.md +227 -0
  47. data/vendor/jquery_file_upload/VULNERABILITIES.md +118 -0
  48. data/vendor/jquery_file_upload/cors/postmessage.html +85 -0
  49. data/vendor/jquery_file_upload/cors/result.html +26 -0
  50. data/vendor/jquery_file_upload/css/jquery.fileupload-noscript.css +22 -0
  51. data/vendor/jquery_file_upload/css/jquery.fileupload-ui-noscript.css +17 -0
  52. data/vendor/jquery_file_upload/css/jquery.fileupload-ui.css +68 -0
  53. data/vendor/jquery_file_upload/css/jquery.fileupload.css +36 -0
  54. data/vendor/jquery_file_upload/docker-compose.yml +55 -0
  55. data/vendor/jquery_file_upload/img/loading.gif +0 -0
  56. data/vendor/jquery_file_upload/img/progressbar.gif +0 -0
  57. data/vendor/jquery_file_upload/index.html +357 -0
  58. data/vendor/jquery_file_upload/js/cors/jquery.postmessage-transport.js +126 -0
  59. data/vendor/jquery_file_upload/js/cors/jquery.xdr-transport.js +97 -0
  60. data/vendor/jquery_file_upload/js/demo.js +75 -0
  61. data/vendor/jquery_file_upload/js/jquery.fileupload-audio.js +101 -0
  62. data/vendor/jquery_file_upload/js/jquery.fileupload-image.js +347 -0
  63. data/vendor/jquery_file_upload/js/jquery.fileupload-process.js +170 -0
  64. data/vendor/jquery_file_upload/js/jquery.fileupload-ui.js +759 -0
  65. data/vendor/jquery_file_upload/js/jquery.fileupload-validate.js +119 -0
  66. data/vendor/jquery_file_upload/js/jquery.fileupload-video.js +101 -0
  67. data/vendor/jquery_file_upload/js/jquery.fileupload.js +1604 -0
  68. data/vendor/jquery_file_upload/js/jquery.iframe-transport.js +227 -0
  69. data/vendor/jquery_file_upload/js/vendor/jquery.ui.widget.js +805 -0
  70. data/vendor/jquery_file_upload/package-lock.json +6853 -0
  71. data/vendor/jquery_file_upload/package.json +116 -0
  72. data/vendor/jquery_file_upload/server/gae-python/app.yaml +18 -0
  73. data/vendor/jquery_file_upload/server/gae-python/main.py +204 -0
  74. data/vendor/jquery_file_upload/server/gae-python/static/favicon.ico +0 -0
  75. data/vendor/jquery_file_upload/server/gae-python/static/robots.txt +2 -0
  76. data/vendor/jquery_file_upload/server/php/Dockerfile +44 -0
  77. data/vendor/jquery_file_upload/server/php/UploadHandler.php +1480 -0
  78. data/vendor/jquery_file_upload/server/php/index.php +15 -0
  79. data/vendor/jquery_file_upload/server/php/php.ini +5 -0
  80. data/vendor/jquery_file_upload/test/index.html +49 -0
  81. data/vendor/jquery_file_upload/test/unit.js +989 -0
  82. data/vendor/jquery_file_upload/test/vendor/chai.js +10854 -0
  83. data/vendor/jquery_file_upload/test/vendor/mocha.css +325 -0
  84. data/vendor/jquery_file_upload/test/vendor/mocha.js +18178 -0
  85. data/vendor/jquery_file_upload/wdio/LICENSE.txt +20 -0
  86. data/vendor/jquery_file_upload/wdio/assets/black+white-3x2.jpg +0 -0
  87. data/vendor/jquery_file_upload/wdio/assets/black+white-60x40.gif +0 -0
  88. data/vendor/jquery_file_upload/wdio/conf/chrome.js +40 -0
  89. data/vendor/jquery_file_upload/wdio/conf/firefox.js +25 -0
  90. data/vendor/jquery_file_upload/wdio/hooks/index.js +36 -0
  91. data/vendor/jquery_file_upload/wdio/test/pages/file-upload.js +79 -0
  92. data/vendor/jquery_file_upload/wdio/test/specs/01-file-upload.js +25 -0
  93. data/vendor/jquery_file_upload/wdio/wdio.conf.js +4 -0
  94. data/vendor/jquery_rails/CHANGELOG.md +359 -0
  95. data/vendor/jquery_rails/CONTRIBUTING.md +132 -0
  96. data/vendor/jquery_rails/Gemfile +22 -0
  97. data/vendor/jquery_rails/MIT-LICENSE +21 -0
  98. data/vendor/jquery_rails/README.md +75 -0
  99. data/vendor/jquery_rails/Rakefile +59 -0
  100. data/vendor/jquery_rails/VERSIONS.md +62 -0
  101. data/vendor/jquery_rails/jquery-rails.gemspec +26 -0
  102. data/vendor/jquery_rails/lib/jquery/assert_select.rb +149 -0
  103. data/vendor/jquery_rails/lib/jquery/rails/engine.rb +6 -0
  104. data/vendor/jquery_rails/lib/jquery/rails/version.rb +9 -0
  105. data/vendor/jquery_rails/lib/jquery/rails.rb +8 -0
  106. data/vendor/jquery_rails/lib/jquery-rails.rb +1 -0
  107. data/vendor/jquery_rails/test/assert_select_jquery_test.rb +85 -0
  108. data/vendor/jquery_rails/test/test_helper.rb +6 -0
  109. data/vendor/jquery_rails/vendor/assets/javascripts/jquery.js +11008 -0
  110. data/vendor/jquery_rails/vendor/assets/javascripts/jquery.min.js +5 -0
  111. data/vendor/jquery_rails/vendor/assets/javascripts/jquery.min.map +1 -0
  112. data/vendor/jquery_rails/vendor/assets/javascripts/jquery2.js +9814 -0
  113. data/vendor/jquery_rails/vendor/assets/javascripts/jquery2.min.js +4 -0
  114. data/vendor/jquery_rails/vendor/assets/javascripts/jquery2.min.map +1 -0
  115. data/vendor/jquery_rails/vendor/assets/javascripts/jquery3.js +10364 -0
  116. data/vendor/jquery_rails/vendor/assets/javascripts/jquery3.min.js +2 -0
  117. data/vendor/jquery_rails/vendor/assets/javascripts/jquery3.min.map +1 -0
  118. data/vendor/jquery_rails/vendor/assets/javascripts/jquery_ujs.js +555 -0
  119. metadata +104 -7
@@ -0,0 +1,357 @@
1
+ <!DOCTYPE html>
2
+ <!--
3
+ /*
4
+ * jQuery File Upload Demo
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
+ * https://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
23
+ name="description"
24
+ 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."
25
+ />
26
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
27
+ <!-- Bootstrap styles -->
28
+ <link
29
+ rel="stylesheet"
30
+ href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"
31
+ integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u"
32
+ crossorigin="anonymous"
33
+ />
34
+ <!-- Generic page styles -->
35
+ <style>
36
+ #navigation {
37
+ margin: 10px 0;
38
+ }
39
+ @media (max-width: 767px) {
40
+ #title,
41
+ #description {
42
+ display: none;
43
+ }
44
+ }
45
+ </style>
46
+ <!-- blueimp Gallery styles -->
47
+ <link
48
+ rel="stylesheet"
49
+ href="https://blueimp.github.io/Gallery/css/blueimp-gallery.min.css"
50
+ />
51
+ <!-- CSS to style the file input field as button and adjust the Bootstrap progress bars -->
52
+ <link rel="stylesheet" href="css/jquery.fileupload.css" />
53
+ <link rel="stylesheet" href="css/jquery.fileupload-ui.css" />
54
+ <!-- CSS adjustments for browsers with JavaScript disabled -->
55
+ <noscript
56
+ ><link rel="stylesheet" href="css/jquery.fileupload-noscript.css"
57
+ /></noscript>
58
+ <noscript
59
+ ><link rel="stylesheet" href="css/jquery.fileupload-ui-noscript.css"
60
+ /></noscript>
61
+ </head>
62
+ <body>
63
+ <div class="container">
64
+ <ul class="nav nav-tabs" id="navigation">
65
+ <li>
66
+ <a href="https://github.com/blueimp/jQuery-File-Upload">Project</a>
67
+ </li>
68
+ <li class="active">
69
+ <a href="#">Demo</a>
70
+ </li>
71
+ <li>
72
+ <a href="https://github.com/blueimp/jQuery-File-Upload/wiki">Wiki</a>
73
+ </li>
74
+ <li>
75
+ <a href="https://blueimp.net">Author</a>
76
+ </li>
77
+ </ul>
78
+ <h1 id="title">jQuery File Upload Demo</h1>
79
+ <blockquote id="description">
80
+ <p>
81
+ File Upload widget with multiple file selection, drag&amp;drop
82
+ support, progress bars, validation and preview images, audio and video
83
+ for jQuery.<br />
84
+ Supports cross-domain, chunked and resumable file uploads and
85
+ client-side image resizing.<br />
86
+ Works with any server-side platform (PHP, Python, Ruby on Rails, Java,
87
+ Node.js, Go etc.) that supports standard HTML form file uploads.
88
+ </p>
89
+ </blockquote>
90
+ <!-- The file upload form used as target for the file upload widget -->
91
+ <form
92
+ id="fileupload"
93
+ action="https://jquery-file-upload.appspot.com/"
94
+ method="POST"
95
+ enctype="multipart/form-data"
96
+ >
97
+ <!-- Redirect browsers with JavaScript disabled to the origin page -->
98
+ <noscript
99
+ ><input
100
+ type="hidden"
101
+ name="redirect"
102
+ value="https://blueimp.github.io/jQuery-File-Upload/"
103
+ /></noscript>
104
+ <!-- The fileupload-buttonbar contains buttons to add/delete files and start/cancel the upload -->
105
+ <div class="row fileupload-buttonbar">
106
+ <div class="col-lg-7">
107
+ <!-- The fileinput-button span is used to style the file input field as button -->
108
+ <span class="btn btn-success fileinput-button">
109
+ <i class="glyphicon glyphicon-plus"></i>
110
+ <span>Add files...</span>
111
+ <input type="file" name="files[]" multiple />
112
+ </span>
113
+ <button type="submit" class="btn btn-primary start">
114
+ <i class="glyphicon glyphicon-upload"></i>
115
+ <span>Start upload</span>
116
+ </button>
117
+ <button type="reset" class="btn btn-warning cancel">
118
+ <i class="glyphicon glyphicon-ban-circle"></i>
119
+ <span>Cancel upload</span>
120
+ </button>
121
+ <button type="button" class="btn btn-danger delete">
122
+ <i class="glyphicon glyphicon-trash"></i>
123
+ <span>Delete selected</span>
124
+ </button>
125
+ <input type="checkbox" class="toggle" />
126
+ <!-- The global file processing state -->
127
+ <span class="fileupload-process"></span>
128
+ </div>
129
+ <!-- The global progress state -->
130
+ <div class="col-lg-5 fileupload-progress fade">
131
+ <!-- The global progress bar -->
132
+ <div
133
+ class="progress progress-striped active"
134
+ role="progressbar"
135
+ aria-valuemin="0"
136
+ aria-valuemax="100"
137
+ >
138
+ <div
139
+ class="progress-bar progress-bar-success"
140
+ style="width: 0%;"
141
+ ></div>
142
+ </div>
143
+ <!-- The extended global progress state -->
144
+ <div class="progress-extended">&nbsp;</div>
145
+ </div>
146
+ </div>
147
+ <!-- The table listing the files available for upload/download -->
148
+ <table role="presentation" class="table table-striped">
149
+ <tbody class="files"></tbody>
150
+ </table>
151
+ </form>
152
+ <div class="panel panel-default">
153
+ <div class="panel-heading">
154
+ <h3 class="panel-title">Demo Notes</h3>
155
+ </div>
156
+ <div class="panel-body">
157
+ <ul>
158
+ <li>
159
+ The maximum file size for uploads in this demo is
160
+ <strong>999 KB</strong> (default file size is unlimited).
161
+ </li>
162
+ <li>
163
+ Only image files (<strong>JPG, GIF, PNG</strong>) are allowed in
164
+ this demo (by default there is no file type restriction).
165
+ </li>
166
+ <li>
167
+ Uploaded files will be deleted automatically after
168
+ <strong>5 minutes or less</strong> (demo files are stored in
169
+ memory).
170
+ </li>
171
+ <li>
172
+ You can <strong>drag &amp; drop</strong> files from your desktop
173
+ on this webpage (see
174
+ <a
175
+ href="https://github.com/blueimp/jQuery-File-Upload/wiki/Browser-support"
176
+ >Browser support</a
177
+ >).
178
+ </li>
179
+ <li>
180
+ Please refer to the
181
+ <a href="https://github.com/blueimp/jQuery-File-Upload"
182
+ >project website</a
183
+ >
184
+ and
185
+ <a href="https://github.com/blueimp/jQuery-File-Upload/wiki"
186
+ >documentation</a
187
+ >
188
+ for more information.
189
+ </li>
190
+ <li>
191
+ Built with the
192
+ <a href="https://getbootstrap.com/">Bootstrap</a> CSS framework
193
+ and Icons from <a href="https://glyphicons.com/">Glyphicons</a>.
194
+ </li>
195
+ </ul>
196
+ </div>
197
+ </div>
198
+ </div>
199
+ <!-- The blueimp Gallery widget -->
200
+ <div
201
+ id="blueimp-gallery"
202
+ class="blueimp-gallery blueimp-gallery-controls"
203
+ aria-label="image gallery"
204
+ aria-modal="true"
205
+ role="dialog"
206
+ data-filter=":even"
207
+ >
208
+ <div class="slides" aria-live="polite"></div>
209
+ <h3 class="title"></h3>
210
+ <a
211
+ class="prev"
212
+ aria-controls="blueimp-gallery"
213
+ aria-label="previous slide"
214
+ aria-keyshortcuts="ArrowLeft"
215
+ ></a>
216
+ <a
217
+ class="next"
218
+ aria-controls="blueimp-gallery"
219
+ aria-label="next slide"
220
+ aria-keyshortcuts="ArrowRight"
221
+ ></a>
222
+ <a
223
+ class="close"
224
+ aria-controls="blueimp-gallery"
225
+ aria-label="close"
226
+ aria-keyshortcuts="Escape"
227
+ ></a>
228
+ <a
229
+ class="play-pause"
230
+ aria-controls="blueimp-gallery"
231
+ aria-label="play slideshow"
232
+ aria-keyshortcuts="Space"
233
+ aria-pressed="false"
234
+ role="button"
235
+ ></a>
236
+ <ol class="indicator"></ol>
237
+ </div>
238
+ <!-- The template to display files available for upload -->
239
+ <script id="template-upload" type="text/x-tmpl">
240
+ {% for (var i=0, file; file=o.files[i]; i++) { %}
241
+ <tr class="template-upload fade{%=o.options.loadImageFileTypes.test(file.type)?' image':''%}">
242
+ <td>
243
+ <span class="preview"></span>
244
+ </td>
245
+ <td>
246
+ <p class="name">{%=file.name%}</p>
247
+ <strong class="error text-danger"></strong>
248
+ </td>
249
+ <td>
250
+ <p class="size">Processing...</p>
251
+ <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>
252
+ </td>
253
+ <td>
254
+ {% if (!o.options.autoUpload && o.options.edit && o.options.loadImageFileTypes.test(file.type)) { %}
255
+ <button class="btn btn-success edit" data-index="{%=i%}" disabled>
256
+ <i class="glyphicon glyphicon-edit"></i>
257
+ <span>Edit</span>
258
+ </button>
259
+ {% } %}
260
+ {% if (!i && !o.options.autoUpload) { %}
261
+ <button class="btn btn-primary start" disabled>
262
+ <i class="glyphicon glyphicon-upload"></i>
263
+ <span>Start</span>
264
+ </button>
265
+ {% } %}
266
+ {% if (!i) { %}
267
+ <button class="btn btn-warning cancel">
268
+ <i class="glyphicon glyphicon-ban-circle"></i>
269
+ <span>Cancel</span>
270
+ </button>
271
+ {% } %}
272
+ </td>
273
+ </tr>
274
+ {% } %}
275
+ </script>
276
+ <!-- The template to display files available for download -->
277
+ <script id="template-download" type="text/x-tmpl">
278
+ {% for (var i=0, file; file=o.files[i]; i++) { %}
279
+ <tr class="template-download fade{%=file.thumbnailUrl?' image':''%}">
280
+ <td>
281
+ <span class="preview">
282
+ {% if (file.thumbnailUrl) { %}
283
+ <a href="{%=file.url%}" title="{%=file.name%}" download="{%=file.name%}" data-gallery><img src="{%=file.thumbnailUrl%}"></a>
284
+ {% } %}
285
+ </span>
286
+ </td>
287
+ <td>
288
+ <p class="name">
289
+ {% if (file.url) { %}
290
+ <a href="{%=file.url%}" title="{%=file.name%}" download="{%=file.name%}" {%=file.thumbnailUrl?'data-gallery':''%}>{%=file.name%}</a>
291
+ {% } else { %}
292
+ <span>{%=file.name%}</span>
293
+ {% } %}
294
+ </p>
295
+ {% if (file.error) { %}
296
+ <div><span class="label label-danger">Error</span> {%=file.error%}</div>
297
+ {% } %}
298
+ </td>
299
+ <td>
300
+ <span class="size">{%=o.formatFileSize(file.size)%}</span>
301
+ </td>
302
+ <td>
303
+ {% if (file.deleteUrl) { %}
304
+ <button class="btn btn-danger delete" data-type="{%=file.deleteType%}" data-url="{%=file.deleteUrl%}"{% if (file.deleteWithCredentials) { %} data-xhr-fields='{"withCredentials":true}'{% } %}>
305
+ <i class="glyphicon glyphicon-trash"></i>
306
+ <span>Delete</span>
307
+ </button>
308
+ <input type="checkbox" name="delete" value="1" class="toggle">
309
+ {% } else { %}
310
+ <button class="btn btn-warning cancel">
311
+ <i class="glyphicon glyphicon-ban-circle"></i>
312
+ <span>Cancel</span>
313
+ </button>
314
+ {% } %}
315
+ </td>
316
+ </tr>
317
+ {% } %}
318
+ </script>
319
+ <script
320
+ src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"
321
+ integrity="sha384-nvAa0+6Qg9clwYCGGPpDQLVpLNn0fRaROjHqs13t4Ggj3Ez50XnGQqc/r8MhnRDZ"
322
+ crossorigin="anonymous"
323
+ ></script>
324
+ <!-- The jQuery UI widget factory, can be omitted if jQuery UI is already included -->
325
+ <script src="js/vendor/jquery.ui.widget.js"></script>
326
+ <!-- The Templates plugin is included to render the upload/download listings -->
327
+ <script src="https://blueimp.github.io/JavaScript-Templates/js/tmpl.min.js"></script>
328
+ <!-- The Load Image plugin is included for the preview images and image resizing functionality -->
329
+ <script src="https://blueimp.github.io/JavaScript-Load-Image/js/load-image.all.min.js"></script>
330
+ <!-- The Canvas to Blob plugin is included for image resizing functionality -->
331
+ <script src="https://blueimp.github.io/JavaScript-Canvas-to-Blob/js/canvas-to-blob.min.js"></script>
332
+ <!-- blueimp Gallery script -->
333
+ <script src="https://blueimp.github.io/Gallery/js/jquery.blueimp-gallery.min.js"></script>
334
+ <!-- The Iframe Transport is required for browsers without support for XHR file uploads -->
335
+ <script src="js/jquery.iframe-transport.js"></script>
336
+ <!-- The basic File Upload plugin -->
337
+ <script src="js/jquery.fileupload.js"></script>
338
+ <!-- The File Upload processing plugin -->
339
+ <script src="js/jquery.fileupload-process.js"></script>
340
+ <!-- The File Upload image preview & resize plugin -->
341
+ <script src="js/jquery.fileupload-image.js"></script>
342
+ <!-- The File Upload audio preview plugin -->
343
+ <script src="js/jquery.fileupload-audio.js"></script>
344
+ <!-- The File Upload video preview plugin -->
345
+ <script src="js/jquery.fileupload-video.js"></script>
346
+ <!-- The File Upload validation plugin -->
347
+ <script src="js/jquery.fileupload-validate.js"></script>
348
+ <!-- The File Upload user interface plugin -->
349
+ <script src="js/jquery.fileupload-ui.js"></script>
350
+ <!-- The main application script -->
351
+ <script src="js/demo.js"></script>
352
+ <!-- The XDomainRequest Transport is included for cross-domain file deletion for IE 8 and IE 9 -->
353
+ <!--[if (gte IE 8)&(lt IE 10)]>
354
+ <script src="js/cors/jquery.xdr-transport.js"></script>
355
+ <![endif]-->
356
+ </body>
357
+ </html>
@@ -0,0 +1,126 @@
1
+ /*
2
+ * jQuery postMessage Transport Plugin
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
+ * https://opensource.org/licenses/MIT
10
+ */
11
+
12
+ /* global define, require */
13
+
14
+ (function (factory) {
15
+ 'use strict';
16
+ if (typeof define === 'function' && define.amd) {
17
+ // Register as an anonymous AMD module:
18
+ define(['jquery'], factory);
19
+ } else if (typeof exports === 'object') {
20
+ // Node/CommonJS:
21
+ factory(require('jquery'));
22
+ } else {
23
+ // Browser globals:
24
+ factory(window.jQuery);
25
+ }
26
+ })(function ($) {
27
+ 'use strict';
28
+
29
+ var counter = 0,
30
+ names = [
31
+ 'accepts',
32
+ 'cache',
33
+ 'contents',
34
+ 'contentType',
35
+ 'crossDomain',
36
+ 'data',
37
+ 'dataType',
38
+ 'headers',
39
+ 'ifModified',
40
+ 'mimeType',
41
+ 'password',
42
+ 'processData',
43
+ 'timeout',
44
+ 'traditional',
45
+ 'type',
46
+ 'url',
47
+ 'username'
48
+ ],
49
+ convert = function (p) {
50
+ return p;
51
+ };
52
+
53
+ $.ajaxSetup({
54
+ converters: {
55
+ 'postmessage text': convert,
56
+ 'postmessage json': convert,
57
+ 'postmessage html': convert
58
+ }
59
+ });
60
+
61
+ $.ajaxTransport('postmessage', function (options) {
62
+ if (options.postMessage && window.postMessage) {
63
+ var iframe,
64
+ loc = $('<a></a>').prop('href', options.postMessage)[0],
65
+ target = loc.protocol + '//' + loc.host,
66
+ xhrUpload = options.xhr().upload;
67
+ // IE always includes the port for the host property of a link
68
+ // element, but not in the location.host or origin property for the
69
+ // default http port 80 and https port 443, so we strip it:
70
+ if (/^(http:\/\/.+:80)|(https:\/\/.+:443)$/.test(target)) {
71
+ target = target.replace(/:(80|443)$/, '');
72
+ }
73
+ return {
74
+ send: function (_, completeCallback) {
75
+ counter += 1;
76
+ var message = {
77
+ id: 'postmessage-transport-' + counter
78
+ },
79
+ eventName = 'message.' + message.id;
80
+ iframe = $(
81
+ '<iframe style="display:none;" src="' +
82
+ options.postMessage +
83
+ '" name="' +
84
+ message.id +
85
+ '"></iframe>'
86
+ )
87
+ .on('load', function () {
88
+ $.each(names, function (i, name) {
89
+ message[name] = options[name];
90
+ });
91
+ message.dataType = message.dataType.replace('postmessage ', '');
92
+ $(window).on(eventName, function (event) {
93
+ var e = event.originalEvent;
94
+ var data = e.data;
95
+ var ev;
96
+ if (e.origin === target && data.id === message.id) {
97
+ if (data.type === 'progress') {
98
+ ev = document.createEvent('Event');
99
+ ev.initEvent(data.type, false, true);
100
+ $.extend(ev, data);
101
+ xhrUpload.dispatchEvent(ev);
102
+ } else {
103
+ completeCallback(
104
+ data.status,
105
+ data.statusText,
106
+ { postmessage: data.result },
107
+ data.headers
108
+ );
109
+ iframe.remove();
110
+ $(window).off(eventName);
111
+ }
112
+ }
113
+ });
114
+ iframe[0].contentWindow.postMessage(message, target);
115
+ })
116
+ .appendTo(document.body);
117
+ },
118
+ abort: function () {
119
+ if (iframe) {
120
+ iframe.remove();
121
+ }
122
+ }
123
+ };
124
+ }
125
+ });
126
+ });
@@ -0,0 +1,97 @@
1
+ /*
2
+ * jQuery XDomainRequest Transport Plugin
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
+ * https://opensource.org/licenses/MIT
10
+ *
11
+ * Based on Julian Aubourg's ajaxHooks xdr.js:
12
+ * https://github.com/jaubourg/ajaxHooks/
13
+ */
14
+
15
+ /* global define, require, XDomainRequest */
16
+
17
+ (function (factory) {
18
+ 'use strict';
19
+ if (typeof define === 'function' && define.amd) {
20
+ // Register as an anonymous AMD module:
21
+ define(['jquery'], factory);
22
+ } else if (typeof exports === 'object') {
23
+ // Node/CommonJS:
24
+ factory(require('jquery'));
25
+ } else {
26
+ // Browser globals:
27
+ factory(window.jQuery);
28
+ }
29
+ })(function ($) {
30
+ 'use strict';
31
+ if (window.XDomainRequest && !$.support.cors) {
32
+ $.ajaxTransport(function (s) {
33
+ if (s.crossDomain && s.async) {
34
+ if (s.timeout) {
35
+ s.xdrTimeout = s.timeout;
36
+ delete s.timeout;
37
+ }
38
+ var xdr;
39
+ return {
40
+ send: function (headers, completeCallback) {
41
+ var addParamChar = /\?/.test(s.url) ? '&' : '?';
42
+ /**
43
+ * Callback wrapper function
44
+ *
45
+ * @param {number} status HTTP status code
46
+ * @param {string} statusText HTTP status text
47
+ * @param {object} [responses] Content-type specific responses
48
+ * @param {string} [responseHeaders] Response headers string
49
+ */
50
+ function callback(status, statusText, responses, responseHeaders) {
51
+ xdr.onload = xdr.onerror = xdr.ontimeout = $.noop;
52
+ xdr = null;
53
+ completeCallback(status, statusText, responses, responseHeaders);
54
+ }
55
+ xdr = new XDomainRequest();
56
+ // XDomainRequest only supports GET and POST:
57
+ if (s.type === 'DELETE') {
58
+ s.url = s.url + addParamChar + '_method=DELETE';
59
+ s.type = 'POST';
60
+ } else if (s.type === 'PUT') {
61
+ s.url = s.url + addParamChar + '_method=PUT';
62
+ s.type = 'POST';
63
+ } else if (s.type === 'PATCH') {
64
+ s.url = s.url + addParamChar + '_method=PATCH';
65
+ s.type = 'POST';
66
+ }
67
+ xdr.open(s.type, s.url);
68
+ xdr.onload = function () {
69
+ callback(
70
+ 200,
71
+ 'OK',
72
+ { text: xdr.responseText },
73
+ 'Content-Type: ' + xdr.contentType
74
+ );
75
+ };
76
+ xdr.onerror = function () {
77
+ callback(404, 'Not Found');
78
+ };
79
+ if (s.xdrTimeout) {
80
+ xdr.ontimeout = function () {
81
+ callback(0, 'timeout');
82
+ };
83
+ xdr.timeout = s.xdrTimeout;
84
+ }
85
+ xdr.send((s.hasContent && s.data) || null);
86
+ },
87
+ abort: function () {
88
+ if (xdr) {
89
+ xdr.onerror = $.noop();
90
+ xdr.abort();
91
+ }
92
+ }
93
+ };
94
+ }
95
+ });
96
+ }
97
+ });
@@ -0,0 +1,75 @@
1
+ /*
2
+ * jQuery File Upload Demo
3
+ * https://github.com/blueimp/jQuery-File-Upload
4
+ *
5
+ * Copyright 2010, Sebastian Tschan
6
+ * https://blueimp.net
7
+ *
8
+ * Licensed under the MIT license:
9
+ * https://opensource.org/licenses/MIT
10
+ */
11
+
12
+ /* global $ */
13
+
14
+ $(function () {
15
+ 'use strict';
16
+
17
+ // Initialize the jQuery File Upload widget:
18
+ $('#fileupload').fileupload({
19
+ // Uncomment the following to send cross-domain cookies:
20
+ //xhrFields: {withCredentials: true},
21
+ url: 'server/php/'
22
+ });
23
+
24
+ // Enable iframe cross-domain access via redirect option:
25
+ $('#fileupload').fileupload(
26
+ 'option',
27
+ 'redirect',
28
+ window.location.href.replace(/\/[^/]*$/, '/cors/result.html?%s')
29
+ );
30
+
31
+ if (window.location.hostname === 'blueimp.github.io') {
32
+ // Demo settings:
33
+ $('#fileupload').fileupload('option', {
34
+ url: '//jquery-file-upload.appspot.com/',
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/.test(
39
+ window.navigator.userAgent
40
+ ),
41
+ maxFileSize: 999000,
42
+ acceptFileTypes: /(\.|\/)(gif|jpe?g|png)$/i
43
+ });
44
+ // Upload server status check for browsers with CORS support:
45
+ if ($.support.cors) {
46
+ $.ajax({
47
+ url: '//jquery-file-upload.appspot.com/',
48
+ type: 'HEAD'
49
+ }).fail(function () {
50
+ $('<div class="alert alert-danger"></div>')
51
+ .text('Upload server currently unavailable - ' + new Date())
52
+ .appendTo('#fileupload');
53
+ });
54
+ }
55
+ } else {
56
+ // Load existing files:
57
+ $('#fileupload').addClass('fileupload-processing');
58
+ $.ajax({
59
+ // Uncomment the following to send cross-domain cookies:
60
+ //xhrFields: {withCredentials: true},
61
+ url: $('#fileupload').fileupload('option', 'url'),
62
+ dataType: 'json',
63
+ context: $('#fileupload')[0]
64
+ })
65
+ .always(function () {
66
+ $(this).removeClass('fileupload-processing');
67
+ })
68
+ .done(function (result) {
69
+ $(this)
70
+ .fileupload('option', 'done')
71
+ // eslint-disable-next-line new-cap
72
+ .call(this, $.Event('done'), { result: result });
73
+ });
74
+ }
75
+ });