annotate downloads/static/js/downloads-get.js @ 693:ad69236e8501

For issue #52, update many 3rd party Javascript libraries. Updated to jquery 1.10.2, jquery ui 1.10.3. This broke a lot of stuff. - Found a newer version of the jquery cycle all plugin (3.0.3). - Updated JPlayer to 2.4.0. - Updated to MarkItUp 1.1.14. This also required me to add multiline attributes set to true on various buttons in the markdown set. - As per a stackoverflow post, added some code to get multiline titles in a jQuery UI dialog. They removed that functionality but allow you to put it back. Tweaked the MarkItUp preview CSS to show blockquotes in italic. Did not update TinyMCE at this time. I'm not using the JQuery version and this version appears to work ok for now. What I should do is make a repo for MarkItUp and do a vendor branch thing so I don't have to futz around diffing directories to figure out if I'll lose changes when I update.
author Brian Neal <bgneal@gmail.com>
date Wed, 04 Sep 2013 19:55:20 -0500
parents ee87ea74d46b
children f56798c96ec2
rev   line source
bgneal@404 1 $(document).ready(function() {
bgneal@404 2 $('.dl-button').each(function(n) {
bgneal@404 3 var button = $(this);
bgneal@404 4 var id = button.attr('id');
bgneal@404 5 var numeric_id = -1;
bgneal@404 6 if (id.match(/dl-(\d+)/))
bgneal@404 7 {
bgneal@404 8 numeric_id = RegExp.$1;
bgneal@404 9 }
bgneal@404 10 button.click(function() {
bgneal@404 11 button.attr('disabled', 'disabled').val('Getting link, stand by...');
bgneal@404 12 $.ajax({
bgneal@404 13 url: '/downloads/request/',
bgneal@404 14 type: 'POST',
bgneal@404 15 data: { id: numeric_id },
bgneal@404 16 dataType: 'json',
bgneal@404 17 success: function(result) {
bgneal@404 18 var link_id = result.id;
bgneal@404 19 var div = $('#link-' + link_id);
bgneal@404 20 div.hide();
bgneal@404 21 div.html(
bgneal@404 22 'Thank you! Your download is now ready. <a href="' + result.url +
bgneal@404 23 '">Click here to download</a>.');
bgneal@404 24 div.fadeIn(3000);
bgneal@404 25 },
bgneal@404 26 error: function (xhr, textStatus, ex) {
bgneal@404 27 alert('Oops, an error occurred. ' + xhr.statusText + ' - ' +
bgneal@404 28 xhr.responseText);
bgneal@404 29 }
bgneal@404 30 });
bgneal@404 31 });
bgneal@404 32 });
bgneal@404 33 });