1window.store = { 2 get: key => window.localStorage[key], 3 set: (key, value) => window.localStorage[key] = value, 4 delete: key => delete window.localStorage[key] 5}; 6 7window.ScrollToBottom = (elementName) => { 8 element = document.getElementById(elementName); 9 element.scrollTop = element.scrollHeight - element.clientHeight; 10}; 11 12//window.DownloadDoc = function (docBinary) { 13// event?.stopPropagation(); 14// var a = document.createElement("a"); 15// document.body.appendChild(a); 16 17// a.style = "display: none"; 18// a.href = 'data:attachment/pdf;base64,' + docBinary; 19// a.download = "proposal.pdf"; 20// a.click(); 21 22//}; 23 24 25window.DownloadFileFromStream = function (mimeType, base64String, fileName) { 26 var fileDataUrl = "data:" + mimeType + ";base64," + base64String; 27 fetch(fileDataUrl) 28 .then(response => response.blob()) 29 .then(blob => { 30 31 //create a link 32 var link = window.document.createElement("a"); 33 link.href = window.URL.createObjectURL(blob, { type: mimeType }); 34 link.download = fileName; 35 36 //add, click and remove 37 document.body.appendChild(link); 38 link.click(); 39 document.body.removeChild(link); 40 }); 41} 42 43window.JumpToSection = (id) => { 44 window.location.hash = id; 45 setTimeout(x => { 46 window.scrollTo(0, window.scrollY - 100); 47 }, 1000); 48} 49 50 51window.scrollToLastElement = (id) => { 52 setTimeout(() => { 53 let objDiv = document.getElementById(id); 54 objDiv.scrollTop = objDiv.scrollHeight; 55 console.log(id); 56 }, 150); 57} 58 59function leftScroll(classname) { 60 scrollOptions = { 61 left: 400, 62 top: 0, 63 behavior: 'smooth' 64 }; 65 66 element = document.querySelector(classname); 67 element.scrollBy(scrollOptions); 68} 69 70function rightScroll(classname) { 71 scrollOptions = { 72 left: -400, 73 top: 0, 74 behavior: 'smooth' 75 }; 76 element = document.querySelector(classname); 77 element.scrollBy(scrollOptions); 78} 79 80function isScrollExists(classname) { 81 div = document.getElementById(classname); 82 hasHorizontalScrollbar = div.scrollWidth > div.clientWidth; 83 return hasHorizontalScrollbar; 84} 85 86window.toggleFullscreenById = function (id) { 87 var elem = document.getElementById(id); 88 if (elem) { 89 if (elem.requestFullscreen) { 90 elem.requestFullscreen(); 91 } else if (elem.webkitRequestFullscreen) { // Safari 92 elem.webkitRequestFullscreen(); 93 } else if (elem.msRequestFullscreen) { // IE11 94 elem.msRequestFullscreen(); 95 } 96 } 97}; 98 99
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.