[Beta] Dynamic Textarea

In diesem Forum können Mod-Autoren ihre Mods vorstellen, die sich noch im Entwicklungsstatus befinden. Der Einbau in Foren im produktiven Betrieb wird nicht empfohlen.
Forumsregeln
phpBB 2.0 hat das Ende seiner Lebenszeit überschritten
phpBB 2.0 wird nicht mehr aktiv unterstützt. Insbesondere werden - auch bei Sicherheitslücken - keine Patches mehr bereitgestellt. Der Einsatz von phpBB 2.0 erfolgt daher auf eigene Gefahr. Wir empfehlen einen Umstieg auf phpBB 3.0, welches aktiv weiterentwickelt wird und für welches regelmäßig Updates zur Verfügung gestellt werden.
Antworten
John Doe
Mitglied
Beiträge: 684
Registriert: 30.03.2005 01:06

[Beta] Dynamic Textarea

Beitrag von John Doe »

Da mich das Scrollen in längeren Postings in der Textarea genervt hab, hab ich für mich was zusammengebastelt.
Evtl kann das ja auch jemand gebrauchen.

Code: Alles auswählen

##############################################################
## MOD Title:   Dynamic Textarea
## MOD Author:  John Doe < smartie2004@freenet.de > (Kai Z.) N/A
## MOD Description:
##   This mod resizes the textarea while typing the message,
##   so there is no scrolling in larger messages.
## MOD Version: 0.0.1
##
## Installation Level: easy
## Installation Time:  2 Minutes
## Files To Edit:
##   overall_header.tpl
##   
##
## Included Files: N/A
##############################################################
## Author Notes:
##
## This mod based on a script by Paul Tuckey. (http://tuckey.org/)
##
## Important!
## If you are already using a script with window.onload=dothis()
## or <body onload="dothat()"> there will be possibly a conflict.
##
## Solution:
##
## change your scripts like this: <body onload="dothis();dothat()">
## regardless if they are called in the <body> tag or window.onload.
## 
##
##############################################################
## MOD History:
##
##   2005-10-22 - Version 0.0.1
##      - first release
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/overall_header.tpl
#
#-----[ FIND ]------------------------------------------
#
</head>
#
#-----[ BEFORE, ADD ]------------------------------------------
#
<script type="text/javascript">
<!--
function countLines(strtocount, cols) {
    var hard_lines = 5; // here you can change the height of the textarea
    var last = 0;
    while ( true ) {
        last = strtocount.indexOf("\n", last+1);
        hard_lines ++;
        if ( last == -1 ) break;
    }
    var soft_lines = Math.round(strtocount.length / (cols-1));
    var hard = eval("hard_lines  " + unescape("%3e") + "soft_lines;");
    if ( hard ) soft_lines = hard_lines;
    return soft_lines;
}
function cleanForm() {
    var the_form = document.forms[0];
    for ( var x in the_form ) {
        if ( ! the_form[x] ) continue;
        if( typeof the_form[x].rows != "number" ) continue;
        the_form[x].rows = countLines(the_form[x].value,the_form[x].cols) +1;
    }
    setTimeout("cleanForm();", 300);
}
// -->
</script>
#
#-----[ FIND ]------------------------------------------
#
<body
#
#-----[ IN-LINE FIND ]------------------------------------------
#
>
# 
#-----[ IN-LINE BEFORE, ADD ]------------------------------------------
#
 onload="cleanForm();"
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
JRK
Mitglied
Beiträge: 123
Registriert: 30.08.2004 17:10

Beitrag von JRK »

Hast du mal n Demolink, oder wenn du das nicht willst nur n Screen dazu?
Kann mir leider nix drunter vorstellen.
John Doe
Mitglied
Beiträge: 684
Registriert: 30.03.2005 01:06

Beitrag von John Doe »

Hab mal ein kleines Demovideo (200k) bei Rapidshare upgeloadet.

http://rapidshare.de/files/6749365/screen.avi.html

Auf den Free-download button klicken, ein paar Sekunden warten-downloaden.

Hab in der Demo einfach ein paar Returns eingegeben, anschliessend wieder
entfernt.

Falls noch Unklarheiten kann ich auch ein paar Scrrenshots machen.
JRK
Mitglied
Beiträge: 123
Registriert: 30.08.2004 17:10

Beitrag von JRK »

Nein keine weiteren Screens nötig, vielen Dank für den schönen Mod
DsMagic
Mitglied
Beiträge: 215
Registriert: 18.05.2005 07:10
Wohnort: Kerpen

Beitrag von DsMagic »

Hi , hast du Video auch in einem anderen format als avi. ???
Edit : Hat sich erledigt !!! Und danke für den mod .
Antworten

Zurück zu „phpBB 2.0: Mods in Entwicklung“