Action: CharCount

Compatible with: R4.2
Current version:
Credits: The CharCount-Code makes part of the WikkaWiki-Messaging-System called WikkaMail written by GmBowen, "extracted" by AhA

{{charcount max=[number]}}


/actions/charcount.php


<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function textCounter(field, countfield, maxlimit) {
if (field.value.length > maxlimit) // if too long...trim it!
field.value = field.value.substring(0, maxlimit);
// otherwise, update 'characters left' counter
else
countfield.value = maxlimit - field.value.length;
}
// End -->
</script>

<?php
// send a new message to a user
if (!$max) {$max "2000";}
{

 echo 
"<form name='myform'>";

 echo 
"<textarea rows='16' cols='80' name='message'
onKeyDown=\"textCounter(this.form.message,this.form.remLen,
$max);\"
onKeyUp=\"textCounter(this.form.message,this.form.remLen,
$max);\"></textarea><br
/><input readonly type='text' name='remLen' size='4' maxlength='4'
value='
$max'> Zeichen übrig.";

 echo 
"</form>";

}
?>

Documentation

CharCount: While typing into the input field it counts down from a set number of characters. Count includes empty space between words. Useful, for example if you compose an article to fit a given length of text.


How to

Localization (optional)

put this at the end of your language file


/lang/wakka.xyz.php

//hacks
"YourPhrase" => "your translation here",


pls. notice that this entry will not survive an Wacko upgrade, so you have to redo this


[xyz] proposed translations
[de] ...
[fr]
[ru]

To Do

  • tranlate in English

Comments

nur wo und wie verwenden -> da müsste man noch die Möglichkeit haben den
Text z.B. als Kommentar übergeben zu können oder man fügt es schlicht
als Zähler in die Lesezeichen oder einfach nur so(?)


Optionen für Übergabe:
– informiert nur
– erzwingt -> schneidet dann ab


Referring pages:

  1. Dev/PatchesHacks