[Phpfreechat-svn] SF.net SVN: phpfreechat: [1104] trunk/data/public/js/pfcclient.js
Status: Beta
Brought to you by:
kerphi
From: <gpi...@us...> - 2007-08-09 01:07:13
|
Revision: 1104 http://phpfreechat.svn.sourceforge.net/phpfreechat/?rev=1104&view=rev Author: gpinzone Date: 2007-08-08 18:07:15 -0700 (Wed, 08 Aug 2007) Log Message: ----------- Got rid of buggy Safari detection method. Replaced other detection methods and variable names with the ones in prototype.js. Tested history function on Safari for Windows. Modified Paths: -------------- trunk/data/public/js/pfcclient.js Modified: trunk/data/public/js/pfcclient.js =================================================================== --- trunk/data/public/js/pfcclient.js 2007-08-08 22:15:04 UTC (rev 1103) +++ trunk/data/public/js/pfcclient.js 2007-08-09 01:07:15 UTC (rev 1104) @@ -1,9 +1,9 @@ -var is_ie = navigator.appName.match("Explorer"); -var is_khtml = navigator.appName.match("Konqueror") || navigator.appVersion.match("KHTML"); -var is_ff = navigator.appName.match("Netscape"); -var is_ie7 = navigator.userAgent.indexOf('MSIE 7') > 0; -var is_opera = window.opera; -var is_safari = document.childNodes && !document.all && !navigator.taintEnabled && !accentColorName; +var is_ie = window.attachEvent && !window.opera; +var is_khtml = navigator.appName.match("Konqueror") || navigator.appVersion.match("KHTML"); +var is_gecko = navigator.userAgent.indexOf('Gecko') > -1 && navigator.userAgent.indexOf('KHTML') == -1; +var is_ie7 = navigator.userAgent.indexOf('MSIE 7') > 0; +var is_opera = window.opera; +var is_webkit = navigator.userAgent.indexOf('AppleWebKit/') > -1; /** * This class is the client part of phpFreeChat @@ -630,7 +630,7 @@ { return this.doSendMessage(); } - else if (code == 63232 && is_safari) // up arrow key + else if (code == 63232 && is_webkit) // up arrow key { // write the last command in the history if (this.cmdhistory.length>0) @@ -644,7 +644,7 @@ w.value = this.cmdhistory[this.cmdhistoryid]; } } - else if (code == 63233 && is_safari) // down arrow key + else if (code == 63233 && is_webkit) // down arrow key { // write the next command in the history if (this.cmdhistory.length>0) @@ -680,7 +680,7 @@ this.completeNick(); return false; /* do not leave the tab key default behavior */ } - else if (code == 38 && (is_ff || is_ie || is_khtml || is_opera)) // up arrow key + else if (code == 38 && (is_gecko || is_ie || is_khtml || is_opera)) // up arrow key { // write the last command in the history if (this.cmdhistory.length>0) @@ -694,7 +694,7 @@ w.value = this.cmdhistory[this.cmdhistoryid]; } } - else if (code == 40 && (is_ff || is_ie || is_khtml || is_opera)) // down arrow key + else if (code == 40 && (is_gecko || is_ie || is_khtml || is_opera)) // down arrow key { // write the next command in the history if (this.cmdhistory.length>0) @@ -908,7 +908,7 @@ while (elt) { // delete this element to save browser memory - if (is_ff) + if (is_gecko) elt.innerHTML = ''; else // this code don't work in FF, why ? don't know .. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |