ext_yarn 0.3.1 → 0.4.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dc1b39d7ac52024f5186be60032f8f1072d9710c1b0e584ce0b988801e06d4b8
4
- data.tar.gz: 997bd8c1871ca0b0c4cb50bbc5115caf930135095b891b090e9a8d21ca460d57
3
+ metadata.gz: d0d6b0dab125d369390dbee23a4e1c55914cadb9e98e900edaa6598b3bda7d14
4
+ data.tar.gz: e8b9f196f657635971e349c892daed678e7a1d5b42a17506211ec002f316cf11
5
5
  SHA512:
6
- metadata.gz: d6aa384def0d3f4c50ca2a043e3e70e6af1271ddf7644fbfc0cb161059ac196fab8f65338a479d816e7407cd03cd654d1e57317235029e2d0d3df7e09c1f61a1
7
- data.tar.gz: a492bf36e6254e50671b5f1250d117e1918102e96eefe6c7f231779ea1b9b68b65b79b3cfc9d547c6816485c1b12638a79a33f37830511d2ba443add66bad153
6
+ metadata.gz: bf1c9c32a30b98e008a50b80ebb43edeb0f7b458a559472d83cb131f6f9809ea51e8749c68ba8d38c672b1bf2849f1c38b126d9ef3d09858a003fdf8d3bfd740
7
+ data.tar.gz: 88e72968da9f6dee769b5ad950db1316770434063d53b8be9ddc14234c3c277b7f217afc6bcb571db7485f3d737827fe229d26ce54fe472602884557a1507070
data/.gitignore CHANGED
@@ -6,6 +6,11 @@ Gemfile.lock
6
6
  *.log
7
7
 
8
8
  # KEEP_FILES_BEGIN
9
+ vendor/actioncable/*.md
10
+
11
+ vendor/activestorage/src/*
12
+ vendor/activestorage/*.md
13
+
9
14
  vendor/bootstrap/**/*.js.map
10
15
  vendor/bootstrap/**/*.min.js
11
16
  vendor/bootstrap/dist/css/*
@@ -159,6 +164,8 @@ vendor/signature_pad/dist/signature_pad.m*
159
164
  !vendor/signature_pad/dist/signature_pad.js
160
165
  !vendor/signature_pad/package.json
161
166
 
167
+ vendor/spark-md5/*
168
+
162
169
  vendor/tempusdominus-bootstrap-4/**/*.min.js
163
170
  vendor/tempusdominus-bootstrap-4/build/css/*
164
171
  vendor/tempusdominus-bootstrap-4/node_modules/*
@@ -1,14 +1,14 @@
1
1
  module ExtYarn
2
2
  class Engine < ::Rails::Engine
3
- initializer 'ext_yarn.assets.paths' do |app|
4
- app.config.assets.paths << root.join('vendor')
5
-
6
- %w(javascripts stylesheets).each do |type|
7
- app.config.assets.paths << root.join('vendor/bootstrap-sass/assets', type)
8
- end
9
-
10
- %w(fonts stylesheets).each do |type|
11
- app.config.assets.paths << root.join('vendor/font-awesome-sass/assets', type)
3
+ initializer 'ext_yarn.append_assets_path' do |app|
4
+ %w(
5
+ vendor
6
+ vendor/bootstrap-sass/assets/javascripts
7
+ vendor/bootstrap-sass/assets/stylesheets
8
+ vendor/font-awesome-sass/assets/fonts
9
+ vendor/font-awesome-sass/assets/stylesheets
10
+ ).each do |assets_dir|
11
+ app.config.assets.paths << root.join(assets_dir).to_s
12
12
  end
13
13
  end
14
14
  end
@@ -1,3 +1,3 @@
1
1
  module ExtYarn
2
- VERSION = '0.3.1'
2
+ VERSION = '0.4.0'
3
3
  end
data/package.json CHANGED
@@ -2,6 +2,8 @@
2
2
  "name": "ext_yarn",
3
3
  "private": true,
4
4
  "dependencies": {
5
+ "actioncable": "^5.2.1",
6
+ "activestorage": "^5.2.1",
5
7
  "bootstrap": "^4.1.3",
6
8
  "bootstrap-sass": "^3.3.7",
7
9
  "bootswatch": "^4.1.3",
@@ -6,6 +6,8 @@
6
6
  "flags": [],
7
7
  "linkedModules": [],
8
8
  "topLevelPatterns": [
9
+ "actioncable@^5.2.1",
10
+ "activestorage@^5.2.1",
9
11
  "bootstrap-sass@^3.3.7",
10
12
  "bootstrap@^4.1.3",
11
13
  "bootswatch-sass@./vendor/bootswatch-sass",
@@ -32,6 +34,8 @@
32
34
  "tempusdominus-bootstrap-4@^5.1.2"
33
35
  ],
34
36
  "lockfileEntries": {
37
+ "actioncable@^5.2.1": "https://registry.yarnpkg.com/actioncable/-/actioncable-5.2.1.tgz#615428a8a302cec55117d9049f0fd7952011c962",
38
+ "activestorage@^5.2.1": "https://registry.yarnpkg.com/activestorage/-/activestorage-5.2.1.tgz#b4be57fbedc25c6c361802707fc5e8884766f6a1",
35
39
  "bootstrap-sass@^3.3.7": "https://registry.yarnpkg.com/bootstrap-sass/-/bootstrap-sass-3.3.7.tgz#6596c7ab40f6637393323ab0bc80d064fc630498",
36
40
  "bootstrap@>=4.1.2": "https://registry.yarnpkg.com/bootstrap/-/bootstrap-4.1.3.tgz#0eb371af2c8448e8c210411d0cb824a6409a12be",
37
41
  "bootstrap@^3.3": "https://registry.yarnpkg.com/bootstrap/-/bootstrap-3.3.7.tgz#5a389394549f23330875a3b150656574f8a9eb71",
@@ -50,6 +54,7 @@
50
54
  "jquery-pjax@defunkt/jquery-pjax": "https://codeload.github.com/defunkt/jquery-pjax/tar.gz/153262eda33e31119eabb97cd5f14365580a3b35",
51
55
  "jquery-ui@^1.12.1": "https://registry.yarnpkg.com/jquery-ui/-/jquery-ui-1.12.1.tgz#bcb4045c8dd0539c134bc1488cdd3e768a7a9e51",
52
56
  "jquery-ujs@rails/jquery-ujs": "https://codeload.github.com/rails/jquery-ujs/tar.gz/9e805c90c8cfc57b39967052e1e9013ccb318cf8",
57
+ "jquery@>=1.8.0": "https://registry.yarnpkg.com/jquery/-/jquery-3.3.1.tgz#958ce29e81c9790f31be7792df5d4d95fc57fbca",
53
58
  "jquery@^1.8.3 || ^2.0 || ^3.0": "https://registry.yarnpkg.com/jquery/-/jquery-3.2.1.tgz#5c4d9de652af6cd0a770154a631bba12b015c787",
54
59
  "jquery@^3.0": "https://registry.yarnpkg.com/jquery/-/jquery-3.3.1.tgz#958ce29e81c9790f31be7792df5d4d95fc57fbca",
55
60
  "jquery@^3.2.1": "https://registry.yarnpkg.com/jquery/-/jquery-3.2.1.tgz#5c4d9de652af6cd0a770154a631bba12b015c787",
@@ -71,6 +76,7 @@
71
76
  "rails-ujs@^5.2.1": "https://registry.yarnpkg.com/rails-ujs/-/rails-ujs-5.2.1.tgz#2869c6d54fdfefac3aaa257f4efe211d8f5a7169",
72
77
  "roboto-fontface@^0.8.0": "https://registry.yarnpkg.com/roboto-fontface/-/roboto-fontface-0.8.0.tgz#031a83c8f79932801a57d83bf743f37250163499",
73
78
  "signature_pad@^2.3.2": "https://registry.yarnpkg.com/signature_pad/-/signature_pad-2.3.2.tgz#ca7230021c89cedeead27b33d8d16ff254e5f04a",
79
+ "spark-md5@^3.0.0": "https://registry.yarnpkg.com/spark-md5/-/spark-md5-3.0.0.tgz#3722227c54e2faf24b1dc6d933cc144e6f71bfef",
74
80
  "tempusdominus-bootstrap-4@^5.1.2": "https://registry.yarnpkg.com/tempusdominus-bootstrap-4/-/tempusdominus-bootstrap-4-5.1.2.tgz#3c9906ca6e5d563faa0b81b2fdc6aa79cad9c0be"
75
81
  },
76
82
  "files": [],
@@ -0,0 +1,601 @@
1
+ (function() {
2
+ var context = this;
3
+
4
+ (function() {
5
+ (function() {
6
+ var slice = [].slice;
7
+
8
+ this.ActionCable = {
9
+ INTERNAL: {
10
+ "message_types": {
11
+ "welcome": "welcome",
12
+ "ping": "ping",
13
+ "confirmation": "confirm_subscription",
14
+ "rejection": "reject_subscription"
15
+ },
16
+ "default_mount_path": "/cable",
17
+ "protocols": ["actioncable-v1-json", "actioncable-unsupported"]
18
+ },
19
+ WebSocket: window.WebSocket,
20
+ logger: window.console,
21
+ createConsumer: function(url) {
22
+ var ref;
23
+ if (url == null) {
24
+ url = (ref = this.getConfig("url")) != null ? ref : this.INTERNAL.default_mount_path;
25
+ }
26
+ return new ActionCable.Consumer(this.createWebSocketURL(url));
27
+ },
28
+ getConfig: function(name) {
29
+ var element;
30
+ element = document.head.querySelector("meta[name='action-cable-" + name + "']");
31
+ return element != null ? element.getAttribute("content") : void 0;
32
+ },
33
+ createWebSocketURL: function(url) {
34
+ var a;
35
+ if (url && !/^wss?:/i.test(url)) {
36
+ a = document.createElement("a");
37
+ a.href = url;
38
+ a.href = a.href;
39
+ a.protocol = a.protocol.replace("http", "ws");
40
+ return a.href;
41
+ } else {
42
+ return url;
43
+ }
44
+ },
45
+ startDebugging: function() {
46
+ return this.debugging = true;
47
+ },
48
+ stopDebugging: function() {
49
+ return this.debugging = null;
50
+ },
51
+ log: function() {
52
+ var messages, ref;
53
+ messages = 1 <= arguments.length ? slice.call(arguments, 0) : [];
54
+ if (this.debugging) {
55
+ messages.push(Date.now());
56
+ return (ref = this.logger).log.apply(ref, ["[ActionCable]"].concat(slice.call(messages)));
57
+ }
58
+ }
59
+ };
60
+
61
+ }).call(this);
62
+ }).call(context);
63
+
64
+ var ActionCable = context.ActionCable;
65
+
66
+ (function() {
67
+ (function() {
68
+ var bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
69
+
70
+ ActionCable.ConnectionMonitor = (function() {
71
+ var clamp, now, secondsSince;
72
+
73
+ ConnectionMonitor.pollInterval = {
74
+ min: 3,
75
+ max: 30
76
+ };
77
+
78
+ ConnectionMonitor.staleThreshold = 6;
79
+
80
+ function ConnectionMonitor(connection) {
81
+ this.connection = connection;
82
+ this.visibilityDidChange = bind(this.visibilityDidChange, this);
83
+ this.reconnectAttempts = 0;
84
+ }
85
+
86
+ ConnectionMonitor.prototype.start = function() {
87
+ if (!this.isRunning()) {
88
+ this.startedAt = now();
89
+ delete this.stoppedAt;
90
+ this.startPolling();
91
+ document.addEventListener("visibilitychange", this.visibilityDidChange);
92
+ return ActionCable.log("ConnectionMonitor started. pollInterval = " + (this.getPollInterval()) + " ms");
93
+ }
94
+ };
95
+
96
+ ConnectionMonitor.prototype.stop = function() {
97
+ if (this.isRunning()) {
98
+ this.stoppedAt = now();
99
+ this.stopPolling();
100
+ document.removeEventListener("visibilitychange", this.visibilityDidChange);
101
+ return ActionCable.log("ConnectionMonitor stopped");
102
+ }
103
+ };
104
+
105
+ ConnectionMonitor.prototype.isRunning = function() {
106
+ return (this.startedAt != null) && (this.stoppedAt == null);
107
+ };
108
+
109
+ ConnectionMonitor.prototype.recordPing = function() {
110
+ return this.pingedAt = now();
111
+ };
112
+
113
+ ConnectionMonitor.prototype.recordConnect = function() {
114
+ this.reconnectAttempts = 0;
115
+ this.recordPing();
116
+ delete this.disconnectedAt;
117
+ return ActionCable.log("ConnectionMonitor recorded connect");
118
+ };
119
+
120
+ ConnectionMonitor.prototype.recordDisconnect = function() {
121
+ this.disconnectedAt = now();
122
+ return ActionCable.log("ConnectionMonitor recorded disconnect");
123
+ };
124
+
125
+ ConnectionMonitor.prototype.startPolling = function() {
126
+ this.stopPolling();
127
+ return this.poll();
128
+ };
129
+
130
+ ConnectionMonitor.prototype.stopPolling = function() {
131
+ return clearTimeout(this.pollTimeout);
132
+ };
133
+
134
+ ConnectionMonitor.prototype.poll = function() {
135
+ return this.pollTimeout = setTimeout((function(_this) {
136
+ return function() {
137
+ _this.reconnectIfStale();
138
+ return _this.poll();
139
+ };
140
+ })(this), this.getPollInterval());
141
+ };
142
+
143
+ ConnectionMonitor.prototype.getPollInterval = function() {
144
+ var interval, max, min, ref;
145
+ ref = this.constructor.pollInterval, min = ref.min, max = ref.max;
146
+ interval = 5 * Math.log(this.reconnectAttempts + 1);
147
+ return Math.round(clamp(interval, min, max) * 1000);
148
+ };
149
+
150
+ ConnectionMonitor.prototype.reconnectIfStale = function() {
151
+ if (this.connectionIsStale()) {
152
+ ActionCable.log("ConnectionMonitor detected stale connection. reconnectAttempts = " + this.reconnectAttempts + ", pollInterval = " + (this.getPollInterval()) + " ms, time disconnected = " + (secondsSince(this.disconnectedAt)) + " s, stale threshold = " + this.constructor.staleThreshold + " s");
153
+ this.reconnectAttempts++;
154
+ if (this.disconnectedRecently()) {
155
+ return ActionCable.log("ConnectionMonitor skipping reopening recent disconnect");
156
+ } else {
157
+ ActionCable.log("ConnectionMonitor reopening");
158
+ return this.connection.reopen();
159
+ }
160
+ }
161
+ };
162
+
163
+ ConnectionMonitor.prototype.connectionIsStale = function() {
164
+ var ref;
165
+ return secondsSince((ref = this.pingedAt) != null ? ref : this.startedAt) > this.constructor.staleThreshold;
166
+ };
167
+
168
+ ConnectionMonitor.prototype.disconnectedRecently = function() {
169
+ return this.disconnectedAt && secondsSince(this.disconnectedAt) < this.constructor.staleThreshold;
170
+ };
171
+
172
+ ConnectionMonitor.prototype.visibilityDidChange = function() {
173
+ if (document.visibilityState === "visible") {
174
+ return setTimeout((function(_this) {
175
+ return function() {
176
+ if (_this.connectionIsStale() || !_this.connection.isOpen()) {
177
+ ActionCable.log("ConnectionMonitor reopening stale connection on visibilitychange. visbilityState = " + document.visibilityState);
178
+ return _this.connection.reopen();
179
+ }
180
+ };
181
+ })(this), 200);
182
+ }
183
+ };
184
+
185
+ now = function() {
186
+ return new Date().getTime();
187
+ };
188
+
189
+ secondsSince = function(time) {
190
+ return (now() - time) / 1000;
191
+ };
192
+
193
+ clamp = function(number, min, max) {
194
+ return Math.max(min, Math.min(max, number));
195
+ };
196
+
197
+ return ConnectionMonitor;
198
+
199
+ })();
200
+
201
+ }).call(this);
202
+ (function() {
203
+ var i, message_types, protocols, ref, supportedProtocols, unsupportedProtocol,
204
+ slice = [].slice,
205
+ bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
206
+ indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
207
+
208
+ ref = ActionCable.INTERNAL, message_types = ref.message_types, protocols = ref.protocols;
209
+
210
+ supportedProtocols = 2 <= protocols.length ? slice.call(protocols, 0, i = protocols.length - 1) : (i = 0, []), unsupportedProtocol = protocols[i++];
211
+
212
+ ActionCable.Connection = (function() {
213
+ Connection.reopenDelay = 500;
214
+
215
+ function Connection(consumer) {
216
+ this.consumer = consumer;
217
+ this.open = bind(this.open, this);
218
+ this.subscriptions = this.consumer.subscriptions;
219
+ this.monitor = new ActionCable.ConnectionMonitor(this);
220
+ this.disconnected = true;
221
+ }
222
+
223
+ Connection.prototype.send = function(data) {
224
+ if (this.isOpen()) {
225
+ this.webSocket.send(JSON.stringify(data));
226
+ return true;
227
+ } else {
228
+ return false;
229
+ }
230
+ };
231
+
232
+ Connection.prototype.open = function() {
233
+ if (this.isActive()) {
234
+ ActionCable.log("Attempted to open WebSocket, but existing socket is " + (this.getState()));
235
+ return false;
236
+ } else {
237
+ ActionCable.log("Opening WebSocket, current state is " + (this.getState()) + ", subprotocols: " + protocols);
238
+ if (this.webSocket != null) {
239
+ this.uninstallEventHandlers();
240
+ }
241
+ this.webSocket = new ActionCable.WebSocket(this.consumer.url, protocols);
242
+ this.installEventHandlers();
243
+ this.monitor.start();
244
+ return true;
245
+ }
246
+ };
247
+
248
+ Connection.prototype.close = function(arg) {
249
+ var allowReconnect, ref1;
250
+ allowReconnect = (arg != null ? arg : {
251
+ allowReconnect: true
252
+ }).allowReconnect;
253
+ if (!allowReconnect) {
254
+ this.monitor.stop();
255
+ }
256
+ if (this.isActive()) {
257
+ return (ref1 = this.webSocket) != null ? ref1.close() : void 0;
258
+ }
259
+ };
260
+
261
+ Connection.prototype.reopen = function() {
262
+ var error;
263
+ ActionCable.log("Reopening WebSocket, current state is " + (this.getState()));
264
+ if (this.isActive()) {
265
+ try {
266
+ return this.close();
267
+ } catch (error1) {
268
+ error = error1;
269
+ return ActionCable.log("Failed to reopen WebSocket", error);
270
+ } finally {
271
+ ActionCable.log("Reopening WebSocket in " + this.constructor.reopenDelay + "ms");
272
+ setTimeout(this.open, this.constructor.reopenDelay);
273
+ }
274
+ } else {
275
+ return this.open();
276
+ }
277
+ };
278
+
279
+ Connection.prototype.getProtocol = function() {
280
+ var ref1;
281
+ return (ref1 = this.webSocket) != null ? ref1.protocol : void 0;
282
+ };
283
+
284
+ Connection.prototype.isOpen = function() {
285
+ return this.isState("open");
286
+ };
287
+
288
+ Connection.prototype.isActive = function() {
289
+ return this.isState("open", "connecting");
290
+ };
291
+
292
+ Connection.prototype.isProtocolSupported = function() {
293
+ var ref1;
294
+ return ref1 = this.getProtocol(), indexOf.call(supportedProtocols, ref1) >= 0;
295
+ };
296
+
297
+ Connection.prototype.isState = function() {
298
+ var ref1, states;
299
+ states = 1 <= arguments.length ? slice.call(arguments, 0) : [];
300
+ return ref1 = this.getState(), indexOf.call(states, ref1) >= 0;
301
+ };
302
+
303
+ Connection.prototype.getState = function() {
304
+ var ref1, state, value;
305
+ for (state in WebSocket) {
306
+ value = WebSocket[state];
307
+ if (value === ((ref1 = this.webSocket) != null ? ref1.readyState : void 0)) {
308
+ return state.toLowerCase();
309
+ }
310
+ }
311
+ return null;
312
+ };
313
+
314
+ Connection.prototype.installEventHandlers = function() {
315
+ var eventName, handler;
316
+ for (eventName in this.events) {
317
+ handler = this.events[eventName].bind(this);
318
+ this.webSocket["on" + eventName] = handler;
319
+ }
320
+ };
321
+
322
+ Connection.prototype.uninstallEventHandlers = function() {
323
+ var eventName;
324
+ for (eventName in this.events) {
325
+ this.webSocket["on" + eventName] = function() {};
326
+ }
327
+ };
328
+
329
+ Connection.prototype.events = {
330
+ message: function(event) {
331
+ var identifier, message, ref1, type;
332
+ if (!this.isProtocolSupported()) {
333
+ return;
334
+ }
335
+ ref1 = JSON.parse(event.data), identifier = ref1.identifier, message = ref1.message, type = ref1.type;
336
+ switch (type) {
337
+ case message_types.welcome:
338
+ this.monitor.recordConnect();
339
+ return this.subscriptions.reload();
340
+ case message_types.ping:
341
+ return this.monitor.recordPing();
342
+ case message_types.confirmation:
343
+ return this.subscriptions.notify(identifier, "connected");
344
+ case message_types.rejection:
345
+ return this.subscriptions.reject(identifier);
346
+ default:
347
+ return this.subscriptions.notify(identifier, "received", message);
348
+ }
349
+ },
350
+ open: function() {
351
+ ActionCable.log("WebSocket onopen event, using '" + (this.getProtocol()) + "' subprotocol");
352
+ this.disconnected = false;
353
+ if (!this.isProtocolSupported()) {
354
+ ActionCable.log("Protocol is unsupported. Stopping monitor and disconnecting.");
355
+ return this.close({
356
+ allowReconnect: false
357
+ });
358
+ }
359
+ },
360
+ close: function(event) {
361
+ ActionCable.log("WebSocket onclose event");
362
+ if (this.disconnected) {
363
+ return;
364
+ }
365
+ this.disconnected = true;
366
+ this.monitor.recordDisconnect();
367
+ return this.subscriptions.notifyAll("disconnected", {
368
+ willAttemptReconnect: this.monitor.isRunning()
369
+ });
370
+ },
371
+ error: function() {
372
+ return ActionCable.log("WebSocket onerror event");
373
+ }
374
+ };
375
+
376
+ return Connection;
377
+
378
+ })();
379
+
380
+ }).call(this);
381
+ (function() {
382
+ var slice = [].slice;
383
+
384
+ ActionCable.Subscriptions = (function() {
385
+ function Subscriptions(consumer) {
386
+ this.consumer = consumer;
387
+ this.subscriptions = [];
388
+ }
389
+
390
+ Subscriptions.prototype.create = function(channelName, mixin) {
391
+ var channel, params, subscription;
392
+ channel = channelName;
393
+ params = typeof channel === "object" ? channel : {
394
+ channel: channel
395
+ };
396
+ subscription = new ActionCable.Subscription(this.consumer, params, mixin);
397
+ return this.add(subscription);
398
+ };
399
+
400
+ Subscriptions.prototype.add = function(subscription) {
401
+ this.subscriptions.push(subscription);
402
+ this.consumer.ensureActiveConnection();
403
+ this.notify(subscription, "initialized");
404
+ this.sendCommand(subscription, "subscribe");
405
+ return subscription;
406
+ };
407
+
408
+ Subscriptions.prototype.remove = function(subscription) {
409
+ this.forget(subscription);
410
+ if (!this.findAll(subscription.identifier).length) {
411
+ this.sendCommand(subscription, "unsubscribe");
412
+ }
413
+ return subscription;
414
+ };
415
+
416
+ Subscriptions.prototype.reject = function(identifier) {
417
+ var i, len, ref, results, subscription;
418
+ ref = this.findAll(identifier);
419
+ results = [];
420
+ for (i = 0, len = ref.length; i < len; i++) {
421
+ subscription = ref[i];
422
+ this.forget(subscription);
423
+ this.notify(subscription, "rejected");
424
+ results.push(subscription);
425
+ }
426
+ return results;
427
+ };
428
+
429
+ Subscriptions.prototype.forget = function(subscription) {
430
+ var s;
431
+ this.subscriptions = (function() {
432
+ var i, len, ref, results;
433
+ ref = this.subscriptions;
434
+ results = [];
435
+ for (i = 0, len = ref.length; i < len; i++) {
436
+ s = ref[i];
437
+ if (s !== subscription) {
438
+ results.push(s);
439
+ }
440
+ }
441
+ return results;
442
+ }).call(this);
443
+ return subscription;
444
+ };
445
+
446
+ Subscriptions.prototype.findAll = function(identifier) {
447
+ var i, len, ref, results, s;
448
+ ref = this.subscriptions;
449
+ results = [];
450
+ for (i = 0, len = ref.length; i < len; i++) {
451
+ s = ref[i];
452
+ if (s.identifier === identifier) {
453
+ results.push(s);
454
+ }
455
+ }
456
+ return results;
457
+ };
458
+
459
+ Subscriptions.prototype.reload = function() {
460
+ var i, len, ref, results, subscription;
461
+ ref = this.subscriptions;
462
+ results = [];
463
+ for (i = 0, len = ref.length; i < len; i++) {
464
+ subscription = ref[i];
465
+ results.push(this.sendCommand(subscription, "subscribe"));
466
+ }
467
+ return results;
468
+ };
469
+
470
+ Subscriptions.prototype.notifyAll = function() {
471
+ var args, callbackName, i, len, ref, results, subscription;
472
+ callbackName = arguments[0], args = 2 <= arguments.length ? slice.call(arguments, 1) : [];
473
+ ref = this.subscriptions;
474
+ results = [];
475
+ for (i = 0, len = ref.length; i < len; i++) {
476
+ subscription = ref[i];
477
+ results.push(this.notify.apply(this, [subscription, callbackName].concat(slice.call(args))));
478
+ }
479
+ return results;
480
+ };
481
+
482
+ Subscriptions.prototype.notify = function() {
483
+ var args, callbackName, i, len, results, subscription, subscriptions;
484
+ subscription = arguments[0], callbackName = arguments[1], args = 3 <= arguments.length ? slice.call(arguments, 2) : [];
485
+ if (typeof subscription === "string") {
486
+ subscriptions = this.findAll(subscription);
487
+ } else {
488
+ subscriptions = [subscription];
489
+ }
490
+ results = [];
491
+ for (i = 0, len = subscriptions.length; i < len; i++) {
492
+ subscription = subscriptions[i];
493
+ results.push(typeof subscription[callbackName] === "function" ? subscription[callbackName].apply(subscription, args) : void 0);
494
+ }
495
+ return results;
496
+ };
497
+
498
+ Subscriptions.prototype.sendCommand = function(subscription, command) {
499
+ var identifier;
500
+ identifier = subscription.identifier;
501
+ return this.consumer.send({
502
+ command: command,
503
+ identifier: identifier
504
+ });
505
+ };
506
+
507
+ return Subscriptions;
508
+
509
+ })();
510
+
511
+ }).call(this);
512
+ (function() {
513
+ ActionCable.Subscription = (function() {
514
+ var extend;
515
+
516
+ function Subscription(consumer, params, mixin) {
517
+ this.consumer = consumer;
518
+ if (params == null) {
519
+ params = {};
520
+ }
521
+ this.identifier = JSON.stringify(params);
522
+ extend(this, mixin);
523
+ }
524
+
525
+ Subscription.prototype.perform = function(action, data) {
526
+ if (data == null) {
527
+ data = {};
528
+ }
529
+ data.action = action;
530
+ return this.send(data);
531
+ };
532
+
533
+ Subscription.prototype.send = function(data) {
534
+ return this.consumer.send({
535
+ command: "message",
536
+ identifier: this.identifier,
537
+ data: JSON.stringify(data)
538
+ });
539
+ };
540
+
541
+ Subscription.prototype.unsubscribe = function() {
542
+ return this.consumer.subscriptions.remove(this);
543
+ };
544
+
545
+ extend = function(object, properties) {
546
+ var key, value;
547
+ if (properties != null) {
548
+ for (key in properties) {
549
+ value = properties[key];
550
+ object[key] = value;
551
+ }
552
+ }
553
+ return object;
554
+ };
555
+
556
+ return Subscription;
557
+
558
+ })();
559
+
560
+ }).call(this);
561
+ (function() {
562
+ ActionCable.Consumer = (function() {
563
+ function Consumer(url) {
564
+ this.url = url;
565
+ this.subscriptions = new ActionCable.Subscriptions(this);
566
+ this.connection = new ActionCable.Connection(this);
567
+ }
568
+
569
+ Consumer.prototype.send = function(data) {
570
+ return this.connection.send(data);
571
+ };
572
+
573
+ Consumer.prototype.connect = function() {
574
+ return this.connection.open();
575
+ };
576
+
577
+ Consumer.prototype.disconnect = function() {
578
+ return this.connection.close({
579
+ allowReconnect: false
580
+ });
581
+ };
582
+
583
+ Consumer.prototype.ensureActiveConnection = function() {
584
+ if (!this.connection.isActive()) {
585
+ return this.connection.open();
586
+ }
587
+ };
588
+
589
+ return Consumer;
590
+
591
+ })();
592
+
593
+ }).call(this);
594
+ }).call(this);
595
+
596
+ if (typeof module === "object" && module.exports) {
597
+ module.exports = ActionCable;
598
+ } else if (typeof define === "function" && define.amd) {
599
+ define(ActionCable);
600
+ }
601
+ }).call(this);
@@ -0,0 +1,24 @@
1
+ {
2
+ "name": "actioncable",
3
+ "version": "5.2.1",
4
+ "description": "WebSocket framework for Ruby on Rails.",
5
+ "main": "lib/assets/compiled/action_cable.js",
6
+ "files": [
7
+ "lib/assets/compiled/*.js"
8
+ ],
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "rails/rails"
12
+ },
13
+ "keywords": [
14
+ "websockets",
15
+ "actioncable",
16
+ "rails"
17
+ ],
18
+ "author": "David Heinemeier Hansson <david@loudthinking.com>",
19
+ "license": "MIT",
20
+ "bugs": {
21
+ "url": "https://github.com/rails/rails/issues"
22
+ },
23
+ "homepage": "http://rubyonrails.org/"
24
+ }
@@ -0,0 +1 @@
1
+ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.ActiveStorage=e():t.ActiveStorage=e()}(this,function(){return function(t){function e(n){if(r[n])return r[n].exports;var i=r[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var r={};return e.m=t,e.c=r,e.d=function(t,r,n){e.o(t,r)||Object.defineProperty(t,r,{configurable:!1,enumerable:!0,get:n})},e.n=function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(r,"a",r),r},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=2)}([function(t,e,r){"use strict";function n(t){var e=a(document.head,'meta[name="'+t+'"]');if(e)return e.getAttribute("content")}function i(t,e){return"string"==typeof t&&(e=t,t=document),o(t.querySelectorAll(e))}function a(t,e){return"string"==typeof t&&(e=t,t=document),t.querySelector(e)}function u(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=t.disabled,i=r.bubbles,a=r.cancelable,u=r.detail,o=document.createEvent("Event");o.initEvent(e,i||!0,a||!0),o.detail=u||{};try{t.disabled=!1,t.dispatchEvent(o)}finally{t.disabled=n}return o}function o(t){return Array.isArray(t)?t:Array.from?Array.from(t):[].slice.call(t)}e.d=n,e.c=i,e.b=a,e.a=u,e.e=o},function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(t&&"function"==typeof t[e]){for(var r=arguments.length,n=Array(r>2?r-2:0),i=2;i<r;i++)n[i-2]=arguments[i];return t[e].apply(t,n)}}r.d(e,"a",function(){return c});var a=r(6),u=r(8),o=r(9),s=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),f=0,c=function(){function t(e,r,i){n(this,t),this.id=++f,this.file=e,this.url=r,this.delegate=i}return s(t,[{key:"create",value:function(t){var e=this;a.a.create(this.file,function(r,n){if(r)return void t(r);var a=new u.a(e.file,n,e.url);i(e.delegate,"directUploadWillCreateBlobWithXHR",a.xhr),a.create(function(r){if(r)t(r);else{var n=new o.a(a);i(e.delegate,"directUploadWillStoreFileWithXHR",n.xhr),n.create(function(e){e?t(e):t(null,a.toJSON())})}})})}}]),t}()},function(t,e,r){"use strict";function n(){window.ActiveStorage&&Object(i.a)()}Object.defineProperty(e,"__esModule",{value:!0});var i=r(3),a=r(1);r.d(e,"start",function(){return i.a}),r.d(e,"DirectUpload",function(){return a.a}),setTimeout(n,1)},function(t,e,r){"use strict";function n(){d||(d=!0,document.addEventListener("submit",i),document.addEventListener("ajax:before",a))}function i(t){u(t)}function a(t){"FORM"==t.target.tagName&&u(t)}function u(t){var e=t.target;if(e.hasAttribute(l))return void t.preventDefault();var r=new c.a(e),n=r.inputs;n.length&&(t.preventDefault(),e.setAttribute(l,""),n.forEach(s),r.start(function(t){e.removeAttribute(l),t?n.forEach(f):o(e)}))}function o(t){var e=Object(h.b)(t,"input[type=submit]");if(e){var r=e,n=r.disabled;e.disabled=!1,e.focus(),e.click(),e.disabled=n}else e=document.createElement("input"),e.type="submit",e.style.display="none",t.appendChild(e),e.click(),t.removeChild(e)}function s(t){t.disabled=!0}function f(t){t.disabled=!1}e.a=n;var c=r(4),h=r(0),l="data-direct-uploads-processing",d=!1},function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}r.d(e,"a",function(){return s});var i=r(5),a=r(0),u=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),o="input[type=file][data-direct-upload-url]:not([disabled])",s=function(){function t(e){n(this,t),this.form=e,this.inputs=Object(a.c)(e,o).filter(function(t){return t.files.length})}return u(t,[{key:"start",value:function(t){var e=this,r=this.createDirectUploadControllers();this.dispatch("start"),function n(){var i=r.shift();i?i.start(function(r){r?(t(r),e.dispatch("end")):n()}):(t(),e.dispatch("end"))}()}},{key:"createDirectUploadControllers",value:function(){var t=[];return this.inputs.forEach(function(e){Object(a.e)(e.files).forEach(function(r){var n=new i.a(e,r);t.push(n)})}),t}},{key:"dispatch",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(a.a)(this.form,"direct-uploads:"+t,{detail:e})}}]),t}()},function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}r.d(e,"a",function(){return o});var i=r(1),a=r(0),u=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),o=function(){function t(e,r){n(this,t),this.input=e,this.file=r,this.directUpload=new i.a(this.file,this.url,this),this.dispatch("initialize")}return u(t,[{key:"start",value:function(t){var e=this,r=document.createElement("input");r.type="hidden",r.name=this.input.name,this.input.insertAdjacentElement("beforebegin",r),this.dispatch("start"),this.directUpload.create(function(n,i){n?(r.parentNode.removeChild(r),e.dispatchError(n)):r.value=i.signed_id,e.dispatch("end"),t(n)})}},{key:"uploadRequestDidProgress",value:function(t){var e=t.loaded/t.total*100;e&&this.dispatch("progress",{progress:e})}},{key:"dispatch",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.file=this.file,e.id=this.directUpload.id,Object(a.a)(this.input,"direct-upload:"+t,{detail:e})}},{key:"dispatchError",value:function(t){this.dispatch("error",{error:t}).defaultPrevented||alert(t)}},{key:"directUploadWillCreateBlobWithXHR",value:function(t){this.dispatch("before-blob-request",{xhr:t})}},{key:"directUploadWillStoreFileWithXHR",value:function(t){var e=this;this.dispatch("before-storage-request",{xhr:t}),t.upload.addEventListener("progress",function(t){return e.uploadRequestDidProgress(t)})}},{key:"url",get:function(){return this.input.getAttribute("data-direct-upload-url")}}]),t}()},function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}r.d(e,"a",function(){return s});var i=r(7),a=r.n(i),u=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),o=File.prototype.slice||File.prototype.mozSlice||File.prototype.webkitSlice,s=function(){function t(e){n(this,t),this.file=e,this.chunkSize=2097152,this.chunkCount=Math.ceil(this.file.size/this.chunkSize),this.chunkIndex=0}return u(t,null,[{key:"create",value:function(e,r){new t(e).create(r)}}]),u(t,[{key:"create",value:function(t){var e=this;this.callback=t,this.md5Buffer=new a.a.ArrayBuffer,this.fileReader=new FileReader,this.fileReader.addEventListener("load",function(t){return e.fileReaderDidLoad(t)}),this.fileReader.addEventListener("error",function(t){return e.fileReaderDidError(t)}),this.readNextChunk()}},{key:"fileReaderDidLoad",value:function(t){if(this.md5Buffer.append(t.target.result),!this.readNextChunk()){var e=this.md5Buffer.end(!0),r=btoa(e);this.callback(null,r)}}},{key:"fileReaderDidError",value:function(t){this.callback("Error reading "+this.file.name)}},{key:"readNextChunk",value:function(){if(this.chunkIndex<this.chunkCount||0==this.chunkIndex&&0==this.chunkCount){var t=this.chunkIndex*this.chunkSize,e=Math.min(t+this.chunkSize,this.file.size),r=o.call(this.file,t,e);return this.fileReader.readAsArrayBuffer(r),this.chunkIndex++,!0}return!1}}]),t}()},function(t,e,r){!function(e){t.exports=e()}(function(t){"use strict";function e(t,e){var r=t[0],n=t[1],i=t[2],a=t[3];r+=(n&i|~n&a)+e[0]-680876936|0,r=(r<<7|r>>>25)+n|0,a+=(r&n|~r&i)+e[1]-389564586|0,a=(a<<12|a>>>20)+r|0,i+=(a&r|~a&n)+e[2]+606105819|0,i=(i<<17|i>>>15)+a|0,n+=(i&a|~i&r)+e[3]-1044525330|0,n=(n<<22|n>>>10)+i|0,r+=(n&i|~n&a)+e[4]-176418897|0,r=(r<<7|r>>>25)+n|0,a+=(r&n|~r&i)+e[5]+1200080426|0,a=(a<<12|a>>>20)+r|0,i+=(a&r|~a&n)+e[6]-1473231341|0,i=(i<<17|i>>>15)+a|0,n+=(i&a|~i&r)+e[7]-45705983|0,n=(n<<22|n>>>10)+i|0,r+=(n&i|~n&a)+e[8]+1770035416|0,r=(r<<7|r>>>25)+n|0,a+=(r&n|~r&i)+e[9]-1958414417|0,a=(a<<12|a>>>20)+r|0,i+=(a&r|~a&n)+e[10]-42063|0,i=(i<<17|i>>>15)+a|0,n+=(i&a|~i&r)+e[11]-1990404162|0,n=(n<<22|n>>>10)+i|0,r+=(n&i|~n&a)+e[12]+1804603682|0,r=(r<<7|r>>>25)+n|0,a+=(r&n|~r&i)+e[13]-40341101|0,a=(a<<12|a>>>20)+r|0,i+=(a&r|~a&n)+e[14]-1502002290|0,i=(i<<17|i>>>15)+a|0,n+=(i&a|~i&r)+e[15]+1236535329|0,n=(n<<22|n>>>10)+i|0,r+=(n&a|i&~a)+e[1]-165796510|0,r=(r<<5|r>>>27)+n|0,a+=(r&i|n&~i)+e[6]-1069501632|0,a=(a<<9|a>>>23)+r|0,i+=(a&n|r&~n)+e[11]+643717713|0,i=(i<<14|i>>>18)+a|0,n+=(i&r|a&~r)+e[0]-373897302|0,n=(n<<20|n>>>12)+i|0,r+=(n&a|i&~a)+e[5]-701558691|0,r=(r<<5|r>>>27)+n|0,a+=(r&i|n&~i)+e[10]+38016083|0,a=(a<<9|a>>>23)+r|0,i+=(a&n|r&~n)+e[15]-660478335|0,i=(i<<14|i>>>18)+a|0,n+=(i&r|a&~r)+e[4]-405537848|0,n=(n<<20|n>>>12)+i|0,r+=(n&a|i&~a)+e[9]+568446438|0,r=(r<<5|r>>>27)+n|0,a+=(r&i|n&~i)+e[14]-1019803690|0,a=(a<<9|a>>>23)+r|0,i+=(a&n|r&~n)+e[3]-187363961|0,i=(i<<14|i>>>18)+a|0,n+=(i&r|a&~r)+e[8]+1163531501|0,n=(n<<20|n>>>12)+i|0,r+=(n&a|i&~a)+e[13]-1444681467|0,r=(r<<5|r>>>27)+n|0,a+=(r&i|n&~i)+e[2]-51403784|0,a=(a<<9|a>>>23)+r|0,i+=(a&n|r&~n)+e[7]+1735328473|0,i=(i<<14|i>>>18)+a|0,n+=(i&r|a&~r)+e[12]-1926607734|0,n=(n<<20|n>>>12)+i|0,r+=(n^i^a)+e[5]-378558|0,r=(r<<4|r>>>28)+n|0,a+=(r^n^i)+e[8]-2022574463|0,a=(a<<11|a>>>21)+r|0,i+=(a^r^n)+e[11]+1839030562|0,i=(i<<16|i>>>16)+a|0,n+=(i^a^r)+e[14]-35309556|0,n=(n<<23|n>>>9)+i|0,r+=(n^i^a)+e[1]-1530992060|0,r=(r<<4|r>>>28)+n|0,a+=(r^n^i)+e[4]+1272893353|0,a=(a<<11|a>>>21)+r|0,i+=(a^r^n)+e[7]-155497632|0,i=(i<<16|i>>>16)+a|0,n+=(i^a^r)+e[10]-1094730640|0,n=(n<<23|n>>>9)+i|0,r+=(n^i^a)+e[13]+681279174|0,r=(r<<4|r>>>28)+n|0,a+=(r^n^i)+e[0]-358537222|0,a=(a<<11|a>>>21)+r|0,i+=(a^r^n)+e[3]-722521979|0,i=(i<<16|i>>>16)+a|0,n+=(i^a^r)+e[6]+76029189|0,n=(n<<23|n>>>9)+i|0,r+=(n^i^a)+e[9]-640364487|0,r=(r<<4|r>>>28)+n|0,a+=(r^n^i)+e[12]-421815835|0,a=(a<<11|a>>>21)+r|0,i+=(a^r^n)+e[15]+530742520|0,i=(i<<16|i>>>16)+a|0,n+=(i^a^r)+e[2]-995338651|0,n=(n<<23|n>>>9)+i|0,r+=(i^(n|~a))+e[0]-198630844|0,r=(r<<6|r>>>26)+n|0,a+=(n^(r|~i))+e[7]+1126891415|0,a=(a<<10|a>>>22)+r|0,i+=(r^(a|~n))+e[14]-1416354905|0,i=(i<<15|i>>>17)+a|0,n+=(a^(i|~r))+e[5]-57434055|0,n=(n<<21|n>>>11)+i|0,r+=(i^(n|~a))+e[12]+1700485571|0,r=(r<<6|r>>>26)+n|0,a+=(n^(r|~i))+e[3]-1894986606|0,a=(a<<10|a>>>22)+r|0,i+=(r^(a|~n))+e[10]-1051523|0,i=(i<<15|i>>>17)+a|0,n+=(a^(i|~r))+e[1]-2054922799|0,n=(n<<21|n>>>11)+i|0,r+=(i^(n|~a))+e[8]+1873313359|0,r=(r<<6|r>>>26)+n|0,a+=(n^(r|~i))+e[15]-30611744|0,a=(a<<10|a>>>22)+r|0,i+=(r^(a|~n))+e[6]-1560198380|0,i=(i<<15|i>>>17)+a|0,n+=(a^(i|~r))+e[13]+1309151649|0,n=(n<<21|n>>>11)+i|0,r+=(i^(n|~a))+e[4]-145523070|0,r=(r<<6|r>>>26)+n|0,a+=(n^(r|~i))+e[11]-1120210379|0,a=(a<<10|a>>>22)+r|0,i+=(r^(a|~n))+e[2]+718787259|0,i=(i<<15|i>>>17)+a|0,n+=(a^(i|~r))+e[9]-343485551|0,n=(n<<21|n>>>11)+i|0,t[0]=r+t[0]|0,t[1]=n+t[1]|0,t[2]=i+t[2]|0,t[3]=a+t[3]|0}function r(t){var e,r=[];for(e=0;e<64;e+=4)r[e>>2]=t.charCodeAt(e)+(t.charCodeAt(e+1)<<8)+(t.charCodeAt(e+2)<<16)+(t.charCodeAt(e+3)<<24);return r}function n(t){var e,r=[];for(e=0;e<64;e+=4)r[e>>2]=t[e]+(t[e+1]<<8)+(t[e+2]<<16)+(t[e+3]<<24);return r}function i(t){var n,i,a,u,o,s,f=t.length,c=[1732584193,-271733879,-1732584194,271733878];for(n=64;n<=f;n+=64)e(c,r(t.substring(n-64,n)));for(t=t.substring(n-64),i=t.length,a=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],n=0;n<i;n+=1)a[n>>2]|=t.charCodeAt(n)<<(n%4<<3);if(a[n>>2]|=128<<(n%4<<3),n>55)for(e(c,a),n=0;n<16;n+=1)a[n]=0;return u=8*f,u=u.toString(16).match(/(.*?)(.{0,8})$/),o=parseInt(u[2],16),s=parseInt(u[1],16)||0,a[14]=o,a[15]=s,e(c,a),c}function a(t){var r,i,a,u,o,s,f=t.length,c=[1732584193,-271733879,-1732584194,271733878];for(r=64;r<=f;r+=64)e(c,n(t.subarray(r-64,r)));for(t=r-64<f?t.subarray(r-64):new Uint8Array(0),i=t.length,a=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],r=0;r<i;r+=1)a[r>>2]|=t[r]<<(r%4<<3);if(a[r>>2]|=128<<(r%4<<3),r>55)for(e(c,a),r=0;r<16;r+=1)a[r]=0;return u=8*f,u=u.toString(16).match(/(.*?)(.{0,8})$/),o=parseInt(u[2],16),s=parseInt(u[1],16)||0,a[14]=o,a[15]=s,e(c,a),c}function u(t){var e,r="";for(e=0;e<4;e+=1)r+=p[t>>8*e+4&15]+p[t>>8*e&15];return r}function o(t){var e;for(e=0;e<t.length;e+=1)t[e]=u(t[e]);return t.join("")}function s(t){return/[\u0080-\uFFFF]/.test(t)&&(t=unescape(encodeURIComponent(t))),t}function f(t,e){var r,n=t.length,i=new ArrayBuffer(n),a=new Uint8Array(i);for(r=0;r<n;r+=1)a[r]=t.charCodeAt(r);return e?a:i}function c(t){return String.fromCharCode.apply(null,new Uint8Array(t))}function h(t,e,r){var n=new Uint8Array(t.byteLength+e.byteLength);return n.set(new Uint8Array(t)),n.set(new Uint8Array(e),t.byteLength),r?n:n.buffer}function l(t){var e,r=[],n=t.length;for(e=0;e<n-1;e+=2)r.push(parseInt(t.substr(e,2),16));return String.fromCharCode.apply(String,r)}function d(){this.reset()}var p=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];return"5d41402abc4b2a76b9719d911017c592"!==o(i("hello"))&&function(t,e){var r=(65535&t)+(65535&e);return(t>>16)+(e>>16)+(r>>16)<<16|65535&r},"undefined"==typeof ArrayBuffer||ArrayBuffer.prototype.slice||function(){function e(t,e){return t=0|t||0,t<0?Math.max(t+e,0):Math.min(t,e)}ArrayBuffer.prototype.slice=function(r,n){var i,a,u,o,s=this.byteLength,f=e(r,s),c=s;return n!==t&&(c=e(n,s)),f>c?new ArrayBuffer(0):(i=c-f,a=new ArrayBuffer(i),u=new Uint8Array(a),o=new Uint8Array(this,f,i),u.set(o),a)}}(),d.prototype.append=function(t){return this.appendBinary(s(t)),this},d.prototype.appendBinary=function(t){this._buff+=t,this._length+=t.length;var n,i=this._buff.length;for(n=64;n<=i;n+=64)e(this._hash,r(this._buff.substring(n-64,n)));return this._buff=this._buff.substring(n-64),this},d.prototype.end=function(t){var e,r,n=this._buff,i=n.length,a=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(e=0;e<i;e+=1)a[e>>2]|=n.charCodeAt(e)<<(e%4<<3);return this._finish(a,i),r=o(this._hash),t&&(r=l(r)),this.reset(),r},d.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},d.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash}},d.prototype.setState=function(t){return this._buff=t.buff,this._length=t.length,this._hash=t.hash,this},d.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},d.prototype._finish=function(t,r){var n,i,a,u=r;if(t[u>>2]|=128<<(u%4<<3),u>55)for(e(this._hash,t),u=0;u<16;u+=1)t[u]=0;n=8*this._length,n=n.toString(16).match(/(.*?)(.{0,8})$/),i=parseInt(n[2],16),a=parseInt(n[1],16)||0,t[14]=i,t[15]=a,e(this._hash,t)},d.hash=function(t,e){return d.hashBinary(s(t),e)},d.hashBinary=function(t,e){var r=i(t),n=o(r);return e?l(n):n},d.ArrayBuffer=function(){this.reset()},d.ArrayBuffer.prototype.append=function(t){var r,i=h(this._buff.buffer,t,!0),a=i.length;for(this._length+=t.byteLength,r=64;r<=a;r+=64)e(this._hash,n(i.subarray(r-64,r)));return this._buff=r-64<a?new Uint8Array(i.buffer.slice(r-64)):new Uint8Array(0),this},d.ArrayBuffer.prototype.end=function(t){var e,r,n=this._buff,i=n.length,a=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(e=0;e<i;e+=1)a[e>>2]|=n[e]<<(e%4<<3);return this._finish(a,i),r=o(this._hash),t&&(r=l(r)),this.reset(),r},d.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},d.ArrayBuffer.prototype.getState=function(){var t=d.prototype.getState.call(this);return t.buff=c(t.buff),t},d.ArrayBuffer.prototype.setState=function(t){return t.buff=f(t.buff,!0),d.prototype.setState.call(this,t)},d.ArrayBuffer.prototype.destroy=d.prototype.destroy,d.ArrayBuffer.prototype._finish=d.prototype._finish,d.ArrayBuffer.hash=function(t,e){var r=a(new Uint8Array(t)),n=o(r);return e?l(n):n},d})},function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}r.d(e,"a",function(){return u});var i=r(0),a=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),u=function(){function t(e,r,a){var u=this;n(this,t),this.file=e,this.attributes={filename:e.name,content_type:e.type,byte_size:e.size,checksum:r},this.xhr=new XMLHttpRequest,this.xhr.open("POST",a,!0),this.xhr.responseType="json",this.xhr.setRequestHeader("Content-Type","application/json"),this.xhr.setRequestHeader("Accept","application/json"),this.xhr.setRequestHeader("X-Requested-With","XMLHttpRequest"),this.xhr.setRequestHeader("X-CSRF-Token",Object(i.d)("csrf-token")),this.xhr.addEventListener("load",function(t){return u.requestDidLoad(t)}),this.xhr.addEventListener("error",function(t){return u.requestDidError(t)})}return a(t,[{key:"create",value:function(t){this.callback=t,this.xhr.send(JSON.stringify({blob:this.attributes}))}},{key:"requestDidLoad",value:function(t){if(this.status>=200&&this.status<300){var e=this.response,r=e.direct_upload;delete e.direct_upload,this.attributes=e,this.directUploadData=r,this.callback(null,this.toJSON())}else this.requestDidError(t)}},{key:"requestDidError",value:function(t){this.callback('Error creating Blob for "'+this.file.name+'". Status: '+this.status)}},{key:"toJSON",value:function(){var t={};for(var e in this.attributes)t[e]=this.attributes[e];return t}},{key:"status",get:function(){return this.xhr.status}},{key:"response",get:function(){var t=this.xhr,e=t.responseType,r=t.response;return"json"==e?r:JSON.parse(r)}}]),t}()},function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}r.d(e,"a",function(){return a});var i=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),a=function(){function t(e){var r=this;n(this,t),this.blob=e,this.file=e.file;var i=e.directUploadData,a=i.url,u=i.headers;this.xhr=new XMLHttpRequest,this.xhr.open("PUT",a,!0),this.xhr.responseType="text";for(var o in u)this.xhr.setRequestHeader(o,u[o]);this.xhr.addEventListener("load",function(t){return r.requestDidLoad(t)}),this.xhr.addEventListener("error",function(t){return r.requestDidError(t)})}return i(t,[{key:"create",value:function(t){this.callback=t,this.xhr.send(this.file.slice())}},{key:"requestDidLoad",value:function(t){var e=this.xhr,r=e.status,n=e.response;r>=200&&r<300?this.callback(null,n):this.requestDidError(t)}},{key:"requestDidError",value:function(t){this.callback('Error storing "'+this.file.name+'". Status: '+this.xhr.status)}}]),t}()}])});
@@ -0,0 +1,37 @@
1
+ {
2
+ "name": "activestorage",
3
+ "version": "5.2.1",
4
+ "description": "Attach cloud and local files in Rails applications",
5
+ "main": "app/assets/javascripts/activestorage.js",
6
+ "files": [
7
+ "app/assets/javascripts/*.js",
8
+ "src/*.js"
9
+ ],
10
+ "homepage": "http://rubyonrails.org/",
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "git+https://github.com/rails/rails.git"
14
+ },
15
+ "bugs": {
16
+ "url": "https://github.com/rails/rails/issues"
17
+ },
18
+ "author": "Javan Makhmali <javan@javan.us>",
19
+ "license": "MIT",
20
+ "dependencies": {
21
+ "spark-md5": "^3.0.0"
22
+ },
23
+ "devDependencies": {
24
+ "babel-core": "^6.25.0",
25
+ "babel-loader": "^7.1.1",
26
+ "babel-preset-env": "^1.6.0",
27
+ "eslint": "^4.3.0",
28
+ "eslint-plugin-import": "^2.7.0",
29
+ "webpack": "^3.4.0"
30
+ },
31
+ "scripts": {
32
+ "prebuild": "yarn lint",
33
+ "build": "webpack -p",
34
+ "lint": "eslint app/javascript",
35
+ "prepublishOnly": "rm -rf src && cp -R app/javascript/activestorage src"
36
+ }
37
+ }
@@ -20,7 +20,7 @@
20
20
  "url": "https://github.com/rails/jquery-ujs/issues"
21
21
  },
22
22
  "homepage": "https://github.com/rails/jquery-ujs#readme",
23
- "peerDependencies": {
23
+ "dependencies": {
24
24
  "jquery": ">=1.8.0"
25
25
  }
26
26
  }
@@ -1,4 +1,4 @@
1
- /* jshint node: true */
1
+ (function($, undefined) {
2
2
 
3
3
  /**
4
4
  * Unobtrusive scripting adapter for jQuery
@@ -10,13 +10,10 @@
10
10
  *
11
11
  */
12
12
 
13
- (function() {
14
- 'use strict';
15
-
16
- var jqueryUjsInit = function($, undefined) {
17
-
18
13
  // Cut down on the number of issues from people inadvertently including jquery_ujs twice
19
14
  // by detecting and raising an error when it happens.
15
+ 'use strict';
16
+
20
17
  if ( $.rails !== undefined ) {
21
18
  $.error('jquery-ujs has already been loaded!');
22
19
  }
@@ -555,11 +552,4 @@
555
552
  });
556
553
  }
557
554
 
558
- };
559
-
560
- if (window.jQuery) {
561
- jqueryUjsInit(jQuery);
562
- } else if (typeof exports === 'object' && typeof module === 'object') {
563
- module.exports = jqueryUjsInit;
564
- }
565
- })();
555
+ })( jQuery );
data/yarn.lock CHANGED
@@ -2,6 +2,18 @@
2
2
  # yarn lockfile v1
3
3
 
4
4
 
5
+ actioncable@^5.2.1:
6
+ version "5.2.1"
7
+ resolved "https://registry.yarnpkg.com/actioncable/-/actioncable-5.2.1.tgz#615428a8a302cec55117d9049f0fd7952011c962"
8
+ integrity sha512-z/YnsgKYUC0E28Pr8YGaq8sZXNQLTZNa8PAJGmqj5qODiGHTyaCVy/DkP1+xpJtAX/UaHSGHobIemoDY/x5SbQ==
9
+
10
+ activestorage@^5.2.1:
11
+ version "5.2.1"
12
+ resolved "https://registry.yarnpkg.com/activestorage/-/activestorage-5.2.1.tgz#b4be57fbedc25c6c361802707fc5e8884766f6a1"
13
+ integrity sha512-n3LcwiC3EV5zkVAvay5yprXTBb8vzT2Qef1GCfC8feJTVWEadzNW9zYaOweDpshqzJHx+zdaps6uiHDJQbdCdA==
14
+ dependencies:
15
+ spark-md5 "^3.0.0"
16
+
5
17
  bootstrap-sass@^3.3.7:
6
18
  version "3.3.7"
7
19
  resolved "https://registry.yarnpkg.com/bootstrap-sass/-/bootstrap-sass-3.3.7.tgz#6596c7ab40f6637393323ab0bc80d064fc630498"
@@ -94,17 +106,19 @@ jquery-ui@^1.12.1:
94
106
  jquery-ujs@rails/jquery-ujs:
95
107
  version "1.2.2"
96
108
  resolved "https://codeload.github.com/rails/jquery-ujs/tar.gz/9e805c90c8cfc57b39967052e1e9013ccb318cf8"
109
+ dependencies:
110
+ jquery ">=1.8.0"
111
+
112
+ jquery@>=1.8.0, jquery@^3.0:
113
+ version "3.3.1"
114
+ resolved "https://registry.yarnpkg.com/jquery/-/jquery-3.3.1.tgz#958ce29e81c9790f31be7792df5d4d95fc57fbca"
115
+ integrity sha512-Ubldcmxp5np52/ENotGxlLe6aGMvmF4R8S6tZjsP6Knsaxd/xp3Zrh50cG93lR6nPXyUFwzN3ZSOQI0wRJNdGg==
97
116
 
98
117
  "jquery@^1.8.3 || ^2.0 || ^3.0", jquery@^3.2.1:
99
118
  version "3.2.1"
100
119
  resolved "https://registry.yarnpkg.com/jquery/-/jquery-3.2.1.tgz#5c4d9de652af6cd0a770154a631bba12b015c787"
101
120
  integrity sha1-XE2d5lKvbNCncBVKYxu6ErAVx4c=
102
121
 
103
- jquery@^3.0:
104
- version "3.3.1"
105
- resolved "https://registry.yarnpkg.com/jquery/-/jquery-3.3.1.tgz#958ce29e81c9790f31be7792df5d4d95fc57fbca"
106
- integrity sha512-Ubldcmxp5np52/ENotGxlLe6aGMvmF4R8S6tZjsP6Knsaxd/xp3Zrh50cG93lR6nPXyUFwzN3ZSOQI0wRJNdGg==
107
-
108
122
  js-cookie@^2.2.0:
109
123
  version "2.2.0"
110
124
  resolved "https://registry.yarnpkg.com/js-cookie/-/js-cookie-2.2.0.tgz#1b2c279a6eece380a12168b92485265b35b1effb"
@@ -180,6 +194,11 @@ signature_pad@^2.3.2:
180
194
  resolved "https://registry.yarnpkg.com/signature_pad/-/signature_pad-2.3.2.tgz#ca7230021c89cedeead27b33d8d16ff254e5f04a"
181
195
  integrity sha512-peYXLxOsIY6MES2TrRLDiNg2T++8gGbpP2yaC+6Ohtxr+a2dzoaqWosWDY9sWqTAAk6E/TyQO+LJw9zQwyu5kA==
182
196
 
197
+ spark-md5@^3.0.0:
198
+ version "3.0.0"
199
+ resolved "https://registry.yarnpkg.com/spark-md5/-/spark-md5-3.0.0.tgz#3722227c54e2faf24b1dc6d933cc144e6f71bfef"
200
+ integrity sha1-NyIifFTi+vJLHcbZM8wUTm9xv+8=
201
+
183
202
  tempusdominus-bootstrap-4@^5.1.2:
184
203
  version "5.1.2"
185
204
  resolved "https://registry.yarnpkg.com/tempusdominus-bootstrap-4/-/tempusdominus-bootstrap-4-5.1.2.tgz#3c9906ca6e5d563faa0b81b2fdc6aa79cad9c0be"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ext_yarn
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Patrice Lebel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-10-21 00:00:00.000000000 Z
11
+ date: 2018-10-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sprockets-rails
@@ -79,6 +79,10 @@ files:
79
79
  - lib/ext_yarn/version.rb
80
80
  - package.json
81
81
  - vendor/.yarn-integrity
82
+ - vendor/actioncable/lib/assets/compiled/action_cable.js
83
+ - vendor/actioncable/package.json
84
+ - vendor/activestorage/app/assets/javascripts/activestorage.js
85
+ - vendor/activestorage/package.json
82
86
  - vendor/bootstrap-sass/LICENSE
83
87
  - vendor/bootstrap-sass/assets/javascripts/bootstrap-sprockets.js
84
88
  - vendor/bootstrap-sass/assets/javascripts/bootstrap.js