1$j = jQuery.noConflict(); 2 3(function($) { 4 // create special namespace for all Jigsy-centric content 5 $.jigsy = $.jigsy || {}; 6 7 /*************************************************************************** 8 define some globally useful methods 9 ***************************************************************************/ 10 /** 11 * Shows the global AJAX spinner w/ overlay 12 * 13 * @returns {jQuery} the AJAX spinner jQuery object 14 */ 15 $.jigsy.showAjaxSpinner = function() { 16 return $('#ajax-spinner').fadeIn(); 17 }; 18 19 /** 20 * Hides the global AJAX spinner w/ overlay 21 * 22 * @returns {jQuery} the AJAX spinner jQuery object 23 */ 24 $.jigsy.hideAjaxSpinner = function() { 25 return $('#ajax-spinner').fadeOut(); 26 }; 27 28 /*************************************************************************** 29 perform all default actions 30 ***************************************************************************/ 31 32 // Configure our automatic AJAX spinner 33 $(document).ajaxStart(function() { 34 if (window.noAjaxSpinner) { 35 return; 36 } 37 $.jigsy.showAjaxSpinner(); 38 }).ajaxComplete(function() { 39 $.jigsy.hideAjaxSpinner(); 40 }); 41 42 // run all DOM-related actions 43 $(function($) { 44 // use pretty bootstrap select boxes 45 // $('select.selectpicker').selectpicker(); 46 47 // always make tooltips function 48 $('[data-toggle="tooltip"]').tooltip(); 49 50 // prevent interacting on anything deactivated 51 $(document).on('click dblclick keypress keydown keyup submit change', '.deactivated', function(evt) { 52 evt.preventDefault(); 53 evt.stopImmediatePropagation(); 54 55 var reason = $(this).data('reason'); 56 57 if (reason) { 58 alert(reason); 59 $.jigsy.utils.html.Modal.alert(reason, { 60 title: 'Feature is disabled', 61 state: 'danger' 62 }); 63 } else { 64 // NOTE - list these from most severe down 65 if ($.jigsy.User.is_suspended) { 66 $.jigsy.utils.html.Modal.alert('Your account has been suspended. Please contact our Support Department.', { 67 title: 'Account Suspended', 68 state: 'danger', 69 callback: function() { 70 document.location = $.jigsy.Destinations.help; 71 } 72 }); 73 } else if ($.jigsy.User.is_expired) { 74 $.jigsy.utils.html.Modal.confirm('Your account has expired. Do you wish to renew now?', 75 function(modal) { 76 modal.modal('hide'); 77 document.location = $.jigsy.Destinations.renew; 78 }, 79 function(modal) { 80 modal.modal('hide'); 81 }, { 82 title: 'Account Has Expired', 83 state: 'warning', 84 confirmLabel: 'Renew now', 85 declineLabel: 'No thank you' 86 } 87 ); 88 } else { 89 $.jigsy.utils.html.Modal.alert('This action has been deactivated for an unknown reason!'); 90 } 91 } 92 93 return false; 94 }); 95 96 $(document).on('click', 'a.double-confirm', function(evt) { 97 var yes = confirm($(this).data('confirmation-message') || "Are you sure?"); 98 99 if (!yes) { 100 evt.stopImmediatePropagation(); 101 } 102 103 return yes; 104 }); 105 106 $(document).on('click', '.ajax-link', function(evt) { 107 evt.preventDefault(); 108 evt.stopImmediatePropagation(); 109 110 var method = $(this).data('method') || 'GET'; 111 112 $.ajax(this.href, { 113 method: method 114 }); 115 }); 116 117 $(document).on('click', '.toggle-force-ssl', function(e) { 118 e.preventDefault(); 119 e.stopPropagation(); 120 121 var $el = $(this); 122 var href = $el.attr('href'); 123 124 $.post(href) 125 .done(function(data, textStatus, jqXHR) { 126 $el.attr('data-force-ssl', data.force_ssl); 127 }) 128 .fail(function() { 129 130 }); 131 }); 132 133 }); 134})(jQuery);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.