Request: counter for letters in entry-backend

Creating and modifying plugins.
Post Reply
lordcoffee
Regular
Posts: 308
Joined: Tue Nov 29, 2005 10:22 pm
Location: Munich - Germany
Contact:

Request: counter for letters in entry-backend

Post by lordcoffee »

Hi!

I've found nothing like that so here's what I'm searching for:
I desided to truncate the entries in the overview to 250 letters. It's just a design thing for better looking. And what I wanted is when I'm writing an entry there will be letter-counter while I'm typing. Is that possible?

Thanks, lordcoffee
judebert
Regular
Posts: 2478
Joined: Sat Oct 15, 2005 6:57 am
Location: Orlando, FL
Contact:

Post by judebert »

You'd need some kind of Javascript to count the letters. I suppose it could be added to a plugin, but then the display would be odd; you'd have to check the output and add the character counter after the textarea.

I'd recommend modifying the Javascript to add the input directly instead.
Judebert
---
Website | Wishlist | PayPal
judebert
Regular
Posts: 2478
Joined: Sat Oct 15, 2005 6:57 am
Location: Orlando, FL
Contact:

Post by judebert »

Hmmm... if you're willing to have the character count between the toolbar and the textarea, you could hook backend_entry_toolbar_body (for the serendipity[body] textarea) and backend_entry_toolbar_extended (for the serendipity[extended] textarea).

You could also edit the template's admin/entries.tpl to insert the count field.

This is starting to look more reasonable the more I look at it.
Judebert
---
Website | Wishlist | PayPal
lordcoffee
Regular
Posts: 308
Joined: Tue Nov 29, 2005 10:22 pm
Location: Munich - Germany
Contact:

Post by lordcoffee »

Thanks! I'll have a lokk at it. When I'm done or stucking I'm reporting ;-)
Post Reply