From fbf77b4493f1b77c99751d8a86365c712ae3fb1b Mon Sep 17 00:00:00 2001
From: thomascube <thomas@roundcube.net>
Date: Fri, 18 Nov 2005 10:35:15 -0500
Subject: [PATCH] Added Japanese localization

---
 program/js/common.js |   32 ++++++++++++++++++++++++++++----
 1 files changed, 28 insertions(+), 4 deletions(-)

diff --git a/program/js/common.js b/program/js/common.js
index 5263a87..0c9917a 100644
--- a/program/js/common.js
+++ b/program/js/common.js
@@ -6,7 +6,7 @@
  | Copyright (C) 2005, RoundCube Dev, - Switzerland                      |
  | Licensed under the GNU GPL                                            |
  |                                                                       |
- | Modified: 19.08.2005 (tbr)                                            |
+ | Modified:2005/11/06 (roundcube)                                       |
  |                                                                       |
  +-----------------------------------------------------------------------+
  | Author: Thomas Bruederli <roundcube@gmail.com>                        |
@@ -47,8 +47,8 @@
   this.ns4 = (this.ns && parseInt(this.ver)==4);
   this.ns6 = (this.ns && parseInt(this.vendver)==6);  // (this.mz && this.ns) ? true : false;
   this.ns7 = (this.ns && parseInt(this.vendver)==7);  // this.agent.indexOf('Netscape/7')>0);
-  this.safari = this.agent.toLowerCase().indexOf('safari')>0;
-  this.konq   = (this.agent.toLowerCase().indexOf('konqueror')>0); 
+  this.safari = (this.agent.toLowerCase().indexOf('safari')>0 || this.agent.toLowerCase().indexOf('applewebkit')>0);
+  this.konq   = (this.agent.toLowerCase().indexOf('konqueror')>0);
 
   this.opera = (window.opera) ? true : false;
   this.opera5 = (this.opera5 && this.agent.indexOf('Opera 5')>0) ? true : false;
@@ -58,11 +58,14 @@
   if(this.opera && window.RegExp)
     this.vendver = (/opera(\s|\/)([0-9\.]+)/i.test(navigator.userAgent)) ? parseFloat(RegExp.$2) : -1;
   else if(!this.vendver && this.safari)
-    this.vendver = (/safari\/([0-9]+)/i.test(this.agent)) ? parseInt(RegExp.$1) : 0;
+    this.vendver = (/(safari|applewebkit)\/([0-9]+)/i.test(this.agent)) ? parseInt(RegExp.$2) : 0;
   else if((!this.vendver && this.mz) || this.agent.indexOf('Camino')>0)
     this.vendver = (/rv:([0-9\.]+)/.test(this.agent)) ? parseFloat(RegExp.$1) : 0;
   else if(this.ie && window.RegExp)
     this.vendver = (/msie\s+([0-9\.]+)/i.test(this.agent)) ? parseFloat(RegExp.$1) : 0;
+  else if(this.konq && window.RegExp)
+    this.vendver = (/khtml\/([0-9\.]+)/i.test(this.agent)) ? parseFloat(RegExp.$1) : 0;
+
 
   // get real language out of safari's user agent
   if(this.safari && (/;\s+([a-z]{2})-[a-z]{2}\)/i.test(this.agent)))
@@ -78,6 +81,14 @@
                    (this.ie && this.win && this.vendver>=5.5) || this.safari);
   this.opacity = (this.mz || (this.ie && this.vendver>=5.5 && !this.opera) || (this.safari && this.vendver>=100));
   this.cookies = navigator.cookieEnabled;
+  
+  // test for XMLHTTP support
+  this.xmlhttp_test = function()
+    {
+    var activeX_test = new Function("try{var o=new ActiveXObject('Microsoft.XMLHTTP');return true;}catch(err){return false;}");
+    this.xmlhttp = (window.XMLHttpRequest || (window.ActiveXObject && activeX_test())) ? true : false;
+    return this.xmlhttp;
+    }
   }
 
 
@@ -253,6 +264,19 @@
   }
 
 
+// check if input is a valid email address
+function rcube_check_email(input, inline)
+  {
+  if (input && window.RegExp)
+    {
+    var reg_str = '([a-z0-9][-a-z0-9\.\+_]*)\@([a-z0-9]([-a-z0-9][\.]?)*[a-z0-9]\.[a-z]{2,9})';
+    var reg1 = inline ? new RegExp(reg_str, 'i') : new RegExp('^'+reg_str+'$', 'i');
+    var reg2 = /[\._\-\@]{2}/;
+    return reg1.test(input) && !reg2.test(input) ? true : false;
+    }
+  return false;
+  }
+  
 
 // find a value in a specific array and returns the index
 function find_in_array()

--
Gitblit v1.9.1