attachinary-dox 1.3.1.pre → 1.3.1.pre2

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 (230) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +71 -0
  3. data/lib/attachinary/version.rb +1 -1
  4. data/spec/dummy/Gemfile +20 -0
  5. data/spec/dummy/Gemfile.lock +267 -0
  6. data/spec/dummy/Rakefile +7 -0
  7. data/spec/dummy/app/active_record/note.rb +12 -0
  8. data/spec/dummy/app/assets/config/manifest.js +2 -0
  9. data/spec/dummy/app/assets/javascripts/application.js +28 -0
  10. data/spec/dummy/app/assets/stylesheets/application.css +21 -0
  11. data/spec/dummy/app/controllers/application_controller.rb +3 -0
  12. data/spec/dummy/app/controllers/notes_controller.rb +56 -0
  13. data/spec/dummy/app/views/layouts/application.html.erb +15 -0
  14. data/spec/dummy/app/views/notes/_form_builder.html.erb +28 -0
  15. data/spec/dummy/app/views/notes/_form_nojs.html.erb +17 -0
  16. data/spec/dummy/app/views/notes/_form_raw.html.erb +28 -0
  17. data/spec/dummy/app/views/notes/_form_simple_form.html.erb +17 -0
  18. data/spec/dummy/app/views/notes/_note.html.erb +15 -0
  19. data/spec/dummy/app/views/notes/edit.html.erb +1 -0
  20. data/spec/dummy/app/views/notes/index.html.erb +12 -0
  21. data/spec/dummy/app/views/notes/new.html.erb +1 -0
  22. data/spec/dummy/config/application.rb +62 -0
  23. data/spec/dummy/config/boot.rb +4 -0
  24. data/spec/dummy/config/cloudinary.yml.example +15 -0
  25. data/spec/dummy/config/database.yml +25 -0
  26. data/spec/dummy/config/environment.rb +5 -0
  27. data/spec/dummy/config/environments/development.rb +33 -0
  28. data/spec/dummy/config/environments/production.rb +63 -0
  29. data/spec/dummy/config/environments/test.rb +37 -0
  30. data/spec/dummy/config/initializers/attachinary.rb +1 -0
  31. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  32. data/spec/dummy/config/initializers/inflections.rb +15 -0
  33. data/spec/dummy/config/initializers/mime_types.rb +5 -0
  34. data/spec/dummy/config/initializers/secret_token.rb +7 -0
  35. data/spec/dummy/config/initializers/session_store.rb +8 -0
  36. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  37. data/spec/dummy/config/locales/en.yml +5 -0
  38. data/spec/dummy/config/routes.rb +5 -0
  39. data/spec/dummy/config.ru +4 -0
  40. data/spec/dummy/db/migrate/20120608091037_create_tables.rb +17 -0
  41. data/spec/dummy/db/migrate/20120608104143_create_notes.rb +9 -0
  42. data/spec/dummy/db/schema.rb +35 -0
  43. data/spec/dummy/script/rails +6 -0
  44. data/spec/dummy/spec/rails_helper.rb +48 -0
  45. data/spec/dummy/spec/spec_helper.rb +92 -0
  46. data/spec/dummy/vendor/assets/javascripts/jquery.fileupload.js +1604 -0
  47. data/spec/dummy/vendor/assets/javascripts/jquery.iframe-transport.js +227 -0
  48. data/spec/dummy/vendor/assets/javascripts/jquery.ui.widget.js +528 -0
  49. data/spec/factories.rb +17 -0
  50. data/spec/features/notes_spec.rb +97 -0
  51. data/spec/models/attachinary/file_spec.rb +44 -0
  52. data/spec/models/note_spec.rb +176 -0
  53. data/spec/spec_helper.rb +78 -0
  54. data/spec/support/A.gif +0 -0
  55. data/spec/support/A.txt +1 -0
  56. data/spec/support/B.gif +0 -0
  57. data/spec/support/C.gif +0 -0
  58. data/spec/support/request_helpers.rb +16 -0
  59. data/vendor/bundle/ruby/3.3.0/extensions/x86_64-linux/3.3.0/bigdecimal-3.1.9/gem_make.out +5 -5
  60. data/vendor/bundle/ruby/3.3.0/extensions/x86_64-linux/3.3.0/bigdecimal-3.1.9/mkmf.log +3 -3
  61. data/vendor/bundle/ruby/3.3.0/extensions/x86_64-linux/3.3.0/cgi-0.4.2/gem_make.out +5 -5
  62. data/vendor/bundle/ruby/3.3.0/extensions/x86_64-linux/3.3.0/date-3.4.1/gem_make.out +5 -5
  63. data/vendor/bundle/ruby/3.3.0/extensions/x86_64-linux/3.3.0/erb-4.0.4/gem_make.out +5 -5
  64. data/vendor/bundle/ruby/3.3.0/extensions/x86_64-linux/3.3.0/io-console-0.8.0/gem_make.out +5 -5
  65. data/vendor/bundle/ruby/3.3.0/extensions/x86_64-linux/3.3.0/json-2.12.0/gem_make.out +5 -5
  66. data/vendor/bundle/ruby/3.3.0/extensions/x86_64-linux/3.3.0/mini_racer-0.18.1/gem_make.out +5 -5
  67. data/vendor/bundle/ruby/3.3.0/extensions/x86_64-linux/3.3.0/nio4r-2.7.4/gem_make.out +5 -5
  68. data/vendor/bundle/ruby/3.3.0/extensions/x86_64-linux/3.3.0/psych-5.2.6/gem_make.out +5 -5
  69. data/vendor/bundle/ruby/3.3.0/extensions/x86_64-linux/3.3.0/puma-6.4.2/gem_make.out +5 -5
  70. data/vendor/bundle/ruby/3.3.0/extensions/x86_64-linux/3.3.0/racc-1.8.1/gem_make.out +5 -5
  71. data/vendor/bundle/ruby/3.3.0/extensions/x86_64-linux/3.3.0/stringio-3.1.7/gem_make.out +5 -5
  72. data/vendor/bundle/ruby/3.3.0/extensions/x86_64-linux/3.3.0/websocket-driver-0.7.7/gem_make.out +5 -5
  73. metadata +114 -160
  74. data/lib/tasks/ci.rake +0 -16
  75. data/vendor/cache/actioncable-7.2.2.1.gem +0 -0
  76. data/vendor/cache/actionmailbox-7.2.2.1.gem +0 -0
  77. data/vendor/cache/actionmailer-7.2.2.1.gem +0 -0
  78. data/vendor/cache/actionpack-7.2.2.1.gem +0 -0
  79. data/vendor/cache/actiontext-7.2.2.1.gem +0 -0
  80. data/vendor/cache/actionview-7.2.2.1.gem +0 -0
  81. data/vendor/cache/activejob-7.2.2.1.gem +0 -0
  82. data/vendor/cache/activemodel-7.2.2.1.gem +0 -0
  83. data/vendor/cache/activerecord-7.2.2.1.gem +0 -0
  84. data/vendor/cache/activestorage-7.2.2.1.gem +0 -0
  85. data/vendor/cache/activesupport-7.2.2.1.gem +0 -0
  86. data/vendor/cache/addressable-2.8.7.gem +0 -0
  87. data/vendor/cache/base64-0.2.0.gem +0 -0
  88. data/vendor/cache/benchmark-0.4.0.gem +0 -0
  89. data/vendor/cache/bigdecimal-3.1.9.gem +0 -0
  90. data/vendor/cache/builder-3.3.0.gem +0 -0
  91. data/vendor/cache/capybara-3.40.0.gem +0 -0
  92. data/vendor/cache/capybara-screenshot-1.0.26.gem +0 -0
  93. data/vendor/cache/cgi-0.4.2.gem +0 -0
  94. data/vendor/cache/childprocess-5.1.0.gem +0 -0
  95. data/vendor/cache/cloudinary-2.3.0.gem +0 -0
  96. data/vendor/cache/coderay-1.1.3.gem +0 -0
  97. data/vendor/cache/coffee-rails-5.0.0.gem +0 -0
  98. data/vendor/cache/coffee-script-2.4.1.gem +0 -0
  99. data/vendor/cache/coffee-script-source-1.12.2.gem +0 -0
  100. data/vendor/cache/concurrent-ruby-1.3.5.gem +0 -0
  101. data/vendor/cache/connection_pool-2.5.3.gem +0 -0
  102. data/vendor/cache/crass-1.0.6.gem +0 -0
  103. data/vendor/cache/database_cleaner-2.1.0.gem +0 -0
  104. data/vendor/cache/database_cleaner-active_record-2.2.1.gem +0 -0
  105. data/vendor/cache/database_cleaner-core-2.0.1.gem +0 -0
  106. data/vendor/cache/date-3.4.1.gem +0 -0
  107. data/vendor/cache/diff-lcs-1.6.2.gem +0 -0
  108. data/vendor/cache/dotenv-3.1.2.gem +0 -0
  109. data/vendor/cache/drb-2.2.3.gem +0 -0
  110. data/vendor/cache/erb-4.0.4.gem +0 -0
  111. data/vendor/cache/erubi-1.13.1.gem +0 -0
  112. data/vendor/cache/execjs-2.10.0.gem +0 -0
  113. data/vendor/cache/factory_bot-6.5.1.gem +0 -0
  114. data/vendor/cache/factory_bot_rails-6.4.4.gem +0 -0
  115. data/vendor/cache/faraday-2.13.1.gem +0 -0
  116. data/vendor/cache/faraday-follow_redirects-0.3.0.gem +0 -0
  117. data/vendor/cache/faraday-multipart-1.1.0.gem +0 -0
  118. data/vendor/cache/faraday-net_http-3.4.0.gem +0 -0
  119. data/vendor/cache/ffi-1.17.2-aarch64-linux-gnu.gem +0 -0
  120. data/vendor/cache/ffi-1.17.2-aarch64-linux-musl.gem +0 -0
  121. data/vendor/cache/ffi-1.17.2-arm-linux-gnu.gem +0 -0
  122. data/vendor/cache/ffi-1.17.2-arm-linux-musl.gem +0 -0
  123. data/vendor/cache/ffi-1.17.2-arm64-darwin.gem +0 -0
  124. data/vendor/cache/ffi-1.17.2-x86_64-darwin.gem +0 -0
  125. data/vendor/cache/ffi-1.17.2-x86_64-linux-gnu.gem +0 -0
  126. data/vendor/cache/ffi-1.17.2-x86_64-linux-musl.gem +0 -0
  127. data/vendor/cache/formatador-1.1.0.gem +0 -0
  128. data/vendor/cache/globalid-1.2.1.gem +0 -0
  129. data/vendor/cache/guard-2.19.1.gem +0 -0
  130. data/vendor/cache/guard-compat-1.2.1.gem +0 -0
  131. data/vendor/cache/guard-rspec-4.7.3.gem +0 -0
  132. data/vendor/cache/i18n-1.14.7.gem +0 -0
  133. data/vendor/cache/io-console-0.8.0.gem +0 -0
  134. data/vendor/cache/irb-1.15.2.gem +0 -0
  135. data/vendor/cache/jquery-rails-4.6.0.gem +0 -0
  136. data/vendor/cache/json-2.12.0.gem +0 -0
  137. data/vendor/cache/launchy-3.1.1.gem +0 -0
  138. data/vendor/cache/libv8-node-23.6.1.0-aarch64-linux.gem +0 -0
  139. data/vendor/cache/libv8-node-23.6.1.0-arm64-darwin.gem +0 -0
  140. data/vendor/cache/libv8-node-23.6.1.0-x86_64-darwin.gem +0 -0
  141. data/vendor/cache/libv8-node-23.6.1.0-x86_64-linux-musl.gem +0 -0
  142. data/vendor/cache/libv8-node-23.6.1.0-x86_64-linux.gem +0 -0
  143. data/vendor/cache/libv8-node-23.6.1.0.gem +0 -0
  144. data/vendor/cache/listen-3.0.8.gem +0 -0
  145. data/vendor/cache/logger-1.7.0.gem +0 -0
  146. data/vendor/cache/loofah-2.24.1.gem +0 -0
  147. data/vendor/cache/lumberjack-1.2.10.gem +0 -0
  148. data/vendor/cache/mail-2.8.1.gem +0 -0
  149. data/vendor/cache/marcel-1.0.4.gem +0 -0
  150. data/vendor/cache/matrix-0.4.2.gem +0 -0
  151. data/vendor/cache/method_source-1.1.0.gem +0 -0
  152. data/vendor/cache/mime-types-3.7.0.gem +0 -0
  153. data/vendor/cache/mime-types-data-3.2025.0520.gem +0 -0
  154. data/vendor/cache/mini_mime-1.1.5.gem +0 -0
  155. data/vendor/cache/mini_racer-0.18.1.gem +0 -0
  156. data/vendor/cache/minitest-5.25.5.gem +0 -0
  157. data/vendor/cache/multipart-post-2.4.1.gem +0 -0
  158. data/vendor/cache/nenv-0.3.0.gem +0 -0
  159. data/vendor/cache/net-http-0.6.0.gem +0 -0
  160. data/vendor/cache/net-imap-0.5.8.gem +0 -0
  161. data/vendor/cache/net-pop-0.1.2.gem +0 -0
  162. data/vendor/cache/net-protocol-0.2.2.gem +0 -0
  163. data/vendor/cache/net-smtp-0.5.1.gem +0 -0
  164. data/vendor/cache/nio4r-2.7.4.gem +0 -0
  165. data/vendor/cache/nokogiri-1.18.8-aarch64-linux-gnu.gem +0 -0
  166. data/vendor/cache/nokogiri-1.18.8-aarch64-linux-musl.gem +0 -0
  167. data/vendor/cache/nokogiri-1.18.8-arm-linux-gnu.gem +0 -0
  168. data/vendor/cache/nokogiri-1.18.8-arm-linux-musl.gem +0 -0
  169. data/vendor/cache/nokogiri-1.18.8-arm64-darwin.gem +0 -0
  170. data/vendor/cache/nokogiri-1.18.8-x86_64-darwin.gem +0 -0
  171. data/vendor/cache/nokogiri-1.18.8-x86_64-linux-gnu.gem +0 -0
  172. data/vendor/cache/nokogiri-1.18.8-x86_64-linux-musl.gem +0 -0
  173. data/vendor/cache/notiffany-0.1.3.gem +0 -0
  174. data/vendor/cache/ostruct-0.6.1.gem +0 -0
  175. data/vendor/cache/pp-0.6.2.gem +0 -0
  176. data/vendor/cache/prettyprint-0.2.0.gem +0 -0
  177. data/vendor/cache/pry-0.15.2.gem +0 -0
  178. data/vendor/cache/psych-5.2.6.gem +0 -0
  179. data/vendor/cache/public_suffix-6.0.2.gem +0 -0
  180. data/vendor/cache/puma-6.4.2.gem +0 -0
  181. data/vendor/cache/racc-1.8.1.gem +0 -0
  182. data/vendor/cache/rack-3.1.15.gem +0 -0
  183. data/vendor/cache/rack-session-2.1.1.gem +0 -0
  184. data/vendor/cache/rack-test-2.2.0.gem +0 -0
  185. data/vendor/cache/rackup-2.2.1.gem +0 -0
  186. data/vendor/cache/rails-7.2.2.1.gem +0 -0
  187. data/vendor/cache/rails-dom-testing-2.3.0.gem +0 -0
  188. data/vendor/cache/rails-html-sanitizer-1.6.2.gem +0 -0
  189. data/vendor/cache/railties-7.2.2.1.gem +0 -0
  190. data/vendor/cache/rake-13.2.1.gem +0 -0
  191. data/vendor/cache/rb-fsevent-0.9.8.gem +0 -0
  192. data/vendor/cache/rb-inotify-0.11.1.gem +0 -0
  193. data/vendor/cache/rdoc-6.14.0.gem +0 -0
  194. data/vendor/cache/regexp_parser-2.10.0.gem +0 -0
  195. data/vendor/cache/reline-0.6.1.gem +0 -0
  196. data/vendor/cache/rexml-3.4.1.gem +0 -0
  197. data/vendor/cache/rspec-3.13.0.gem +0 -0
  198. data/vendor/cache/rspec-core-3.13.3.gem +0 -0
  199. data/vendor/cache/rspec-expectations-3.13.4.gem +0 -0
  200. data/vendor/cache/rspec-mocks-3.13.4.gem +0 -0
  201. data/vendor/cache/rspec-rails-8.0.0.gem +0 -0
  202. data/vendor/cache/rspec-support-3.13.3.gem +0 -0
  203. data/vendor/cache/rspec_junit_formatter-0.6.0.gem +0 -0
  204. data/vendor/cache/rubyzip-2.4.1.gem +0 -0
  205. data/vendor/cache/securerandom-0.4.1.gem +0 -0
  206. data/vendor/cache/selenium-webdriver-4.32.0.gem +0 -0
  207. data/vendor/cache/shellany-0.0.1.gem +0 -0
  208. data/vendor/cache/simple_form-5.3.1.gem +0 -0
  209. data/vendor/cache/sprockets-4.2.1.gem +0 -0
  210. data/vendor/cache/sprockets-rails-3.5.2.gem +0 -0
  211. data/vendor/cache/sqlite3-2.6.0-aarch64-linux-gnu.gem +0 -0
  212. data/vendor/cache/sqlite3-2.6.0-aarch64-linux-musl.gem +0 -0
  213. data/vendor/cache/sqlite3-2.6.0-arm-linux-gnu.gem +0 -0
  214. data/vendor/cache/sqlite3-2.6.0-arm-linux-musl.gem +0 -0
  215. data/vendor/cache/sqlite3-2.6.0-arm64-darwin.gem +0 -0
  216. data/vendor/cache/sqlite3-2.6.0-x86_64-darwin.gem +0 -0
  217. data/vendor/cache/sqlite3-2.6.0-x86_64-linux-gnu.gem +0 -0
  218. data/vendor/cache/sqlite3-2.6.0-x86_64-linux-musl.gem +0 -0
  219. data/vendor/cache/stringio-3.1.7.gem +0 -0
  220. data/vendor/cache/thor-1.3.2.gem +0 -0
  221. data/vendor/cache/timeout-0.4.3.gem +0 -0
  222. data/vendor/cache/tzinfo-2.0.6.gem +0 -0
  223. data/vendor/cache/uri-1.0.3.gem +0 -0
  224. data/vendor/cache/useragent-0.16.11.gem +0 -0
  225. data/vendor/cache/valid_attribute-2.0.0.gem +0 -0
  226. data/vendor/cache/websocket-1.2.11.gem +0 -0
  227. data/vendor/cache/websocket-driver-0.7.7.gem +0 -0
  228. data/vendor/cache/websocket-extensions-0.1.5.gem +0 -0
  229. data/vendor/cache/xpath-3.2.0.gem +0 -0
  230. data/vendor/cache/zeitwerk-2.6.18.gem +0 -0
@@ -0,0 +1,227 @@
1
+ /*
2
+ * jQuery Iframe 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
+ // Helper variable to create unique names for the transport iframes:
30
+ var counter = 0,
31
+ jsonAPI = $,
32
+ jsonParse = 'parseJSON';
33
+
34
+ if ('JSON' in window && 'parse' in JSON) {
35
+ jsonAPI = JSON;
36
+ jsonParse = 'parse';
37
+ }
38
+
39
+ // The iframe transport accepts four additional options:
40
+ // options.fileInput: a jQuery collection of file input fields
41
+ // options.paramName: the parameter name for the file form data,
42
+ // overrides the name property of the file input field(s),
43
+ // can be a string or an array of strings.
44
+ // options.formData: an array of objects with name and value properties,
45
+ // equivalent to the return data of .serializeArray(), e.g.:
46
+ // [{name: 'a', value: 1}, {name: 'b', value: 2}]
47
+ // options.initialIframeSrc: the URL of the initial iframe src,
48
+ // by default set to "javascript:false;"
49
+ $.ajaxTransport('iframe', function (options) {
50
+ if (options.async) {
51
+ // javascript:false as initial iframe src
52
+ // prevents warning popups on HTTPS in IE6:
53
+ // eslint-disable-next-line no-script-url
54
+ var initialIframeSrc = options.initialIframeSrc || 'javascript:false;',
55
+ form,
56
+ iframe,
57
+ addParamChar;
58
+ return {
59
+ send: function (_, completeCallback) {
60
+ form = $('<form style="display:none;"></form>');
61
+ form.attr('accept-charset', options.formAcceptCharset);
62
+ addParamChar = /\?/.test(options.url) ? '&' : '?';
63
+ // XDomainRequest only supports GET and POST:
64
+ if (options.type === 'DELETE') {
65
+ options.url = options.url + addParamChar + '_method=DELETE';
66
+ options.type = 'POST';
67
+ } else if (options.type === 'PUT') {
68
+ options.url = options.url + addParamChar + '_method=PUT';
69
+ options.type = 'POST';
70
+ } else if (options.type === 'PATCH') {
71
+ options.url = options.url + addParamChar + '_method=PATCH';
72
+ options.type = 'POST';
73
+ }
74
+ // IE versions below IE8 cannot set the name property of
75
+ // elements that have already been added to the DOM,
76
+ // so we set the name along with the iframe HTML markup:
77
+ counter += 1;
78
+ iframe = $(
79
+ '<iframe src="' +
80
+ initialIframeSrc +
81
+ '" name="iframe-transport-' +
82
+ counter +
83
+ '"></iframe>'
84
+ ).on('load', function () {
85
+ var fileInputClones,
86
+ paramNames = $.isArray(options.paramName)
87
+ ? options.paramName
88
+ : [options.paramName];
89
+ iframe.off('load').on('load', function () {
90
+ var response;
91
+ // Wrap in a try/catch block to catch exceptions thrown
92
+ // when trying to access cross-domain iframe contents:
93
+ try {
94
+ response = iframe.contents();
95
+ // Google Chrome and Firefox do not throw an
96
+ // exception when calling iframe.contents() on
97
+ // cross-domain requests, so we unify the response:
98
+ if (!response.length || !response[0].firstChild) {
99
+ throw new Error();
100
+ }
101
+ } catch (e) {
102
+ response = undefined;
103
+ }
104
+ // The complete callback returns the
105
+ // iframe content document as response object:
106
+ completeCallback(200, 'success', { iframe: response });
107
+ // Fix for IE endless progress bar activity bug
108
+ // (happens on form submits to iframe targets):
109
+ $('<iframe src="' + initialIframeSrc + '"></iframe>').appendTo(
110
+ form
111
+ );
112
+ window.setTimeout(function () {
113
+ // Removing the form in a setTimeout call
114
+ // allows Chrome's developer tools to display
115
+ // the response result
116
+ form.remove();
117
+ }, 0);
118
+ });
119
+ form
120
+ .prop('target', iframe.prop('name'))
121
+ .prop('action', options.url)
122
+ .prop('method', options.type);
123
+ if (options.formData) {
124
+ $.each(options.formData, function (index, field) {
125
+ $('<input type="hidden"/>')
126
+ .prop('name', field.name)
127
+ .val(field.value)
128
+ .appendTo(form);
129
+ });
130
+ }
131
+ if (
132
+ options.fileInput &&
133
+ options.fileInput.length &&
134
+ options.type === 'POST'
135
+ ) {
136
+ fileInputClones = options.fileInput.clone();
137
+ // Insert a clone for each file input field:
138
+ options.fileInput.after(function (index) {
139
+ return fileInputClones[index];
140
+ });
141
+ if (options.paramName) {
142
+ options.fileInput.each(function (index) {
143
+ $(this).prop('name', paramNames[index] || options.paramName);
144
+ });
145
+ }
146
+ // Appending the file input fields to the hidden form
147
+ // removes them from their original location:
148
+ form
149
+ .append(options.fileInput)
150
+ .prop('enctype', 'multipart/form-data')
151
+ // enctype must be set as encoding for IE:
152
+ .prop('encoding', 'multipart/form-data');
153
+ // Remove the HTML5 form attribute from the input(s):
154
+ options.fileInput.removeAttr('form');
155
+ }
156
+ window.setTimeout(function () {
157
+ // Submitting the form in a setTimeout call fixes an issue with
158
+ // Safari 13 not triggering the iframe load event after resetting
159
+ // the load event handler, see also:
160
+ // https://github.com/blueimp/jQuery-File-Upload/issues/3633
161
+ form.submit();
162
+ // Insert the file input fields at their original location
163
+ // by replacing the clones with the originals:
164
+ if (fileInputClones && fileInputClones.length) {
165
+ options.fileInput.each(function (index, input) {
166
+ var clone = $(fileInputClones[index]);
167
+ // Restore the original name and form properties:
168
+ $(input)
169
+ .prop('name', clone.prop('name'))
170
+ .attr('form', clone.attr('form'));
171
+ clone.replaceWith(input);
172
+ });
173
+ }
174
+ }, 0);
175
+ });
176
+ form.append(iframe).appendTo(document.body);
177
+ },
178
+ abort: function () {
179
+ if (iframe) {
180
+ // javascript:false as iframe src aborts the request
181
+ // and prevents warning popups on HTTPS in IE6.
182
+ iframe.off('load').prop('src', initialIframeSrc);
183
+ }
184
+ if (form) {
185
+ form.remove();
186
+ }
187
+ }
188
+ };
189
+ }
190
+ });
191
+
192
+ // The iframe transport returns the iframe content document as response.
193
+ // The following adds converters from iframe to text, json, html, xml
194
+ // and script.
195
+ // Please note that the Content-Type for JSON responses has to be text/plain
196
+ // or text/html, if the browser doesn't include application/json in the
197
+ // Accept header, else IE will show a download dialog.
198
+ // The Content-Type for XML responses on the other hand has to be always
199
+ // application/xml or text/xml, so IE properly parses the XML response.
200
+ // See also
201
+ // https://github.com/blueimp/jQuery-File-Upload/wiki/Setup#content-type-negotiation
202
+ $.ajaxSetup({
203
+ converters: {
204
+ 'iframe text': function (iframe) {
205
+ return iframe && $(iframe[0].body).text();
206
+ },
207
+ 'iframe json': function (iframe) {
208
+ return iframe && jsonAPI[jsonParse]($(iframe[0].body).text());
209
+ },
210
+ 'iframe html': function (iframe) {
211
+ return iframe && $(iframe[0].body).html();
212
+ },
213
+ 'iframe xml': function (iframe) {
214
+ var xmlDoc = iframe && iframe[0];
215
+ return xmlDoc && $.isXMLDoc(xmlDoc)
216
+ ? xmlDoc
217
+ : $.parseXML(
218
+ (xmlDoc.XMLDocument && xmlDoc.XMLDocument.xml) ||
219
+ $(xmlDoc.body).html()
220
+ );
221
+ },
222
+ 'iframe script': function (iframe) {
223
+ return iframe && $.globalEval($(iframe[0].body).text());
224
+ }
225
+ }
226
+ });
227
+ });