clipboard-rails 1.5.9 → 1.5.10

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: 077ff103bd6ab5e0fe17a5be37211ed983793776
4
- data.tar.gz: 3309368552404247f57e5380305a306c4c23612d
3
+ metadata.gz: 555b4837bfd3cce57e5232bcc0d0eb62827574d0
4
+ data.tar.gz: b5f3b55fad5450dedbd51021314fc6601b01b706
5
5
  SHA512:
6
- metadata.gz: 8689af10933aac18159d1bd592207996d2e7c1f92386277405d77a40a770c344b962e88c5eebf36f0b443eeb73e7d1bc47d5ff8101bda8c8a2b4d13432be39a5
7
- data.tar.gz: 5871a35c815fe5c7a69ab8fe881d33097b2ea7b114f75313969cc7968ecbdb823526c6ccd3ec20376f606ba721dd91e3a1f901b0c6dd17902ed8e8ecfe6b6d78
6
+ metadata.gz: d9fa1727b97d59fff6eb049aef697b646c82da43b65cb5af76fbdaf887d1d8144757af7a680cf24a403a239ded3f735b8a9ef323eb888bb8cdb10ba50c0c93d5
7
+ data.tar.gz: bef94d87e72fa417ad23d361f31d9fe1f7c6f7669cdb4642be8b8d3b22e5e8be71158fe0b5df8969d137f08b06aeb656bcdd20034d0b1b921a1c5bfa4b7d3f1b
@@ -1,5 +1,5 @@
1
1
  module Clipboard
2
2
  module Rails
3
- VERSION = "1.5.9"
3
+ VERSION = "1.5.10"
4
4
  end
5
5
  end
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * clipboard.js v1.5.9
2
+ * clipboard.js v1.5.10
3
3
  * https://zenorocha.github.io/clipboard.js
4
4
  *
5
5
  * Licensed MIT © Zeno Rocha
@@ -434,14 +434,10 @@ module.exports = E;
434
434
  };
435
435
 
436
436
  ClipboardAction.prototype.initSelection = function initSelection() {
437
- if (this.text && this.target) {
438
- throw new Error('Multiple attributes declared, use either "target" or "text"');
439
- } else if (this.text) {
437
+ if (this.text) {
440
438
  this.selectFake();
441
439
  } else if (this.target) {
442
440
  this.selectTarget();
443
- } else {
444
- throw new Error('Missing required attributes, use either "target" or "text"');
445
441
  }
446
442
  };
447
443
 
@@ -554,6 +550,14 @@ module.exports = E;
554
550
  set: function set(target) {
555
551
  if (target !== undefined) {
556
552
  if (target && (typeof target === 'undefined' ? 'undefined' : _typeof(target)) === 'object' && target.nodeType === 1) {
553
+ if (this.action === 'copy' && target.hasAttribute('disabled')) {
554
+ throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');
555
+ }
556
+
557
+ if (this.action === 'cut' && (target.hasAttribute('readonly') || target.hasAttribute('disabled'))) {
558
+ throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes');
559
+ }
560
+
557
561
  this._target = target;
558
562
  } else {
559
563
  throw new Error('Invalid "target" value, use a valid Element');
@@ -733,4 +737,4 @@ module.exports = E;
733
737
  });
734
738
 
735
739
  },{"./clipboard-action":8,"good-listener":4,"tiny-emitter":7}]},{},[9])(9)
736
- });
740
+ });
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: clipboard-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.9
4
+ version: 1.5.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mohammed Sadiq
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-03-04 00:00:00.000000000 Z
11
+ date: 2016-04-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -81,7 +81,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
81
81
  version: '0'
82
82
  requirements: []
83
83
  rubyforge_project:
84
- rubygems_version: 2.5.2
84
+ rubygems_version: 2.5.1
85
85
  signing_key:
86
86
  specification_version: 4
87
87
  summary: ''