Commit 4fa8218f authored by Colm O'Neill's avatar Colm O'Neill

centimeter function

parent 594a7736
......@@ -47,7 +47,7 @@ var scrollListener = window.addEventListener("scroll", function(){
//setStorage(stringToSave);
});
var intervalID = window.setInterval(function(){setStorage(stringToSave)}, 10000);
//var intervalID = window.setInterval(function(){setStorage(stringToSave)}, 10000);
function setStorage(item) {
chrome.storage.sync.set(item, function () {
......
......@@ -20,7 +20,7 @@ function onGot(item) {
for (items in pageTitle){
console.log("scrolled " + cumulativeDist + " on " + pageTitle + " last recorded at " + "entrytime");
listItem.textContent = "scrolled " + cumulativeDist + " on " + pageTitle + " last recorded on " + entrytime;
listItem.textContent = "scrolled " + pxToCm(cumulativeDist) + " cm on " + pageTitle;
listEl.appendChild(listItem);
}
});
......@@ -29,3 +29,12 @@ function onGot(item) {
function onError(error) {
console.log(`Error: ${error}`);
}
function pxToCm(distance){
return (distance * 0.0264);
}
function pxToM(distance){
return (distance * 0.000264);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment