You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@brooklyn.apache.org by he...@apache.org on 2015/04/08 11:20:18 UTC
[02/19] incubator-brooklyn git commit: - Catalog rearrangement so it
work with jekyll serve without moving files - Include the Navigation menu in
the catalog
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/671fda38/docs/website/learnmore/catalog/common.js
----------------------------------------------------------------------
diff --git a/docs/website/learnmore/catalog/common.js b/docs/website/learnmore/catalog/common.js
deleted file mode 100644
index 8e8a45f..0000000
--- a/docs/website/learnmore/catalog/common.js
+++ /dev/null
@@ -1,94 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-var brooklyn = (function ($, _) {
-
- return {
- findItemOfType: function(items, type) {
- return _.findWhere(items, { type: type });
- },
-
- entityCard: _.template(
- "<a class='plain' data-type='<%= type %>' href='entities/<%= type %>.html'>" +
- "<div class='card'>" +
- "<span class='glyphicon glyphicon-chevron-right'/>" +
- "<div class='name'><%=name%></div>" +
- "<div class='type'><%=type%></div>" +
- "<div class='description'><%=description%></div>" +
- "</div>" +
- "</a>"
- ),
- policyCard: _.template(
- "<a class='plain' data-type='<%= type %>' href='policies/<%= type %>.html'>" +
- "<div class='card'>" +
- "<span class='glyphicon glyphicon-chevron-right'/>" +
- "<div class='name'><%=name%></div>" +
- "<div class='type'><%=type%></div>" +
- "<div class='description'><%=description%></div>" +
- "</div>" +
- "</a>"
- ),
- enricherCard: _.template(
- "<a class='plain' data-type='<%= type %>' href='enrichers/<%= type %>.html'>" +
- "<div class='card'>" +
- "<span class='glyphicon glyphicon-chevron-right'/>" +
- "<div class='name'><%=name%></div>" +
- "<div class='type'><%=type%></div>" +
- "<div class='description'><%=description%></div>" +
- "</div>" +
- "</a>"
- ),
-
- typeSummary: _.template(
- "<div class='summaryLabel'><%=name%></div>" +
- "<div class='summaryType'><%=type%></div>" +
- "<div class='description'><%=description%></div>"
- ),
-
- configKeyCard: _.template(
- "<div class='card configKey'>" +
- "<div class='name'><%=name%></div>" +
- "<dl>" +
- "<dt>description</dt><dd><%=(description||' ')%></dd>" +
- "<dt>value type</dt><dd class='java'><%=(type||' ')%></dd>" +
- "<dt>default value</dt><dd><%=(defaultValue||' ')%></dd>" +
- "</dl>" +
- "</div>"
- ),
- sensorCard: _.template(
- "<div class='card sensor'>" +
- "<div class='name'><%=name%></div>" +
- "<dl>" +
- "<dt>description</dt><dd><%=(description||' ')%></dd>" +
- "<dt>value type</dt><dd class='java'><%=(type||' ')%></dd>" +
- "</dl>" +
- "</div>"
- ),
- effectorCard: _.template(
- "<div class='card effector'>" +
- "<div class='name'><%=name%></div>" +
- "<dl>" +
- "<dt>description</dt><dd><%=(description||' ')%></dd>" +
- "<dt>return type</dt><dd class='java'><%=(returnType||' ')%></dd>" +
- "</dl>" +
- "</div>"
- )
- };
-
-}(jQuery, _));
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/671fda38/docs/website/learnmore/catalog/index.html
----------------------------------------------------------------------
diff --git a/docs/website/learnmore/catalog/index.html b/docs/website/learnmore/catalog/index.html
new file mode 100644
index 0000000..87b8723
--- /dev/null
+++ b/docs/website/learnmore/catalog/index.html
@@ -0,0 +1,150 @@
+---
+layout: base
+title: Catalog
+---
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<head>
+
+ {% include base-head.html %}
+ <link rel="stylesheet" href="{{site.path.style}}/css/catalog_items.css" type="text/css" media="screen"/>
+</head>
+
+
+<body>
+
+{% include topmenu.html %}
+
+
+
+<div id="container">
+ <div id="header">
+ <div id="identity">
+ <a href="https://brooklyn.incubator.apache.org/" rel="home">Brooklyn</a>
+ </div>
+ </div>
+
+ <ul class="nav nav-tabs">
+ <li class="active"><a href="#entities" data-toggle="tab">Entities</a></li>
+ <li><a href="#policies" data-toggle="tab">Policies</a></li>
+ <li><a href="#enrichers" data-toggle="tab">Enrichers</a></li>
+ </ul>
+
+ <div class="tab-content">
+ <div class="tab-pane active" id="entities">
+ <input class="filter form-control" type="text" placeholder="Filter by type, e.g. webapp or nosql">
+ </div>
+ <div class="tab-pane" id="policies">
+ <input class="filter form-control" type="text" placeholder="Filter by type, e.g. ha">
+ </div>
+ <div class="tab-pane" id="enrichers">
+ <input class="filter form-control" type="text" placeholder="Filter by type, e.g. http">
+ </div>
+ <div class="tab-pane" id="locations"></div>
+ <div class="tab-pane" id="locationResolvers"></div>
+ </div>
+</div>
+
+<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js" type="text/javascript"></script>
+<script src="{{site.path.style}}/js/underscore-min.js" type="text/javascript"></script>
+<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
+<script src="libs/js/bloodhound.js" type="text/javascript"></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">
+ if (!String.prototype.trim) {
+ String.prototype.trim = function () {
+ return this.replace(/^\s+|\s+$/g, '');
+ };
+ }
+ var card = function (collection, cardFunction, target) {
+ var cards = _.map(collection, cardFunction);
+ $(target).append(cards.join(""));
+ };
+ var ESCAPE_KEY = 27;
+
+ var filter = function (element) {
+ var $element = $(element),
+ $tab = $element.parent(),
+ kind = $tab.attr("id"),
+ collection = items[kind];
+ if (!collection) {
+ console.warn("Unable to determine type for input", element);
+ return;
+ }
+
+ // Number.MAX_VALUE configures Bloodhound to return all matches.
+ var bloodhound = new Bloodhound({
+ name: kind,
+ local: collection,
+ limit: Number.MAX_VALUE,
+ datumTokenizer: function (d) {
+ return Bloodhound.tokenizers.nonword(d.type);
+ },
+ queryTokenizer: Bloodhound.tokenizers.nonword
+ });
+ bloodhound.initialize();
+
+ // Filter items as input changes
+ var allAnchors = $tab.find("a").map(function (index, a) { return $(a); });
+ var hideAnchorsNotMatchingQuery = function () {
+ var query = $element.val();
+ query = query.trim();
+ if (!query) {
+ $tab.find("a").removeClass("hide");
+ } else {
+ var matchedTypes = {};
+ bloodhound.get(query, function (suggestions) {
+ _.each(suggestions, function (s) {
+ // approximate a set!
+ matchedTypes[s.type] = true;
+ });
+ });
+ _.each(allAnchors, function (a) {
+ if (_.has(matchedTypes, a.data("type"))) {
+ a.removeClass("hide");
+ } else {
+ a.addClass("hide");
+ }
+ });
+ }
+ };
+ $element.on("input", hideAnchorsNotMatchingQuery);
+ // In case page is loaded with text in input, e.g. from back button.
+ hideAnchorsNotMatchingQuery();
+
+ $element.on("keydown", function (e) {
+ if (e.keyCode == ESCAPE_KEY) {
+ $element.val("");
+ hideAnchorsNotMatchingQuery();
+ }
+ });
+ };
+
+ $(document).ready(function () {
+ card(items.entities, brooklyn.entityCard, "#entities");
+ card(items.policies, brooklyn.policyCard, "#policies");
+ card(items.enrichers, brooklyn.enricherCard, "#enrichers");
+ //transformItemAndAddToElement(items.locations, brooklyn.locationCard, "#locations");
+ //items.locationResolvers.forEach(function (element) { $("#locationResolvers").append("<tr><td>" + element + "</td></tr>"); });
+ $("input.filter").each(function (index, element) {
+ filter(element);
+ });
+ });
+</script>
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/671fda38/docs/website/learnmore/catalog/index.md
----------------------------------------------------------------------
diff --git a/docs/website/learnmore/catalog/index.md b/docs/website/learnmore/catalog/index.md
deleted file mode 100644
index 98f8a96..0000000
--- a/docs/website/learnmore/catalog/index.md
+++ /dev/null
@@ -1,131 +0,0 @@
----
-title: Catalog
----
-<html lang="en">
- <head>
- <meta charset="utf-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
- <link rel="stylesheet" href="items.css" type="text/css" media="screen"/>
- <title>Brooklyn Objects</title>
- </head>
-
- <body>
- <div id="container">
- <div id="header">
- <div id="identity">
- <a href="https://brooklyn.incubator.apache.org/" rel="home">Brooklyn</a>
- </div>
- </div>
-
- <ul class="nav nav-tabs">
- <li class="active"><a href="#entities" data-toggle="tab">Entities</a></li>
- <li><a href="#policies" data-toggle="tab">Policies</a></li>
- <li><a href="#enrichers" data-toggle="tab">Enrichers</a></li>
- </ul>
-
- <div class="tab-content">
- <div class="tab-pane active" id="entities">
- <input class="filter form-control" type="text" placeholder="Filter by type, e.g. webapp or nosql">
- </div>
- <div class="tab-pane" id="policies">
- <input class="filter form-control" type="text" placeholder="Filter by type, e.g. ha">
- </div>
- <div class="tab-pane" id="enrichers">
- <input class="filter form-control" type="text" placeholder="Filter by type, e.g. http">
- </div>
- <div class="tab-pane" id="locations"></div>
- <div class="tab-pane" id="locationResolvers"></div>
- </div>
- </div>
-
- <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js" type="text/javascript"></script>
- <script src="../../style/js/underscore-min.js" type="text/javascript"></script>
- <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
- <script src="libs/js/bloodhound.js" type="text/javascript"></script>
- <script src="common.js" type="text/javascript"></script>
- <script src="items.js" type="text/javascript"></script>
- <script type="text/javascript">
- if (!String.prototype.trim) {
- String.prototype.trim = function () {
- return this.replace(/^\s+|\s+$/g, '');
- };
- }
- var card = function (collection, cardFunction, target) {
- var cards = _.map(collection, cardFunction);
- $(target).append(cards.join(""));
- };
- var ESCAPE_KEY = 27;
-
- var filter = function (element) {
- var $element = $(element),
- $tab = $element.parent(),
- kind = $tab.attr("id"),
- collection = items[kind];
- if (!collection) {
- console.warn("Unable to determine type for input", element);
- return;
- }
-
- // Number.MAX_VALUE configures Bloodhound to return all matches.
- var bloodhound = new Bloodhound({
- name: kind,
- local: collection,
- limit: Number.MAX_VALUE,
- datumTokenizer: function (d) {
- return Bloodhound.tokenizers.nonword(d.type);
- },
- queryTokenizer: Bloodhound.tokenizers.nonword
- });
- bloodhound.initialize();
-
- // Filter items as input changes
- var allAnchors = $tab.find("a").map(function (index, a) { return $(a); });
- var hideAnchorsNotMatchingQuery = function () {
- var query = $element.val();
- query = query.trim();
- if (!query) {
- $tab.find("a").removeClass("hide");
- } else {
- var matchedTypes = {};
- bloodhound.get(query, function (suggestions) {
- _.each(suggestions, function (s) {
- // approximate a set!
- matchedTypes[s.type] = true;
- });
- });
- _.each(allAnchors, function (a) {
- if (_.has(matchedTypes, a.data("type"))) {
- a.removeClass("hide");
- } else {
- a.addClass("hide");
- }
- });
- }
- };
- $element.on("input", hideAnchorsNotMatchingQuery);
- // In case page is loaded with text in input, e.g. from back button.
- hideAnchorsNotMatchingQuery();
-
- $element.on("keydown", function (e) {
- if (e.keyCode == ESCAPE_KEY) {
- $element.val("");
- hideAnchorsNotMatchingQuery();
- }
- });
- };
-
- $(document).ready(function () {
- card(items.entities, brooklyn.entityCard, "#entities");
- card(items.policies, brooklyn.policyCard, "#policies");
- card(items.enrichers, brooklyn.enricherCard, "#enrichers");
- //transformItemAndAddToElement(items.locations, brooklyn.locationCard, "#locations");
- //items.locationResolvers.forEach(function (element) { $("#locationResolvers").append("<tr><td>" + element + "</td></tr>"); });
- $("input.filter").each(function (index, element) {
- filter(element);
- });
- });
- </script>
- </body>
-</html>
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/671fda38/docs/website/learnmore/catalog/items.css
----------------------------------------------------------------------
diff --git a/docs/website/learnmore/catalog/items.css b/docs/website/learnmore/catalog/items.css
deleted file mode 100644
index a0bf0f0..0000000
--- a/docs/website/learnmore/catalog/items.css
+++ /dev/null
@@ -1,153 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
-*/
-/* landing page */
-body {
- margin: 0px;
- padding: 10px 0px 20px 0px;
- font-family: arial, helvetica, sans-serif;
- background-color: #ffffff;
- color: #393939;
- font-size: 15px;
-}
-
-.nav-tabs {
- clear: both;
- font-weight: bold;
- font-size: 12pt;
-}
-.nav-tabs a {
- color: #4d9d3a;
-}
-.nav-tabs a:hover {
- color: #4d9d3a;
-}
-
-.tab-content {
- padding: 20px;
- padding-bottom: 10px;
- border: 1px solid #ddd;
- border-top: none;
-}
-
-a:hover > .card {
- top: -2px;
- background-color: #f4f4f4;
- box-shadow: 0px 2px 2px 0px rgba(0, 0, 0, 0.2);
-}
-.card {
- position: relative;
- padding: 12px;
- background-color: #f8f8f8;
- color: #333;
- border: 1px solid #E1E1E8;
- border-radius: 6px;
- font-size: 11pt;
-}
-.card,
-.filter {
- margin-bottom: 10px;
-}
-a .glyphicon {
- display: block;
- position: absolute;
- right: 0;
- top: 0;
- padding: 8px;
- font-size: 16pt;
- color: #aaa;
-}
-a:hover .glyphicon {
- color: #888;
-}
-a.plain {
- text-decoration: none !important;
-}
-.name {
- font-size: 12pt;
- font-weight: bold;
-}
-.type {
- font-family: monospace;
- color: #888;
- margin-top: 2px;
-}
-#summary .description {
- margin: 15px 0 25px 0;
-}
-.card .description {
- margin: 10px 40px 0 20px;
-}
-
-#summary {
- clear: both;
- margin: 10px 0 20px 0;
-}
-.summaryLabel {
- font-size: 20px;
- font-weight: bold;
-}
-.summaryType {
- font-family: monospace;
- font-size: 12pt;
- color: #888;
-}
-.java {
- font-family: monospace;
-}
-
-.card dl {
- margin-bottom: 0;
- margin-top: 5px;
-}
-dt {
- clear: both;
- float: left;
- width: 8em;
- text-align: right;
- font-weight: normal;
-}
-dd {
- margin-left: 9em;
-}
-
-#container {
- width: 980px;
- padding: 0;
- margin: 0 auto;
-}
-
-#identity {
- float: left;
- margin: 0;
- padding: 30px 0 15px 10px;
-}
-
-#identity a {
- text-decoration: none;
- display: block;
- margin: 0;
- color: #4d9d3a;
- font-size: 2.5em;
- padding: 0;
- background: transparent url(images/brooklyn.gif) no-repeat 0 0;
- width: 206px;
- height: 44px;
- text-indent: -1000px;
- overflow: hidden;
-}