jegolize 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. data/VERSION +1 -1
  2. data/app/controllers/jegol_controller.rb +43 -0
  3. data/app/views/_jegol.html.erb +49 -0
  4. data/app/views/jebol_demo.html.erb +3 -0
  5. data/config/initializers/jegol.rb +3 -0
  6. data/config/jegol.yml +31 -0
  7. data/jegolize.gemspec +31 -1
  8. data/lib/jegolize.rb +31 -0
  9. data/lib/ruby_bosh.rb +161 -0
  10. data/public/javascripts/jegol.js +571 -0
  11. data/public/javascripts/jegol.plugin/jegol.plugin.update.subject_docs/images/doc_background.gif +0 -0
  12. data/public/javascripts/jegol.plugin/jegol.plugin.update.subject_docs/images/shared.css +360 -0
  13. data/public/javascripts/jegol.plugin/jegol.plugin.update.subject_docs/index.html +1 -0
  14. data/public/javascripts/jegol.plugin/jegol.plugin.update.subject_docs/index.html.xml +2 -0
  15. data/public/javascripts/jegol.plugin/jegol.plugin.update.tag_docs/images/doc_background.gif +0 -0
  16. data/public/javascripts/jegol.plugin/jegol.plugin.update.tag_docs/images/shared.css +360 -0
  17. data/public/javascripts/jegol.plugin/jegol.plugin.update.tag_docs/index.html +1 -0
  18. data/public/javascripts/jegol.plugin/jegol.plugin.update.tag_docs/index.html.xml +2 -0
  19. data/public/javascripts/jegol.plugin/update.notify.js +53 -0
  20. data/public/javascripts/jegol.plugin/update.subject.js +17 -0
  21. data/public/javascripts/jegol.plugin/update.tag.js +84 -0
  22. data/public/javascripts/jegol.plugin/viewer.default.js +17 -0
  23. data/public/javascripts/jegol.plugin/viewer.image.js +7 -0
  24. data/public/javascripts/jegol.plugin/viewer.poll.js +6 -0
  25. data/public/javascripts/jegol.plugin/viewer.youtube.js +7 -0
  26. data/public/javascripts/jegol.tag.js +102 -0
  27. data/public/javascripts/jegol_docs/images/doc_background.gif +0 -0
  28. data/public/javascripts/jegol_docs/images/shared.css +360 -0
  29. data/public/javascripts/jegol_docs/index.html +1 -0
  30. data/public/javascripts/jegol_docs/index.html.xml +200 -0
  31. data/public/javascripts/strophe.js +3543 -0
  32. data/public/stylesheets/.gitkeep +0 -0
  33. data/public/stylesheets/jegol.css +181 -0
  34. metadata +32 -2
@@ -0,0 +1,53 @@
1
+
2
+ /**
3
+ * Register 'notify' update plugin
4
+ */
5
+ JeGol.addUpdatePlugins('notify',
6
+ {
7
+ /**
8
+ * Update plugin - Audio visual inication for new messages.
9
+ * @param {Object} msgStanza - string topic
10
+ */
11
+ DoUpdate: function(msgStanza)
12
+ {
13
+ flashIfOutofScope();
14
+ return false;
15
+ }
16
+ });
17
+
18
+ var browserInfocus = 1;
19
+ var flashSpeed = 1500;
20
+ var defaultTitle = 'jeGol';
21
+
22
+ function onBlur() {
23
+ browserInfocus = 0;
24
+ }
25
+ function onFocus(){
26
+ browserInfocus = 1;
27
+ }
28
+
29
+ function flashIfOutofScope(){
30
+ if (browserInfocus == 1)
31
+ {
32
+ window.document.title = defaultTitle;
33
+ }
34
+ else
35
+ {
36
+ if(window.document.title == defaultTitle)
37
+ {
38
+ window.document.title = '*New Message*';
39
+ }else
40
+ {
41
+ window.document.title = defaultTitle;
42
+ }
43
+ setTimeout("flashIfOutofScope();",flashSpeed);
44
+ }
45
+ }
46
+
47
+ if (/*@cc_on!@*/false) { // check for Internet Explorer
48
+ document.onfocusin = onFocus;
49
+ document.onfocusout = onBlur;
50
+ } else {
51
+ window.onfocus = onFocus;
52
+ window.onblur = onBlur;
53
+ }
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Register 'subject' update plugin
3
+ */
4
+ JeGol.addUpdatePlugins('subject',
5
+ {
6
+ /**
7
+ * Update plugin - Sets topic/subject of chat window.
8
+ * @param {Object} msgTitle - string topic
9
+ */
10
+ DoUpdate: function(msgTitle)
11
+ {
12
+ $("#jegol_topic").html(msgTitle);
13
+ return false;
14
+ }
15
+ });
16
+
17
+
@@ -0,0 +1,84 @@
1
+
2
+ /**
3
+ * Register 'like' update plugin
4
+ */
5
+ JeGol.addUpdatePlugins('like',
6
+ {
7
+ /**
8
+ * Adds the parameter to like section
9
+ * @param {Object} msg
10
+ */
11
+ DoUpdate: function(msg)
12
+ {
13
+ var section = $("#jegol_tags").find('#like');
14
+ if(section.length == 0){
15
+ section = $('<fieldset id="like" class="jegol_tag_frameset" ><legend>/like</legend></fieldset>')
16
+ $("#jegol_tags").append(section);
17
+ }
18
+ section.append('<div class="jegol_tags_item">' + msg + '</div>');
19
+ return false;
20
+ }
21
+ });
22
+
23
+ /**
24
+ * Register 'action' update plugin
25
+ */
26
+ JeGol.addUpdatePlugins('action',
27
+ {
28
+ /**
29
+ * Adds the parameter to action section
30
+ * @param {Object} msg
31
+ */
32
+ DoUpdate: function(msg)
33
+ {
34
+ var section = $("#jegol_tags").find('#action');
35
+ if(section.length == 0){
36
+ section = $('<fieldset id="action" class="jegol_tag_frameset" ><legend>/action</legend></fieldset>')
37
+ $("#jegol_tags").append(section);
38
+ }
39
+ section.append('<div class="jegol_tags_item">' + msg + '</div>');
40
+ return false;
41
+ }
42
+ });
43
+
44
+ /**
45
+ * Register 'decision' update plugin
46
+ */
47
+ JeGol.addUpdatePlugins('decision',
48
+ {
49
+ /**
50
+ * Adds the parameter to decision section
51
+ * @param {Object} msg
52
+ */
53
+ DoUpdate: function(msg)
54
+ {
55
+ var section = $("#jegol_tags").find('#decision');
56
+ if(section.length == 0){
57
+ section = $('<fieldset id="decision" class="jegol_tag_frameset" ><legend>/decision</legend></fieldset>')
58
+ $("#jegol_tags").append(section);
59
+ }
60
+ section.append('<div class="jegol_tags_item">' + msg + '</div>');
61
+ return false;
62
+ }
63
+ });
64
+
65
+ /**
66
+ * Register 'park' update plugin
67
+ */
68
+ JeGol.addUpdatePlugins('park',
69
+ {
70
+ /**
71
+ * Adds the parameter to park section
72
+ * @param {Object} msg
73
+ */
74
+ DoUpdate: function(msg)
75
+ {
76
+ var section = $("#jegol_tags").find('#park');
77
+ if(section.length == 0){
78
+ section = $('<fieldset id="park" class="jegol_tag_frameset" ><legend>/park</legend></fieldset>')
79
+ $("#jegol_tags").append(section);
80
+ }
81
+ section.append('<div class="jegol_tags_item">' + msg + '</div>');
82
+ return false;
83
+ }
84
+ });
@@ -0,0 +1,17 @@
1
+
2
+ JeGol.addViewerPlugins('default',
3
+ {
4
+ WriteLog: function(timestamp, nickname, msgID, defaultMsg)
5
+ {
6
+ defaultMsg = defaultMsg.replace(/(https?:\/\/([-\w\.]+)(:\d+)?([-~`!@#%&={}:;,"'<>\/\[\]\\\^\$\.\|\?\*\+\(\)\w\/]*))/g,'<a class="imLink" target="_new" href="$1">$1</a>');
7
+ var id = (new Date()).getTime();
8
+ var imDiv = $('<div></div>')
9
+ .html('<div class="jegol_log_timestamp">' + timestamp + '</div>' + nickname + '<div id="imBody" class="jegol_log_message">' + defaultMsg + '</div>')
10
+ .attr('id', 'imDiv_' + id)
11
+ .attr('msgID', msgID);
12
+
13
+ imDiv.hover(TagMenuHelper.tagMenuPopIn, TagMenuHelper.tagMenuPopOut);
14
+
15
+ return imDiv;
16
+ }
17
+ });
@@ -0,0 +1,7 @@
1
+
2
+ JeGol.addViewerPlugins('image',
3
+ {
4
+ WriteLog: function(msg){
5
+ return '<a target="_blank" href="' + msg + '">' + msg + '</a><br/><img class="jegol_plugin" src="' + msg + '"/>';
6
+ }
7
+ });
@@ -0,0 +1,6 @@
1
+ JeGol.addViewerPlugins('poll',
2
+ {
3
+ WriteLog: function(msg){
4
+ return '<a target="_blank" href="' + msg + '">' + msg + '</a><br/><iframe target="new" class="jegol_plugin" frameborder="0" src="' + msg + '"> </iframe>';
5
+ }
6
+ });
@@ -0,0 +1,7 @@
1
+
2
+ JeGol.addViewerPlugins('youtube',
3
+ {
4
+ WriteLog: function(msg){
5
+ return '<a target="_blank" href="' + msg + '">' + msg + '</a><br/><object class="jegol_plugin"><param name="movie" value="' + msg + '&amp;hl=en_US&amp;fs=1"></param><param name="allowFullScreen" value=""></param><param name="allowscriptaccess" value="always"></param><embed src="' + msg + '&amp;hl=en_US&amp;fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" class="jegol_plugin"></embed></object>';
6
+ }
7
+ });
@@ -0,0 +1,102 @@
1
+
2
+ TagMenuHelper = {
3
+ tagMenuPopIn : function() //toggle menu on hover
4
+ {
5
+ var menu = $(this).find("#menu");
6
+ if(menu.length == 0)
7
+ {
8
+ //create and show QMUC IM menu
9
+ var menuItems = TagMenuHelper._getMenuItems();
10
+
11
+ menu = TagMenuHelper._createMenu(menuItems);
12
+ menu.insertBefore($(this).find('#imBody'));
13
+ }
14
+ menu.slideToggle("slow");
15
+ },
16
+ tagMenuPopOut : function()
17
+ {
18
+ var item = $(this);
19
+ var menu = item.find("#menu");
20
+ menu.slideToggle("fast");
21
+ //menu.remove();
22
+ },
23
+ _createMenu : function(menuItems)
24
+ {
25
+ var menu = $("<div id='menu'></div>")
26
+ .addClass('jegol_plugin_menu')
27
+ .hide(); //start out hidden
28
+ //IM menu
29
+ $.each(
30
+ menuItems,
31
+ function(index, aMenuItem)
32
+ {
33
+ //menu.append('|');
34
+ var menuItem = $("<input/>")
35
+ .attr('type', 'submit')
36
+ .val(aMenuItem.action)
37
+ .attr('action', aMenuItem.action)
38
+ .addClass('jegol_Button')
39
+ .click(function(){aMenuItem.clicked($(this))});
40
+ menu.append(menuItem);
41
+ //menu.append('| ');
42
+ menu.append(' ');
43
+ }
44
+ );
45
+
46
+ return menu;
47
+ },
48
+ _menuItemClicked : function(sender)
49
+ {
50
+ var p = sender.parent().parent();
51
+ var f = p.find('#fromJID').attr('from');
52
+ var b = p.find('#imBody').html();
53
+ var action = sender.attr('action');
54
+
55
+ JeGol.sendStanza(b, action);
56
+ },
57
+ _getMenuItems: function()
58
+ {
59
+ var menuItems = new Array();
60
+ menuItems[0] = {action: 'like',
61
+ clicked: function(sender){
62
+ var values = TagMenuHelper._getValues(sender);
63
+
64
+ JeGol.sendStanza(values.body, values.action);
65
+ }};
66
+ menuItems[1] = {action: 'action',
67
+ clicked: function(sender){
68
+ var values = TagMenuHelper._getValues(sender);
69
+
70
+ JeGol.sendStanza(values.body, values.action);
71
+ }};
72
+ menuItems[2] = {action: 'decision',
73
+ clicked: function(sender){
74
+ var values = TagMenuHelper._getValues(sender);
75
+
76
+ JeGol.sendStanza(values.body, values.action);
77
+ }};
78
+ menuItems[3] = {action: 'park',
79
+ clicked: function(sender){
80
+ var values = TagMenuHelper._getValues(sender);
81
+
82
+ JeGol.sendStanza(values.body, values.action);
83
+ }};
84
+ menuItems[4] = {action: 'tweet',
85
+ clicked: function(sender){
86
+ var values = TagMenuHelper._getValues(sender);
87
+ var url = 'http://twitter.com/share'
88
+ url += '?via=jeGol';
89
+ url += '&text=' + values.from + '-'+ values.body;
90
+ url += '&url=' + document.location.href;
91
+ window.open (url, 'tweet from notablechat', "location=1,status=1,scrollbars=1, width=500,height=500");
92
+ }};
93
+ return menuItems;
94
+ },
95
+ _getValues : function(sender){
96
+ var p = sender.parent().parent();
97
+ var f = p.find('#fromJID').attr('from');
98
+ var b = p.find('#imBody').text();
99
+ var action = sender.attr('action');
100
+ return {from: f, body: b, action: action};
101
+ }
102
+ }
@@ -0,0 +1,360 @@
1
+ body {
2
+ font-family: Verdana, sans-serif;
3
+ background-image: url('doc_background.gif');
4
+ background-repeat: repeat-x;
5
+ padding-left: 0px;
6
+ padding-right: 0px;
7
+ margin: 0px;
8
+ font-size: 70%;
9
+ }
10
+
11
+ a {
12
+ color: #5E83C1;
13
+ text-decoration: none;
14
+ }
15
+
16
+ a:visited {
17
+ color: #5E83C1;
18
+ text-decoration: none;
19
+ }
20
+
21
+ a:hover {
22
+ color: #B7D4F3;
23
+ text-decoration: underline;
24
+ }
25
+
26
+ img {
27
+ border:0px;
28
+ }
29
+
30
+ h1 {
31
+ width: 100%;
32
+ font-weight: bold;
33
+ font-size: 130%;
34
+ color: #FFFFFF;
35
+ background-color: #636D84;
36
+ padding: 10px;
37
+ padding-left: 20px;
38
+ margin-top: 0px;
39
+ }
40
+
41
+ h1 a { color: #FFFFFF; }
42
+
43
+ h1 a:visited { color: #FFFFFF; }
44
+
45
+ pre {
46
+ font-size: 120%;
47
+ color: #1C1D1F;
48
+ background: #f3f3f3;
49
+ padding: 1em 2em;
50
+ border-left: 3px solid #ccc;
51
+ margin-left: 15px;
52
+ }
53
+
54
+ .content {
55
+ padding-left: 20px;
56
+ padding-right: 20px;
57
+ }
58
+
59
+ .content h2 {
60
+ font-weight: bold;
61
+ font-size: 120%;
62
+ color: #959DAF;
63
+ margin-bottom: .5em;
64
+ border-bottom: 1px dotted #aaaaaa;
65
+ padding-top: 6px;
66
+ }
67
+
68
+ /* content for the examples */
69
+ .content h3 {
70
+ font-weight: bold;
71
+ font-size: 120%;
72
+ color: #959DAF;
73
+ margin-bottom: .5em;
74
+ padding-left: 10px;
75
+ padding-top: 6px;
76
+ }
77
+
78
+ .content p {
79
+ margin-left: 15px;
80
+ }
81
+
82
+ .content dd {
83
+ margin-left: 15px;
84
+ padding-bottom: 5px;
85
+ }
86
+
87
+ .content dt {
88
+ margin-left: 10px;
89
+ padding-bottom: 5px;
90
+ }
91
+
92
+ .content table {
93
+ border: 1px solid #ECECEA;
94
+ }
95
+
96
+ .content th {
97
+ font-size: 60%;
98
+ font-weight: bold;
99
+ color: #FFFFFF;
100
+ background-color: #959DAF;
101
+ text-align: left;
102
+ padding-left: 10px;
103
+ padding-right: 10px;
104
+ padding-top: 6px;
105
+ padding-bottom: 6px;
106
+ }
107
+
108
+ .content td {
109
+ font-size: 60%;
110
+ padding-left: 10px;
111
+ padding-right: 10px;
112
+ padding-top: 6px;
113
+ padding-bottom: 6px;
114
+ }
115
+
116
+ /* Lists are top-level lists for each class, i.e. constructors, methods, etc. */
117
+ .list {
118
+ margin-left: 20px;
119
+ }
120
+
121
+ .list h3 {
122
+ font-weight: bold;
123
+ padding-top: 10px;
124
+ padding-left: 0px;
125
+ padding-bottom: 4px;
126
+ }
127
+
128
+ .list dd {
129
+ margin-left: 0px;
130
+ }
131
+
132
+ .list dt {
133
+ margin-left: 14px;
134
+ }
135
+
136
+ .details dt {
137
+ font-weight: bold;
138
+ font-size: 1.2em;
139
+ color: #000000;
140
+ padding-top: 12px;
141
+ padding-left: 0px;
142
+ padding-bottom:0px;
143
+ margin-bottom: 0px;
144
+ margin-left: 15px;
145
+ }
146
+
147
+ .details dd {
148
+ padding-left: 15px;
149
+ margin: 0px;
150
+ }
151
+
152
+ .details dd p
153
+ {
154
+ margin:0px;
155
+ padding:0px;
156
+ padding-top:10px;
157
+ }
158
+
159
+ /* from the example documentation */
160
+ .details h3 {
161
+ font-weight: bold;
162
+ font-size: 1.2em;
163
+ color: #000000;
164
+ padding-left: 0px;
165
+ margin-bottom: 0px;
166
+ margin-left: 14px;
167
+ padding-bottom: 0px;
168
+ background-image: none;
169
+ }
170
+
171
+ .parameters dt {
172
+ font-weight: bold;
173
+ font-size: 1em;
174
+ color: #000000;
175
+ margin-left: 15px;
176
+ }
177
+
178
+ .padded {
179
+ margin-top: 4px;
180
+ margin-left: 10px;
181
+ margin-bottom: 6px;
182
+ }
183
+
184
+ .parameter-table {
185
+ background-color: #F9F9F9;
186
+ }
187
+
188
+ .parameters dd {
189
+ margin-left: 15px;
190
+ margin-bottom: 10px;
191
+ }
192
+
193
+ .navigator {
194
+ padding-top: 10px;
195
+ font-weight: bold;
196
+ font-size: 80%;
197
+ padding-bottom: 10px;
198
+ }
199
+
200
+ .classDescription {
201
+ font-size: 1.4em;
202
+ padding-bottom:10px;
203
+ }
204
+
205
+ DIV#catlinks {
206
+ CLEAR: both; BORDER-RIGHT: #bbb 1px solid; PADDING-RIGHT: 0px; BORDER-TOP: #bbb 1px solid; PADDING-LEFT: 0px; FONT-SIZE: 0.9em; BACKGROUND: #eee; PADDING-BOTTOM: 0px; MARGIN: 40px 0px 0px; BORDER-LEFT: #bbb 1px solid; PADDING-TOP: 0px; BORDER-BOTTOM: #bbb 1px solid
207
+ }
208
+
209
+ DIV#catlinks P {
210
+ PADDING-RIGHT: 5px; PADDING-LEFT: 5px; PADDING-BOTTOM: 2px; MARGIN: 0px; PADDING-TOP: 0px
211
+ }
212
+
213
+ .catlink-table {
214
+ WIDTH: 100%
215
+ }
216
+
217
+ .catlink-table TD {
218
+ PADDING-RIGHT: 8px; PADDING-LEFT: 8px; PADDING-BOTTOM: 8px; PADDING-TOP: 8px
219
+ }
220
+
221
+ .catlink-table TD H4 {
222
+ PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-WEIGHT: bold; FONT-SIZE: 1em; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px; BORDER-BOTTOM: #bbb 1px solid
223
+ }
224
+
225
+ .catlink-table UL {
226
+ PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: 5px 0px; PADDING-TOP: 0px
227
+ }
228
+
229
+ .catlink-table LI {
230
+ MARGIN: 0px 0px 0px 2em; LINE-HEIGHT: 1.45em
231
+ }
232
+
233
+ #updatedContent {
234
+ margin-left: 20px;
235
+ margin-right: 20px;
236
+ padding:10px;
237
+ border:1px solid #CCCCCC;
238
+ background-color:#FFFFE1;
239
+ }
240
+
241
+ ol { list-style-type: decimal; }
242
+ ol ol { list-style-type: lower-alpha; }
243
+ ol ol ol { list-style-type: lower-roman; }
244
+ ol ol ol ol { list-style-type: decimal; }
245
+ ol ol ol ol ol { list-style-type: lower-alpha; }
246
+ ol ol ol ol ol ol { list-style-type: lower-roman; }
247
+ ul { list-style-type: square; }
248
+ ul ul { list-style-type: disc; }
249
+ ul ul ul { list-style-type: circle; }
250
+ ul ul ul ul { list-style-type: square; }
251
+ ul ul ul ul ul { list-style-type: disc; }
252
+ ul ul ul ul ul ul { list-style-type: circle; }
253
+
254
+
255
+ /* COMPATIBILITY TABLES */
256
+
257
+ tr.compheader {
258
+ }
259
+
260
+ tr.compheader th {
261
+ font-weight: normal;
262
+ font-size: 80%;
263
+ text-align:center;
264
+ }
265
+
266
+ td.header {
267
+ background-color: #F2F3EF;
268
+ padding: 0.3em;
269
+ }
270
+
271
+ td.header h3,td.header h4 {
272
+ margin-top: 0.5em;
273
+ text-align: center;
274
+ }
275
+
276
+ td.declaration {
277
+ background-color: #F2F3EF;
278
+ text-align: left;
279
+ vertical-align: top;
280
+ padding-right: 10px;
281
+ color: #666666;
282
+ }
283
+
284
+ td.declaration a {
285
+ text-decoration: none;
286
+ }
287
+
288
+ div.name {
289
+ font-weight: bold;
290
+ margin-bottom: 2em;
291
+ margin-top: 1em;
292
+ font-size:110%;
293
+ }
294
+
295
+ b.warning {
296
+ display: block;
297
+ margin: 0.5em 0;
298
+ }
299
+
300
+ td.comparison {
301
+ font-family: verdana,sans-serif;
302
+ font-size: 80%;
303
+ text-transform: lowercase;
304
+ text-align: center;
305
+ height: 3em;
306
+ border: 1px solid;
307
+ width:8%;
308
+ border-collapse:separate;
309
+ }
310
+
311
+ td.yes {
312
+ background-color: #00882D;
313
+ color: #ffffff;
314
+ }
315
+
316
+ td.almost {
317
+ color: #00882D;
318
+ border-width: 3px;
319
+ }
320
+
321
+ td.incomplete {
322
+ color: #00882D;
323
+ border-color: #00882D;
324
+ }
325
+
326
+ td.alternative {
327
+ color: #006699;
328
+ }
329
+
330
+ td.untestable {
331
+ color: #006699;
332
+ border: none;
333
+ }
334
+
335
+ td.minimal {
336
+ color: #CB000F;
337
+ }
338
+
339
+ td.incorrect {
340
+ color: #CB000F;
341
+ border-width: 2px;
342
+ }
343
+
344
+ td.buggy {
345
+ color: #CB000F;
346
+ border-color: #CB000F;
347
+ border-width: 3px;
348
+ }
349
+
350
+ td.no {
351
+ background-color: #CB000F;
352
+ color: #ffffff;
353
+ }
354
+
355
+ td.crash {
356
+ background-color: #535353;
357
+ font-weight: bold;
358
+ text-transform: uppercase;
359
+ color: #ffffff;
360
+ }
@@ -0,0 +1 @@
1
+ <html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title> ScriptDoc Reference</title><link rel="stylesheet" href="images/shared.css" type="text/css"></head><body><h1> ScriptDoc Reference</h1><div class="content"><h2>Properties</h2><div class="list"><a name="#Object.onConnect"></a><h3>static&nbsp;<i>Boolean</i>&nbsp;JeGol.onConnect.onConnect</h3><p class="padded">Listener for connection status change. On Connected: Join chat room On Disconnect: auto reconnect if so configured</p><dl class="details"></dl><a name="#Object.onPresence"></a><h3>static&nbsp;<i>Object</i>&nbsp;JeGol.onPresence.onPresence</h3><p class="padded">Listener for presence. Updates roster on UI</p><dl class="details"></dl><a name="#Object.onPublicMessage"></a><h3>static&nbsp;<i>Object</i>&nbsp;JeGol.onPublicMessage.onPublicMessage</h3><p class="padded">Listener for in-bound messages.</p><dl class="details"></dl><a name="#Object.addMessage"></a><h3>static&nbsp;<i>Object</i>&nbsp;JeGol.addMessage.addMessage</h3><p class="padded">Append to message log to UI</p><dl class="details"></dl></div><h2>Functions</h2><div class="list"><a name="#.addViewerPlugins"></a><h3>JeGol.addViewerPlugins()&nbsp;:&nbsp;static&nbsp;<i></i></h3><p class="padded">Registers viewer plugins</p><dl class="details"></dl><a name="#.addUpdatePlugins"></a><h3>JeGol.addUpdatePlugins()&nbsp;:&nbsp;static&nbsp;<i></i></h3><p class="padded">Registers update plugin's</p><dl class="details"></dl><a name="#.init"></a><h3>JeGol.init()&nbsp;:&nbsp;static&nbsp;<i></i></h3><p class="padded">Initialize components</p><dl class="details"></dl><a name="#.execCommand"></a><h3>JeGol.execCommand()&nbsp;:&nbsp;static&nbsp;<i></i></h3><p class="padded">Send message based on type ('chat' or 'groupchat')</p><dl class="details"></dl><a name="#.sendStanza"></a><h3>JeGol.sendStanza()&nbsp;:&nbsp;static&nbsp;<i></i></h3><p class="padded">Sends stanza of XMPP-type groupchat. The inner body tag is added for the purpose of graceful degradation for other unaware XMPP clients who look for the <body> tag. If the command passed is already 'body' type, it will not be duplicated. <body ...> < { command } > { message } </ { command } > <body>/ { command } { message } </body> <id> { psudo -GUID}</id> </body></p><dl class="details"></dl><a name="#.getFullHistory"></a><h3>JeGol.getFullHistory()&nbsp;:&nbsp;static&nbsp;<i></i></h3><p class="padded">Reconnect to chat room requesting full chat history</p><dl class="details"></dl><a name="#.loginSIDOnPage"></a><h3>JeGol.loginSIDOnPage()&nbsp;:&nbsp;static&nbsp;<i></i></h3><p class="padded">Establish connection option 1 - from hidden fields with authenticated SID from server side</p><dl class="details"></dl><a name="#.loginSIDFromServer"></a><h3>JeGol.loginSIDFromServer()&nbsp;:&nbsp;static&nbsp;<i></i></h3><p class="padded">Establish connection option 2- from server side json store request for SID</p><dl class="details"></dl><a name="#.loginUsernamePassword"></a><h3>JeGol.loginUsernamePassword()&nbsp;:&nbsp;static&nbsp;<i></i></h3><p class="padded">Establish connection option 3 - from hidden fields with username/password</p><dl class="details"></dl><a name="#.logout"></a><h3>JeGol.logout()&nbsp;:&nbsp;static&nbsp;<i></i></h3><p class="padded">Sends 'unavailable' XMPP-presnce stanza and disconnect.</p><dl class="details"></dl><a name="#.refreshconnection"></a><h3>JeGol.refreshconnection()&nbsp;:&nbsp;static&nbsp;<i></i></h3><p class="padded">Re-login</p><dl class="details"></dl><a name="#.changeNickname"></a><h3>JeGol.changeNickname()&nbsp;:&nbsp;static&nbsp;<i></i></h3><p class="padded">Changes nickname by sending XMPP-presence type stanza</p><dl class="details"></dl><a name="#.onConnect"></a><h3>JeGol.onConnect()&nbsp;:&nbsp;static&nbsp;<i></i></h3><p class="padded">Listener for connection status change. On Connected: Join chat room On Disconnect: auto reconnect if so configured</p><dl class="details"></dl><a name="#.onPresence"></a><h3>JeGol.onPresence()&nbsp;:&nbsp;static&nbsp;<i></i></h3><p class="padded">Listener for presence. Updates roster on UI</p><dl class="details"></dl><a name="#.onPublicMessage"></a><h3>JeGol.onPublicMessage()&nbsp;:&nbsp;static&nbsp;<i></i></h3><p class="padded">Listener for in-bound messages.</p><dl class="details"></dl><a name="#.addMessage"></a><h3>JeGol.addMessage()&nbsp;:&nbsp;static&nbsp;<i></i></h3><p class="padded">Append to message log to UI</p><dl class="details"></dl><a name="#._htmlEncode"></a><h3>JeGol._htmlEncode()&nbsp;:&nbsp;static&nbsp;<i></i></h3><p class="padded">Helper: HTML encode</p><dl class="details"></dl><a name="#._htmlDecode"></a><h3>JeGol._htmlDecode()&nbsp;:&nbsp;static&nbsp;<i></i></h3><p class="padded">Helper: HTML dencode</p><dl class="details"></dl><a name="#._isNullOrEmpty"></a><h3>JeGol._isNullOrEmpty()&nbsp;:&nbsp;static&nbsp;<i></i></h3><p class="padded">Helper: True if string is null or empty or line break</p><dl class="details"></dl><a name="#._stripTimeStampFromNickname"></a><h3>JeGol._stripTimeStampFromNickname()&nbsp;:&nbsp;static&nbsp;<i></i></h3><p class="padded">To support multiple browser/client with same nickname, a time stampe is added after a ":~:" pattern. This helper strips the nickname to bare name. e.g. Guest1324:~:1278889735, alem:~:1278889735</p><dl class="details"></dl><a name="#._logNickname"></a><h3>JeGol._logNickname()&nbsp;:&nbsp;static&nbsp;<i></i></h3><p class="padded">If the same JID/nickname sends multiple messages, do not display it repeatedly. The first message will have the nickname, subsequent messages will not until the sequence is broken by someone else sending a message in between.</p><dl class="details"></dl><a name="#.psudoGuid"></a><h3>JeGol.psudoGuid()&nbsp;:&nbsp;static&nbsp;<i></i></h3><p class="padded">Helper: Generate psudo GUID</p><dl class="details"></dl><a name="#.setCookie"></a><h3>JeGol.setCookie()&nbsp;:&nbsp;static&nbsp;<i></i></h3><p class="padded">Helper: Set value in cookie</p><dl class="details"></dl><a name="#.getCookie"></a><h3>JeGol.getCookie()&nbsp;:&nbsp;static&nbsp;<i></i></h3><p class="padded">Helper: Get value from cookie</p><dl class="details"></dl><a name="#.onload"></a><h3>window.onload()&nbsp;:&nbsp;static&nbsp;<i></i></h3><p class="padded">Start connection on HTML page load</p><dl class="details"></dl><a name="#.onbeforeunload"></a><h3>window.onbeforeunload()&nbsp;:&nbsp;static&nbsp;<i></i></h3><p class="padded">Close connection on HTML page unload</p><dl class="details"></dl></div></div></body></html>