Commit b1a4ec1a authored by Clément Damiens's avatar Clément Damiens

impossible commit named refactor

parent b2f91802
......@@ -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")+" <i class='fa fa-angle-down'></i>");
}
});
},
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) ? " <i class='fa fa-"+icon+"'></i> " : "";
$(".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" ){
......
......@@ -992,7 +992,7 @@ var loading = "<div class='loader shadow2 letter-blue text-center margin-bottom
"<span>"+trad.currentlyloading+" ...</span>" +
"</div>";
function loadStream(indexMin, indexMax){ mylog.log("LOAD STREAM PROFILSOCIAL"); //loadLiveNow
/*function loadStream(indexMin, indexMax){ mylog.log("LOAD STREAM PROFILSOCIAL"); //loadLiveNow
loadingData = true;
currentIndexMin = indexMin;
currentIndexMax = indexMax;
......@@ -1033,7 +1033,7 @@ function loadStream(indexMin, indexMax){ mylog.log("LOAD STREAM PROFILSOCIAL");
}
}
});
}
}*/
var colNotifOpen = true;
function toogleNotif(open){
......
......@@ -32,6 +32,7 @@ var searchInterface={
init : function(typeInit){
searchInterface.setSearchTypes(typeInit);
searchInterface.initSearchParams();
searchInterface.setSearchbar();
if(searchObject.types.length > 1) searchAllEngine.initSearch();
if(searchObject.text != "") $(".main-search-bar, #second-search-bar").val(searchObject.text);
$(".theme-header-filter").off().on("click",function(){
......@@ -82,7 +83,7 @@ var searchInterface={
activeTagsFilter();
startSearch(0, indexStepInit, searchCallback);
});
$(".btn-tags-unik").off().on("click", function(){
$(".btn-tags-unik").off().on("click", function(){
$(".btn-tags-unik").removeClass("active");
if(!notNull($(this).data("k")) || $(this).data("k")=="")
searchObject.tags=[];
......@@ -96,7 +97,28 @@ var searchInterface={
if(typeof searchObject.ranges != "undefined") searchAllEngine.initSearch();
startSearch(0, indexStepInit, searchCallback);
});
$("#main-search-bar").keyup(function(e){
$(".main-btn-create").off().on("click",function(){
currentKFormType = $(this).data("ktype");
var type = $(this).data("type");
if(type=="all"){
$("#dash-create-modal").modal("show");
return;
}
if(type=="events") type="event";
if(type=="vote") type="entry";
dyFObj.openForm(type);
});
if(typeof themeParams!="undefined" && typeof themeParams.appRendering != "undefined" && themeParams.appRendering=="vertical"){
$(".headerSearchContainer, .bodySearchContainer").removeClass("col-md-10 col-sm-10 col-sm-offset-1 col-md-offset-1");
}
},
setSearchbar : function(){
$("#main-search-bar").keyup(function(e){
$("#second-search-bar").val($(this).val());
$("#main-search-xs-bar").val($(this).val());
$("#input-search-map").val($(this).val());
......@@ -110,8 +132,7 @@ var searchInterface={
startSearch(0, indexStepInit, searchCallback);
}
});
$("#main-search-xs-bar").keyup(function(e){
$("#main-search-xs-bar").off().keyup(function(e){
$("#second-search-bar").val($(this).val());
$("#main-search-bar").val($(this).val());
$("#input-search-map").val($(this).val());
......@@ -126,7 +147,7 @@ var searchInterface={
}
});
$("#second-search-bar").keyup(function(e){
$("#second-search-bar").off().keyup(function(e){
$(".main-search-bar").val($(this).val());
if(e.keyCode == 13 || $(this).val() == ""){
scrollH= ($("#filter-thematic-menu").is(":visible")) ? 250 : 0;
......@@ -140,7 +161,7 @@ var searchInterface={
$(".btn-directory-type").removeClass("active");
}
});
$("#input-search-map").off().keyup(function(e){
$("#second-search-bar").val($("#input-search-map").val());
$(".main-search-bar").val($("#input-search-map").val());
......@@ -176,25 +197,6 @@ var searchInterface={
startSearch(0, indexStepInit, searchCallback);
$(".btn-directory-type").removeClass("active");
});
$(".main-btn-create").off().on("click",function(){
currentKFormType = $(this).data("ktype");
var type = $(this).data("type");
if(type=="all"){
$("#dash-create-modal").modal("show");
return;
}
if(type=="events") type="event";
if(type=="vote") type="entry";
dyFObj.openForm(type);
});
if(typeof themeParams!="undefined" && typeof themeParams.appRendering != "undefined" && themeParams.appRendering=="vertical"){
$(".headerSearchContainer, .bodySearchContainer").removeClass("col-md-10 col-sm-10 col-sm-offset-1 col-md-offset-1");
}
},
bindFiltersEvents : function() {
$(".btn-directory-type").off().on("click", function(){
......@@ -598,7 +600,6 @@ var searchInterface={
searchInterface.initCategoriesEvent();
},
setSearchTypes: function(typeInit){
if(typeInit == "all") {
if(isCustom("types")){
searchObject.types = [];
......
......@@ -35,7 +35,6 @@
},
"#welcome": {
"inMenu" : false,
"useHeader" : true,
"useFooter" : true,
"useFilter" : false,
"dropdownResult":true,
......@@ -50,7 +49,6 @@
},
"#myhome": {
"inMenu" : false,
"useHeader" : true,
"useFooter" : true,
"useFilter" : false,
"subdomain" : "home",
......@@ -65,7 +63,6 @@
},
"#docs": {
"inMenu" : false,
"useHeader" : false,
"subdomain" : "docs",
"subdomainName" : "Documentation",
"hash" : "#app.docs",
......@@ -77,7 +74,6 @@
},
"#search": {
"inMenu" : true,
"useHeader" : true,
"useFooter" : true,
"useFilter" : true,
"subdomain" : "search",
......@@ -103,7 +99,6 @@
},
"#web":
{ "inMenu" : false,
"useHeader" : true,
"useFilter" : false,
"subdomain" : "web",
"subdomainName" : "Web",
......@@ -115,7 +110,6 @@
"#referencement":
{
"inMenu" : false,
"useHeader" : true,
"subdomain" : "referencement",
"subdomainName" : "Referencement",
"hash" : "#app.referencement",
......@@ -126,7 +120,6 @@
"#live": {
"inMenu" : true,
"useHeader" : true,
"useFilter" : true,
"subdomain" : "live",
"useFooter" : true,
......@@ -145,7 +138,6 @@
"#agenda": {
"inMenu" : true,
"useHeader" : true,
"useFilter" : true,
"useFooter" : true,
"subdomain" : "agenda",
......@@ -167,7 +159,6 @@
"#annonces": {
"inMenu" : true,
"useHeader" : true,
"useFilter" : true,
"useFooter" : true,
"subdomain" : "annonces",
......@@ -194,7 +185,6 @@
},
"#dda": {
"inMenu" : true,
"useHeader" : true,
"useFooter" : true,
"useFilter" : {"scope":true, "filters":false},
"subdomain" : "dda",
......@@ -215,7 +205,6 @@
},
"#place":
{"inMenu" : false,
"useHeader" : true,
"subdomain" : "place",
"subdomainName" : "Lieux",
"hash" : "#app.search.type.place",
......@@ -239,7 +228,6 @@
},
"#page": {
"inMenu" : false,
"useHeader" : true,
"useFilter" : false,
"useFooter" : true,
"dropdownResult":true,
......@@ -252,7 +240,6 @@
},
"#info": {
"inMenu" : false,
"useHeader" : true,
"dropdownResult":true,
"useFilter" : false,
"subdomain" : "apropos",
......@@ -265,7 +252,6 @@
"#power": {
"inMenu" : false,
"useHeader" : true,
"subdomain" : "power",
"subdomainName" : "Power",
"hash":"#app.power",
......@@ -279,7 +265,6 @@
"#city": {
"inMenu" : false,
"useHeader" : false,
"subdomain" : "city",
"subdomainName" : "City",
"hash":"#app.city",
......@@ -290,7 +275,6 @@
"#rooms": {
"inMenu" : false,
"useHeader" : false,
"subdomain" : "rooms",
"subdomainName" : "rooms",
"hash":"#app.rooms",
......@@ -301,7 +285,6 @@
"#survey": {
"inMenu" : false,
"useHeader" : false,
"useFilter" : false,
"subdomain" : "city",
"subdomainName" : "City",
......@@ -313,7 +296,6 @@
"#admin": {
"inMenu" : false,
"useHeader" : true,
"useFilter" : false,
"useFooter" : false,
"subdomain" : "admin",
......@@ -326,7 +308,6 @@
"#adminpublic": {
"inMenu" : false,
"useHeader" : false,
"useFilter" : false,
"subdomain" : "admin",
"subdomainName" : "admin",
......
......@@ -7,20 +7,7 @@
"/plugins/Chart-2.6.0/Chart.min.js",
); HtmlHelper::registerCssAndScriptsFiles($cssAnsScriptFilesTheme, Yii::app()->request->baseUrl);
$cssAnsScriptFilesModule = array(
//'/js/default/profilSocial.js',
);
HtmlHelper::registerCssAndScriptsFiles($cssAnsScriptFilesModule, $this->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");
......
<?php
// $cssAnsScriptFilesModule = array(
// '/js/default/search.js',
$cssAnsScriptFilesModule = array(
//'/js/default/search.js',
//'/js/default/live.js',
//);
//HtmlHelper::registerCssAndScriptsFiles($cssAnsScriptFilesModule, $this->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 @@
</style>
<div class="row padding-10 bg-white live-container">
<?php
//$CO2DomainName = Yii::app()->params["CO2DomainName"];
// if($CO2DomainName == "kgougle"){
//$this->renderPartial($layoutPath.'headers/pod/'.$CO2DomainName.'/dayQuestion', array());
//}
?>
//$this->renderPartial($layoutPath.'headers/pod/'.$CO2DomainName.'/dayQuestion', array());
?>
<div class="col-md-12 col-sm-12 col-xs-12 bg-white top-page" id="" style="padding-top:0px!important;">
<div class="col-lg-1 col-md-1 hidden-sm hidden-xs text-right hidden-xs" id="sub-menu-left"></div>
......@@ -85,9 +82,6 @@
</div>
<?php $this->renderPartial($layoutPath.'footer', array("page"=>$page)); ?>
<script type="text/javascript" >
searchObject.initType="news";
......
......@@ -23,13 +23,11 @@
$cssAnsScriptFilesModule = array(
'/js/default/responsive-calendar.js',
'/js/default/search.js',
'/js/news/index.js',
// '/js/default/search.js',
// '/js/news/index.js',
);
HtmlHelper::registerCssAndScriptsFiles($cssAnsScriptFilesModule, $this->module->getParentAssetsUrl());
// HtmlHelper::registerCssAndScriptsFiles( array('/css/default/directory.css', ) ,
// Yii::app()->theme->baseUrl. '/assets');
$layoutPath = 'webroot.themes.'.Yii::app()->theme->name.'.views.layouts.';
......@@ -46,12 +44,6 @@
$directoryParams=Yii::app()->session["paramsConfig"]["directory"];
if(@Yii::app()->session["paramsConfig"]["pages"]["#".$page]["directory"])
$directoryParams=Yii::app()->session["paramsConfig"]["pages"]["#".$page]["directory"];
//header + menu
/*$this->renderPartial($layoutPath.'header',
array( "layoutPath"=>$layoutPath ,
"page" => $page,
"type" => @$type)
);*/
?>
......@@ -91,7 +83,7 @@
</style>