Replace ZeroClipboard with Clipboard.js to remove flash dependency
This commit is contained in:
@@ -11,7 +11,7 @@
|
|||||||
<link rel="stylesheet" href="./resources/layout.css" type="text/css">
|
<link rel="stylesheet" href="./resources/layout.css" type="text/css">
|
||||||
{{{ extraHead }}}
|
{{{ extraHead }}}
|
||||||
{{{ css.tag }}}
|
{{{ css.tag }}}
|
||||||
<script src="./resources/zeroclipboard/ZeroClipboard.min.js"></script>
|
<script src="https://cdn.rawgit.com/zenorocha/clipboard.js/master/dist/clipboard.min.js"></script>
|
||||||
<title>{{ title }}</title>
|
<title>{{ title }}</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
@@ -38,7 +38,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="jsfiddle-button"><i class="fa fa-jsfiddle"></i> Edit</a>
|
<a id="jsfiddle-button"><i class="fa fa-jsfiddle"></i> Edit</a>
|
||||||
</div>
|
</div>
|
||||||
<form method="POST" id="jsfiddle-form" target="_blank" action="http://jsfiddle.net/api/post/jquery/1.11.0/">
|
<form method="POST" id="jsfiddle-form" target="_blank" action="http://jsfiddle.net/api/post/jquery/1.11.0/">
|
||||||
|
|||||||
@@ -1,12 +1,9 @@
|
|||||||
(function() {
|
(function() {
|
||||||
var copyButton = document.getElementById('copy-button');
|
var copyButton = document.getElementById('copy-button');
|
||||||
if (copyButton) {
|
if (copyButton) {
|
||||||
var data = document.getElementById('example-source').textContent;
|
var clipboard = new Clipboard('#copy-button');
|
||||||
new ZeroClipboard(copyButton).on('copy', function(event) {
|
clipboard.on('success', function(e) {
|
||||||
event.clipboardData.setData({
|
e.clearSelection();
|
||||||
'text/plain': data,
|
|
||||||
'text/html': data
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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.
Reference in New Issue
Block a user