definitly fix the history bug due to aggregation by loading history in head
This commit is contained in:
@@ -1,24 +1,11 @@
|
|||||||
console.log('history');
|
console.log('EDLP THEME HISTORY.js');
|
||||||
// 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();
|
|
||||||
// }
|
|
||||||
|
|
||||||
// var edlp is provided by edlp_ajax.module file
|
// var edlp is provided by edlp_ajax.module file
|
||||||
if(edlp.redirect){
|
if(edlp.redirect){
|
||||||
console.log('history 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_path', edlp.sys_path.replace(/^\//, ''));
|
||||||
window.localStorage.setItem('edlp_origin_url', window.location.pathname);
|
window.localStorage.setItem('edlp_origin_url', window.location.pathname);
|
||||||
// redirect to home
|
// redirect to home
|
||||||
window.location.replace(window.location.origin);
|
window.location.replace(window.location.origin);
|
||||||
}else{
|
}else{
|
||||||
console.log('history do not redirect');
|
console.log('history do not redirect');
|
||||||
document.body.style.visibility = 'visible';
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
console.log('EDLP THEME MAIN.js');
|
||||||
(function($, Drupal, drupalSettings) {
|
(function($, Drupal, drupalSettings) {
|
||||||
|
|
||||||
EdlpTheme = function(){
|
EdlpTheme = function(){
|
||||||
|
|||||||
@@ -1,24 +1,11 @@
|
|||||||
console.log('history');
|
console.log('EDLP THEME HISTORY.js');
|
||||||
// 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();
|
|
||||||
// }
|
|
||||||
|
|
||||||
// var edlp is provided by edlp_ajax.module file
|
// var edlp is provided by edlp_ajax.module file
|
||||||
if(edlp.redirect){
|
if(edlp.redirect){
|
||||||
console.log('history 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_path', edlp.sys_path.replace(/^\//, ''));
|
||||||
window.localStorage.setItem('edlp_origin_url', window.location.pathname);
|
window.localStorage.setItem('edlp_origin_url', window.location.pathname);
|
||||||
// redirect to home
|
// redirect to home
|
||||||
window.location.replace(window.location.origin);
|
window.location.replace(window.location.origin);
|
||||||
}else{
|
}else{
|
||||||
console.log('history do not redirect');
|
console.log('history do not redirect');
|
||||||
document.body.style.visibility = 'visible';
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
console.log('EDLP THEME MAIN.js');
|
||||||
(function($, Drupal, drupalSettings) {
|
(function($, Drupal, drupalSettings) {
|
||||||
|
|
||||||
EdlpTheme = function(){
|
EdlpTheme = function(){
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ base theme: classy
|
|||||||
core: 8.x
|
core: 8.x
|
||||||
libraries:
|
libraries:
|
||||||
- core/normalize
|
- core/normalize
|
||||||
- edlptheme/global-css
|
|
||||||
- edlptheme/history-js
|
- edlptheme/history-js
|
||||||
|
- edlptheme/global-css
|
||||||
- edlptheme/global-js
|
- edlptheme/global-js
|
||||||
|
|
||||||
# stylesheets-remove:
|
# stylesheets-remove:
|
||||||
|
|||||||
@@ -1,21 +1,22 @@
|
|||||||
global-css:
|
global-css:
|
||||||
version: VERSION
|
version: VERSION
|
||||||
css:
|
css:
|
||||||
base:
|
theme:
|
||||||
assets/dist/styles/app.min.css: {}
|
assets/dist/styles/app.min.css: {}
|
||||||
|
|
||||||
history-js:
|
history-js:
|
||||||
version: VERSION
|
version: VERSION
|
||||||
|
header: true
|
||||||
js:
|
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:
|
global-js:
|
||||||
version: VERSION
|
version: VERSION
|
||||||
js:
|
js:
|
||||||
# assets/dist/bower/jquery.hotkeys.js: { scope: footer }
|
# assets/dist/bower/jquery.hotkeys.js: { scope: footer }
|
||||||
assets/dist/bower/imagesloaded.pkgd.min.js: { scope: footer }
|
assets/dist/bower/imagesloaded.pkgd.min.js: { minified: true }
|
||||||
assets/dist/bower/masonry.pkgd.min.js: { scope: footer }
|
assets/dist/bower/masonry.pkgd.min.js: { minified: true }
|
||||||
assets/dist/scripts/main.min.js: { scope: footer }
|
assets/dist/scripts/main.min.js: { minified: true }
|
||||||
dependencies:
|
dependencies:
|
||||||
- core/drupal
|
- core/drupal
|
||||||
# - core/drupal.ajax
|
# - core/drupal.ajax
|
||||||
|
|||||||
Reference in New Issue
Block a user