jsonobj.time.hours = msg.value.time.hours;
jsonobj.time.minutes = msg.value.time.minutes;
jsonobj.time.seconds = msg.value.time.seconds;
+ jsonfile.writeFile(filepath, jsonobj, function (err) {
+ console.error(err);
+ });
document.getElementById('hours-digit').innerHTML = jsonobj.time.hours;
document.getElementById('minutes-digit').innerHTML = jsonobj.time.minutes;
document.getElementById('seconds-digit').innerHTML = jsonobj.time.seconds;
function start() {
console.log('start, '+jsonobj.time.hours+' : '+jsonobj.time.minutes+' : '+jsonobj.time.seconds);
- document.body.insertAdjacentHTML('beforebegin', TIME_HTML);
+ document.body.insertAdjacentHTML('afterbegin', TIME_HTML);
port.postMessage({contentscript: "timer-setTime", value:jsonobj.time});
port.postMessage({contentscript: "timer-start"});
}
top: 0;
width: 100%; /* Full width */
height: 100%; /* Full height */
- overflow: auto; /* Enable scroll if needed */
background-color: rgb(0,0,0); /* Fallback color */
background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
}