• Forum
  • Doc
  • Screenshots
  • Download
  • Donate
  • Contributors
  • Contact
  • Follow @phpfreechat
  • DEMO
  • Board index ‹ Version 1.x branch ‹ Feature Requests (v1.x)
  • Change font size
  • FAQ
  • Register
  • Login

Multiline input

This forum is now locked as we will no longer be developing the v1.x branch

Moderators: OldWolf, re*s.t.a.r.s.*2

Topic locked
2 posts • Page 1 of 1

Postby olabri » Tue Jan 13, 2009 2:24 pm

Thanks for a great chat!

I'm wondering about a thing though. If a user pastes in text over more than one line, is it possible to do that. I DO know that its easier to use input field than textarea, but maybe a button that submits the clipboard or something?
Last edited by olabri on Tue Jan 13, 2009 2:24 pm, edited 1 time in total.
olabri
Member
 
Posts: 14
Joined: Tue Jan 13, 2009 2:17 pm
Top

Postby olabri » Wed Jan 14, 2009 10:23 am

ok solved it myself

in chat.html.tpl, change
Code: Select all
     <input type="text"
               id="pfc_words"
               title="<?php echo _pfc("Enter your message here"); ?>"
               maxlength="<?php echo $max_text_len; ?>"/>

to
Code: Select all
<textarea rows=1 cols=120
               id="pfc_words"
               title="<?php echo _pfc("Enter your message here"); ?>"
           maxlength="<?php echo $max_text_len; ?>"/></textarea>

in pfcommand.class.php add the following to first lines of function ParseCommand($cmd_str, $one_parameter = false)

Code: Select all
if (strstr ($cmd_str,"/send"))
    {
        $cmd_str= str_replace(array("n","t"),array("[br]","[tab]"), $cmd_str);
    }

in data/public/js/pfclient.js
in parseMessage: function(msg) before

Code: Select all
 // try to parse smileys
    var smileys = this.res.getSmileyHash();

(around line 1500) add

Code: Select all
 
msg = msg.replace(/[br]/g, '<br>');
msg = msg.replace(/[tab]/g, ' ');

edit: removed tabs as well as they messed it up.
Last edited by olabri on Wed Jan 21, 2009 10:54 am, edited 1 time in total.
olabri
Member
 
Posts: 14
Joined: Tue Jan 13, 2009 2:17 pm
Top


Topic locked
2 posts • Page 1 of 1

Return to Feature Requests (v1.x)

Who is online

Users browsing this forum: No registered users and 5 guests

  • Board index
  • The team • Delete all board cookies • All times are UTC + 1 hour
Powered by phpBB® Forum Software © phpBB Group
Sign in
Wrong credentials
Sign up I forgot my password
.
jeu-gratuit.net | more partners
Fork me on GitHub