[Phpfreechat-svn] SF.net SVN: phpfreechat: [844] trunk/src/client/pfcclient.js
Status: Beta
Brought to you by:
kerphi
From: <ke...@us...> - 2006-10-26 08:24:02
|
Revision: 844 http://svn.sourceforge.net/phpfreechat/?rev=844&view=rev Author: kerphi Date: 2006-10-26 01:23:57 -0700 (Thu, 26 Oct 2006) Log Message: ----------- [en] The nicknames in the list are clickable for opening the whois box. [10min] [fr] Les pseudonymes de la liste sont maintenant clickables et ouvrent la boite whois. [10min] Modified Paths: -------------- trunk/src/client/pfcclient.js Modified: trunk/src/client/pfcclient.js =================================================================== --- trunk/src/client/pfcclient.js 2006-10-25 12:13:20 UTC (rev 843) +++ trunk/src/client/pfcclient.js 2006-10-26 08:23:57 UTC (rev 844) @@ -1030,19 +1030,15 @@ var nick = this.getUserMeta(nickid, 'nick'); var isadmin = this.getUserMeta(nickid, 'isadmin'); if (isadmin == '') isadmin = false; + var li = document.createElement('li'); + li.style.borderBottom = '1px solid #AAA'; - var img = document.createElement('img'); - if (isadmin) - img.setAttribute('src', this.res.getFileUrl('images/user-admin.gif')); - else - img.setAttribute('src', this.res.getFileUrl('images/user.gif')); - img.style.marginRight = '5px'; - img.setAttribute('class', 'pfc_nickbutton'); - img.setAttribute('className', 'pfc_nickbutton'); // for IE6 - img.pfc_nick = nick; - img.pfc_nickid = nickid; - img.onclick = function(evt){ + var a = document.createElement('a'); + a.setAttribute('href','#'); + a.pfc_nick = nick; + a.pfc_nickid = nickid; + a.onclick = function(evt){ var d = pfc.getNickWhoisBox(this.pfc_nickid); document.body.appendChild(d); d.style.display = 'block'; @@ -1052,22 +1048,29 @@ d.style.top = (mousePosY(evt)-5)+'px'; return false; } - li.appendChild(img); + li.appendChild(a); - + + var img = document.createElement('img'); + if (isadmin) + img.setAttribute('src', this.res.getFileUrl('images/user-admin.gif')); + else + img.setAttribute('src', this.res.getFileUrl('images/user.gif')); + img.style.marginRight = '5px'; + img.setAttribute('class', 'pfc_nickbutton'); + img.setAttribute('className', 'pfc_nickbutton'); // for IE6 + a.appendChild(img); + // nobr is not xhtml valid but it's a workeround // for IE which doesn't support 'white-space: pre' css rule var nobr = document.createElement('nobr'); var span = document.createElement('span'); span.setAttribute('class', 'pfc_nickmarker pfc_nick_'+nickid); span.setAttribute('className', 'pfc_nickmarker pfc_nick_'+nickid); // for IE6 - span.pfc_nick = nick; - span.pfc_nickid = nickid; - span.onclick = function(){pfc.insert_text(this.pfc_nick+", ","",false); return false;} span.appendChild(document.createTextNode(nick)); nobr.appendChild(span); - li.appendChild(nobr); - li.style.borderBottom = '1px solid #AAA'; + a.appendChild(nobr); + return li; }, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |