main.js 21 KB

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