Source: site.view [edit]
Function name: footer
Arguments: page
Description: OPTIONALARGS -- 0: sessionkey (nil to expire)
Page type: text
Render function:  
Module: maybeathome

Page source:

        <!--  Footer Wrapper Starts  -->
        <footer class="custom-footer footer-wrapper">
            <ul class="nav nav-justified">
                <li class="dropdown">
                	<a href="/site/company" data-localize="footer.company">Company</a>
                	<ul class="dropdown-menu">
                        <li>
                            <div class="row">
                                <div class="col-sm-6">
                                    <a data-localize="footer.company" href="/site/company">Company</a>
                                </div>       
                                <div class="col-sm-6 active">
                                    <a data-localize="footer.team" href="/site/team">Team</a>
                                </div>    
                                
                            </div>    
                        </li>
                        <li>
                            <div class="row">
                                <div class="col-sm-6">
                                    <a data-localize="footer.hiring" href="/site/jobs">We're Hiring!</a>
                                </div>    
                                <div class="col-sm-6 active">
                                    <a data-localize="footer.advisors" href="/site/advisors">Advisors</a>
                                </div>      
                                
                            </div>    
                        </li>
                    </ul>
                </li>
                <li class="dropdown">
                	<a href="/site/terms" data-localize="footer.terms">Terms</a>
                </li>
                <li class="dropdown">
                	<a href="/site/contact" data-localize="footer.contact">Contact</a>
                	<!-- ul class="dropdown-menu">
                        <li>
                            <div class="row">
                                <div class="col-sm-6">
                                    <a href="javascript:void(0);">Sitemap Link 1</a>
                                </div>    
                                <div class="col-sm-6 active">
                                    <a href="javascript:void(0);">Sitemap Link 2</a>
                                </div>    
                            </div>    
                        </li>
                        <li>
                            <div class="row">
                                <div class="col-sm-6">
                                    <a href="javascript:void(0);">Sitemap Link 3</a>
                                </div>    
                                <div class="col-sm-6 active">
                                    <a href="javascript:void(0);">Sitemap Link 4</a>
                                </div>    
                            </div>    
                        </li>
                    </ul -->
                </li>
            </ul>
            <a href="javascript:void(0)" class="copyright" data-localize="footer.copyright"></a>
        </footer>
        <!--  Footer Wrapper Ends  -->

        <!-- Bootstrap core JavaScript
        ================================================== -->
        <!-- Placed at the end of the document so the pages load faster -->

        <!--  J-query Script  -->
        <script src="assets/js/jquery.min.js" type="text/javascript"></script>
        <!-- script src="assets/js/jquery-ui.min.js" type="text/javascript"></script -->

        <!--  Bootstrap Script  -->
        <script src="assets/bootstrap/js/bootstrap.js"></script>

        <!--  Bootstrap Select Script  -->
        <script src="assets/plugins/bootstrap-select/js/bootstrap-select.js"></script>

        <!--  Select2 Script  -->
        <script src="assets/plugins/select2/js/select2.full.js"></script>

        <!--  BX-Slider Script  -->
        <script src="assets/plugins/bxslider/jquery.bxslider.js" type="text/javascript"></script>

        <!--  Perfect Scrollbar Script  -->
        <script src="assets/plugins/perfect-scrollbar/perfect-scrollbar.min.js" type="text/javascript"></script>

        <!--  Country Select Script  -->
        <script src="assets/plugins/country-select/js/countrySelect.min.js" type="text/javascript"></script>

        <!--  J-query Localize Script  -->
        <script src="assets/plugins/jquery-localize/jquery.localize.js" type="text/javascript"></script>

     <webl> if page == "results" then
       `
        <!--  Full Calendar Script  -->
        <script src="assets/plugins/full-calendar/moment.min.js" type="text/javascript"></script>
        <!--<script src="assets/plugins/full-calendar/fullcalendar.min.js" type="text/javascript"></script>-->
        <script src="https://cdnjs.cloudflare.com/ajax/libs/fullcalendar/3.9.0/fullcalendar.js" type="text/javascript"></script>
        <script src="https://cdnjs.cloudflare.com/ajax/libs/fullcalendar/3.8.0/locale-all.js" type="text/javascript"></script>

        <!--  Bootstrap Date-picker Script  -->
        <script src="assets/plugins/bootstrap-datepicker/moment.js" type="text/javascript"></script>
        <script src="assets/plugins/bootstrap-datepicker/bootstrap-datetimepicker.min.js" type="text/javascript"></script>
        `;
      else 
         "";
      end;
     </webl>
     
        <!--  Custom Script  -->  
        <script type="text/javascript">
			$(document).ready(function(){
            
            /*--   Jquery Localize Initialization  --*/
            var countryCode;
            countryCode = "us";  
            <webl> if page == "results" then
      		 `
				$('#calendar').fullCalendar('option', 'locale', countryCode);
             	
             `;
            else 
               "";
            end;
           </webl>
            function customLocalize(countryCode) {
                $("[data-localize]").localize("application", {
                    language: countryCode,
                    pathPrefix: "assets/plugins/jquery-localize/data"
                });
            }
            
            /*--  Country Select Initialization  --*/
            $("#country").countrySelect({
                onlyCountries: ["us", "gb", "fr"],
                preferredCountries: []
            });

            /*--  Select Picker Initialization  --*/
            $('select').selectpicker();
            
            if (localStorage.getItem("changedCode") !== null) {
                /*--  Get Changed Country Code  --*/
                countryCode = JSON.parse(localStorage.getItem("changedCode"));
                customLocalize(countryCode);
                $("#country").countrySelect("selectCountry", countryCode);
                $('select').selectpicker("refresh");                
				<webl> if page == "results" then
                 `
                 	getCalendarEventsData = $('#calendar').fullCalendar('getEventSources');
                    console.log(getCalendarEventsData);
                    $('#calendar').fullCalendar('option', 'locale', countryCode);
                      $(".btn-wrapper a[href='#calendarWrapper']").on('shown.bs.tab', function (e) {
                       e.target; /*--  Newly Activated Tab  --*/
                       e.relatedTarget; /*--  Previous Active Tab  --*/
                       $('#calendar').fullCalendar('option', 'locale', countryCode);
                       console.log("fxjfsdn",countryCode);
                      });
                 `;
                else 
                   "";
                end;
               </webl>
            }
            else {
                countryCode = "us";
                customLocalize(countryCode);                
				<webl> if page == "results" then
                 `
                    $('#calendar').fullCalendar('option', 'locale', countryCode);
                 `;
                else 
                   "";
                end;
               </webl>
            }
            
			if (localStorage.getItem("messageRequestedStay") !== null) {
                /*--  Get Message Requested Stay  --*/
                messageRequestedStay = localStorage.getItem("messageRequestedStay");
                $("#messageBox").val(messageRequestedStay);
            }
            
            $("#country").change(function () {
                countryCode = $(this).val();                
                switch (countryCode) {
                    case 'United States':
                        countryCode = "us";
                        customLocalize(countryCode);
                        break;
                    case 'United Kingdom':
                        countryCode = "gb";
                        customLocalize(countryCode);
                        break;
                    case 'France':
                        countryCode = "fr";
                        customLocalize(countryCode);
                        break;
                   /* case 'Italy (Italia)':
                        countryCode = "it";
                        customLocalize(countryCode);
                        break;
                    case 'Russia (&#1056;&#1086;&#1089;&#1089;&#1080;&#1103;)':
                        countryCode = "ru";
                        customLocalize(countryCode);
                        break; */
                    default:
                        countryCode = "us";
                        customLocalize(countryCode);
                }
                $('select').selectpicker("refresh");                
				<webl> if page == "results" then
                 `
                 	 if (localStorage.getItem("getCalendarData") !== null) {
                        /*--  Get Changed Country Code  --*/
                        data = JSON.parse(localStorage.getItem("getCalendarData"));
						console.log(data,"fdsf");
                         if(countryCode == "fr"){         
                         	$(".chat-media-list .media").each(function(){
                            	var messageText = $(this).children(".media-body").find("p").html();
                            	messageText = messageText.replace(/I want to book this property from date/gi, 'Je veux réserver cette propriété à partir de la date ');
                               	messageText = messageText.replace(/To reserve this property from/gi, 'Pour réserver cette propriété de ');
                                messageText = messageText.replace(/click on the link provided then press the/gi, 'cliquez sur le lien fourni puis appuyez sur le bouton ');
                                messageText = messageText.replace(/Pay with Card/gi, 'Payer avec la carte ');
                                messageText = messageText.replace(/button to book it/gi, 'bouton pour le réserver ');
                                messageText = messageText.replace(/For/gi, 'pour ');
                                messageText = messageText.replace(/Click Here/gi, 'Cliquez ici ');
                                $(this).children(".media-body").find("p").html(messageText);
                            });                          
                           $(data).each(function(k,v){
                            console.log(k,v);                                 
                             if(v.title == "available"){
                                v.title = "reservé";
                               console.log(v.title);
                             }
                             else{
                                v.title = v.title.replace(/Booked:/gi, 'disponible');
                             }
                           });                               
                           console.log(data);
						    events = data;
                        	$('#calendar').fullCalendar('removeEvents');
                            $('#calendar').fullCalendar( 'addEventSource', events );
                         }
                         else if(countryCode == "us"){      
                         	$(".chat-media-list .media").each(function(){
                            	var messageText = $(this).children(".media-body").find("p").html();
                            	messageText = messageText.replace(/Je veux réserver cette propriété à partir de la date/gi, 'I want to book this property from date ');
                                messageText = messageText.replace(/Pour réserver cette propriété de/gi, 'To reserve this property from ');
                                messageText = messageText.replace(/cliquez sur le lien fourni puis appuyez sur le bouton/gi, 'click on the link provided then press the ');
                                messageText = messageText.replace(/Payer avec la carte/gi, 'Pay with Card ');
                                messageText = messageText.replace(/bouton pour le réserver/gi, 'button to book it ');
                                messageText = messageText.replace(/pour/gi, 'For ');
                                messageText = messageText.replace(/Cliquez ici/gi, 'Click Here ');
                                $(this).children(".media-body").find("p").html(messageText);
                            });                         	
                           $(data).each(function(k,v){
                            console.log(k,v);                                 
                             if(v.title == "available"){
                                v.title = "available";
                               console.log(v.title);
                             }
                             else{
                                v.title = v.title.replace(/Booked:/gi, 'Booked:');
                             }
                           });                               
                           console.log(data);
						    events = data;
                        	$('#calendar').fullCalendar('removeEvents');
                            $('#calendar').fullCalendar( 'addEventSource', events );
                         }
                         else if(countryCode == "gb"){   
                         	$(".chat-media-list .media").each(function(){
                            	var messageText = $(this).children(".media-body").find("p").html();
                            	messageText = messageText.replace(/Je veux réserver cette propriété à partir de la date/gi, 'I want to book this property from date ');
                                messageText = messageText.replace(/Pour réserver cette propriété de/gi, 'To reserve this property from ');
                                messageText = messageText.replace(/cliquez sur le lien fourni puis appuyez sur le bouton/gi, 'click on the link provided then press the ');
                                messageText = messageText.replace(/Payer avec la carte/gi, 'Pay with Card ');
                                messageText = messageText.replace(/bouton pour le réserver/gi, 'button to book it ');
                                messageText = messageText.replace(/pour/gi, 'For ');
                                messageText = messageText.replace(/Cliquez ici/gi, 'Click Here ');
                                $(this).children(".media-body").find("p").html(messageText);
                            });
                           $(data).each(function(k,v){
                            console.log(k,v);                                 
                             if(v.title == "available"){
                                v.title = "available";
                               console.log(v.title);
                             }
                             else{
                                v.title = v.title.replace(/Booked:/gi, 'Booked:');
                             }
                           });                               
                           console.log(data);
						    events = data;
                        	$('#calendar').fullCalendar('removeEvents');
                            $('#calendar').fullCalendar( 'addEventSource', events );
                         }
                     }
                    $('#calendar').fullCalendar('option', 'locale', countryCode);
                 `;
                else 
                   "";
                end;
               </webl>
                /*--  Check Browser Support  --*/
                if (typeof (Storage) !== "undefined") {
                    /*--  Store Changed Country Code  --*/
                    localStorage.setItem("changedCode", JSON.stringify(countryCode));
                }
                setCookie("countryCode", JSON.stringify(countryCode), 365);
            });

          
           function setCookie(cname, cvalue, exdays) {
              var d = new Date();
              d.setTime(d.getTime() + (exdays*24*60*60*1000));
              var expires = "expires="+d.toUTCString();
              document.cookie = cname + "=" + cvalue + ";path=/site/; " + expires;
           }

           function getCookie(cname) {
              var name = cname + "=";
              var ca = document.cookie.split(';');
              for(var i = 0; i < ca.length; i++) {
                  var c = ca[i];
                  while (c.charAt(0) == ' ') {
                      c = c.substring(1);
                  }
                  if (c.indexOf(name) == 0) {
                      return c.substring(name.length, c.length);
                  }
              }
              return "";
           }
           
			<webl>
               if Size(OPTIONALARGS) > 0 then
                  if (OPTIONALARGS[0] == "nil") then
                     var sessionkey = wubinfo.cookies.sessionkey ? nil;
                     if (sessionkey != nil) then
                        WubCall("siteutil.siteLogout", ["maybeathome", sessionkey]);
                     end;
                     `document.cookie = "sessionkey=;path=/site/; expires=Thu, 01 Jan 1970 00:00:01 GMT;";`
                  else
                     `setCookie("sessionkey", "` + OPTIONALARGS[0] + `", 365);`
                  end;
               else
                  "";
               end;
            </webl>
               
           
           });
        
        	/*--  On Mouseover Footer Dropdown Menu  --*/
           	$(".footer-wrapper .nav > li > a").mouseover(function () {
                //$(".footer-wrapper .nav > li").removeClass("open");
                $(this).parents("li").addClass("open");
            });
            
            $(".footer-wrapper .nav > li > a ").mouseout(function () {
                $(this).parents("li").removeClass("open");
            });
			        </script>