Copy url button

This commit is contained in:
Martin Mahner 2016-12-02 14:44:12 +01:00
parent d765a0ccda
commit 335fa38ab1
4 changed files with 33 additions and 1 deletions

File diff suppressed because one or more lines are too long

View file

@ -63,6 +63,20 @@ tt strong {
color: #5393b4; color: #5393b4;
} }
input.headline-url {
font-size: 20px;
height: 40px;
width: 210px;
color: #5393b4;
border: none;
box-shadow: none;
}
button.btn.headline-url-copy {
margin-top: -4px;
padding: 5px 10px 3px 10px;
}
h1, h2, h3, h4 { h1, h2, h3, h4 {
font-weight: 300; font-weight: 300;
} }

View file

@ -19,7 +19,9 @@
<li class="{% block dpaste_nav_history %}{% endblock %}"><a href="{% url "snippet_history" %}">{% trans "History" %}</a></li> <li class="{% block dpaste_nav_history %}{% endblock %}"><a href="{% url "snippet_history" %}">{% trans "History" %}</a></li>
<li class="{% block dpaste_nav_new %}{% endblock %}"><a href="{% url "snippet_new" %}">{% trans "New snippet" %} &rarr;</a></li> <li class="{% block dpaste_nav_new %}{% endblock %}"><a href="{% url "snippet_new" %}">{% trans "New snippet" %} &rarr;</a></li>
</ul> </ul>
{% block headline_wrapper %}
<h3 class="headline"><a href="{% url "snippet_new" %}">{% block headline %}{% endblock %}</a></h3> <h3 class="headline"><a href="{% url "snippet_new" %}">{% block headline %}{% endblock %}</a></h3>
{% endblock %}
</header> </header>
{% block page %} {% block page %}
PAGE MISSING PAGE MISSING
@ -28,8 +30,10 @@
{% block script_footer %} {% block script_footer %}
<script src="{{ jquery_url }}"></script> <script src="{{ jquery_url }}"></script>
<script src="{% static "dpaste/clipboardjs.min.js" %}"></script>
<script> <script>
jQuery(function($) { jQuery(function($) {
new Clipboard('.clip-button');
$('.autofocus textarea:first').focus(); $('.autofocus textarea:first').focus();
$('.superenter textarea').on('keydown', function(e){ $('.superenter textarea').on('keydown', function(e){
var metaKey; var metaKey;

View file

@ -5,7 +5,14 @@
{% load dpaste_tags %} {% load dpaste_tags %}
{% block title %}{% trans "Snippet" %} #{{ snippet.pk }}{% endblock %} {% block title %}{% trans "Snippet" %} #{{ snippet.pk }}{% endblock %}
{% block headline %}{% trans "Snippet" %} #{{ snippet.pk }}{% endblock %} {% block headline_wrapper %}
<input id="headline-url" class="headline-url" type="text" value="{{ request.build_absolute_uri }}"/>
<button class="btn clip-button headline-url-copy" data-clipboard-target="#headline-url">
<svg width="18" height="24" viewBox="0 0 1024 896" xmlns="http://www.w3.org/2000/svg">
<path d="M128 768h256v64H128v-64z m320-384H128v64h320v-64z m128 192V448L384 640l192 192V704h320V576H576z m-288-64H128v64h160v-64zM128 704h160v-64H128v64z m576 64h64v128c-1 18-7 33-19 45s-27 18-45 19H64c-35 0-64-29-64-64V192c0-35 29-64 64-64h192C256 57 313 0 384 0s128 57 128 128h192c35 0 64 29 64 64v320h-64V320H64v576h640V768zM128 256h512c0-35-29-64-64-64h-64c-35 0-64-29-64-64s-29-64-64-64-64 29-64 64-29 64-64 64h-64c-35 0-64 29-64 64z" />
</svg>
</button>
{% endblock %}
{% block page %} {% block page %}