Subversion Repositories SmartDukaan

Rev

Rev 18148 | Blame | Compare with Previous | Last modification | View Log | RSS feed

<!DOCTYPE html>
<html>
<head>
        <script type="text/javascript" src="<?php echo $base_url;?>js/jquery-1.10.2.js"></script>
        <title>Profitmandi</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0"/> 
    <body>
        <input type="hidden" value='<?php echo $intentToSend;?>' id="intent" />
    </body>
</head>

</html>

<script type="text/javascript">
$( document ).ready(function (){
        $(document).on('click','.ok',function(){
                $('.modalWindow').hide();
                window.location=document.getElementById('intent').value;
        });
});

var overlayElement = null;
var modalWindowElement = null;

var isTouchSupported = 'ontouchstart' in window.document;
var startEvent = isTouchSupported ? 'touchstart' : 'mousedown';
var moveEvent = isTouchSupported ? 'touchmove' : 'mousemove';
var endEvent = isTouchSupported ? 'touchend' : 'mouseup';

//when window loads
window.addEventListener('load', initialize, false);
function initialize() {
        showPopUpMessage(createPopUpHeader("Welcome to Profitmandi"),createPopUpContent("This message has expired. The deals might have changed."),250,175);
}
  
function createPopUpHeader(title){
    modalWindowHeader = document.createElement("div");
    modalWindowHeader.className = "modalWindowHeader";
    modalWindowHeader.innerHTML = "<p>" + title + "</p>";
    return modalWindowHeader;
}
function createPopUpContent(msg){
    modalWindowContent = document.createElement("div");
    modalWindowContent.className = "modalWindowContent";
    modalWindowContent.innerHTML = "<p style='text-align:center; margin-top:10px;'>" + msg + "</p>";
    okBtn = document.createElement("div");
    okBtn.className = "redBtn okBtn";
    okBtn.innerHTML = "<p class='ok' style='text-align:center;'>OK</p>";
    okBtn.addEventListener(endEvent,function(){ hidePopUpMessage(); },false);
    modalWindowContent.appendChild(okBtn);
    return modalWindowContent;
}

function showPopUpMessage(modalWindowHeader,modalWindowContent,width,height) {
    overlayElement = document.createElement("div");
    overlayElement.className = 'modalOverlay';
    modalWindowElement = document.createElement("div");
    modalWindowElement.className = 'modalWindow';
    modalWindowElement.style.width = width + "px";
    modalWindowElement.style.height = height + "px";
    modalWindowElement.style.left = (window.innerWidth - width) / 2 + "px";
    modalWindowElement.style.top = (window.innerHeight - height) / 2 + "px";
    modalWindowElement.appendChild(modalWindowHeader);
    modalWindowElement.appendChild(modalWindowContent);
    document.body.appendChild(overlayElement);
    document.body.appendChild(modalWindowElement);
    setTimeout(function() {
        modalWindowElement.style.opacity = 1;
        overlayElement.style.opacity = 0.4;
        overlayElement.addEventListener(endEvent, hidePopUpMessage, false);
    }, 300);
}

function hidePopUpMessage() {
    modalWindowElement.style.opacity = 0;
    overlayElement.style.opacity = 0;
    overlayElement.removeEventListener(endEvent, hidePopUpMessage, false);
    setTimeout(function() {
        document.body.removeChild(overlayElement);
        document.body.removeChild(modalWindowElement);
    }, 400); 
        //window.location=document.getElementById('intent').value;
}

</script>


<style type="text/css">
*
{
    margin:0;
    padding:0;
}
html,body
{
    margin:0;
    padding:0;
    font-family:Helvetica;
    font-size:14px;
    background:#FFFFFF; 
    color:#222;
    width:100%;
    height:100%;
} 
#wrapper
{
    width:100%;
    height:100%;            
    overflow:hidden;
    position:relative;
}      
.pageHeader
{
    width:100%;
    line-height:40px;            
    padding-top:3px;                           
    color: #fff;
    display: block;
    overflow:hidden;
    font-size: 16px;
    font-weight: bold;            
    text-align: center;                        
    margin-bottom:0px;            
    border-bottom:1px solid #999999;
    background-color:#354F6E;                
    background: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #8a8a8a), color-stop(2%, #6a6a6a), color-stop(100%, #151515));
}                                 

.content
{
    padding:10px;
    text-align:center;                       
} 
        
.redBtn                       
{
    -webkit-border-radius:4px;
    padding:10px;
    text-align:center;
    color:#fff;
    font-size:14px;
    font-weight:bold;             
    background: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #58d936), color-stop(2%, #58d936), color-stop(100%, #58d936));
    -webkit-tap-highlight-color:rgba(0,0,0,0); 
    
} 
.okBtn
{             
    width:80px;
    padding:10px;                
    position:absolute;
    left:77px;
    bottom:10px;  
} 

/* modal window*/
.modalOverlay
{
    width:100%;
    height:100%;
    position:absolute;
    top:0;             
    left:0;
    margin:0;
    padding:0;
    background:#000;
    opacity:0;
    -webkit-transition: opacity 0.3s ease-in;
    z-index:101;
}
.modalWindow
{
    position:fixed;
    margin:0;                          
    text-align:center;
    word-spacing:2px;
    line-height:15px;
    font-weight:bold;
    font-size:13px;
    color:#58d936;
    opacity:0;                        
    z-index:102;
    background: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #FFFFFF), color-stop(2%, #FFFFFF), color-stop(100%, #FFFFFF));    
    -webkit-border-radius:2px;              
    -webkit-box-shadow:-1px 2px 12px rgba(0, 0, 0, 0.91);
    -webkit-transition: opacity 0.2s ease-in;                          
}
.modalWindowHeader
{
    width:100%;
    line-height:45px;
    /*height:62px;*/
    padding-top:3px;                           
    color: #fff;
    display: block;
    overflow:hidden;
    font-size: 16px;
    font-weight: bold;            
    text-align: center;                        
    margin-bottom:0px;    
    background: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #58d936), color-stop(2%, #58d936), color-stop(100%, #58d936));
}
.modalWindowContent
{       
    padding:10px;                           
    color: #000;
    display: block;
    overflow:hidden;
    font-size: 14px;
    font-weight: bold;            
    line-height:20px;                                          
}
</style>