clipboard-rails 1.5.15 → 1.5.16

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: e56f029fb7779a965754984ddf583a58bef79c93
4
- data.tar.gz: d9cdd73bbfae23db57575fca5a751253d7bb9cc2
3
+ metadata.gz: 93064c17a8044f99b9104e68339b272bf644d7cd
4
+ data.tar.gz: 4744cfe7fc97c40d354c499efb999abe6b439795
5
5
  SHA512:
6
- metadata.gz: 4d81c7969e4e174939bb4c645cdab5f7062e2f03ab046401d8eb63321b451868fd05a406ec024db3efb7f20d7f5d4f301dee94fd542257b1cf39ed69efbcc430
7
- data.tar.gz: 5fc1adb8656876eb149810b7a56078487396580aaea8aadfbc786e2fddaec8f05b504d350d222ccb77c7692e5b08867c15411b83a4bdb671ff8433ddb0590071
6
+ metadata.gz: 559f99d751b69b05eb462aab85e92f65b2e9c68eee4152de95696f293abd39681ebd1cd980893fb314e2777ccb97de6f0994d5dbbd168ab0f771528b44ecdd07
7
+ data.tar.gz: d37d68ea1af38fdb19a43bbcdb8c3758a33d188b9ef935c58c5fa58654cfb9f784198778765c410e6971c95db6aa98b0d8be73f5be34f65212dabced413ea6d8
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # clipboard-rails
2
2
  [![Gem Version](https://badge.fury.io/rb/clipboard-rails.svg)](http://badge.fury.io/rb/clipboard-rails)
3
3
 
4
- clipboard-rails gem is the integration of clipboard.js javascript library for your Rails 4 application.
4
+ clipboard-rails gem is the integration of clipboard.js javascript library for your Rails 4 and Rails 5 applications.
5
5
 
6
6
  clipboard.js is a modern approach to copy text to clipboard No Flash. No dependencies. Just 2kb
7
7
  source: https://github.com/zenorocha/clipboard.js
@@ -38,7 +38,7 @@ Add this sample code to your `app/assets/javascripts/application.js` file
38
38
  ``` javascript
39
39
  $(document).ready(function(){
40
40
 
41
- var clip = new Clipboard('.btn');
41
+ var clip = new Clipboard('.clipboard-btn');
42
42
  console.log(clip);
43
43
 
44
44
  });
@@ -53,14 +53,19 @@ Add this sample code to your template file like `index.html.erb`
53
53
  <textarea id="bar">Mussum ipsum cacilds...</textarea>
54
54
 
55
55
  <!-- Trigger -->
56
- <button class="btn" data-clipboard-action="cut" data-clipboard-target="#bar">
56
+ <button class="clipboard-btn" data-clipboard-action="copy" data-clipboard-target="#bar">
57
57
  Cut to clipboard
58
58
  </button>
59
59
  ```
60
+ ## Additional information
61
+
62
+ Additionally, you can define a **data-clipboard-action** attribute to specify if you want to either **copy** or **cut** content.
63
+
64
+ If you omit this attribute, **copy** will be used by default.
60
65
 
61
66
  ## Full documentation
62
67
 
63
- Read the clipboard.js documentation here http://zenorocha.github.io/clipboard.js/
68
+ Read the clipboard.js documentation here http://zenorocha.github.io/clipboard.js/ for full usage information.
64
69
 
65
70
  ## Development
66
71
 
@@ -70,7 +75,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
70
75
 
71
76
  ## Contributing
72
77
 
73
- Bug reports and pull requests are welcome on GitHub at https://github.com/sadiqmmm/clipboard-rails. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](contributor-covenant.org) code of conduct.
78
+ Bug reports and pull requests are welcome on GitHub at https://github.com/sadiqmmm/clipboard-rails. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
74
79
 
75
80
 
76
81
  ## License
@@ -1,5 +1,5 @@
1
1
  module Clipboard
2
2
  module Rails
3
- VERSION = "1.5.15"
3
+ VERSION = "1.5.16"
4
4
  end
5
5
  end
@@ -1,10 +1,12 @@
1
1
  /*!
2
- * clipboard.js v1.5.15
2
+ * clipboard.js v1.5.16
3
3
  * https://zenorocha.github.io/clipboard.js
4
4
  *
5
5
  * Licensed MIT © Zeno Rocha
6
6
  */
7
7
  (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Clipboard = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
8
+ var DOCUMENT_NODE_TYPE = 9;
9
+
8
10
  /**
9
11
  * A polyfill for Element.matches()
10
12
  */
@@ -26,7 +28,7 @@ if (Element && !Element.prototype.matches) {
26
28
  * @return {Function}
27
29
  */
28
30
  function closest (element, selector) {
29
- while (element && element !== document) {
31
+ while (element && element.nodeType !== DOCUMENT_NODE_TYPE) {
30
32
  if (element.matches(selector)) return element;
31
33
  element = element.parentNode;
32
34
  }
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.15
4
+ version: 1.5.16
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-10-24 00:00:00.000000000 Z
11
+ date: 2016-12-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler