js cleaning
This commit is contained in:
@@ -12,11 +12,7 @@
|
||||
|
||||
/**
|
||||
* depends on :
|
||||
*
|
||||
|
||||
* physics.js : http://jonobr1.com/Physics/#
|
||||
* EaselJS : https://createjs.com/docs/easeljs/modules/EaselJS.html
|
||||
*
|
||||
*/
|
||||
|
||||
(function($, Drupal, drupalSettings) {
|
||||
@@ -35,7 +31,6 @@
|
||||
'margin_left':0
|
||||
};
|
||||
var _physics = new Physics();
|
||||
// var _stage = new createjs.Stage('corpus-map');
|
||||
var _nodes = [];
|
||||
var _articles_nodes = [];
|
||||
var _no_articles_nodes = [];
|
||||
@@ -47,8 +42,6 @@
|
||||
|
||||
var _playlist = [];
|
||||
|
||||
// var _particules = [];
|
||||
// var _base_radius = 3; // nodes radius (real radius, not diametre)
|
||||
var _p_velocity_factor = 0.5;
|
||||
var _mouse_in = true;
|
||||
var _m_pos = {x:0, y:0};
|
||||
@@ -60,9 +53,7 @@
|
||||
var _node_pop_up;
|
||||
// Colors depend on drupalSettings loaded by edlp_corpus.module
|
||||
var _settings = drupalSettings.edlp_corpus;
|
||||
// load_corpus_ajax_url
|
||||
var _ecolors = _settings.colors;
|
||||
//console.log('Corpus : _ecolors', _ecolors);
|
||||
// Physics
|
||||
var _attracter,
|
||||
_repulser_top,
|
||||
@@ -709,7 +700,6 @@
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// ___ _
|
||||
// / __| ___ __ _ _ _ __| |_
|
||||
// \__ \/ -_) _` | '_/ _| ' \
|
||||
@@ -730,7 +720,6 @@
|
||||
createNodesRepulsions();
|
||||
};
|
||||
|
||||
|
||||
// ___ _ _ _
|
||||
// / __| __ _ _ __ _ _ __ | |__| (_)_ _ __ _
|
||||
// \__ \/ _| '_/ _` | ' \| '_ \ | | ' \/ _` |
|
||||
@@ -808,6 +797,7 @@
|
||||
if(_$articles_link.is('.is-active'))
|
||||
_$articles_link.trigger('click');
|
||||
};
|
||||
|
||||
// ___ _
|
||||
// | __|_ _____ _ _| |_ ___
|
||||
// | _|\ V / -_) ' \ _(_-<
|
||||
@@ -909,7 +899,6 @@
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
function checkPreOpenedEntry(){
|
||||
_$entrees_block.find('li.entree').each(function(index, el) {
|
||||
var $li = $(this);
|
||||
@@ -1046,10 +1035,8 @@
|
||||
init();
|
||||
}
|
||||
|
||||
|
||||
$(document).ready(function($) {
|
||||
var edlpcorpus = new EdlpCorpus();
|
||||
});
|
||||
|
||||
|
||||
})(jQuery, Drupal, drupalSettings);
|
||||
|
||||
@@ -12,11 +12,7 @@
|
||||
|
||||
/**
|
||||
* depends on :
|
||||
*
|
||||
|
||||
* physics.js : http://jonobr1.com/Physics/#
|
||||
* EaselJS : https://createjs.com/docs/easeljs/modules/EaselJS.html
|
||||
*
|
||||
*/
|
||||
|
||||
(function($, Drupal, drupalSettings) {
|
||||
@@ -35,7 +31,6 @@
|
||||
'margin_left':0
|
||||
};
|
||||
var _physics = new Physics();
|
||||
// var _stage = new createjs.Stage('corpus-map');
|
||||
var _nodes = [];
|
||||
var _articles_nodes = [];
|
||||
var _no_articles_nodes = [];
|
||||
@@ -47,8 +42,6 @@
|
||||
|
||||
var _playlist = [];
|
||||
|
||||
// var _particules = [];
|
||||
// var _base_radius = 3; // nodes radius (real radius, not diametre)
|
||||
var _p_velocity_factor = 0.5;
|
||||
var _mouse_in = true;
|
||||
var _m_pos = {x:0, y:0};
|
||||
@@ -60,9 +53,7 @@
|
||||
var _node_pop_up;
|
||||
// Colors depend on drupalSettings loaded by edlp_corpus.module
|
||||
var _settings = drupalSettings.edlp_corpus;
|
||||
// load_corpus_ajax_url
|
||||
var _ecolors = _settings.colors;
|
||||
//console.log('Corpus : _ecolors', _ecolors);
|
||||
// Physics
|
||||
var _attracter,
|
||||
_repulser_top,
|
||||
@@ -709,7 +700,6 @@
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// ___ _
|
||||
// / __| ___ __ _ _ _ __| |_
|
||||
// \__ \/ -_) _` | '_/ _| ' \
|
||||
@@ -730,7 +720,6 @@
|
||||
createNodesRepulsions();
|
||||
};
|
||||
|
||||
|
||||
// ___ _ _ _
|
||||
// / __| __ _ _ __ _ _ __ | |__| (_)_ _ __ _
|
||||
// \__ \/ _| '_/ _` | ' \| '_ \ | | ' \/ _` |
|
||||
@@ -808,6 +797,7 @@
|
||||
if(_$articles_link.is('.is-active'))
|
||||
_$articles_link.trigger('click');
|
||||
};
|
||||
|
||||
// ___ _
|
||||
// | __|_ _____ _ _| |_ ___
|
||||
// | _|\ V / -_) ' \ _(_-<
|
||||
@@ -909,7 +899,6 @@
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
function checkPreOpenedEntry(){
|
||||
_$entrees_block.find('li.entree').each(function(index, el) {
|
||||
var $li = $(this);
|
||||
@@ -1046,10 +1035,8 @@
|
||||
init();
|
||||
}
|
||||
|
||||
|
||||
$(document).ready(function($) {
|
||||
var edlpcorpus = new EdlpCorpus();
|
||||
});
|
||||
|
||||
|
||||
})(jQuery, Drupal, drupalSettings);
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
console.log('EDLP THEME MAIN.js');
|
||||
(function($, Drupal, drupalSettings) {
|
||||
|
||||
EdlpTheme = function(){
|
||||
@@ -32,10 +31,6 @@ console.log('EDLP THEME MAIN.js');
|
||||
_audioPlayer = new AudioPlayer();
|
||||
_compoPlayer = new CompoPlayer();
|
||||
|
||||
|
||||
// if (_$body.is('.path-productions')) initProductions();
|
||||
// if(_$body.is('.path-frontpage')) initHome();
|
||||
// initScrollbars();
|
||||
};
|
||||
|
||||
// ___ _
|
||||
@@ -148,7 +143,6 @@ console.log('EDLP THEME MAIN.js');
|
||||
}
|
||||
return state;
|
||||
};
|
||||
// function ajaxLoadContent(url, sys_path, ajax_path, selector){
|
||||
function ajaxLoadContent(state){
|
||||
console.log('ajaxLoadContent : url', state.url);
|
||||
_$body.addClass('ajax-loading');
|
||||
@@ -167,7 +161,6 @@ console.log('EDLP THEME MAIN.js');
|
||||
$('.ajax-loading').removeClass('ajax-loading');
|
||||
_$body.removeClass('ajax-loading');
|
||||
};
|
||||
// function onAjaxLoaded(data, url, ajax_path, sys_path, selector){
|
||||
function onAjaxLoaded(data, state){
|
||||
console.log('ajax loaded url:'+state.url+' ajax_path:'+state.ajax_path+' sys_path:'+state.sys_path);
|
||||
|
||||
@@ -467,7 +460,6 @@ console.log('EDLP THEME MAIN.js');
|
||||
|
||||
_$body.attr('corpus-map', 'ready');
|
||||
}
|
||||
|
||||
function openEntree(tid){
|
||||
if(tid){
|
||||
closeAllModals();
|
||||
@@ -1082,7 +1074,7 @@ console.log('EDLP THEME MAIN.js');
|
||||
// assume we are going back to front page
|
||||
$('body').removeClass().addClass('path-frontpage');
|
||||
$('a[data-drupal-link-system-path="<front>"]').addClass('is-active');
|
||||
// TODO: close entrees
|
||||
// close entrees
|
||||
_$corpus_canvas.trigger({'type':'close-all-entree'});
|
||||
}
|
||||
|
||||
@@ -1161,16 +1153,16 @@ console.log('EDLP THEME MAIN.js');
|
||||
// |_|
|
||||
|
||||
// https://plainjs.com/javascript/utilities/set-cookie-get-cookie-and-delete-cookie-5/
|
||||
function getCookie(name) {
|
||||
var v = document.cookie.match('(^|;) ?' + name + '=([^;]*)(;|$)');
|
||||
return v ? v[2] : null;
|
||||
}
|
||||
function setCookie(name, value, days) {
|
||||
var d = new Date;
|
||||
d.setTime(d.getTime() + 24*60*60*1000*days);
|
||||
document.cookie = name + "=" + value + ";path=/;expires=" + d.toGMTString();
|
||||
}
|
||||
function deleteCookie(name) { setCookie(name, '', -1); }
|
||||
// function getCookie(name) {
|
||||
// var v = document.cookie.match('(^|;) ?' + name + '=([^;]*)(;|$)');
|
||||
// return v ? v[2] : null;
|
||||
// }
|
||||
// function setCookie(name, value, days) {
|
||||
// var d = new Date;
|
||||
// d.setTime(d.getTime() + 24*60*60*1000*days);
|
||||
// document.cookie = name + "=" + value + ";path=/;expires=" + d.toGMTString();
|
||||
// }
|
||||
// function deleteCookie(name) { setCookie(name, '', -1); }
|
||||
|
||||
init();
|
||||
} // end EdlpTheme()
|
||||
@@ -1179,5 +1171,4 @@ console.log('EDLP THEME MAIN.js');
|
||||
var edlptheme = new EdlpTheme();
|
||||
});
|
||||
|
||||
|
||||
})(jQuery, Drupal, drupalSettings);
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
console.log('EDLP THEME MAIN.js');
|
||||
(function($, Drupal, drupalSettings) {
|
||||
|
||||
EdlpTheme = function(){
|
||||
@@ -32,10 +31,6 @@ console.log('EDLP THEME MAIN.js');
|
||||
_audioPlayer = new AudioPlayer();
|
||||
_compoPlayer = new CompoPlayer();
|
||||
|
||||
|
||||
// if (_$body.is('.path-productions')) initProductions();
|
||||
// if(_$body.is('.path-frontpage')) initHome();
|
||||
// initScrollbars();
|
||||
};
|
||||
|
||||
// ___ _
|
||||
@@ -148,7 +143,6 @@ console.log('EDLP THEME MAIN.js');
|
||||
}
|
||||
return state;
|
||||
};
|
||||
// function ajaxLoadContent(url, sys_path, ajax_path, selector){
|
||||
function ajaxLoadContent(state){
|
||||
console.log('ajaxLoadContent : url', state.url);
|
||||
_$body.addClass('ajax-loading');
|
||||
@@ -167,7 +161,6 @@ console.log('EDLP THEME MAIN.js');
|
||||
$('.ajax-loading').removeClass('ajax-loading');
|
||||
_$body.removeClass('ajax-loading');
|
||||
};
|
||||
// function onAjaxLoaded(data, url, ajax_path, sys_path, selector){
|
||||
function onAjaxLoaded(data, state){
|
||||
console.log('ajax loaded url:'+state.url+' ajax_path:'+state.ajax_path+' sys_path:'+state.sys_path);
|
||||
|
||||
@@ -467,7 +460,6 @@ console.log('EDLP THEME MAIN.js');
|
||||
|
||||
_$body.attr('corpus-map', 'ready');
|
||||
}
|
||||
|
||||
function openEntree(tid){
|
||||
if(tid){
|
||||
closeAllModals();
|
||||
@@ -1082,7 +1074,7 @@ console.log('EDLP THEME MAIN.js');
|
||||
// assume we are going back to front page
|
||||
$('body').removeClass().addClass('path-frontpage');
|
||||
$('a[data-drupal-link-system-path="<front>"]').addClass('is-active');
|
||||
// TODO: close entrees
|
||||
// close entrees
|
||||
_$corpus_canvas.trigger({'type':'close-all-entree'});
|
||||
}
|
||||
|
||||
@@ -1161,16 +1153,16 @@ console.log('EDLP THEME MAIN.js');
|
||||
// |_|
|
||||
|
||||
// https://plainjs.com/javascript/utilities/set-cookie-get-cookie-and-delete-cookie-5/
|
||||
function getCookie(name) {
|
||||
var v = document.cookie.match('(^|;) ?' + name + '=([^;]*)(;|$)');
|
||||
return v ? v[2] : null;
|
||||
}
|
||||
function setCookie(name, value, days) {
|
||||
var d = new Date;
|
||||
d.setTime(d.getTime() + 24*60*60*1000*days);
|
||||
document.cookie = name + "=" + value + ";path=/;expires=" + d.toGMTString();
|
||||
}
|
||||
function deleteCookie(name) { setCookie(name, '', -1); }
|
||||
// function getCookie(name) {
|
||||
// var v = document.cookie.match('(^|;) ?' + name + '=([^;]*)(;|$)');
|
||||
// return v ? v[2] : null;
|
||||
// }
|
||||
// function setCookie(name, value, days) {
|
||||
// var d = new Date;
|
||||
// d.setTime(d.getTime() + 24*60*60*1000*days);
|
||||
// document.cookie = name + "=" + value + ";path=/;expires=" + d.toGMTString();
|
||||
// }
|
||||
// function deleteCookie(name) { setCookie(name, '', -1); }
|
||||
|
||||
init();
|
||||
} // end EdlpTheme()
|
||||
@@ -1179,5 +1171,4 @@ console.log('EDLP THEME MAIN.js');
|
||||
var edlptheme = new EdlpTheme();
|
||||
});
|
||||
|
||||
|
||||
})(jQuery, Drupal, drupalSettings);
|
||||
|
||||
Reference in New Issue
Block a user