[Jifty-commit] r1051 - in jifty/branches/jifty-jsan: share/web/static/js/jsan

jifty-commit at lists.jifty.org jifty-commit at lists.jifty.org
Sat May 13 17:46:54 EDT 2006


Author: trs
Date: Sat May 13 17:46:54 2006
New Revision: 1051

Modified:
   jifty/branches/jifty-jsan/   (props changed)
   jifty/branches/jifty-jsan/share/web/static/js/jsan/JSAN.js

Log:
 r12281 at zot:  tom | 2006-05-13 17:30:28 -0400
 Compat with Konq


Modified: jifty/branches/jifty-jsan/share/web/static/js/jsan/JSAN.js
==============================================================================
--- jifty/branches/jifty-jsan/share/web/static/js/jsan/JSAN.js	(original)
+++ jifty/branches/jifty-jsan/share/web/static/js/jsan/JSAN.js	Sat May 13 17:46:54 2006
@@ -1,10 +1,17 @@
 /*
+ * This is not a stock JSAN.js.  To increase browser compatibility,
+ * s/'/"/g has been applied to the file and the range of valid response
+ * codes for JSAN.Request has been expanded (lifted from Prototype, in
+ * fact).
+ */
+
+/*
 
 */
 
 var JSAN = function () { JSAN.addRepository(arguments) };
 
-JSAN.VERSION = "0.10-jifty1";
+JSAN.VERSION = "0.10-jifty2";
 
 /*
 
@@ -273,7 +280,7 @@
         this._req.open("GET", url, false);
         try {
             this._req.send(null);
-            if (this._req.status == 200 || this._req.status == 0)
+            if ( this.responseIsSuccess() )
                 return this._req.responseText;
         } catch (e) {
             JSAN._handleError("File not found: " + url);
@@ -282,6 +289,12 @@
 
         JSAN._handleError("File not found: " + url);
         return null;
+    },
+
+    responseIsSuccess: function() {
+        return this._req.status == undefined
+            || this._req.status == 0
+            || (this._req.status >= 200 && this._req.status < 300);
     }
 };
 


More information about the Jifty-commit mailing list