From 4581dce18142452b8eaf84ec1c95be519050c130 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franti=C5=A1ek=20Nesveda?= Date: Thu, 26 Oct 2017 15:28:49 +0200 Subject: [PATCH] Change the cookie library The jQuery.cookie library is deprecated and replaced by js-cookie, so we switch them --- editor/Makefile | 2 +- editor/pages/content/home.php | 2 +- editor/pages/content/rvsn.php | 2 +- editor/scripts/js/home.js | 5 ++--- editor/scripts/js/rvsn.js | 3 +-- 5 files changed, 6 insertions(+), 8 deletions(-) mode change 100644 => 100755 editor/Makefile mode change 100644 => 100755 editor/pages/content/rvsn.php mode change 100644 => 100755 editor/scripts/js/rvsn.js diff --git a/editor/Makefile b/editor/Makefile old mode 100644 new mode 100755 index c0f08c8..322fa44 --- a/editor/Makefile +++ b/editor/Makefile @@ -25,7 +25,7 @@ adminer : cookie : rm -rf lib/cookie mkdir -p lib/cookie - curl -L https://raw.githubusercontent.com/carhartl/jquery-cookie/master/src/jquery.cookie.js -o lib/cookie/jquery.cookie.js + curl -L https://www.github.com/js-cookie/js-cookie/releases/download/v2.1.4/js.cookie-2.1.4.min.js -o lib/cookie/js.cookie.min.js dropzone : rm -rf lib/dropzone diff --git a/editor/pages/content/home.php b/editor/pages/content/home.php index b949249..3fdce9a 100755 --- a/editor/pages/content/home.php +++ b/editor/pages/content/home.php @@ -13,7 +13,7 @@ - + diff --git a/editor/pages/content/rvsn.php b/editor/pages/content/rvsn.php old mode 100644 new mode 100755 index c080f2b..3c2d18f --- a/editor/pages/content/rvsn.php +++ b/editor/pages/content/rvsn.php @@ -135,7 +135,7 @@ function createCommitSelectBox($commits, $boxID, $defaultCommitID = "-1") { - + diff --git a/editor/scripts/js/home.js b/editor/scripts/js/home.js index 9ee464f..b246524 100755 --- a/editor/scripts/js/home.js +++ b/editor/scripts/js/home.js @@ -430,7 +430,7 @@ function main() { * @function saveAceOptions */ window.saveAceOptions = function() { - $.cookie('ace-options', aceUserOptions, { expires: 5*365, path: '/' }); + Cookies.set('ace-options', aceUserOptions, { expires: 5*365, path: '/' }); }; /** @@ -450,8 +450,7 @@ function main() { }); // load settings currently saved in the cookie and combine them with the default ones - $.cookie.json = true; - $.extend(aceUserOptions, $.cookie('ace-options')); + $.extend(aceUserOptions, Cookies.getJSON('ace-options')); // save them back to the cookie saveAceOptions(); diff --git a/editor/scripts/js/rvsn.js b/editor/scripts/js/rvsn.js old mode 100644 new mode 100755 index 153086e..050594d --- a/editor/scripts/js/rvsn.js +++ b/editor/scripts/js/rvsn.js @@ -77,8 +77,7 @@ function main() { editor = ace.edit('editor'); // load settings currently saved in the cookie and combine them with the default ones - $.cookie.json = true; - $.extend(aceUserOptions, $.cookie('ace-options')); + $.extend(aceUserOptions, Cookies.getJSON('ace-options')); // set editor options editor.setOptions(aceOptions);