From b1a4ec1a2ca81061b050ee5ab71cac9d7c037c18 Mon Sep 17 00:00:00 2001 From: Bouboule Date: Fri, 10 May 2019 20:02:29 +0200 Subject: [PATCH] impossible commit named refactor --- assets/js/co.js | 127 +++++++---- assets/js/default/profilSocial.js | 4 +- assets/js/default/search.js | 53 ++--- config/params.json | 19 -- views/app/info/CO2/stats.php | 13 -- views/app/live.php | 20 +- views/app/search.php | 18 +- views/app/welcome.php | 8 +- views/docs/de/welcome.php | 2 +- views/docs/en/welcome.php | 2 +- views/docs/es/welcome.php | 2 +- views/docs/fr/welcome.php | 2 +- views/docs/index.php | 347 +++++++++++++++--------------- views/docs/it/welcome.php | 2 +- views/search/searchTerla.php | 173 --------------- 15 files changed, 319 insertions(+), 473 deletions(-) delete mode 100644 views/search/searchTerla.php diff --git a/assets/js/co.js b/assets/js/co.js index 0434e333..1ada3bdb 100644 --- a/assets/js/co.js +++ b/assets/js/co.js @@ -362,9 +362,9 @@ function loadSettings(hash){ var CoAllReadyLoad = false; var coInterface = { init : function(){ + coInterface.initHtmlPosition(); coInterface.scrollTo(".main-container"); coInterface.bindResizeEvent(); - coInterface.initHtmlPosition(); // Active button to get dynform coInterface.bindButtonOpenForm(); coInterface.bindLBHLinks(); @@ -471,10 +471,7 @@ var coInterface = { }); $("#btn-apropos").click(function(){ urlCtrl.loadByHash("#info.p.apropos") - }); - - //$(".logo-menutop.hidden-top, .menu-btn-start-search, #input-sec-search").attr("style", ""); - + }); $(".btn-show-map").off().click(function(){ if(typeof formInMap != "undefined" && formInMap.actived == true) @@ -510,7 +507,7 @@ var coInterface = { else $("#menuApp.subMenuTop").addClass("borderShadow"); } - setTimeout(function(){headerHeightPos(true)},250); + setTimeout(function(){coInterface.setTopPosition(true);},250); }); $(".menu-btn-scope-filter").click(function(){ if($("#filter-scopes-menu").is(":visible")){ @@ -520,7 +517,7 @@ var coInterface = { $(".menu-btn-scope-filter").addClass("visible"); $("#filter-scopes-menu").show(200); } - setTimeout(function(){headerHeightPos(true)},250); + setTimeout(function(){coInterface.setTopPosition(true)},250); if(notNull(costum) && typeof costum.scopeHeaderFunction!="undefined" && typeof costum.scopeHeaderFunction == "function") @@ -570,6 +567,7 @@ var coInterface = { } }); coInterface.bindResizeEvent(); + $("#loadingModal").css({"opacity": 0.95}); }, 400); }, setDomHtmlPosition: function(initHeight){ @@ -610,7 +608,7 @@ var coInterface = { } if($("#header-banner").length > 0 && initHeight==0) heightPos=heightPos+$("#header-banner").outerHeight(); - $(".main-container").css("padding-top",heightPos); + $(".main-container").css("padding-top",heightPos);//, "min-height":($(window).height()-heightPos)+"px"}); setTimeout(function(){headerScaling=false;},300); }, bindResizeEvent : function(){ @@ -663,8 +661,6 @@ var coInterface = { coInterface.simpleScroll(0, 500); searchObject.reset(); historyReplace=true; - $(".lbh-menu-app").removeClass("active"); - $(this).addClass("active"); urlCtrl.loadByHash($(this).data("hash")); }) //open any url in a modal window @@ -744,8 +740,74 @@ var coInterface = { $('html,body').animate({scrollTop: scrollToPos}, speedScroll, ''); }, menu : { - set : function(){ - + showFilters : false, + showScope : false, + set : function(hash){ + if(!notEmpty(hash) || hash=="#"){ + redirK=(userId!="") ? "logged" : "unlogged"; + pageMenu="#"+themeParams["#app.index"][redirK]; + }else if(hash.indexOf(".") >= 0){ + pageMenu=hash.split(".")[0]; + }else + pageMenu=hash; + if(pageMenu.indexOf("?") >= 0) + pageMenu=pageMenu.split("?")[0]; + mylog.log("checkMenu *******************", pageMenu); + inMenu = (typeof themeParams.pages[pageMenu].inMenu != "undefined") ? themeParams.pages[pageMenu].inMenu : false; + useFilter = (typeof themeParams.pages[pageMenu].useFilter != "undefined") ? themeParams.pages[pageMenu].useFilter : false; + subdomainName = (typeof themeParams.pages[pageMenu].subdomainName != "undefined") ? themeParams.pages[pageMenu].subdomainName : ""; + icon = (typeof themeParams.pages[pageMenu].icon != "undefined") ? themeParams.pages[pageMenu].icon : "info"; + mainTitle = (typeof themeParams.pages[pageMenu].mainTitle != "undefined") ? themeParams.pages[pageMenu].mainTitle : themeParams.metaTitle; + dropdownResult = (typeof themeParams.pages[pageMenu].dropdownResult != "undefined") ? themeParams.pages[pageMenu].dropdownResult : true; + //mylog.dir(urlObj); + $(".lbh-menu-app").removeClass("active"); + if(inMenu) $(".lbh-menu-app[data-hash='"+pageMenu+"']").addClass("active"); + $("#filter-scopes-menu").hide(200); + if(notEmpty(useFilter)){ + coInterface.menu.showScope=true; + coInterface.menu.showFilters=true; + if(typeof useFilter == "object"){ + coInterface.menu.showScope=(typeof useFilter.scope != "undefined" && useFilter.scope) ? true : false; + coInterface.menu.showFilters=(typeof useFilter.filters != "undefined" && useFilter.filters) ? true : false; + } + classToShow=(coInterface.menu.showScope) ? ".menu-btn-scope-filter": ""; + if(coInterface.menu.showFilters){ + classToShow+=(notEmpty(classToShow)) ? ", ":""; + classToShow+= (coInterface.menu.showFilters) ? ".btn-show-filters": ""; + } + $(classToShow).show().removeClass("forcedHide"); + if(coInterface.menu.showFilters) + coInterface.menu.resetFilters(); + }else{ + coInterface.menu.showScope=false; + coInterface.menu.showFilters=false; + $("#filters-nav").hide(); + $(".menu-btn-scope-filter, .btn-show-filters").hide(); + $(".menu-btn-scope-filter.visible-xs, .btn-show-filters.visible-xs").addClass("forcedHide"); + } + $("#second-search-bar, #main-search-bar, #input-search-map").val(""); + if(dropdownResult){ + //Replace id event of app search bar by id event of search bar using dropdown result like in home, element page; + $.each(["second-search-bar, second-search-xs-bar-addon, second-search-bar-xs, second-search-xs-bar-addon"], function(e, v){ + changeId=v.replace("second", "main"); + $("#"+v).attr("id", changeId); + }); + }else{ + //Generate id event for app search bar instead of search bar using dropdown result like in home, element page; + $.each(["main-search-bar, main-search-xs-bar-addon, main-search-bar-xs, main-search-xs-bar-addon"], function(e, v){ + changeId=v.replace("main", "second"); + $("#"+v).attr("id", changeId); + }); + } + searchInterface.setSearchbar(); + }, + resetFilters: function(){ + $("#filters-nav-list li .menu-button").each(function(){ + if($(this).hasClass("active")){ + $(this).removeClass("active"); + $(this).html($(this).attr("title")+" "); + } + }); }, renderTools : { @@ -882,7 +944,7 @@ var urlCtrl = { return false; } - checkMenu(urlObj, hash); + coInterface.menu.set(hash); endPoint = urlCtrl.loadableUrls[urlIndex]; mylog.log("jsController 2",endPoint,"login",endPoint.login,endPoint.hash ); @@ -1164,6 +1226,7 @@ var urlCtrl = { } else { //alert( baseUrl+'/'+ moduleId + '/app/index 3' ); + coInterface.menu.set(); showAjaxPanel( baseUrl+'/'+ moduleId + '/app/index', 'Home','home' ); } @@ -1533,7 +1596,6 @@ var smallMenu = { function showAjaxPanel (url,title,icon, mapEnd , urlObj) { //alert("showAjaxPanel"+url); - $(".progressTop").show().val(20); //$("#loadingModal").css({"opacity": 0.7}); var dest = ( typeof urlObj == "undefined" || typeof urlObj.useHeader != "undefined" ) ? themeObj.mainContainer : ".pageContent" ; mylog.log("showAjaxPanel", url, urlObj,dest,urlCtrl.afterLoad ); @@ -1541,42 +1603,45 @@ function showAjaxPanel (url,title,icon, mapEnd , urlObj) { hideScrollTop = false; //alert("showAjaxPanel"+dest); showNotif(false); - $(".hover-info,.hover-info2").hide(); showMap(false); - $(".box").hide(200); - //showPanel('box-ajax'); icon = (icon) ? " " : ""; $(".panelTitle").html(icon+title).fadeIn(); mylog.log("GETAJAX",icon+title); //showTopMenu(true); userIdBefore = userId; + coInterface.simpleScroll(0,300); + $(".progressTop").show().val(20); setTimeout(function(){ if( $(dest).length ) { setTimeout(function(){ $('.progressTop').val(40)}, 500); setTimeout(function(){ $('.progressTop').val(60)}, 1500); - setTimeout(function(){$("#loadingModal").css({"opacity": 0.6});}, 500); - setTimeout(function(){$("#loadingModal").css({"opacity": 0.5});}, 1500); + /*setTimeout(function(){$("#loadingModal").css({"opacity": 0.});}, 500); + setTimeout(function(){$("#loadingModal").css({"opacity": 0.5});}, 1500);*/ + $("#loadingModal").css({"opacity": 0.9}); getAjax(dest, url, function(data){ if( dest != themeObj.mainContainer ) $(".subModuleTitle").html(""); $(".modal-backdrop").hide(); + if(coInterface.menu.showFilters) $("#filters-nav").show(); + coInterface.setTopPosition(); coInterface.bindTooltips(); coInterface.bindLBHLinks(); $(".progressTop").val(90); - if($("#loadingModal").is(":visible")){ - setTimeout(function(){ $("#loadingModal").css({"opacity": 0.4});}, 10); - setTimeout(function(){ $("#loadingModal").css({"opacity": 0.3});}, 10); - setTimeout(function(){ $("#loadingModal").css({"opacity": 0.2});}, 10); - setTimeout(function(){ $("#loadingModal").css({"opacity": 0.1});}, 10); - setTimeout(function(){ $("#loadingModal").hide()}, 10); + //$("#loadingModal").hide(1000); + if($("#firstLoader").is(":visible")){ + setTimeout(function(){ $("#loadingModal").css({"opacity": 0.8});}, 250); + setTimeout(function(){ $("#loadingModal").css({"opacity": 0.6});}, 250); + setTimeout(function(){ $("#loadingModal").css({"opacity": 0.4});}, 250); + setTimeout(function(){ $("#loadingModal").css({"opacity": 0.2});$("#firstLoader").hide(400);}, 250); + //setTimeout(function(){}, 10); } setTimeout(function(){ $(".progressTop").val(100)}, 10); - $(".progressTop").fadeOut(200); + $(".progressTop").fadeOut(300); $.unblockUI(); if(!$("#page-top").is(":visible")) $("#page-top").show(); if(mapEnd) @@ -1707,16 +1772,6 @@ function setTitle(str, icon, topTitle,keywords,shortDesc) { mylog.log("setTitle" } -function checkMenu(urlObj, hash){ - mylog.log("checkMenu *******************", hash); - //mylog.dir(urlObj); - $(".menu-button-left").removeClass("selected"); - if(typeof urlObj.menuId != "undefined"){ mylog.log($("#"+urlObj.menuId).data("hash")); - if($("#"+urlObj.menuId).attr("href") == hash) - $("#"+urlObj.menuId).addClass("selected"); - } -} - var backUrl = null; function checkIsLoggued(uId){ if( uId == "" || typeof uId == "undefined" ){ diff --git a/assets/js/default/profilSocial.js b/assets/js/default/profilSocial.js index 6a02ab7e..bd30fc7f 100644 --- a/assets/js/default/profilSocial.js +++ b/assets/js/default/profilSocial.js @@ -992,7 +992,7 @@ var loading = "
module->assetsUrl); - $layoutPath = 'webroot.themes.'.Yii::app()->theme->name.'.views.layouts.'; - //header + menu - $this->renderPartial($layoutPath.'header', - array( "layoutPath"=>$layoutPath , - "page" => "info", - ) - ); - - $week = @$_POST["week"]; $visits = CO2Stat::getStatsByHash(@$week); $days = array("Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"); diff --git a/views/app/live.php b/views/app/live.php index 613d2349..78e1d29e 100644 --- a/views/app/live.php +++ b/views/app/live.php @@ -1,9 +1,9 @@ module->assetsUrl); + ); + HtmlHelper::registerCssAndScriptsFiles($cssAnsScriptFilesModule, $this->module->assetsUrl); $page = "live"; @@ -16,7 +16,7 @@ "dontShowMenu"=>true, //"explain"=> "Live public : retrouvez tous les messages publics selon vos lieux favoris") ));*/ - $page = "live"; + //$page = "live"; //$randImg = 1; //$filliaireCategories = CO2::getContextList("filliaireCategories"); @@ -69,11 +69,8 @@
params["CO2DomainName"]; - // if($CO2DomainName == "kgougle"){ - //$this->renderPartial($layoutPath.'headers/pod/'.$CO2DomainName.'/dayQuestion', array()); - //} - ?> + //$this->renderPartial($layoutPath.'headers/pod/'.$CO2DomainName.'/dayQuestion', array()); +?>
@@ -85,9 +82,6 @@
-renderPartial($layoutPath.'footer', array("page"=>$page)); ?> - - \ No newline at end of file diff --git a/views/docs/de/welcome.php b/views/docs/de/welcome.php index 79fd6cab..f926541d 100644 --- a/views/docs/de/welcome.php +++ b/views/docs/de/welcome.php @@ -109,7 +109,7 @@ background-color: #09adef;
-
+
diff --git a/views/docs/en/welcome.php b/views/docs/en/welcome.php index 79fd6cab..f926541d 100644 --- a/views/docs/en/welcome.php +++ b/views/docs/en/welcome.php @@ -109,7 +109,7 @@ background-color: #09adef;
-
+
diff --git a/views/docs/es/welcome.php b/views/docs/es/welcome.php index f8e24c03..1a05370c 100644 --- a/views/docs/es/welcome.php +++ b/views/docs/es/welcome.php @@ -109,7 +109,7 @@ background-color: #09adef;
-
+
diff --git a/views/docs/fr/welcome.php b/views/docs/fr/welcome.php index f8e24c03..1a05370c 100644 --- a/views/docs/fr/welcome.php +++ b/views/docs/fr/welcome.php @@ -109,7 +109,7 @@ background-color: #09adef;
-
+
diff --git a/views/docs/index.php b/views/docs/index.php index 189991a4..4ea5a32f 100644 --- a/views/docs/index.php +++ b/views/docs/index.php @@ -1,4 +1,12 @@ - -
- - - -
- résultats


- $value) { ?> - ." class="lbh"> - - - - -

- - - ." - class="btn btn-link bg-orange pull-left lbh"> - - - - - ." - class="lbh btn btn-link bg-orange pull-right"> - - - -


- - - -
- -
- - \ No newline at end of file -- GitLab