-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHtmlWidget.js
More file actions
99 lines (86 loc) · 2.8 KB
/
HtmlWidget.js
File metadata and controls
99 lines (86 loc) · 2.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
/* ************************************************************************
License: MIT
Authors: Lukas Michalski, Benjamin Zeller, Thorsten Schwalb
************************************************************************ */
qx.Class.define("pms.HtmlWidget",
{
extend : qx.ui.embed.Html,
construct: function (channelname)
{
this.base(arguments);
this.setWidgetLayout();
this.__channelname = channelname;
this.__init = 0 ;
this.__initData = [];
this.__dom = this.getContentElement();
this.__scrollTo = 1000;
this.main();
},
/******************************************************************************
* MEMBERS
******************************************************************************/
members :
{
'__channelname' : null,
'__init' : null,
'__initData' : null,
'__scrollTo' : null,
/******************************************************************************
* FUNCTION: main
******************************************************************************/
main : function ()
{
this.setHtml("<div id=pms-"+this.__channelname+"></div>");
},
/******************************************************************************
* FUNCTION: doScroll
******************************************************************************/
doScroll : function ()
{
this.__scrollTo += 1000;
this.__dom.scrollToY(this.__scrollTo+1000,true);
},
/******************************************************************************
* FUNCTION: setWidgetLayout
******************************************************************************/
setWidgetLayout : function ()
{
this.setOverflow("auto","auto");
this.setDecorator("main");
this.setBackgroundColor("white");
},
/******************************************************************************
* FUNCTION: addMessage
******************************************************************************/
addMessage : function (value,container)
{
if(this.__init == 0)
{
this.__initData.push(value);
var data = "<div id=pms-"+container+">";
for(var x=0; x < this.__initData.length; x++)
{
//data += "<pre class='pms-css'>"+this.__initData[x]+"</pre>";
data += this.__initData[x];
}
data += "</div>";
this.setHtml(data);
if(value.match(/END BACKLOG/))
this.setInit();
}
else
{
//qx.bom.Collection.create("<pre class='pms-css'>"+value+"</pre>").appendTo("#pms-"+container);
qx.bom.Collection.create(value).appendTo("#pms-"+container);
}
this.doScroll();
},
/******************************************************************************
* FUNCTION: setInit
******************************************************************************/
setInit : function ()
{
this.__init = 1;
}
}
});