Temp fix for buttons on modals and bonfires exec on load
This commit is contained in:
@ -388,3 +388,7 @@ var resetEditor = function resetEditor() {
|
|||||||
editor.setValue(allSeeds);
|
editor.setValue(allSeeds);
|
||||||
codeStorage.updateStorage();
|
codeStorage.updateStorage();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
$(document).ready(function(){
|
||||||
|
bonfireExecute();
|
||||||
|
});
|
||||||
|
@ -22,67 +22,6 @@ $(document).ready(function() {
|
|||||||
|
|
||||||
setCSRFToken($('meta[name="csrf-token"]').attr('content'));
|
setCSRFToken($('meta[name="csrf-token"]').attr('content'));
|
||||||
|
|
||||||
$('#i-want-help').on('click', function() {
|
|
||||||
$('#help-modal').modal('hide');
|
|
||||||
var editorValue = editor.getValue();
|
|
||||||
var currentLocation = window.location.href;
|
|
||||||
$.post(
|
|
||||||
'/get-help',
|
|
||||||
{
|
|
||||||
payload: {
|
|
||||||
code: editorValue,
|
|
||||||
challenge: currentLocation
|
|
||||||
}
|
|
||||||
},
|
|
||||||
function(res) {
|
|
||||||
if (res) {
|
|
||||||
window.open('https://gitter.im/FreeCodeCamp/Help', '_blank')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
$('#i-want-help-editorless').on('click', function() {
|
|
||||||
$('#help-editorless-modal').modal('hide');
|
|
||||||
var currentLocation = window.location.href;
|
|
||||||
$.post(
|
|
||||||
'/get-help',
|
|
||||||
{
|
|
||||||
payload: {
|
|
||||||
challenge: currentLocation
|
|
||||||
}
|
|
||||||
},
|
|
||||||
function(res) {
|
|
||||||
if (res) {
|
|
||||||
window.open('https://gitter.im/FreeCodeCamp/Help', '_blank')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
$('#report-issue').on('click', function() {
|
|
||||||
$('#issue-modal').modal('hide');
|
|
||||||
window.open('https://github.com/freecodecamp/freecodecamp/issues/new?&body=Challenge '+ window.location.href +' has an issue. Please describe how to reproduce it, and include links to screenshots if possible.', '_blank')
|
|
||||||
});
|
|
||||||
|
|
||||||
$('#i-want-to-pair').on('click', function() {
|
|
||||||
$('#pair-modal').modal('hide');
|
|
||||||
var currentLocation = window.location.href;
|
|
||||||
$.post(
|
|
||||||
'/get-pair',
|
|
||||||
{
|
|
||||||
payload: {
|
|
||||||
challenge: currentLocation
|
|
||||||
}
|
|
||||||
},
|
|
||||||
function(res) {
|
|
||||||
if (res) {
|
|
||||||
window.open('https://gitter.im/FreeCodeCamp/LetsPair', '_blank')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
$('.checklist-element').each(function() {
|
$('.checklist-element').each(function() {
|
||||||
var checklistElementId = $(this).attr('id');
|
var checklistElementId = $(this).attr('id');
|
||||||
if(!!localStorage[checklistElementId]) {
|
if(!!localStorage[checklistElementId]) {
|
||||||
@ -118,41 +57,126 @@ $(document).ready(function() {
|
|||||||
$(this).unbind("error").attr("src", "https://s3.amazonaws.com/freecodecamp/camper-image-placeholder.png");
|
$(this).unbind("error").attr("src", "https://s3.amazonaws.com/freecodecamp/camper-image-placeholder.png");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function reBindModals(){
|
||||||
|
|
||||||
|
$('#i-want-help').unbind('click');
|
||||||
|
$('#i-want-help').on('click', function() {
|
||||||
|
$('#help-modal').modal('hide');
|
||||||
|
var editorValue = editor.getValue();
|
||||||
|
var currentLocation = window.location.href;
|
||||||
|
$.post(
|
||||||
|
'/get-help',
|
||||||
|
{
|
||||||
|
payload: {
|
||||||
|
code: editorValue,
|
||||||
|
challenge: currentLocation
|
||||||
|
}
|
||||||
|
},
|
||||||
|
function(res) {
|
||||||
|
if (res) {
|
||||||
|
window.open('https://gitter.im/FreeCodeCamp/Help', '_blank')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#i-want-help-editorless').unbind('click');
|
||||||
|
$('#i-want-help-editorless').on('click', function() {
|
||||||
|
$('#help-editorless-modal').modal('hide');
|
||||||
|
var currentLocation = window.location.href;
|
||||||
|
$.post(
|
||||||
|
'/get-help',
|
||||||
|
{
|
||||||
|
payload: {
|
||||||
|
challenge: currentLocation
|
||||||
|
}
|
||||||
|
},
|
||||||
|
function(res) {
|
||||||
|
if (res) {
|
||||||
|
window.open('https://gitter.im/FreeCodeCamp/Help', '_blank')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#report-issue').unbind('click');
|
||||||
|
$('#report-issue').on('click', function() {
|
||||||
|
$('#issue-modal').modal('hide');
|
||||||
|
window.open('https://github.com/freecodecamp/freecodecamp/issues/new?&body=Challenge '+ window.location.href +' has an issue. Please describe how to reproduce it, and include links to screenshots if possible.', '_blank')
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#i-want-help').unbind('click');
|
||||||
|
$('#i-want-to-pair').on('click', function() {
|
||||||
|
$('#pair-modal').modal('hide');
|
||||||
|
var currentLocation = window.location.href;
|
||||||
|
$.post(
|
||||||
|
'/get-pair',
|
||||||
|
{
|
||||||
|
payload: {
|
||||||
|
challenge: currentLocation
|
||||||
|
}
|
||||||
|
},
|
||||||
|
function(res) {
|
||||||
|
if (res) {
|
||||||
|
window.open('https://gitter.im/FreeCodeCamp/LetsPair', '_blank')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#completed-courseware').unbind('click');
|
||||||
$('#completed-courseware').on('click', function() {
|
$('#completed-courseware').on('click', function() {
|
||||||
$('#complete-courseware-dialog').modal('show');
|
$('#complete-courseware-dialog').modal('show');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$('#completed-courseware-editorless').unbind('click');
|
||||||
$('#completed-courseware-editorless').on('click', function() {
|
$('#completed-courseware-editorless').on('click', function() {
|
||||||
$('#complete-courseware-editorless-dialog').modal('show');
|
$('#complete-courseware-editorless-dialog').modal('show');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$('#trigger-pair-modal').unbind('click');
|
||||||
$('#trigger-pair-modal').on('click', function() {
|
$('#trigger-pair-modal').on('click', function() {
|
||||||
$('#pair-modal').modal('show');
|
$('#pair-modal').modal('show');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$('#trigger-reset-modal').unbind('click');
|
||||||
$('#trigger-reset-modal').on('click', function() {
|
$('#trigger-reset-modal').on('click', function() {
|
||||||
$('#reset-modal').modal('show');
|
$('#reset-modal').modal('show');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$('#trigger-help-modal').unbind('click');
|
||||||
$('#trigger-help-modal').on('click', function() {
|
$('#trigger-help-modal').on('click', function() {
|
||||||
$('#help-modal').modal('show');
|
$('#help-modal').modal('show');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$('#trigger-issue-modal').unbind('click');
|
||||||
$('#trigger-issue-modal').on('click', function() {
|
$('#trigger-issue-modal').on('click', function() {
|
||||||
$('#issue-modal').modal('show');
|
$('#issue-modal').modal('show');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$('#completed-zipline-or-basejump').unbind('click');
|
||||||
$('#completed-zipline-or-basejump').on('click', function() {
|
$('#completed-zipline-or-basejump').on('click', function() {
|
||||||
$('#complete-zipline-or-basejump-dialog').modal('show');
|
$('#complete-zipline-or-basejump-dialog').modal('show');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$('#completed-courseware-dialog').unbind('click');
|
||||||
$('#complete-courseware-dialog').on('hidden.bs.modal', function() {
|
$('#complete-courseware-dialog').on('hidden.bs.modal', function() {
|
||||||
editor.focus();
|
editor.focus();
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#complete-challenge-dialog').on('hidden.bs.modal', function() {
|
$('#completed-zipline-or-basejump').unbind('click');
|
||||||
|
$('#complete-zipline-or-basejump').on('hidden.bs.modal', function() {
|
||||||
editor.focus();
|
editor.focus();
|
||||||
});
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$(window).resize(function(){
|
||||||
|
reBindModals();
|
||||||
|
});
|
||||||
|
|
||||||
|
reBindModals();
|
||||||
|
|
||||||
var challengeTypes = {
|
var challengeTypes = {
|
||||||
'HTML_CSS_JQ': '0',
|
'HTML_CSS_JQ': '0',
|
||||||
|
@ -34,7 +34,7 @@
|
|||||||
| .
|
| .
|
||||||
h3 If you've already read the errors and searched Google, you should ask for help.
|
h3 If you've already read the errors and searched Google, you should ask for help.
|
||||||
h3 This will take you to our help room.
|
h3 This will take you to our help room.
|
||||||
a.btn.btn-lg.btn-primary.btn-block(href='https://gitter.im/FreeCodeCamp/LetsPair', data-dismiss='modal', aria-hidden='true' target='_blank') Take me to the help room
|
a.btn.btn-lg.btn-primary.btn-block(href='https://gitter.im/FreeCodeCamp/help', data-dismiss='modal', aria-hidden='true' target='_blank') Take me to the help room
|
||||||
a.btn.btn-lg.btn-info.btn-block(href='#', data-dismiss='modal', aria-hidden='true') Cancel
|
a.btn.btn-lg.btn-info.btn-block(href='#', data-dismiss='modal', aria-hidden='true') Cancel
|
||||||
|
|
||||||
#reset-modal.modal(tabindex='-1')
|
#reset-modal.modal(tabindex='-1')
|
||||||
|
Reference in New Issue
Block a user