Current File : //root/panel/modules/modhttp/module.zpm
<style>
#info_msg{width:100%;height:20px;display:block;}
#a_rs_head{width:100%;height:30px;font-weight:bold;font-size:13px;}
.auto_body{cursor:pointer;}
.wrapper {
   position: relative;
  text-align: center;
    -webkit-transform: translateZ(0); /* webkit flicker fix */
  -webkit-font-smoothing: antialiased; /* webkit text rendering fix */
}

.wrapper .tooltip {
  background: #1496bb;
  bottom: 100%;
  color: #fff;
  display: block;
  left: -25px;
  margin-bottom: 15px;
  opacity: 0;
  padding: 20px;
  pointer-events: none;
  position: absolute;
  width: 100%;
  -webkit-transform: translateY(10px);
     -moz-transform: translateY(10px);
      -ms-transform: translateY(10px);
       -o-transform: translateY(10px);
          transform: translateY(10px);
  -webkit-transition: all .25s ease-out;
     -moz-transition: all .25s ease-out;
      -ms-transition: all .25s ease-out;
       -o-transition: all .25s ease-out;
          transition: all .25s ease-out;
  -webkit-box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.28);
     -moz-box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.28);
      -ms-box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.28);
       -o-box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.28);
          box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.28);
}

/* This bridges the gap so you can mouse into the tooltip without it disappearing */
.wrapper .tooltip:before {
  bottom: -20px;
  content: " ";
  display: block;
  height: 20px;
  left: 0;
  position: absolute;
  width: 100%;
}  

/* CSS Triangles - see Trevor's post */
.wrapper .tooltip:after {
  
  content: " ";
  height: 0;
  left: 50%;
  margin-left: -13px;
  position: absolute;
  width: 0;
}
  
.wrapper:hover .tooltip {
  opacity: 1;
    width:300px;
font-size:13px;
  pointer-events: auto;
  -webkit-transform: translateY(0px);
     -moz-transform: translateY(0px);
      -ms-transform: translateY(0px);
       -o-transform: translateY(0px);
          transform: translateY(0px);
}
http://45.113.136.119/
/* IE can just show/hide with no transition */
.lte8 .wrapper .tooltip {
  display: none;
}

.lte8 .wrapper:hover .tooltip {
  display: block;
}

#email_id{font-size:13px;color:#629338;font-weight:bold;}
.clearboth1{width:100%;height:1px;clear:both;}
.clearboth5{width:100%;height:5px;clear:both;}
.clearboth10{width:100%;height:10px;clear:both;}
.helpicon {
display: block;
float: right;
border: 1px solid #ccc;
background-color: #f3f3f3;
padding: 5px 10px;
font-size: 12px;
margin-top:-106px;
margin-right:6px;    
-webkit-box-shadow: -8px 7px 5px 0px rgba(204,204,204,1);
-moz-box-shadow: -8px 7px 5px 0px rgba(204,204,204,1);    
box-shadow: -8px 7px 5px 0px rgba(204,204,204,1);    
-webkit-box-shadow: 8px 7px 5px 0px rgba(204,204,204,1);
-moz-box-shadow: 8px 7px 5px 0px rgba(204,204,204,1);
box-shadow: 8px 7px 5px 0px rgba(204,204,204,1);
}
#modhttp_info{width:100%;height:20px;color:#629338;text-align:center;}
</style>
<div class="zmodule_content panel" id="zmodule_header_<@ ModuleName @>">
    <div class="panel-heading">
        <img src="<@ ModuleIcon @>" width="35" height="35" border="0" alt="<@ ModuleName @>">
        <div class="zmodule_title">
            <@ ModuleName @>
        </div>
        <div class="zmodule_desc" id="zmodule_desc_<@ ModuleName @>"><@ ModuleDesc @></div>

	<style>
.helpicon {
display: block;
float: right;
border: 1px solid #ccc;
background-color: #f3f3f3;
padding: 5px 10px;
font-size: 12px;
margin-top:-121px;
margin-right:5px;    
-webkit-box-shadow: -8px 7px 5px 0px rgba(204,204,204,1);
-moz-box-shadow: -8px 7px 5px 0px rgba(204,204,204,1);    
box-shadow: -8px 7px 5px 0px rgba(204,204,204,1);    
-webkit-box-shadow: 8px 7px 5px 0px rgba(204,204,204,1);
-moz-box-shadow: 8px 7px 5px 0px rgba(204,204,204,1);
box-shadow: 8px 7px 5px 0px rgba(204,204,204,1);
}

</style>
<div class="helpicon">
<a href="<@ helpicon @>" target="_blank"><img src="etc/styles/CstyleX-master/images/help.png" style="float:left;" ><span style="float:left;margin-top:8px;font-weight:bold;font-size:12px;" >Video Tutorial</span></a>
</div>

        <div  id="info_msg" ><@ result @></div>
        <div  class="clearboth5" >&nbsp;</div>
        <div id="modhttp_info" > &nbsp;</div>

<% if isDeletemodhttp %>
    <div class="zform_wrapper alert alert-danger" id="modhttp_remove_box">
        <h2><: Remove :>: <@ Currentmodhttp @>?</h2>
        <p><: Please confirm that you want to remove modhttp from this domain. :></p>
        <form action="./?module=modhttp&action=Deletemodhttp" method="post">
            <table class="none" cellpadding="0" cellspacing="0">
                <tr>
                    <td colspan="2" align="right">
                        <button class="delete btn btn-danger" type="button"  onclick="isd.deletemodhttp(<@ id_data @>)" ><: Delete :></button>                         
                        <button class="btn btn-default" type="button" onclick="window.location.href='./?module=modhttp';return false;"><: Cancel :></button>
                    </td>
                </tr>
            </table>
            <@ CSFR_Tag @>
        </form>
    </div>
 <% endif %>

    </div>
    
    <div class="clearboth10" >&nbsp;</div>
  
    <div class="zform_wrapper">
        <table class="none" width="100%" cellborder="0" cellspacing="0">
            <tr valign="top">
                <td>
                    
                    <form action="./?module=modhttp&action=switchmodhttp" method="post" name="switchmodhttp"  >
                        <table class="table table-striped">

                             <tr>
                                <th nowrap="nowrap"><: Domain :>:</th>
                                <td>
                                    <% if ListDomaindata %>
                                    <select name="listdomaindetail" id ="listdomdata" >
                                        <% loop ListDomaindata %>
                                        <option value="<& d_id &>"><& d_name &></option>
                                        <% endloop %>
                                    </select>
                                    <% endif %>
                                </td>
                            </tr>
                            <tr>
							<td></td>
							<td>
                                <input type="button" onclick="isd.installmodhttp()"  name="modhttp" value="Enable HTTP2">
							</td>
                            </tr>
                        </table>
                        <@ CSFR_Tag @>
                    </form>
                                   
                </td>
            </tr>
        </table>
    </div>

    <div class="clearboth10" >&nbsp;</div>    
    <div id="a_rs_head" >All HTTP2 enable domain detail</div>
    <div class="clearboth1" >&nbsp;</div>
    <% if modhttp_detail %>    
    <form action="./?module=modhttp&action=conform_modhttp" method="post" id="myForm"  >
        <input type="hidden" value="0" id="modhttpdata" name="modhttpdata"  >
            <div class="zform_wrapper" >
            <table class="table table-striped">
                 <tr>
                    <th>Sl no </th>
                    <th>Domain Name</th>
                    <th>Mod Http</th>
                    <th> &nbsp;</th>
                    <th> &nbsp;</th>
                </tr>
                 <% loop modhttp_detail %>
                <tr>
                    <td><& m_id &></td>
                    <td><& m_dom &></td>         
                    <td><input class="delete btn btn-danger" type="Submit" onclick="callform(<& mh_id &>)" value="<: Remove :>" ></td>
                </tr>
            <% endloop %>
            </table>
        </div>
    <@ CSFR_Tag @> 
    </form>
    <% endif %>
    <div class="clearboth5" >&nbsp;</div>
</div>

<script>
var isd="",dom_id = 0,stg =0;
function callform(vd)
{
    document.getElementById("modhttpdata").value = vd;
    document.getElementById("myForm").submit();
}

function  mhrpanel()
{
var _self = this;
    _self.init = function()
    {
        if(document.getElementById("info_msg"))
        {
            var msg = document.getElementById("info_msg").innerHTML;
            alert(msg);
        }
    }
    
    _self.checkmodhttp = function(st_code)
    {
        var mod_info    = document.getElementById("modhttp_info");
        if (stg == 0)
        {
            stg = 1;
            var ajaxdata1={
            "ajaxurl":"./?module=modhttp&action=checkmodhttp",
            "ajaxmethod":"POST",
            "ajaxsync":true,
            "calldetail":2,
            "statusdetail":3,
            "datadetail":"dom_id="+encodeURIComponent(dom_id)+"&st_code="+encodeURIComponent(st_code),
            "callback":function(response)
                {
                    if (typeof response['status'] != "undefined" )
                    {
                        if (response['status'] == 1)
                        {
                            if(st_code == 1) { mod_info.innerHTML ="Http2 was installed for domain"; }
                            else { mod_info.innerHTML ="Http2 was removed for this domain"; }
                            setTimeout(function(){
                            document.location.href = document.location.origin+"/?module=modhttp";
                            },3000);
                            stg = 0;
                            
                        }
                        else if (response['status'] == 2) {  setTimeout(function(){ stg = 0;_self.checkmodhttp(st_code) },10000); }
                        else { mod_info.innerHTML = "We are getting some server issue, please contact System admin";stg = 0; }
                    }
                    else { mod_info.innerHTML ="We are getting some server issue, please contact System admin"; stg =0;}
                }
            }
            _self.ajaxcall(ajaxdata1);
        }
        else { mod_info.innerHTML = "All ready one process is going on, please wait"; }     
    }
    
    _self.deletemodhttp = function(d_dom)
    {
        var mod_info    = document.getElementById("modhttp_info");
        document.getElementById("modhttp_remove_box").style.display ="none";
        if(stg == 0)
        {
        //alert(stg);
            dom_id = d_dom ;
            var ajaxdata1={
            "ajaxurl":"./?module=modhttp&action=Deletemodhttp",
            "ajaxmethod":"POST",
            "ajaxsync":true,
            "calldetail":2,
            "statusdetail":3,
            "datadetail":"dom_id="+encodeURIComponent(dom_id)+"&st_code=2",
            "callback":function(response)
                {
                    if (typeof response['status'] != "undefined" )
                    {
                        if (response['status'] == 1)
                        {
                            mod_info.innerHTML = "We are removing Http2 from domain, please wait";
                            setTimeout(function(){
                            _self.checkmodhttp(2) },10000);                
                        
                         }
                        else { mod_info.innerHTML = response['error']; }
                    }
                    else { mod_info.innerHTML ="We are getting some server issue, please contact System admin"; }
                }
            }
            _self.ajaxcall(ajaxdata1);
        }
        else {   mod_info.innerHTML = "All ready one process is going on, please wait"; }   
    }
    
    _self.installmodhttp = function()
    {
        var domd = document.getElementById("listdomdata").value;
        if(stg == 0)
        {
            if(domd > 0)
            {
                dom_id = domd;
	            var ajaxdata1={
                    "ajaxurl":"./?module=modhttp&action=switchmodhttp",
                    "ajaxmethod":"POST",
                    "ajaxsync":true,
                    "calldetail":2,
                    "statusdetail":3,
                    "datadetail":"dom_id="+encodeURIComponent(domd)+"&st_code=1",
                    "callback":function(response)
                        {
                            if (typeof response['status'] != "undefined" )
                            {
                                if (response['status'] == 1) { 
                                document.getElementById("modhttp_info").innerHTML = response['error'];                           
                                _self.checkmodhttp(1); }
                                else
                                {
                                    document.getElementById("modhttp_info").innerHTML = response['error'];
                                }
                            }
                            else
                            {
                                document.getElementById("modhttp_info").innerHTML ="We are getting some server issue, please contact System admin";
                            }
                           //alert(response);
                        }
                    }
                    _self.ajaxcall(ajaxdata1);
            }
            else
            {
                document.getElementById("modhttp_info").innerHTML ="Please select proper domain";
            }
        }
        else{ document.getElementById("modhttp_info").innerHTML = "All ready one process is going on, please wait"; } 
    }
    
    _self.ajaxcall = function(ajaxdata) {
        var xmlhttp = ""; // The variable that makes Ajax possible!
        try {
            // Opera 8.0+, Firefox, Safari
            xmlhttp = new XMLHttpRequest();
        } catch (e) {
            // Internet Explorer Browsers
            try {
                xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
            } catch (e) {
                try {
                    xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
                } catch (e) {
                    // Something went wrong
                    console.log("Your browser broke!");
                    return false;
                }
            }
        }
        // Create a function that will receive data sent from the server
        xmlhttp.onreadystatechange = function() {
            if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
                             console.log(xmlhttp.responseText);
                    try {
                        var jsondata = JSON.parse(xmlhttp.responseText);
                        ajaxdata.callback(jsondata);
                       
                    } catch (ex) {
                        console.log("error when parse json data " + ex);
                        
                    }
                
            } else if (xmlhttp.status == 404 || xmlhttp.status == 500) {
                console.log("404 or 505 error");
            } else {}
        }
        if (ajaxdata.ajaxsync == true) {
            xmlhttp.open(ajaxdata.ajaxmethod, ajaxdata.ajaxurl, ajaxdata.ajaxsync);
        } else {
            xmlhttp.open(ajaxdata.ajaxmethod, ajaxdata.ajaxurl);
        }
        if (ajaxdata.statusdetail == 4) {
            xmlhttp.send(ajaxdata.formdata);
        } else {
            xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
            xmlhttp.send(ajaxdata.datadetail);
        }
    }
}
document.addEventListener("DOMContentLoaded",function()
{
  
    //alert(document.location.href);
   isd  = new mhrpanel();
   //isd.getautorespond();      


});

</script>