From 297b1c0b2af6e9c4c320af98d5702e4b6016a51f Mon Sep 17 00:00:00 2001 From: Bart Baas Date: Fri, 7 Dec 2012 13:44:00 +0100 Subject: [PATCH 1/4] Ignore .DS_Store --- .gitignore | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index b1fd6583..850a9164 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,7 @@ src/doc/lib/menu src/doc/lib/plugins src/doc/lib/widgets src/doc/lib/util.rst -build/ \ No newline at end of file +build/ +src/script/plugins/.DS_Store + +.DS_Store From fd6547f76bd4d126db763208127ebff1bd60c4f1 Mon Sep 17 00:00:00 2001 From: Bart Baas Date: Fri, 7 Dec 2012 13:45:57 +0100 Subject: [PATCH 2/4] Fixed buttonText on tool Enabled buttonText when the showButtonText toggle is applied --- src/script/plugins/AddLayers.js | 1 + src/script/plugins/FeatureEditor.js | 12 ++++++++++-- src/script/plugins/LayerProperties.js | 6 ++++++ src/script/plugins/Measure.js | 8 +++++++- src/script/plugins/Navigation.js | 7 +++++++ src/script/plugins/NavigationHistory.js | 14 ++++++++++++++ src/script/plugins/RemoveLayer.js | 7 +++++++ src/script/plugins/Styler.js | 6 ++++++ src/script/plugins/Zoom.js | 23 ++++++++++++++++++++++- src/script/plugins/ZoomToExtent.js | 3 ++- 10 files changed, 82 insertions(+), 5 deletions(-) diff --git a/src/script/plugins/AddLayers.js b/src/script/plugins/AddLayers.js index b49580e5..1bcbbffc 100644 --- a/src/script/plugins/AddLayers.js +++ b/src/script/plugins/AddLayers.js @@ -237,6 +237,7 @@ gxp.plugins.AddLayers = Ext.extend(gxp.plugins.Tool, { tooltip : this.addActionTip, text: this.addActionText, menuText: this.addActionMenuText, + buttonText: this.addButtonText, disabled: true, iconCls: "gxp-icon-addlayers" }; diff --git a/src/script/plugins/FeatureEditor.js b/src/script/plugins/FeatureEditor.js index 88b775e4..ed6ae089 100644 --- a/src/script/plugins/FeatureEditor.js +++ b/src/script/plugins/FeatureEditor.js @@ -52,6 +52,12 @@ gxp.plugins.FeatureEditor = Ext.extend(gxp.plugins.ClickableFeatures, { */ splitButton: null, + /** api: config[showButtonText] + * Show the ``buttonText`` an action is configured with, if used as a + * button. Default is false. + */ + showButtonText: false, + /** api: config[iconClsAdd] * ``String`` * iconCls to use for the add button. @@ -583,8 +589,9 @@ gxp.plugins.FeatureEditor = Ext.extend(gxp.plugins.ClickableFeatures, { var commonOptions = { tooltip: this.createFeatureActionTip, // backwards compatibility: only show text if configured - menuText: this.initialConfig.createFeatureActionText, text: this.initialConfig.createFeatureActionText, + menuText: this.initialConfig.createFeatureActionText, + buttonText: this.createFeatureActionText, iconCls: this.iconClsAdd, disabled: true, hidden: this.modifyOnly || this.readOnly, @@ -682,6 +689,7 @@ gxp.plugins.FeatureEditor = Ext.extend(gxp.plugins.ClickableFeatures, { // backwards compatibility: only show text if configured text: this.initialConfig.editFeatureActionText, menuText: this.initialConfig.editFeatureActionText, + buttonText: this.editFeatureActionText, iconCls: this.iconClsEdit, disabled: true, toggleGroup: toggleGroup, @@ -710,7 +718,7 @@ gxp.plugins.FeatureEditor = Ext.extend(gxp.plugins.ClickableFeatures, { }) ]}, disabled: true, - buttonText: this.splitButtonText, + text: this.showButtonText ? this.splitButtonText : null, tooltip: this.splitButtonTooltip, iconCls: this.iconClsAdd, enableToggle: true, diff --git a/src/script/plugins/LayerProperties.js b/src/script/plugins/LayerProperties.js index 6dfde36c..b44e475a 100644 --- a/src/script/plugins/LayerProperties.js +++ b/src/script/plugins/LayerProperties.js @@ -29,6 +29,11 @@ gxp.plugins.LayerProperties = Ext.extend(gxp.plugins.Tool, { /** api: ptype = gxp_layerproperties */ ptype: "gxp_layerproperties", + + /** api: config[buttonText] + * ``String`` Text to show next to the zoom button + */ + buttonText: "Layer Properties", /** api: config[menuText] * ``String`` @@ -69,6 +74,7 @@ gxp.plugins.LayerProperties = Ext.extend(gxp.plugins.Tool, { addActions: function() { var actions = gxp.plugins.LayerProperties.superclass.addActions.apply(this, [{ menuText: this.menuText, + buttonText: this.buttonText, iconCls: "gxp-icon-layerproperties", disabled: true, tooltip: this.toolTip, diff --git a/src/script/plugins/Measure.js b/src/script/plugins/Measure.js index 05ce9bec..d18f8987 100644 --- a/src/script/plugins/Measure.js +++ b/src/script/plugins/Measure.js @@ -44,6 +44,12 @@ gxp.plugins.Measure = Ext.extend(gxp.plugins.Tool, { */ outputTarget: "map", + /** api: config[showButtonText] + * Show the ``buttonText`` an action is configured with, if used as a + * button. Default is false. + */ + showButtonText: false, + /** api: config[buttonText] * ``String`` * Text for the Measure button (i18n). @@ -205,7 +211,7 @@ gxp.plugins.Measure = Ext.extend(gxp.plugins.Tool, { this.button = new Ext.SplitButton({ iconCls: "gxp-icon-measure-length", tooltip: this.measureTooltip, - buttonText: this.buttonText, + text: this.showButtonText ? this.buttonText : null, enableToggle: true, toggleGroup: this.toggleGroup, allowDepress: true, diff --git a/src/script/plugins/Navigation.js b/src/script/plugins/Navigation.js index f413b7d9..fb9f2615 100644 --- a/src/script/plugins/Navigation.js +++ b/src/script/plugins/Navigation.js @@ -31,6 +31,12 @@ gxp.plugins.Navigation = Ext.extend(gxp.plugins.Tool, { /** api: ptype = gxp_navigation */ ptype: "gxp_navigation", + + /** api: config[buttonText] + * ``String`` + * Text for the Measure button (i18n). + */ + buttonText: "Pan", /** api: config[menuText] * ``String`` @@ -69,6 +75,7 @@ gxp.plugins.Navigation = Ext.extend(gxp.plugins.Tool, { var actions = [new GeoExt.Action({ tooltip: this.tooltip, menuText: this.menuText, + buttonText: this.buttonText, iconCls: "gxp-icon-pan", enableToggle: true, pressed: true, diff --git a/src/script/plugins/NavigationHistory.js b/src/script/plugins/NavigationHistory.js index 6aed078d..84f5d159 100644 --- a/src/script/plugins/NavigationHistory.js +++ b/src/script/plugins/NavigationHistory.js @@ -30,6 +30,18 @@ gxp.plugins.NavigationHistory = Ext.extend(gxp.plugins.Tool, { /** api: ptype = gxp_navigationhistory */ ptype: "gxp_navigationhistory", + + /** api: config[previousButtonText] + * ``String`` + * Text for zoom previous menu item (i18n). + */ + previousButtonText: "Zoom Previous", + + /** api: config[nextButtonText] + * ``String`` + * Text for zoom next menu item (i18n). + */ + nextButtonText: "Zoom Next", /** api: config[previousMenuText] * ``String`` @@ -68,12 +80,14 @@ gxp.plugins.NavigationHistory = Ext.extend(gxp.plugins.Tool, { this.target.mapPanel.map.addControl(historyControl); var actions = [new GeoExt.Action({ menuText: this.previousMenuText, + buttonText: this.previousButtonText, iconCls: "gxp-icon-zoom-previous", tooltip: this.previousTooltip, disabled: true, control: historyControl.previous }), new GeoExt.Action({ menuText: this.nextMenuText, + buttonText: this.nextButtonText, iconCls: "gxp-icon-zoom-next", tooltip: this.nextTooltip, disabled: true, diff --git a/src/script/plugins/RemoveLayer.js b/src/script/plugins/RemoveLayer.js index 49689d3a..4ed79796 100644 --- a/src/script/plugins/RemoveLayer.js +++ b/src/script/plugins/RemoveLayer.js @@ -30,6 +30,12 @@ gxp.plugins.RemoveLayer = Ext.extend(gxp.plugins.Tool, { /** api: ptype = gxp_removelayer */ ptype: "gxp_removelayer", + + /** api: config[buttonText] + * ``String`` + * Text for the Measure button (i18n). + */ + buttonText: "Remove layer", /** api: config[removeMenuText] * ``String`` @@ -49,6 +55,7 @@ gxp.plugins.RemoveLayer = Ext.extend(gxp.plugins.Tool, { var selectedLayer; var actions = gxp.plugins.RemoveLayer.superclass.addActions.apply(this, [{ menuText: this.removeMenuText, + buttonText: this.buttonText, iconCls: "gxp-icon-removelayers", disabled: true, tooltip: this.removeActionTip, diff --git a/src/script/plugins/Styler.js b/src/script/plugins/Styler.js index 657d1406..d71070aa 100644 --- a/src/script/plugins/Styler.js +++ b/src/script/plugins/Styler.js @@ -31,6 +31,11 @@ gxp.plugins.Styler = Ext.extend(gxp.plugins.Tool, { /** api: ptype = gxp_styler */ ptype: "gxp_styler", + + /** api: config[buttonText] + * ``String`` Text to show next to the zoom button + */ + buttonText: "Edit Styles", /** api: config[menuText] * ``String`` @@ -117,6 +122,7 @@ gxp.plugins.Styler = Ext.extend(gxp.plugins.Tool, { var layerProperties; var actions = gxp.plugins.Styler.superclass.addActions.apply(this, [{ menuText: this.menuText, + buttonText: this.buttonText, iconCls: "gxp-icon-palette", disabled: true, tooltip: this.tooltip, diff --git a/src/script/plugins/Zoom.js b/src/script/plugins/Zoom.js index cf466d0f..249d8f0a 100644 --- a/src/script/plugins/Zoom.js +++ b/src/script/plugins/Zoom.js @@ -31,6 +31,24 @@ gxp.plugins.Zoom = Ext.extend(gxp.plugins.Tool, { /** api: ptype = gxp_zoom */ ptype: "gxp_zoom", + + /** api: config[zoomButtonText] + * ``String`` + * Text for zoom box menu item (i18n). + */ + zoomButtonText: "Zoom Box", + + /** api: config[zoomInButtonText] + * ``String`` + * Text for zoom in menu item (i18n). + */ + zoomInButtonText: "Zoom In", + + /** api: config[zoomOutButtonText] + * ``String`` + * Text for zoom out menu item (i18n). + */ + zoomOutButtonText: "Zoom Out", /** api: config[zoomMenuText] * ``String`` @@ -92,6 +110,7 @@ gxp.plugins.Zoom = Ext.extend(gxp.plugins.Tool, { addActions: function() { var actions = [{ menuText: this.zoomInMenuText, + buttonText: this.zoomInButtonText, iconCls: "gxp-icon-zoom-in", tooltip: this.zoomInTooltip, handler: function() { @@ -100,6 +119,7 @@ gxp.plugins.Zoom = Ext.extend(gxp.plugins.Tool, { scope: this }, { menuText: this.zoomOutMenuText, + buttonText: this.zoomOutButtonText, iconCls: "gxp-icon-zoom-out", tooltip: this.zoomOutTooltip, handler: function() { @@ -109,7 +129,8 @@ gxp.plugins.Zoom = Ext.extend(gxp.plugins.Tool, { }]; if (this.showZoomBoxAction) { actions.unshift(new GeoExt.Action({ - menuText: this.zoomText, + menuText: this.zoomMenuText, + buttonText: this.zoomButtonText, iconCls: "gxp-icon-zoom", tooltip: this.zoomTooltip, control: new OpenLayers.Control.ZoomBox(this.controlOptions), diff --git a/src/script/plugins/ZoomToExtent.js b/src/script/plugins/ZoomToExtent.js index 1d4df0e5..399a7d40 100644 --- a/src/script/plugins/ZoomToExtent.js +++ b/src/script/plugins/ZoomToExtent.js @@ -34,6 +34,7 @@ gxp.plugins.ZoomToExtent = Ext.extend(gxp.plugins.Tool, { /** api: config[buttonText] * ``String`` Text to show next to the zoom button */ + buttonText: "Zoom Extend", /** api: config[menuText] * ``String`` @@ -85,8 +86,8 @@ gxp.plugins.ZoomToExtent = Ext.extend(gxp.plugins.Tool, { */ addActions: function() { return gxp.plugins.ZoomToExtent.superclass.addActions.apply(this, [{ - text: this.buttonText, menuText: this.menuText, + buttonText: this.buttonText, iconCls: this.iconCls, tooltip: this.tooltip, handler: function() { From c35746d1ac8a39cf0292f4a82924214d29426e93 Mon Sep 17 00:00:00 2001 From: Bart Baas Date: Wed, 9 Jan 2013 09:15:53 +0100 Subject: [PATCH 3/4] Revert "Fixed buttonText on tool" This reverts commit fd6547f76bd4d126db763208127ebff1bd60c4f1. --- src/script/plugins/AddLayers.js | 1 - src/script/plugins/FeatureEditor.js | 12 ++---------- src/script/plugins/LayerProperties.js | 6 ------ src/script/plugins/Measure.js | 8 +------- src/script/plugins/Navigation.js | 7 ------- src/script/plugins/NavigationHistory.js | 14 -------------- src/script/plugins/RemoveLayer.js | 7 ------- src/script/plugins/Styler.js | 6 ------ src/script/plugins/Zoom.js | 23 +---------------------- src/script/plugins/ZoomToExtent.js | 3 +-- 10 files changed, 5 insertions(+), 82 deletions(-) diff --git a/src/script/plugins/AddLayers.js b/src/script/plugins/AddLayers.js index 1bcbbffc..b49580e5 100644 --- a/src/script/plugins/AddLayers.js +++ b/src/script/plugins/AddLayers.js @@ -237,7 +237,6 @@ gxp.plugins.AddLayers = Ext.extend(gxp.plugins.Tool, { tooltip : this.addActionTip, text: this.addActionText, menuText: this.addActionMenuText, - buttonText: this.addButtonText, disabled: true, iconCls: "gxp-icon-addlayers" }; diff --git a/src/script/plugins/FeatureEditor.js b/src/script/plugins/FeatureEditor.js index ed6ae089..88b775e4 100644 --- a/src/script/plugins/FeatureEditor.js +++ b/src/script/plugins/FeatureEditor.js @@ -52,12 +52,6 @@ gxp.plugins.FeatureEditor = Ext.extend(gxp.plugins.ClickableFeatures, { */ splitButton: null, - /** api: config[showButtonText] - * Show the ``buttonText`` an action is configured with, if used as a - * button. Default is false. - */ - showButtonText: false, - /** api: config[iconClsAdd] * ``String`` * iconCls to use for the add button. @@ -589,9 +583,8 @@ gxp.plugins.FeatureEditor = Ext.extend(gxp.plugins.ClickableFeatures, { var commonOptions = { tooltip: this.createFeatureActionTip, // backwards compatibility: only show text if configured - text: this.initialConfig.createFeatureActionText, menuText: this.initialConfig.createFeatureActionText, - buttonText: this.createFeatureActionText, + text: this.initialConfig.createFeatureActionText, iconCls: this.iconClsAdd, disabled: true, hidden: this.modifyOnly || this.readOnly, @@ -689,7 +682,6 @@ gxp.plugins.FeatureEditor = Ext.extend(gxp.plugins.ClickableFeatures, { // backwards compatibility: only show text if configured text: this.initialConfig.editFeatureActionText, menuText: this.initialConfig.editFeatureActionText, - buttonText: this.editFeatureActionText, iconCls: this.iconClsEdit, disabled: true, toggleGroup: toggleGroup, @@ -718,7 +710,7 @@ gxp.plugins.FeatureEditor = Ext.extend(gxp.plugins.ClickableFeatures, { }) ]}, disabled: true, - text: this.showButtonText ? this.splitButtonText : null, + buttonText: this.splitButtonText, tooltip: this.splitButtonTooltip, iconCls: this.iconClsAdd, enableToggle: true, diff --git a/src/script/plugins/LayerProperties.js b/src/script/plugins/LayerProperties.js index b44e475a..6dfde36c 100644 --- a/src/script/plugins/LayerProperties.js +++ b/src/script/plugins/LayerProperties.js @@ -29,11 +29,6 @@ gxp.plugins.LayerProperties = Ext.extend(gxp.plugins.Tool, { /** api: ptype = gxp_layerproperties */ ptype: "gxp_layerproperties", - - /** api: config[buttonText] - * ``String`` Text to show next to the zoom button - */ - buttonText: "Layer Properties", /** api: config[menuText] * ``String`` @@ -74,7 +69,6 @@ gxp.plugins.LayerProperties = Ext.extend(gxp.plugins.Tool, { addActions: function() { var actions = gxp.plugins.LayerProperties.superclass.addActions.apply(this, [{ menuText: this.menuText, - buttonText: this.buttonText, iconCls: "gxp-icon-layerproperties", disabled: true, tooltip: this.toolTip, diff --git a/src/script/plugins/Measure.js b/src/script/plugins/Measure.js index d18f8987..05ce9bec 100644 --- a/src/script/plugins/Measure.js +++ b/src/script/plugins/Measure.js @@ -44,12 +44,6 @@ gxp.plugins.Measure = Ext.extend(gxp.plugins.Tool, { */ outputTarget: "map", - /** api: config[showButtonText] - * Show the ``buttonText`` an action is configured with, if used as a - * button. Default is false. - */ - showButtonText: false, - /** api: config[buttonText] * ``String`` * Text for the Measure button (i18n). @@ -211,7 +205,7 @@ gxp.plugins.Measure = Ext.extend(gxp.plugins.Tool, { this.button = new Ext.SplitButton({ iconCls: "gxp-icon-measure-length", tooltip: this.measureTooltip, - text: this.showButtonText ? this.buttonText : null, + buttonText: this.buttonText, enableToggle: true, toggleGroup: this.toggleGroup, allowDepress: true, diff --git a/src/script/plugins/Navigation.js b/src/script/plugins/Navigation.js index fb9f2615..f413b7d9 100644 --- a/src/script/plugins/Navigation.js +++ b/src/script/plugins/Navigation.js @@ -31,12 +31,6 @@ gxp.plugins.Navigation = Ext.extend(gxp.plugins.Tool, { /** api: ptype = gxp_navigation */ ptype: "gxp_navigation", - - /** api: config[buttonText] - * ``String`` - * Text for the Measure button (i18n). - */ - buttonText: "Pan", /** api: config[menuText] * ``String`` @@ -75,7 +69,6 @@ gxp.plugins.Navigation = Ext.extend(gxp.plugins.Tool, { var actions = [new GeoExt.Action({ tooltip: this.tooltip, menuText: this.menuText, - buttonText: this.buttonText, iconCls: "gxp-icon-pan", enableToggle: true, pressed: true, diff --git a/src/script/plugins/NavigationHistory.js b/src/script/plugins/NavigationHistory.js index 84f5d159..6aed078d 100644 --- a/src/script/plugins/NavigationHistory.js +++ b/src/script/plugins/NavigationHistory.js @@ -30,18 +30,6 @@ gxp.plugins.NavigationHistory = Ext.extend(gxp.plugins.Tool, { /** api: ptype = gxp_navigationhistory */ ptype: "gxp_navigationhistory", - - /** api: config[previousButtonText] - * ``String`` - * Text for zoom previous menu item (i18n). - */ - previousButtonText: "Zoom Previous", - - /** api: config[nextButtonText] - * ``String`` - * Text for zoom next menu item (i18n). - */ - nextButtonText: "Zoom Next", /** api: config[previousMenuText] * ``String`` @@ -80,14 +68,12 @@ gxp.plugins.NavigationHistory = Ext.extend(gxp.plugins.Tool, { this.target.mapPanel.map.addControl(historyControl); var actions = [new GeoExt.Action({ menuText: this.previousMenuText, - buttonText: this.previousButtonText, iconCls: "gxp-icon-zoom-previous", tooltip: this.previousTooltip, disabled: true, control: historyControl.previous }), new GeoExt.Action({ menuText: this.nextMenuText, - buttonText: this.nextButtonText, iconCls: "gxp-icon-zoom-next", tooltip: this.nextTooltip, disabled: true, diff --git a/src/script/plugins/RemoveLayer.js b/src/script/plugins/RemoveLayer.js index 4ed79796..49689d3a 100644 --- a/src/script/plugins/RemoveLayer.js +++ b/src/script/plugins/RemoveLayer.js @@ -30,12 +30,6 @@ gxp.plugins.RemoveLayer = Ext.extend(gxp.plugins.Tool, { /** api: ptype = gxp_removelayer */ ptype: "gxp_removelayer", - - /** api: config[buttonText] - * ``String`` - * Text for the Measure button (i18n). - */ - buttonText: "Remove layer", /** api: config[removeMenuText] * ``String`` @@ -55,7 +49,6 @@ gxp.plugins.RemoveLayer = Ext.extend(gxp.plugins.Tool, { var selectedLayer; var actions = gxp.plugins.RemoveLayer.superclass.addActions.apply(this, [{ menuText: this.removeMenuText, - buttonText: this.buttonText, iconCls: "gxp-icon-removelayers", disabled: true, tooltip: this.removeActionTip, diff --git a/src/script/plugins/Styler.js b/src/script/plugins/Styler.js index d71070aa..657d1406 100644 --- a/src/script/plugins/Styler.js +++ b/src/script/plugins/Styler.js @@ -31,11 +31,6 @@ gxp.plugins.Styler = Ext.extend(gxp.plugins.Tool, { /** api: ptype = gxp_styler */ ptype: "gxp_styler", - - /** api: config[buttonText] - * ``String`` Text to show next to the zoom button - */ - buttonText: "Edit Styles", /** api: config[menuText] * ``String`` @@ -122,7 +117,6 @@ gxp.plugins.Styler = Ext.extend(gxp.plugins.Tool, { var layerProperties; var actions = gxp.plugins.Styler.superclass.addActions.apply(this, [{ menuText: this.menuText, - buttonText: this.buttonText, iconCls: "gxp-icon-palette", disabled: true, tooltip: this.tooltip, diff --git a/src/script/plugins/Zoom.js b/src/script/plugins/Zoom.js index 249d8f0a..cf466d0f 100644 --- a/src/script/plugins/Zoom.js +++ b/src/script/plugins/Zoom.js @@ -31,24 +31,6 @@ gxp.plugins.Zoom = Ext.extend(gxp.plugins.Tool, { /** api: ptype = gxp_zoom */ ptype: "gxp_zoom", - - /** api: config[zoomButtonText] - * ``String`` - * Text for zoom box menu item (i18n). - */ - zoomButtonText: "Zoom Box", - - /** api: config[zoomInButtonText] - * ``String`` - * Text for zoom in menu item (i18n). - */ - zoomInButtonText: "Zoom In", - - /** api: config[zoomOutButtonText] - * ``String`` - * Text for zoom out menu item (i18n). - */ - zoomOutButtonText: "Zoom Out", /** api: config[zoomMenuText] * ``String`` @@ -110,7 +92,6 @@ gxp.plugins.Zoom = Ext.extend(gxp.plugins.Tool, { addActions: function() { var actions = [{ menuText: this.zoomInMenuText, - buttonText: this.zoomInButtonText, iconCls: "gxp-icon-zoom-in", tooltip: this.zoomInTooltip, handler: function() { @@ -119,7 +100,6 @@ gxp.plugins.Zoom = Ext.extend(gxp.plugins.Tool, { scope: this }, { menuText: this.zoomOutMenuText, - buttonText: this.zoomOutButtonText, iconCls: "gxp-icon-zoom-out", tooltip: this.zoomOutTooltip, handler: function() { @@ -129,8 +109,7 @@ gxp.plugins.Zoom = Ext.extend(gxp.plugins.Tool, { }]; if (this.showZoomBoxAction) { actions.unshift(new GeoExt.Action({ - menuText: this.zoomMenuText, - buttonText: this.zoomButtonText, + menuText: this.zoomText, iconCls: "gxp-icon-zoom", tooltip: this.zoomTooltip, control: new OpenLayers.Control.ZoomBox(this.controlOptions), diff --git a/src/script/plugins/ZoomToExtent.js b/src/script/plugins/ZoomToExtent.js index 399a7d40..1d4df0e5 100644 --- a/src/script/plugins/ZoomToExtent.js +++ b/src/script/plugins/ZoomToExtent.js @@ -34,7 +34,6 @@ gxp.plugins.ZoomToExtent = Ext.extend(gxp.plugins.Tool, { /** api: config[buttonText] * ``String`` Text to show next to the zoom button */ - buttonText: "Zoom Extend", /** api: config[menuText] * ``String`` @@ -86,8 +85,8 @@ gxp.plugins.ZoomToExtent = Ext.extend(gxp.plugins.Tool, { */ addActions: function() { return gxp.plugins.ZoomToExtent.superclass.addActions.apply(this, [{ + text: this.buttonText, menuText: this.menuText, - buttonText: this.buttonText, iconCls: this.iconCls, tooltip: this.tooltip, handler: function() { From 5b577f5b90ab1da07def9f42772281ac39846dd9 Mon Sep 17 00:00:00 2001 From: Bart Baas Date: Wed, 9 Jan 2013 09:57:31 +0100 Subject: [PATCH 4/4] Fixed buttonText on tool Enabled buttonText when the showButtonText toggle is applied --- src/script/plugins/AddLayers.js | 1 + src/script/plugins/FeatureEditor.js | 10 +++++++- src/script/plugins/LayerProperties.js | 7 ++++++ src/script/plugins/Legend.js | 7 ++++++ src/script/plugins/Measure.js | 8 ++++++- src/script/plugins/Navigation.js | 7 ++++++ src/script/plugins/NavigationHistory.js | 14 +++++++++++ src/script/plugins/RemoveLayer.js | 7 ++++++ src/script/plugins/Styler.js | 7 ++++++ src/script/plugins/Zoom.js | 25 ++++++++++++++++++-- src/script/plugins/ZoomToDataExtent.js | 6 +++++ src/script/plugins/ZoomToExtent.js | 6 +++-- src/script/plugins/ZoomToLayerExtent.js | 6 +++++ src/script/plugins/ZoomToSelectedFeatures.js | 6 +++++ 14 files changed, 111 insertions(+), 6 deletions(-) diff --git a/src/script/plugins/AddLayers.js b/src/script/plugins/AddLayers.js index 912099be..b3177135 100644 --- a/src/script/plugins/AddLayers.js +++ b/src/script/plugins/AddLayers.js @@ -251,6 +251,7 @@ gxp.plugins.AddLayers = Ext.extend(gxp.plugins.Tool, { tooltip : this.addActionTip, text: this.addActionText, menuText: this.addActionMenuText, + buttonText: this.addButtonText, disabled: true, iconCls: "gxp-icon-addlayers" }; diff --git a/src/script/plugins/FeatureEditor.js b/src/script/plugins/FeatureEditor.js index 034846cc..84d1409e 100644 --- a/src/script/plugins/FeatureEditor.js +++ b/src/script/plugins/FeatureEditor.js @@ -58,6 +58,12 @@ gxp.plugins.FeatureEditor = Ext.extend(gxp.plugins.ClickableFeatures, { */ splitButton: null, + /** api: config[showButtonText] + * Show the ``buttonText`` an action is configured with, if used as a + * button. Default is false. + */ + showButtonText: false, + /** api: config[iconClsAdd] * ``String`` * iconCls to use for the add button. @@ -623,6 +629,7 @@ gxp.plugins.FeatureEditor = Ext.extend(gxp.plugins.ClickableFeatures, { // backwards compatibility: only show text if configured menuText: this.initialConfig.createFeatureActionText, text: this.initialConfig.createFeatureActionText, + buttonText: this.createFeatureActionText, iconCls: this.iconClsAdd, disabled: true, hidden: this.modifyOnly || this.readOnly, @@ -720,6 +727,7 @@ gxp.plugins.FeatureEditor = Ext.extend(gxp.plugins.ClickableFeatures, { // backwards compatibility: only show text if configured text: this.initialConfig.editFeatureActionText, menuText: this.initialConfig.editFeatureActionText, + buttonText: this.editFeatureActionText, iconCls: this.iconClsEdit, disabled: true, toggleGroup: toggleGroup, @@ -748,7 +756,7 @@ gxp.plugins.FeatureEditor = Ext.extend(gxp.plugins.ClickableFeatures, { }) ]}, disabled: true, - buttonText: this.splitButtonText, + text: this.showButtonText ? this.splitButtonText : null, tooltip: this.splitButtonTooltip, iconCls: this.iconClsAdd, enableToggle: true, diff --git a/src/script/plugins/LayerProperties.js b/src/script/plugins/LayerProperties.js index 6dfde36c..f03a093f 100644 --- a/src/script/plugins/LayerProperties.js +++ b/src/script/plugins/LayerProperties.js @@ -29,6 +29,12 @@ gxp.plugins.LayerProperties = Ext.extend(gxp.plugins.Tool, { /** api: ptype = gxp_layerproperties */ ptype: "gxp_layerproperties", + + /** api: config[buttonText] + * ``String`` + * Text for layer properties button item (i18n). + */ + buttonText: "Layer Properties", /** api: config[menuText] * ``String`` @@ -69,6 +75,7 @@ gxp.plugins.LayerProperties = Ext.extend(gxp.plugins.Tool, { addActions: function() { var actions = gxp.plugins.LayerProperties.superclass.addActions.apply(this, [{ menuText: this.menuText, + buttonText: this.buttonText, iconCls: "gxp-icon-layerproperties", disabled: true, tooltip: this.toolTip, diff --git a/src/script/plugins/Legend.js b/src/script/plugins/Legend.js index e4a3e403..10cb42e1 100644 --- a/src/script/plugins/Legend.js +++ b/src/script/plugins/Legend.js @@ -31,6 +31,12 @@ gxp.plugins.Legend = Ext.extend(gxp.plugins.Tool, { /** api: ptype = gxp_legend */ ptype: "gxp_legend", + + /** api: config[buttonText] + * ``String`` + * Text for legend button item (i18n). + */ + buttonText: "Legend", /** api: config[menuText] * ``String`` @@ -70,6 +76,7 @@ gxp.plugins.Legend = Ext.extend(gxp.plugins.Tool, { addActions: function() { var actions = [{ menuText: this.menuText, + buttonText: this.buttonText, iconCls: "gxp-icon-legend", tooltip: this.tooltip, handler: function() { diff --git a/src/script/plugins/Measure.js b/src/script/plugins/Measure.js index 05ce9bec..d18f8987 100644 --- a/src/script/plugins/Measure.js +++ b/src/script/plugins/Measure.js @@ -44,6 +44,12 @@ gxp.plugins.Measure = Ext.extend(gxp.plugins.Tool, { */ outputTarget: "map", + /** api: config[showButtonText] + * Show the ``buttonText`` an action is configured with, if used as a + * button. Default is false. + */ + showButtonText: false, + /** api: config[buttonText] * ``String`` * Text for the Measure button (i18n). @@ -205,7 +211,7 @@ gxp.plugins.Measure = Ext.extend(gxp.plugins.Tool, { this.button = new Ext.SplitButton({ iconCls: "gxp-icon-measure-length", tooltip: this.measureTooltip, - buttonText: this.buttonText, + text: this.showButtonText ? this.buttonText : null, enableToggle: true, toggleGroup: this.toggleGroup, allowDepress: true, diff --git a/src/script/plugins/Navigation.js b/src/script/plugins/Navigation.js index f413b7d9..3ff0baf5 100644 --- a/src/script/plugins/Navigation.js +++ b/src/script/plugins/Navigation.js @@ -31,6 +31,12 @@ gxp.plugins.Navigation = Ext.extend(gxp.plugins.Tool, { /** api: ptype = gxp_navigation */ ptype: "gxp_navigation", + + /** api: config[buttonText] + * ``String`` + * Text for navigation button item (i18n). + */ + buttonText: "Pan", /** api: config[menuText] * ``String`` @@ -69,6 +75,7 @@ gxp.plugins.Navigation = Ext.extend(gxp.plugins.Tool, { var actions = [new GeoExt.Action({ tooltip: this.tooltip, menuText: this.menuText, + buttonText: this.buttonText, iconCls: "gxp-icon-pan", enableToggle: true, pressed: true, diff --git a/src/script/plugins/NavigationHistory.js b/src/script/plugins/NavigationHistory.js index 6aed078d..4ffa61a0 100644 --- a/src/script/plugins/NavigationHistory.js +++ b/src/script/plugins/NavigationHistory.js @@ -30,6 +30,18 @@ gxp.plugins.NavigationHistory = Ext.extend(gxp.plugins.Tool, { /** api: ptype = gxp_navigationhistory */ ptype: "gxp_navigationhistory", + + /** api: config[previousButtonText] + * ``String`` + * Text for zoom previous button item (i18n). + */ + previousButtonText: "Zoom Previous", + + /** api: config[nextButtonText] + * ``String`` + * Text for zoom next button item (i18n). + */ + nextButtonText: "Zoom Next", /** api: config[previousMenuText] * ``String`` @@ -68,12 +80,14 @@ gxp.plugins.NavigationHistory = Ext.extend(gxp.plugins.Tool, { this.target.mapPanel.map.addControl(historyControl); var actions = [new GeoExt.Action({ menuText: this.previousMenuText, + buttonText: this.previousButtonText, iconCls: "gxp-icon-zoom-previous", tooltip: this.previousTooltip, disabled: true, control: historyControl.previous }), new GeoExt.Action({ menuText: this.nextMenuText, + buttonText: this.nextButtonText, iconCls: "gxp-icon-zoom-next", tooltip: this.nextTooltip, disabled: true, diff --git a/src/script/plugins/RemoveLayer.js b/src/script/plugins/RemoveLayer.js index 49689d3a..a1e86503 100644 --- a/src/script/plugins/RemoveLayer.js +++ b/src/script/plugins/RemoveLayer.js @@ -30,6 +30,12 @@ gxp.plugins.RemoveLayer = Ext.extend(gxp.plugins.Tool, { /** api: ptype = gxp_removelayer */ ptype: "gxp_removelayer", + + /** api: config[buttonText] + * ``String`` + * Text for remove button item (i18n). + */ + buttonText: "Remove layer", /** api: config[removeMenuText] * ``String`` @@ -49,6 +55,7 @@ gxp.plugins.RemoveLayer = Ext.extend(gxp.plugins.Tool, { var selectedLayer; var actions = gxp.plugins.RemoveLayer.superclass.addActions.apply(this, [{ menuText: this.removeMenuText, + buttonText: this.buttonText, iconCls: "gxp-icon-removelayers", disabled: true, tooltip: this.removeActionTip, diff --git a/src/script/plugins/Styler.js b/src/script/plugins/Styler.js index 657d1406..393ed813 100644 --- a/src/script/plugins/Styler.js +++ b/src/script/plugins/Styler.js @@ -31,6 +31,12 @@ gxp.plugins.Styler = Ext.extend(gxp.plugins.Tool, { /** api: ptype = gxp_styler */ ptype: "gxp_styler", + + /** api: config[buttonText] + * ``String`` + * Text for layer properties button item (i18n). + */ + buttonText: "Edit Styles", /** api: config[menuText] * ``String`` @@ -117,6 +123,7 @@ gxp.plugins.Styler = Ext.extend(gxp.plugins.Tool, { var layerProperties; var actions = gxp.plugins.Styler.superclass.addActions.apply(this, [{ menuText: this.menuText, + buttonText: this.buttonText, iconCls: "gxp-icon-palette", disabled: true, tooltip: this.tooltip, diff --git a/src/script/plugins/Zoom.js b/src/script/plugins/Zoom.js index cf466d0f..7389fe9d 100644 --- a/src/script/plugins/Zoom.js +++ b/src/script/plugins/Zoom.js @@ -31,7 +31,25 @@ gxp.plugins.Zoom = Ext.extend(gxp.plugins.Tool, { /** api: ptype = gxp_zoom */ ptype: "gxp_zoom", - + + /** api: config[zoomButtonText] + * ``String`` + * Text for zoom box button item (i18n). + */ + zoomButtonText: "Zoom Box", + + /** api: config[zoomInButtonText] + * ``String`` + * Text for zoom in button item (i18n). + */ + zoomInButtonText: "Zoom In", + + /** api: config[zoomOutButtonText] + * ``String`` + * Text for zoom out button item (i18n). + */ + zoomOutButtonText: "Zoom Out", + /** api: config[zoomMenuText] * ``String`` * Text for zoom box menu item (i18n). @@ -92,6 +110,7 @@ gxp.plugins.Zoom = Ext.extend(gxp.plugins.Tool, { addActions: function() { var actions = [{ menuText: this.zoomInMenuText, + buttonText: this.zoomInButtonText, iconCls: "gxp-icon-zoom-in", tooltip: this.zoomInTooltip, handler: function() { @@ -100,6 +119,7 @@ gxp.plugins.Zoom = Ext.extend(gxp.plugins.Tool, { scope: this }, { menuText: this.zoomOutMenuText, + buttonText: this.zoomOutButtonText, iconCls: "gxp-icon-zoom-out", tooltip: this.zoomOutTooltip, handler: function() { @@ -109,7 +129,8 @@ gxp.plugins.Zoom = Ext.extend(gxp.plugins.Tool, { }]; if (this.showZoomBoxAction) { actions.unshift(new GeoExt.Action({ - menuText: this.zoomText, + menuText: this.zoomMenuText, + buttonText: this.zoomButtonText, iconCls: "gxp-icon-zoom", tooltip: this.zoomTooltip, control: new OpenLayers.Control.ZoomBox(this.controlOptions), diff --git a/src/script/plugins/ZoomToDataExtent.js b/src/script/plugins/ZoomToDataExtent.js index 3aa840e4..0bba2933 100644 --- a/src/script/plugins/ZoomToDataExtent.js +++ b/src/script/plugins/ZoomToDataExtent.js @@ -29,6 +29,12 @@ gxp.plugins.ZoomToDataExtent = Ext.extend(gxp.plugins.ZoomToExtent, { /** api: ptype = gxp_zoomtodataextent */ ptype: "gxp_zoomtodataextent", + + /** api: config[buttonText] + * ``String`` + * Text for zoom button item (i18n). + */ + buttonText: "Zoom layer extent", /** api: config[menuText] * ``String`` diff --git a/src/script/plugins/ZoomToExtent.js b/src/script/plugins/ZoomToExtent.js index 1d4df0e5..0ede8246 100644 --- a/src/script/plugins/ZoomToExtent.js +++ b/src/script/plugins/ZoomToExtent.js @@ -32,8 +32,10 @@ gxp.plugins.ZoomToExtent = Ext.extend(gxp.plugins.Tool, { ptype: "gxp_zoomtoextent", /** api: config[buttonText] - * ``String`` Text to show next to the zoom button + * ``String`` + * Text for zoom button item (i18n). */ + buttonText: "Zoom extend", /** api: config[menuText] * ``String`` @@ -85,8 +87,8 @@ gxp.plugins.ZoomToExtent = Ext.extend(gxp.plugins.Tool, { */ addActions: function() { return gxp.plugins.ZoomToExtent.superclass.addActions.apply(this, [{ - text: this.buttonText, menuText: this.menuText, + buttonText: this.buttonText, iconCls: this.iconCls, tooltip: this.tooltip, handler: function() { diff --git a/src/script/plugins/ZoomToLayerExtent.js b/src/script/plugins/ZoomToLayerExtent.js index a6214cc8..7f00d200 100644 --- a/src/script/plugins/ZoomToLayerExtent.js +++ b/src/script/plugins/ZoomToLayerExtent.js @@ -29,6 +29,12 @@ gxp.plugins.ZoomToLayerExtent = Ext.extend(gxp.plugins.ZoomToExtent, { /** api: ptype = gxp_zoomtolayerextent */ ptype: "gxp_zoomtolayerextent", + + /** api: config[buttonText] + * ``String`` + * Text for zoom button item (i18n). + */ + buttonText: "Zoom layer extent", /** api: config[menuText] * ``String`` diff --git a/src/script/plugins/ZoomToSelectedFeatures.js b/src/script/plugins/ZoomToSelectedFeatures.js index a2f88519..4e82546d 100644 --- a/src/script/plugins/ZoomToSelectedFeatures.js +++ b/src/script/plugins/ZoomToSelectedFeatures.js @@ -29,6 +29,12 @@ gxp.plugins.ZoomToSelectedFeatures = Ext.extend(gxp.plugins.ZoomToExtent, { /** api: ptype = gxp_zoomtoselectedfeatures */ ptype: "gxp_zoomtoselectedfeatures", + + /** api: config[buttonText] + * ``String`` + * Text for zoom button item (i18n). + */ + buttonText: "Zoom selected features", /** api: config[menuText] * ``String``