Autofix small errors

This commit is contained in:
Igor Barkov [iwork]
2019-01-16 19:45:30 +02:00
parent d330721114
commit 094b8a6027
313 changed files with 736 additions and 2280 deletions
+9 -9
View File
@@ -15,9 +15,9 @@ jQuery.cookie = function(name, value, options) {
value = '';
options.expires = -1;
}
var expires = '';
let expires = '';
if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) {
var date;
let date;
if (typeof options.expires == 'number') {
date = new Date();
date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000));
@@ -29,16 +29,16 @@ jQuery.cookie = function(name, value, options) {
// CAUTION: Needed to parenthesize options.path and options.domain
// in the following expressions, otherwise they evaluate to undefined
// in the packed version for some reason...
var path = options.path ? '; path=' + (options.path) : '';
var domain = options.domain ? '; domain=' + (options.domain) : '';
var secure = options.secure ? '; secure' : '';
const path = options.path ? '; path=' + (options.path) : '';
const domain = options.domain ? '; domain=' + (options.domain) : '';
const secure = options.secure ? '; secure' : '';
document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join('');
} else { // only name given, get cookie
var cookieValue = null;
let cookieValue = null;
if (document.cookie && document.cookie != '') {
var cookies = document.cookie.split(';');
for (var i = 0; i < cookies.length; i++) {
var cookie = jQuery.trim(cookies[i]);
const cookies = document.cookie.split(';');
for (let i = 0; i < cookies.length; i++) {
const cookie = jQuery.trim(cookies[i]);
// Does this cookie string begin with the name we want?
if (cookie.substring(0, name.length + 1) == (name + '=')) {
cookieValue = decodeURIComponent(cookie.substring(name.length + 1));