Admin Word Count

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
Anywhere in a settings.TEMPLATE_DIRS directory:

# ./admin/<app>/change_form.html:
****************************************************

{% block extrahead %}
  {{ block.super }}
  <style>label b{font-weight:normal;font-size:0.75em;color:#888;display:block;margin-top:120px;}</style>
  <script type="text/javascript">
    
    django.jQuery(document).ready(function(){
        django.jQuery('#id_body').keypress(function(){
            django.jQuery('label[for=id_body]').html("Body:<b>Word count: " + this.value.split(" ").length + "</b>");
        });
    });
  </script>
{% endblock %}

More like this

  1. truncatehtml_at_word by zakj 5 years, 5 months ago
  2. Truncate string after a given number of chars keeping whole words by rix 5 years, 4 months ago
  3. Truncate words by characters by trodrigues 5 years, 11 months ago
  4. Clean text pasted from word into RTE by rodrigoc 4 years, 10 months ago
  5. Audit word filter by shinyzhu 4 years, 2 months ago

Comments

(Forgotten your password?)