add the bug, pair and help buttons to challenge views

This commit is contained in:
Quincy Larson
2015-05-24 00:53:01 -07:00
parent 1949005632
commit bf0cf4cc7d
7 changed files with 82 additions and 16 deletions

View File

@@ -24,7 +24,7 @@ $(document).ready(function() {
{
payload: {
code: editorValue,
challenge: currentLocation,
challenge: currentLocation
}
},
function(res) {
@@ -35,6 +35,27 @@ $(document).ready(function() {
);
});
$('#i-want-help-editorless').on('click', function() {
var currentLocation = window.location.href;
$.post(
'/get-help',
{
payload: {
challenge: currentLocation
}
},
function(res) {
if (res) {
window.open('https://freecode.slack.com/messages/help/', '_blank')
}
}
);
});
$('#report-issue').on('click', function() {
window.open('https://github.com/freecodecamp/freecodecamp/issues/new?title=Challenge '+ window.location.href +' has an issue &body=Please%20tell%20us%20in%20detail%20here%20how%20we%20can%20make%20this%20challenge%20better.', '_blank')
});
$('#i-want-to-pair').on('click', function() {
var currentLocation = window.location.href;
$.post(