2
0
mirror of https://github.com/offen/website.git synced 2024-12-23 05:20:21 +01:00

Merge pull request #76 from offen/click-to-copy

Add click to copy for demo commands
This commit is contained in:
Frederik Ring 2020-05-22 17:57:45 +02:00 committed by GitHub
commit 46aac03106
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 37 additions and 3 deletions

View File

@ -0,0 +1,24 @@
clipboard.js
Copyright (C) Zeno Rocha
MIT License
Copyright (c) Zeno Rocha
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@ -0,0 +1,3 @@
$(document).ready(function () {
var clipboard = new ClipboardJS('.js-click-to-copy')
})

File diff suppressed because one or more lines are too long

View File

@ -199,7 +199,7 @@
{% endif %}
</div>
{% block scripts %}
{% assets filters="rjsmin", output="scripts/packed.js", "scripts/jquery-3.4.1.min.js", "scripts/menu.js", "scripts/fade.js" %}
{% assets filters="rjsmin", output="scripts/packed.js", "scripts/jquery-3.4.1.min.js", "scripts/menu.js", "scripts/fade.js", "scripts/clipboard.min.js", "scripts/click-to-copy.js" %}
<script src="/{{ ASSET_URL }}"></script>
{% endassets %}
{% endblock %}

View File

@ -19,7 +19,7 @@
</p>
<div class="flex flex-column items-center">
<div class="w-100 ph4 pv2 mb5 inner-shaddow bg-gray">
<code class="ma0 lh-solid word-wrap white">
<code class="ma0 lh-solid word-wrap white js-click-to-copy pointer" data-clipboard-text="curl https://demo.offen.dev | bash" title="Click to copy">
curl https://demo.offen.dev | bash
</code>
</div>
@ -30,7 +30,7 @@
</p>
<div class="flex flex-column items-center">
<div class="w-100 ph4 pv2 mb5 inner-shaddow bg-gray">
<code class="ma0 lh-solid word-wrap white">
<code class="ma0 lh-solid word-wrap white js-click-to-copy pointer" data-clipboard-text="docker run --rm -it -p 9876:9876 offen/offen:latest demo -port 9876" title="Click to copy">
docker run --rm -it -p 9876:9876 offen/offen:latest demo -port 9876
</code>
</div>