Commit c819309f authored by Cédric Le Ninivin's avatar Cédric Le Ninivin

Home Page: Add list of apps to easily add and use

parent c4725d69
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, user-scalable=no" />
<!-- renderjs -->
<script src="../lib/rsvp.js" type="text/javascript"></script>
<script src="../lib/renderjs.js" type="text/javascript"></script>
<!-- custom script -->
<script src="./gadget_cribjs_page_app_example_list.js" type="text/javascript"></script>
<title>CribJS Header</title>
</head>
<body>
<div class="nav_content cribjs container">
<h3>Easily add more Applications</h3>
<ul class="list-unstyled">
<li>&#10133; <a class="install-app-link"
data-app-id="helloworld"
data-app-title="Hello World"
data-app-zip-url="https://cribjs.nexedi.net/apps/hello-world-template.zip">
Hello World</a>: A Simple hello World App</li>
<li>&#10133; <a class="install-app-link"
data-app-id="onehtmlpagechallenge"
data-app-title="One HTML Page Challenge"
data-app-zip-url="https://cribjs.nexedi.net/apps/one-html-page-challenge-master.zip">
One HTML Page Challenge</a>:
<a href="https://github.com/Metroxe/one-html-page-challenge">
https://github.com/Metroxe/one-html-page-challenge</a></li>
<li>&#10133; <a class="install-app-link"
data-app-id="html5asteroidsmaster"
data-app-title="OfficeJS Text Editor"
data-app-zip-url="https://cribjs.nexedi.net/apps/HTML5-Asteroids-master.zip">
HTML5 Asteroids Game</a>: <a href="https://github.com/dmcinnes/HTML5-Asteroids">https://github.com/dmcinnes/HTML5-Asteroids</a></li>
<li>&#10133; <a class="install-app-link"
data-app-id="2048"
data-app-title="2048"
data-app-zip-url="https://cribjs.nexedi.net/apps/2048-master.zip">
2048</a>: The game
<a href="https://github.com/gabrielecirulli/2048">https://github.com/gabrielecirulli/2048</a></li>
<li>&#10133; <a class="install-app-link"
data-app-id="officejsappstore"
data-app-title="OfficeJS Appstore"
data-app-zip-url="https://cribjs.nexedi.net/apps/officejs-appstore.zip">
OfficeJS Appstore</a></li>
<li>&#10133; <a class="install-app-link"
data-app-id="officejstexteditor"
data-app-title="OfficeJS Text Editor"
data-app-zip-url="https://cribjs.nexedi.net/apps/officejs-texteditor.zip">
OfficeJS Text Editor</a>: a simple HTML text editor</li>
<li>&#10133; <a class="install-app-link"
data-app-id="officejsimageeditor"
data-app-title="OfficeJS Image Editor"
data-app-zip-url="https://cribjs.nexedi.net/apps/officejs-imageeditor.zip">
OfficeJS Image Editor</a>: a simple image editor</li>
<li>&#10133; <a class="install-app-link"
data-app-id="officejssvgeditor"
data-app-title="OfficeJS SVG Editor"
data-app-zip-url="https://cribjs.nexedi.net/apps/officejs-svgeditor.zip">
OfficeJS SVG Editor</a>: a simple svg editor</li>
<li>&#10133; <a class="install-app-link"
data-app-id="officejspdfreader"
data-app-title="OfficeJS PDF Reader"
data-app-zip-url="https://cribjs.nexedi.net/apps/officejs-pdfreader.zip">
OfficeJS PDF Reader</a>: a simple PDF Reader</li>
<li>&#10133; <a class="install-app-link"
data-app-id="officejsspreadsheet"
data-app-title="OfficeJS Office Spreadsheet"
data-app-zip-url="https://cribjs.nexedi.net/apps/officejs-spreadsheet.zip">
OfficeJS Office Spreadsheet</a>: powerfull spreadsheet tool</li>
<li>&#10133; <a class="install-app-link"
data-app-id="officejssmartasistant"
data-app-title="OfficeJS Smart Assistant"
data-app-zip-url="https://cribjs.nexedi.net/apps/officejs-smartassistant.zip">
OfficeJS Text Editor</a>: a simple HTML text editor</li>
<li>&#10133; <a class="install-app-link"
data-app-id="converse"
data-app-title="ConverseJS"
data-app-zip-url="https://cribjs.nexedi.net/apps/officejs-converse.zip">
Converse JS</a>: Jabber communication</li>
</ul>
</div>
</body>
</html>
\ No newline at end of file
/*jslint nomen: true, indent: 2, maxerr: 3 */
/*global window, rJS, Handlebars, document, loopEventListener, RSVP */
(function (window, rJS, document, RSVP) {
"use strict";
rJS(window)
/////////////////////////////////////////////////////////////////
// ready
/////////////////////////////////////////////////////////////////
// Assign the element to a variable
.ready(function (g) {
var link_list;
g.props = {};
return g.getElement()
.push(function (element) {
var promise_list = [];
link_list = element.querySelectorAll("a.install-app-link");
g.props.element = element;
link_list.forEach(function (link) {
promise_list.push(g.getUrlFor(
{
page: "add_application",
app_name: link.getAttribute("data-app-title"),
app_id: link.getAttribute("data-app-id"),
zip_app_url: link.getAttribute("data-app-zip-url")
}));
});
return RSVP.all(promise_list);
})
.push(function (url_list) {
for (var i = 0; i < link_list.length; i++) {
link_list[i].href = url_list[i];
}
});
})
//////////////////////////////////////////////
// acquired methods
//////////////////////////////////////////////
.declareAcquiredMethod("getUrlFor", "getUrlFor")
.declareMethod('render', function (options) {
});
}(window, rJS, document, RSVP));
\ No newline at end of file
...@@ -35,6 +35,9 @@ ...@@ -35,6 +35,9 @@
<div data-gadget-url="./gadget_cribjs_page_app_list.html" <div data-gadget-url="./gadget_cribjs_page_app_list.html"
data-gadget-scope="app_list" data-gadget-scope="app_list"
data-gadget-sandbox="public"></div> data-gadget-sandbox="public"></div>
<div data-gadget-url="./gadget_cribjs_page_app_example_list.html"
data-gadget-scope="app_example_list"
data-gadget-sandbox="public"></div>
</div> </div>
<div class="nav_content container"> <div class="nav_content container">
<h2>Start Editing this Site In another Crib</h2> <h2>Start Editing this Site In another Crib</h2>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment