1/*! 2 * jQuery BB Online v1.1 3 * 4 * Copyright 2017 BB Online UK Ltd 5 */ 6 7/*! 8 * Function: setCountry 9 * 10 * Set the default country to UK if prefCurrency is GBP. 11 * 12 * Copyright 2017 BB Online UK Ltd 13 */ 14 (function($) { 15 $.setCountry = function(selectName) { 16 var prefCurrency = $.getPrefCurrency(); 17 if (prefCurrency == 'GBP') { 18 $('select[name="' + selectName + '"]').val('') 19 $('select[name="' + selectName + '"]').val('UK') 20 } 21 } 22 })(jQuery); 23 24/*! 25 * Function: sameheight 26 * 27 * Makes 2 CSS classes the same height, by increasing the height of the shortest. 28 * 29 * Copyright 2017 BB Online UK Ltd 30 */ 31 32 (function($) { 33 $.sameheight = function(aClass, bClass, eSpeed) { 34 var aHeight = $(aClass).height(); 35 var bHeight = $(bClass).height(); 36 var eSpeed = (eSpeed) ? eSpeed : 0; 37 if (aHeight < bHeight) { 38 $(aClass).animate({ 'height' : bHeight }, eSpeed ); 39 //$(aClass).css('min-height', bHeight + 'px'); 40 } else { 41 $(bClass).animate({ 'height' : aHeight }, eSpeed ); 42 //$(bClass).css('min-height', aheight + 'px'); 43 } 44 return false; 45 } 46 })(jQuery); 47 48/*! 49 * Function: equalheight 50 * 51 * Makes 2 or more CSS classes the same height. 52 * 53 * Copyright 2017 BB Online UK Ltd 54 */ 55 (function($) { 56 $.equalheight = function(container) { 57 58 var currentTallest = 0, 59 currentRowStart = 0, 60 rowDivs = new Array(), 61 $el, 62 topPosition = 0; 63 64 $(container).each(function() { 65 $el = $(this); 66 $($el).height('auto'); 67 //$($el).height(''); 68 //$($el).removeAttr('height'); 69 topPostion = $el.position().top; 70 71 if (currentRowStart != topPostion) { 72 for (currentDiv = 0 ; currentDiv < rowDivs.length ; currentDiv++) { 73 rowDivs[currentDiv].height(currentTallest); 74 } 75 rowDivs.length = 0; // empty the array 76 currentRowStart = topPostion; 77 currentTallest = $el.height(); 78 rowDivs.push($el); 79 } else { 80 rowDivs.push($el); 81 currentTallest = (currentTallest < $el.height()) ? ($el.height()) : (currentTallest); 82 } 83 84 for (currentDiv = 0 ; currentDiv < rowDivs.length ; currentDiv++) { 85 rowDivs[currentDiv].height(currentTallest + 3); 86 } 87 }); 88 89 } 90 })(jQuery); 91 92/*! 93 * BasketTracking Cookie Functions v1.0 94 * 95 * Set 1 hour Visitor ID 96 * 97 * Copyright 2017 BB-Online.com 98 */ 99 100 (function($) { 101 $.updateBasketTrackingCookie = function() { 102 var basketTrackingCookie; 103 if ($.cookie('BasketTracking')) { 104 basketTrackingCookie = $.cookie('BasketTracking'); 105 } else { 106 basketTrackingCookie = createVisitorID(); 107 } 108 $.cookie('BasketTracking', basketTrackingCookie, { expires: 1/24, path: '/' }); 109 if (!$.cookie('BasketTracking')) { 110 alert('No cookies!\n\nPlease enable cookies to continue.'); 111 window.location = 'https://www.bb-online.com/cookies.shtml'; 112 } 113 } 114 115 // Private methods... 116 var createVisitorID = function (prefix) { 117 var d = new Date().getTime(); 118 d += (parseInt(Math.random() * 100)).toString(); 119 if (undefined === prefix) { 120 prefix = 'vid-'; 121 } 122 return 'VisitorId:' + prefix + d; 123 }; 124 })(jQuery); 125 126 (function($) { 127 $.getVisitorID = function() { 128 if (!$.cookie('BasketTracking')) { 129 alert('No cookies! Please enable cookies to continue.'); 130 window.location = 'https://www.bb-online.com/cookies.shtml'; 131 } 132 var vid = $.cookie('BasketTracking').split(':'); 133 return (vid[1]); 134 } 135 })(jQuery); 136 137/*! 138 * jQuery MultiCurrency v2.0 139 * 140 * Copyright 2016 BB Online UK Ltd 141 */ 142 143/*! 144 * $(function() { 145 * $('#pref-currency').change(function(e) { 146 * // var prevCurrency = $.getPrefCurrency(); 147 * // var prefCurrency = $(e.target).val(); 148 * $.changePrefCurrency($(e.target).val(),$.getPrefCurrency()); 149 * }); 150 * }); 151 * 152 * (function($) { 153 * $.updatePrefCurrency = function() { 154 * var prefCurrency = $.getPrefCurrency(); 155 * $("#pref-currency option[value="+prefCurrency+"]").prop('selected', true); 156 * $('#pref-currency').trigger('change'); 157 * return this; 158 * } 159 * })(jQuery); 160 * 161 * (function($) { 162 * $.getPrefCurrency = function() { 163 * var prefCurrency; 164 * if ($.cookie('preferredCurrency')) { 165 * prefCurrency = $.cookie('preferredCurrency'); 166 * } else if ($.cookie('defaultCurrency')) { 167 * prefCurrency = $.cookie('defaultCurrency'); 168 * } else {
169 * var prefCurrency = $('input[name=geoCurrency]').val(); 170 * $("#pref-currency option[value="+prefCurrency+"]").prop('selected', true); 171 * $.cookie('defaultCurrency', prefCurrency, { expires: 20*365+5, path: '/' }); 172 * } 173 * return (prefCurrency); 174 * } 175 * })(jQuery); 176 * 177 * (function($) { 178 * $.changePrefCurrency = function(prefCurrency,prevCurrency) { 179 * if (prevCurrency != prefCurrency) { 180 * $.cookie('preferredCurrency', prefCurrency, { expires: 20*365+5, path: '/' }); 181 * $('.' + prevCurrency).hide(); 182 * } else { 183 * $('.NZD, .GBP, .AUD, .DKK, .EUR, .SEK, .USD, .ZAR').hide(); 184 * } 185 * $('.' + prefCurrency).show(); 186 * return false; 187 * } 188 * })(jQuery); 189 */ 190 191 192/*! 193 * Fix Top Navfor different sized screens 194 * 195 * Copyright 2017 BB-Online.com 196 */ 197 198 $(function() { 199 $(window).resize(function() { 200 if(window.innerWidth > 1024){ 201 $("div.header").addClass("navbar-fixed-top"); 202 $("body").css("padding-top", "115px"); 203// $("div.banner").css("padding-top", "133px"); 204 } else { 205 $("div.header").removeClass("navbar-fixed-top"); 206 $("body").css("padding-top", "0px"); 207// $("div.banner").css("padding-top", "3px"); 208 } 209 }).resize(); 210 }); 211 212/** 213 * 214 * Copyright (c) 2007 Tom Deater (http://www.tomdeater.com) 215 * Licensed under the MIT License: 216 * http://www.opensource.org/licenses/mit-license.php 217 * 218 */ 219 220(function($) { 221 /** 222 * equalizes the heights of all elements in a jQuery collection 223 * thanks to John Resig for optimising this! 224 * usage: $("#col1, #col2, #col3").equaliseCols(); 225 */ 226 227 $.fn.equaliseCols = function(){ 228 var height = 0, 229// reset = $.browser.msie && $.browser.version < 7 ? "1%" : "auto"; 230 231 reset = "auto"; 232 return this 233 .css("height", reset) 234 .each(function() { 235 height = Math.max(height, this.offsetHeight); 236 }) 237 .css("height", height + " !important") 238 .each(function() { 239 var h = this.offsetHeight; 240 if (h > height) { 241 $(this).css("height", (height - (h - height)) + " !important"); 242 }; 243 }); 244 245 }; 246 247})(jQuery); 248 249/** 250 * Function: disable 251 * 252 * Disables HTML elements such as button, input, option, select and textarea 253 * by id or class 254 * 255 * Copyright 2017 BB Online UK Ltd 256 */ 257 258 (function($) { 259 $.fn.disable = function(state) { 260 return this.each(function () { 261 var $this = jQuery(this); 262 if ($this.is('input, button')) 263 this.disabled = state; 264 else if ($this.is('select') && state) 265 $this.attr('disabled', 'disabled'); 266 else if ($this.is('select') && !state) 267 $this.removeAttr('disabled'); 268 else 269 $this.toggleClass('disabled', state); 270 }); 271 } 272 })(jQuery); 273
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.