taskreport
Version:
A Report Render for TaskBuilder
44 lines (37 loc) • 947 B
JavaScript
function showMsg(msg) {
$("#divHint").html(msg);
if(isShowHint) return;
isShowHint = true;
$("#divHint").show();
setTimeout(function() {
$("#divHint").hide();
isShowHint = false;
}, 3000);
}
function changeFrameHeight(){
var ifm= document.getElementById("ifm");
//ifm.height=document.documentElement.clientHeight;
}
window.onresize=function(){
changeFrameHeight();
}
function printReport() {
var f = document.getElementById('ifm');
window.frames['ifm'].focus();
/*try{
window.frames['ifm'].print();
} catch(err) {
f.contentWindow.print();
}*/
f.contentWindow.printReport();
}
function isDev() {
return (window.navigator.userAgent+"").indexOf("Electron")>0;
}
function openTFP() {
let urlPath = location.href+"";
$("#ifm").attr("src", "render.html"+urlPath.substr(urlPath.indexOf("?")));
}
$(function() {
if(!isDev()) openTFP();
});