Replace ZeroClipboard with Clipboard.js
This commit is contained in:
@@ -1,14 +1,8 @@
|
|||||||
(function() {
|
(function() {
|
||||||
var copyButton = document.getElementById('copy-button');
|
var clipboard = new Clipboard('#copy-button');
|
||||||
if (copyButton) {
|
clipboard.on('success', function(e) {
|
||||||
var data = document.getElementById('example-source').textContent;
|
e.clearSelection();
|
||||||
new ZeroClipboard(copyButton).on('copy', function(event) {
|
});
|
||||||
event.clipboardData.setData({
|
|
||||||
'text/plain': data,
|
|
||||||
'text/html': data
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
var codepenButton = document.getElementById('codepen-button');
|
var codepenButton = document.getElementById('codepen-button');
|
||||||
if (codepenButton) {
|
if (codepenButton) {
|
||||||
|
|||||||
@@ -1,70 +0,0 @@
|
|||||||
{
|
|
||||||
/* Enforcing options */
|
|
||||||
"bitwise": true,
|
|
||||||
"camelcase": true,
|
|
||||||
"curly": true,
|
|
||||||
"eqeqeq": true,
|
|
||||||
"es3": true,
|
|
||||||
"es5": false,
|
|
||||||
"forin": true,
|
|
||||||
"freeze": true,
|
|
||||||
"immed": true,
|
|
||||||
"indent": 2,
|
|
||||||
"latedef": true,
|
|
||||||
"newcap": true,
|
|
||||||
"noarg": true,
|
|
||||||
"noempty": true,
|
|
||||||
"nonbsp": true,
|
|
||||||
"nonew": true,
|
|
||||||
"plusplus": false,
|
|
||||||
"quotmark": "double",
|
|
||||||
"undef": true,
|
|
||||||
"unused": true,
|
|
||||||
"strict": true,
|
|
||||||
"trailing": true,
|
|
||||||
"maxparams": 4,
|
|
||||||
"maxdepth": 5,
|
|
||||||
"maxstatements": false,
|
|
||||||
"maxlen": false, /* IDEAL: 120? */
|
|
||||||
|
|
||||||
|
|
||||||
/* Relaxing options */
|
|
||||||
"asi": false,
|
|
||||||
"boss": false,
|
|
||||||
"debug": false,
|
|
||||||
"eqnull": true,
|
|
||||||
"esnext": false,
|
|
||||||
"evil": false,
|
|
||||||
"expr": false,
|
|
||||||
"funcscope": false,
|
|
||||||
"gcl": false,
|
|
||||||
"globalstrict": false,
|
|
||||||
"iterator": false,
|
|
||||||
"lastsemic": false,
|
|
||||||
"laxbreak": false,
|
|
||||||
"laxcomma": false,
|
|
||||||
"loopfunc": false,
|
|
||||||
"maxerr": 50,
|
|
||||||
"moz": false,
|
|
||||||
"multistr": false,
|
|
||||||
"notypeof": false,
|
|
||||||
"proto": false,
|
|
||||||
"scripturl": false,
|
|
||||||
"smarttabs": false,
|
|
||||||
"shadow": false,
|
|
||||||
"sub": false,
|
|
||||||
"supernew": false,
|
|
||||||
"validthis": false,
|
|
||||||
"noyield": false,
|
|
||||||
|
|
||||||
/* Environments */
|
|
||||||
"browser": true,
|
|
||||||
|
|
||||||
/* Global variables */
|
|
||||||
"globals": {
|
|
||||||
/* AMD */
|
|
||||||
"define": false,
|
|
||||||
/* CommonJS */
|
|
||||||
"module": false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Binary file not shown.
@@ -12,7 +12,7 @@
|
|||||||
{{{ extraHead.local }}}
|
{{{ extraHead.local }}}
|
||||||
{{{ css.tag }}}
|
{{{ css.tag }}}
|
||||||
<script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=fetch,requestAnimationFrame,Element.prototype.classList,URL"></script>
|
<script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=fetch,requestAnimationFrame,Element.prototype.classList,URL"></script>
|
||||||
<script src="./resources/zeroclipboard/ZeroClipboard.min.js"></script>
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/1.7.1/clipboard.min.js"></script>
|
||||||
<title>{{ title }}</title>
|
<title>{{ title }}</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
@@ -57,7 +57,7 @@
|
|||||||
|
|
||||||
<div class="row-fluid">
|
<div class="row-fluid">
|
||||||
<div id="source-controls">
|
<div id="source-controls">
|
||||||
<a id="copy-button"><i class="fa fa-clipboard"></i> Copy</a>
|
<a id="copy-button" data-clipboard-target="#example-source"><i class="fa fa-clipboard"></i> Copy</a>
|
||||||
<a id="codepen-button"><i class="fa fa-codepen"></i> Edit</a>
|
<a id="codepen-button"><i class="fa fa-codepen"></i> Edit</a>
|
||||||
</div>
|
</div>
|
||||||
<form method="POST" id="codepen-form" target="_blank" action="https://codepen.io/pen/define/">
|
<form method="POST" id="codepen-form" target="_blank" action="https://codepen.io/pen/define/">
|
||||||
|
|||||||
Reference in New Issue
Block a user