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

insert nick on click

Post a bug fix, a new feature, a theme ...

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

Post a reply
2 posts • Page 1 of 1

Postby void » Thu Apr 20, 2006 8:56 pm

Maybe, it's already done, but i do not find that in demos.
Just small modified demo34.

Code: Select all
pfcClient.prototype.updateNickList = function(lst)
{
  this.nicklist = lst;
  var nicks   = lst;
  var nickdiv = this.el_online;
  var ul = document.createElement('ul');
  for (var i=0; i<nicks.length; i++)
  {
    var li = document.createElement('li');
    var a = document.createElement('a');
    a.setAttribute('class', '<?php echo $prefix; ?>nickmarker <?php echo $prefix; ?>nick_'+ hex_md5(nicks[i]));
    a.setAttribute('onClick','pfcClient.prototype.insert_text("'+nicks[i]+', ","");');
    var txt = document.createTextNode(nicks[i]);
    a.appendChild(txt);
    li.appendChild(a);
    ul.appendChild(li);
  }
  var fc = nickdiv.firstChild;
  if (fc)
    nickdiv.replaceChild(ul,fc);
  else
    nickdiv.appendChild(ul,fc);
  this.colorizeNicks(nickdiv);
}
void
New member
 
Posts: 1
Joined: Tue Apr 18, 2006 9:54 pm
Top

Postby phpfreechat » Thu Apr 20, 2006 9:27 pm

Thank you,
I just integrated your contribution (a bit modified) in the 1.x branche.
phpfreechat
Site Admin
 
Posts: 2657
Joined: Tue Feb 07, 2006 3:35 pm
Location: France
Top


Post a reply
2 posts • Page 1 of 1

Return to Contributions (v1.x)

Who is online

Users browsing this forum: No registered users and 16 guests

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