WackoWiki : Dev/PatchesHacks/CharCount

Action: CharCount

Current version:
Credits: The CharCount-Code makes part of the WikkaWiki-Messaging-System called WikkaMail written by GmBowen, “extracted” bei AhA, editable variable added by Skipper
Оглавление документа
{{charcount max=[number]}}

/actions/charcount.php
<?php
<SCRIPT LANGUAGE="JavaScript">
<!-- 
Begin
function textCounter(fieldcountfieldmaxlimit) {
if (
field.value.length maxlimit// if too long...trim it!
field.value field.value.substring(0maxlimit);
// 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 &uuml;brig."
;

 echo 
"</form>";

}
?>
?>

Documentation

Char Count: 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


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

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

Страницы, ссылающиеся на данную: Dev/PatchesHacks
Dev/PatchesHacks/CharCount