Merge remote-tracking branch 'upstream/master' into next-courseware-flow

This commit is contained in:
Nathan Leniz
2015-03-12 00:04:12 +09:00
74 changed files with 6538 additions and 3717 deletions

View File

@@ -1,5 +1,5 @@
$(document).ready(function() {
challengeName = typeof challengeName !== undefined ? challengeName : 'Untitled';
var challengeName = typeof challengeName !== undefined ? challengeName : 'Untitled';
if (challengeName) {
ga('send', 'event', 'Challenge', 'load', challengeName);
}
@@ -149,8 +149,6 @@ $(document).ready(function() {
.done(function (data, textStatus, xhr) {
$('#storyRank').text(data.rank);
});
} else {
console.log('Can\'t upvote because you\'ve already upvoted');
}
};
$('#upvote').on('click', upvoteHandler);
@@ -160,7 +158,6 @@ $(document).ready(function() {
var link = $('#story-url').val();
var headline = $('#story-title').val();
var description = $('#description-box').val();
console.log(link, headline, description);
var userDataForUpvote = {
upVotedBy: user._id,
upVotedByUsername: user.profile.username
@@ -173,7 +170,7 @@ $(document).ready(function() {
headline: headline,
timePosted: Date.now(),
description: description,
storyMetaDescription: storyMetaDescription,
rank: 1,
upVotes: [userDataForUpvote],
author: {
@@ -182,7 +179,7 @@ $(document).ready(function() {
username: user.profile.username
},
comments: [],
image: ''
image: storyImage
}
})
.fail(function (xhr, textStatus, errorThrown) {
@@ -199,7 +196,6 @@ $(document).ready(function() {
var commentSubmitButtonHandler = function commentSubmitButtonHandler() {
$('comment-button').unbind('click');
var data = $('#comment-box').val();
console.log('comment clicked');
$('#comment-button').attr('disabled', 'disabled');
$.post('/stories/comment/',
@@ -341,4 +337,4 @@ profileValidation.directive('uniqueEmail', ['$http', function($http) {
});
}
}
}]);
}]);