2015-10-21 23:34:35 +00:00
|
|
|
|
2016-09-26 09:28:47 +00:00
|
|
|
module.exports = new Class
|
2015-10-21 23:34:35 +00:00
|
|
|
({
|
2017-10-18 16:01:21 +00:00
|
|
|
Extends: Vn.Component
|
2015-10-21 23:34:35 +00:00
|
|
|
|
2017-04-05 14:06:07 +00:00
|
|
|
,activate: function ()
|
|
|
|
{
|
|
|
|
this.renderReport ();
|
|
|
|
}
|
|
|
|
|
2017-04-08 11:42:27 +00:00
|
|
|
,open: function (hash, body)
|
2015-11-17 10:34:33 +00:00
|
|
|
{
|
2017-04-08 11:42:27 +00:00
|
|
|
this.hash = hash;
|
2017-03-23 16:20:51 +00:00
|
|
|
this.body = body;
|
2017-03-30 11:44:53 +00:00
|
|
|
this.reportWindow = body.ownerDocument.defaultView;
|
2017-04-08 11:42:27 +00:00
|
|
|
this.activate (hash, body);
|
2015-11-17 10:34:33 +00:00
|
|
|
}
|
2017-03-30 11:44:53 +00:00
|
|
|
|
2017-04-08 11:42:27 +00:00
|
|
|
,openIframe: function (hash)
|
2015-08-17 18:02:14 +00:00
|
|
|
{
|
2017-04-08 11:42:27 +00:00
|
|
|
this.hash = hash;
|
2017-03-30 11:44:53 +00:00
|
|
|
|
2017-03-23 16:20:51 +00:00
|
|
|
var iframe = this.iframe = this.createElement ('iframe');
|
|
|
|
iframe.src = 'js/hedera/report.html';
|
|
|
|
iframe.style.display = 'none';
|
2017-03-30 11:44:53 +00:00
|
|
|
this.doc.body.appendChild (iframe);
|
2017-03-23 16:20:51 +00:00
|
|
|
|
2017-03-30 11:44:53 +00:00
|
|
|
this.reportWindow = iframe.contentWindow;
|
|
|
|
this.reportWindow.addEventListener ('load',
|
|
|
|
this._onWindowLoad.bind (this));
|
2017-03-23 16:20:51 +00:00
|
|
|
|
2015-11-19 13:57:23 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
,_onWindowLoad: function ()
|
|
|
|
{
|
2017-03-30 11:44:53 +00:00
|
|
|
this.body = this.reportWindow.document.body;
|
|
|
|
this.renderReport ();
|
|
|
|
}
|
|
|
|
|
|
|
|
,print: function ()
|
|
|
|
{
|
|
|
|
this.reportWindow.print ();
|
2015-11-19 13:57:23 +00:00
|
|
|
}
|
|
|
|
|
2017-03-30 11:44:53 +00:00
|
|
|
,renderReport: function ()
|
2015-11-19 13:57:23 +00:00
|
|
|
{
|
|
|
|
var builder = new Vn.Builder ();
|
2017-10-18 16:01:21 +00:00
|
|
|
builder.compileFile ('reports/'+ this.info.path +'/ui.xml');
|
|
|
|
|
|
|
|
var extraObjects = {
|
|
|
|
conn: this.conn,
|
|
|
|
hash: this.hash
|
|
|
|
};
|
|
|
|
this.loadScope (builder, null, extraObjects);
|
2017-10-20 17:09:06 +00:00
|
|
|
this.body.appendChild (this.$.report);
|
2015-10-21 23:34:35 +00:00
|
|
|
}
|
|
|
|
});
|