Vn.Report = new Class ({ Extends: Vn.Object ,open: function () {} ,print: function () { this.window.print (); } ,includeCss: function (path) { var basePath = location.protocol +'//'+ location.host; basePath += location.port ? ':'+ location.port : ''; basePath += location.pathname.substring (0, location.pathname.lastIndexOf ('/')); var link = this.doc.createElement ('link'); link.rel = 'stylesheet'; link.type = 'text/css'; link.href = basePath +'/'+ path + Vn.getVersion (); var head = this.doc.getElementsByTagName ('head')[0]; head.appendChild (link); } ,createWindow: function (reportPath) { var reportWindow = window.open (''/*'js/hedera/report.html'*/, '_blank'/*reportPath*/, 'resizable=yes,height=900,width=900,scrollbars=yes,menubar=true'); if (!reportWindow) { Htk.Toast.showError ( _('Can\'t open the report, please unlock popup block and try again')); return; } this.window = reportWindow; this.doc = reportWindow.document this.includeCss ('js/hedera/report.css'); this.includeCss ('reports/'+ reportPath +'/style.css'); var printButton = this.doc.createElement ('button'); printButton.className = 'print-button'; printButton.appendChild (this.doc.createTextNode (_('Print'))); printButton.addEventListener ('click', this.print.bind (this)); this.doc.body.appendChild (printButton); return reportWindow; } });