1 2/** 3 * @preserve 4 * Project: Bootstrap Hover Dropdown 5 * Author: Cameron Spear 6 * Version: v2.0.11 7 * Contributors: Mattia Larentis 8 * Dependencies: Bootstrap's Dropdown plugin, jQuery 9 * Description: A simple plugin to enable Bootstrap dropdowns to active on hover and provide a nice user experience. 10 * License: MIT 11 * Homepage: http://cameronspear.com/blog/bootstrap-dropdown-on-hover-plugin/ 12 */ 13;(function ($, window, undefined) { 14 // outside the scope of the jQuery plugin to 15 // keep track of all dropdowns 16 var $allDropdowns = $(); 17 18 // if instantlyCloseOthers is true, then it will instantly 19 // shut other nav items when a new one is hovered over 20 $.fn.dropdownHover = function (options) { 21 // don't do anything if touch is supported 22 // (plugin causes some issues on mobile) 23 if('ontouchstart' in document) return this; // don't want to affect chaining 24 25 // the element we really care about 26 // is the dropdown-toggle's parent 27 $allDropdowns = $allDropdowns.add(this.parent()); 28 29 return this.each(function () { 30 var $this = $(this), 31 $parent = $this.parent(), 32 defaults = { 33 delay: 500, 34 instantlyCloseOthers: true 35 }, 36 data = { 37 delay: $(this).data('delay'), 38 instantlyCloseOthers: $(this).data('close-others') 39 }, 40 showEvent = 'show.bs.dropdown', 41 hideEvent = 'hide.bs.dropdown', 42 // shownEvent = 'shown.bs.dropdown', 43 // hiddenEvent = 'hidden.bs.dropdown', 44 settings = $.extend(true, {}, defaults, options, data), 45 timeout; 46 47 $parent.hover(function (event) { 48 // so a neighbor can't open the dropdown 49 if(!$parent.hasClass('open') && !$this.is(event.target)) { 50 // stop this event, stop executing any code 51 // in this callback but continue to propagate 52 return true; 53 } 54 55 openDropdown(event); 56 }, function () { 57 timeout = window.setTimeout(function () { 58 $parent.removeClass('open'); 59 $this.trigger(hideEvent); 60 }, settings.delay); 61 }); 62 63 // this helps with button groups! 64 $this.hover(function (event) { 65 // this helps prevent a double event from firing. 66 // see https://github.com/CWSpear/bootstrap-hover-dropdown/issues/55 67 if(!$parent.hasClass('open') && !$parent.is(event.target)) { 68 // stop this event, stop executing any code 69 // in this callback but continue to propagate 70 return true; 71 } 72 73 openDropdown(event); 74 }); 75 76 // handle submenus 77 $parent.find('.dropdown-submenu').each(function (){ 78 var $this = $(this); 79 var subTimeout; 80 $this.hover(function () { 81 window.clearTimeout(subTimeout); 82 $this.children('.dropdown-menu').show(); 83 // always close submenu siblings instantly 84 $this.siblings().children('.dropdown-menu').hide(); 85 }, function () { 86 var $submenu = $this.children('.dropdown-menu'); 87 subTimeout = window.setTimeout(function () { 88 $submenu.hide(); 89 }, settings.delay); 90 }); 91 }); 92 93 function openDropdown(event) { 94 $allDropdowns.find(':focus').blur(); 95 96 if(settings.instantlyCloseOthers === true) 97 $allDropdowns.removeClass('open'); 98 99 window.clearTimeout(timeout); 100 $parent.addClass('open'); 101 $this.trigger(showEvent); 102 } 103 }); 104 }; 105 106 $(document).ready(function () { 107 // apply dropdownHover to all elements with the data-hover="dropdown" attribute 108 $('[data-hover="dropdown"]').dropdownHover(); 109 }); 110})(jQuery, this); 111 112/*! 113 * JavaScript Cookie v2.1.0 114 * https://github.com/js-cookie/js-cookie 115 * 116 * Copyright 2006, 2015 Klaus Hartl & Fagner Brack 117 * Released under the MIT license 118 */ 119(function (factory) { 120 if (typeof define === 'function' && define.amd) { 121 define(factory); 122 } else if (typeof exports === 'object') { 123 module.exports = factory(); 124 } else { 125 var _OldCookies = window.Cookies; 126 var api = window.Cookies = factory(); 127 api.noConflict = function () { 128 window.Cookies = _OldCookies; 129 return api; 130 }; 131 } 132}(function () { 133 function extend () { 134 var i = 0; 135 var result = {}; 136 for (; i < arguments.length; i++) { 137 var attributes = arguments[ i ]; 138 for (var key in attributes) { 139 result[key] = attributes[key]; 140 } 141 } 142 return result; 143 } 144 145 function init (converter) { 146 function api (key, value, attributes) { 147 var result; 148 149 // Write 150
151 if (arguments.length > 1) { 152 attributes = extend({ 153 path: '/' 154 }, api.defaults, attributes); 155 156 if (typeof attributes.expires === 'number') { 157 var expires = new Date(); 158 expires.setMilliseconds(expires.getMilliseconds() + attributes.expires * 864e+5); 159 attributes.expires = expires; 160 } 161 162 try { 163 result = JSON.stringify(value); 164 if (/^[\{\[]/.test(result)) { 165 value = result; 166 } 167 } catch (e) {} 168 169 if (!converter.write) { 170 value = encodeURIComponent(String(value)) 171 .replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent); 172 } else { 173 value = converter.write(value, key); 174 } 175 176 key = encodeURIComponent(String(key)); 177 key = key.replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent); 178 key = key.replace(/[\(\)]/g, escape); 179 180 return (document.cookie = [ 181 key, '=', value, 182 attributes.expires && '; expires=' + attributes.expires.toUTCString(), // use expires attribute, max-age is not supported by IE 183 attributes.path && '; path=' + attributes.path, 184 attributes.domain && '; domain=' + attributes.domain, 185 attributes.secure ? '; secure' : '' 186 ].join('')); 187 } 188 189 // Read 190 191 if (!key) { 192 result = {}; 193 } 194 195 // To prevent the for loop in the first place assign an empty array 196 // in case there are no cookies at all. Also prevents odd result when 197 // calling "get()" 198 var cookies = document.cookie ? document.cookie.split('; ') : []; 199 var rdecode = /(%[0-9A-Z]{2})+/g; 200 var i = 0; 201 202 for (; i < cookies.length; i++) { 203 var parts = cookies[i].split('='); 204 var name = parts[0].replace(rdecode, decodeURIComponent); 205 var cookie = parts.slice(1).join('='); 206 207 if (cookie.charAt(0) === '"') { 208 cookie = cookie.slice(1, -1); 209 } 210 211 try { 212 cookie = converter.read ? 213 converter.read(cookie, name) : converter(cookie, name) || 214 cookie.replace(rdecode, decodeURIComponent); 215 216 if (this.json) { 217 try { 218 cookie = JSON.parse(cookie); 219 } catch (e) {} 220 } 221 222 if (key === name) { 223 result = cookie; 224 break; 225 } 226 227 if (!key) { 228 result[name] = cookie; 229 } 230 } catch (e) {} 231 } 232 233 return result; 234 } 235 236 api.get = api.set = api; 237 api.getJSON = function () { 238 return api.apply({ 239 json: true 240 }, [].slice.call(arguments)); 241 }; 242 api.defaults = {}; 243 244 api.remove = function (key, attributes) { 245 api(key, '', extend(attributes, { 246 expires: -1 247 })); 248 }; 249 250 api.withConverter = init; 251 252 return api; 253 } 254 255 return init(function () {}); 256})); 257 258 /* decrypt helper function */ 259 function decryptCharcode(n,start,end,offset) { 260 n = n + offset; 261 if (offset > 0 && n > end) { 262 n = start + (n - end - 1); 263 } else if (offset < 0 && n < start) { 264 n = end - (start - n - 1); 265 } 266 return String.fromCharCode(n); 267 } 268 /* decrypt string */ 269 function decryptString(enc,offset) { 270 var dec = ""; 271 var len = enc.length; 272 for(var i=0; i < len; i++) { 273 var n = enc.charCodeAt(i); 274 if (n >= 0x2B && n <= 0x3A) { 275 dec += decryptCharcode(n,0x2B,0x3A,offset); /* 0-9 . , - + / : */ 276 } else if (n >= 0x40 && n <= 0x5A) { 277 dec += decryptCharcode(n,0x40,0x5A,offset); /* A-Z @ */ 278 } else if (n >= 0x61 && n <= 0x7A) { 279 dec += decryptCharcode(n,0x61,0x7A,offset); /* a-z */ 280 } else { 281 dec += enc.charAt(i); 282 } 283 } 284 return dec; 285 } 286 /* decrypt spam-protected emails */ 287 function linkTo_UnCryptMailto(s) { 288 location.href = decryptString(s,-1); 289 } 290
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.