-
Notifications
You must be signed in to change notification settings - Fork 0
/
output.js
executable file
·24 lines (23 loc) · 1.06 KB
/
output.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
document.addEventListener( 'DOMContentLoaded', function () {
var range = document.getElementById('expire'), input = document.getElementById('range-value');
document.getElementById('expire').addEventListener("change", updateNum);
function updateNum(){
if(range.valueAsNumber == 1)
input.innerHTML = range.valueAsNumber + " minute";
else if(range.valueAsNumber == 262800)
input.innerHTML = "forever";
else if(range.valueAsNumber > 20160)
input.innerHTML = Math.floor(range.valueAsNumber/60/24) + " days";
else if(range.valueAsNumber > 5760)
input.innerHTML = Math.floor(range.valueAsNumber/60) + " hours";
else
input.innerHTML = Math.floor(range.valueAsNumber) + " minutes";
};
}, false );
document.addEventListener( 'DOMContentLoaded', function () {
var range = document.getElementById('latestPastesDisplaySize'), input = document.getElementById('range-value-display');
document.getElementById('latestPastesDisplaySize').addEventListener("change", updateNum);
function updateNum(){
input.innerHTML = Math.floor(range.valueAsNumber) + " rows";
};
}, false );