[fusion-commits] r1656 - in trunk/widgets: . About widgetinfo

svn_fusion at osgeo.org svn_fusion at osgeo.org
Sat Nov 8 16:44:26 EST 2008


Author: madair
Date: 2008-11-08 16:44:26 -0500 (Sat, 08 Nov 2008)
New Revision: 1656

Added:
   trunk/widgets/About/
   trunk/widgets/About/About.html
Modified:
   trunk/widgets/About.js
   trunk/widgets/Help.js
   trunk/widgets/widgetinfo/about.xml
   trunk/widgets/widgetinfo/help.xml
Log:
closes #160: if the default URL is specified, add in the Fusion URL, otherwise the URL is relative to the template or absolute

Added: trunk/widgets/About/About.html
===================================================================
--- trunk/widgets/About/About.html	                        (rev 0)
+++ trunk/widgets/About/About.html	2008-11-08 21:44:26 UTC (rev 1656)
@@ -0,0 +1,8 @@
+<html>
+<head>
+    <title>About Fusion</title>
+</head>
+<body>
+    <h1>About</h1>
+</body>
+</html>
\ No newline at end of file

Modified: trunk/widgets/About.js
===================================================================
--- trunk/widgets/About.js	2008-11-07 21:40:52 UTC (rev 1655)
+++ trunk/widgets/About.js	2008-11-08 21:44:26 UTC (rev 1656)
@@ -33,9 +33,17 @@
 
 Fusion.Widget.About = OpenLayers.Class(Fusion.Widget, {
     uiClass: Jx.Button,
-    _nWidth : 500,
-    _nHeight : 400,
-    _sDefaultUrl : '/mapguide/mapadmin/about.php',  //TBD we need a Fusion specific About page
+    _nWidth: 500,
+    _nHeight: 400,
+    
+    /* the url to open.  If specified, it is relative to the
+     * application, not fusion
+     */
+     _sAboutUrl: null,
+     
+    /* the default url 
+     */
+    _sDefaultUrl: 'widgets/About/About.html',
 
 /*
  * Constructor: About
@@ -47,8 +55,12 @@
  */
     initializeWidget: function(widgetTag) {
         var json = widgetTag.extension;
-        this._sAboutUrl = (json.AboutURL) ? 
-                json.AboutURL[0] : this._sDefaultUrl;
+        this._sAboutUrl = (json.AboutURL) ? json.AboutURL[0] : this._sDefaultUrl;
+        
+        if (this._sAboutUrl == this._sDefaultUrl) {
+          this._sAboutUrl = Fusion.getFusionURL() + this._sAboutUrl;
+        }
+        
         this.enable();
     },
 

Modified: trunk/widgets/Help.js
===================================================================
--- trunk/widgets/Help.js	2008-11-07 21:40:52 UTC (rev 1655)
+++ trunk/widgets/Help.js	2008-11-08 21:44:26 UTC (rev 1656)
@@ -34,7 +34,7 @@
     uiClass: Jx.Button,
     
     /* popup window initialization parameters */
-    sFeatures : 'menubar=no,location=no,resizable=no,status=no',
+    sFeatures: 'menubar=no,location=no,resizable=no,status=no',
 
     /* the frame or window name to target.  If set to the Name of a
      * task pane widget, then it will appear in the task pane
@@ -46,11 +46,18 @@
      */
     baseUrl: null,
     
+    /* the default url 
+     */
+    defaultUrl: 'widgets/Help/Help.html',
+    
     initializeWidget: function(widgetTag) {
         var json = widgetTag.extension;
         this.target = json.Target ? json.Target[0] : "HelpWindow";
-        this.baseUrl = json.Url ? json.Url[0] : Fusion.getFusionURL() + widgetTag.location + '/Help/Help.html';
-
+        this.baseUrl = json.Url ? json.Url[0] : this.defaultUrl;
+        if (this.baseUrl == this.defaultUrl) {
+          this.baseUrl = Fusion.getFusionURL() + this.baseUrl;
+        }
+        
         /* this widget is always enabled unless it was explicitly disabled
          * in the widget tag
          */

Modified: trunk/widgets/widgetinfo/about.xml
===================================================================
--- trunk/widgets/widgetinfo/about.xml	2008-11-07 21:40:52 UTC (rev 1655)
+++ trunk/widgets/widgetinfo/about.xml	2008-11-08 21:44:26 UTC (rev 1656)
@@ -15,7 +15,7 @@
     <Description>This is a pointer to the URL that will be displayed in the popup window</Description>
     <Type>String</Type>
     <Label>URL pointing to the About page</Label>
-    <DefaultValue>/mapguide/mapadmin/about.php</DefaultValue>
+    <DefaultValue>widgets/About/About.html</DefaultValue>
     <IsMandatory>false</IsMandatory>
   </Parameter>
 </WidgetInfo>

Modified: trunk/widgets/widgetinfo/help.xml
===================================================================
--- trunk/widgets/widgetinfo/help.xml	2008-11-07 21:40:52 UTC (rev 1655)
+++ trunk/widgets/widgetinfo/help.xml	2008-11-08 21:44:26 UTC (rev 1656)
@@ -23,7 +23,7 @@
     <Description>The URL which contaions the help page contents.</Description>
     <Type>String</Type>
     <Label>Help URL</Label>
-    <DefaultValue>fusion/widgets/Help/Help.html</DefaultValue>
+    <DefaultValue>widgets/Help/Help.html</DefaultValue>
     <IsMandatory>false</IsMandatory>
   </Parameter>
 </WidgetInfo>



More information about the fusion-commits mailing list