Project

General

Profile

1
/*
2
Author:       Patrice G Cappelaere patATcappelaere.com
3
License:      LGPL as per: http://www.gnu.org/copyleft/lesser.html
4

    
5
$Id$
6
*/
7

    
8
// Ensure this object's dependancies are loaded.
9
// References: http://www.bosrup.com/web/overlib/?Command_Reference
10
// Plugins: 
11
//		http://overlib.boughner.us/plugins/bubble_commands.html
12
//		http://www.bosrup.com/web/overlib/?Unofficial_Plugins
13

    
14
mapbuilder.loadScript(baseDir+"/model/Proj.js");
15
mapbuilder.loadScript(baseDir+"/widget/WidgetBase.js");
16
mapbuilder.loadScript(baseDir+"/util/overlib/overlib.js");
17
// does not work with IE mapbuilder.loadScript(baseDir+"/util/overlib/overlib_shadow.js");
18
//mapbuilder.loadScript(baseDir+"/util/overlib/overlib_bubble/overlib_bubble.js");
19

    
20
/**
21
 * Popup uses overlib http://www.bosrup.com/web/overlib/
22
 * @constructor
23
 * @base MapContainerBase
24
 * @param widgetNode  The widget's XML object node from the configuration document.
25
 * @param model       The model object that this widget belongs to.
26
 */
27
function Popup( widgetNode, model) {
28

    
29
  // get configuration options   
30
  var styleNode = widgetNode.selectSingleNode("mb:stylesheet");
31
  if (styleNode ) {
32
  	  var xslt = styleNode.firstChild.nodeValue;
33
      this.stylesheet = new XslProcessor(xslt, model.namespace);
34
  } 
35
  
36
  // apply stylesheet transform to the entry and return results
37
  this.transform = function( objRef, entry ) {
38
   	if( objRef.stylesheet != null ) {
39
  		var resultNode = objRef.stylesheet.transformNodeToObject( entry );
40
        var result = Sarissa.serialize(resultNode.documentElement);
41
    		//alert("transforming:"+result);
42
  		return result;
43
  	}
44
  }
45
}
(7-7/15)