Unverified Commit 690b0766 authored by Lauri Timmanee's avatar Lauri Timmanee
Browse files

Issue #2550717 by mradcliffe, bnjmnm, finnsky, Manuel Garcia, lauriii,...

Issue #2550717 by mradcliffe, bnjmnm, finnsky, Manuel Garcia, lauriii, longwave, tedbow, silesky, catch, xjm, droplet, johndevman, nod_, marassa: [JS] Replace jQuery.cookie with JS-cookie and provide a BC layer
parent a9654497
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -5,3 +5,4 @@ node_modules/**/*
!*.es6.js
modules/locale/tests/locale_test.es6.js
!tests/Drupal/Nightwatch/**/*.js
misc/polyfills/object.assign.es6.js
+1 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
    "jQuery": true,
    "_": true,
    "matchMedia": true,
    "Cookies": true,
    "Backbone": true,
    "Modernizr": true,
    "Popper": true,
+0 −2
Original line number Diff line number Diff line
/*! jquery.cookie v1.4.1 | MIT */
!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof exports?a(require("jquery")):a(jQuery)}(function(a){function b(a){return h.raw?a:encodeURIComponent(a)}function c(a){return h.raw?a:decodeURIComponent(a)}function d(a){return b(h.json?JSON.stringify(a):String(a))}function e(a){0===a.indexOf('"')&&(a=a.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\"));try{return a=decodeURIComponent(a.replace(g," ")),h.json?JSON.parse(a):a}catch(b){}}function f(b,c){var d=h.raw?b:e(b);return a.isFunction(c)?c(d):d}var g=/\+/g,h=a.cookie=function(e,g,i){if(void 0!==g&&!a.isFunction(g)){if(i=a.extend({},h.defaults,i),"number"==typeof i.expires){var j=i.expires,k=i.expires=new Date;k.setTime(+k+864e5*j)}return document.cookie=[b(e),"=",d(g),i.expires?"; expires="+i.expires.toUTCString():"",i.path?"; path="+i.path:"",i.domain?"; domain="+i.domain:"",i.secure?"; secure":""].join("")}for(var l=e?void 0:{},m=document.cookie?document.cookie.split("; "):[],n=0,o=m.length;o>n;n++){var p=m[n].split("="),q=c(p.shift()),r=p.join("=");if(e&&e===q){l=f(r,g);break}e||void 0===(r=f(r))||(l[q]=r)}return l};h.defaults={},a.removeCookie=function(b,c){return void 0===a.cookie(b)?!1:(a.cookie(b,"",a.extend({},c,{expires:-1})),!a.cookie(b))}});
 No newline at end of file
+3 −0
Original line number Diff line number Diff line
/*! js-cookie v2.2.1 | MIT */

!function(a){var b;if("function"==typeof define&&define.amd&&(define(a),b=!0),"object"==typeof exports&&(module.exports=a(),b=!0),!b){var c=window.Cookies,d=window.Cookies=a();d.noConflict=function(){return window.Cookies=c,d}}}(function(){function a(){for(var a=0,b={};a<arguments.length;a++){var c=arguments[a];for(var d in c)b[d]=c[d]}return b}function b(a){return a.replace(/(%[0-9A-Z]{2})+/g,decodeURIComponent)}function c(d){function e(){}function f(b,c,f){if("undefined"!=typeof document){f=a({path:"/"},e.defaults,f),"number"==typeof f.expires&&(f.expires=new Date(1*new Date+864e5*f.expires)),f.expires=f.expires?f.expires.toUTCString():"";try{var g=JSON.stringify(c);/^[\{\[]/.test(g)&&(c=g)}catch(j){}c=d.write?d.write(c,b):encodeURIComponent(c+"").replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),b=encodeURIComponent(b+"").replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/[\(\)]/g,escape);var h="";for(var i in f)f[i]&&(h+="; "+i,!0!==f[i]&&(h+="="+f[i].split(";")[0]));return document.cookie=b+"="+c+h}}function g(a,c){if("undefined"!=typeof document){for(var e={},f=document.cookie?document.cookie.split("; "):[],g=0;g<f.length;g++){var h=f[g].split("="),i=h.slice(1).join("=");c||'"'!==i.charAt(0)||(i=i.slice(1,-1));try{var j=b(h[0]);if(i=(d.read||d)(i,j)||b(i),c)try{i=JSON.parse(i)}catch(k){}if(e[j]=i,a===j)break}catch(k){}}return a?e[a]:e}}return e.set=f,e.get=function(a){return g(a,!1)},e.getJSON=function(a){return g(a,!0)},e.remove=function(b,c){f(b,"",a(c,{expires:-1}))},e.defaults={},e.withConverter=c,e}return c(function(){})});
 No newline at end of file
+21 −10
Original line number Diff line number Diff line
@@ -229,7 +229,6 @@ drupal.form:
    - core/jquery
    - core/drupal
    - core/drupal.debounce
    - core/jquery.cookie
    - core/jquery.once

drupal.machine-name:
@@ -251,6 +250,11 @@ drupal.message:
    - core/drupal
    - core/drupal.announce

drupal.object.assign:
  version: VERSION
  js:
    misc/polyfills/object.assign.js: { weight: -20 }

drupal.progress:
  version: VERSION
  js:
@@ -289,7 +293,6 @@ drupal.tabledrag:
    - core/drupal
    - core/drupalSettings
    - core/jquery.once
    - core/jquery.cookie

drupal.tableheader:
  version: VERSION
@@ -370,16 +373,13 @@ jquery:
    assets/vendor/jquery/jquery.min.js: { minified: true, weight: -20 }

jquery.cookie:
  remote: https://github.com/carhartl/jquery-cookie
  version: "v1.4.1"
  license:
    name: MIT
    url: https://github.com/carhartl/jquery-cookie/blob/v1.4.1/MIT-LICENSE.txt
    gpl-compatible: true
  version: VERSION
  js:
    assets/vendor/jquery.cookie/jquery.cookie.min.js: { minified: true }
    misc/jquery.cookie.shim.js: {}
  dependencies:
    - core/jquery
    - core/drupal
    - core/js-cookie

jquery.farbtastic:
  remote: https://github.com/mattfarina/farbtastic
@@ -425,7 +425,6 @@ jquery.joyride:
    assets/vendor/jquery-joyride/jquery.joyride-2.1.js: { }
  dependencies:
    - core/jquery
    - core/jquery.cookie

jquery.once:
  remote: https://github.com/RobLoach/jquery-once
@@ -1024,3 +1023,15 @@ drupal.dialog.off_canvas:
    - core/drupal.announce
    - core/drupal.dialog
    - core/drupal.dialog.ajax

js-cookie:
  remote: https://github.com/js-cookie/js-cookie
  version: "v2.2.1"
  license:
    name: MIT
    url: https://github.com/js-cookie/js-cookie/blob/v2.2.1/MIT-LICENSE.txt
    gpl-compatible: true
  js:
    assets/vendor/js-cookie/js.cookie.min.js: {}
  dependencies:
    - core/drupal.object.assign
Loading