1
|
/*
|
2
|
|
3
|
Author: Mike Adair mike.adairATccrs.nrcan.gc.ca
|
4
|
|
5
|
License: LGPL as per: http://www.gnu.org/copyleft/lesser.html
|
6
|
|
7
|
|
8
|
|
9
|
$Id$
|
10
|
|
11
|
*/
|
12
|
|
13
|
|
14
|
|
15
|
// Ensure this object's dependancies are loaded.
|
16
|
|
17
|
mapbuilder.loadScript(baseDir+"/widget/WidgetBaseXSL.js");
|
18
|
|
19
|
|
20
|
|
21
|
/**
|
22
|
|
23
|
* Widget which will display some anchor tags for accessing model URLs.
|
24
|
|
25
|
* TBD: which is the prefered method to use here,
|
26
|
|
27
|
*
|
28
|
|
29
|
* @constructor
|
30
|
|
31
|
* @base WidgetBaseXSL
|
32
|
|
33
|
* @param widgetNode This widget's object node from the configuration document.
|
34
|
|
35
|
* @param model The model that this widget is a view of.
|
36
|
|
37
|
*/
|
38
|
|
39
|
|
40
|
|
41
|
function SaveModel(widgetNode, model) {
|
42
|
|
43
|
WidgetBaseXSL.apply(this,new Array(widgetNode, model));
|
44
|
|
45
|
|
46
|
|
47
|
/**
|
48
|
|
49
|
* a listenet to set the saved model URL as the href attribute in an anchor link
|
50
|
|
51
|
* @param objRef Pointer to this SaveModel object.
|
52
|
|
53
|
*/
|
54
|
|
55
|
this.saveLink = function(objRef, fileUrl) {
|
56
|
|
57
|
var modelAnchor = document.getElementById(objRef.model.id+"."+objRef.id+".modelUrl");
|
58
|
|
59
|
modelAnchor.href = fileUrl;
|
60
|
|
61
|
}
|
62
|
|
63
|
this.model.addListener("modelSaved", this.saveLink, this);
|
64
|
|
65
|
|
66
|
|
67
|
}
|
68
|
|
69
|
|
70
|
|