[Phpfreechat-svn] SF.net SVN: phpfreechat: [1114] trunk/data/public/js/pfcclient.js
Status: Beta
Brought to you by:
kerphi
From: <gpi...@us...> - 2007-08-11 00:22:37
|
Revision: 1114 http://phpfreechat.svn.sourceforge.net/phpfreechat/?rev=1114&view=rev Author: gpinzone Date: 2007-08-10 17:22:37 -0700 (Fri, 10 Aug 2007) Log Message: ----------- Nickname completion now works based on last space in string instead of only at the beginning of line. This more closely emulates IRC. However, nicknames with spaces may not work well. Modified Paths: -------------- trunk/data/public/js/pfcclient.js Modified: trunk/data/public/js/pfcclient.js =================================================================== --- trunk/data/public/js/pfcclient.js 2007-08-10 20:24:20 UTC (rev 1113) +++ trunk/data/public/js/pfcclient.js 2007-08-11 00:22:37 UTC (rev 1114) @@ -591,13 +591,28 @@ return false; }, + reverse: function(inp) + { + var outp = ''; + + for (var i = 0; i < inp.length; i++) + outp = inp.charAt(i) + outp; + + return outp; + }, + /** * Try to complete a nickname like on IRC when pressing the TAB key + * Nicks with spaces may not work under certain circumstances + * Note: IRC does not allow nicks with spaces */ completeNick: function() { var w = this.el_words; - var nick_src = w.value; + var last_space = w.value.lastIndexOf(' '); + var nick_src = w.value.substring(last_space+1, w.value.length); + var non_nick_src = w.value.substring(0,last_space+1); + if (nick_src != '') { var tabid = this.gui.getTabId(); @@ -628,7 +643,7 @@ } } if (nick_match) - w.value = w.value.replace(nick_src, nick_replace); + w.value = non_nick_src + nick_src.replace(nick_src, nick_replace); } }, /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |