diff --git a/downloads.js b/downloads.js new file mode 100644 index 0000000..3a62ae0 --- /dev/null +++ b/downloads.js @@ -0,0 +1,115 @@ +function prettyOutput() { + document.getElementById('result').style.display = "inline-block"; + document.getElementById('warning').style.display = "inline-block"; + document.getElementById('result').innerText = calculateCSS(); +} + +function getNums (input) { + input = input.split(' - '); + input.shift(); + input.forEach(function(n, i) { + input[i]=parseInt(n); + }); + return input; +} + +function calculateCSS() { + var mincss = ""; + var details = { + general: false, + headings: false, + buttons: false, + inputs: false, + navbar: false, + tables: false, + messages: false, + icons: false, + iehacks: false, + grid: false, + total: 0, + totalmin: 0, + totalmingzip: 0 + }; + + for (var i=0; iminified and gzipped." + mixpanel.track('Calculate CSS', details); + } + } + http.send(params); + + document.getElementById('details').innerHTML = "Your download of min is " + details.total + " bytes unminified and " + details.totalmin + " bytes minified (above)"; + + console.log(details); + return mincss; +}