couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dav...@apache.org
Subject [24/51] [abbrv] futon commit: updated refs/heads/import-master to 53a86dd
Date Thu, 31 Jul 2014 21:43:14 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-futon/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-futon/commit/493f7003
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-futon/tree/493f7003
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-futon/diff/493f7003

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

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


http://git-wip-us.apache.org/repos/asf/couchdb-futon/blob/493f7003/script/jquery.couch.js
----------------------------------------------------------------------
diff --git a/script/jquery.couch.js b/script/jquery.couch.js
index b7e36f9..db4e8ef 100644
--- a/script/jquery.couch.js
+++ b/script/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