File: /var/www/info.viitorcloud.in/wp-content/themes/infoviitorcloud/assets/js/mycustom.js
$=jQuery;
$(document).ready(function(){
/* Start for count click */
/* End for count click */
if (typeof html5Lightbox === "undefined")
html5Lightbox = jQuery(".html5lightbox").html5lightbox({
resizespeed:0
})
$(".html5lightbox").click(function(){
// $(this).attr('href','javascript:void(0)');
// $(this).attr('onclick',+$(this).attr('href'));
// $(this).attr('href','javascript:void(0)');
//var event_id = $(this).attr('id');
//alert(event_id);
$('html').addClass('overflow');
setTimeout(function(){
$("#html5-lightbox-box iframe")[0].contentWindow.oncontextmenu = function () {
return false;
}
$("#html5-lightbox-box iframe").contents().find("#download, #print").remove()
$("#html5-lightbox-box iframe").contents().find("#viewer").append('<style type="text/css" media="print">* { display: none; }</style>')
$("#html5-lightbox-box iframe").contents().bind('keydown keypress', function(e) {
console.log(e.ctrlKey && e.key == "p" || e.charCode == 16 || e.charCode == 112 || e.keyCode == 80)
if(e.ctrlKey && (e.key == "p" || e.charCode == 16 || e.charCode == 112 || e.keyCode == 80) ){
alert("Please use the Print PDF button below for a better rendering on the document");
e.cancelBubble = true;
e.preventDefault();
e.stopImmediatePropagation();
}
if((e.ctrlKey && (e.which == 83)) || (e.ctrlKey && (e.which == 80))) {
e.preventDefault();
return false;
}
});
},1000)
})
window.oncontextmenu = function () {
return false;
}
// for stop body scroll when lightbox open
$("body").on("mousedown", "#html5-close-fullscreen, #html5-lightbox-overlay, #html5-close", function(){
$("html").removeClass("overflow");
});
$(document).keyup(function(e) {
if (e.keyCode === 27) {
$("html").removeClass("overflow");
}
});
})
$(window).load(function () {
var frame = $('iframe').get(0);
if (frame != null) {
var frmHead = $(frame).contents().find('head');
if (frmHead != null) {
frmHead.append($('style, link[rel=stylesheet]').clone()); // clone existing css link
//frmHead.append($("<link/>", { rel: "stylesheet", href: "/styles/style.css", type: "text/css" })); // or create css link yourself
}
}
});