From ea435b75174a944ce0f708f04e8b8ec9a8855be1 Mon Sep 17 00:00:00 2001 From: Bachir Soussi Chiadmi Date: Sun, 15 Apr 2018 00:00:40 +0200 Subject: [PATCH] enregistrement transcription interface is ok --- .../edlptheme/assets/dist/scripts/main.min.js | 40 +++++++++++++-- .../edlptheme/assets/dist/styles/app.min.css | 51 +++++++++++++++++-- .../custom/edlptheme/assets/scripts/main.js | 40 +++++++++++++-- .../custom/edlptheme/assets/styles/app.scss | 47 ++++++++++++++++- .../edlptheme/assets/styles/base/_fonts.scss | 14 +++-- .../themes/custom/edlptheme/edlptheme.theme | 5 ++ .../templates/content/node.html.twig | 15 ++++-- ...e.enregistrement.field_transcript_trad.yml | 2 +- ...ode.enregistrement.field_transcript_vo.yml | 2 +- 9 files changed, 196 insertions(+), 20 deletions(-) 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 1e05fe069..ee8eb66f7 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 @@ -194,7 +194,11 @@ console.log('selector', state.selector); $('a[selector="'+state.selector+'"]').addClass('is-active'); }else{ - $('a[data-drupal-link-system-path="'+state.sys_path+'"]').addClass('is-active'); + if(typeof state.view_mode != 'undefined'){ + $('a[viewmode="'+state.view_mode+'"][data-drupal-link-system-path="'+state.sys_path+'"]').addClass('is-active'); + }else{ + $('a[data-drupal-link-system-path="'+state.sys_path+'"]').addClass('is-active'); + } // as new content is not related to entree, we trigger close entree _$body.trigger({'type':'new-content-not-entree-ajax-loaded'}); } @@ -228,6 +232,12 @@ addCloseModalBtnToCols(); } + // enregistrement transcription + if(data.entity_type == "node" && data.bundle == "enregistrement" && data.view_mode == "transcript"){ + // window.requestAnimationFrame(initEnregistrementTranscript); + initEnregistrementTranscript(); + } + // update the language switcher block if it comes in the response if(typeof data.translations_links != 'undefined'){ console.log('state',state); @@ -261,7 +271,6 @@ _$body.attr('booted', 'booted'); _$body.removeClass('ajax-loading'); - // url is null means that we are loading content on popState event // so we don't record the state again if(state.url){ @@ -271,7 +280,7 @@ // }; // console.log('url:'+url+' ; state',state); // console.log(window.location); - // we can not pushestate with absolute url + // /!\ we can not pushestate with absolute url /!\ history.pushState(state, null, state.url); } }; @@ -713,6 +722,7 @@ stop(){ // console.log('AudioPlayer stop()'); this.audio.pause(); + // TODO: don't close player if article or transcript is open this.timeOutToHide(); }, // audio events @@ -1201,6 +1211,30 @@ }); }; + + // ___ _ _ _ + // | __|_ _ _ _ ___ __ _(_)__| |_ _ _ ___ _ __ ___ _ _| |_ + // | _|| ' \| '_/ -_) _` | (_-< _| '_/ -_) ' \/ -_) ' \ _| + // |___|_||_|_| \___\__, |_/__/\__|_| \___|_|_|_\___|_||_\__| + // |___/ + function initEnregistrementTranscript(){ + console.log('initEnregistrementTranscript'); + var $node = _$row.find('article.node--type-enregistrement.node--view-mode-transcript'); + var $nav = $('