diff --git a/sites/all/themes/custom/edlptheme/assets/dist/scripts/history.min.js b/sites/all/themes/custom/edlptheme/assets/dist/scripts/history.min.js index 48a7f69cf..c981a6e32 100644 --- a/sites/all/themes/custom/edlptheme/assets/dist/scripts/history.min.js +++ b/sites/all/themes/custom/edlptheme/assets/dist/scripts/history.min.js @@ -1,24 +1,11 @@ -console.log('history'); -// https://plainjs.com/javascript/utilities/set-cookie-get-cookie-and-delete-cookie-5/ -// function setCookie(name, value, days) { -// var d = new Date; -// d.setTime(d.getTime() + 24*60*60*1000*days); -// document.cookie = name + "=" + value + ";path=/;expires=" + d.toGMTString(); -// } - +console.log('EDLP THEME HISTORY.js'); // var edlp is provided by edlp_ajax.module file if(edlp.redirect){ console.log('history redirect'); - document.body.style.visibility = 'hidden'; - // record current (will be origin) sys_path in cookie - // var cookiename = "edlp_origin_path"; - // var cookie_value = edlp.sys_path.replace(/^\//, '') + '~~' + window.location.pathname; - // setCookie(cookiename, cookie_value, 1); window.localStorage.setItem('edlp_origin_path', edlp.sys_path.replace(/^\//, '')); window.localStorage.setItem('edlp_origin_url', window.location.pathname); // redirect to home window.location.replace(window.location.origin); }else{ console.log('history do not redirect'); - document.body.style.visibility = 'visible'; } diff --git a/sites/all/themes/custom/edlptheme/assets/dist/scripts/main.min.js b/sites/all/themes/custom/edlptheme/assets/dist/scripts/main.min.js index 636a3326e..2aa197814 100644 --- a/sites/all/themes/custom/edlptheme/assets/dist/scripts/main.min.js +++ b/sites/all/themes/custom/edlptheme/assets/dist/scripts/main.min.js @@ -1,3 +1,4 @@ +console.log('EDLP THEME MAIN.js'); (function($, Drupal, drupalSettings) { EdlpTheme = function(){ diff --git a/sites/all/themes/custom/edlptheme/assets/scripts/history.js b/sites/all/themes/custom/edlptheme/assets/scripts/history.js index 48a7f69cf..c981a6e32 100644 --- a/sites/all/themes/custom/edlptheme/assets/scripts/history.js +++ b/sites/all/themes/custom/edlptheme/assets/scripts/history.js @@ -1,24 +1,11 @@ -console.log('history'); -// https://plainjs.com/javascript/utilities/set-cookie-get-cookie-and-delete-cookie-5/ -// function setCookie(name, value, days) { -// var d = new Date; -// d.setTime(d.getTime() + 24*60*60*1000*days); -// document.cookie = name + "=" + value + ";path=/;expires=" + d.toGMTString(); -// } - +console.log('EDLP THEME HISTORY.js'); // var edlp is provided by edlp_ajax.module file if(edlp.redirect){ console.log('history redirect'); - document.body.style.visibility = 'hidden'; - // record current (will be origin) sys_path in cookie - // var cookiename = "edlp_origin_path"; - // var cookie_value = edlp.sys_path.replace(/^\//, '') + '~~' + window.location.pathname; - // setCookie(cookiename, cookie_value, 1); window.localStorage.setItem('edlp_origin_path', edlp.sys_path.replace(/^\//, '')); window.localStorage.setItem('edlp_origin_url', window.location.pathname); // redirect to home window.location.replace(window.location.origin); }else{ console.log('history do not redirect'); - document.body.style.visibility = 'visible'; } diff --git a/sites/all/themes/custom/edlptheme/assets/scripts/main.js b/sites/all/themes/custom/edlptheme/assets/scripts/main.js index 636a3326e..2aa197814 100644 --- a/sites/all/themes/custom/edlptheme/assets/scripts/main.js +++ b/sites/all/themes/custom/edlptheme/assets/scripts/main.js @@ -1,3 +1,4 @@ +console.log('EDLP THEME MAIN.js'); (function($, Drupal, drupalSettings) { EdlpTheme = function(){ diff --git a/sites/all/themes/custom/edlptheme/edlptheme.info.yml b/sites/all/themes/custom/edlptheme/edlptheme.info.yml index 6322cb8ab..5013a92eb 100644 --- a/sites/all/themes/custom/edlptheme/edlptheme.info.yml +++ b/sites/all/themes/custom/edlptheme/edlptheme.info.yml @@ -5,8 +5,8 @@ base theme: classy core: 8.x libraries: - core/normalize - - edlptheme/global-css - edlptheme/history-js + - edlptheme/global-css - edlptheme/global-js # stylesheets-remove: diff --git a/sites/all/themes/custom/edlptheme/edlptheme.libraries.yml b/sites/all/themes/custom/edlptheme/edlptheme.libraries.yml index 37db8e80b..4748329e0 100644 --- a/sites/all/themes/custom/edlptheme/edlptheme.libraries.yml +++ b/sites/all/themes/custom/edlptheme/edlptheme.libraries.yml @@ -1,21 +1,22 @@ global-css: version: VERSION css: - base: + theme: assets/dist/styles/app.min.css: {} history-js: version: VERSION + header: true js: - assets/dist/scripts/history.min.js: { weight:-998, scope: header } + assets/dist/scripts/history.min.js: { weight:-998, preprocess: false, minified: true } global-js: version: VERSION js: # assets/dist/bower/jquery.hotkeys.js: { scope: footer } - assets/dist/bower/imagesloaded.pkgd.min.js: { scope: footer } - assets/dist/bower/masonry.pkgd.min.js: { scope: footer } - assets/dist/scripts/main.min.js: { scope: footer } + assets/dist/bower/imagesloaded.pkgd.min.js: { minified: true } + assets/dist/bower/masonry.pkgd.min.js: { minified: true } + assets/dist/scripts/main.min.js: { minified: true } dependencies: - core/drupal # - core/drupal.ajax