1"use strict"; 2 3/************************************** 4MB CUSTOM SCRIPTS 5 6EMBED SCROLL PROTECT 7GENERATE UNIQUE ID 8 9***************************************/ 10 11 12 13/************************************************************* 14 15EMBED SCROLL PROTECT 16 17AUTHOR: Michael Bregnbak 18DESCRIPTION: When embedding content sometimes scrolling when mouse is over embedded content will interact with content instead of scrolling page (e.g. zoom on Google Maps). 19The Embed Scroll Protect will protect against this by creating an invisible overlay. Clicking this overlay will remove it and allow users to interact with content. 20HOW-TO-USE: $('.some-selector').mbEmbedScrollProtect(); 21Now you can put class some-selector on e.g. Google Maps iframe. 22 23*************************************************************/ 24 25 26 (function ( $ ) { 27 28 $.fn.mbEmbedScrollProtect = function() { 29 30 // add markup 31 this.wrap('<div class="embed-scroll-protect-wrapper"></div>'); 32 this.before('<div class="embed-scroll-protect-overlay"></div>') 33 34 var $wrapper = $('.embed-scroll-protect-wrapper');
35 var $overlay = $('.embed-scroll-protect-overlay'); 36 37 // add css 38 $wrapper.css({ 39 position: 'relative', 40 }); 41 $overlay.css({ 42 position: 'absolute', 43 cursor: 'pointer', 44 top: 0, 45 left: 0, 46 width: '100%', 47 height: '100%', 48 "z-index": 999, 49 }); 50 51 // on click event 52 $overlay.on('click', function() { 53 $(this).remove(); 54 }) 55 56 return this; 57 58 }; 59 60 }( jQuery )); 61 62 63 64/************************************************************* 65GENERATE UNIQUE ID 66 67AUTHOR: Michael Bregnbak 68DESCRIPTION: Generates a unique identifier (string). Optional parameters: prefix (string), addRandom (boolean). 69First creates a timestamp (ms since epoch). Optionally adds a set prefix and appends a random number between 1-1.000.000. 70Not 100% guaranteed unique - but close enough for everyday use. 71 72*************************************************************/ 73 74 function mbGenerateUniqueId (prefix, addRandom) { 75 76 var prefix = (typeof prefix != 'undefined') ? prefix : ""; 77 var dateTimeStamp = new Date().getTime(); 78 var uniqueId = prefix + dateTimeStamp; 79 80 if (typeof addRandom != 'undefined') { 81 if (addRandom === true) { 82 var randomNumber = Math.floor(Math.random() * 1000000) + 1; 83 uniqueId = uniqueId + "r" + randomNumber; 84 } 85 } 86 return uniqueId; 87 88 } 89 90
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.