You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by kx...@apache.org on 2013/12/08 17:33:26 UTC

git commit: updated refs/heads/master to 5310b40

Updated Branches:
  refs/heads/master 3097e8cdd -> 5310b4087


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/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/5310b408
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/5310b408
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/5310b408

Branch: refs/heads/master
Commit: 5310b4087b69ae4df496d00bc77a3e258888c71a
Parents: 3097e8c
Author: Alexander Shorin <kx...@apache.org>
Authored: Sun Dec 8 20:32:53 2013 +0400
Committer: Alexander Shorin <kx...@apache.org>
Committed: Sun Dec 8 20:32:53 2013 +0400

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


http://git-wip-us.apache.org/repos/asf/couchdb/blob/5310b408/share/www/script/jquery.couch.js
----------------------------------------------------------------------
diff --git a/share/www/script/jquery.couch.js b/share/www/script/jquery.couch.js
index b7e36f9..db4e8ef 100644
--- a/share/www/script/jquery.couch.js
+++ b/share/www/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);