Commit 94eb66ce authored by Cédric Le Ninivin's avatar Cédric Le Ninivin

Fix links on home page

parent a824d34e
...@@ -5,6 +5,12 @@ ...@@ -5,6 +5,12 @@
<meta http-equiv="Content-type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, user-scalable=no" /> <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_cribjs_home.js" type="text/javascript"></script>
<title>CribJS Header</title> <title>CribJS Header</title>
</head> </head>
...@@ -18,10 +24,10 @@ ...@@ -18,10 +24,10 @@
See how it is made, modify it, improve it. See how it is made, modify it, improve it.
Start developping your own way. Feel free to make this place your own crib.</p> Start developping your own way. Feel free to make this place your own crib.</p>
<ul> <ul>
<li>1. Browse the <a href="#view=url_list">list of URLs</a> you wish to edit</li> <li>1. Browse the <a class="url_list" href="#page=url_list">list of URLs</a> you wish to edit</li>
<li>2. Edit and add files in your <a href="#view=editor">Editor</a></li> <li>2. Edit and add files in your <a class="editor" href="#page=editor">Editor</a></li>
<li>3. <a href="#view=save_load">Export and Import</a> your copy of the web locally and remotly</li> <li>3. <a class="save_load" href="#page=save_load">Export and Import</a> your copy of the web locally and remotly</li>
<li>4. <a href="#view=mass_remove">Remove</a> uncessary URLs</li> <li>4. <a class="mass_remove" href="#page=mass_remove">Remove</a> uncessary URLs</li>
</ul> </ul>
<p>Have fun building the web :), here is your <a href="../crib-editor/todo.txt">TODO list</a>.</p> <p>Have fun building the web :), here is your <a href="../crib-editor/todo.txt">TODO list</a>.</p>
</div> </div>
......
/*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) {
g.props = {};
return g.getElement()
.push(function (element) {
g.props.element = element;
});
})
//////////////////////////////////////////////
// acquired methods
//////////////////////////////////////////////
.declareAcquiredMethod("getUrlFor", "getUrlFor")
.declareMethod('render', function (options) {
var gadget = this,
page_list = ["url_list", "editor", "save_load", "mass_remove"],
promise_list = [];
page_list.forEach(function (page) {
promise_list.push(gadget.getUrlFor({page: page}))
})
// Handle main title
return new RSVP.Queue()
.push(function () {
return RSVP.all(promise_list);
})
.push(function (link_list) {
for (var i = 0; i < link_list.length; i++) {
gadget.props.element.querySelector("." + page_list[i]).href = link_list[i]
}
});
})
}(window, rJS, document, RSVP));
\ No newline at end of file
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