From: Charles Connell Date: Fri, 24 Jan 2014 17:42:45 +0000 (-0500) Subject: Confirm note download X-Git-Tag: release-20150131~203 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=6cf010039dc761738b6e0a4c40ed0b3945be8957;p=oweals%2Fkarmaworld.git Confirm note download --- diff --git a/karmaworld/assets/js/note-detail.js b/karmaworld/assets/js/note-detail.js index da96df8..9bd282f 100644 --- a/karmaworld/assets/js/note-detail.js +++ b/karmaworld/assets/js/note-detail.js @@ -106,16 +106,18 @@ $(function() { }); $("#note-download-button").click(function(event) { - // disable handler so it won't be run again - $(this).unbind('click'); + if (confirm('It costs 2 karma points to download a note. Are you sure?')) { + // disable handler so it won't be run again + $(this).unbind('click'); - // tell server that somebody downloaded - // this note - $.ajax({ - url: note_downloaded_url, - dataType: "json", - type: 'POST', - async: false - }); + // tell server that somebody downloaded + // this note + $.ajax({ + url: note_downloaded_url, + dataType: "json", + type: 'POST', + async: false + }) + }; }); });