diff --git a/web/modules/custom/edlp_ajax/edlp_ajax.module b/web/modules/custom/edlp_ajax/edlp_ajax.module index 1ba9cf8a0..01422000c 100644 --- a/web/modules/custom/edlp_ajax/edlp_ajax.module +++ b/web/modules/custom/edlp_ajax/edlp_ajax.module @@ -61,7 +61,8 @@ function edlp_ajax_page_attachments(array &$attachments) { $redirect = true; } - // $redirect = false; + $site_name = \Drupal::config('system.site')->get('name'); + $js_str = "var edlp = {\n sys_path:'".$current_path."',\n is_front:".($is_front ? 'true':'false').",\n @@ -71,6 +72,7 @@ function edlp_ajax_page_attachments(array &$attachments) { entity_bundle:'".$entity_bundle."',\n entity_id:'".$entity_id."',\n audio_url:'".$audio_url."',\n + site_name:'".$site_name."',\n };"; $attachments['#attached']['html_head'][] = [ diff --git a/web/themes/custom/edlptheme/assets/dist/scripts/main.min.js b/web/themes/custom/edlptheme/assets/dist/scripts/main.min.js index 1164e7c5c..2528227a2 100644 --- a/web/themes/custom/edlptheme/assets/dist/scripts/main.min.js +++ b/web/themes/custom/edlptheme/assets/dist/scripts/main.min.js @@ -84,7 +84,7 @@ return this;},showHideControls(){if(this.$controls){if(this.playing&&!this.pause if(this.$playpause){if(this.playlist.length>0){this.$playpause.addClass('is-active');}else{this.$playpause.removeClass('is-active');}} if(this.$next){if(this.playing&&this.playlist.length>1&&this.current_index1&&this.current_index>0){this.$previous.addClass('is-active');}else{this.$previous.removeClass('is-active');}} -return this;},deactivate(){this.stop();this.active=false;},onAudioOpenDocument(args){void 0;if(args.caller!==this){this.reset();}},onAudioPlayerPlay(){if(this.playing&&this.paused){this.paused=false;this.showHideControls();}},onAudioPlayerPause(){if(this.playing&&!this.paused){this.paused=true;this.showHideControls();}},onAudioPlayerEnded(){void 0;if(this.playing){this.paused=false;this.next();}},};function initExpo(){void 0;if(window.location.hash=='#black'){$('body').addClass('expo-black');} +return this;},deactivate(){this.stop();this.active=false;},onAudioOpenDocument(args){void 0;if(args.caller!==this){this.reset();}},onAudioPlayerPlay(){if(this.playing&&this.paused){this.paused=false;this.showHideControls();}},onAudioPlayerPause(){if(this.playing&&!this.paused){this.paused=true;this.showHideControls();}},onAudioPlayerEnded(){void 0;if(this.playing){this.paused=false;this.next();}},};function initExpo(){void 0;document.title=edlp.site_name;if(window.location.hash=='#black'){$('body').addClass('expo-black');} _$body.on('map-node-opened',checkExpoPlayerPositionning);_randomPlayer.start();} function checkExpoPlayerPositionning(e){void 0;switch(true){case e.node.x>window.innerWidth-800&&e.node.y<200:_audioPlayer.$container.attr('pos','bottom-left');break;case e.node.x>window.innerWidth-800:_audioPlayer.$container.attr('pos','top-left');break;case e.node.y<200:_audioPlayer.$container.attr('pos','bottom-right');break;default:_audioPlayer.$container.attr('pos','top-right');} _audioPlayer.$container.css({'display':"block",'left':e.node.x+"px",'top':e.node.y+"px",});} diff --git a/web/themes/custom/edlptheme/assets/scripts/main.js b/web/themes/custom/edlptheme/assets/scripts/main.js index 06cf8efcf..3921d2918 100644 --- a/web/themes/custom/edlptheme/assets/scripts/main.js +++ b/web/themes/custom/edlptheme/assets/scripts/main.js @@ -1963,6 +1963,7 @@ // |_| function initExpo(){ console.log('initExpo', window.location.hash); + document.title = edlp.site_name; if(window.location.hash == '#black'){ $('body').addClass('expo-black'); }