1'use strict'; 2var mfpdf = (function () { 3 4 var _privateProperty = 'Hello World'; 5 var images = []; 6 var index = 0; 7 var publicProperty = 'I am a public property'; 8 9 async function _loadImages() { 10 let response = await fetch(document.getElementById('mf-jsonurl').value); 11 images = await response.json(); 12 _showImage(); 13 } 14 15 function _showImage() { 16 let image = images[index]; 17 var img = document.getElementById('mfpdf-image'); 18 img.src = image.url; 19 img.style.opacity = 1; 20 /* 21 setTimeout(() => { 22 img.src = image.url; 23 img.style.opacity = 1; 24 }, 200); 25 */ 26 //img.style.width = image.width + 'px'; 27 //img.style.height = image.height + 'px'; 28 document.getElementById('mfpdf-index').innerText = `Sida ${index + 1} av ${images.length}`; 29 } 30 31 32 function _init() { 33 34 console.log('mfpdf'); 35 36 document.getElementById('mfpdf-prev').addEventListener('click', () => { 37 index = index - 1 < 0 ? images.length - 1 : index - 1; 38 _showImage(); 39 }); 40 41 document.getElementById('mfpdf-next').addEventListener('click', () => { 42 index = (index + 1) % images.length; 43 _showImage(); 44 }); 45 46 _loadImages(); 47 } 48 49 50 function init() { 51 _init(); 52 } 53 54 return { 55 init: init, 56 publicProperty: publicProperty 57 }; 58}());
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.