Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

added javascripts in portal_javascript registry

  • Loading branch information...
commit 52a47274fe6cf87a927d54f9c5757aeaf9337b6d 1 parent 7493dd1
@gborelli gborelli authored
View
11 README.rst
@@ -3,6 +3,13 @@ Introduction
collective.geo.openlayers enables `Openlayers`_ machinery into Plone.
+This package registers two javascript files into Plone javascript registry:
+
+1. OpenLayers.js
+2. proj4js-compressed.js
+
+
+
.. image:: https://secure.travis-ci.org/collective/collective.geo.openlayers.png
:target: http://travis-ci.org/collective/collective.geo.openlayers
@@ -31,7 +38,6 @@ by having a buildout configuration such as: ::
Install this product from the Plone control panel.
-
Integration example
===================
@@ -50,9 +56,6 @@ other `openlayers examples`_)::
portal_state context/@@plone_portal_state;
portal_url portal_state/portal_url" />
<metal:block metal:fill-slot="javascript_head_slot">
- <script type="text/javascript"
- tal:attributes="src string:$portal_url/OpenLayers.js"></script>
-
<!-- optional openlayers translation -->
<script type="text/javascript"
tal:attributes="src string:$portal_url/lang/de.js"></script>
View
4 collective/geo/openlayers/README.txt
@@ -15,10 +15,6 @@ the @@openlayers view must contain a div wrapper for a map
>>> '<div id="map" ' in browser.contents
True
-openlayers javascript
- >>> '<script type="text/javascript" src="http://nohost/plone/OpenLayers.js"></script>' in browser.contents
- True
-
Now, check to make sure the CSS files from OpenLayers are accessible. This causes issues if for the client if they can't be found (eg when the directories aren't registered)
View
20 collective/geo/openlayers/profiles/default/jsregistry.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0"?>
+<object name="portal_javascripts">
+ <javascript
+ cacheable="True"
+ compression="safe"
+ cookable="True"
+ enabled="True"
+ expression=""
+ id="OpenLayers.js"
+ inline="False" />
+ <javascript
+ cacheable="True"
+ compression="safe"
+ cookable="True"
+ enabled="True"
+ expression=""
+ id="proj4js-compressed.js"
+ inline="False" />
+
+</object>
View
2  collective/geo/openlayers/tests/openlayers_test.pt
@@ -17,8 +17,6 @@
</metal:block>
<metal:block metal:fill-slot="javascript_head_slot">
- <script type="text/javascript"
- tal:attributes="src string:$portal_url/OpenLayers.js"></script>
<script type="text/javascript">
<!--
var map;
View
12 collective/geo/openlayers/tests/test_setup.py
@@ -63,6 +63,18 @@ def test_resource_openlayerscss(self):
self.get_resource('++resource++geo-openlayers.css')
)
+ def test_javascript_resources(self):
+ pjs = getToolByName(self.portal, 'portal_javascripts')
+ resources = [
+ ("OpenLayers.js", True),
+ ("proj4js-compressed.js", True)
+ ]
+
+ for id_, enabled in resources:
+ res = pjs.getResource(id_)
+ self.assertIsNotNone(res)
+ self.assertEqual(enabled, res.getEnabled())
+
def test_suite():
suite = unittest.TestSuite()
View
2  docs/HISTORY.txt
@@ -4,7 +4,7 @@ Changelog
2.6 (unreleased)
----------------
-- Nothing changed yet.
+- added javascripts in portal_javascript registry [gborelli]
2.5 (2013-01-28)
Please sign in to comment.
Something went wrong with that request. Please try again.