1var Core = 2 { 3 run: function() 4 { 5 $("#toggle-handy").on("click", function () { 6 $("#handy-helper").fadeToggle("fast"); 7 }); 8 9 // Dark mode 10 $("#toggle-darkmode").on("click", function () { 11 $.post("/base/darkmode", function () { 12 location.reload(); 13 }); 14 }); 15 16 // Grayscale 17 $("#toggle-grayscale").on("click", function () { 18 $.post("/base/grayscale", function () { 19 location.reload(); 20 }); 21 }); 22 23 // Font bigger 24 $("#font-bigger").on("click", function () { 25 var currentSize = parseFloat($("html").attr("style").replace("font-size: ", "").replace(";", "")); 26 if(!isNaN(currentSize) && currentSize < 2) { 27 currentSize = (currentSize + 0.05).toFixed(2); 28 $("html").attr("style", "font-size: "+currentSize+"rem;"); 29 $.post("/base/font", {font: currentSize}, function (data) { 30 console.log(data); 31 }); 32 } 33 }); 34 35 // Font smaller 36 $("#font-default").on("click", function () { 37 38 $("html").attr("style", "font-size: "+1+"rem;"); 39 $.post("/base/font", {font: 1}, function (data) { 40 console.log(data); 41 }); 42 43 }); 44 45 // Font smaller 46 $("#font-smaller").on("click", function () { 47 var currentSize = parseFloat($("html").attr("style").replace("font-size: ", "").replace(";", "")); 48 if(!isNaN(currentSize) && currentSize > 1) { 49 currentSize = (currentSize - 0.05).toFixed(2); 50 $("html").attr("style", "font-size: "+currentSize+"rem;"); 51 $.post("/base/font", {font: currentSize}, function (data) { 52 console.log(data); 53 }); 54 } 55 }); 56 57 $(document).ready(function(){ 58 $('[data-toggle="tooltip"]').tooltip(); 59 }); 60 }, 61 62 numberFormat: function (number, decimals, decPoint, thousandsSep) { 63 number = (number + '').replace(/[^0-9+\-Ee.]/g, ''); 64 var n = !isFinite(+number) ? 0 : +number; 65 var prec = !isFinite(+decimals) ? 0 : Math.abs(decimals); 66 var sep = (typeof thousandsSep === 'undefined') ? ',' : thousandsSep; 67 var dec = (typeof decPoint === 'undefined') ? '.' : decPoint; 68 var s = ''; 69 var toFixedFix = function (n, prec) { 70 var k = Math.pow(10, prec); 71 return '' + (Math.round(n * k) / k) 72 .toFixed(prec); 73 }; 74 // @todo: for IE parseFloat(0.55).toFixed(0) = 0; 75 s = (prec ? toFixedFix(n, prec) : '' + Math.round(n)).split('.'); 76 if (s[0].length > 3) { 77 s[0] = s[0].replace(/\B(?=(?:\d{3})+(?!\d))/g, sep); 78 } 79 if ((s[1] || '').length < prec) { 80 s[1] = s[1] || ''; 81 s[1] += new Array(prec - s[1].length + 1).join('0'); 82 } 83 return s.join(dec) 84 } 85 }; 86 87StartUp(Core); 88 89function StartUp(runnable){ 90 $(document).ready(runnable.run); 91}
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.