mirror of
https://github.com/neocities/neocities.git
synced 2025-05-16 09:27:20 +02:00
add logic for tutorial requirement
This commit is contained in:
parent
01aab733bb
commit
2ff8365651
9 changed files with 32 additions and 9 deletions
|
@ -31,6 +31,7 @@
|
|||
</div>
|
||||
|
||||
<script>
|
||||
sessionStorage.setItem('tutorialHtml', '')
|
||||
$('#checkButton').on('click', function(button) {
|
||||
checkHomework($('#nameInput').val())
|
||||
})
|
||||
|
|
|
@ -44,6 +44,6 @@
|
|||
}
|
||||
|
||||
sessionStorage.setItem('tutorialHtml', html)
|
||||
ok('Great, you did it!', '/tutorial/html/9')
|
||||
ok('Great, you did it!', '/tutorial/html/9?csrf_token=<%= Rack::Utils.escape csrf_token %>')
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
$('#saveToSite').on('click', function() {
|
||||
$.ajax({
|
||||
url: '/site_files/save/index.html?csrf_token=<%= Rack::Utils.escape csrf_token %>',
|
||||
url: '/site_files/upload?csrf_token=<%= Rack::Utils.escape csrf_token %>&filename=<%= Rack::Utils.escape 'index.html' %>&site_id=<%= current_site.id %>',
|
||||
data: sessionStorage.getItem('tutorialHtml'),
|
||||
processData: false,
|
||||
contentType: false,
|
||||
|
@ -29,11 +29,7 @@
|
|||
alert('There has been an error saving your file, please try again. If it continues to fail, make a copy of the file locally so you don\'t lose your changes!')
|
||||
},
|
||||
success: function(response){
|
||||
if(response == 'ok') {
|
||||
window.location = '/tutorial/html/10'
|
||||
} else {
|
||||
alert('There has been an error saving your file, please try again. If it continues to fail, make a copy of the file locally so you don\'t lose your changes!')
|
||||
}
|
||||
window.location = '/tutorial/html/10'
|
||||
}
|
||||
})
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue