\
\
\
\
\
'+(attrs.text||'please wait..')+'\
\
');
};
$.fn.preloader_remove = function(){
var obj = $(this);
obj.find(".hover-preloader").remove();
}
// JavaScript Document
var popup = {
show : function(title, content, ops){
var infoMode=ops.mode=="info";
ops = ops==undefined?{}:ops;
title = title!=undefined?title:"";
content = content!=undefined?content:"";
ops.closebtn = ops.closebtn!=undefined?ops.closebtn:true;
if(infoMode){
title = ''+title+'
';
content = ''+content+'
';
ops.ok_btn = ops.ok_btn!=undefined?ops.ok_btn:true;
ops.width = ops.width==undefined?500:ops.width;
}
var popObj = document.createElement("div");
if(ops.id!=undefined) popObj.id = ops.id;
popObj.className = 'popup-frame'+(infoMode?' info-mode':'');
popObj.innerHTML = '';
if(ops.closebtn){
$(popObj).find(".popup-close").click(function(e) {
popup.hide($(this).parents(".popup-frame"));
return false;
});
}
if(ops.ok_btn==true){
$(popObj).find(".ok_btn").click(function(e){
popup.hide($(this).parents(".popup-frame"));
return false;
});
}
if(infoMode && !window.infoModeKeyEvtBound){
window.infoModeKeyEvtBound = 1;
document.addEventListener('keypress', popup.onInfoModeCloseEvtTrack);
}
if(!popup.popupLastIx){
popup.popupLastIx = 7499;
}
popup.popupLastIx++;
popObj.style.zIndex = popup.popupLastIx;
$("body").prepend(popObj);
if(ops.callback!=undefined){
ops.callback();
}
popObj.resizeEvent = function(){
popup.updateHeight($(popObj));
};
$(window).bind("resize", popObj.resizeEvent);
$("html").css({overflow:"hidden"});
popObj.resizeEvent();
},
hide : function(obj, ops){
ops = ops==undefined?{}:ops;
obj = obj==undefined?$(".popup-frame"):$(obj);
$(window).unbind("resize", obj[0].resizeEvent);
obj.remove();
if(ops.callback!=undefined){
ops.callback();
}
if($(".popup-frame").length==0){
$("html").css({overflow:""});
}
},
updateHeight : function(obj){
var targetHeight = $(window).height() - 90;
var limiter = obj.find('.limit-content');
if (limiter.find('> div').height() > targetHeight) {
limiter.height(targetHeight).css({
overflow: 'auto', marginRight:"-15px", maxWidth:"none"
});
}else if(obj.length>0){
limiter[0].style = {};
}
},
showPreloader:function(msg, width, id){
this.show('', `
`+(msg||'Loading. Please wait..')+`
`, {
width:width||400, closebtn:0, id:id
});
},
onInfoModeCloseEvtTrack:function(e){
if(e.keyCode==13){
var lastInfo = $('.popup-frame.info-mode');
if(lastInfo[0]){
popup.hide(lastInfo[0]);
}
if(lastInfo.length<2){
delete window.infoModeKeyEvtBound;
document.removeEventListener('keypress', popup.onInfoModeCloseEvtTrack);
}
}
}
}
$(document).ready(function(e) {
$(".confirm").click(function(e) {
return confirm(this.dataset.message!=undefined?this.dataset.message:"Are you sure ?");
});
$("#mobileMenuBtn,#close").click(function(e){
$("#mobMenu").toggleClass("show_menu");
e.preventDefault();
});
});
function closeUserNoti() {
setTimeout(function(){ $(".user-notification").remove(); }, 7000);
}
var pix={
openNotification:function(message, ok){
message = message||'Oops. An error occurred. Please try again.';
ok = ok||'';
var msgCont = document.getElementById('notificationMsgLoader'), msgItem=document.createElement('div');
if(!msgCont){
msgCont = document.createElement('div');
msgCont.id = 'notificationMsgLoader';
document.body.appendChild(msgCont);
}
msgItem.className = 'notification-item'+(ok?' success':'');
msgItem.innerHTML = message+'';
msgItem.getClass('noti-close-btn').onclick = pix.winNotificationHide;
$(msgItem).fadeIn(250);
msgCont.appendChild(msgItem);
$(msgItem).delay(15000).fadeOut(250, pix.winNotificationFadeOutCb);
},
winNotificationHide:function(){
$(this.parentNode).clearQueue().fadeOut(250, pix.winNotificationFadeOutCb);
},
winNotificationFadeOutCb:function(){
$(this).remove();
}
};