improve the tweet button functionality for both bonfire and challenges

This commit is contained in:
Michael Q Larson
2015-01-28 21:00:14 -08:00
parent 0739934c50
commit 2f59dd5e5b
4 changed files with 30 additions and 40 deletions

View File

@ -85,9 +85,9 @@ exports.returnNextBonfire = function(req, res, next) {
}; };
exports.returnIndividualBonfire = function(req, res, next) { exports.returnIndividualBonfire = function(req, res, next) {
var bonfireName = req.params.bonfireName; var dashedName = req.params.bonfireName;
bonfireName = bonfireName.replace(/\-/g, ' '); bonfireName = dashedName.replace(/\-/g, ' ');
var bonfireNumber = 0; var bonfireNumber = 0;
Bonfire.find({"name" : new RegExp(bonfireName, 'i')}, function(err, bonfire) { Bonfire.find({"name" : new RegExp(bonfireName, 'i')}, function(err, bonfire) {
@ -103,6 +103,7 @@ exports.returnIndividualBonfire = function(req, res, next) {
res.render('bonfire/show', { res.render('bonfire/show', {
completedWith: null, completedWith: null,
title: bonfire[bonfireNumber].name, title: bonfire[bonfireNumber].name,
dashedName: dashedName,
name: bonfire[bonfireNumber].name, name: bonfire[bonfireNumber].name,
difficulty: Math.floor(+bonfire[bonfireNumber].difficulty), difficulty: Math.floor(+bonfire[bonfireNumber].difficulty),
brief: bonfire[bonfireNumber].description[0], brief: bonfire[bonfireNumber].description[0],

View File

@ -149,47 +149,31 @@
"aced", "aced",
"nailed", "nailed",
"rocked", "rocked",
"scorched",
"devastated",
"destroyed", "destroyed",
"owned", "owned",
"crushed", "crushed",
"conquered", "conquered",
"killed",
"shredded", "shredded",
"annihilated",
"nuked",
"smashed",
"decimated",
"demolished", "demolished",
"devoured", "devoured",
"pulvarized",
"banished", "banished",
"throttled", "wrangled"
"blew away",
"roundhoused",
"tangoed",
"wrangled",
"shot down",
"scarfed",
"grappled",
"incinerated"
], ],
"compliments": [ "compliments": [
"You've got the power!", "Over the top!",
"Nicely done!", "Down the rabbit hole we go!",
"Rock and roll!", "Somewhere over the rainbow!",
"High five!", "Eye of the tiger!",
"Bravo!", "Run, Forest, run!",
"Yes!", "Welcome to the Rock!",
"Swoosh!", "Bring that rain!",
"There is no try", "Target acquired!",
"Done and done!", "Feel that need for speed!",
"You make this look easy", "You've got guts!",
"Terminated",
"We have liftoff!", "We have liftoff!",
"To infinity and beyond!", "To infinity and beyond!",
"Encore!", "Encore!",
"Onward, ho!",
"Challenge destroyed!", "Challenge destroyed!",
"Power level 9000!", "Power level 9000!",
"Most efficient!", "Most efficient!",
@ -197,15 +181,15 @@
"You've got the touch!", "You've got the touch!",
"You're on fire!", "You're on fire!",
"Don't hurt 'em, Hammer!", "Don't hurt 'em, Hammer!",
"The town is now red", "The town is now red!",
"To the nines!", "To the nines!",
"Nothing but net!", "Nothing but net!",
"Grumpy cat approves", "Grumpy cat approves!",
"The world rejoices", "The world rejoices!",
"That's the way it's done!", "That's the way it's done!",
"You rock!", "You rock!",
"Woo-hoo!", "Woo-hoo!",
"We knew you could do it", "We knew you could do it!",
"Hyper Combo Finish!", "Hyper Combo Finish!",
"Nothing but net!", "Nothing but net!",
"Boom-shakalaka!", "Boom-shakalaka!",
@ -216,17 +200,22 @@
"Walk on that sunshine!", "Walk on that sunshine!",
"Keep on trucking!", "Keep on trucking!",
"Off the charts!", "Off the charts!",
"There is no spoon", "There is no spoon!",
"Cranked it up to 11!", "Cranked it up to 11!",
"Escape velocity reached!", "Escape velocity reached!",
"You make this look easy!", "You make this look easy!",
"Passed with flying colors!", "Passed with flying colors!",
"One step closer...",
"You've got this!", "You've got this!",
"Happy happy joy joy!", "Happy, happy, joy, joy!",
"Tomorrow, the world!", "Tomorrow, the world!",
"Your powers combined!",
"A winner is you!",
"It's alive. It's alive!",
"Sonic Boom!",
"Here's looking at you, Code!", "Here's looking at you, Code!",
"It's alive. It's alive!" "The more you code!",
"Legen - wait for it - dary!",
"Ludicrous Speed! Go!"
], ],
"phrases": [ "phrases": [
"Shout it from on top of a mountain", "Shout it from on top of a mountain",

View File

@ -125,7 +125,7 @@ block content
- if (points && points > 2) - if (points && points > 2)
a.animated.fadeIn.btn.btn-lg.btn-block.btn-twitter(href="https://twitter.com/intent/tweet?text=I%20just%20#{verb}%20%40FreeCodeCamp%20Challenge%20%23#{number}:%20#{name}&url=http%3A%2F%2Ffreecodecamp.com/bonfires/#{number}&hashtags=learntocode, javascript" target="_blank") a.animated.fadeIn.btn.btn-lg.btn-block.btn-twitter(href="https://twitter.com/intent/tweet?text=I%20just%20#{verb}%20%40FreeCodeCamp%20Bonfire:%20#{name}&url=http%3A%2F%2Ffreecodecamp.com/bonfires/#{dashedName}&hashtags=LearnToCode, JavaScript" target="_blank")
i.fa.fa-twitter   i.fa.fa-twitter  
= phrase = phrase
- else - else

View File

@ -28,7 +28,7 @@ block content
- if (cc) - if (cc)
a.animated.fadeIn.btn.btn-lg.btn-primary.btn-block.next-challenge-button(name='_csrf', value=_csrf, aria-hidden='true') Take me to my next challenge a.animated.fadeIn.btn.btn-lg.btn-primary.btn-block.next-challenge-button(name='_csrf', value=_csrf, aria-hidden='true') Take me to my next challenge
- if (points && points > 2) - if (points && points > 2)
a.animated.fadeIn.btn.btn-lg.btn-block.btn-twitter(href="https://twitter.com/intent/tweet?text=I%20just%20#{verb}%20%40FreeCodeCamp%20Challenge%20%23#{number}:%20#{name}&url=http%3A%2F%2Ffreecodecamp.com/challenges/#{number}&hashtags=learntocode, javascript" target="_blank") a.animated.fadeIn.btn.btn-lg.btn-block.btn-twitter(href="https://twitter.com/intent/tweet?text=I%20just%20#{verb}%20%40FreeCodeCamp%20Challenge%20%23#{number}:%20#{name}&url=http%3A%2F%2Ffreecodecamp.com/challenges/#{number}&hashtags=LearnToCode, JavaScript" target="_blank")
i.fa.fa-twitter   i.fa.fa-twitter  
= phrase = phrase
- else - else