1if(typeof(j2store) == 'undefined') { 2 var j2store = {}; 3} 4if(typeof(j2store.jQuery) == 'undefined') { 5 j2store.jQuery = jQuery.noConflict(); 6} 7 8if(typeof(j2storeURL) == 'undefined') { 9 var j2storeURL = ''; 10} 11(function ($) { 12 // Make sure the DOM elements are loaded and accounted for 13 $(document).ready(function() { 14 15 // Match to Bootstraps data-toggle for the modal 16 // and attach an onclick event handler 17 $('a[data-toggle="modal"]').on('click', function(e) { 18 19 // From the clicked element, get the data-target arrtibute 20 // which BS3 uses to determine the target modal 21 var target_modal = $(e.currentTarget).data('target'); 22 // external url content load to modal body 23 var method = 1; 24 if(target_modal == undefined){ 25 // old href model id 26 method = 2; 27 } 28 // also get the remote content's URL 29 var remote_content = e.currentTarget.href; 30 // Find the target modal in the DOM 31 var modal = $(target_modal); 32 // Find the modal's <div class="modal-body"> so we can populate it 33 var modalBody = $(target_modal + ' .modal-body'); 34 35 // Capture BS3's show.bs.modal which is fires 36 // immediately when, you guessed it, the show instance method 37 // for the modal is called 38 if(method == 1){ 39 modal.on('show.bs.modal', function () { 40 if(remote_content){ 41 // use your remote content URL to load the modal body 42 43 modalBody.load(remote_content); 44 45 46 } 47 }).modal(); 48 }else{ 49 return true; 50 } 51 52 // and show the modal 53 54 // Now return a false (negating the link action) to prevent Bootstrap's JS 3.1.1 55 // from throwing a 'preventDefault' error due to us overriding the anchor usage. 56 return false; 57 }); 58 }); 59})(j2store.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.