main.js 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658
  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. _$corpus_canvas.trigger({
  135. 'type':'audio-node-opened',
  136. 'nid':this.historic[this.currentHistoricIndex].nid
  137. });
  138. this.showHidePreviousBtn();
  139. this.showHideNextBtn();
  140. this.show();
  141. },
  142. // audio functions
  143. setSRC(url){
  144. // console.log('AudioPlayer setSRC : url', url);
  145. this.audio.src = url;
  146. },
  147. onLoadedmetadata(){
  148. var rem = parseInt(this.audio.duration, 10),
  149. mins = Math.floor(rem/60,10),
  150. secs = rem - mins*60;
  151. this.$duration.html('<span>'+(mins<10 ? '0':'')+mins+':'+(secs<10 ? '0':'')+secs+'</span>');
  152. this.updateLoadingBar();
  153. },
  154. updateLoadingBar(){
  155. this.$loader.css({
  156. 'width':parseInt((100 * this.audio.buffered.end(0) / this.audio.duration), 10)+'%'
  157. });
  158. if( this.audio.buffered.end(0) < this.audio.duration ){
  159. // loop through this function until file is fully loaded
  160. var that = this;
  161. window.requestAnimationFrame(that.updateLoadingBar.bind(that));
  162. }else{
  163. console.log('Audio fully loaded');
  164. }
  165. },
  166. onCanplay(){
  167. this.play();
  168. },
  169. play(){
  170. this.audio.play();
  171. },
  172. playPrevious(){
  173. if(this.currentHistoricIndex > 0){
  174. this.currentHistoricIndex -= 1;
  175. this.launch();
  176. }
  177. },
  178. playNext(){
  179. if(this.currentHistoricIndex < this.historic.length-1){
  180. this.currentHistoricIndex += 1;
  181. this.launch();
  182. }else{
  183. this.emmit('audio-play-next');
  184. }
  185. },
  186. togglePlayPause(e){
  187. if(this.audio.paused){
  188. this.audio.play();
  189. }else{
  190. this.audio.pause();
  191. }
  192. },
  193. stop(){
  194. console.log('AudioPlayer stop()');
  195. this.audio.pause();
  196. this.timeOutToHide();
  197. },
  198. // audio events
  199. onPlaying(){
  200. this.$container.addClass('is-playing');
  201. },
  202. onPause(){
  203. this.$container.removeClass('is-playing');
  204. },
  205. onTimeupdate(){
  206. // move cursor
  207. this.$cursor.css({
  208. 'left':(this.audio.currentTime/this.audio.duration * this.timeline_w)+"px"
  209. });
  210. // update time text display
  211. var rem = parseInt(this.audio.currentTime, 10),
  212. mins = Math.floor(rem/60,10),
  213. secs = rem - mins*60;
  214. this.$currentTime.html('<span>'+(mins<10 ? '0':'')+mins+':'+(secs<10 ? '0':'')+secs+'</span>');
  215. },
  216. onEnded(){
  217. this.emmit('audio-ended');
  218. this.stop();
  219. },
  220. // cartel functions
  221. loadNode(nid){
  222. this.$cartel.addClass('loading');
  223. $.getJSON('/edlp/ajax/json/node/'+nid+'/player_cartel', {})
  224. .done(this.onNodeLoaded.bind(this))
  225. .fail(this.onNodeLoadFail.bind(this));
  226. },
  227. onNodeLoaded(data){
  228. console.log('AudioPlayer node loaded');
  229. this.$cartel.html(data.rendered).removeClass('loading');
  230. _$body.trigger({'type':'new-audio-cartel-loaded'});
  231. initAjaxLinks();
  232. },
  233. onNodeLoadFail(jqxhr, textStatus, error){
  234. console.warn('AudioPlayer node load failed', jqxhr.responseText);
  235. this.$cartel.removeClass('loading').html('');
  236. },
  237. // global
  238. show(){
  239. this.$container.addClass('visible');
  240. },
  241. showHidePreviousBtn(){
  242. if(this.historic.length > 1 && this.currentHistoricIndex > 0){
  243. this.$previous.addClass('is-active');
  244. }else{
  245. this.$previous.removeClass('is-active');
  246. }
  247. },
  248. showHideNextBtn(){
  249. if(this.currentHistoricIndex < this.historic.length-1 || this.shuffle_is_active){
  250. this.$next.addClass('is-active');
  251. }else{
  252. this.$next.removeClass('is-active');
  253. }
  254. },
  255. timeOutToHide(){
  256. console.log('AudioPlayer timeOutToHide()');
  257. this.clearTimeOutToHide();
  258. this.hideTimer = setTimeout(this.hide.bind(this), this.hideTimeMS);
  259. },
  260. clearTimeOutToHide(){
  261. console.log('AudioPlayer clearTimeOutToHide()',this.hideTimer);
  262. if(this.hideTimer){
  263. clearTimeout(this.hideTimer);
  264. this.hideTimer = false;
  265. }
  266. },
  267. hide(){
  268. console.log('AudioPlayer hide()');
  269. this.$container.removeClass('visible');
  270. // trigger highlighted node remove on corpus map
  271. _$corpus_canvas.trigger('audio-node-closed');
  272. },
  273. // object events
  274. on(event_name, handler){
  275. if(typeof this.event_handlers[event_name] == 'undefined'){
  276. console.warn('AudioPlayer : event '+event_name+' does not exists');
  277. }
  278. this.event_handlers[event_name].push(handler);
  279. return this;
  280. },
  281. emmit(event_name){
  282. var handler;
  283. for (var i = this.event_handlers[event_name].length; i >= 0 ; i--) {
  284. handler = this.event_handlers[event_name][i];
  285. setTimeout(handler, 0);
  286. }
  287. return this;
  288. },
  289. }
  290. // ___ _ _ ___
  291. // / __| __ _ _ ___| | | _ ) __ _ _ _ ___
  292. // \__ \/ _| '_/ _ \ | | _ \/ _` | '_(_-<
  293. // |___/\__|_| \___/_|_|___/\__,_|_| /__/
  294. function initScrollbars(){
  295. // console.log("initScrollbars");
  296. // TODO: find a better js scroll than overlayScrollbars which does not handle well max-height + overflow-y:auto;
  297. // $('.os-scroll').overlayScrollbars({
  298. // overflowBehavior:{
  299. // x:'h',
  300. // y:'scroll',
  301. // clipAlways:false
  302. // }
  303. // });
  304. };
  305. // _ _
  306. // /_\ (_)__ ___ __
  307. // / _ \ | / _` \ \ /
  308. // /_/ \_\/ \__,_/_\_\
  309. // |__/
  310. // TODO: add url hash nav
  311. // TODO: implement history.js
  312. function initAjaxLinks(){
  313. console.log('initAjaxLinks');
  314. $('a', '#block-mainnavigation')
  315. .add('a', '#block-footer.menu--footer')
  316. .add('a', '#block-productions')
  317. .add('a', 'article.node:not(.node--type-enregistrement) h2.node-title')
  318. .add('a', '.productions-subtree')
  319. .add('a', '.productions-parent')
  320. // .add('a.index-link, a.notice-link', '#block-edlpentreesblock')
  321. .addClass('ajax-link');
  322. _$ajaxLinks = $('.ajax-link:not(.ajax-enabled)')
  323. .each(function(i,e){
  324. var $this = $(this);
  325. // avoid already ajaxified links
  326. if($this.is('.ajax-enable')) return;
  327. if($this.attr('data-drupal-link-system-path')){
  328. $this.on('click', onClickAjaxLink).addClass('ajax-enable');
  329. }
  330. });
  331. };
  332. function onClickAjaxLink(e){
  333. e.preventDefault();
  334. var $link = $(this);
  335. if($link.is('.is-active'))
  336. return false;
  337. // Audio links
  338. if($link.is('.audio-link')){
  339. // TODO: stop randomplayer
  340. _audio_player
  341. .emmit('stop-shuffle')
  342. .openDocument({
  343. nid:$link.attr('nid'),
  344. audio_url:$link.attr('audio_url')
  345. });
  346. return false;
  347. }
  348. // other links
  349. var sys_path = $(this).attr('data-drupal-link-system-path');
  350. var ajax_path = sys_path;
  351. if(sys_path == '<front>'){
  352. backToFrontPage();
  353. return false;
  354. }
  355. // convert node link to edlp_ajax_node module links
  356. var node_match = ajax_path.match(/^\/?(node\/\d+)$/g);
  357. var term_match = ajax_path.match(/^\/?(taxonomy\/term\/\d+)$/g);
  358. if(node_match){
  359. ajax_path = 'edlp/ajax/json/'+node_match[0];
  360. // check for viewmode attribute
  361. if($link.attr('viewmode')){
  362. ajax_path += '/'+$link.attr('viewmode');
  363. }
  364. }else if(term_match){
  365. ajax_path = 'edlp/ajax/json/'+term_match[0];
  366. ajax_path = ajax_path.replace(/taxonomy\/term/, 'taxonomy_term');
  367. // check for viewmode attribute
  368. if($link.attr('viewmode')){
  369. ajax_path += '/'+$link.attr('viewmode');
  370. }
  371. }else{
  372. // convert other link to ajax
  373. ajax_path += '/ajax'
  374. }
  375. _$body.addClass('ajax-loading');
  376. $link.addClass('ajax-loading');
  377. // TODO: use Drupal.url()
  378. // Drupal.url = function (path) {
  379. // return drupalSettings.path.baseUrl + drupalSettings.path.pathPrefix + path;
  380. // };
  381. var path = window.location.origin + Drupal.url(ajax_path);
  382. $.getJSON(path, {})
  383. .done(function(data){
  384. onAjaxLinkLoaded(data, $link, sys_path);
  385. })
  386. .fail(function(jqxhr, textStatus, error){
  387. onAjaxLinkLoadError(jqxhr, textStatus, error, $link, sys_path);
  388. });
  389. return false;
  390. };
  391. function onAjaxLinkLoadError(jqxhr, textStatus, error, $link, sys_path){
  392. console.warn('ajaxlink load failed for '+sys_path+' : '+error, jqxhr.responseText);
  393. $link.removeClass('ajax-loading');
  394. _$body.removeClass('ajax-loading');
  395. };
  396. function onAjaxLinkLoaded(data, $link, sys_path){
  397. console.log('ajax link loaded : data', data);
  398. _$body.removeClass('ajax-loading');
  399. // replace all content with newly loaded
  400. // TODO: build a system to replace or append contents (like studio + search)
  401. _$row.html(data.rendered);
  402. // add close btn
  403. if(sys_path != 'procuction'){
  404. addCloseBtnToCols();
  405. }
  406. // add body class for currently loaded content
  407. var body_classes = [
  408. 'path-'+sys_path.replace(/\//g, '-'),
  409. 'entity-type-'+data.entity_type,
  410. 'bundle-'+data.bundle,
  411. 'view-mode-'+data.view_mode
  412. ];
  413. _$body.removeClass().addClass(body_classes.join(' '));
  414. // id node add a generic path-node class to body
  415. m = sys_path.match(/^\/?(node\/\d+)$/g);
  416. if(m)
  417. _$body.addClass('path-edlp-node');
  418. // handle clicked link classes
  419. _$ajaxLinks.removeClass('is-active');
  420. $link.removeClass('ajax-loading').addClass('is-active');
  421. // if block attached (eg : from edlp_productions module)
  422. if(typeof data.block != 'undefined'){
  423. // if block not already added
  424. if(!$('#'+data.block.id, '.region-'+data.block.region).length){
  425. $('.region-'+data.block.region).append(data.block.rendered);
  426. }
  427. }
  428. initScrollbars();
  429. if(sys_path == "productions")
  430. initProductions();
  431. initAjaxLinks();
  432. _$body.trigger({'type':'new-content-ajax-loaded'});
  433. // call behaviours
  434. Drupal.attachBehaviors(_$row[0]);
  435. };
  436. function addCloseBtnToCols(){
  437. $('.col', _$row).each(function(index, el) {
  438. if($('span.close-col-btn', this).length)
  439. return true;
  440. $(this).children('.wrapper').append($('<span>')
  441. .addClass('close-col-btn')
  442. .on('click', function(e){
  443. // check for theme attribute and emmit event
  444. var $col = $(this).parents('.col');
  445. var theme = $col.attr('theme');
  446. if(theme != ''){
  447. _$body.trigger({'type':theme+'-col-closed'});
  448. }
  449. // remove the col
  450. $col.remove();
  451. // if row is empty call closeAllModals()
  452. if(!$('.col', _$row).length){
  453. backToFrontPage();
  454. }
  455. })
  456. );
  457. });
  458. };
  459. // ___
  460. // / __|___ _ _ _ __ _ _ ___
  461. // | (__/ _ \ '_| '_ \ || (_-<
  462. // \___\___/_| | .__/\_,_/__/
  463. // |_|
  464. function onCorpusMapReady(e){
  465. console.log('theme : onCorpusReady', e);
  466. _$corpus_canvas = $('canvas#corpus-map');
  467. _$corpus_canvas
  468. .on('corpus-cliked-on-map', function(e) {
  469. console.log('theme : corpus-cliked-on-map');
  470. backToFrontPage();
  471. })
  472. .on('corpus-cliked-on-node', function(e) {
  473. console.log('theme : corpus-cliked-on-node', e);
  474. _audio_player
  475. .emmit('stop-shuffle')
  476. .openDocument(e.target_node);
  477. });
  478. _randomPlayer = new RandomPlayer(e.playlist);
  479. _$body.attr('corpus-map', 'ready');
  480. }
  481. // ___ _ ___ _
  482. // | _ \__ _ _ _ __| |___ _ __ | _ \ |__ _ _ _ ___ _ _
  483. // | / _` | ' \/ _` / _ \ ' \| _/ / _` | || / -_) '_|
  484. // |_|_\__,_|_||_\__,_\___/_|_|_|_| |_\__,_|\_, \___|_|
  485. // |__/
  486. function RandomPlayer(playlist){
  487. this.active = false;
  488. this.playlist = playlist;
  489. this.$btn = $('<a>').html('Shuffle').addClass('random-player-btn');
  490. this.init()
  491. };
  492. RandomPlayer.prototype = {
  493. init(){
  494. // this.shuffle();
  495. $('<div>')
  496. .addClass('block random-player')
  497. .append(this.$btn)
  498. .insertAfter('#block-userlogin, #block-studiolinkblock');
  499. // events
  500. this.$btn.on('click', this.toggleActive.bind(this));
  501. // attach an event on AudioPlayer
  502. _audio_player
  503. .on('audio-ended', this.onAudioPlayerEnded.bind(this))
  504. .on('audio-play-next', this.onAudioPlayNext.bind(this))
  505. .on('stop-shuffle', this.stop.bind(this));
  506. },
  507. shuffle(){
  508. var tempPLaylist = [];
  509. for (var i = this.playlist.length-1; i >= 0 ; i--) {
  510. tempPLaylist.push(this.playlist[i]);
  511. }
  512. this.shuffledPlaylist = [];
  513. while(tempPLaylist.length > 0){
  514. var r = Math.floor(Math.random() * tempPLaylist.length);
  515. this.shuffledPlaylist.push(tempPLaylist.splice(r,1)[0]);
  516. }
  517. console.log('RandomPlayer, this.shuffledPlaylist', this.shuffledPlaylist);
  518. },
  519. toggleActive(e){
  520. if (this.active) {
  521. this.stop();
  522. }else{
  523. this.start();
  524. }
  525. },
  526. start(){
  527. this.active = _audio_player.shuffle_is_active = true;
  528. this.$btn.addClass('is-active');
  529. this.shuffle();
  530. this.next();
  531. },
  532. stop(){
  533. this.active = _audio_player.shuffle_is_active = false;
  534. this.$btn.removeClass('is-active');
  535. // stop audio player
  536. // _audio_player.stop();
  537. },
  538. next(){
  539. if(this.active && this.shuffledPlaylist.length > 0)
  540. _audio_player.openDocument(this.shuffledPlaylist.splice(0,1)[0]);
  541. },
  542. onAudioPlayNext(){
  543. console.log('RandomPlayer : onAudioPlayNext()');
  544. this.next();
  545. },
  546. onAudioPlayerEnded(){
  547. console.log('RandomPlayer : onAudioPlayerEnded()');
  548. this.next();
  549. }
  550. };
  551. // ___ _ _ _
  552. // | _ \_ _ ___ __| |_ _ __| |_(_)___ _ _ ___
  553. // | _/ '_/ _ \/ _` | || / _| _| / _ \ ' \(_-<
  554. // |_| |_| \___/\__,_|\_,_\__|\__|_\___/_||_/__/
  555. function initProductions(){
  556. console.log('theme : initProductions');
  557. var $grid = $('.row', _$row).masonry({
  558. itemSelector:'.col',
  559. columnWidth:'.col-2'
  560. });
  561. // layout Masonry after each image loads
  562. $grid.imagesLoaded().progress( function() {
  563. $grid.masonry('layout');
  564. });
  565. // var $grid = $('.row', _$row).imagesLoaded( function() {
  566. // // init Masonry after all images have loaded
  567. // $grid.masonry({
  568. // itemSelector:'.col',
  569. // columnWidth:'.col-2'
  570. // });
  571. // });
  572. };
  573. // ___ _ ___
  574. // | __| _ ___ _ _| |_| _ \__ _ __ _ ___
  575. // | _| '_/ _ \ ' \ _| _/ _` / _` / -_)
  576. // |_||_| \___/_||_\__|_| \__,_\__, \___|
  577. // |___/
  578. function backToFrontPage(){
  579. closeAllModals();
  580. // assume we are going back to front page
  581. $('body').removeClass().addClass('path-frontpage');
  582. $('a[data-drupal-link-system-path="<front>"]').addClass('is-active');
  583. }
  584. // __ __ _ _
  585. // | \/ |___ __| |__ _| |___
  586. // | |\/| / _ \/ _` / _` | (_-<
  587. // |_| |_\___/\__,_\__,_|_/__/
  588. function closeAllModals(){
  589. console.log('theme : closeAllModals');
  590. // TODO: animate the remove
  591. _$row.html('');
  592. _$ajaxLinks.removeClass('is-active');
  593. };
  594. init();
  595. } // end EdlpTheme()
  596. $(document).ready(function($) {
  597. var edlptheme = new EdlpTheme();
  598. });
  599. })(jQuery, Drupal, drupalSettings);