From dbc57dd0cb0f32f47b7a66a0d65dcf935b520796 Mon Sep 17 00:00:00 2001 From: "A. Drake" Date: Mon, 23 Mar 2015 23:55:24 -0400 Subject: [PATCH] links iterated through on the page. TODO formatting and adding more data. --- controllers/bonfire.js | 1 + seed_data/bonfireMDNlinks.js | 14 ++++++++------ views/bonfire/show.jade | 7 ++++--- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/controllers/bonfire.js b/controllers/bonfire.js index e600375752..2615b5845b 100644 --- a/controllers/bonfire.js +++ b/controllers/bonfire.js @@ -112,6 +112,7 @@ exports.returnIndividualBonfire = function(req, res, next) { compliment: resources.randomCompliment(), bonfires: bonfire, bonfireHash: bonfire._id, + MDNkeys: bonfire.MDNlinks, MDNlinks: getMDNlinks(bonfire.MDNlinks) }); diff --git a/seed_data/bonfireMDNlinks.js b/seed_data/bonfireMDNlinks.js index 9d80585185..1bec840ac9 100644 --- a/seed_data/bonfireMDNlinks.js +++ b/seed_data/bonfireMDNlinks.js @@ -2,21 +2,23 @@ /* These links are for Bonfires. Each key/value pair is used to render a Bonfire with approrpiate links. Making an effort to keep methods in alphabetical order will help others behind you. + + The text of the key is what the link text will be, e.g. Global Array Object */ var links = { // ========= GLOBAL OBJECTS - "Array-global" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", - "Object-global" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object", - "String-global" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", + "Global Array Object" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", + "Global Object" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object", + "Global String Object" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", // ======== STRING METHODS - "string-split" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split", + "String.split()" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split", // ======== ARRAY METHODS - "array-join" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/join", - "array-reverse": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reverse" + "Array.join()" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/join", + "Array.reverse()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reverse" }; module.exports = links; diff --git a/views/bonfire/show.jade b/views/bonfire/show.jade index 007caa6fc5..96c573a84a 100644 --- a/views/bonfire/show.jade +++ b/views/bonfire/show.jade @@ -66,8 +66,8 @@ block content .bonfire-instructions p= brief #brief-instructions - #more-info.btn.btn-primary.btn-block.btn-primary-ghost - span.ion-arrow-down-b + #more-info.btn.btn-primary.btn-block.btn-primary-ghost + span.ion-arrow-down-b | More information #long-instructions.row.hide .col-xs-12 @@ -76,6 +76,7 @@ block content #less-info.btn.btn-primary.btn-block.btn-primary-ghost span.ion-arrow-up-b | Less information + #submitButton.btn.btn-primary.btn-big.btn-block Run code (ctrl + enter) br form.code @@ -92,7 +93,7 @@ block content var started = Math.floor(Date.now() / 1000); var _ = R; var dashed = !{JSON.stringify(dashedName)}; - var MDNlinks = !{JSON.stringify(MDNlinks)}; + .col-xs-12.col-sm-12.col-md-8 #mainEditorPanel form.code