Skip to content
This repository has been archived by the owner on Nov 10, 2017. It is now read-only.

Commit

Permalink
Tacked on support for strategies
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom MacWright committed Oct 4, 2009
1 parent 964443d commit 0e0d0b2
Show file tree
Hide file tree
Showing 153 changed files with 22,926 additions and 1,072 deletions.
2 changes: 1 addition & 1 deletion app.yaml
@@ -1,5 +1,5 @@
application: openlayerer
version: 1
version: 2
runtime: python
api_version: 1

Expand Down
35 changes: 27 additions & 8 deletions index.html
Expand Up @@ -70,12 +70,11 @@ <h1>OpenLayerer</h1>
<div class="clearfix" id="version_trunk">
<h2>Trunk</h2>
<form action="/openlayerer" method="POST">
<div class="grid_3">

<input type="hidden" name="version" value="trunk" />
<!-- trunk -->

<fieldset class="grid_3">
<fieldset class="grid_2">
<legend>Layer Types</legend>
{% for layer in trunk.layers %}
<div>
Expand All @@ -85,8 +84,7 @@ <h2>Trunk</h2>
</div>
{% endfor %}
</fieldset>
</div>
<fieldset class="grid_3">
<fieldset class="grid_2">
<legend>Controls</legend>
{% for control in trunk.controls %}
<div>
Expand All @@ -96,7 +94,7 @@ <h2>Trunk</h2>
</div>
{% endfor %}
</fieldset>
<fieldset class="grid_2">
<fieldset class="grid_1">
<legend>Languages</legend>
{% for language in trunk.languages %}
<div>
Expand All @@ -106,6 +104,17 @@ <h2>Trunk</h2>
</div>
{% endfor %}
</fieldset>
<fieldset class="grid_2">
<legend>Strategies</legend>
{% for strategy in trunk.strategies %}
<div>
<input type="checkbox" id="{{ strategy}}" name="strategy" value="{{ strategy }}" />
<label for="{{ strategy }}">{{ strategy|friendly_name }}</label>
<small>[<a href="{{ strategy|trunk_link }}">docs</a>]</small>
</div>
{% endfor %}
</fieldset>

<input class="generate_button" type="submit" value="Generate OpenLayers.js" />
</form>
</div>
Expand All @@ -119,7 +128,7 @@ <h2>Trunk</h2>
<h2>Release 2.8</h2>
<form action="/openlayerer" method="POST">
<input type="hidden" name="version" value="trunk" />
<fieldset class="grid_3">
<fieldset class="grid_2">
<legend>Layer Types</legend>
{% for layer in release_28.layers %}
<div>
Expand All @@ -129,7 +138,7 @@ <h2>Release 2.8</h2>
</div>
{% endfor %}
</fieldset>
<fieldset class="grid_3">
<fieldset class="grid_2">
<legend>Controls</legend>
{% for control in release_28.controls %}
<div>
Expand All @@ -139,7 +148,7 @@ <h2>Release 2.8</h2>
</div>
{% endfor %}
</fieldset>
<fieldset class="grid_2">
<fieldset class="grid_1">
<legend>Languages</legend>
{% for language in release_28.languages %}
<div>
Expand All @@ -149,6 +158,16 @@ <h2>Release 2.8</h2>
</div>
{% endfor %}
</fieldset>
<fieldset class="grid_2">
<legend>Strategies</legend>
{% for strategy in release_28.strategies %}
<div>
<input type="checkbox" id="{{ strategy}}" name="strategy" value="{{ strategy }}" />
<label for="{{ strategy }}">{{ strategy|friendly_name }}</label>
<small>[<a href="{{ strategy|release_28_link }}">docs</a>]</small>
</div>
{% endfor %}
</fieldset>
<input class="generate_button" type="submit" value="Generate OpenLayers.js" />
</form>
</div>
Expand Down
15 changes: 13 additions & 2 deletions main.py
Expand Up @@ -43,6 +43,9 @@ def all_languages(file_path):
def all_formats(file_path):
return re.match("OpenLayers/Format/\w+\.js", file_path) > -1

def all_strategies(file_path):
return re.match("OpenLayers/Strategy/\w+\.js", file_path) > -1

class MainHandler(webapp.RequestHandler):
def get(self):
path = os.path.join(os.path.dirname(__file__), 'index.html')
Expand All @@ -53,12 +56,14 @@ def get(self):
'controls': filter(all_controls, trunk),
'languages': filter(all_languages, trunk),
'formats': filter(all_formats, trunk),
'strategies': filter(all_strategies, trunk),
}
release_28 = {
'layers': filter(all_layers, release_28),
'controls': filter(all_controls, release_28),
'languages': filter(all_languages, release_28),
'formats': filter(all_formats, release_28),
'strategies': filter(all_strategies, release_28),
}
template_values = {
'trunk': trunk, 'release_28': release_28}
Expand All @@ -71,13 +76,19 @@ def post(self):
controls = self.request.get_all('control')
languages = self.request.get_all('language')
version = self.request.get('version')
strategies = self.request.get('strategies')


forceFirst = first
include = controls + layers + languages
include = controls + layers + languages + strategies
config = mergejs.Config(include=include, forceFirst=forceFirst)

merged = mergejs.merge('openlayers_src/%s/lib' % version, config)
try:
merged = mergejs.merge('openlayers_src/%s/lib' % version, config)
except:
self.response.out.write("An error occurred. Currently a single layer, language, or control must be selected, OpenLayerer does not do empty builds yet.")
return

output = file('license.txt').read() + build.minimize(merged)

# Force client to download file
Expand Down
Binary file not shown.
2 changes: 1 addition & 1 deletion openlayers_src/trunk/.svn/all-wcprops
@@ -1,7 +1,7 @@
K 25
svn:wc:ra_dav:version-url
V 31
/!svn/ver/9650/trunk/openlayers
/!svn/ver/9686/trunk/openlayers
END
license.txt
K 25
Expand Down
20 changes: 10 additions & 10 deletions openlayers_src/trunk/.svn/entries
@@ -1,15 +1,15 @@
10

dir
9653
9689
http://svn.openlayers.org/trunk/openlayers
http://svn.openlayers.org



2009-09-10T06:50:45.752417Z
9650
elemoine
2009-09-21T18:22:40.376275Z
9686
crschmidt
has-props


Expand All @@ -32,6 +32,9 @@ dir
art
dir

doc_config
dir

news.txt
file

Expand Down Expand Up @@ -66,10 +69,10 @@ has-props

814

doc_config
build
dir

build
tools
dir

license.txt
Expand Down Expand Up @@ -106,15 +109,12 @@ crschmidt

1860

tools
tests
dir

theme
dir

tests
dir

doc
dir

Expand Down
2 changes: 1 addition & 1 deletion openlayers_src/trunk/apidoc_config/.svn/entries
@@ -1,7 +1,7 @@
10

dir
9653
9689
http://svn.openlayers.org/trunk/openlayers/apidoc_config
http://svn.openlayers.org

Expand Down
2 changes: 1 addition & 1 deletion openlayers_src/trunk/art/.svn/entries
@@ -1,7 +1,7 @@
10

dir
9653
9689
http://svn.openlayers.org/trunk/openlayers/art
http://svn.openlayers.org

Expand Down
2 changes: 1 addition & 1 deletion openlayers_src/trunk/build/.svn/entries
@@ -1,7 +1,7 @@
10

dir
9653
9689
http://svn.openlayers.org/trunk/openlayers/build
http://svn.openlayers.org

Expand Down
2 changes: 1 addition & 1 deletion openlayers_src/trunk/doc/.svn/entries
@@ -1,7 +1,7 @@
10

dir
9653
9689
http://svn.openlayers.org/trunk/openlayers/doc
http://svn.openlayers.org

Expand Down
2 changes: 1 addition & 1 deletion openlayers_src/trunk/doc/licenses/.svn/entries
@@ -1,7 +1,7 @@
10

dir
9653
9689
http://svn.openlayers.org/trunk/openlayers/doc/licenses
http://svn.openlayers.org

Expand Down
2 changes: 1 addition & 1 deletion openlayers_src/trunk/doc_config/.svn/entries
@@ -1,7 +1,7 @@
10

dir
9653
9689
http://svn.openlayers.org/trunk/openlayers/doc_config
http://svn.openlayers.org

Expand Down

0 comments on commit 0e0d0b2

Please sign in to comment.