Skip to content

Commit

Permalink
update 1.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
xuliangzhan committed Dec 30, 2018
1 parent 59996c8 commit 8e407be
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 12 deletions.
9 changes: 4 additions & 5 deletions dist/xe-clipboard.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* xe-clipboard.js v1.0.0
* xe-clipboard.js v1.0.1
* (c) 2017-2018 Xu Liangzhan
* ISC License.
* @preserve
Expand Down Expand Up @@ -34,15 +34,14 @@
*/
function XEClipboard (content) {
var $copy = getContainer()
var value = '' + content
var value = content === null || content === undefined ? '' : '' + content
try {
$copy.value = value
$copy.focus()
$copy.setSelectionRange(0, value.length)
return document.execCommand('copy', true)
} catch (e) {
return false
}
} catch (e) { }
return false
}

XEClipboard.copy = XEClipboard
Expand Down
4 changes: 2 additions & 2 deletions dist/xe-clipboard.min.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* xe-clipboard.js v1.0.0
* xe-clipboard.js v1.0.1
* (c) 2017-2018 Xu Liangzhan
* ISC License.
* @preserve
*/
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.XEClipboard=t()}(this,function(){"use strict";function e(e){var t,n=((t=document.getElementById("$XECopy"))||((t=document.createElement("input")).id="$XECopy",t.style.width="48px",t.style.height="12px",t.style.position="absolute",t.style["z-index"]="0",t.style.left="-500px",t.style.top="-500px",document.body.appendChild(t)),t),o=""+e;try{return n.value=o,n.focus(),n.setSelectionRange(0,o.length),document.execCommand("copy",!0)}catch(e){return!1}}return e.copy=e});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.XEClipboard=t()}(this,function(){"use strict";function e(e){var t,n=((t=document.getElementById("$XECopy"))||((t=document.createElement("input")).id="$XECopy",t.style.width="48px",t.style.height="12px",t.style.position="absolute",t.style["z-index"]="0",t.style.left="-500px",t.style.top="-500px",document.body.appendChild(t)),t),o=null==e?"":""+e;try{return n.value=o,n.focus(),n.setSelectionRange(0,o.length),document.execCommand("copy",!0)}catch(e){}return!1}return e.copy=e});
7 changes: 3 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,14 @@ function getContainer () {
*/
function XEClipboard (content) {
var $copy = getContainer()
var value = '' + content
var value = content === null || content === undefined ? '' : '' + content
try {
$copy.value = value
$copy.focus()
$copy.setSelectionRange(0, value.length)
return document.execCommand('copy', true)
} catch (e) {
return false
}
} catch (e) {}
return false
}

XEClipboard.copy = XEClipboard
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "xe-clipboard",
"version": "1.0.0",
"version": "1.0.1",
"description": "Copy the contents to the clipboard, support commonly used H5 browser IE, Chrome, Firefox, Opera, Safari, IOS, Android.",
"main": "index.js",
"typings": "types/index.d.ts",
Expand Down

0 comments on commit 8e407be

Please sign in to comment.