Skip to content

Commit 9e90af9

Browse files
author
Matt Priour
committed
Merge pull request #2 from elemoine/multiple-builds
Multiple builds
2 parents ef0da77 + 645e2f4 commit 9e90af9

File tree

5 files changed

+49
-1
lines changed

5 files changed

+49
-1
lines changed

lib/OpenLayers/SingleFile.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ var OpenLayers = {
2525
* {String} Path to this script
2626
*/
2727
_getScriptLocation: (function() {
28-
var r = new RegExp("(^|(.*?\\/))(OpenLayers.*?\.js)(\\?|$)"),
28+
var r = new RegExp("(^|(.*?\\/))(OpenLayers.*?\\.js)(\\?|$)"),
2929
s = document.getElementsByTagName('script'),
3030
src, m, l = "";
3131
for(var i=0, len=s.length; i<len; i++) {

tests/SingleFile1.html

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<html>
2+
<head>
3+
<script src="some/path/OpenLayers.js"></script>
4+
<script src="../lib/OpenLayers/SingleFile.js"></script>
5+
<script type="text/javascript">
6+
function test_OpenLayers(t) {
7+
t.plan(1);
8+
t.eq(OpenLayers._getScriptLocation(), "some/path/",
9+
"Script location correctly detected (OpenLayers.js).");
10+
}
11+
</script>
12+
</head>
13+
<body>
14+
</body>
15+
</html>

tests/SingleFile2.html

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<html>
2+
<head>
3+
<script src="some/path/OpenLayers.light.js"></script>
4+
<script src="../lib/OpenLayers/SingleFile.js"></script>
5+
<script type="text/javascript">
6+
function test_OpenLayers(t) {
7+
t.plan(1);
8+
t.eq(OpenLayers._getScriptLocation(), "some/path/",
9+
"Script location correctly detected (OpenLayers.light.js) .");
10+
}
11+
</script>
12+
</head>
13+
<body>
14+
</body>
15+
</html>

tests/SingleFile3.html

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<html>
2+
<head>
3+
<script src="some/path/OpenLayers.light.debug.js"></script>
4+
<script src="../lib/OpenLayers/SingleFile.js"></script>
5+
<script type="text/javascript">
6+
function test_OpenLayers(t) {
7+
t.plan(1);
8+
t.eq(OpenLayers._getScriptLocation(), "some/path/",
9+
"Script location correctly detected (OpenLayers.light.debug.js).");
10+
}
11+
</script>
12+
</head>
13+
<body>
14+
</body>
15+
</html>

tests/list-tests.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,9 @@
182182
<li>OpenLayers3.html</li>
183183
<li>OpenLayers4.html</li>
184184
<li>OpenLayersJsFiles.html</li>
185+
<li>SingleFile1.html</html>
186+
<li>SingleFile2.html</html>
187+
<li>SingleFile3.html</html>
185188
<li>Popup.html</li>
186189
<li>Popup/Anchored.html</li>
187190
<li>Popup/AnchoredBubble.html</li>

0 commit comments

Comments
 (0)