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