mirror of
https://github.com/zenorocha/clipboard.js.git
synced 2023-08-10 21:12:48 +03:00
46 lines
1.2 KiB
HTML
46 lines
1.2 KiB
HTML
<html>
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>Mocha Tests</title>
|
|
<link rel="stylesheet" href="../node_modules/mocha/mocha.css">
|
|
</head>
|
|
<body>
|
|
<div id="mocha"></div>
|
|
|
|
<div>
|
|
<p>Copy text from attribute</p>
|
|
<button class="btn" data-action="copy" data-text="hello">Copy</button>
|
|
</div>
|
|
|
|
<div>
|
|
<p>Copy text from non-input element</p>
|
|
<p id="paragraph">hello</p>
|
|
<button class="btn" data-action="copy" data-target="paragraph">Copy</button>
|
|
</div>
|
|
|
|
<div>
|
|
<p>Copy text from input element</p>
|
|
<input id="foo" type="text" value="hello">
|
|
<button class="btn" data-action="copy" data-target="foo">Copy</button>
|
|
</div>
|
|
|
|
<div>
|
|
<p>Cut text from textarea element</p>
|
|
<textarea id="bar">hello</textarea>
|
|
<button class="btn" data-action="cut" data-target="bar">Cut</button>
|
|
</div>
|
|
|
|
<script src="../dist/clipboard.min.js"></script>
|
|
<script src="../node_modules/mocha/mocha.js"></script>
|
|
<script src="../node_modules/chai/chai.js"></script>
|
|
|
|
<script>mocha.setup('bdd')</script>
|
|
<script src="clipboard.js"></script>
|
|
<script>
|
|
mocha.checkLeaks();
|
|
mocha.globals(['Clipboard']);
|
|
mocha.run();
|
|
</script>
|
|
</body>
|
|
</html>
|