0
|
1 /*==================================================
|
|
2 * Default Event Source
|
|
3 *==================================================
|
|
4 */
|
|
5
|
|
6
|
|
7 Timeline.DefaultEventSource = function(eventIndex) {
|
|
8 this._events = (eventIndex instanceof Object) ? eventIndex : new SimileAjax.EventIndex();
|
|
9 this._listeners = [];
|
|
10 };
|
|
11
|
|
12 Timeline.DefaultEventSource.prototype.addListener = function(listener) {
|
|
13 this._listeners.push(listener);
|
|
14 };
|
|
15
|
|
16 Timeline.DefaultEventSource.prototype.removeListener = function(listener) {
|
|
17 for (var i = 0; i < this._listeners.length; i++) {
|
|
18 if (this._listeners[i] == listener) {
|
|
19 this._listeners.splice(i, 1);
|
|
20 break;
|
|
21 }
|
|
22 }
|
|
23 };
|
|
24
|
|
25 Timeline.DefaultEventSource.prototype.loadXML = function(xml, url) {
|
|
26 var base = this._getBaseURL(url);
|
|
27
|
|
28 var wikiURL = xml.documentElement.getAttribute("wiki-url");
|
|
29 var wikiSection = xml.documentElement.getAttribute("wiki-section");
|
|
30
|
|
31 var dateTimeFormat = xml.documentElement.getAttribute("date-time-format");
|
|
32 var parseDateTimeFunction = this._events.getUnit().getParser(dateTimeFormat);
|
|
33
|
|
34 var node = xml.documentElement.firstChild;
|
|
35 var added = false;
|
|
36 while (node != null) {
|
|
37 if (node.nodeType == 1) {
|
|
38 var description = "";
|
|
39 if (node.firstChild != null && node.firstChild.nodeType == 3) {
|
|
40 description = node.firstChild.nodeValue;
|
|
41 }
|
|
42 // instant event: default is true. Or use values from isDuration or durationEvent
|
|
43 var instant = (node.getAttribute("isDuration") === null &&
|
|
44 node.getAttribute("durationEvent") === null) ||
|
|
45 node.getAttribute("isDuration") == "false" ||
|
|
46 node.getAttribute("durationEvent") == "false";
|
|
47
|
|
48 var evt = new Timeline.DefaultEventSource.Event( {
|
|
49 id: node.getAttribute("id"),
|
|
50 start: parseDateTimeFunction(node.getAttribute("start")),
|
|
51 end: parseDateTimeFunction(node.getAttribute("end")),
|
|
52 latestStart: parseDateTimeFunction(node.getAttribute("latestStart")),
|
|
53 earliestEnd: parseDateTimeFunction(node.getAttribute("earliestEnd")),
|
|
54 instant: instant,
|
|
55 text: node.getAttribute("title"),
|
|
56 description: description,
|
|
57 image: this._resolveRelativeURL(node.getAttribute("image"), base),
|
|
58 link: this._resolveRelativeURL(node.getAttribute("link") , base),
|
|
59 icon: this._resolveRelativeURL(node.getAttribute("icon") , base),
|
|
60 color: node.getAttribute("color"),
|
|
61 textColor: node.getAttribute("textColor"),
|
|
62 hoverText: node.getAttribute("hoverText"),
|
|
63 classname: node.getAttribute("classname"),
|
|
64 tapeImage: node.getAttribute("tapeImage"),
|
|
65 tapeRepeat: node.getAttribute("tapeRepeat"),
|
|
66 caption: node.getAttribute("caption"),
|
|
67 eventID: node.getAttribute("eventID"),
|
|
68 trackNum: node.getAttribute("trackNum")
|
|
69 });
|
|
70
|
|
71 evt._node = node;
|
|
72 evt.getProperty = function(name) {
|
|
73 return this._node.getAttribute(name);
|
|
74 };
|
|
75 evt.setWikiInfo(wikiURL, wikiSection);
|
|
76
|
|
77 this._events.add(evt);
|
|
78
|
|
79 added = true;
|
|
80 }
|
|
81 node = node.nextSibling;
|
|
82 }
|
|
83
|
|
84 if (added) {
|
|
85 this._fire("onAddMany", []);
|
|
86 }
|
|
87 };
|
|
88
|
|
89
|
|
90 Timeline.DefaultEventSource.prototype.loadJSON = function(data, url) {
|
|
91 var base = this._getBaseURL(url);
|
|
92 var added = false;
|
|
93 if (data && data.events){
|
|
94 var wikiURL = ("wikiURL" in data) ? data.wikiURL : null;
|
|
95 var wikiSection = ("wikiSection" in data) ? data.wikiSection : null;
|
|
96
|
|
97 var dateTimeFormat = ("dateTimeFormat" in data) ? data.dateTimeFormat : null;
|
|
98 var parseDateTimeFunction = this._events.getUnit().getParser(dateTimeFormat);
|
|
99
|
|
100 for (var i=0; i < data.events.length; i++){
|
|
101 var event = data.events[i];
|
|
102 // Fixing issue 33:
|
|
103 // instant event: default (for JSON only) is false. Or use values from isDuration or durationEvent
|
|
104 // isDuration was negated (see issue 33, so keep that interpretation
|
|
105 var instant = event.isDuration || (event.durationEvent != null && !event.durationEvent);
|
|
106
|
|
107 var evt = new Timeline.DefaultEventSource.Event({
|
|
108 id: ("id" in event) ? event.id : undefined,
|
|
109 start: parseDateTimeFunction(event.start),
|
|
110 end: parseDateTimeFunction(event.end),
|
|
111 latestStart: parseDateTimeFunction(event.latestStart),
|
|
112 earliestEnd: parseDateTimeFunction(event.earliestEnd),
|
|
113 instant: instant,
|
|
114 text: event.title,
|
|
115 description: event.description,
|
|
116 image: this._resolveRelativeURL(event.image, base),
|
|
117 link: this._resolveRelativeURL(event.link , base),
|
|
118 icon: this._resolveRelativeURL(event.icon , base),
|
|
119 color: event.color,
|
|
120 textColor: event.textColor,
|
|
121 hoverText: event.hoverText,
|
|
122 classname: event.classname,
|
|
123 tapeImage: event.tapeImage,
|
|
124 tapeRepeat: event.tapeRepeat,
|
|
125 caption: event.caption,
|
|
126 eventID: event.eventID,
|
|
127 trackNum: event.trackNum
|
|
128 });
|
|
129 evt._obj = event;
|
|
130 evt.getProperty = function(name) {
|
|
131 return this._obj[name];
|
|
132 };
|
|
133 evt.setWikiInfo(wikiURL, wikiSection);
|
|
134
|
|
135 this._events.add(evt);
|
|
136 added = true;
|
|
137 }
|
|
138 }
|
|
139
|
|
140 if (added) {
|
|
141 this._fire("onAddMany", []);
|
|
142 }
|
|
143 };
|
|
144
|
|
145 /*
|
|
146 * Contributed by Morten Frederiksen, http://www.wasab.dk/morten/
|
|
147 */
|
|
148 Timeline.DefaultEventSource.prototype.loadSPARQL = function(xml, url) {
|
|
149 var base = this._getBaseURL(url);
|
|
150
|
|
151 var dateTimeFormat = 'iso8601';
|
|
152 var parseDateTimeFunction = this._events.getUnit().getParser(dateTimeFormat);
|
|
153
|
|
154 if (xml == null) {
|
|
155 return;
|
|
156 }
|
|
157
|
|
158 /*
|
|
159 * Find <results> tag
|
|
160 */
|
|
161 var node = xml.documentElement.firstChild;
|
|
162 while (node != null && (node.nodeType != 1 || node.nodeName != 'results')) {
|
|
163 node = node.nextSibling;
|
|
164 }
|
|
165
|
|
166 var wikiURL = null;
|
|
167 var wikiSection = null;
|
|
168 if (node != null) {
|
|
169 wikiURL = node.getAttribute("wiki-url");
|
|
170 wikiSection = node.getAttribute("wiki-section");
|
|
171
|
|
172 node = node.firstChild;
|
|
173 }
|
|
174
|
|
175 var added = false;
|
|
176 while (node != null) {
|
|
177 if (node.nodeType == 1) {
|
|
178 var bindings = { };
|
|
179 var binding = node.firstChild;
|
|
180 while (binding != null) {
|
|
181 if (binding.nodeType == 1 &&
|
|
182 binding.firstChild != null &&
|
|
183 binding.firstChild.nodeType == 1 &&
|
|
184 binding.firstChild.firstChild != null &&
|
|
185 binding.firstChild.firstChild.nodeType == 3) {
|
|
186 bindings[binding.getAttribute('name')] = binding.firstChild.firstChild.nodeValue;
|
|
187 }
|
|
188 binding = binding.nextSibling;
|
|
189 }
|
|
190
|
|
191 if (bindings["start"] == null && bindings["date"] != null) {
|
|
192 bindings["start"] = bindings["date"];
|
|
193 }
|
|
194
|
|
195 // instant event: default is true. Or use values from isDuration or durationEvent
|
|
196 var instant = (bindings["isDuration"] === null &&
|
|
197 bindings["durationEvent"] === null) ||
|
|
198 bindings["isDuration"] == "false" ||
|
|
199 bindings["durationEvent"] == "false";
|
|
200
|
|
201 var evt = new Timeline.DefaultEventSource.Event({
|
|
202 id: bindings["id"],
|
|
203 start: parseDateTimeFunction(bindings["start"]),
|
|
204 end: parseDateTimeFunction(bindings["end"]),
|
|
205 latestStart: parseDateTimeFunction(bindings["latestStart"]),
|
|
206 earliestEnd: parseDateTimeFunction(bindings["earliestEnd"]),
|
|
207 instant: instant, // instant
|
|
208 text: bindings["title"], // text
|
|
209 description: bindings["description"],
|
|
210 image: this._resolveRelativeURL(bindings["image"], base),
|
|
211 link: this._resolveRelativeURL(bindings["link"] , base),
|
|
212 icon: this._resolveRelativeURL(bindings["icon"] , base),
|
|
213 color: bindings["color"],
|
|
214 textColor: bindings["textColor"],
|
|
215 hoverText: bindings["hoverText"],
|
|
216 caption: bindings["caption"],
|
|
217 classname: bindings["classname"],
|
|
218 tapeImage: bindings["tapeImage"],
|
|
219 tapeRepeat: bindings["tapeRepeat"],
|
|
220 eventID: bindings["eventID"],
|
|
221 trackNum: bindings["trackNum"]
|
|
222 });
|
|
223 evt._bindings = bindings;
|
|
224 evt.getProperty = function(name) {
|
|
225 return this._bindings[name];
|
|
226 };
|
|
227 evt.setWikiInfo(wikiURL, wikiSection);
|
|
228
|
|
229 this._events.add(evt);
|
|
230 added = true;
|
|
231 }
|
|
232 node = node.nextSibling;
|
|
233 }
|
|
234
|
|
235 if (added) {
|
|
236 this._fire("onAddMany", []);
|
|
237 }
|
|
238 };
|
|
239
|
|
240 Timeline.DefaultEventSource.prototype.add = function(evt) {
|
|
241 this._events.add(evt);
|
|
242 this._fire("onAddOne", [evt]);
|
|
243 };
|
|
244
|
|
245 Timeline.DefaultEventSource.prototype.addMany = function(events) {
|
|
246 for (var i = 0; i < events.length; i++) {
|
|
247 this._events.add(events[i]);
|
|
248 }
|
|
249 this._fire("onAddMany", []);
|
|
250 };
|
|
251
|
|
252 Timeline.DefaultEventSource.prototype.clear = function() {
|
|
253 this._events.removeAll();
|
|
254 this._fire("onClear", []);
|
|
255 };
|
|
256
|
|
257 Timeline.DefaultEventSource.prototype.getEvent = function(id) {
|
|
258 return this._events.getEvent(id);
|
|
259 };
|
|
260
|
|
261 Timeline.DefaultEventSource.prototype.getEventIterator = function(startDate, endDate) {
|
|
262 return this._events.getIterator(startDate, endDate);
|
|
263 };
|
|
264
|
|
265 Timeline.DefaultEventSource.prototype.getEventReverseIterator = function(startDate, endDate) {
|
|
266 return this._events.getReverseIterator(startDate, endDate);
|
|
267 };
|
|
268
|
|
269 Timeline.DefaultEventSource.prototype.getAllEventIterator = function() {
|
|
270 return this._events.getAllIterator();
|
|
271 };
|
|
272
|
|
273 Timeline.DefaultEventSource.prototype.getCount = function() {
|
|
274 return this._events.getCount();
|
|
275 };
|
|
276
|
|
277 Timeline.DefaultEventSource.prototype.getEarliestDate = function() {
|
|
278 return this._events.getEarliestDate();
|
|
279 };
|
|
280
|
|
281 Timeline.DefaultEventSource.prototype.getLatestDate = function() {
|
|
282 return this._events.getLatestDate();
|
|
283 };
|
|
284
|
|
285 Timeline.DefaultEventSource.prototype._fire = function(handlerName, args) {
|
|
286 for (var i = 0; i < this._listeners.length; i++) {
|
|
287 var listener = this._listeners[i];
|
|
288 if (handlerName in listener) {
|
|
289 try {
|
|
290 listener[handlerName].apply(listener, args);
|
|
291 } catch (e) {
|
|
292 SimileAjax.Debug.exception(e);
|
|
293 }
|
|
294 }
|
|
295 }
|
|
296 };
|
|
297
|
|
298 Timeline.DefaultEventSource.prototype._getBaseURL = function(url) {
|
|
299 if (url.indexOf("://") < 0) {
|
|
300 var url2 = this._getBaseURL(document.location.href);
|
|
301 if (url.substr(0,1) == "/") {
|
|
302 url = url2.substr(0, url2.indexOf("/", url2.indexOf("://") + 3)) + url;
|
|
303 } else {
|
|
304 url = url2 + url;
|
|
305 }
|
|
306 }
|
|
307
|
|
308 var i = url.lastIndexOf("/");
|
|
309 if (i < 0) {
|
|
310 return "";
|
|
311 } else {
|
|
312 return url.substr(0, i+1);
|
|
313 }
|
|
314 };
|
|
315
|
|
316 Timeline.DefaultEventSource.prototype._resolveRelativeURL = function(url, base) {
|
|
317 if (url == null || url == "") {
|
|
318 return url;
|
|
319 } else if (url.indexOf("://") > 0) {
|
|
320 return url;
|
|
321 } else if (url.substr(0,1) == "/") {
|
|
322 return base.substr(0, base.indexOf("/", base.indexOf("://") + 3)) + url;
|
|
323 } else {
|
|
324 return base + url;
|
|
325 }
|
|
326 };
|
|
327
|
|
328
|
|
329 Timeline.DefaultEventSource.Event = function(args) {
|
|
330 //
|
|
331 // Attention developers!
|
|
332 // If you add a new event attribute, please be sure to add it to
|
|
333 // all three load functions: loadXML, loadSPARCL, loadJSON.
|
|
334 // Thanks!
|
|
335 //
|
|
336 // args is a hash/object. It supports the following keys. Most are optional
|
|
337 // id -- an internal id. Really shouldn't be used by events.
|
|
338 // Timeline library clients should use eventID
|
|
339 // eventID -- For use by library client when writing custom painters or
|
|
340 // custom fillInfoBubble
|
|
341 // start
|
|
342 // end
|
|
343 // latestStart
|
|
344 // earliestEnd
|
|
345 // instant -- boolean. Controls precise/non-precise logic & duration/instant issues
|
|
346 // text -- event source attribute 'title' -- used as the label on Timelines and in bubbles.
|
|
347 // description -- used in bubbles
|
|
348 // image -- used in bubbles
|
|
349 // link -- used in bubbles
|
|
350 // icon -- on the Timeline
|
|
351 // color -- Timeline label and tape color
|
|
352 // textColor -- Timeline label color, overrides color attribute
|
|
353 // hoverText -- deprecated, here for backwards compatibility.
|
|
354 // Superceeded by caption
|
|
355 // caption -- tooltip-like caption on the Timeline. Uses HTML title attribute
|
|
356 // classname -- used to set classname in Timeline. Enables better CSS selector rules
|
|
357 // tapeImage -- background image of the duration event's tape div on the Timeline
|
|
358 // tapeRepeat -- repeat attribute for tapeImage. {repeat | repeat-x | repeat-y }
|
|
359
|
|
360 function cleanArg(arg) {
|
|
361 // clean up an arg
|
|
362 return (args[arg] != null && args[arg] != "") ? args[arg] : null;
|
|
363 }
|
|
364
|
|
365 var id = args.id ? args.id.trim() : "";
|
|
366 this._id = id.length > 0 ? id : Timeline.EventUtils.getNewEventID();
|
|
367
|
|
368 this._instant = args.instant || (args.end == null);
|
|
369
|
|
370 this._start = args.start;
|
|
371 this._end = (args.end != null) ? args.end : args.start;
|
|
372
|
|
373 this._latestStart = (args.latestStart != null) ?
|
|
374 args.latestStart : (args.instant ? this._end : this._start);
|
|
375 this._earliestEnd = (args.earliestEnd != null) ? args.earliestEnd : this._end;
|
|
376
|
|
377 // check sanity of dates since incorrect dates will later cause calculation errors
|
|
378 // when painting
|
|
379 var err=[];
|
|
380 if (this._start > this._latestStart) {
|
|
381 this._latestStart = this._start;
|
|
382 err.push("start is > latestStart");}
|
|
383 if (this._start > this._earliestEnd) {
|
|
384 this._earliestEnd = this._latestStart;
|
|
385 err.push("start is > earliestEnd");}
|
|
386 if (this._start > this._end) {
|
|
387 this._end = this._earliestEnd;
|
|
388 err.push("start is > end");}
|
|
389 if (this._latestStart > this._earliestEnd) {
|
|
390 this._earliestEnd = this._latestStart;
|
|
391 err.push("latestStart is > earliestEnd");}
|
|
392 if (this._latestStart > this._end) {
|
|
393 this._end = this._earliestEnd;
|
|
394 err.push("latestStart is > end");}
|
|
395 if (this._earliestEnd > this._end) {
|
|
396 this._end = this._earliestEnd;
|
|
397 err.push("earliestEnd is > end");}
|
|
398
|
|
399 this._eventID = cleanArg('eventID');
|
|
400 this._text = (args.text != null) ? SimileAjax.HTML.deEntify(args.text) : ""; // Change blank titles to ""
|
|
401 if (err.length > 0) {
|
|
402 this._text += " PROBLEM: " + err.join(", ");
|
|
403 }
|
|
404
|
|
405 this._description = SimileAjax.HTML.deEntify(args.description);
|
|
406 this._image = cleanArg('image');
|
|
407 this._link = cleanArg('link');
|
|
408 this._title = cleanArg('hoverText');
|
|
409 this._title = cleanArg('caption');
|
|
410
|
|
411 this._icon = cleanArg('icon');
|
|
412 this._color = cleanArg('color');
|
|
413 this._textColor = cleanArg('textColor');
|
|
414 this._classname = cleanArg('classname');
|
|
415 this._tapeImage = cleanArg('tapeImage');
|
|
416 this._tapeRepeat = cleanArg('tapeRepeat');
|
|
417 this._trackNum = cleanArg('trackNum');
|
|
418 if (this._trackNum != null) {
|
|
419 this._trackNum = parseInt(this._trackNum);
|
|
420 }
|
|
421
|
|
422 this._wikiURL = null;
|
|
423 this._wikiSection = null;
|
|
424 };
|
|
425
|
|
426 Timeline.DefaultEventSource.Event.prototype = {
|
|
427 getID: function() { return this._id; },
|
|
428
|
|
429 isInstant: function() { return this._instant; },
|
|
430 isImprecise: function() { return this._start != this._latestStart || this._end != this._earliestEnd; },
|
|
431
|
|
432 getStart: function() { return this._start; },
|
|
433 getEnd: function() { return this._end; },
|
|
434 getLatestStart: function() { return this._latestStart; },
|
|
435 getEarliestEnd: function() { return this._earliestEnd; },
|
|
436
|
|
437 getEventID: function() { return this._eventID; },
|
|
438 getText: function() { return this._text; }, // title
|
|
439 getDescription: function() { return this._description; },
|
|
440 getImage: function() { return this._image; },
|
|
441 getLink: function() { return this._link; },
|
|
442
|
|
443 getIcon: function() { return this._icon; },
|
|
444 getColor: function() { return this._color; },
|
|
445 getTextColor: function() { return this._textColor; },
|
|
446 getClassName: function() { return this._classname; },
|
|
447 getTapeImage: function() { return this._tapeImage; },
|
|
448 getTapeRepeat: function() { return this._tapeRepeat; },
|
|
449 getTrackNum: function() { return this._trackNum; },
|
|
450
|
|
451 getProperty: function(name) { return null; },
|
|
452
|
|
453 getWikiURL: function() { return this._wikiURL; },
|
|
454 getWikiSection: function() { return this._wikiSection; },
|
|
455 setWikiInfo: function(wikiURL, wikiSection) {
|
|
456 this._wikiURL = wikiURL;
|
|
457 this._wikiSection = wikiSection;
|
|
458 },
|
|
459
|
|
460 fillDescription: function(elmt) {
|
|
461 elmt.innerHTML = this._description;
|
|
462 },
|
|
463 fillWikiInfo: function(elmt) {
|
|
464 // Many bubbles will not support a wiki link.
|
|
465 //
|
|
466 // Strategy: assume no wiki link. If we do have
|
|
467 // enough parameters for one, then create it.
|
|
468 elmt.style.display = "none"; // default
|
|
469
|
|
470 if (this._wikiURL == null || this._wikiSection == null) {
|
|
471 return; // EARLY RETURN
|
|
472 }
|
|
473
|
|
474 // create the wikiID from the property or from the event text (the title)
|
|
475 var wikiID = this.getProperty("wikiID");
|
|
476 if (wikiID == null || wikiID.length == 0) {
|
|
477 wikiID = this.getText(); // use the title as the backup wiki id
|
|
478 }
|
|
479
|
|
480 if (wikiID == null || wikiID.length == 0) {
|
|
481 return; // No wikiID. Thus EARLY RETURN
|
|
482 }
|
|
483
|
|
484 // ready to go...
|
|
485 elmt.style.display = "inline";
|
|
486 wikiID = wikiID.replace(/\s/g, "_");
|
|
487 var url = this._wikiURL + this._wikiSection.replace(/\s/g, "_") + "/" + wikiID;
|
|
488 var a = document.createElement("a");
|
|
489 a.href = url;
|
|
490 a.target = "new";
|
|
491 a.innerHTML = Timeline.strings[Timeline.clientLocale].wikiLinkLabel;
|
|
492
|
|
493 elmt.appendChild(document.createTextNode("["));
|
|
494 elmt.appendChild(a);
|
|
495 elmt.appendChild(document.createTextNode("]"));
|
|
496 },
|
|
497
|
|
498 fillTime: function(elmt, labeller) {
|
|
499 if (this._instant) {
|
|
500 if (this.isImprecise()) {
|
|
501 elmt.appendChild(elmt.ownerDocument.createTextNode(labeller.labelPrecise(this._start)));
|
|
502 elmt.appendChild(elmt.ownerDocument.createElement("br"));
|
|
503 elmt.appendChild(elmt.ownerDocument.createTextNode(labeller.labelPrecise(this._end)));
|
|
504 } else {
|
|
505 elmt.appendChild(elmt.ownerDocument.createTextNode(labeller.labelPrecise(this._start)));
|
|
506 }
|
|
507 } else {
|
|
508 if (this.isImprecise()) {
|
|
509 elmt.appendChild(elmt.ownerDocument.createTextNode(
|
|
510 labeller.labelPrecise(this._start) + " ~ " + labeller.labelPrecise(this._latestStart)));
|
|
511 elmt.appendChild(elmt.ownerDocument.createElement("br"));
|
|
512 elmt.appendChild(elmt.ownerDocument.createTextNode(
|
|
513 labeller.labelPrecise(this._earliestEnd) + " ~ " + labeller.labelPrecise(this._end)));
|
|
514 } else {
|
|
515 elmt.appendChild(elmt.ownerDocument.createTextNode(labeller.labelPrecise(this._start)));
|
|
516 elmt.appendChild(elmt.ownerDocument.createElement("br"));
|
|
517 elmt.appendChild(elmt.ownerDocument.createTextNode(labeller.labelPrecise(this._end)));
|
|
518 }
|
|
519 }
|
|
520 },
|
|
521
|
|
522 fillInfoBubble: function(elmt, theme, labeller) {
|
|
523 var doc = elmt.ownerDocument;
|
|
524
|
|
525 var title = this.getText();
|
|
526 var link = this.getLink();
|
|
527 var image = this.getImage();
|
|
528
|
|
529 if (image != null) {
|
|
530 var img = doc.createElement("img");
|
|
531 img.src = image;
|
|
532
|
|
533 theme.event.bubble.imageStyler(img);
|
|
534 elmt.appendChild(img);
|
|
535 }
|
|
536
|
|
537 var divTitle = doc.createElement("div");
|
|
538 var textTitle = doc.createTextNode(title);
|
|
539 if (link != null) {
|
|
540 var a = doc.createElement("a");
|
|
541 a.href = link;
|
|
542 a.appendChild(textTitle);
|
|
543 divTitle.appendChild(a);
|
|
544 } else {
|
|
545 divTitle.appendChild(textTitle);
|
|
546 }
|
|
547 theme.event.bubble.titleStyler(divTitle);
|
|
548 elmt.appendChild(divTitle);
|
|
549
|
|
550 var divBody = doc.createElement("div");
|
|
551 this.fillDescription(divBody);
|
|
552 theme.event.bubble.bodyStyler(divBody);
|
|
553 elmt.appendChild(divBody);
|
|
554
|
|
555 var divTime = doc.createElement("div");
|
|
556 this.fillTime(divTime, labeller);
|
|
557 theme.event.bubble.timeStyler(divTime);
|
|
558 elmt.appendChild(divTime);
|
|
559
|
|
560 var divWiki = doc.createElement("div");
|
|
561 this.fillWikiInfo(divWiki);
|
|
562 theme.event.bubble.wikiStyler(divWiki);
|
|
563 elmt.appendChild(divWiki);
|
|
564 }
|
|
565 };
|
|
566
|
|
567
|