Thread: [Phpfreechat-svn] SF.net SVN: phpfreechat: [963] trunk/demo/demo34_add_a_link_on_nicknames/ mytheme
Status: Beta
Brought to you by:
kerphi
From: <ke...@us...> - 2007-02-16 20:44:05
|
Revision: 963 http://svn.sourceforge.net/phpfreechat/?rev=963&view=rev Author: kerphi Date: 2007-02-16 12:44:05 -0800 (Fri, 16 Feb 2007) Log Message: ----------- rename to be ok with refactoring Added Paths: ----------- trunk/demo/demo34_add_a_link_on_nicknames/mytheme/customize.js.php Removed Paths: ------------- trunk/demo/demo34_add_a_link_on_nicknames/mytheme/customize.js Deleted: trunk/demo/demo34_add_a_link_on_nicknames/mytheme/customize.js =================================================================== --- trunk/demo/demo34_add_a_link_on_nicknames/mytheme/customize.js 2007-02-16 20:43:01 UTC (rev 962) +++ trunk/demo/demo34_add_a_link_on_nicknames/mytheme/customize.js 2007-02-16 20:44:05 UTC (rev 963) @@ -1,61 +0,0 @@ -pfcClient.prototype.updateNickList = function(tabid,lst) -{ - this.nicklist[tabid] = lst; - var nicks = lst; - var nickdiv = this.gui.getOnlineContentFromTabId(tabid).firstChild; - var ul = document.createElement('ul'); - for (var i=0; i<nicks.length; i++) - { - var li = document.createElement('li'); - if (nicks[i] != this.nickname) - { - // this is someone -> create a privmsg link - var img = document.createElement('img'); - img.setAttribute('src', this.res.getFileUrl('images/user.gif')); - img.alt = this.res.getLabel('Private message'); - img.title = img.alt; - img.style.marginRight = '5px'; - var a = document.createElement('a'); - a.setAttribute('href', ''); - a.pfc_nick = nicks[i]; - a.onclick = function(){pfc.sendRequest('/privmsg "'+this.pfc_nick+'"'); return false;} - a.appendChild(img); - li.appendChild(a); - } - else - { - // this is myself -> do not create a privmsg link - var img = document.createElement('img'); - img.setAttribute('src', this.res.getFileUrl('images/user-me.gif')); - img.alt = ''; - img.title = img.alt; - img.style.marginRight = '5px'; - li.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 a = document.createElement('a'); - a.pfc_nick = nicks[i]; - a.setAttribute('href','http://www.google.com/search?q='+nicks[i]); - a.setAttribute('target','_blank'); - //a.onclick = function(){pfc.insert_text(this.pfc_nick+", ","",false); return false;} - a.appendChild(document.createTextNode(nicks[i])); - a.setAttribute('class', 'pfc_nickmarker pfc_nick_'+ hex_md5(_to_utf8(nicks[i]))); - a.setAttribute('className', 'pfc_nickmarker pfc_nick_'+ hex_md5(_to_utf8(nicks[i]))); // for IE6 - - nobr.appendChild(a); - li.appendChild(nobr); - li.style.borderBottom = '1px solid #AAA'; - - ul.appendChild(li); - } - var fc = nickdiv.firstChild; - if (fc) - nickdiv.replaceChild(ul,fc); - else - nickdiv.appendChild(ul,fc); - this.colorizeNicks(nickdiv); -} Copied: trunk/demo/demo34_add_a_link_on_nicknames/mytheme/customize.js.php (from rev 960, trunk/demo/demo34_add_a_link_on_nicknames/mytheme/customize.js) =================================================================== --- trunk/demo/demo34_add_a_link_on_nicknames/mytheme/customize.js.php (rev 0) +++ trunk/demo/demo34_add_a_link_on_nicknames/mytheme/customize.js.php 2007-02-16 20:44:05 UTC (rev 963) @@ -0,0 +1,61 @@ +pfcClient.prototype.updateNickList = function(tabid,lst) +{ + this.nicklist[tabid] = lst; + var nicks = lst; + var nickdiv = this.gui.getOnlineContentFromTabId(tabid).firstChild; + var ul = document.createElement('ul'); + for (var i=0; i<nicks.length; i++) + { + var li = document.createElement('li'); + if (nicks[i] != this.nickname) + { + // this is someone -> create a privmsg link + var img = document.createElement('img'); + img.setAttribute('src', this.res.getFileUrl('images/user.gif')); + img.alt = this.res.getLabel('Private message'); + img.title = img.alt; + img.style.marginRight = '5px'; + var a = document.createElement('a'); + a.setAttribute('href', ''); + a.pfc_nick = nicks[i]; + a.onclick = function(){pfc.sendRequest('/privmsg "'+this.pfc_nick+'"'); return false;} + a.appendChild(img); + li.appendChild(a); + } + else + { + // this is myself -> do not create a privmsg link + var img = document.createElement('img'); + img.setAttribute('src', this.res.getFileUrl('images/user-me.gif')); + img.alt = ''; + img.title = img.alt; + img.style.marginRight = '5px'; + li.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 a = document.createElement('a'); + a.pfc_nick = nicks[i]; + a.setAttribute('href','http://www.google.com/search?q='+nicks[i]); + a.setAttribute('target','_blank'); + //a.onclick = function(){pfc.insert_text(this.pfc_nick+", ","",false); return false;} + a.appendChild(document.createTextNode(nicks[i])); + a.setAttribute('class', 'pfc_nickmarker pfc_nick_'+ hex_md5(_to_utf8(nicks[i]))); + a.setAttribute('className', 'pfc_nickmarker pfc_nick_'+ hex_md5(_to_utf8(nicks[i]))); // for IE6 + + nobr.appendChild(a); + li.appendChild(nobr); + li.style.borderBottom = '1px solid #AAA'; + + ul.appendChild(li); + } + var fc = nickdiv.firstChild; + if (fc) + nickdiv.replaceChild(ul,fc); + else + nickdiv.appendChild(ul,fc); + this.colorizeNicks(nickdiv); +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |