|
@@ -1,43 +1,6 @@
|
|
|
{% extends "base.html" %}
|
|
|
{% load static %}
|
|
|
|
|
|
-{% block head_extra %}
|
|
|
-<script>
|
|
|
-$(document).ready(function() {
|
|
|
- // Initialize the tooltip.
|
|
|
- $('#copy-button').tooltip();
|
|
|
-
|
|
|
- // When the copy button is clicked, select the value of the text box, attempt
|
|
|
- // to execute the copy command, and trigger event to update tooltip message
|
|
|
- // to indicate whether the text was successfully copied.
|
|
|
- $('#copy-button').bind('click', function() {
|
|
|
- var input = document.querySelector('#copy-input');
|
|
|
- input.setSelectionRange(0, input.value.length + 1);
|
|
|
- try {
|
|
|
- var success = document.execCommand('copy');
|
|
|
- if (success) {
|
|
|
- $('#copy-button').trigger('copied', ['Copied!']);
|
|
|
- } else {
|
|
|
- $('#copy-button').trigger('copied', ['Copy with Ctrl-c']);
|
|
|
- }
|
|
|
- } catch (err) {
|
|
|
- $('#copy-button').trigger('copied', ['Copy with Ctrl-c']);
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
- // Handler for updating the tooltip message.
|
|
|
- $('#copy-button').bind('copied', function(event, message) {
|
|
|
- $(this).attr('title', message)
|
|
|
- .tooltip('fixTitle')
|
|
|
- .tooltip('show')
|
|
|
- .attr('title', "Copy to Clipboard")
|
|
|
- .tooltip('fixTitle');
|
|
|
- });
|
|
|
-});
|
|
|
-</script>
|
|
|
-
|
|
|
-
|
|
|
-{% endblock %}
|
|
|
{% block title %}{{object.name}}{% endblock %}
|
|
|
|
|
|
{% block content %}
|
|
@@ -78,19 +41,13 @@ $(document).ready(function() {
|
|
|
{% endif %}
|
|
|
<h5>Retroarch command</h5>
|
|
|
<p>
|
|
|
- <form>
|
|
|
- <div class="input-group">
|
|
|
- <input type="text" class="form-control"
|
|
|
- value="{{object.cmd}}" placeholder="" id="copy-input">
|
|
|
- <span class="input-group-btn">
|
|
|
- <button class="btn btn-default" type="button" id="copy-button"
|
|
|
- data-toggle="tooltip" data-placement="button"
|
|
|
- title="Copy to Clipboard">
|
|
|
- Copy
|
|
|
- </button>
|
|
|
- </span>
|
|
|
- </div>
|
|
|
- </form>
|
|
|
+ <!-- Target -->
|
|
|
+ <input type="text" class="form-control" value="{{object.cmd}}" placeholder="" id="cmd" />
|
|
|
+
|
|
|
+ <!-- Trigger -->
|
|
|
+ <button class="btn" data-clipboard-target="#cmd">
|
|
|
+ <img src="assets/clippy.svg" alt="Copy to clipboard">
|
|
|
+ </button>
|
|
|
</p>
|
|
|
|
|
|
<p>{{object.description}}</p>
|