Dropping show_char_left

This commit is contained in:
Julien Palard 2023-04-21 09:38:10 +02:00
parent 2ec9baa0b1
commit e03b8635dd
Signed by: mdk
GPG Key ID: 0EFC1AC1006886F8
6 changed files with 0 additions and 46 deletions

File diff suppressed because one or more lines are too long

View File

@ -1,19 +0,0 @@
/*
* ----------------------------------------------------------------------------
* "THE BEER-WARE LICENSE" (Revision 42):
* <jevin9@gmail.com> wrote this file. As long as you retain this notice you
* can do whatever you want with this stuff. If we meet some day, and you think
* this stuff is worth it, you can buy me a beer in return. Jevin O. Sewaruth
* ----------------------------------------------------------------------------
*
* Autogrow Textarea Plugin Version v3.0
* http://www.technoreply.com/autogrow-textarea-plugin-3-0
*
* THIS PLUGIN IS DELIVERD ON A PAY WHAT YOU WHANT BASIS. IF THE PLUGIN WAS USEFUL TO YOU, PLEASE CONSIDER BUYING THE PLUGIN HERE :
* https://sites.fastspring.com/technoreply/instant/autogrowtextareaplugin
*
* Date: October 15, 2012
*/
jQuery.fn.autoGrow=function(){return this.each(function(){var createMirror=function(textarea){jQuery(textarea).after('<div class="autogrow-textarea-mirror"></div>');return jQuery(textarea).next(".autogrow-textarea-mirror")[0]};var sendContentToMirror=function(textarea){mirror.innerHTML=String(textarea.value).replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\n/g,"<br />")+".<br/>.";if(jQuery(textarea).height()!=jQuery(mirror).height())jQuery(textarea).height(jQuery(mirror).height())};
var growTextarea=function(){sendContentToMirror(this)};var mirror=createMirror(this);mirror.style.display="none";mirror.style.wordWrap="break-word";mirror.style.padding=jQuery(this).css("padding");mirror.style.width=jQuery(this).css("width");mirror.style.fontFamily=jQuery(this).css("font-family");mirror.style.fontSize=jQuery(this).css("font-size");mirror.style.lineHeight=jQuery(this).css("line-height");this.style.overflow="hidden";this.style.minHeight=this.rows+"em";this.onkeyup=growTextarea;sendContentToMirror(this)})};

View File

@ -1,10 +0,0 @@
function refresh_characters_left() {
var characters_left = parseInt(document.getElementById("max_characters").value) - $('#id_content').val().length;
$('b#charsleft_counter').html(characters_left);
}
$(document).ready(function() {
refresh_characters_left();
});
$('#id_content').keyup(function() {
refresh_characters_left();
})

View File

@ -30,8 +30,5 @@
{% block content %}{% endblock %}
</div>
{% block javascript %}{% endblock %}
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js" integrity="sha384-smHYKdLADwkXOn1EmN1qk/HfnUcbVRZyYmZ4qpPea6sjB/pTJ0euyQp0Mk8ck+5T" crossorigin="anonymous"></script>
</body>
</html>

View File

@ -7,9 +7,6 @@
<form method="post" action="{% url 'index' %}">
{{ form.non_field_errors }}
<div class="form-group">
{% if PASTE.show_char_left %}
<span id="charsleft"><b id="charsleft_counter">...</b>&nbsp;{% trans 'characters left' %}</span>
{% endif %}
<label for="id_content">{% trans 'Content' %}</label>
{{ form.content|add_class:"form-control"}}
{{ form.content.errors }}
@ -83,8 +80,3 @@
</div>
</div>
{% endblock %}
{% block javascript %}
{% if PASTE.show_char_left %}
<script type="text/javascript" src="/static/js/paste.js"></script>
{% endif %}
{% endblock %}

View File

@ -94,7 +94,6 @@ PASTE = {
"has_title": False,
"has_expire_by_views": False,
"has_meta_table": False,
"show_char_left": False,
"enabled_renderers": ["pygments", "raw"],
"default_renderer": "pygments",
"max_characters": 100000,