main.js 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663
  1. (function($, Drupal, drupalSettings) {
  2. EdlpTheme = function(){
  3. var _$body = $('body');
  4. var _is_front = _$body.is('.path-frontpage');
  5. var _$corpus_canvas;
  6. var _$row = $('main[role="main"]>.layout-content>.row');
  7. var _$ajaxLinks;
  8. var _audio_player;
  9. var _randomPlayer;
  10. // ___ _ _
  11. // |_ _|_ _ (_) |_
  12. // | || ' \| | _|
  13. // |___|_||_|_|\__|
  14. function init(){
  15. console.log("EdlpTheme init()");
  16. // TODO: redirect all no-front pages to front with write hash
  17. _$body.on('corpus-map-ready', onCorpusMapReady);
  18. _audio_player = new AudioPlayer();
  19. initAjaxLinks();
  20. if (_$body.is('.path-productions')){
  21. initProductions();
  22. }
  23. if(_$body.is('.path-frontpage')){
  24. addCloseBtnToCols();
  25. }
  26. // initScrollbars();
  27. initEvents();
  28. };
  29. // ___ _
  30. // | __|_ _____ _ _| |_ ___
  31. // | _|\ V / -_) ' \ _(_-<
  32. // |___|\_/\___|_||_\__/__/
  33. function initEvents(){
  34. $('body')
  35. .on('on-studio-chutier-updated', function(e){
  36. initAjaxLinks();
  37. })
  38. .on('search-results-loaded',function(e){
  39. initAjaxLinks();
  40. })
  41. .on('open_entree', function(e){
  42. // e.tid available
  43. closeAllModals();
  44. })
  45. .on('close_entree', function(e){
  46. // e.tid available
  47. backToFrontPage();
  48. });
  49. }
  50. // _ _ _
  51. // /_\ _ _ __| (_)___
  52. // / _ \ || / _` | / _ \
  53. // /_/ \_\_,_\__,_|_\___/
  54. //
  55. // https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement
  56. // https://docs.microsoft.com/en-us/previous-versions/windows/internet-explorer/ie-developer/samples/gg589528%28v%3dvs.85%29
  57. // https://www.binarytides.com/using-html5-audio-element-javascript/
  58. function AudioPlayer(){
  59. var that = this;
  60. this.fid;
  61. this.audio = new Audio();
  62. // audio events
  63. this.audio_events = ["loadedmetadata","canplay","playing","pause","timeupdate","ended"];
  64. // UI dom objects
  65. this.$container = $('<div id="audio-player">');
  66. // btns
  67. this.$btns = $('<div>').addClass('btns').appendTo(this.$container);
  68. this.$previous = $('<div>').addClass('previous').appendTo(this.$btns);
  69. this.$playpause = $('<div>').addClass('play-pause').appendTo(this.$btns);
  70. this.$next = $('<div>').addClass('next').appendTo(this.$btns);
  71. // timeline
  72. this.$timelinecont= $('<div>').addClass('time-line-container').appendTo(this.$container);
  73. this.$timeline = $('<div>').addClass('time-line').appendTo(this.$timelinecont);
  74. this.$loader = $('<div>').addClass('loader').appendTo(this.$timeline);
  75. this.$cursor = $('<div>').addClass('cursor').appendTo(this.$timeline);
  76. // time
  77. this.$time = $('<div>').addClass('time').appendTo(this.$container);
  78. this.$currentTime = $('<div>').addClass('current-time').html('00:00').appendTo(this.$time);
  79. this.$duration = $('<div>').addClass('duration').html('00:00').appendTo(this.$time);
  80. // favoris
  81. this.$fav = $('<div>').addClass('favoris').appendTo(this.$container);
  82. // cartel
  83. this.$cartel = $('<div>').addClass('cartel').appendTo(this.$container);
  84. // hiding
  85. this.hideTimer = false;
  86. this.hideTimeMS = 10000;
  87. // history
  88. this.currentHistoricIndex = null;
  89. this.historic = [];
  90. this.shuffle_is_active = false;
  91. // object events
  92. this.event_handlers = {
  93. 'audio-play-next':[],
  94. 'audio-ended':[],
  95. 'stop-shuffle':[]
  96. };
  97. this.init();
  98. };
  99. AudioPlayer.prototype = {
  100. init(){
  101. // append ui to document
  102. this.$container.appendTo('header[role="banner"] .region-header');
  103. // record timeline width
  104. this.timeline_w = parseInt(this.$timeline.width());
  105. // init audio events
  106. var fn = '';
  107. for (var i = 0; i < this.audio_events.length; i++) {
  108. fn = this.audio_events[i];
  109. // capitalize first letter of event (only cosmetic :p )
  110. fn = 'on'+fn.charAt(0).toUpperCase()+fn.slice(1);
  111. this.audio.addEventListener(
  112. this.audio_events[i],
  113. this[fn].bind(this),
  114. true);
  115. }
  116. // init btns events
  117. this.$previous.on('click', this.playPrevious.bind(this));
  118. this.$playpause.on('click', this.togglePlayPause.bind(this));
  119. this.$next.on('click', this.playNext.bind(this));
  120. // TODO: previous and next btns
  121. },
  122. openDocument(node){
  123. console.log('AudioPlayer openDocument', node);
  124. this.historic.push(node);
  125. this.currentHistoricIndex = this.historic.length-1;
  126. // this.shuffle_mode = shuffle_mode || false;
  127. this.launch();
  128. },
  129. launch(){
  130. this.clearTimeOutToHide();
  131. this.setSRC(this.historic[this.currentHistoricIndex].audio_url);
  132. this.loadNode(this.historic[this.currentHistoricIndex].nid);
  133. // emmit new playing doc (e.g.: corpus map nowing that audio played from RandomPlayer)
  134. try {
  135. _$corpus_canvas.trigger({
  136. 'type':'audio-node-opened',
  137. 'nid':this.historic[this.currentHistoricIndex].nid
  138. });
  139. } catch (e) {
  140. console.warn('AudioPlayer : _$corpus_canvas does not exists');
  141. }
  142. this.showHidePreviousBtn();
  143. this.showHideNextBtn();
  144. this.show();
  145. },
  146. // audio functions
  147. setSRC(url){
  148. // console.log('AudioPlayer setSRC : url', url);
  149. this.audio.src = url;
  150. },
  151. onLoadedmetadata(){
  152. var rem = parseInt(this.audio.duration, 10),
  153. mins = Math.floor(rem/60,10),
  154. secs = rem - mins*60;
  155. this.$duration.html('<span>'+(mins<10 ? '0':'')+mins+':'+(secs<10 ? '0':'')+secs+'</span>');
  156. this.updateLoadingBar();
  157. },
  158. updateLoadingBar(){
  159. this.$loader.css({
  160. 'width':parseInt((100 * this.audio.buffered.end(0) / this.audio.duration), 10)+'%'
  161. });
  162. if( this.audio.buffered.end(0) < this.audio.duration ){
  163. // loop through this function until file is fully loaded
  164. var that = this;
  165. window.requestAnimationFrame(that.updateLoadingBar.bind(that));
  166. }else{
  167. console.log('Audio fully loaded');
  168. }
  169. },
  170. onCanplay(){
  171. this.play();
  172. },
  173. play(){
  174. this.audio.play();
  175. },
  176. playPrevious(){
  177. if(this.currentHistoricIndex > 0){
  178. this.currentHistoricIndex -= 1;
  179. this.launch();
  180. }
  181. },
  182. playNext(){
  183. if(this.currentHistoricIndex < this.historic.length-1){
  184. this.currentHistoricIndex += 1;
  185. this.launch();
  186. }else{
  187. this.emmit('audio-play-next');
  188. }
  189. },
  190. togglePlayPause(e){
  191. if(this.audio.paused){
  192. this.audio.play();
  193. }else{
  194. this.audio.pause();
  195. }
  196. },
  197. stop(){
  198. console.log('AudioPlayer stop()');
  199. this.audio.pause();
  200. this.timeOutToHide();
  201. },
  202. // audio events
  203. onPlaying(){
  204. this.$container.addClass('is-playing');
  205. },
  206. onPause(){
  207. this.$container.removeClass('is-playing');
  208. },
  209. onTimeupdate(){
  210. // move cursor
  211. this.$cursor.css({
  212. 'left':(this.audio.currentTime/this.audio.duration * this.timeline_w)+"px"
  213. });
  214. // update time text display
  215. var rem = parseInt(this.audio.currentTime, 10),
  216. mins = Math.floor(rem/60,10),
  217. secs = rem - mins*60;
  218. this.$currentTime.html('<span>'+(mins<10 ? '0':'')+mins+':'+(secs<10 ? '0':'')+secs+'</span>');
  219. },
  220. onEnded(){
  221. this.emmit('audio-ended');
  222. this.stop();
  223. },
  224. // cartel functions
  225. loadNode(nid){
  226. this.$cartel.addClass('loading');
  227. $.getJSON('/edlp/ajax/json/node/'+nid+'/player_cartel', {})
  228. .done(this.onNodeLoaded.bind(this))
  229. .fail(this.onNodeLoadFail.bind(this));
  230. },
  231. onNodeLoaded(data){
  232. console.log('AudioPlayer node loaded');
  233. this.$cartel.html(data.rendered).removeClass('loading');
  234. _$body.trigger({'type':'new-audio-cartel-loaded'});
  235. initAjaxLinks();
  236. },
  237. onNodeLoadFail(jqxhr, textStatus, error){
  238. console.warn('AudioPlayer node load failed', jqxhr.responseText);
  239. this.$cartel.removeClass('loading').html('');
  240. },
  241. // global
  242. show(){
  243. this.$container.addClass('visible');
  244. },
  245. showHidePreviousBtn(){
  246. if(this.historic.length > 1 && this.currentHistoricIndex > 0){
  247. this.$previous.addClass('is-active');
  248. }else{
  249. this.$previous.removeClass('is-active');
  250. }
  251. },
  252. showHideNextBtn(){
  253. if(this.currentHistoricIndex < this.historic.length-1 || this.shuffle_is_active){
  254. this.$next.addClass('is-active');
  255. }else{
  256. this.$next.removeClass('is-active');
  257. }
  258. },
  259. timeOutToHide(){
  260. console.log('AudioPlayer timeOutToHide()');
  261. this.clearTimeOutToHide();
  262. this.hideTimer = setTimeout(this.hide.bind(this), this.hideTimeMS);
  263. },
  264. clearTimeOutToHide(){
  265. console.log('AudioPlayer clearTimeOutToHide()',this.hideTimer);
  266. if(this.hideTimer){
  267. clearTimeout(this.hideTimer);
  268. this.hideTimer = false;
  269. }
  270. },
  271. hide(){
  272. console.log('AudioPlayer hide()');
  273. this.$container.removeClass('visible');
  274. // trigger highlighted node remove on corpus map
  275. _$corpus_canvas.trigger('audio-node-closed');
  276. },
  277. // object events
  278. on(event_name, handler){
  279. if(typeof this.event_handlers[event_name] == 'undefined'){
  280. console.warn('AudioPlayer : event '+event_name+' does not exists');
  281. }
  282. this.event_handlers[event_name].push(handler);
  283. return this;
  284. },
  285. emmit(event_name){
  286. var handler;
  287. for (var i = this.event_handlers[event_name].length; i >= 0 ; i--) {
  288. handler = this.event_handlers[event_name][i];
  289. setTimeout(handler, 0);
  290. }
  291. return this;
  292. },
  293. }
  294. // ___ _ _ ___
  295. // / __| __ _ _ ___| | | _ ) __ _ _ _ ___
  296. // \__ \/ _| '_/ _ \ | | _ \/ _` | '_(_-<
  297. // |___/\__|_| \___/_|_|___/\__,_|_| /__/
  298. function initScrollbars(){
  299. // console.log("initScrollbars");
  300. // TODO: find a better js scroll than overlayScrollbars which does not handle well max-height + overflow-y:auto;
  301. // $('.os-scroll').overlayScrollbars({
  302. // overflowBehavior:{
  303. // x:'h',
  304. // y:'scroll',
  305. // clipAlways:false
  306. // }
  307. // });
  308. };
  309. // _ _
  310. // /_\ (_)__ ___ __
  311. // / _ \ | / _` \ \ /
  312. // /_/ \_\/ \__,_/_\_\
  313. // |__/
  314. // TODO: add url hash nav
  315. // TODO: implement history.js
  316. function initAjaxLinks(){
  317. console.log('initAjaxLinks');
  318. $('a', '#block-mainnavigation')
  319. .add('a', '#block-footer.menu--footer')
  320. .add('a', '#block-productions')
  321. .add('a', 'article.node:not(.node--type-enregistrement) h2.node-title')
  322. .add('a', '.productions-subtree')
  323. .add('a', '.productions-parent')
  324. // .add('a.index-link, a.notice-link', '#block-edlpentreesblock')
  325. .addClass('ajax-link');
  326. _$ajaxLinks = $('.ajax-link:not(.ajax-enabled)')
  327. .each(function(i,e){
  328. var $this = $(this);
  329. // avoid already ajaxified links
  330. if($this.is('.ajax-enable')) return;
  331. if($this.attr('data-drupal-link-system-path')){
  332. $this.on('click', onClickAjaxLink).addClass('ajax-enable');
  333. }
  334. });
  335. };
  336. function onClickAjaxLink(e){
  337. e.preventDefault();
  338. var $link = $(this);
  339. if($link.is('.is-active'))
  340. return false;
  341. // Audio links
  342. if($link.is('.audio-link')){
  343. // TODO: stop randomplayer
  344. _audio_player
  345. .emmit('stop-shuffle')
  346. .openDocument({
  347. nid:$link.attr('nid'),
  348. audio_url:$link.attr('audio_url')
  349. });
  350. return false;
  351. }
  352. // other links
  353. var sys_path = $(this).attr('data-drupal-link-system-path');
  354. var ajax_path = sys_path;
  355. if(sys_path == '<front>'){
  356. backToFrontPage();
  357. return false;
  358. }
  359. // convert node link to edlp_ajax_node module links
  360. var node_match = ajax_path.match(/^\/?(node\/\d+)$/g);
  361. var term_match = ajax_path.match(/^\/?(taxonomy\/term\/\d+)$/g);
  362. if(node_match){
  363. ajax_path = 'edlp/ajax/json/'+node_match[0];
  364. // check for viewmode attribute
  365. if($link.attr('viewmode')){
  366. ajax_path += '/'+$link.attr('viewmode');
  367. }
  368. }else if(term_match){
  369. ajax_path = 'edlp/ajax/json/'+term_match[0];
  370. ajax_path = ajax_path.replace(/taxonomy\/term/, 'taxonomy_term');
  371. // check for viewmode attribute
  372. if($link.attr('viewmode')){
  373. ajax_path += '/'+$link.attr('viewmode');
  374. }
  375. }else{
  376. // convert other link to ajax
  377. ajax_path += '/ajax'
  378. }
  379. _$body.addClass('ajax-loading');
  380. $link.addClass('ajax-loading');
  381. // TODO: use Drupal.url()
  382. // Drupal.url = function (path) {
  383. // return drupalSettings.path.baseUrl + drupalSettings.path.pathPrefix + path;
  384. // };
  385. var path = window.location.origin + Drupal.url(ajax_path);
  386. $.getJSON(path, {})
  387. .done(function(data){
  388. onAjaxLinkLoaded(data, $link, sys_path);
  389. })
  390. .fail(function(jqxhr, textStatus, error){
  391. onAjaxLinkLoadError(jqxhr, textStatus, error, $link, sys_path);
  392. });
  393. return false;
  394. };
  395. function onAjaxLinkLoadError(jqxhr, textStatus, error, $link, sys_path){
  396. console.warn('ajaxlink load failed for '+sys_path+' : '+error, jqxhr.responseText);
  397. $link.removeClass('ajax-loading');
  398. _$body.removeClass('ajax-loading');
  399. };
  400. function onAjaxLinkLoaded(data, $link, sys_path){
  401. console.log('ajax link loaded : data', data);
  402. _$body.removeClass('ajax-loading');
  403. // replace all content with newly loaded
  404. // TODO: build a system to replace or append contents (like studio + search)
  405. _$row.html(data.rendered);
  406. // add close btn
  407. if(sys_path != 'procuction'){
  408. addCloseBtnToCols();
  409. }
  410. // add body class for currently loaded content
  411. var body_classes = [
  412. 'path-'+sys_path.replace(/\//g, '-'),
  413. 'entity-type-'+data.entity_type,
  414. 'bundle-'+data.bundle,
  415. 'view-mode-'+data.view_mode
  416. ];
  417. _$body.removeClass().addClass(body_classes.join(' '));
  418. // id node add a generic path-node class to body
  419. m = sys_path.match(/^\/?(node\/\d+)$/g);
  420. if(m)
  421. _$body.addClass('path-edlp-node');
  422. // handle clicked link classes
  423. _$ajaxLinks.removeClass('is-active');
  424. $link.removeClass('ajax-loading').addClass('is-active');
  425. // if block attached (eg : from edlp_productions module)
  426. if(typeof data.block != 'undefined'){
  427. // if block not already added
  428. if(!$('#'+data.block.id, '.region-'+data.block.region).length){
  429. $('.region-'+data.block.region).append(data.block.rendered);
  430. }
  431. }
  432. initScrollbars();
  433. if(sys_path == "productions")
  434. initProductions();
  435. initAjaxLinks();
  436. _$body.trigger({'type':'new-content-ajax-loaded'});
  437. // call behaviours
  438. Drupal.attachBehaviors(_$row[0]);
  439. };
  440. function addCloseBtnToCols(){
  441. $('.col', _$row).each(function(index, el) {
  442. if($('span.close-col-btn', this).length)
  443. return true;
  444. $(this).children('.wrapper').append($('<span>')
  445. .addClass('close-col-btn')
  446. .on('click', function(e){
  447. // check for theme attribute and emmit event
  448. var $col = $(this).parents('.col');
  449. var theme = $col.attr('theme');
  450. if(theme != ''){
  451. _$body.trigger({'type':theme+'-col-closed'});
  452. }
  453. // remove the col
  454. $col.remove();
  455. // if row is empty call closeAllModals()
  456. if(!$('.col', _$row).length){
  457. backToFrontPage();
  458. }
  459. })
  460. );
  461. });
  462. };
  463. // ___
  464. // / __|___ _ _ _ __ _ _ ___
  465. // | (__/ _ \ '_| '_ \ || (_-<
  466. // \___\___/_| | .__/\_,_/__/
  467. // |_|
  468. function onCorpusMapReady(e){
  469. console.log('theme : onCorpusReady', e);
  470. _$corpus_canvas = $('canvas#corpus-map');
  471. _$corpus_canvas
  472. .on('corpus-cliked-on-map', function(e) {
  473. console.log('theme : corpus-cliked-on-map');
  474. backToFrontPage();
  475. })
  476. .on('corpus-cliked-on-node', function(e) {
  477. console.log('theme : corpus-cliked-on-node', e);
  478. _audio_player
  479. .emmit('stop-shuffle')
  480. .openDocument(e.target_node);
  481. });
  482. _randomPlayer = new RandomPlayer(e.playlist);
  483. _$body.attr('corpus-map', 'ready');
  484. }
  485. // ___ _ ___ _
  486. // | _ \__ _ _ _ __| |___ _ __ | _ \ |__ _ _ _ ___ _ _
  487. // | / _` | ' \/ _` / _ \ ' \| _/ / _` | || / -_) '_|
  488. // |_|_\__,_|_||_\__,_\___/_|_|_|_| |_\__,_|\_, \___|_|
  489. // |__/
  490. function RandomPlayer(playlist){
  491. this.active = false;
  492. this.playlist = playlist;
  493. this.$btn = $('<a>').html('Shuffle').addClass('random-player-btn');
  494. this.init()
  495. };
  496. RandomPlayer.prototype = {
  497. init(){
  498. // this.shuffle();
  499. $('<div>')
  500. .addClass('block random-player')
  501. .append(this.$btn)
  502. .insertAfter('#block-userlogin, #block-studiolinkblock');
  503. // events
  504. this.$btn.on('click', this.toggleActive.bind(this));
  505. // attach an event on AudioPlayer
  506. _audio_player
  507. .on('audio-ended', this.onAudioPlayerEnded.bind(this))
  508. .on('audio-play-next', this.onAudioPlayNext.bind(this))
  509. .on('stop-shuffle', this.stop.bind(this));
  510. },
  511. shuffle(){
  512. var tempPLaylist = [];
  513. for (var i = this.playlist.length-1; i >= 0 ; i--) {
  514. tempPLaylist.push(this.playlist[i]);
  515. }
  516. this.shuffledPlaylist = [];
  517. while(tempPLaylist.length > 0){
  518. var r = Math.floor(Math.random() * tempPLaylist.length);
  519. this.shuffledPlaylist.push(tempPLaylist.splice(r,1)[0]);
  520. }
  521. console.log('RandomPlayer, this.shuffledPlaylist', this.shuffledPlaylist);
  522. },
  523. toggleActive(e){
  524. if (this.active) {
  525. this.stop();
  526. }else{
  527. this.start();
  528. }
  529. },
  530. start(){
  531. this.active = _audio_player.shuffle_is_active = true;
  532. this.$btn.addClass('is-active');
  533. this.shuffle();
  534. this.next();
  535. },
  536. stop(){
  537. this.active = _audio_player.shuffle_is_active = false;
  538. this.$btn.removeClass('is-active');
  539. // stop audio player
  540. // _audio_player.stop();
  541. },
  542. next(){
  543. if(this.active && this.shuffledPlaylist.length > 0)
  544. _audio_player.openDocument(this.shuffledPlaylist.splice(0,1)[0]);
  545. },
  546. onAudioPlayNext(){
  547. console.log('RandomPlayer : onAudioPlayNext()');
  548. this.next();
  549. },
  550. onAudioPlayerEnded(){
  551. console.log('RandomPlayer : onAudioPlayerEnded()');
  552. this.next();
  553. }
  554. };
  555. // ___ _ _ _
  556. // | _ \_ _ ___ __| |_ _ __| |_(_)___ _ _ ___
  557. // | _/ '_/ _ \/ _` | || / _| _| / _ \ ' \(_-<
  558. // |_| |_| \___/\__,_|\_,_\__|\__|_\___/_||_/__/
  559. function initProductions(){
  560. console.log('theme : initProductions');
  561. var $grid = $('.row', _$row).masonry({
  562. itemSelector:'.col',
  563. columnWidth:'.col-2'
  564. });
  565. // layout Masonry after each image loads
  566. $grid.imagesLoaded().progress( function() {
  567. $grid.masonry('layout');
  568. });
  569. // var $grid = $('.row', _$row).imagesLoaded( function() {
  570. // // init Masonry after all images have loaded
  571. // $grid.masonry({
  572. // itemSelector:'.col',
  573. // columnWidth:'.col-2'
  574. // });
  575. // });
  576. };
  577. // ___ _ ___
  578. // | __| _ ___ _ _| |_| _ \__ _ __ _ ___
  579. // | _| '_/ _ \ ' \ _| _/ _` / _` / -_)
  580. // |_||_| \___/_||_\__|_| \__,_\__, \___|
  581. // |___/
  582. function backToFrontPage(){
  583. closeAllModals();
  584. // assume we are going back to front page
  585. $('body').removeClass().addClass('path-frontpage');
  586. $('a[data-drupal-link-system-path="<front>"]').addClass('is-active');
  587. }
  588. // __ __ _ _
  589. // | \/ |___ __| |__ _| |___
  590. // | |\/| / _ \/ _` / _` | (_-<
  591. // |_| |_\___/\__,_\__,_|_/__/
  592. function closeAllModals(){
  593. console.log('theme : closeAllModals');
  594. // TODO: animate the remove
  595. _$row.html('');
  596. _$ajaxLinks.removeClass('is-active');
  597. };
  598. init();
  599. } // end EdlpTheme()
  600. $(document).ready(function($) {
  601. var edlptheme = new EdlpTheme();
  602. });
  603. })(jQuery, Drupal, drupalSettings);