active_frontend 14.0.80 → 14.0.81
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 89561af6ed088ed080187332c73c80be8cb12c91
|
4
|
+
data.tar.gz: 73ae8b120387fee13410c469a07279a41cbbcfff
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a8450019cbeb9a6033074ad449e989e8c0269942b4e58a00167392a84f6a63edda440e04563bef3f03b9eecf90b72752761e25f0c60218d9141444f691ddd3d2
|
7
|
+
data.tar.gz: 629cb40ede38167b660b2db308205c98ed7215d0a8d6667bb206576750cf252aca7567604bb8094a18da97f231cdc6f9cfaa35c699fd5a394f9ebc2de367dcf0
|
@@ -0,0 +1,694 @@
|
|
1
|
+
(function (f) {
|
2
|
+
if (typeof exports === 'object' &&typeof module !== 'undefined') {
|
3
|
+
module.exports = f();
|
4
|
+
} else if (typeof define === 'function' && define.amd) {
|
5
|
+
define([], f);
|
6
|
+
} else {
|
7
|
+
var g;
|
8
|
+
|
9
|
+
if (typeof window !== 'undefined') {
|
10
|
+
g = window;
|
11
|
+
} else if (typeof global !== 'undefined') {
|
12
|
+
g = global;
|
13
|
+
} else if (typeof self !== 'undefined') {
|
14
|
+
g = self;
|
15
|
+
} else {
|
16
|
+
g = this;
|
17
|
+
}
|
18
|
+
|
19
|
+
g.Clipboard = f();
|
20
|
+
}
|
21
|
+
})
|
22
|
+
|
23
|
+
(function() {
|
24
|
+
var define, module, exports;
|
25
|
+
|
26
|
+
return (function e(t, n, r) {
|
27
|
+
function s(o, u) {
|
28
|
+
if(!n[o]) {
|
29
|
+
if(!t[o]) {
|
30
|
+
var a = typeof require == 'function' && require;
|
31
|
+
|
32
|
+
if(!u && a) return a(o,!0);
|
33
|
+
if(i) return i(o,!0);
|
34
|
+
|
35
|
+
var f = new Error("Cannot find module '" + o + "'");
|
36
|
+
|
37
|
+
throw f.code = "MODULE_NOT_FOUND", f
|
38
|
+
}
|
39
|
+
|
40
|
+
var l = n[o] = {
|
41
|
+
exports:{}
|
42
|
+
};
|
43
|
+
|
44
|
+
t[o][0].call(l.exports, function(e) {
|
45
|
+
var n=t[o][1][e];
|
46
|
+
return s(n ? n:e);
|
47
|
+
}, l, l.exports, e, t, n, r)}
|
48
|
+
|
49
|
+
return n[o].exports;
|
50
|
+
}
|
51
|
+
|
52
|
+
var i = typeof require == 'function' && require;
|
53
|
+
|
54
|
+
for (var o = 0; o < r.length; o++) s(r[o]);
|
55
|
+
|
56
|
+
return s;
|
57
|
+
})({ 1: [function(require, module, exports) {
|
58
|
+
|
59
|
+
var DOCUMENT_NODE_TYPE = 9;
|
60
|
+
|
61
|
+
if (typeof Element !== 'undefined' && !Element.prototype.matches) {
|
62
|
+
var proto = Element.prototype;
|
63
|
+
|
64
|
+
proto.matches = proto.matchesSelector ||
|
65
|
+
proto.mozMatchesSelector ||
|
66
|
+
proto.msMatchesSelector ||
|
67
|
+
proto.oMatchesSelector ||
|
68
|
+
proto.webkitMatchesSelector;
|
69
|
+
}
|
70
|
+
|
71
|
+
function closest (element, selector) {
|
72
|
+
while (element && element.nodeType !== DOCUMENT_NODE_TYPE) {
|
73
|
+
if (element.matches(selector)) return element;
|
74
|
+
element = element.parentNode;
|
75
|
+
}
|
76
|
+
}
|
77
|
+
|
78
|
+
module.exports = closest;
|
79
|
+
|
80
|
+
}, {}], 2:[function(require, module, exports) {
|
81
|
+
var closest = require('./closest');
|
82
|
+
|
83
|
+
function delegate(element, selector, type, callback, useCapture) {
|
84
|
+
var listenerFn = listener.apply(this, arguments);
|
85
|
+
|
86
|
+
element.addEventListener(type, listenerFn, useCapture);
|
87
|
+
|
88
|
+
return {
|
89
|
+
destroy: function() {
|
90
|
+
element.removeEventListener(type, listenerFn, useCapture);
|
91
|
+
}
|
92
|
+
};
|
93
|
+
}
|
94
|
+
|
95
|
+
function listener(element, selector, type, callback) {
|
96
|
+
return function(e) {
|
97
|
+
e.delegateTarget = closest(e.target, selector);
|
98
|
+
|
99
|
+
if (e.delegateTarget) callback.call(element, e);
|
100
|
+
};
|
101
|
+
}
|
102
|
+
|
103
|
+
module.exports = delegate;
|
104
|
+
|
105
|
+
}, { './closest': 1 }], 3: [function(require, module, exports) {
|
106
|
+
|
107
|
+
exports.node = function(value) {
|
108
|
+
return value !== undefined &&
|
109
|
+
value instanceof HTMLElement &&
|
110
|
+
value.nodeType === 1;
|
111
|
+
};
|
112
|
+
|
113
|
+
exports.nodeList = function(value) {
|
114
|
+
var type = Object.prototype.toString.call(value);
|
115
|
+
|
116
|
+
return value !== undefined &&
|
117
|
+
(type === '[object NodeList]' || type === '[object HTMLCollection]') &&
|
118
|
+
('length' in value) &&
|
119
|
+
(value.length === 0 || exports.node(value[0]));
|
120
|
+
};
|
121
|
+
|
122
|
+
exports.string = function(value) {
|
123
|
+
return typeof value === 'string' ||
|
124
|
+
value instanceof String;
|
125
|
+
};
|
126
|
+
|
127
|
+
exports.fn = function(value) {
|
128
|
+
var type = Object.prototype.toString.call(value);
|
129
|
+
|
130
|
+
return type === '[object Function]';
|
131
|
+
};
|
132
|
+
|
133
|
+
}, {}], 4: [function(require, module, exports){
|
134
|
+
var is = require('./is');
|
135
|
+
var delegate = require('delegate');
|
136
|
+
|
137
|
+
function listen(target, type, callback) {
|
138
|
+
if (!target && !type && !callback) {
|
139
|
+
throw new Error('Missing required arguments');
|
140
|
+
}
|
141
|
+
|
142
|
+
if (!is.string(type)) {
|
143
|
+
throw new TypeError('Second argument must be a String');
|
144
|
+
}
|
145
|
+
|
146
|
+
if (!is.fn(callback)) {
|
147
|
+
throw new TypeError('Third argument must be a Function');
|
148
|
+
}
|
149
|
+
|
150
|
+
if (is.node(target)) {
|
151
|
+
return listenNode(target, type, callback);
|
152
|
+
}
|
153
|
+
else if (is.nodeList(target)) {
|
154
|
+
return listenNodeList(target, type, callback);
|
155
|
+
}
|
156
|
+
else if (is.string(target)) {
|
157
|
+
return listenSelector(target, type, callback);
|
158
|
+
}
|
159
|
+
else {
|
160
|
+
throw new TypeError('First argument must be a String, HTMLElement, HTMLCollection, or NodeList');
|
161
|
+
}
|
162
|
+
}
|
163
|
+
|
164
|
+
function listenNode(node, type, callback) {
|
165
|
+
node.addEventListener(type, callback);
|
166
|
+
|
167
|
+
return {
|
168
|
+
destroy: function() {
|
169
|
+
node.removeEventListener(type, callback);
|
170
|
+
}
|
171
|
+
};
|
172
|
+
}
|
173
|
+
|
174
|
+
function listenNodeList(nodeList, type, callback) {
|
175
|
+
Array.prototype.forEach.call(nodeList, function(node) {
|
176
|
+
node.addEventListener(type, callback);
|
177
|
+
});
|
178
|
+
|
179
|
+
return {
|
180
|
+
destroy: function() {
|
181
|
+
Array.prototype.forEach.call(nodeList, function(node) {
|
182
|
+
node.removeEventListener(type, callback);
|
183
|
+
});
|
184
|
+
}
|
185
|
+
};
|
186
|
+
}
|
187
|
+
|
188
|
+
function listenSelector(selector, type, callback) {
|
189
|
+
return delegate(document.body, selector, type, callback);
|
190
|
+
}
|
191
|
+
|
192
|
+
module.exports = listen;
|
193
|
+
|
194
|
+
}, { './is': 3, 'delegate': 2 }], 5: [function(require, module, exports) {
|
195
|
+
function select(element) {
|
196
|
+
var selectedText;
|
197
|
+
|
198
|
+
if (element.nodeName === 'SELECT') {
|
199
|
+
element.focus();
|
200
|
+
selectedText = element.value;
|
201
|
+
} else if (element.nodeName === 'INPUT' || element.nodeName === 'TEXTAREA') {
|
202
|
+
var isReadOnly = element.hasAttribute('readonly');
|
203
|
+
|
204
|
+
if (!isReadOnly) element.setAttribute('readonly', '');
|
205
|
+
|
206
|
+
element.select();
|
207
|
+
element.setSelectionRange(0, element.value.length);
|
208
|
+
|
209
|
+
if (!isReadOnly) element.removeAttribute('readonly');
|
210
|
+
|
211
|
+
selectedText = element.value;
|
212
|
+
} else {
|
213
|
+
if (element.hasAttribute('contenteditable')) element.focus();
|
214
|
+
|
215
|
+
var selection = window.getSelection();
|
216
|
+
var range = document.createRange();
|
217
|
+
|
218
|
+
range.selectNodeContents(element);
|
219
|
+
selection.removeAllRanges();
|
220
|
+
selection.addRange(range);
|
221
|
+
|
222
|
+
selectedText = selection.toString();
|
223
|
+
}
|
224
|
+
|
225
|
+
return selectedText;
|
226
|
+
}
|
227
|
+
|
228
|
+
module.exports = select;
|
229
|
+
|
230
|
+
}, {}], 6: [function(require, module, exports) {
|
231
|
+
function E () {
|
232
|
+
// Keep this empty so it's easier to inherit from
|
233
|
+
// (via https://github.com/lipsmack from https://github.com/scottcorgan/tiny-emitter/issues/3)
|
234
|
+
}
|
235
|
+
|
236
|
+
E.prototype = {
|
237
|
+
on: function (name, callback, ctx) {
|
238
|
+
var e = this.e || (this.e = {});
|
239
|
+
|
240
|
+
(e[name] || (e[name] = [])).push({
|
241
|
+
fn: callback,
|
242
|
+
ctx: ctx
|
243
|
+
});
|
244
|
+
|
245
|
+
return this;
|
246
|
+
},
|
247
|
+
|
248
|
+
once: function (name, callback, ctx) {
|
249
|
+
var self = this;
|
250
|
+
function listener () {
|
251
|
+
self.off(name, listener);
|
252
|
+
callback.apply(ctx, arguments);
|
253
|
+
}
|
254
|
+
|
255
|
+
listener._ = callback;
|
256
|
+
return this.on(name, listener, ctx);
|
257
|
+
},
|
258
|
+
|
259
|
+
emit: function (name) {
|
260
|
+
var data = [].slice.call(arguments, 1);
|
261
|
+
var evtArr = ((this.e || (this.e = {}))[name] || []).slice();
|
262
|
+
var i = 0;
|
263
|
+
var len = evtArr.length;
|
264
|
+
|
265
|
+
for (i; i < len; i++) {
|
266
|
+
evtArr[i].fn.apply(evtArr[i].ctx, data);
|
267
|
+
}
|
268
|
+
|
269
|
+
return this;
|
270
|
+
},
|
271
|
+
|
272
|
+
off: function (name, callback) {
|
273
|
+
var e = this.e || (this.e = {});
|
274
|
+
var evts = e[name];
|
275
|
+
var liveEvents = [];
|
276
|
+
|
277
|
+
if (evts && callback) {
|
278
|
+
for (var i = 0, len = evts.length; i < len; i++) {
|
279
|
+
if (evts[i].fn !== callback && evts[i].fn._ !== callback)
|
280
|
+
liveEvents.push(evts[i]);
|
281
|
+
}
|
282
|
+
}
|
283
|
+
|
284
|
+
// Remove event from queue to prevent memory leak
|
285
|
+
// Suggested by https://github.com/lazd
|
286
|
+
// Ref: https://github.com/scottcorgan/tiny-emitter/commit/c6ebfaa9bc973b33d110a84a307742b7cf94c953#commitcomment-5024910
|
287
|
+
|
288
|
+
(liveEvents.length) ? e[name] = liveEvents : delete e[name];
|
289
|
+
|
290
|
+
return this;
|
291
|
+
}
|
292
|
+
};
|
293
|
+
|
294
|
+
module.exports = E;
|
295
|
+
|
296
|
+
}, {}], 7: [function(require, module, exports) {
|
297
|
+
(function (global, factory) {
|
298
|
+
if (typeof define === 'function' && define.amd) {
|
299
|
+
define(['module', 'select'], factory);
|
300
|
+
} else if (typeof exports !== 'undefined') {
|
301
|
+
factory(module, require('select'));
|
302
|
+
} else {
|
303
|
+
var mod = {
|
304
|
+
exports: {}
|
305
|
+
};
|
306
|
+
factory(mod, global.select);
|
307
|
+
global.clipboardAction = mod.exports;
|
308
|
+
}
|
309
|
+
})(this, function (module, _select) {
|
310
|
+
'use strict';
|
311
|
+
|
312
|
+
var _select2 = _interopRequireDefault(_select);
|
313
|
+
|
314
|
+
function _interopRequireDefault(obj) {
|
315
|
+
return obj && obj.__esModule ? obj : {
|
316
|
+
default: obj
|
317
|
+
};
|
318
|
+
}
|
319
|
+
|
320
|
+
var _typeof = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol' ? function (obj) {
|
321
|
+
return typeof obj;
|
322
|
+
} : function (obj) {
|
323
|
+
return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : typeof obj;
|
324
|
+
};
|
325
|
+
|
326
|
+
function _classCallCheck(instance, Constructor) {
|
327
|
+
if (!(instance instanceof Constructor)) {
|
328
|
+
throw new TypeError('Cannot call a class as a function');
|
329
|
+
}
|
330
|
+
}
|
331
|
+
|
332
|
+
var _createClass = function () {
|
333
|
+
function defineProperties(target, props) {
|
334
|
+
for (var i = 0; i < props.length; i++) {
|
335
|
+
var descriptor = props[i];
|
336
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
337
|
+
descriptor.configurable = true;
|
338
|
+
if ("value" in descriptor) descriptor.writable = true;
|
339
|
+
Object.defineProperty(target, descriptor.key, descriptor);
|
340
|
+
}
|
341
|
+
}
|
342
|
+
|
343
|
+
return function (Constructor, protoProps, staticProps) {
|
344
|
+
if (protoProps) defineProperties(Constructor.prototype, protoProps);
|
345
|
+
if (staticProps) defineProperties(Constructor, staticProps);
|
346
|
+
return Constructor;
|
347
|
+
};
|
348
|
+
}();
|
349
|
+
|
350
|
+
var ClipboardAction = function () {
|
351
|
+
function ClipboardAction(options) {
|
352
|
+
_classCallCheck(this, ClipboardAction);
|
353
|
+
this.resolveOptions(options);
|
354
|
+
this.initSelection();
|
355
|
+
}
|
356
|
+
|
357
|
+
_createClass(ClipboardAction, [{
|
358
|
+
key: 'resolveOptions',
|
359
|
+
value: function resolveOptions() {
|
360
|
+
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
361
|
+
|
362
|
+
this.action = options.action;
|
363
|
+
this.emitter = options.emitter;
|
364
|
+
this.target = options.target;
|
365
|
+
this.text = options.text;
|
366
|
+
this.trigger = options.trigger;
|
367
|
+
|
368
|
+
this.selectedText = '';
|
369
|
+
}
|
370
|
+
}, {
|
371
|
+
key: 'initSelection',
|
372
|
+
value: function initSelection() {
|
373
|
+
if (this.text) {
|
374
|
+
this.selectFake();
|
375
|
+
} else if (this.target) {
|
376
|
+
this.selectTarget();
|
377
|
+
}
|
378
|
+
}
|
379
|
+
}, {
|
380
|
+
key: 'selectFake',
|
381
|
+
value: function selectFake() {
|
382
|
+
var _this = this;
|
383
|
+
|
384
|
+
var isRTL = document.documentElement.getAttribute('dir') == 'rtl';
|
385
|
+
|
386
|
+
this.removeFake();
|
387
|
+
|
388
|
+
this.fakeHandlerCallback = function () {
|
389
|
+
return _this.removeFake();
|
390
|
+
};
|
391
|
+
this.fakeHandler = document.body.addEventListener('click', this.fakeHandlerCallback) || true;
|
392
|
+
|
393
|
+
this.fakeElem = document.createElement('textarea');
|
394
|
+
// Prevent zooming on iOS
|
395
|
+
this.fakeElem.style.fontSize = '12pt';
|
396
|
+
// Reset box model
|
397
|
+
this.fakeElem.style.border = '0';
|
398
|
+
this.fakeElem.style.padding = '0';
|
399
|
+
this.fakeElem.style.margin = '0';
|
400
|
+
// Move element out of screen horizontally
|
401
|
+
this.fakeElem.style.position = 'absolute';
|
402
|
+
this.fakeElem.style[isRTL ? 'right' : 'left'] = '-9999px';
|
403
|
+
// Move element to the same position vertically
|
404
|
+
var yPosition = window.pageYOffset || document.documentElement.scrollTop;
|
405
|
+
this.fakeElem.style.top = yPosition + 'px';
|
406
|
+
|
407
|
+
this.fakeElem.setAttribute('readonly', '');
|
408
|
+
this.fakeElem.value = this.text;
|
409
|
+
|
410
|
+
document.body.appendChild(this.fakeElem);
|
411
|
+
|
412
|
+
this.selectedText = (0, _select2.default)(this.fakeElem);
|
413
|
+
this.copyText();
|
414
|
+
}
|
415
|
+
}, {
|
416
|
+
key: 'removeFake',
|
417
|
+
value: function removeFake() {
|
418
|
+
if (this.fakeHandler) {
|
419
|
+
document.body.removeEventListener('click', this.fakeHandlerCallback);
|
420
|
+
this.fakeHandler = null;
|
421
|
+
this.fakeHandlerCallback = null;
|
422
|
+
}
|
423
|
+
|
424
|
+
if (this.fakeElem) {
|
425
|
+
document.body.removeChild(this.fakeElem);
|
426
|
+
this.fakeElem = null;
|
427
|
+
}
|
428
|
+
}
|
429
|
+
}, {
|
430
|
+
key: 'selectTarget',
|
431
|
+
value: function selectTarget() {
|
432
|
+
this.selectedText = (0, _select2.default)(this.target);
|
433
|
+
this.copyText();
|
434
|
+
}
|
435
|
+
}, {
|
436
|
+
key: 'copyText',
|
437
|
+
value: function copyText() {
|
438
|
+
var succeeded = void 0;
|
439
|
+
|
440
|
+
try {
|
441
|
+
succeeded = document.execCommand(this.action);
|
442
|
+
} catch (err) {
|
443
|
+
succeeded = false;
|
444
|
+
}
|
445
|
+
|
446
|
+
this.handleResult(succeeded);
|
447
|
+
}
|
448
|
+
}, {
|
449
|
+
key: 'handleResult',
|
450
|
+
value: function handleResult(succeeded) {
|
451
|
+
this.emitter.emit(succeeded ? 'success' : 'error', {
|
452
|
+
action: this.action,
|
453
|
+
text: this.selectedText,
|
454
|
+
trigger: this.trigger,
|
455
|
+
clearSelection: this.clearSelection.bind(this)
|
456
|
+
});
|
457
|
+
}
|
458
|
+
}, {
|
459
|
+
key: 'clearSelection',
|
460
|
+
value: function clearSelection() {
|
461
|
+
if (this.target) this.target.blur();
|
462
|
+
window.getSelection().removeAllRanges();
|
463
|
+
}
|
464
|
+
}, {
|
465
|
+
key: 'destroy',
|
466
|
+
value: function destroy() {
|
467
|
+
this.removeFake();
|
468
|
+
}
|
469
|
+
}, {
|
470
|
+
key: 'action',
|
471
|
+
set: function set() {
|
472
|
+
var action = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'copy';
|
473
|
+
|
474
|
+
this._action = action;
|
475
|
+
|
476
|
+
if (this._action !== 'copy' && this._action !== 'cut') {
|
477
|
+
throw new Error('Invalid "action" value, use either "copy" or "cut"');
|
478
|
+
}
|
479
|
+
},
|
480
|
+
get: function get() {
|
481
|
+
return this._action;
|
482
|
+
}
|
483
|
+
}, {
|
484
|
+
key: 'target',
|
485
|
+
set: function set(target) {
|
486
|
+
if (target !== undefined) {
|
487
|
+
if (target && (typeof target === 'undefined' ? 'undefined' : _typeof(target)) === 'object' && target.nodeType === 1) {
|
488
|
+
if (this.action === 'copy' && target.hasAttribute('disabled')) {
|
489
|
+
throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');
|
490
|
+
}
|
491
|
+
|
492
|
+
if (this.action === 'cut' && (target.hasAttribute('readonly') || target.hasAttribute('disabled'))) {
|
493
|
+
throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes');
|
494
|
+
}
|
495
|
+
|
496
|
+
this._target = target;
|
497
|
+
} else {
|
498
|
+
throw new Error('Invalid "target" value, use a valid Element');
|
499
|
+
}
|
500
|
+
}
|
501
|
+
},
|
502
|
+
get: function get() {
|
503
|
+
return this._target;
|
504
|
+
}
|
505
|
+
}]);
|
506
|
+
|
507
|
+
return ClipboardAction;
|
508
|
+
}();
|
509
|
+
|
510
|
+
module.exports = ClipboardAction;
|
511
|
+
});
|
512
|
+
|
513
|
+
}, { 'select': 5}], 8: [function(require, module, exports) {
|
514
|
+
(function (global, factory) {
|
515
|
+
if (typeof define === 'function' && define.amd) {
|
516
|
+
define(['module', './clipboard-action', 'tiny-emitter', 'good-listener'], factory);
|
517
|
+
} else if (typeof exports !== 'undefined') {
|
518
|
+
factory(module, require('./clipboard-action'), require('tiny-emitter'), require('good-listener'));
|
519
|
+
} else {
|
520
|
+
var mod = {
|
521
|
+
exports: {}
|
522
|
+
};
|
523
|
+
factory(mod, global.clipboardAction, global.tinyEmitter, global.goodListener);
|
524
|
+
global.clipboard = mod.exports;
|
525
|
+
}
|
526
|
+
})(this, function (module, _clipboardAction, _tinyEmitter, _goodListener) {
|
527
|
+
'use strict';
|
528
|
+
|
529
|
+
var _clipboardAction2 = _interopRequireDefault(_clipboardAction);
|
530
|
+
var _tinyEmitter2 = _interopRequireDefault(_tinyEmitter);
|
531
|
+
var _goodListener2 = _interopRequireDefault(_goodListener);
|
532
|
+
|
533
|
+
function _interopRequireDefault(obj) {
|
534
|
+
return obj && obj.__esModule ? obj : {
|
535
|
+
default: obj
|
536
|
+
};
|
537
|
+
}
|
538
|
+
|
539
|
+
function _classCallCheck(instance, Constructor) {
|
540
|
+
if (!(instance instanceof Constructor)) {
|
541
|
+
throw new TypeError("Cannot call a class as a function");
|
542
|
+
}
|
543
|
+
}
|
544
|
+
|
545
|
+
var _createClass = function () {
|
546
|
+
function defineProperties(target, props) {
|
547
|
+
for (var i = 0; i < props.length; i++) {
|
548
|
+
var descriptor = props[i];
|
549
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
550
|
+
descriptor.configurable = true;
|
551
|
+
if ("value" in descriptor) descriptor.writable = true;
|
552
|
+
Object.defineProperty(target, descriptor.key, descriptor);
|
553
|
+
}
|
554
|
+
}
|
555
|
+
|
556
|
+
return function (Constructor, protoProps, staticProps) {
|
557
|
+
if (protoProps) defineProperties(Constructor.prototype, protoProps);
|
558
|
+
if (staticProps) defineProperties(Constructor, staticProps);
|
559
|
+
return Constructor;
|
560
|
+
};
|
561
|
+
}();
|
562
|
+
|
563
|
+
function _possibleConstructorReturn(self, call) {
|
564
|
+
if (!self) {
|
565
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
566
|
+
}
|
567
|
+
|
568
|
+
return call && (typeof call === "object" || typeof call === 'function') ? call : self;
|
569
|
+
}
|
570
|
+
|
571
|
+
function _inherits(subClass, superClass) {
|
572
|
+
if (typeof superClass !== 'function' && superClass !== null) {
|
573
|
+
throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
|
574
|
+
}
|
575
|
+
|
576
|
+
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
577
|
+
constructor: {
|
578
|
+
value: subClass,
|
579
|
+
enumerable: false,
|
580
|
+
writable: true,
|
581
|
+
configurable: true
|
582
|
+
}
|
583
|
+
});
|
584
|
+
|
585
|
+
if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
|
586
|
+
}
|
587
|
+
|
588
|
+
var Clipboard = function (_Emitter) {
|
589
|
+
_inherits(Clipboard, _Emitter);
|
590
|
+
|
591
|
+
function Clipboard(trigger, options) {
|
592
|
+
_classCallCheck(this, Clipboard);
|
593
|
+
|
594
|
+
var _this = _possibleConstructorReturn(this, (Clipboard.__proto__ || Object.getPrototypeOf(Clipboard)).call(this));
|
595
|
+
|
596
|
+
_this.resolveOptions(options);
|
597
|
+
_this.listenClick(trigger);
|
598
|
+
return _this;
|
599
|
+
}
|
600
|
+
|
601
|
+
_createClass(Clipboard, [{
|
602
|
+
key: 'resolveOptions',
|
603
|
+
value: function resolveOptions() {
|
604
|
+
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
605
|
+
|
606
|
+
this.action = typeof options.action === 'function' ? options.action : this.defaultAction;
|
607
|
+
this.target = typeof options.target === 'function' ? options.target : this.defaultTarget;
|
608
|
+
this.text = typeof options.text === 'function' ? options.text : this.defaultText;
|
609
|
+
}
|
610
|
+
}, {
|
611
|
+
key: 'listenClick',
|
612
|
+
value: function listenClick(trigger) {
|
613
|
+
var _this2 = this;
|
614
|
+
|
615
|
+
this.listener = (0, _goodListener2.default)(trigger, 'click', function (e) {
|
616
|
+
return _this2.onClick(e);
|
617
|
+
});
|
618
|
+
}
|
619
|
+
}, {
|
620
|
+
key: 'onClick',
|
621
|
+
value: function onClick(e) {
|
622
|
+
var trigger = e.delegateTarget || e.currentTarget;
|
623
|
+
|
624
|
+
if (this.clipboardAction) {
|
625
|
+
this.clipboardAction = null;
|
626
|
+
}
|
627
|
+
|
628
|
+
this.clipboardAction = new _clipboardAction2.default({
|
629
|
+
action: this.action(trigger),
|
630
|
+
target: this.target(trigger),
|
631
|
+
text: this.text(trigger),
|
632
|
+
trigger: trigger,
|
633
|
+
emitter: this
|
634
|
+
});
|
635
|
+
}
|
636
|
+
}, {
|
637
|
+
key: 'defaultAction',
|
638
|
+
value: function defaultAction(trigger) {
|
639
|
+
return getAttributeValue('action', trigger);
|
640
|
+
}
|
641
|
+
}, {
|
642
|
+
key: 'defaultTarget',
|
643
|
+
value: function defaultTarget(trigger) {
|
644
|
+
var selector = getAttributeValue('target', trigger);
|
645
|
+
|
646
|
+
if (selector) return document.querySelector(selector);
|
647
|
+
}
|
648
|
+
}, {
|
649
|
+
key: 'defaultText',
|
650
|
+
value: function defaultText(trigger) {
|
651
|
+
return getAttributeValue('text', trigger);
|
652
|
+
}
|
653
|
+
}, {
|
654
|
+
key: 'destroy',
|
655
|
+
value: function destroy() {
|
656
|
+
this.listener.destroy();
|
657
|
+
|
658
|
+
if (this.clipboardAction) {
|
659
|
+
this.clipboardAction.destroy();
|
660
|
+
this.clipboardAction = null;
|
661
|
+
}
|
662
|
+
}
|
663
|
+
}], [{
|
664
|
+
key: 'isSupported',
|
665
|
+
value: function isSupported() {
|
666
|
+
var action = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ['copy', 'cut'];
|
667
|
+
|
668
|
+
var actions = typeof action === 'string' ? [action] : action;
|
669
|
+
var support = !!document.queryCommandSupported;
|
670
|
+
|
671
|
+
actions.forEach(function (action) {
|
672
|
+
support = support && !!document.queryCommandSupported(action);
|
673
|
+
});
|
674
|
+
|
675
|
+
return support;
|
676
|
+
}
|
677
|
+
}]);
|
678
|
+
|
679
|
+
return Clipboard;
|
680
|
+
}(_tinyEmitter2.default);
|
681
|
+
|
682
|
+
function getAttributeValue(suffix, element) {
|
683
|
+
var attribute = 'data-clipboard-' + suffix;
|
684
|
+
|
685
|
+
if (!element.hasAttribute(attribute)) return;
|
686
|
+
|
687
|
+
return element.getAttribute(attribute);
|
688
|
+
}
|
689
|
+
|
690
|
+
module.exports = Clipboard;
|
691
|
+
});
|
692
|
+
|
693
|
+
}, { './clipboard-action': 7, 'good-listener': 4, 'tiny-emitter': 6 }]}, {}, [8])(8)
|
694
|
+
});
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_frontend
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 14.0.
|
4
|
+
version: 14.0.81
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Juan Gomez
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-04-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -247,6 +247,7 @@ files:
|
|
247
247
|
- vendor/assets/javascripts/base/_typeahead.js
|
248
248
|
- vendor/assets/javascripts/extensions/_calendar.js
|
249
249
|
- vendor/assets/javascripts/extensions/_chart.js
|
250
|
+
- vendor/assets/javascripts/extensions/_copy.js
|
250
251
|
- vendor/assets/javascripts/extensions/_map.js
|
251
252
|
- vendor/assets/javascripts/extensions/_wysiwyg.js
|
252
253
|
- vendor/assets/stylesheets/.DS_Store
|
@@ -324,7 +325,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
324
325
|
version: '0'
|
325
326
|
requirements: []
|
326
327
|
rubyforge_project:
|
327
|
-
rubygems_version: 2.6.
|
328
|
+
rubygems_version: 2.6.11
|
328
329
|
signing_key:
|
329
330
|
specification_version: 4
|
330
331
|
summary: ActiveFrontend Responsive Web Framework
|