brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From henev...@apache.org
Subject [11/19] incubator-brooklyn git commit: Load the catalog items as json resource
Date Wed, 08 Apr 2015 09:20:27 GMT
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/c7900364/docs/website/learnmore/catalog/catalog-item.html
----------------------------------------------------------------------
diff --git a/docs/website/learnmore/catalog/catalog-item.html b/docs/website/learnmore/catalog/catalog-item.html
index 2eaf96b..8eb333f 100644
--- a/docs/website/learnmore/catalog/catalog-item.html
+++ b/docs/website/learnmore/catalog/catalog-item.html
@@ -57,15 +57,22 @@ under the License.
 <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js" type="text/javascript"></script>
 <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
 <script src="{{site.path.style}}/js/catalog/common.js" type="text/javascript"></script>
-<script src="{{site.path.style}}/js/catalog/items.js" type="text/javascript"></script>
 <script type="text/javascript">
   $(document).ready(function () {
-    updateItem();
+    var items_loaded;
 
     $(window).on('hashchange', updateItem);
 
-    function updateItem() {
+    $.getJSON( "{{site.path.style}}/js/catalog/items.json", function( data ) {
+      items_loaded = data;
+      updateItem(data);
+    });
+
+    function updateItem(items) {
       var args, catalog_type;
+      if(!items) {
+        items = items_loaded;
+      }
       args = getArgs();
       if(args.length!=2) {
         alert('bad entity format')


Mime
View raw message