1
|
/*
|
2
|
License: LGPL as per: http://www.gnu.org/copyleft/lesser.html
|
3
|
$Id: Loading.js 3702 2007-12-09 23:24:11Z ahocevar $
|
4
|
*/
|
5
|
|
6
|
// Ensure this object's dependancies are loaded.
|
7
|
mapbuilder.loadScript(baseDir+"/widget/WidgetBase.js");
|
8
|
|
9
|
/**
|
10
|
* This widget can be used to insert a message while the Mapbuilder
|
11
|
* javascript is loading. The message is removed once Mapbuilder
|
12
|
* javascript is loaded. In the main HTML file, insert something like:<br/>
|
13
|
* <div id="loading"><p>Loading Program</p></div>.
|
14
|
* @constructor
|
15
|
* @base WidgetBase
|
16
|
* @author Cameron Shorter
|
17
|
* @param widgetNode The widget's XML object node from the configuration document.
|
18
|
* @param model The model object that this widget belongs to.
|
19
|
*/
|
20
|
function Loading(widgetNode, model) {
|
21
|
WidgetBase.apply(this,new Array(widgetNode, model));
|
22
|
|
23
|
/**
|
24
|
* Remove the contents of the HTML tag for this widget.
|
25
|
* @param objRef Reference to this object.
|
26
|
*/
|
27
|
this.paint= function(objRef) {
|
28
|
var node = document.getElementById(objRef.htmlTagId);
|
29
|
if (node) {
|
30
|
while (node.childNodes.length>0) {
|
31
|
node.removeChild(node.childNodes[0]);
|
32
|
}
|
33
|
}
|
34
|
}
|
35
|
this.model.addListener("refresh",this.paint, this);
|
36
|
}
|