[fusion-commits] r1365 - sandbox/olcore/widgets
svn_fusion at osgeo.org
svn_fusion at osgeo.org
Tue Apr 8 13:37:11 EDT 2008
Author: pdeschamps
Date: 2008-04-08 13:37:11 -0400 (Tue, 08 Apr 2008)
New Revision: 1365
Modified:
sandbox/olcore/widgets/CenterSelection.js
sandbox/olcore/widgets/ClearSelection.js
sandbox/olcore/widgets/ColorPicker.js
sandbox/olcore/widgets/CursorPosition.js
sandbox/olcore/widgets/EditableScale.js
sandbox/olcore/widgets/ExtentHistory.js
sandbox/olcore/widgets/InitialMapView.js
sandbox/olcore/widgets/InvokeScript.js
sandbox/olcore/widgets/InvokeURL.js
sandbox/olcore/widgets/LayerManager.js
sandbox/olcore/widgets/Legend.js
sandbox/olcore/widgets/LinkToView.js
sandbox/olcore/widgets/MapMenu.js
Log:
linked up OL prototype class
Modified: sandbox/olcore/widgets/CenterSelection.js
===================================================================
--- sandbox/olcore/widgets/CenterSelection.js 2008-04-08 14:58:32 UTC (rev 1364)
+++ sandbox/olcore/widgets/CenterSelection.js 2008-04-08 17:37:11 UTC (rev 1365)
@@ -33,13 +33,15 @@
-Fusion.Widget.CenterSelection = Class.create();
-Fusion.Widget.CenterSelection.prototype = {
+//Fusion.Widget.CenterSelection = Class.create();
+//Fusion.Widget.CenterSelection.prototype = {
+Fusion.Widget.CenterSelection = OpenLayers.Class(Fusion.Widget, Fusion.Tool.ButtonBase, {
initialize : function(widgetTag) {
//console.log('CenterSelection.initialize');
- Object.inheritFrom(this, Fusion.Widget.prototype, [widgetTag, false]);
- Object.inheritFrom(this, Fusion.Tool.ButtonBase.prototype, []);
-
+ //Object.inheritFrom(this, Fusion.Widget.prototype, [widgetTag, false]);
+ //Object.inheritFrom(this, Fusion.Tool.ButtonBase.prototype, []);
+ Fusion.Widget.prototype.initialize.apply(this, [widgetTag, false]);
+ Fusion.Tool.ButtonBase.prototype.initialize.apply(this, []);
this.enable = Fusion.Widget.CenterSelection.prototype.enable;
this.getMap().registerForEvent(Fusion.Event.MAP_SELECTION_ON, OpenLayers.Function.bind(this.enable, this));
@@ -92,4 +94,4 @@
this.disable();
}
}
-};
+});
Modified: sandbox/olcore/widgets/ClearSelection.js
===================================================================
--- sandbox/olcore/widgets/ClearSelection.js 2008-04-08 14:58:32 UTC (rev 1364)
+++ sandbox/olcore/widgets/ClearSelection.js 2008-04-08 17:37:11 UTC (rev 1365)
@@ -29,14 +29,16 @@
* Clears the current selection, if any.
* **********************************************************************/
+//Fusion.Widget.ClearSelection = Class.create();
+//Fusion.Widget.ClearSelection.prototype = {
+Fusion.Widget.Help = OpenLayers.Class(Fusion.Widget, Fusion.Tool.ButtonBase, {
-
-Fusion.Widget.ClearSelection = Class.create();
-Fusion.Widget.ClearSelection.prototype = {
initialize : function(widgetTag) {
//console.log('ClearSelection.initialize');
- Object.inheritFrom(this, Fusion.Widget.prototype, [widgetTag, false]);
- Object.inheritFrom(this, Fusion.Tool.ButtonBase.prototype, []);
+ //Object.inheritFrom(this, Fusion.Widget.prototype, [widgetTag, false]);
+ //Object.inheritFrom(this, Fusion.Tool.ButtonBase.prototype, []);
+ Fusion.Widget.prototype.initialize.apply(this, [widgetTag, false]);
+ Fusion.Tool.ButtonBase.prototype.initialize.apply(this, []);
this.enable = Fusion.Widget.ClearSelection.prototype.enable;
@@ -58,4 +60,4 @@
this.disable();
}
}
-};
+});
Modified: sandbox/olcore/widgets/ColorPicker.js
===================================================================
--- sandbox/olcore/widgets/ColorPicker.js 2008-04-08 14:58:32 UTC (rev 1364)
+++ sandbox/olcore/widgets/ColorPicker.js 2008-04-08 17:37:11 UTC (rev 1365)
@@ -32,8 +32,9 @@
* **********************************************************************/
-Fusion.Widget.ColorPicker = Class.create();
-Fusion.Widget.ColorPicker.prototype =
+//Fusion.Widget.ColorPicker = Class.create();
+//Fusion.Widget.ColorPicker.prototype =
+Fusion.Widget.ColorPicker = OpenLayers.Class(Fusion.Widget, {
{
/* HTML input element that is used to store both the initial
value for this widget and receives the color value as the
@@ -50,8 +51,8 @@
colorButton: null,
initialize : function(widgetTag) {
- Object.inheritFrom(this, Fusion.Widget.prototype, [widgetTag, false]);
-
+ //Object.inheritFrom(this, Fusion.Widget.prototype, [widgetTag, false]);
+ Fusion.Widget.prototype.initialize.apply(this, [widgetTag, false]);
var json = widgetTag.extension;
if (json.ColorInputId) {
this.colorInput = $(json.ColorInputId[0]);
@@ -79,4 +80,4 @@
this.colorInput.value = c;
}
}
-};
\ No newline at end of file
+});
\ No newline at end of file
Modified: sandbox/olcore/widgets/CursorPosition.js
===================================================================
--- sandbox/olcore/widgets/CursorPosition.js 2008-04-08 14:58:32 UTC (rev 1364)
+++ sandbox/olcore/widgets/CursorPosition.js 2008-04-08 17:37:11 UTC (rev 1365)
@@ -54,8 +54,9 @@
* x: {x}<br/>y: {y}
* **********************************************************************/
-Fusion.Widget.CursorPosition = Class.create();
-Fusion.Widget.CursorPosition.prototype = {
+//Fusion.Widget.CursorPosition = Class.create();
+//Fusion.Widget.CursorPosition.prototype = {
+Fusion.Widget.CursorPosition = OpenLayers.Class(Fusion.Widget, {
defaultTemplate: 'x: {x}, y: {y}',
domSpan: null,
@@ -64,7 +65,8 @@
initialize : function(widgetTag) {
//console.log('CursorPosition.initialize');
- Object.inheritFrom(this, Fusion.Widget.prototype, [widgetTag, true]);
+ //Object.inheritFrom(this, Fusion.Widget.prototype, [widgetTag, true]);
+ Fusion.Widget.prototype.initialize.apply(this, [widgetTag, true]);
var json = widgetTag.extension;
@@ -139,4 +141,4 @@
this.units = Fusion.unitFromName(value);
}
}
-};
+});
Modified: sandbox/olcore/widgets/EditableScale.js
===================================================================
--- sandbox/olcore/widgets/EditableScale.js 2008-04-08 14:58:32 UTC (rev 1364)
+++ sandbox/olcore/widgets/EditableScale.js 2008-04-08 17:37:11 UTC (rev 1365)
@@ -30,12 +30,14 @@
*
* **********************************************************************/
-Fusion.Widget.EditableScale = Class.create();
-Fusion.Widget.EditableScale.prototype = {
+//Fusion.Widget.EditableScale = Class.create();
+//Fusion.Widget.EditableScale.prototype = {
+Fusion.Widget.EditableScale = OpenLayers.Class(Fusion.Widget, {
precision: 4,
initialize : function(widgetTag) {
- Object.inheritFrom(this, Fusion.Widget.prototype, [widgetTag, false]);
+ //Object.inheritFrom(this, Fusion.Widget.prototype, [widgetTag, false]);
+ Fusion.Widget.prototype.initialize.apply(this, [widgetTag, false]);
var json = widgetTag.extension;
@@ -78,4 +80,4 @@
this.getMap().zoomToScale(scale);
}
}
-};
\ No newline at end of file
+});
\ No newline at end of file
Modified: sandbox/olcore/widgets/ExtentHistory.js
===================================================================
--- sandbox/olcore/widgets/ExtentHistory.js 2008-04-08 14:58:32 UTC (rev 1364)
+++ sandbox/olcore/widgets/ExtentHistory.js 2008-04-08 17:37:11 UTC (rev 1365)
@@ -32,15 +32,18 @@
Fusion.Event.HISTORY_CHANGED = Fusion.Event.lastEventId++;
-Fusion.Widget.ExtentHistory = Class.create();
-Fusion.Widget.ExtentHistory.prototype = {
+//Fusion.Widget.ExtentHistory = Class.create();
+//Fusion.Widget.ExtentHistory.prototype = {
+Fusion.Widget.ExtentHistory = OpenLayers.Class(Fusion.Widget, Fusion.Tool.ButtonBase, {
events: [],
aHistory: [],
sDirection: null,
EPS: 0.00000001, //percentage difference allowed in bounds values for test for equal
initialize : function(widgetTag) {
- Object.inheritFrom(this, Fusion.Widget.prototype, [widgetTag, false]);
- Object.inheritFrom(this, Fusion.Tool.ButtonBase.prototype, []);
+ //Object.inheritFrom(this, Fusion.Widget.prototype, [widgetTag, false]);
+ //Object.inheritFrom(this, Fusion.Tool.ButtonBase.prototype, []);
+ Fusion.Widget.prototype.initialize.apply(this, [widgetTag, false]);
+ Fusion.Tool.ButtonBase.prototype.initialize.apply(this, []);
var json = widgetTag.extension;
var sDirection = json.Direction ? json.Direction[0].toLowerCase() : 'previous';
@@ -165,5 +168,5 @@
Math.abs(b1.right - b2.right)/b2.right < this.EPS);
return equal;
}
-};
+});
Modified: sandbox/olcore/widgets/InitialMapView.js
===================================================================
--- sandbox/olcore/widgets/InitialMapView.js 2008-04-08 14:58:32 UTC (rev 1364)
+++ sandbox/olcore/widgets/InitialMapView.js 2008-04-08 17:37:11 UTC (rev 1365)
@@ -30,16 +30,19 @@
*
* **********************************************************************/
-Fusion.Widget.InitialMapView = Class.create();
-Fusion.Widget.InitialMapView.prototype = {
+//Fusion.Widget.InitialMapView = Class.create();
+//Fusion.Widget.InitialMapView.prototype = {
+Fusion.Widget.InitialMapView = OpenLayers.Class(Fusion.Widget, Fusion.Tool.ButtonBase, {
initialize : function(widgetTag) {
//console.log('InitialMapView.initialize');
- Object.inheritFrom(this, Fusion.Widget.prototype, [widgetTag, false]);
- Object.inheritFrom(this, Fusion.Tool.ButtonBase.prototype, []);
+ //Object.inheritFrom(this, Fusion.Widget.prototype, [widgetTag, false]);
+ //Object.inheritFrom(this, Fusion.Tool.ButtonBase.prototype, []);
+ Fusion.Widget.prototype.initialize.apply(this, [widgetTag, false]);
+ Fusion.Tool.ButtonBase.prototype.initialize.apply(this, []);
},
execute: function() {
//console.log('InitialMapView.activateTool');
this.getMap().fullExtents();
}
-};
+});
Modified: sandbox/olcore/widgets/InvokeScript.js
===================================================================
--- sandbox/olcore/widgets/InvokeScript.js 2008-04-08 14:58:32 UTC (rev 1364)
+++ sandbox/olcore/widgets/InvokeScript.js 2008-04-08 17:37:11 UTC (rev 1365)
@@ -29,12 +29,16 @@
* Executes an arbitrary piece of JavaScript code
* **********************************************************************/
-Fusion.Widget.InvokeScript = Class.create();
-Fusion.Widget.InvokeScript.prototype = {
+//Fusion.Widget.InvokeScript = Class.create();
+//Fusion.Widget.InvokeScript.prototype = {
+Fusion.Widget.InvokeScript = OpenLayers.Class(Fusion.Widget, Fusion.Tool.ButtonBase, {
sScript: null,
initialize : function(widgetTag) {
- Object.inheritFrom(this, Fusion.Widget.prototype, [widgetTag, false]);
- Object.inheritFrom(this, Fusion.Tool.ButtonBase.prototype, []);
+ //Object.inheritFrom(this, Fusion.Widget.prototype, [widgetTag, false]);
+ //Object.inheritFrom(this, Fusion.Tool.ButtonBase.prototype, []);
+ Fusion.Widget.prototype.initialize.apply(this, [widgetTag, false]);
+ Fusion.Tool.ButtonBase.prototype.initialize.apply(this, []);
+
var json = widgetTag.extension;
this.sScript = json.Script ? json.Script[0] : '';
},
@@ -45,4 +49,4 @@
execute : function() {
eval(this.sScript);
}
-};
\ No newline at end of file
+});
\ No newline at end of file
Modified: sandbox/olcore/widgets/InvokeURL.js
===================================================================
--- sandbox/olcore/widgets/InvokeURL.js 2008-04-08 14:58:32 UTC (rev 1364)
+++ sandbox/olcore/widgets/InvokeURL.js 2008-04-08 17:37:11 UTC (rev 1365)
@@ -35,15 +35,18 @@
*
* **********************************************************************/
-Fusion.Widget.InvokeURL = Class.create();
-Fusion.Widget.InvokeURL.prototype = {
+//Fusion.Widget.InvokeURL = Class.create();
+//Fusion.Widget.InvokeURL.prototype = {
+Fusion.Widget.InvokeURL = OpenLayers.Class(Fusion.Widget, Fusion.Tool.ButtonBase, {
sFeatures : 'menubar=no,location=no,resizable=no,status=no',
initialize : function(widgetTag) {
//console.log('InvokeURL.initialize');
- Object.inheritFrom(this, Fusion.Widget.prototype, [widgetTag, false]);
- Object.inheritFrom(this, Fusion.Tool.ButtonBase.prototype, []);
-
+ //Object.inheritFrom(this, Fusion.Widget.prototype, [widgetTag, false]);
+ //Object.inheritFrom(this, Fusion.Tool.ButtonBase.prototype, []);
+ Fusion.Widget.prototype.initialize.apply(this, [widgetTag, false]);
+ Fusion.Tool.ButtonBase.prototype.initialize.apply(this, []);
+
var json = widgetTag.extension;
this.sTarget = json.Target ? json.Target[0] : "InvokeUrlWindow";
this.sBaseUrl = json.Url[0]; //must be supplied
@@ -121,4 +124,4 @@
}
}
}
-};
+});
Modified: sandbox/olcore/widgets/LayerManager.js
===================================================================
--- sandbox/olcore/widgets/LayerManager.js 2008-04-08 14:58:32 UTC (rev 1364)
+++ sandbox/olcore/widgets/LayerManager.js 2008-04-08 17:37:11 UTC (rev 1365)
@@ -50,14 +50,16 @@
*
* **********************************************************************/
-Fusion.Widget.LayerManager = Class.create();
-Fusion.Widget.LayerManager.prototype = {
+//Fusion.Widget.LayerManager = Class.create();
+//Fusion.Widget.LayerManager.prototype = {
+Fusion.Widget.LayerManager = OpenLayers.Class(Fusion.Widget, {
currentNode: null,
bIsDrawn: false,
initialize : function(widgetTag) {
//console.log('LayerManager.initialize');
- Object.inheritFrom(this, Fusion.Widget.prototype, [widgetTag, true]);
-
+ //Object.inheritFrom(this, Fusion.Widget.prototype, [widgetTag, true]);
+ Fusion.Widget.prototype.initialize.apply(this, [widgetTag, true]);
+
var json = widgetTag.extension;
this.delIconSrc = json.DeleteIcon ? json.DeleteIcon[0] : 'images/icons/select-delete.png';
@@ -269,4 +271,4 @@
}
}
-};
+});
Modified: sandbox/olcore/widgets/Legend.js
===================================================================
--- sandbox/olcore/widgets/Legend.js 2008-04-08 14:58:32 UTC (rev 1364)
+++ sandbox/olcore/widgets/Legend.js 2008-04-08 17:37:11 UTC (rev 1365)
@@ -50,8 +50,9 @@
*
* **********************************************************************/
-Fusion.Widget.Legend = Class.create();
-Fusion.Widget.Legend.prototype = {
+//Fusion.Widget.Legend = Class.create();
+//Fusion.Widget.Legend.prototype = {
+Fusion.Widget.Legend = OpenLayers.Class(Fusion.Widget, {
currentNode: null,
bIsDrawn: false,
targetFolder: null,
@@ -66,8 +67,9 @@
this.bIncludeVisToggle = true;
//console.log('Legend.initialize');
- Object.inheritFrom(this, Fusion.Widget.prototype, [widgetTag, true]);
-
+ //Object.inheritFrom(this, Fusion.Widget.prototype, [widgetTag, true]);
+ Fusion.Widget.prototype.initialize.apply(this, [widgetTag, true]);
+
var json = widgetTag.extension;
this.imgLayerDWFIcon = json.LayerDWFIcon ? json.LayerDWFIcon[0] : this.defLayerDWFIcon;
@@ -500,4 +502,4 @@
}
}
}
-};
+});
Modified: sandbox/olcore/widgets/LinkToView.js
===================================================================
--- sandbox/olcore/widgets/LinkToView.js 2008-04-08 14:58:32 UTC (rev 1364)
+++ sandbox/olcore/widgets/LinkToView.js 2008-04-08 17:37:11 UTC (rev 1365)
@@ -29,13 +29,13 @@
* A widget that displays a link to the currently displayedd map view.
* **********************************************************************/
-Fusion.Widget.LinkToView = Class.create();
-Fusion.Widget.LinkToView.prototype = {
-
+//Fusion.Widget.LinkToView = Class.create();
+//Fusion.Widget.LinkToView.prototype = {
+Fusion.Widget.LinkToView = OpenLayers.Class(Fusion.Widget, {
initialize : function(widgetTag) {
//console.log('LinkToView.initialize');
- Object.inheritFrom(this, Fusion.Widget.prototype, [widgetTag, false]);
-
+ //Object.inheritFrom(this, Fusion.Widget.prototype, [widgetTag, false]);
+ Fusion.Widget.prototype.initialize.apply(this, [widgetTag, false]);
var json = widgetTag.extension;
this.baseUrl = window.location.protocol + '//' + window.location.host + window.location.pathname + '?';
@@ -72,4 +72,4 @@
var join = (this.baseUrl.indexOf('?')==this.baseUrl.length-1)?'':'&';
this.anchor.href = this.baseUrl + join +'extent=' + sBbox;
}
-};
+});
Modified: sandbox/olcore/widgets/MapMenu.js
===================================================================
--- sandbox/olcore/widgets/MapMenu.js 2008-04-08 14:58:32 UTC (rev 1364)
+++ sandbox/olcore/widgets/MapMenu.js 2008-04-08 17:37:11 UTC (rev 1365)
@@ -31,8 +31,9 @@
* **********************************************************************/
-Fusion.Widget.MapMenu = Class.create();
-Fusion.Widget.MapMenu.prototype =
+//Fusion.Widget.MapMenu = Class.create();
+//Fusion.Widget.MapMenu.prototype =
+Fusion.Widget.LinkToView = OpenLayers.Class(Fusion.Widget, Fusion.Tool.MenuBase,
{
domObj: null,
oMenu: null,
@@ -41,8 +42,11 @@
initialize : function(widgetTag)
{
//console.log('MapMenu.initialize');
- Object.inheritFrom(this, Fusion.Widget.prototype, [widgetTag, true]);
- Object.inheritFrom(this, Fusion.Tool.MenuBase.prototype, []);
+ //Object.inheritFrom(this, Fusion.Widget.prototype, [widgetTag, true]);
+ //Object.inheritFrom(this, Fusion.Tool.MenuBase.prototype, []);
+ Fusion.Widget.prototype.initialize.apply(this, [widgetTag, false]);
+ Fusion.Tool.MenuBase.prototype.initialize.apply(this, []);
+
this.enable();
var json = widgetTag.extension;
@@ -136,4 +140,4 @@
switchMap: function(data) {
this.getMap().loadMapGroup(data);
}
-};
\ No newline at end of file
+});
\ No newline at end of file
More information about the fusion-commits
mailing list