-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #339 from marcjansen/mergeable-extjs5
Support both ExtJS 4.2.1 and ExtJS 5.1.0
- Loading branch information
Showing
132 changed files
with
3,049 additions
and
1,509 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,4 @@ | ||
language: node_js | ||
node_js: 0.10 | ||
# installs dependencies for testing | ||
install: npm install -g [email protected] | ||
# command to run tests | ||
script: casperjs test tests/headless/run-testsuite.js | ||
node_js: | ||
- node | ||
- iojs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -138,11 +138,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 [email protected] | ||
# 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). | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,20 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>GeoExt2 - Action</title> | ||
<head> | ||
<title>GeoExt2 - Action</title> | ||
|
||
<!-- ExtJS --> | ||
<script type="text/javascript" src="http://cdn.sencha.com/ext/gpl/4.2.1/examples/shared/include-ext.js"></script> | ||
<script type="text/javascript" src="http://cdn.sencha.com/ext/gpl/4.2.1/examples/shared/options-toolbar.js"></script> | ||
<!-- ExtJS --> | ||
<script type="text/javascript" src="../include-ext.js"></script> | ||
<script type="text/javascript" src="../options-toolbar.js"></script> | ||
|
||
<!-- Shared --> | ||
<link rel="stylesheet" type="text/css" href="http://cdn.sencha.com/ext/gpl/4.2.1/examples/shared/example.css" /> | ||
<!-- Basic example styling --> | ||
<link rel="stylesheet" type="text/css" href="../shared/example.css" /> | ||
<!-- Basic example styling --> | ||
<link rel="stylesheet" type="text/css" href="../shared/example.css" /> | ||
|
||
<!-- You should definitely consider using a custom single-file version of OpenLayers --> | ||
<script src="http://openlayers.org/api/2.13.1/OpenLayers.js"></script> | ||
<!-- You should definitely consider using a custom single-file version of OpenLayers --> | ||
<script src="http://openlayers.org/api/2.13.1/OpenLayers.js"></script> | ||
|
||
<script type="text/javascript" src="../loader.js"></script> | ||
<script type="text/javascript" src="mappanel_with_actions.js"></script> | ||
</head> | ||
<body></body> | ||
<script type="text/javascript" src="../loader.js"></script> | ||
<script type="text/javascript" src="mappanel_with_actions.js"></script> | ||
</head> | ||
<body></body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
/** | ||
* Modified from ext-5.0.0/shared/include-ext.js: | ||
* | ||
* * support query parameter 'extjs' | ||
* * default to 'neptune' theme, as this one exists in both v4 and v5 | ||
* * load the debug-variants of the resources | ||
* | ||
* This file includes the required ext-all js and css files based upon "theme" and "rtl" | ||
* url parameters. It first searches for these parameters on the page url, and if they | ||
* are not found there, it looks for them on the script tag src query string. | ||
* For example, to include the neptune flavor of ext from an index page in a subdirectory | ||
* of extjs/examples/: | ||
* <script type="text/javascript" src="../../examples/shared/include-ext.js?theme=neptune"></script> | ||
*/ | ||
(function() { | ||
function getQueryParam(name) { | ||
var regex = RegExp('[?&]' + name + '=([^&]*)'); | ||
|
||
var match = regex.exec(location.search) || regex.exec(path); | ||
return match && decodeURIComponent(match[1]); | ||
} | ||
|
||
function hasOption(opt, queryString) { | ||
var s = queryString || location.search; | ||
var re = new RegExp('(?:^|[&?])' + opt + '(?:[=]([^&]*))?(?:$|[&])', 'i'); | ||
var m = re.exec(s); | ||
|
||
return m ? (m[1] === undefined || m[1] === '' ? true : m[1]) : false; | ||
} | ||
|
||
function getCookieValue(name){ | ||
var cookies = document.cookie.split('; '), | ||
i = cookies.length, | ||
cookie, value; | ||
|
||
while(i--) { | ||
cookie = cookies[i].split('='); | ||
if (cookie[0] === name) { | ||
value = cookie[1]; | ||
} | ||
} | ||
|
||
return value; | ||
} | ||
|
||
var scriptEls = document.getElementsByTagName('script'), | ||
v = getQueryParam('extjs') ? getQueryParam('extjs') : '5.1.0', | ||
basePath = 'http://cdn.sencha.com/ext/gpl/'+ v, | ||
path = (v[0] == 4) ? basePath : basePath + '/build', | ||
rtl = getQueryParam('rtl'), | ||
theme = getQueryParam('theme') || 'neptune', | ||
includeCSS = !hasOption('nocss', path), | ||
hasOverrides = !hasOption('nooverrides', path) && !!{ | ||
// TODO: remove neptune | ||
neptune: 1, | ||
classic: 1, | ||
gray: 1, | ||
'neptune-touch': 1, | ||
crisp: 1, | ||
'crisp-touch': 1 | ||
}[theme], | ||
repoDevMode = getCookieValue('ExtRepoDevMode'), | ||
packagePath, | ||
themePath, | ||
i = 3, | ||
overridePath; | ||
|
||
rtl = rtl && rtl.toString() === 'true'; | ||
|
||
theme = 'ext-theme-' + theme; | ||
packagePath = path + '/packages/' + theme + '/build/'; | ||
themePath = packagePath + 'resources/' + theme + (rtl ? '-all-rtl' : '-all'); | ||
|
||
if (includeCSS) { | ||
document.write('<link rel="stylesheet" type="text/css" href="' + | ||
themePath + '-debug.css"/>'); | ||
} | ||
|
||
document.write('<script type="text/javascript" src="' + path + '/ext-all' + | ||
(rtl ? '-rtl' : '') + '-debug.js"></script>'); | ||
|
||
if (hasOverrides) { | ||
// since document.write('<script>') does not block execution in IE, we need to | ||
// makes sure we prevent ext-theme-neptune.js from executing before ext-all.js | ||
// normally this can be done using the defer attribute on the script tag, however | ||
// this method does not work in IE when in repoDevMode. It seems the reason for | ||
// this is because in repoDevMode ext-all.js is simply a script that loads other | ||
// scripts and so Ext is still undefined when the neptune overrides are executed. | ||
// To work around this we use the _beforereadyhandler hook to load the neptune | ||
// overrides dynamically after Ext has been defined. | ||
overridePath = packagePath + theme + (repoDevMode ? '-debug' : '') + '.js'; | ||
|
||
if (repoDevMode && window.ActiveXObject) { | ||
Ext = { | ||
_beforereadyhandler: function() { | ||
Ext.Loader.loadScript({ url: overridePath }); | ||
} | ||
}; | ||
} else { | ||
document.write('<script type="text/javascript" src="' + | ||
overridePath + '" defer></script>'); | ||
} | ||
} | ||
|
||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.