You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by ma...@apache.org on 2021/09/17 16:41:46 UTC
[airavata-django-portal] branch master updated: tutorial: copy to
clipboard button
This is an automated email from the ASF dual-hosted git repository.
machristie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/airavata-django-portal.git
The following commit(s) were added to refs/heads/master by this push:
new 13a8dca tutorial: copy to clipboard button
13a8dca is described below
commit 13a8dca44db4cc94beb389c1bd8030014c304074
Author: Marcus Christie <ma...@apache.org>
AuthorDate: Fri Sep 17 12:41:37 2021 -0400
tutorial: copy to clipboard button
---
docs/assets/js/clipboard.min.js | 7 +++++++
docs/assets/js/clipboard_init.js | 1 +
docs/tutorial/custom_ui_tutorial.md | 8 +++++++-
mkdocs.yml | 4 ++++
4 files changed, 19 insertions(+), 1 deletion(-)
diff --git a/docs/assets/js/clipboard.min.js b/docs/assets/js/clipboard.min.js
new file mode 100644
index 0000000..54b3c46
--- /dev/null
+++ b/docs/assets/js/clipboard.min.js
@@ -0,0 +1,7 @@
+/*!
+ * clipboard.js v2.0.8
+ * https://clipboardjs.com/
+ *
+ * Licensed MIT © Zeno Rocha
+ */
+!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.ClipboardJS=e():t.ClipboardJS=e()}(this,function(){return n={686:function(t,e,n){"use strict";n.d(e,{default:function(){return o}});var e=n(279),i=n.n(e),e=n(370),u=n.n(e),e=n(817),c=n.n(e);function a(t){try{return document.execCommand(t)}catch(t){return}}var f=function(t){t=c()(t);return a("cut"),t};var l=function(t){var [...]
\ No newline at end of file
diff --git a/docs/assets/js/clipboard_init.js b/docs/assets/js/clipboard_init.js
new file mode 100644
index 0000000..64fbda4
--- /dev/null
+++ b/docs/assets/js/clipboard_init.js
@@ -0,0 +1 @@
+new ClipboardJS(".btn[data-clipboard-target]");
diff --git a/docs/tutorial/custom_ui_tutorial.md b/docs/tutorial/custom_ui_tutorial.md
index deb9745..b2a9f22 100644
--- a/docs/tutorial/custom_ui_tutorial.md
+++ b/docs/tutorial/custom_ui_tutorial.md
@@ -575,7 +575,7 @@ the settings_local.py file for local development. Move or copy it to the
2. Run the following to create a Docker container called **custom-ui-tutorial**.
cd $HOME/custom_ui_tutorial_app
- docker run -d --name custom-ui-tutorial -p 8000:8000 -v "${PWD}:/extensions" -v "${PWD}/settings_local.py:/code/django_airavata/settings_local.py" machristie/airavata-django-portal
+ docker run --pull always -d --name custom-ui-tutorial -p 8000:8000 -v "${PWD}:/extensions" -v "${PWD}/settings_local.py:/code/django_airavata/settings_local.py" machristie/airavata-django-portal
3. Wait until the Docker container starts up. Go to <http://localhost:8000>
and when it loads and you see **Welcome to your new Wagtail site!**, then
you're ready to proceed to the next step.
@@ -742,6 +742,11 @@ Choose from 1, 2 [1]:
steps, but you can go ahead and copy and paste the following into
`gaussian_eigenvalues_view.py`:
+<button class="btn" data-clipboard-target="#gaussian_eigenvalues_view">
+ Copy to clipboard
+</button>
+
+<div id="gaussian_eigenvalues_view">
```python
import io
import os
@@ -804,6 +809,7 @@ class GaussianEigenvaluesViewProvider:
}
```
+</div>
5. Let's take a look at the implementation. First we added some imports at the
top:
diff --git a/mkdocs.yml b/mkdocs.yml
index 2da4025..644679c 100644
--- a/mkdocs.yml
+++ b/mkdocs.yml
@@ -25,6 +25,10 @@ theme: readthedocs
extra_css:
- assets/css/pymdownx.tabbed.css
+extra_javascript:
+ - assets/js/clipboard.min.js
+ - assets/js/clipboard_init.js
+
markdown_extensions:
- sane_lists # allow restarting numbering of ordered lists
- admonition