vendor/assets/javascripts/js.cookie.js in js_cookie_rails-2.1.2 vs vendor/assets/javascripts/js.cookie.js in js_cookie_rails-2.1.3
- old
+ new
@@ -1,18 +1,23 @@
/*!
- * JavaScript Cookie v2.1.2
+ * JavaScript Cookie v2.1.3
* https://github.com/js-cookie/js-cookie
*
* Copyright 2006, 2015 Klaus Hartl & Fagner Brack
* Released under the MIT license
*/
;(function (factory) {
+ var registeredInModuleLoader = false;
if (typeof define === 'function' && define.amd) {
define(factory);
- } else if (typeof exports === 'object') {
+ registeredInModuleLoader = true;
+ }
+ if (typeof exports === 'object') {
module.exports = factory();
- } else {
+ registeredInModuleLoader = true;
+ }
+ if (!registeredInModuleLoader) {
var OldCookies = window.Cookies;
var api = window.Cookies = factory();
api.noConflict = function () {
window.Cookies = OldCookies;
return api;
@@ -70,13 +75,13 @@
key = key.replace(/[\(\)]/g, escape);
return (document.cookie = [
key, '=', value,
attributes.expires ? '; expires=' + attributes.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
- attributes.path ? '; path=' + attributes.path : '',
- attributes.domain ? '; domain=' + attributes.domain : '',
- attributes.secure ? '; secure' : ''
+ attributes.path ? '; path=' + attributes.path : '',
+ attributes.domain ? '; domain=' + attributes.domain : '',
+ attributes.secure ? '; secure' : ''
].join(''));
}
// Read
@@ -125,10 +130,10 @@
return result;
}
api.set = api;
api.get = function (key) {
- return api(key);
+ return api.call(api, key);
};
api.getJSON = function () {
return api.apply({
json: true
}, [].slice.call(arguments));