Add url correcting in case user forgets http:// or https:// so url works properly in show view, remove upvote arrows from index view

This commit is contained in:
Nathan Leniz
2015-03-05 19:51:56 +09:00
parent 40a42e29c2
commit 8552a06ac6
2 changed files with 5 additions and 6 deletions

View File

@ -119,10 +119,14 @@ exports.storySubmission = function(req, res, next) {
.replace(/[^a-z0-9]/gi, ' ')
.replace(/\s+/g, ' ')
.toLowerCase();
var link = data.link;
if (link.search(/^https?:\/\//g) === -1) {
link = 'http://' + link;
}
var story = new Story({
headline: data.headline,
timePosted: Date.now(),
link: data.link,
link: link,
description: data.description,
rank: 0,
upVotes: 0,

View File

@ -19,11 +19,6 @@ h3
$(li).html("<div class='row text-left'>" +
"<div class='col-xs-3 col-sm-1'>" +
"<div class='row'>" +
"<div class='col-xs-12 big-ion-up-arrow'>" +
"<i class='ion-arrow-up-b'></i>" +
"</div>" +
"</div>" +
"<div class='story-up-votes'>" +
"<span>" + rank + "</span>" +
"</div>" +