Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added buttonText properties #174

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,7 @@ src/doc/lib/menu
src/doc/lib/plugins
src/doc/lib/widgets
src/doc/lib/util.rst
build/
build/
src/script/plugins/.DS_Store

.DS_Store
1 change: 1 addition & 0 deletions src/script/plugins/AddLayers.js
Original file line number Diff line number Diff line change
Expand Up @@ -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"
};
Expand Down
10 changes: 9 additions & 1 deletion src/script/plugins/FeatureEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
7 changes: 7 additions & 0 deletions src/script/plugins/LayerProperties.js
Original file line number Diff line number Diff line change
Expand Up @@ -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``
Expand Down Expand Up @@ -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,
Expand Down
7 changes: 7 additions & 0 deletions src/script/plugins/Legend.js
Original file line number Diff line number Diff line change
Expand Up @@ -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``
Expand Down Expand Up @@ -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() {
Expand Down
8 changes: 7 additions & 1 deletion src/script/plugins/Measure.js
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down Expand Up @@ -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,
Expand Down
7 changes: 7 additions & 0 deletions src/script/plugins/Navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -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``
Expand Down Expand Up @@ -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,
Expand Down
14 changes: 14 additions & 0 deletions src/script/plugins/NavigationHistory.js
Original file line number Diff line number Diff line change
Expand Up @@ -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``
Expand Down Expand Up @@ -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,
Expand Down
7 changes: 7 additions & 0 deletions src/script/plugins/RemoveLayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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``
Expand All @@ -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,
Expand Down
7 changes: 7 additions & 0 deletions src/script/plugins/Styler.js
Original file line number Diff line number Diff line change
Expand Up @@ -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``
Expand Down Expand Up @@ -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,
Expand Down
25 changes: 23 additions & 2 deletions src/script/plugins/Zoom.js
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down Expand Up @@ -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() {
Expand All @@ -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() {
Expand All @@ -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),
Expand Down
6 changes: 6 additions & 0 deletions src/script/plugins/ZoomToDataExtent.js
Original file line number Diff line number Diff line change
Expand Up @@ -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``
Expand Down
6 changes: 4 additions & 2 deletions src/script/plugins/ZoomToExtent.js
Original file line number Diff line number Diff line change
Expand Up @@ -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``
Expand Down Expand Up @@ -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() {
Expand Down
6 changes: 6 additions & 0 deletions src/script/plugins/ZoomToLayerExtent.js
Original file line number Diff line number Diff line change
Expand Up @@ -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``
Expand Down
6 changes: 6 additions & 0 deletions src/script/plugins/ZoomToSelectedFeatures.js
Original file line number Diff line number Diff line change
Expand Up @@ -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``
Expand Down