Skip to content

Commit

Permalink
Update js-cookie to 2.1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
mikejolley authored and claudiosanches committed Apr 20, 2017
1 parent 40a8733 commit e89ec0f
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 17 deletions.
25 changes: 17 additions & 8 deletions assets/js/js-cookie/js.cookie.js
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* JavaScript Cookie v2.1.3
* JavaScript Cookie v2.1.4
* https://github.com/js-cookie/js-cookie
*
* Copyright 2006, 2015 Klaus Hartl & Fagner Brack
Expand Down Expand Up @@ -56,6 +56,9 @@
attributes.expires = expires;
}

// We're using "expires" because "max-age" is not supported by IE
attributes.expires = attributes.expires ? attributes.expires.toUTCString() : '';

try {
result = JSON.stringify(value);
if (/^[\{\[]/.test(result)) {
Expand All @@ -74,13 +77,19 @@
key = key.replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent);
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' : ''
].join(''));
var stringifiedAttributes = '';

for (var attributeName in attributes) {
if (!attributes[attributeName]) {
continue;
}
stringifiedAttributes += '; ' + attributeName;
if (attributes[attributeName] === true) {
continue;
}
stringifiedAttributes += '=' + attributes[attributeName];
}
return (document.cookie = key + '=' + value + stringifiedAttributes);
}

// Read
Expand Down
11 changes: 3 additions & 8 deletions assets/js/js-cookie/js.cookie.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion includes/class-wc-frontend-scripts.php
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ private static function register_scripts() {
'js-cookie' => array(
'src' => self::get_asset_url( 'assets/js/js-cookie/js.cookie' . $suffix . '.js' ),
'deps' => array(),
'version' => '2.1.3',
'version' => '2.1.4',
),
'jquery-blockui' => array(
'src' => self::get_asset_url( 'assets/js/jquery-blockui/jquery.blockUI' . $suffix . '.js' ),
Expand Down

0 comments on commit e89ec0f

Please sign in to comment.