Commit 095f9523 authored by thomas craipeau's avatar thomas craipeau
Browse files

del console

parent 9802db72
......@@ -7,7 +7,7 @@ $(document).ready(function() {
function checkPoll(){
countPoll++;
console.log("countPoll",countPoll,"currentUrl",currentUrl);
//refactor check Log to use only one call with pollParams
//returning multple server checks in a unique ajax call
if(userId){
......@@ -113,10 +113,10 @@ function log(msg,type){
case 'debug': console.debug(msg); break;
case 'error': console.error(msg); break;
case 'dir': console.dir(msg); break;
default : console.log(msg);
default: console.log(msg);
}
} else
console.log(msg);
console.log(msg);
} catch (e) {
//alert(msg);
}
......@@ -145,7 +145,7 @@ function showEvent(id){
//Calling Actions in ajax. Can be used easily on views
function connectPerson(connectUserId, callback)
{
console.log("connect Person");
$.ajax({
type: "POST",
url: baseUrl+"/"+moduleId+'/person/follows',
......@@ -320,7 +320,7 @@ function connectTo(parentType, parentId, childId, childType, connectType, parent
"parentId" : parentId,
"connectType" : connectType,
};
console.log(formData);
if(connectType!="admin" && connectType !="attendee"){
bootbox.dialog({
......@@ -351,7 +351,7 @@ function connectTo(parentType, parentId, childId, childType, connectType, parent
formData.roles=role;
}
formData.connectType=answer;
console.log(formData);
$.ajax({
type: "POST",
url: baseUrl+"/"+moduleId+"/link/connect",
......@@ -508,18 +508,18 @@ var loadableUrls = {
};
function jsController(hash){
console.log("jsController",hash);
res = false;
$(".menuShortcuts").addClass("hide");
$.each( loadableUrls, function(urlIndex,urlObj)
{
//console.log("replaceAndShow2",urlIndex);
if( hash.indexOf(urlIndex) >= 0 )
{
checkMenu(urlObj, hash);
endPoint = loadableUrls[urlIndex];
console.log("jsController 2",endPoint,"login",endPoint.login,endPoint.hash );
if( typeof endPoint.login == undefined || !endPoint.login || ( endPoint.login && userId ) ){
//alises are renaming of urls example default.home could be #home
if( endPoint.alias ){
......@@ -567,7 +567,7 @@ function loadByHash( hash , back ) {
//alert("loadByHash");
console.warn("loadByHash",hash,back);
if( jsController(hash) ){
console.log("loadByHash >>> jsController",hash);
}
else if( hash.indexOf("#panel") >= 0 ){
panelName = hash.substr(7);
......@@ -625,7 +625,7 @@ function searchByHash (hash)
else if( searchT[2] == "quartier" )
scopeBtn = ".btn-scope-niv-2" ;
}
console.log("search : "+search,searchT, scopeBtn);
$(".input-global-search").val(search);
//startGlobalSearch();
if( scopeBtn )
......@@ -633,10 +633,10 @@ function searchByHash (hash)
}
function checkMenu(urlObj, hash){
console.log("checkMenu *******************", hash);
console.dir(urlObj);
$(".menu-button-left").removeClass("selected");
if(typeof urlObj.menuId != "undefined"){ console.log($("#"+urlObj.menuId).data("hash"));
if(typeof urlObj.menuId != "undefined"){
if($("#"+urlObj.menuId).data("hash") == hash)
$("#"+urlObj.menuId).addClass("selected");
}
......@@ -691,7 +691,7 @@ function showPanel(box,callback){
if(isMapEnd) showMap(false);
console.log("showPanel");
//showTopMenu(false);
$(".main-col-search").animate({ top: -1500, opacity:0 }, 500 );
......@@ -717,7 +717,7 @@ function processingBlockUi() {
}
function showAjaxPanel (url,title,icon) {
//$(".main-col-search").css("opacity", 0);
console.log("showAjaxPanel",url,"TITLE",title);
hideScrollTop = false;
showNotif(false);
......@@ -737,7 +737,7 @@ function showAjaxPanel (url,title,icon) {
//showPanel('box-ajax');
icon = (icon) ? " <i class='fa fa-"+icon+"'></i> " : "";
$(".panelTitle").html(icon+title).fadeIn();
console.log("GETAJAX",icon+title);
showTopMenu(true);
userIdBefore = userId;
......@@ -756,12 +756,12 @@ function showAjaxPanel (url,title,icon) {
$.unblockUI();
// setTimeout(function(){
// console.log("call timeout MAP MAP");
//
// getAjax('#mainMap',baseUrl+'/'+moduleId+"/search/mainmap",function(){
// toastr.info('<i class="fa fa-check"></i> Cartographie activée');
// showMap(false);
// $("#btn-toogle-map").show(400);
// //console.log("getAJAX OK timeout MAIN MAP");
//
// },"html");
// }, 2000);
......@@ -774,7 +774,7 @@ visualize all tagged elements on a map
**************/
function showTagOnMap (tag) {
console.log("showTagOnMap",tag);
var data = { "name" : tag,
"locality" : "",
......@@ -798,7 +798,7 @@ function showTagOnMap (tag) {
data: data,
dataType: "json",
error: function (data){
console.log("error"); console.dir(data);
console.dir(data);
},
success: function(data){
if(!data){ toastr.error(data.content); }
......@@ -821,7 +821,7 @@ function showTagOnMap (tag) {
show a definition in the focus menu panel
**************/
function showDefinition( id ){
console.log("showDefinition",id);
$(".main-col-search").animate({ opacity:0.3 }, 400 );
$(".hover-info").css("display" , "inline");
toggle( "."+id , ".explain" );
......@@ -834,7 +834,7 @@ var hoverPersist = false;
var positionMouseMenu = "out";
function activateHoverMenu () {
//console.log("enter all");
positionMouseMenu = "in";
$(".main-col-search").animate({ opacity:0.3 }, 400 );
$(".lbl-btn-menu-name").show(200);
......@@ -873,7 +873,7 @@ function openMenuSmall () {
var selection;
function bindHighlighter() {
//console.clear();
console.log("bindHighlighter");
console.dir(window.getSelection());
$(".my-main-container").bind('mouseup', function(e){
if (window.getSelection) {
......@@ -897,7 +897,7 @@ function bindHighlighter() {
}
function bindTags() {
console.log("bindTags");
var tagClasses = ".tag,.label tag_item_map_list"
$(".tag,.label tag_item_map_list").off().on('click', function(e){
if(userId){
......
......@@ -86,7 +86,7 @@ function isUniqueUsername(username) {
response = data;
}
});
console.log("isUniqueUsername=", response);
return response;
}
......@@ -107,7 +107,7 @@ function dateToStr(date, lang, inline, fullMonth){ //work with date formated : y
if(typeof date == "undefined") return;
if(fullMonth != true) fullMonth = false;
//console.log("convert format date 1", date);
if(typeof date.sec != "undefined"){
date = new Date(date.sec);
var yyyy = date.getFullYear().toString();
......@@ -121,7 +121,7 @@ function dateToStr(date, lang, inline, fullMonth){ //work with date formated : y
if(lang == "fr"){
//(year, month, day, hours, minutes, seconds, milliseconds)
//console.log("convert format date", date);
var year = date.substr(0, 4);
var month = date.substr(5, 2);//getMonthStr(date.substr(5, 2), lang);
var day = date.substr(8, 2);
......
......@@ -9,14 +9,14 @@ var totalData = 0;
var timeout = null;
function startSearch(indexMin, indexMax){
console.log("startSearch", indexMin, indexMax, indexStep);
console.log("loadingData", loadingData);
if(loadingData) return;
loadingData = true;
console.log("loadingData true");
indexStep = indexStepInit;
var name = $('#searchBarText').val();
......@@ -99,7 +99,7 @@ function autoCompleteSearch(name, locality, indexMin, indexMax){
4 : "REGION"
};
}
console.log("levelCommunexionName", levelCommunexionName[levelCommunexion]);
var data = {"name" : name, "locality" : locality, "searchType" : searchType, "searchBy" : levelCommunexionName[levelCommunexion],
"indexMin" : indexMin, "indexMax" : indexMax };
......@@ -128,7 +128,7 @@ function autoCompleteSearch(name, locality, indexMin, indexMax){
data: data,
dataType: "json",
error: function (data){
console.log("error"); console.dir(data);
console.dir(data);
},
success: function(data){
if(!data){ toastr.error(data.content); }
......@@ -318,14 +318,14 @@ function autoCompleteSearch(name, locality, indexMin, indexMax){
} //end else (str=="")
//signal que le chargement est terminé
console.log("loadingData false");
loadingData = false;
//quand la recherche est terminé, on remet la couleur normal du bouton search
$(".btn-start-search").removeClass("bg-azure");
}
$('.tooltips').tooltip();
console.log("scrollEnd ? ", scrollEnd, indexMax, countData , indexMin);
//si le nombre de résultat obtenu est inférieur au indexStep => tous les éléments ont été chargé et affiché
if(indexMax - countData > indexMin){
$("#btnShowMoreResult").remove();
......@@ -362,9 +362,9 @@ function autoCompleteSearch(name, locality, indexMin, indexMax){
var type = $(value).attr("data-type");
type = type + "s";
//console.log("#floopItem-"+type+"-"+id);
if($("#floopItem-"+type+"-"+id).length){
//console.log("I FOLLOW THIS");
$(value).html("<i class='fa fa-unlink text-green'></i>");
$(value).attr("data-ownerlink","unparticipate");
$(value).attr("data-original-title","Ne plus participer à l\'évènement");
......@@ -386,7 +386,7 @@ function autoCompleteSearch(name, locality, indexMin, indexMax){
type = type + "s";
var thiselement = this;
$(this).html("<i class='fa fa-spin fa-circle-o-notch text-azure'></i>");
console.log(formData);
if ($(this).attr("data-ownerlink")=="participate"){
formData.connectType = "attendee";
$.ajax({
......@@ -410,7 +410,7 @@ function autoCompleteSearch(name, locality, indexMin, indexMax){
});
} else if ($(this).attr("data-ownerlink")=="unparticipate"){
formData.connectType = "attendees";
console.log(formData);
$.ajax({
type: "POST",
url: baseUrl+"/"+moduleId+"/link/disconnect",
......
......@@ -9,12 +9,12 @@ var totalData = 0;
var timeout = null;
function startSearch(indexMin, indexMax){
//console.log("startSearch", indexMin, indexMax, indexStep);
if(loadingData) return;
loadingData = true;
//console.log("loadingData true");
indexStep = indexStepInit;
var name = $('#searchBarText').val();
......@@ -88,7 +88,7 @@ function autoCompleteSearch(name, locality, indexMin, indexMax){
4 : "REGION"
};
}
//console.log("levelCommunexionName", levelCommunexionName[levelCommunexion]);
var data = {"name" : name, "locality" : locality, "searchType" : searchType, "searchBy" : levelCommunexionName[levelCommunexion],
"indexMin" : indexMin, "indexMax" : indexMax };
......@@ -115,7 +115,7 @@ function autoCompleteSearch(name, locality, indexMin, indexMax){
data: data,
dataType: "json",
error: function (data){
console.log("error autocomplete search"); console.dir(data);
console.dir(data);
//signal que le chargement est terminé
loadingData = false;
},
......@@ -309,7 +309,7 @@ function autoCompleteSearch(name, locality, indexMin, indexMax){
$(".btn-start-search").removeClass("bg-azure");
}
//console.log("scrollEnd ? ", scrollEnd, indexMax, countData , indexMin);
//si le nombre de résultat obtenu est inférieur au indexStep => tous les éléments ont été chargé et affiché
if(indexMax - countData > indexMin){
$("#btnShowMoreResult").remove();
......@@ -335,9 +335,9 @@ function autoCompleteSearch(name, locality, indexMin, indexMax){
var type = $(value).attr("data-type");
if(type == "person") type = "people";
else type = type + "s";
//console.log("#floopItem-"+type+"-"+id);
if($("#floopItem-"+type+"-"+id).length){
//console.log("I FOLLOW THIS");
if(type=="people"){
$(value).html("<i class='fa fa-unlink text-green'></i>");
$(value).attr("data-original-title", "Ne plus suivre cette personne");
......@@ -381,7 +381,7 @@ function autoCompleteSearch(name, locality, indexMin, indexMax){
var thiselement = this;
$(this).html("<i class='fa fa-spin fa-circle-o-notch text-azure'></i>");
//console.log(formData);
if ($(this).attr("data-ownerlink")=="follow"){
$.ajax({
type: "POST",
......@@ -402,7 +402,7 @@ function autoCompleteSearch(name, locality, indexMin, indexMax){
});
} else if ($(this).attr("data-ownerlink")=="unfollow"){
formData.connectType = "followers";
//console.log(formData);
$.ajax({
type: "POST",
url: baseUrl+"/"+moduleId+"/link/disconnect",
......
......@@ -30,13 +30,13 @@ var totalDataGS = 0;
var mapElementsGS = new Array();
function startGlobalSearch(indexMin, indexMax){
console.log("startGlobalSearch", indexMin, indexMax, indexStepGS, loadingDataGS);
if(loadingDataGS) return;
setTimeout(function(){ loadingDataGS = false; }, 10000);
console.log("loadingDataGS true");
loadingDataGS = true;
var search = $('.input-global-search').val();
......@@ -52,7 +52,7 @@ function startGlobalSearch(indexMin, indexMax){
totalDataGS = 0;
mapElementsGS = new Array();
}
else{ console.log("scrollEndGS ? ", scrollEndGS); if(scrollEndGS) return; }
else{ if(scrollEndGS) return; }
if(search.length>=3){
autoCompleteSearchGS(search, indexMin, indexMax);
......@@ -68,7 +68,7 @@ function startGlobalSearch(indexMin, indexMax){
function autoCompleteSearchGS(search, indexMin, indexMax){
console.log("autoCompleteSearchGS");
var data = {"name" : search, "locality" : "", "searchType" : searchTypeGS, "searchBy" : "ALL",
"indexMin" : indexMin, "indexMax" : indexMax };
......@@ -87,13 +87,13 @@ function autoCompleteSearchGS(search, indexMin, indexMax){
data: data,
dataType: "json",
error: function (data){
console.log("error"); console.dir(data);
console.dir(data);
},
success: function(data){
if(!data){ toastr.error(data.content); }
else
{
console.log("DATA GS");
console.dir(data);
var countData = 0;
......@@ -254,14 +254,14 @@ function autoCompleteSearchGS(search, indexMin, indexMax){
} //end else (str=="")
//signal que le chargement est terminé
console.log("loadingDataGS false");
loadingDataGS = false;
//quand la recherche est terminé, on remet la couleur normal du bouton search
//$(".btn-start-search").removeClass("bg-azure");
}
//console.log("scrollEndGS ? ", scrollEnd, indexMax, countData , indexMin);
//si le nombre de résultat obtenu est inférieur au indexStep => tous les éléments ont été chargé et affiché
if(indexMax - countData > indexMin){
$("#btnShowMoreResultGS").remove();
......
......@@ -145,7 +145,7 @@ function bindEventMenu(){
// });
$(".btn-login").click(function(){
//console.log("btn-login");
showPanel("box-login");
//$(".main-col-search").html("");
}).mouseenter(function(e){
......@@ -156,7 +156,7 @@ function bindEventMenu(){
});
$(".btn-register").click(function(){
//console.log("btn-register");
showPanel("box-register");
//$(".main-col-search").html("");
}).mouseenter(function(e){
......@@ -167,7 +167,7 @@ function bindEventMenu(){
});
$(".btn-logout").click(function(){
console.log("btn-logout");
window.location.href = urlLogout;
});
......@@ -184,7 +184,7 @@ function bindEventMenu(){
}
});
$(".btn-param-postal-code").click(function(e){
////console.log("cookie", $.cookie('inseeCommunexion'));
//
if(typeof $.cookie('inseeCommunexion') == "undefined" && typeof inseeCommunexion == "undefined"){
//$(".search-loader").html("<i class='fa fa-spin fa-circle-o-notch'></i> Géolocalisation en cours ...");
showMap(true);
......@@ -205,7 +205,7 @@ function bindEventMenu(){
});
$(".btn-geoloc-auto").click(function(e){
//console.log("cookie", $.cookie('inseeCommunexion'));
if($.cookie('inseeCommunexion')){
loadByHash("#city.detail.insee." + $.cookie('inseeCommunexion')+ ".postalCode." + $.cookie('cpCommunexion'));
}else{
......@@ -230,7 +230,7 @@ function bindEventMenu(){
var positionMouseMenu = "out";
// $(".hover-menu").mouseenter(function(){
// ////console.log("enter all");
// //
// positionMouseMenu = "in";
// //$(".main-col-search").animate({ opacity:0.3 }, 0 );
// $(".main-menu-right .lbl-btn-menu-name").show(0);
......@@ -249,7 +249,7 @@ function bindEventMenu(){
// $(".hover-menu .btn-menu").mouseenter(function(){
// ////console.log("enter btn, loginRegister", isLoginRegister());
// //
// if(!isLoginRegister()){
// positionMouseMenu = "inBtn";
// //$(".main-col-search").animate({ opacity:0.3 }, 0 );
......@@ -315,7 +315,7 @@ function bindEventMenu(){
$(".main-menu-right .lbl-btn-menu-name").hide();
$(".menu-button").removeClass("large");
timeoutCommunexion = setTimeout(function(){
//console.log("HIDE HIDE"); $("#input-communexion").hide(200); clearTimeout(timeoutCommunexion);
$("#input-communexion").hide(200); clearTimeout(timeoutCommunexion);
}, 300);
}
$(".hover-info").hide();
......@@ -327,11 +327,11 @@ function bindEventMenu(){
});
$(".menu-button").click(function(){
////console.log("login display", !isLoginRegister());
//
//permet de savoir si l'utilisateur est en train de se logguer ou de s'inscrire
var login_register = isLoginRegister();
//console.log(isLoginRegister());
if(!isLoginRegister()){
positionMouseMenu = "out";
$(".main-col-search").animate({ opacity:1 }, 200 );
......
......@@ -165,7 +165,7 @@
var items = "";
var startDate = "";
console.log("allDayEvents", allDayEvents);
$.each(allDayEvents, function(key, dayEvents){
......@@ -329,7 +329,7 @@
return currentMonth;
}
};
$.fn.responsiveCalendar = function(option, params) { console.log("RELOAD CALENDAR");
$.fn.responsiveCalendar = function(option, params) {
var init, options, publicFunc;
options = $.extend({}, $.fn.responsiveCalendar.defaults, typeof option === 'object' && option);
publicFunc = {
......
......@@ -8,12 +8,12 @@ function initDocJs(faIcon, title){
$(".my-main-container").animate({ scrollTop: top, }, 100 );
});
$(".btn-carousel-previous").click(function(){ //toastr.success('success!'); console.log("CAROUSEL CLICK");
$(".btn-carousel-previous").click(function(){ //toastr.success('success!');
var top = $("#docCarousel").position().top-30;
$(".my-main-container").animate({ scrollTop: top, }, 100 );
setTimeout(function(){ $(".carousel-control.left").click(); }, 500);
});
$(".btn-carousel-next").click(function(){ //toastr.success('success!'); console.log("CAROUSEL CLICK");
$(".btn-carousel-next").click(function(){ //toastr.success('success!');
var top = $("#docCarousel").position().top-30;
$(".my-main-container").animate({ scrollTop: top, }, 100 );
setTimeout(function(){ $(".carousel-control.right").click(); }, 500);
......
......@@ -193,7 +193,7 @@ function checkFloopSearch(thisElement, searchVal, type){
//ajout d'un élément dans la liste
function addFloopEntity(entityId, entityType, entityValue){
var type = getFloopContactTypes(entityType);
//console.log("getFloopContactTypes", entityType, type);
var html = getFloopItem(entityId, type, entityValue);
$("ul#floopType-"+entityType).prepend(html);
//toastr.success("ajout de l'element floop ok");
......
......@@ -233,11 +233,11 @@ function addFloopEntity(entityId, entityType, entityValue){
//floopContacts[entityType].push(entityValue);
var type = getFloopContactTypes(entityType);
//console.log("getFloopContactTypes", entityType, type);
//We check if the element is already displayed
if($('#floopItem-'+type.name+'-'+entityId).length < 1){
console.log("here5");
var html = getFloopItem(entityId, type, entityValue);
$("ul#floopType-"+entityType).prepend(html);
}
......
......@@ -40,8 +40,8 @@ var loadStream = function(indexMin, indexMax){
dataType: "json",
data: filter,
success: function(data){
console.log("LOAD NEWS BY AJAX");
console.log(data.news);
if(data){
buildTimeLine (data.news, indexMin, indexMax);
bindTags();
......@@ -75,7 +75,7 @@ function buildTimeLine (news, indexMin, indexMax)
totalEntries += countEntries;
str = "";
//console.log(news);
$.each( news , function(key,newsObj)
{
if(newsObj.created)
......@@ -99,7 +99,7 @@ function buildTimeLine (news, indexMin, indexMax)
$( ".newsFeed:gt(-6)" ).each(function(){
if($i!=0){
if(typeof(offsetLastNews)!="undefined" && typeof(offsetLastNews.top)!="undefined")
console.log(offsetLastNews.top+" // VS // "+$(this).offset().top);
if($(this).offset().top == offsetLastNews.top){
$(this).css("margin-top","20px");
}
......@@ -170,7 +170,7 @@ function bindEvent(){
$("#get_url").elastic();
$(".scopeShare").click(function() {
console.log(this);