couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kxe...@apache.org
Subject [46/50] jquery-couch commit: updated refs/heads/import-master to 66dbcbf
Date Tue, 01 Apr 2014 08:52:51 GMT
Fix compatibility with jQuery 1.9+

$.browser is gone there, but still we have to disable cache for MSIE.

COUCHDB-1668


Project: http://git-wip-us.apache.org/repos/asf/couchdb-jquery-couch/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-jquery-couch/commit/b99d71ee
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-jquery-couch/tree/b99d71ee
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-jquery-couch/diff/b99d71ee

Branch: refs/heads/import-master
Commit: b99d71eed2542e8839655cda831168d383fd4f90
Parents: 1dbeb76
Author: Alexander Shorin <kxepal@apache.org>
Authored: Sun Dec 8 20:32:53 2013 +0400
Committer: Alexander Shorin <kxepal@gmail.com>
Committed: Sun Dec 8 20:32:53 2013 +0400

----------------------------------------------------------------------
 jquery.couch.js | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-jquery-couch/blob/b99d71ee/jquery.couch.js
----------------------------------------------------------------------
diff --git a/jquery.couch.js b/jquery.couch.js
index b7e36f9..db4e8ef 100644
--- a/jquery.couch.js
+++ b/jquery.couch.js
@@ -977,7 +977,7 @@
     errorMessage = errorMessage || "Unknown error";
     timeStart = (new Date()).getTime();
     $.ajax($.extend($.extend({
-      type: "GET", dataType: "json", cache : !$.browser.msie,
+      type: "GET", dataType: "json", cache : maybeUseCache(),
       beforeSend: function(xhr){
         if(ajaxOptions && ajaxOptions.headers){
           for (var header in ajaxOptions.headers){
@@ -1058,4 +1058,17 @@
     return obj !== null ? JSON.stringify(obj) : null;
   }
 
+  /**
+   * @private
+   */
+  function maybeUseCache() {
+    if (!navigator){
+      return true;
+    }
+    else if (/(MSIE|Trident)/.test(navigator.userAgent)){
+      return false;
+    }
+    return true;
+  }
+
 })(jQuery);


Mime
View raw message