shop.balmet.com

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

squareup.twig (1660B)


      1 <div class="buttons clearfix">
      2   {% if order_recurring_id %}
      3   <div class="pull-left">
      4     <button type="button" id="button-cancel" data-loading-text="{{ text_loading }}" class="btn btn-danger">{{ button_cancel }}</button>
      5   </div>
      6   {% endif %}
      7   <div class="pull-right"><a href="{{ continue }}" data-loading-text="{{ text_loading }}" class="btn btn-primary">{{ button_continue }}</a></div>
      8 </div>
      9 <script type="text/javascript"><!--
     10 $(document).delegate('#button-cancel', 'click', function() {
     11     if (!confirm("{{ text_confirm_cancel }}")) {
     12         return false;
     13     }
     14 
     15     $.ajax({
     16         url: '{{ cancel_url }}',
     17         dataType: 'json',
     18         beforeSend: function() {
     19              $('#button-cancel').button('loading');
     20         },
     21         complete: function() {
     22             $('#button-cancel').button('reset');
     23         },        
     24         success: function(json) {
     25             $('.alert').remove();
     26             
     27             if (json['success']) {
     28                 $('#content').prepend('<div class="alert alert-success">' + json['success'] + '<button type="button" class="close" data-dismiss="alert">&times;</button></div>');
     29 
     30                 $('#button-cancel').hide();
     31             }
     32             
     33             if (json['error']) {
     34                 $('#content').prepend('<div class="alert alert-danger">' + json['error'] + '<button type="button" class="close" data-dismiss="alert">&times;</button></div>');
     35             }
     36         },
     37         error: function(xhr, ajaxOptions, thrownError) {
     38             alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
     39         }
     40     });
     41 });
     42 //--></script>