Skip to content

Commit e81f36e

Browse files
committed
Merge pull request #201 from marcjansen/version
Refactor namespace and version setup
2 parents 4a962b6 + b615a9c commit e81f36e

34 files changed

+215
-36
lines changed

src/GeoExt/Action.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@
2525
Ext.define('GeoExt.Action', {
2626
extend: 'Ext.Action',
2727
alias : 'widget.gx_action',
28+
requires: [
29+
'GeoExt.Version'
30+
],
2831

2932
/**
3033
* The OpenLayers control wrapped in this action.

src/GeoExt/FeatureRenderer.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@
2323
Ext.define('GeoExt.FeatureRenderer', {
2424
extend: 'Ext.Component',
2525
alias: 'widget.gx_renderer',
26+
requires: [
27+
'GeoExt.Version'
28+
],
2629

2730
/**
2831
* Optional vector to be drawn. If not provided, and if `symbolizers`

src/GeoExt/Form.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@
4646
};
4747

4848
Ext.define('GeoExt.Form', {
49+
requires: [
50+
'GeoExt.Version'
51+
],
52+
4953
singleton: true,
5054

5155
/**

src/GeoExt/GeoExt.js

Lines changed: 0 additions & 16 deletions
This file was deleted.

src/GeoExt/Lang.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
Ext.define('GeoExt.Lang', {
1616
extend: 'Ext.util.Observable',
1717
singleton: true,
18+
requires: [
19+
'GeoExt.Version'
20+
],
1821

1922
/**
2023
* The current language tag. Use `#set` to set the locale. Defaults

src/GeoExt/LegendImage.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@
1818
Ext.define('GeoExt.LegendImage', {
1919
extend : 'Ext.Component',
2020
alias : 'widget.gx_legendimage',
21-
21+
requires: [
22+
'GeoExt.Version'
23+
],
2224
/**
2325
* The url of the image to load.
2426
*

src/GeoExt/Version.js

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
/*
2+
* Copyright (c) 2008-2013 The Open Source Geospatial Foundation
3+
*
4+
* Published under the BSD license.
5+
* See https://github.com/geoext/geoext2/blob/master/license.txt for the full
6+
* text of the license.
7+
*/
8+
(function() {
9+
var major = 2,
10+
minor = 0,
11+
patch = 1,
12+
label = 'dev',
13+
environment = [],
14+
v = '';
15+
16+
// Concatenate GeoExt version.
17+
v = 'v' + major + '.' + minor + '.' + patch + (label ? '.' + label : '');
18+
19+
// Grab versions of libraries in the environment
20+
if ( Ext.versions.extjs.version ) {
21+
environment.push('ExtJS: ' + Ext.versions.extjs.version);
22+
}
23+
if ( OpenLayers ) {
24+
environment.push('OpenLayers: ' + OpenLayers.VERSION_NUMBER);
25+
}
26+
environment.push('GeoExt: ' + v);
27+
28+
/**
29+
* A singleton class holding the properties #version with the current
30+
* GeoExt version and #environment with a string about the surrounding
31+
* libraries ExtJS and OpenLayers.
32+
*/
33+
Ext.define('GeoExt.Version', {
34+
singleton: true,
35+
36+
/**
37+
* The version number of GeoExt.
38+
*
39+
* @property {String} version
40+
*/
41+
version: v,
42+
43+
/**
44+
* Lists the versions of the currently loaded libraries and contains the
45+
* versions of `ExtJS`, `OpenLayers` and `GeoExt`.
46+
*
47+
* @property {String} environment
48+
*/
49+
environment: (environment.join(', '))
50+
}, function() {
51+
/**
52+
* The GeoExt root object.
53+
*
54+
* @class GeoExt
55+
* @singleton
56+
*/
57+
/**
58+
* @inheritdoc GeoExt.Version#version
59+
* @member GeoExt
60+
* @property version
61+
*/
62+
GeoExt.version = GeoExt.Version.version;
63+
});
64+
})();

src/GeoExt/container/LayerLegend.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@
1313
*/
1414
Ext.define('GeoExt.container.LayerLegend', {
1515
extend : 'Ext.container.Container',
16-
requires: ['Ext.form.Label'],
16+
requires: [
17+
'GeoExt.Version',
18+
'Ext.form.Label'
19+
],
1720
alias : 'widget.gx_layerlegend',
1821
alternateClassName : 'GeoExt.LayerLegend',
1922

src/GeoExt/data/FeatureStore.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@
1818
*/
1919
Ext.define('GeoExt.data.FeatureStore', {
2020
extend: 'Ext.data.Store',
21-
requires: ['GeoExt.data.reader.Feature'],
21+
requires: [
22+
'GeoExt.data.reader.Feature'
23+
],
2224

2325
statics: {
2426
/**

src/GeoExt/data/LayerModel.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,11 @@
1414
Ext.define('GeoExt.data.LayerModel',{
1515
alternateClassName: 'GeoExt.data.LayerRecord',
1616
extend: 'Ext.data.Model',
17-
requires: ['Ext.data.proxy.Memory', 'Ext.data.reader.Json'],
17+
requires: [
18+
'Ext.data.proxy.Memory',
19+
'Ext.data.reader.Json',
20+
'GeoExt.Version'
21+
],
1822
alias: 'model.gx_layer',
1923
statics: {
2024
/**

src/GeoExt/data/LayerTreeModel.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ Ext.define('GeoExt.data.LayerTreeModel',{
5151
extend: 'Ext.data.Model',
5252
requires: [
5353
'Ext.data.proxy.Memory',
54-
'Ext.data.reader.Json'
54+
'Ext.data.reader.Json',
55+
'GeoExt.Version'
5556
],
5657
alias: 'model.gx_layertree',
5758
fields: [

src/GeoExt/data/MapfishPrintProvider.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,10 @@
5151
*/
5252
Ext.define('GeoExt.data.MapfishPrintProvider', {
5353
extend: 'Ext.util.Observable',
54-
requires: ['Ext.data.JsonStore'],
54+
requires: [
55+
'Ext.data.JsonStore',
56+
'GeoExt.Version'
57+
],
5558

5659
/**
5760
* Base url of the print service. Will always have a trailing "/".

src/GeoExt/data/OwsStore.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
*/
2020
Ext.define('GeoExt.data.OwsStore', {
2121
extend: 'Ext.data.Store',
22+
requires: [
23+
'GeoExt.Version'
24+
],
2225
alternateClassName: ['GeoExt.data.OWSStore'],
2326

2427
config: {

src/GeoExt/data/RasterStyleModel.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@
1919
*/
2020
Ext.define('GeoExt.data.RasterStyleModel',{
2121
extend: 'Ext.data.Model',
22-
requires : ['Ext.data.JsonReader'],
22+
requires : [
23+
'Ext.data.JsonReader',
24+
'GeoExt.Version'
25+
],
2326
idProperty: "filter",
2427
fields: [
2528
{name: "symbolizers", mapping: function(v) {

src/GeoExt/data/ScaleModel.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ Ext.define('GeoExt.data.ScaleModel', {
1515
extend: 'Ext.data.Model',
1616
requires: [
1717
'Ext.data.proxy.Memory',
18-
'Ext.data.reader.Json'
18+
'Ext.data.reader.Json',
19+
'GeoExt.Version'
1920
],
2021
alias: 'model.gx_scale',
2122
fields: [

src/GeoExt/data/VectorStyleModel.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@
1919
*/
2020
Ext.define('GeoExt.data.VectorStyleModel', {
2121
extend : 'Ext.data.Model',
22-
requires : ['Ext.data.JsonReader'],
22+
requires : [
23+
'Ext.data.JsonReader',
24+
'GeoExt.Version'
25+
],
2326
fields : [{
2427
name : "elseFilter",
2528
defaultValue : null

src/GeoExt/data/proxy/Protocol.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
*/
1414
Ext.define('GeoExt.data.proxy.Protocol', {
1515
extend: 'Ext.data.proxy.Server',
16+
requires: [
17+
'GeoExt.Version'
18+
],
1619
alias: 'proxy.gx_protocol',
1720

1821
/**

src/GeoExt/data/reader/Attribute.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,10 @@
3333
*/
3434
Ext.define('GeoExt.data.reader.Attribute', {
3535
extend: 'Ext.data.reader.Json',
36-
requires: ['Ext.data.Field'],
36+
requires: [
37+
'GeoExt.Version',
38+
'Ext.data.Field'
39+
],
3740
alternateClassName: 'GeoExt.data.AttributeReader',
3841
alias: 'reader.gx_attribute',
3942

src/GeoExt/data/reader/CswRecords.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ Ext.define('GeoExt.data.reader.CswRecords', {
3232
alternateClassName: ['GeoExt.data.CSWRecordsReader'],
3333
extend: 'Ext.data.reader.Json',
3434
alias: 'reader.gx_cswrecords',
35-
35+
requires: [
36+
'GeoExt.Version'
37+
],
3638
/**
3739
* Creates new Reader.
3840
*

src/GeoExt/data/reader/Feature.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@
1818
Ext.define('GeoExt.data.reader.Feature', {
1919
extend: 'Ext.data.reader.Json',
2020
alias : 'reader.feature',
21-
21+
requires: [
22+
'GeoExt.Version'
23+
],
2224
/**
2325
* Force to have our convertRecordData.
2426
*

src/GeoExt/data/reader/WfsCapabilities.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ Ext.define('GeoExt.data.reader.WfsCapabilities', {
2626
],
2727
extend: 'Ext.data.reader.Json',
2828
alias: 'reader.gx_wfscapabilities',
29-
29+
requires: [
30+
'GeoExt.Version'
31+
],
3032
/**
3133
* Creates new Reader.
3234
*

src/GeoExt/data/reader/Wmc.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ Ext.define('GeoExt.data.reader.Wmc', {
1919
alternateClassName: ['GeoExt.data.WMCReader'],
2020
extend: 'Ext.data.reader.Json',
2121
alias: 'reader.gx_wmc',
22+
requires: [
23+
'GeoExt.Version'
24+
],
2225

2326
/**
2427
* Creates new Reader.

src/GeoExt/data/reader/WmsCapabilities.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ Ext.define('GeoExt.data.reader.WmsCapabilities', {
2525
],
2626
extend: 'Ext.data.reader.Json',
2727
alias: 'reader.gx_wmscapabilities',
28-
28+
requires: [
29+
'GeoExt.Version'
30+
],
2931
/**
3032
* Creates new Reader.
3133
*

src/GeoExt/data/reader/WmsDescribeLayer.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ Ext.define('GeoExt.data.reader.WmsDescribeLayer', {
2020
alternateClassName: ['GeoExt.data.reader.WMSDescribeLayer', 'GeoExt.data.WMSCapabilitiesReader'],
2121
extend: 'Ext.data.reader.Json',
2222
alias: 'reader.gx_wmsdescribelayer',
23-
23+
requires: [
24+
'GeoExt.Version'
25+
],
2426
/**
2527
* Creates new Reader.
2628
*

src/GeoExt/panel/Map.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,9 @@
4848
*/
4949
Ext.define('GeoExt.panel.Map', {
5050
extend: 'Ext.panel.Panel',
51-
requires: ['GeoExt.data.LayerStore'],
51+
requires: [
52+
'GeoExt.data.LayerStore'
53+
],
5254
alias: 'widget.gx_mappanel',
5355
alternateClassName: 'GeoExt.MapPanel',
5456

src/GeoExt/selection/FeatureModel.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@
4343
Ext.define('GeoExt.selection.FeatureModel', {
4444
extend: 'Ext.selection.RowModel',
4545
alias: 'selection.featuremodel',
46+
requires: [
47+
'GeoExt.Version'
48+
],
4649

4750
/**
4851
* If true the select feature control is activated and deactivated when

src/GeoExt/slider/Tip.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@
3232
Ext.define('GeoExt.slider.Tip', {
3333
extend : 'Ext.slider.Tip',
3434
alternateClassName : 'GeoExt.SliderTip',
35-
35+
requires: [
36+
'GeoExt.Version'
37+
],
3638
/**
3739
* Display the tip when hovering over the thumb. If `false`, tip will
3840
* only be displayed while dragging. Default is `true`.

src/GeoExt/state/PermalinkProvider.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@
4343
*/
4444
Ext.define('GeoExt.state.PermalinkProvider', {
4545
extend : 'Ext.state.Provider',
46-
requires : [],
46+
requires : [
47+
'GeoExt.Version'
48+
],
4749
alias : 'widget.gx_permalinkprovider',
4850

4951
/**

src/GeoExt/tree/Column.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
*/
1616
Ext.define('GeoExt.tree.Column', {
1717
extend: 'Ext.tree.Column',
18+
requires: [
19+
'GeoExt.Version'
20+
],
1821
alias: 'widget.gx_treecolumn',
1922

2023
initComponent: function() {

src/GeoExt/tree/LayerNode.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@
2424
Ext.define('GeoExt.tree.LayerNode', {
2525
extend: 'Ext.AbstractPlugin',
2626
alias: 'plugin.gx_layer',
27-
27+
requires: [
28+
'GeoExt.Version'
29+
],
2830
/**
2931
* The init method is invoked after initComponent method has been run for
3032
* the client Component. It performs plugin initialization.

src/GeoExt/tree/View.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@
2727
Ext.define('GeoExt.tree.View', {
2828
extend: 'Ext.tree.View',
2929
alias: 'widget.gx_treeview',
30-
30+
requires: [
31+
'GeoExt.Version'
32+
],
3133
initComponent : function() {
3234
var me = this;
3335

0 commit comments

Comments
 (0)