|
@@ -29,23 +29,28 @@
|
|
// if(!drupalSettings.path.isFront)
|
|
// if(!drupalSettings.path.isFront)
|
|
// return;
|
|
// return;
|
|
|
|
|
|
- if(!_is_mobile){
|
|
|
|
- initEvents();
|
|
|
|
|
|
+ if(_is_mobile){
|
|
|
|
+ initMobile();
|
|
|
|
+ }
|
|
|
|
|
|
- _audioPlayer = new AudioPlayer();
|
|
|
|
- _compoPlayer = new CompoPlayer();
|
|
|
|
|
|
+ initEvents();
|
|
|
|
|
|
- checkLayout();
|
|
|
|
|
|
+ _audioPlayer = new AudioPlayer();
|
|
|
|
+ _compoPlayer = new CompoPlayer();
|
|
|
|
+ initAjaxLinks();
|
|
|
|
+ initHistory();
|
|
|
|
|
|
- initAjaxLinks();
|
|
|
|
|
|
|
|
- initHistory();
|
|
|
|
|
|
+ if(!_is_mobile){
|
|
|
|
+
|
|
|
|
+ checkLayout();
|
|
|
|
|
|
initAudioLinksHover();
|
|
initAudioLinksHover();
|
|
- }else{
|
|
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if(_is_mobile){
|
|
if(drupalSettings.path.isFront){
|
|
if(drupalSettings.path.isFront){
|
|
initHomeMobile();
|
|
initHomeMobile();
|
|
-
|
|
|
|
}
|
|
}
|
|
_$body.attr('booted', 'booted');
|
|
_$body.attr('booted', 'booted');
|
|
}
|
|
}
|
|
@@ -62,38 +67,48 @@
|
|
// | \/ |___| |__(_) |___
|
|
// | \/ |___| |__(_) |___
|
|
// | |\/| / _ \ '_ \ | / -_)
|
|
// | |\/| / _ \ '_ \ | / -_)
|
|
// |_| |_\___/_.__/_|_\___|
|
|
// |_| |_\___/_.__/_|_\___|
|
|
- function initHomeMobile(){
|
|
|
|
- $('.field--name-field-notice, .index', '.entrees .taxonomy-term.vocabulary-entrees')
|
|
|
|
- .addClass('closed');
|
|
|
|
- $('[data-drupal-link-system-path="<front>"]','#block-mainnavigation')
|
|
|
|
- .removeClass('is-active')
|
|
|
|
- .attr('href', '#collection');
|
|
|
|
- $('h2#block-mainnavigation-menu, a', '#block-mainnavigation')
|
|
|
|
|
|
+ function initMobile(){
|
|
|
|
+ // $('[data-drupal-link-system-path="<front>"]','#block-mainnavigation')
|
|
|
|
+ // .removeClass('is-active')
|
|
|
|
+ // .attr('href', '#collection');
|
|
|
|
+
|
|
|
|
+ // edlp_mobile.mobile_home_path.replace(/^\//, '')
|
|
|
|
+
|
|
|
|
+ // TODO: remove collection from mobile home
|
|
|
|
+ // TODO: replace ajax link to only collection for mobile
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ $('h2, a', '#block-mainnavigation')
|
|
|
|
+ .add('h2, a', '#block-mainnavigation-2')
|
|
.on('click', onclickHomeMobileMenu);
|
|
.on('click', onclickHomeMobileMenu);
|
|
- // $('a', '#block-mainnavigation')
|
|
|
|
- // .on('click', onclickHomeMobileMenu);
|
|
|
|
- $('.field--name-field-notice>.field__label', '.entrees .taxonomy-term.vocabulary-entrees')
|
|
|
|
- .on('click', onClickHomeMobileNotice);
|
|
|
|
- $('.index>.field__label', '.entrees .taxonomy-term.vocabulary-entrees')
|
|
|
|
- .on('click', onClickHomeMobileIndex);
|
|
|
|
- };
|
|
|
|
|
|
+ }
|
|
function onclickHomeMobileMenu(e){
|
|
function onclickHomeMobileMenu(e){
|
|
- $('#block-mainnavigation').toggleClass('visible');
|
|
|
|
|
|
+ // $('#block-mainnavigation').toggleClass('opened');
|
|
|
|
+ $('#block-mainnavigation-2').toggleClass('opened');
|
|
};
|
|
};
|
|
- function onClickHomeMobileNotice(e){
|
|
|
|
- // console.log('onClickHomeMobileNotice');
|
|
|
|
- // var $part = $(this).parent();//parents('.taxonomy-term');
|
|
|
|
- toggleEntreeOpening($(this).parent(), 'notice');
|
|
|
|
- };
|
|
|
|
- function onClickHomeMobileIndex(e){
|
|
|
|
- // console.log('onClickHomeMobileIndex');
|
|
|
|
- // var $part = $(this).parent();//parents('.taxonomy-term');
|
|
|
|
- toggleEntreeOpening($(this).parent(), 'index');
|
|
|
|
|
|
+ function initHomeMobile(){
|
|
|
|
+ // taxonomy-term.vocabulary-entrees.home_mobile
|
|
|
|
+ // $('.field--name-field-notice, .index', '.entrees .taxonomy-term.vocabulary-entrees')
|
|
|
|
+ // .addClass('closed');
|
|
|
|
+ // $('.field--name-field-notice>.field__label', '.entrees .taxonomy-term.vocabulary-entrees')
|
|
|
|
+ // .on('click', onClickHomeMobileNotice);
|
|
|
|
+ // $('.index>.field__label', '.entrees .taxonomy-term.vocabulary-entrees')
|
|
|
|
+ // .on('click', onClickHomeMobileIndex);
|
|
};
|
|
};
|
|
- function toggleEntreeOpening($e, part){
|
|
|
|
- $e.toggleClass('closed')
|
|
|
|
- .parents('.taxonomy-term.vocabulary-entrees.home_mobile').toggleClass(part+'-opened');
|
|
|
|
- }
|
|
|
|
|
|
+ // function onClickHomeMobileNotice(e){
|
|
|
|
+ // // console.log('onClickHomeMobileNotice');
|
|
|
|
+ // // var $part = $(this).parent();//parents('.taxonomy-term');
|
|
|
|
+ // toggleEntreeOpening($(this).parent(), 'notice');
|
|
|
|
+ // };
|
|
|
|
+ // function onClickHomeMobileIndex(e){
|
|
|
|
+ // // console.log('onClickHomeMobileIndex');
|
|
|
|
+ // // var $part = $(this).parent();//parents('.taxonomy-term');
|
|
|
|
+ // toggleEntreeOpening($(this).parent(), 'index');
|
|
|
|
+ // };
|
|
|
|
+ // function toggleEntreeOpening($e, part){
|
|
|
|
+ // $e.toggleClass('closed')
|
|
|
|
+ // .parents('.taxonomy-term.vocabulary-entrees.home_mobile').toggleClass(part+'-opened');
|
|
|
|
+ // }
|
|
|
|
|
|
// ___ _
|
|
// ___ _
|
|
// | __|_ _____ _ _| |_ ___
|
|
// | __|_ _____ _ _| |_ ___
|
|
@@ -379,6 +394,11 @@
|
|
addCloseModalBtnToCols();
|
|
addCloseModalBtnToCols();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ if(state.sys_path == "collection"){
|
|
|
|
+ // only for mobile version of collection
|
|
|
|
+ initCollectionNav();
|
|
|
|
+ }
|
|
|
|
+
|
|
// enregistrement transcription
|
|
// enregistrement transcription
|
|
if(data.entity_type == "node" && data.bundle == "enregistrement" && data.view_mode == "transcript"){
|
|
if(data.entity_type == "node" && data.bundle == "enregistrement" && data.view_mode == "transcript"){
|
|
// window.requestAnimationFrame(initEnregistrementTranscript);
|
|
// window.requestAnimationFrame(initEnregistrementTranscript);
|
|
@@ -481,6 +501,8 @@
|
|
};
|
|
};
|
|
|
|
|
|
function addCloseModalBtnToCols(){
|
|
function addCloseModalBtnToCols(){
|
|
|
|
+ if(_is_mobile) return;
|
|
|
|
+
|
|
$('.col', _$row).each(function(index, el) {
|
|
$('.col', _$row).each(function(index, el) {
|
|
|
|
|
|
if($('span.close-col-btn', this).length)
|
|
if($('span.close-col-btn', this).length)
|
|
@@ -682,6 +704,7 @@
|
|
|
|
|
|
$('a.site-name', '#block-edlptheme-branding')
|
|
$('a.site-name', '#block-edlptheme-branding')
|
|
.add('a', '#block-mainnavigation')
|
|
.add('a', '#block-mainnavigation')
|
|
|
|
+ .add('a', '#block-mainnavigation-2')
|
|
// .add('a', '.block.language-switcher-language-url')
|
|
// .add('a', '.block.language-switcher-language-url')
|
|
.add('a', '#block-footer.menu--footer')
|
|
.add('a', '#block-footer.menu--footer')
|
|
.add('a', '#block-productions')
|
|
.add('a', '#block-productions')
|
|
@@ -695,8 +718,16 @@
|
|
|
|
|
|
$('a[data-drupal-link-system-path="<front>"]', '#block-mainnavigation').removeClass('is-active');
|
|
$('a[data-drupal-link-system-path="<front>"]', '#block-mainnavigation').removeClass('is-active');
|
|
|
|
|
|
- _$ajaxLinks = $('.ajax-link:not(.ajax-enabled)')
|
|
|
|
- .each(function(i,e){
|
|
|
|
|
|
+ _$ajaxLinks = $('.ajax-link');
|
|
|
|
+ activateAjaxLinks();
|
|
|
|
+ };
|
|
|
|
+ // function initAudioLinks(){
|
|
|
|
+ // _$ajaxLinks = $('.ajax-link.audio-link');
|
|
|
|
+ // activateAjaxLinks();
|
|
|
|
+ // };
|
|
|
|
+ function activateAjaxLinks(){
|
|
|
|
+ // $('.ajax-link:not(.ajax-enabled)')
|
|
|
|
+ _$ajaxLinks.each(function(i,e){
|
|
var $this = $(this);
|
|
var $this = $(this);
|
|
// avoid already ajaxified links
|
|
// avoid already ajaxified links
|
|
if($this.is('.ajax-enable')) return;
|
|
if($this.is('.ajax-enable')) return;
|
|
@@ -753,12 +784,17 @@
|
|
// front page
|
|
// front page
|
|
// just remove contents and stop here
|
|
// just remove contents and stop here
|
|
if(sys_path == '<front>'){
|
|
if(sys_path == '<front>'){
|
|
- if($link.is('.is-active') && _corpus_ready){
|
|
|
|
- _$corpus_canvas.trigger({'type':'shuffle-collection'});
|
|
|
|
- }else{
|
|
|
|
- backToFrontPage();
|
|
|
|
|
|
+ if(!_is_mobile){
|
|
|
|
+ if($link.is('.is-active') && _corpus_ready){
|
|
|
|
+ _$corpus_canvas.trigger({'type':'shuffle-collection'});
|
|
|
|
+ }else{
|
|
|
|
+ backToFrontPage();
|
|
|
|
+ }
|
|
|
|
+ return false;
|
|
}
|
|
}
|
|
- return false;
|
|
|
|
|
|
+ // else{
|
|
|
|
+ // sys_path = edlp_mobile.mobile_home_path.replace(/^\//, '');
|
|
|
|
+ // }
|
|
}
|
|
}
|
|
|
|
|
|
var view_mode = $link.attr('viewmode');
|
|
var view_mode = $link.attr('viewmode');
|
|
@@ -993,7 +1029,7 @@
|
|
this.currentHistoricIndex = historic_index;
|
|
this.currentHistoricIndex = historic_index;
|
|
}
|
|
}
|
|
|
|
|
|
- if(_$body.is('.path-frontpage') && caller !== 'lastdocs'){
|
|
|
|
|
|
+ if(_$body.is('.path-frontpage') && caller !== 'lastdocs' && !_is_mobile){
|
|
closeAllModals();
|
|
closeAllModals();
|
|
}
|
|
}
|
|
// TODO: update language switcher for document url
|
|
// TODO: update language switcher for document url
|
|
@@ -1024,7 +1060,9 @@
|
|
this.clearTimeOutToHide();
|
|
this.clearTimeOutToHide();
|
|
this.clearIntervalAutoCartelSwitch();
|
|
this.clearIntervalAutoCartelSwitch();
|
|
this.setSRC(this.historic[this.currentHistoricIndex].audio_url);
|
|
this.setSRC(this.historic[this.currentHistoricIndex].audio_url);
|
|
- this.loadNode(this.historic[this.currentHistoricIndex].nid);
|
|
|
|
|
|
+ if(!_is_mobile){
|
|
|
|
+ this.loadNode(this.historic[this.currentHistoricIndex].nid);
|
|
|
|
+ }
|
|
// emmit new playing doc (e.g.: corpus map nowing that audio played from RandomPlayer)
|
|
// emmit new playing doc (e.g.: corpus map nowing that audio played from RandomPlayer)
|
|
try {
|
|
try {
|
|
_$corpus_canvas.trigger({
|
|
_$corpus_canvas.trigger({
|
|
@@ -1677,8 +1715,10 @@
|
|
// \___|_| |_\__,_|
|
|
// \___|_| |_\__,_|
|
|
function initGrid(){
|
|
function initGrid(){
|
|
console.log('theme : initGrid');
|
|
console.log('theme : initGrid');
|
|
- checkGridBlockHeight();
|
|
|
|
- _$row.find('.col').addClass('offfield');
|
|
|
|
|
|
+ if(!_is_mobile){
|
|
|
|
+ checkGridBlockHeight();
|
|
|
|
+ _$row.find('.col').addClass('offfield');
|
|
|
|
+ }
|
|
if(false){
|
|
if(false){
|
|
|
|
|
|
var $grid = $('.grid',_$row).masonry({
|
|
var $grid = $('.grid',_$row).masonry({
|
|
@@ -1711,12 +1751,16 @@
|
|
|
|
|
|
}else{
|
|
}else{
|
|
// setTimeout(checkGridBlockVisible, 100);
|
|
// setTimeout(checkGridBlockVisible, 100);
|
|
- checkGridBlockVisible();
|
|
|
|
|
|
+ if(!_is_mobile){
|
|
|
|
+ checkGridBlockVisible();
|
|
|
|
+ }
|
|
}
|
|
}
|
|
};
|
|
};
|
|
|
|
|
|
function checkGridBlockHeight(){
|
|
function checkGridBlockHeight(){
|
|
// console.log('checkGridBlockHeight');
|
|
// console.log('checkGridBlockHeight');
|
|
|
|
+ // if(_is_mobile) return;
|
|
|
|
+
|
|
var $r_h = _$row.height();
|
|
var $r_h = _$row.height();
|
|
var $this;
|
|
var $this;
|
|
// console.log($r_h);
|
|
// console.log($r_h);
|
|
@@ -1737,6 +1781,8 @@
|
|
|
|
|
|
function checkGridBlockVisible(){
|
|
function checkGridBlockVisible(){
|
|
// console.log('checkGridBlockVisible');
|
|
// console.log('checkGridBlockVisible');
|
|
|
|
+ // if(_is_mobile) return;
|
|
|
|
+
|
|
var $r_h = _$row.height();
|
|
var $r_h = _$row.height();
|
|
var $this,pos;
|
|
var $this,pos;
|
|
$('.grid .col', _$row).each(function(i,e){
|
|
$('.grid .col', _$row).each(function(i,e){
|
|
@@ -1803,6 +1849,40 @@
|
|
// };
|
|
// };
|
|
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
+ // ___ _ _ _ _
|
|
|
|
+ // / __|___| | |___ __| |_(_)___ _ _
|
|
|
|
+ // | (__/ _ \ | / -_) _| _| / _ \ ' \
|
|
|
|
+ // \___\___/_|_\___\__|\__|_\___/_||_|
|
|
|
|
+ // mobile version of collection
|
|
|
|
+ function initCollectionNav(){
|
|
|
|
+ console.log('initCollectionNav');
|
|
|
|
+ // taxonomy-term.vocabulary-entrees.home_mobile
|
|
|
|
+ $('.field--name-field-notice, .index', '.taxonomy-term.vocabulary-entrees.home_mobile')
|
|
|
|
+ .addClass('closed');
|
|
|
|
+ $('.field--name-field-notice>.field__label', '.taxonomy-term.vocabulary-entrees.home_mobile')
|
|
|
|
+ .on('click', onClickCollectionNotice);
|
|
|
|
+ $('.index>.field__label', '.taxonomy-term.vocabulary-entrees.home_mobile')
|
|
|
|
+ .on('click', onClickCollectionIndex);
|
|
|
|
+ };
|
|
|
|
+ function onClickCollectionNotice(e){
|
|
|
|
+ // console.log('onClickCollectionNotice');
|
|
|
|
+ // var $part = $(this).parent();//parents('.taxonomy-term');
|
|
|
|
+ toggleEntreeOpening($(this).parent(), 'notice');
|
|
|
|
+ };
|
|
|
|
+ function onClickCollectionIndex(e){
|
|
|
|
+ // console.log('onClickCollectionIndex');
|
|
|
|
+ // var $part = $(this).parent();//parents('.taxonomy-term');
|
|
|
|
+ toggleEntreeOpening($(this).parent(), 'index');
|
|
|
|
+ };
|
|
|
|
+ function toggleEntreeOpening($e, part){
|
|
|
|
+ $e.toggleClass('closed')
|
|
|
|
+ .parents('.taxonomy-term.vocabulary-entrees.home_mobile').toggleClass(part+'-opened');
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
// ___ _
|
|
// ___ _
|
|
// / __| ___ __ _ _ _ __| |_
|
|
// / __| ___ __ _ _ _ __| |_
|
|
// \__ \/ -_) _` | '_/ _| ' \
|
|
// \__ \/ -_) _` | '_/ _| ' \
|
|
@@ -1852,8 +1932,10 @@
|
|
$('body').removeClass().addClass('path-frontpage');
|
|
$('body').removeClass().addClass('path-frontpage');
|
|
$('a[data-drupal-link-system-path="<front>"]').addClass('is-active');
|
|
$('a[data-drupal-link-system-path="<front>"]').addClass('is-active');
|
|
// close entrees
|
|
// close entrees
|
|
- _$corpus_canvas.trigger({'type':'close-all-entree'});
|
|
|
|
- _$corpus_canvas.trigger({'type':'scramble-collection'});
|
|
|
|
|
|
+ if(_corpus_ready){
|
|
|
|
+ _$corpus_canvas.trigger({'type':'close-all-entree'});
|
|
|
|
+ _$corpus_canvas.trigger({'type':'scramble-collection'});
|
|
|
|
+ }
|
|
|
|
|
|
if(typeof pop_state == "undefined" || !pop_state){
|
|
if(typeof pop_state == "undefined" || !pop_state){
|
|
console.log('backToFrontPage push state');
|
|
console.log('backToFrontPage push state');
|
|
@@ -1924,7 +2006,9 @@
|
|
// }
|
|
// }
|
|
}else{
|
|
}else{
|
|
// if we were on production page just scramble collection in case of map was filtered
|
|
// if we were on production page just scramble collection in case of map was filtered
|
|
- _$corpus_canvas.trigger({'type':'scramble-collection'});
|
|
|
|
|
|
+ if(_corpus_ready){
|
|
|
|
+ _$corpus_canvas.trigger({'type':'scramble-collection'});
|
|
|
|
+ }
|
|
// reload production home
|
|
// reload production home
|
|
$('a[data-drupal-link-system-path="productions"]', '#block-mainnavigation')
|
|
$('a[data-drupal-link-system-path="productions"]', '#block-mainnavigation')
|
|
.removeClass('is-active').trigger('click');
|
|
.removeClass('is-active').trigger('click');
|