diff --git a/.travis.yml b/.travis.yml index 7552a7cd6..f42bdf06c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,4 @@ language: node_js -node_js: 0.10 -# installs dependencies for testing -install: npm install -g casperjs@1.1.0-beta3 -# command to run tests -script: casperjs test tests/headless/run-testsuite.js +node_js: + - node + - iojs diff --git a/README.md b/README.md index 58a59593f..d1509d605 100644 --- a/README.md +++ b/README.md @@ -139,11 +139,11 @@ prior to submitting your changes. Thanks. You can also run the above tests headlessly through casperjs. ```bash -# Install casperjs via npm in the GeoExt 2 clone dir (only first time) -npm install casperjs@1.1.0-beta3 +# Install dependencies via npm in the GeoExt 2 clone dir (only first time) +npm install # Run the suite in the root of the repository -./node_modules/casperjs/bin/casperjs test tests/headless/run-testsuite.js +npm test ``` These tests are also run though [travis](https://travis-ci.org/geoext/geoext2). diff --git a/examples/action/mappanel_with_actions.html b/examples/action/mappanel_with_actions.html index 97aefb86c..042e49e4a 100644 --- a/examples/action/mappanel_with_actions.html +++ b/examples/action/mappanel_with_actions.html @@ -1,22 +1,20 @@ - - GeoExt2 - Action + + GeoExt2 - Action - - - + + + - - - - + + - - + + - - - - + + + + diff --git a/examples/action/mappanel_with_actions.js b/examples/action/mappanel_with_actions.js index e17321c24..1fe09cbfb 100644 --- a/examples/action/mappanel_with_actions.js +++ b/examples/action/mappanel_with_actions.js @@ -17,7 +17,7 @@ Ext.application({ name: 'ActionExample', launch: function(){ - var map = new OpenLayers.Map({}); + var map = new OpenLayers.Map({allOverlays: true, fallThrough: true}); map.addControl(new OpenLayers.Control.LayerSwitcher()); var wms = new OpenLayers.Layer.WMS( "OpenStreetMap WMS", diff --git a/examples/app/simple/app/view/Map.js b/examples/app/simple/app/view/Map.js index c7a2fcec5..45bedb0af 100644 --- a/examples/app/simple/app/view/Map.js +++ b/examples/app/simple/app/view/Map.js @@ -25,7 +25,7 @@ Ext.define('CF.view.Map', { items = [], ctrl; - var map = new OpenLayers.Map(); + var map = new OpenLayers.Map({allOverlays: true, fallThrough: true}); // ZoomToMaxExtent control, a "button" control items.push(Ext.create('Ext.button.Button', Ext.create('GeoExt.Action', { diff --git a/examples/geocoder/geocoder.html b/examples/geocoder/geocoder.html index 4b7c10892..785b480ee 100644 --- a/examples/geocoder/geocoder.html +++ b/examples/geocoder/geocoder.html @@ -4,20 +4,17 @@ GeoExt GeocoderComboBox Example - - + + - - - + -

GeoExt.form.field.GeocoderComboBox

diff --git a/examples/grid/feature-grid-w-proxy.html b/examples/grid/feature-grid-w-proxy.html index 8c61c3073..e28477ac1 100644 --- a/examples/grid/feature-grid-w-proxy.html +++ b/examples/grid/feature-grid-w-proxy.html @@ -4,14 +4,12 @@ GeoExt WFS FeatureStore in an Ext Grid - - + + - - - + - -

GeoExt.LayerOpacitySlider

diff --git a/examples/legendpanel/legendpanel.html b/examples/legendpanel/legendpanel.html index 6d76c8da5..94f3f193c 100644 --- a/examples/legendpanel/legendpanel.html +++ b/examples/legendpanel/legendpanel.html @@ -3,28 +3,25 @@ GeoExt Legend Panel - - + + - - - + diff --git a/examples/legendpanel/legendpanel.js b/examples/legendpanel/legendpanel.js index 4bb08b38c..652b2f21c 100644 --- a/examples/legendpanel/legendpanel.js +++ b/examples/legendpanel/legendpanel.js @@ -27,9 +27,7 @@ Ext.require([ Ext.application({ name: 'LegendPanel GeoExt2', launch: function() { - var map = new OpenLayers.Map({ - allOverlays: true - }); + var map = new OpenLayers.Map({allOverlays: true, fallThrough: true}); map.addLayers([ new OpenLayers.Layer.WMS( "OpenStreetMap WMS", diff --git a/examples/loader.js b/examples/loader.js index 26a887b1f..58544faae 100644 --- a/examples/loader.js +++ b/examples/loader.js @@ -2,7 +2,6 @@ Ext.Loader.setConfig({ enabled: true, disableCaching: false, paths: { - GeoExt: "../../src/GeoExt", - Ext: "http://cdn.sencha.com/ext/gpl/4.2.1/src" + GeoExt: "../../src/GeoExt" } }); diff --git a/examples/mappanel/mappanel.html b/examples/mappanel/mappanel.html index d41f0ad4f..9be19aac3 100644 --- a/examples/mappanel/mappanel.html +++ b/examples/mappanel/mappanel.html @@ -1,22 +1,20 @@ - - Hello GeoExt2 + + Hello GeoExt2 - - - + + + - - - - + + - - + + - - - - + + + + diff --git a/examples/mappanel/mappanel.js b/examples/mappanel/mappanel.js index dfe55830b..17d452f4a 100644 --- a/examples/mappanel/mappanel.js +++ b/examples/mappanel/mappanel.js @@ -22,7 +22,7 @@ Ext.application({ expires: new Date(new Date().getTime()+(1000*60*60*24*7)) //7 days from now })); - var map = new OpenLayers.Map({}); + var map = new OpenLayers.Map({allOverlays: true, fallThrough: true}); var wms = new OpenLayers.Layer.WMS( "OpenStreetMap WMS", diff --git a/examples/options-toolbar.js b/examples/options-toolbar.js new file mode 100644 index 000000000..73e3f7453 --- /dev/null +++ b/examples/options-toolbar.js @@ -0,0 +1,211 @@ +/** + * Unmodified copy from ext-5.0.0/shared/include-ext.js to prevent CORS-problems + */ +(function() { + function getQueryParam(name, queryString) { + var match = RegExp(name + '=([^&]*)').exec(queryString || location.search); + return match && decodeURIComponent(match[1]); + } + + function hasOption(opt) { + var s = window.location.search; + var re = new RegExp('(?:^|[&?])' + opt + '(?:[=]([^&]*))?(?:$|[&])', 'i'); + var m = re.exec(s); + + return m ? (m[1] === undefined ? true : m[1]) : false; + } + + var scriptTags = document.getElementsByTagName('script'), + defaultTheme = 'neptune', + defaultRtl = false, + i = scriptTags.length, + requires = [ + 'Ext.window.MessageBox', + 'Ext.toolbar.Toolbar', + 'Ext.form.field.ComboBox', + 'Ext.form.FieldContainer', + 'Ext.form.field.Radio' + + ], + comboWidth = { + classic: 160, + gray: 160, + neptune: 180, + crisp: 180, + 'neptune-touch': 220, + 'crisp-touch': 220 + }, + labelWidth = { + classic: 40, + gray: 40, + neptune: 45, + crisp: 45, + 'neptune-touch': 55, + 'crisp-touch': 55 + }, + defaultQueryString, src, theme, rtl, toolbar; + + while (i--) { + src = scriptTags[i].src; + if (src.indexOf('include-ext.js') !== -1) { + defaultQueryString = src.split('?')[1]; + if (defaultQueryString) { + defaultTheme = getQueryParam('theme', defaultQueryString) || defaultTheme; + defaultRtl = getQueryParam('rtl', defaultQueryString) || defaultRtl; + } + break; + } + } + + Ext.themeName = theme = getQueryParam('theme') || defaultTheme; + + rtl = getQueryParam('rtl') || defaultRtl; + + if (rtl.toString() === 'true') { + requires.unshift('Ext.rtl.*'); + Ext.define('Ext.examples.RtlComponent', { + override: 'Ext.Component', + rtl: true + }); + } + + Ext.require(requires); + + Ext.onReady(function() { + Ext.getBody().addCls(Ext.baseCSSPrefix + 'theme-' + Ext.themeName); + + // prevent touchmove from panning the viewport in mobile safari + if (Ext.supports.TouchEvents) { + Ext.getDoc().on({ + touchmove: function(e) { + // If within a scroller, don't let the document use it + if (Ext.scroll.Scroller.isTouching) { + e.preventDefault(); + } + }, + translate: false, + delegated: false + }); + } + + if (hasOption('nocss3')) { + Ext.supports.CSS3BorderRadius = false; + Ext.getBody().addCls('x-nbr x-nlg'); + } + + if (hasOption('nlg')) { + Ext.getBody().addCls('x-nlg'); + } + + function setParam(param) { + var queryString = Ext.Object.toQueryString( + Ext.apply(Ext.Object.fromQueryString(location.search), param) + ); + location.search = queryString; + } + + function removeParam(paramName) { + var params = Ext.Object.fromQueryString(location.search); + + delete params[paramName]; + + location.search = Ext.Object.toQueryString(params); + } + + setTimeout(function() { + var v = getQueryParam('extjs') ? getQueryParam('extjs') : '5.1.0', + extJs5Themes = [ + { value: 'neptune', name: 'Neptune' }, + { value: 'neptune-touch', name: 'Neptune Touch' }, + { value: 'crisp', name: 'Crisp' }, + { value: 'crisp-touch', name: 'Crisp Touch' }, + { value: 'classic', name: 'Classic' }, + { value: 'gray', name: 'Gray' } + ], + extJs4Themes= [ + { value: 'neptune', name: 'Neptune' }, + { value: 'access', name: 'Accessibility' }, + { value: 'classic', name: 'Classic' }, + { value: 'gray', name: 'Gray' } + ]; + + toolbar = Ext.widget({ + xtype: 'toolbar', + border: true, + rtl: false, + id: 'options-toolbar', + floating: true, + fixed: true, + preventFocusOnActivate: true, + draggable: { + constrain: true + }, + defaults : { rtl : false }, + items: [{ + xtype: 'combo', + width: comboWidth[Ext.themeName], + labelWidth: labelWidth[Ext.themeName], + fieldLabel: 'Theme', + displayField: 'name', + valueField: 'value', + labelStyle: 'cursor:move;', + margin: '0 5 0 0', + store: Ext.create('Ext.data.Store', { + fields: ['value', 'name'], + data : (v[0] == 4) ? extJs4Themes : extJs5Themes + }), + value: theme, + listeners: { + select: function(combo) { + var theme = combo.getValue(); + if (theme !== defaultTheme) { + setParam({ theme: theme }); + } else { + removeParam('theme'); + } + } + } + }, { + + /** + * Only visible in repoDevMode and on QA sites + */ + xtype: 'button', + hidden: !(Ext.repoDevMode || location.href.indexOf('qa.sencha.com') !== -1), + enableToggle: true, + pressed: rtl, + text: 'RTL', + margin: '0 5 0 0', + listeners: { + toggle: function(btn, pressed) { + if (pressed) { + setParam({ rtl: true }); + } else { + removeParam('rtl'); + } + } + } + }, { + xtype: 'tool', + type: 'close', + handler: function() { + toolbar.destroy(); + } + }], + + // Extra constraint margins within default constrain region of parentNode + constraintInsets: '0 -' + (Ext.getScrollbarSize().width + 5) + ' 0 0' + }); + toolbar.show(); + toolbar.anchorTo( + document.body, + Ext.optionsToolbarAlign || 'tr-tr', + [-(Ext.getScrollbarSize().width + 5), 0], //adjust for scrollbar offsets + false, //anim + true //monitor scroll + ); + + }, 100); + + }); +})(); diff --git a/examples/overviewmap/overview-generic.html b/examples/overviewmap/overview-generic.html index 97d55901e..b0d3ccd9a 100644 --- a/examples/overviewmap/overview-generic.html +++ b/examples/overviewmap/overview-generic.html @@ -1,43 +1,40 @@ - - GeoExt Simple Overview Example + + GeoExt Simple Overview Example - - - + + + - - - - + + - - - + + - - - - - -
-

GeoExt.OverviewMap Components

-

This example shows how to work with the OverviewMap component. It inherits - from Ext.Component wrapping the OpenLayers Overview control. This means - you can place it in your applications layout as you would any other component. - The example shows the usage of an GeoExt.OverviewMap as an item of a - Ext.panel.Panel inside a vbox layout. The overviews map size is ultimately - determined by the parents dimensions.
- The OverviewMap component has not been configured with a map so it defaults to the - GeoExt.panel.Map guessed at runtime.

-

The js is not minified so it is readable. See - overview-generic.js.

-
- + + + + + +
+

GeoExt.OverviewMap Components

+

This example shows how to work with the OverviewMap component. It inherits + from Ext.Component wrapping the OpenLayers Overview control. This means + you can place it in your applications layout as you would any other component. + The example shows the usage of an GeoExt.OverviewMap as an item of a + Ext.panel.Panel inside a vbox layout. The overviews map size is ultimately + determined by the parents dimensions.
+ The OverviewMap component has not been configured with a map so it defaults to the + GeoExt.panel.Map guessed at runtime.

+

The js is not minified so it is readable. See + overview-generic.js.

+
+ diff --git a/examples/overviewmap/overview.html b/examples/overviewmap/overview.html index 51c71b271..fd885d6e5 100644 --- a/examples/overviewmap/overview.html +++ b/examples/overviewmap/overview.html @@ -1,44 +1,41 @@ - - GeoExt.OverviewMap Example + + GeoExt.OverviewMap Example - - - + + + - - - - + + - - - + + - - - - - -
-

GeoExt.OverviewMap Components

-

This example shows how to work with the OverviewMap component. It inherits - from Ext.Component wrapping the OpenLayers OverviewMap control. This means - you can place it in your applications layout as you would any other component. - The example shows the usage as a floating, resizable component positioned - absolutely above the map. The second GeoExt.OverviewMap has been placed as a - panels item inside a vbox layout, so the components size is determined by - the parents dimensions.
- The floating OverviewMap has been configured as "dynamic" which means it will - update itself to show the bound maps active baselayer.

-

The js is not minified so it is readable. See - overview.js.

-
- + + + + + +
+

GeoExt.OverviewMap Components

+

This example shows how to work with the OverviewMap component. It inherits + from Ext.Component wrapping the OpenLayers OverviewMap control. This means + you can place it in your applications layout as you would any other component. + The example shows the usage as a floating, resizable component positioned + absolutely above the map. The second GeoExt.OverviewMap has been placed as a + panels item inside a vbox layout, so the components size is determined by + the parents dimensions.
+ The floating OverviewMap has been configured as "dynamic" which means it will + update itself to show the bound maps active baselayer.

+

The js is not minified so it is readable. See + overview.js.

+
+ diff --git a/examples/permalink/permalink.html b/examples/permalink/permalink.html index 3e523db3e..64cca2dbd 100644 --- a/examples/permalink/permalink.html +++ b/examples/permalink/permalink.html @@ -1,31 +1,30 @@ - - Permalink Example GeoExt2 + + Permalink Example GeoExt2 - - - + + + - - - - + + - - + + - + + - - -

Permalink

+ + +

Permalink

-

This example shows how to generate permalinks with the current map position and visible layers.

-

The js is not minified so it is readable. See permalink.js.

-
-

Permalink:

- - +

This example shows how to generate permalinks with the current map position and visible layers.

+

The js is not minified so it is readable. See permalink.js.

+
+

Permalink:

+ + diff --git a/examples/permalink/permalink.js b/examples/permalink/permalink.js index ba7502d1d..f4806dae9 100644 --- a/examples/permalink/permalink.js +++ b/examples/permalink/permalink.js @@ -37,7 +37,7 @@ Ext.application({ }); Ext.state.Manager.setProvider(permalinkProvider); - var map = new OpenLayers.Map({}); + var map = new OpenLayers.Map({allOverlays: true, fallThrough: true}); var ol_wms = new OpenLayers.Layer.WMS( "OpenStreetMap WMS", "http://ows.terrestris.de/osm/service?", diff --git a/examples/popup/popup.html b/examples/popup/popup.html index 0e94cfb8d..bbba48498 100644 --- a/examples/popup/popup.html +++ b/examples/popup/popup.html @@ -4,17 +4,12 @@ GeoExt Popup Example - - + + - - - - - diff --git a/examples/popup/popup.js b/examples/popup/popup.js index 813c5f4bc..3f2701396 100644 --- a/examples/popup/popup.js +++ b/examples/popup/popup.js @@ -13,11 +13,17 @@ */ Ext.require([ - 'Ext.Window', // useless in fact, since we're using ext-all.js in the example + 'Ext.Window', 'GeoExt.panel.Map', 'GeoExt.window.Popup' ]); +if(!Ext.isDefined(Ext.DomQuery)) { + // Ext.DomQuery is replaced by Ext.dom.Query when using ExtJS5 + Ext.require('Ext.dom.Query'); +} + + var mapPanel, popup; Ext.onReady(function() { @@ -40,7 +46,8 @@ Ext.onReady(function() { "Lorem ipsum dolor sit amet, consectetuer adipiscing elit."; function createPopup(feature) { - var checkConstrOpt = Ext.DomQuery.select('input[name="constrainOpt"]:checked')[0].value, + var DomQuery = GeoExt.isExt4 ? Ext.DomQuery : Ext.dom.Query, + checkConstrOpt = DomQuery.select('input[name="constrainOpt"]:checked')[0].value, undef, constrainOpts = { constrain: (checkConstrOpt === 'constrain-full') ? true : undef, diff --git a/examples/printextent/print-extent.html b/examples/printextent/print-extent.html index 18a233db8..282bb6432 100644 --- a/examples/printextent/print-extent.html +++ b/examples/printextent/print-extent.html @@ -4,11 +4,9 @@ GeoExt PrintExtent Example - - + + - - @@ -16,9 +14,8 @@ - - + - - + + - - @@ -16,7 +14,6 @@ - - - + + - - @@ -16,7 +14,6 @@ - - - + + - - @@ -16,7 +14,6 @@ - - - + + - - @@ -17,7 +15,7 @@ - +