[Phpfreechat-svn] SF.net SVN: phpfreechat:[1262] trunk/data/public/js/pfcclient.js
Status: Beta
Brought to you by:
kerphi
From: <ke...@us...> - 2009-04-25 11:58:31
|
Revision: 1262 http://phpfreechat.svn.sourceforge.net/phpfreechat/?rev=1262&view=rev Author: kerphi Date: 2009-04-25 11:58:21 +0000 (Sat, 25 Apr 2009) Log Message: ----------- Makes more flexible the users list customization (example: change the little icon, modify the nicknames styles) Modified Paths: -------------- trunk/data/public/js/pfcclient.js Modified: trunk/data/public/js/pfcclient.js =================================================================== --- trunk/data/public/js/pfcclient.js 2009-04-25 11:09:31 UTC (rev 1261) +++ trunk/data/public/js/pfcclient.js 2009-04-25 11:58:21 UTC (rev 1262) @@ -1398,6 +1398,26 @@ this.nickwhoisbox.set(nickid, div); }, + buildNickItem_create_image: function(nickid) + { + var className = (! is_ie) ? 'class' : 'className'; + var isadmin = this.getUserMeta(nickid, 'isadmin'); + 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(className, 'pfc_nickbutton'); + return img; + }, + + buildNickItem_modify_nick_style: function(nickid, span) + { + // this method can be overloaded to change the nick style (color, font ...) + // example: span.style.color = 'red'; + }, + buildNickItem: function(nickid) { var className = (! is_ie) ? 'class' : 'className'; @@ -1424,14 +1444,8 @@ } 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(className, 'pfc_nickbutton'); - a.appendChild(img); + var img = this.buildNickItem_create_image(nickid); + if (img) a.appendChild(img); // nobr is not xhtml valid but it's a workeround // for IE which doesn't support 'white-space: pre' css rule @@ -1439,6 +1453,7 @@ var span = document.createElement('span'); span.setAttribute(className, 'pfc_nickmarker pfc_nick_'+nickid); span.innerHTML = nick.escapeHTML(); + this.buildNickItem_modify_nick_style(nickid, span); nobr.appendChild(span); a.appendChild(nobr); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |