Removed Camper News completely
This commit is contained in:
@@ -186,75 +186,6 @@ $(document).ready(function() {
|
||||
);
|
||||
});
|
||||
|
||||
function upvoteHandler(e) {
|
||||
e.preventDefault();
|
||||
var upvoteBtn = this;
|
||||
var id = upvoteBtn.id;
|
||||
var upVotes = $(upvoteBtn).data().upVotes;
|
||||
var username = typeof username !== 'undefined' ? username : '';
|
||||
var alreadyUpvoted = false;
|
||||
for (var i = 0; i < upVotes.length; i++) {
|
||||
if (upVotes[i].upVotedBy === username) {
|
||||
alreadyUpvoted = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!alreadyUpvoted) {
|
||||
$.post('/stories/upvote', { id: id })
|
||||
.fail(function() {
|
||||
$(upvoteBtn).bind('click', upvoteHandler);
|
||||
})
|
||||
.done(function(data) {
|
||||
$(upvoteBtn)
|
||||
.text('Upvoted!')
|
||||
.addClass('disabled');
|
||||
|
||||
$('#storyRank').text(data.rank + ' points');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
$('#story-list').on('click', 'button.btn-upvote', upvoteHandler);
|
||||
|
||||
var storySubmitButtonHandler = function storySubmitButtonHandler() {
|
||||
|
||||
if (!$('#story-submission-form')[0].checkValidity()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
var link = $('#story-url').val();
|
||||
var headline = $('#story-title').val();
|
||||
var description = $('#description-box').val();
|
||||
var data = {
|
||||
data: {
|
||||
link: link,
|
||||
headline: headline,
|
||||
timePosted: Date.now(),
|
||||
description: description,
|
||||
storyMetaDescription: main.storyMetaDescription,
|
||||
rank: 1,
|
||||
image: main.storyImage
|
||||
}
|
||||
};
|
||||
|
||||
$('#story-submit').unbind('click');
|
||||
return $.post('/stories/', data)
|
||||
.fail(function() {
|
||||
$('#story-submit').bind('click', storySubmitButtonHandler);
|
||||
})
|
||||
.done(function({ storyLink, isBanned }) {
|
||||
if (isBanned) {
|
||||
window.location = '/news';
|
||||
return null;
|
||||
}
|
||||
window.location = '/stories/' + storyLink;
|
||||
return null;
|
||||
});
|
||||
};
|
||||
|
||||
$('#story-submit').on('click', storySubmitButtonHandler);
|
||||
|
||||
|
||||
// map sharing
|
||||
var alreadyShared = main.getMapShares();
|
||||
|
||||
|
Reference in New Issue
Block a user