1(function($) { 2 3 4 5 $.extend({ 6 getGo: function(url, params) { 7 document.location = url + '?' + $.param(params); 8 }, 9 postGo: function(url, params) { 10 var $form = $("<form>") 11 .attr("method", "post") 12 .attr("action", url); 13 $.each(params, function(name, value) { 14 if (value instanceof Array) { 15 $.each(value, function(name2, value) { 16 $("<input type='hidden'>") 17 .attr("name", name + '[' + name2 + ']') 18 .attr("value", value) 19 .appendTo($form); 20 }); 21 } 22 23 else { 24 $("<input type='hidden'>") 25 .attr("name", name) 26 .attr("value", value) 27 .appendTo($form); 28 29 } 30 }); 31 $form.appendTo("body"); 32 $form.submit(); 33 } 34 }); 35})(jQuery); 36 37 38$.extend({confirm: function(title, message, yesText, yesCallback) { 39 $("<div></div>").dialog({ 40 buttons: [{ 41 text: yesText, 42 click: function() { 43 yesCallback(); 44 $(this).remove(); 45 } 46 }, 47 { 48 text: "Cancel", 49 click: function() { 50 $(this).remove(); 51 } 52 } 53 ], 54 close: function(event, ui) { 55 $(this).remove(); 56 }, 57 resizable: false, 58 title: title, 59 modal: true 60 }).text(message).parent().addClass("alert"); 61 } 62}); 63 64$.extend({alert: function(title, message) { 65 $("<div></div>").dialog({ 66 position: {my: "center", 67 at: "center", 68 of: window 69 }, 70 buttons: [{ 71 text: 'Ok', 72 click: function() { 73 $(this).remove(); 74 } 75 }], 76 title: title, 77 modal: true 78 }).text(message).parent().addClass("alert"); 79 } 80}); 81 82$(document).ready(function() { 83 84 if (!isAuthenticated) { 85 $('.require-authentication').click(function(e) { 86 console.log('authentication required'); 87 e.preventDefault(); 88 e.stopPropagation(); 89 openSignupIFrame(); 90 }); 91 } 92 93 $('.fancybox-ajax').fancybox({ 94 type: 'ajax', 95 beforeShow: function() { 96 this.width = $(this).find('#content').width(); 97 this.height = $(this).find('#content').height(); 98 console.log(this.width + " " + this.height); 99 }, 100 padding: '0', 101 scrolling: 'no', 102 autoSize: true, 103 closeBtn: false 104 }); 105 106 $('.submenu').removeAttr('style'); 107}); 108 109function popupwindow(url, title, w, h) { 110 var left = (screen.width / 2) - (w / 2); 111 var top = (screen.height / 2) - (h / 2); 112 return window.open(url, title, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=' + w + ', height=' + h + ', top=' + top + ', left=' + left); 113} 114 115 116 117function openSignupIFrame() { 118 console.log('opening signup Iframe'); 119 $.fancybox.showLoading(); 120 $.fancybox.open({ 121 beforeShow: function() { 122 this.width = $('.fancybox-iframe').contents().find('#content').width(); 123 this.height = $('.fancybox-iframe').contents().find('#content').height(); 124 console.log(this.width + " " + this.height); 125 }, 126 href: signinPopupUrl, 127 type: 'iframe', 128 padding: '0', 129 scrolling: 'no', 130 autoSize: false, 131 showCloseButton: true 132 }); 133} 134 135$(document).on('click', '.fancybox', function(e) { 136 e.preventDefault(); 137 var url = $(this).data('url'); 138 console.log(url); 139 $.fancybox.showLoading(); 140 $.fancybox.open({ 141 beforeShow: function() { 142 this.width = $('.fancybox-iframe').contents().find('#content').width(); 143 this.height = $('.fancybox-iframe').contents().find('#content').height(); 144 console.log(this.width + " " + this.height); 145 }, 146 href: url, 147 type: 'iframe', 148 padding: '0', 149 scrolling: 'no', 150 autoSize: false, 151 closeBtn: false 152 }); 153}); 154 155$(document).on('click', '.fancybox-iframe', function(e) { 156 e.preventDefault(); 157 var url = $(this).data('url'); 158 if(url === "") { 159 url = $(this).href(); 160 } 161 console.log(url); 162 $.fancybox.showLoading(); 163 $.fancybox.open({ 164 href: url, 165 type: 'iframe', 166 padding: '0', 167 scrolling: 'no', 168 autoSize: false, 169 closeBtn: false 170 }); 171}); 172 173/* 174$("body").on("click", "a.signout-link", function(event) { 175 $.post("/shop/legacy/logout", function(data) { 176 window.location.href = "/logout"; 177 }); 178}); 179*/
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.