Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <link rel="stylesheet" type="text/css" href="/nis.css">
- <link rel="stylesheet" type="text/css" href="/alt1-currentskin/skinstyle.css">
- <script type="text/javascript" src="runeappslib.js"></script>
- <script type="text/javascript" src="Alarm.js"></script>
- <script type="text/javascript" src="Alerter.js"></script>
- <style>
- #settingsbutton{background-image:url(settingsbutton2.png);}
- #alarmvolume{width:45px; height:20px; background:url(volumeslider.png) 0px 0px;}
- #alarmvolumeinner{width:0%; height:20px; background:url(volumeslider.png) 0px -20px;}
- #alarmname{float:right;}
- #timelineroot{color:white; margin-top:5px;}
- .text,.time,.popover{
- display:inline;
- font-size:12px;
- }
- .time{
- color:lightgray;
- margin-right:5px;
- }
- .text{
- color:#FDFDFD;
- }
- </style>
- <script>
- var interval = null;
- var alerts = [];
- var playingalarm = null;
- var tickcount = 0;
- var currenttooltip = "";
- var currentTaskbar = 0;
- var currentTriggered = false;
- var globalAlarmSound = null;
- var settings = {
- globalAlarm: { sound: "bell", repeat: false },
- activeSuppress: true,
- showTaskbarOverlay: true,
- suppressDelay: 3000,
- volume: 0.5,
- cache: true,
- warband: true,
- goebies: true,
- prifddinas: true,
- Cadarn: true,
- Amlodd: true,
- Crwys: true,
- Ithell: true,
- Hefin: true,
- Meilyr: true,
- Trahaearn: true,
- Iorwerth: true
- };
- var alarmplayer = new SoundPlayer();
- var url = "timeline.php";
- var timelineroot = null;
- var districts = {
- Cadarn: {alarm: false, text:"Magic and Ranged"},
- Amlodd: {alarm: false, text:"Summoning and Division"},
- Crwys: {alarm: false, text:"Farming and Woodcutting"},
- Ithell: {alarm: false, text:"Crafting and Construction"},
- Hefin: {alarm: false, text:"Agility and Prayer"},
- Meilyr: {alarm: false, text:"Dungeoneering and Herblore"},
- Trahaearn: {alarm: false, text:"Mining and Smithing"},
- Iorwerth: {alarm: false, text:"Melee and Slayer"},
- prifddinas: {alarm: false, text:"N/A"},
- cache: {alarm: false, text:"N/A"},
- goebies: {alarm: false, text:"N/A"},
- warband: {alarm: false, text:"N/A"},
- };
- function start() {
- tickcount = 0;
- //elid("alarmvolume").onmousedown = function (e) { newdraghandler(setvolume, setvolume); e.preventDefault(); }
- timelineroot = document.getElementById("timelineroot");
- retrieveTimeline();
- setInterval(retrieveTimeline,30*1000);
- updateClock();
- setInterval(updateClock,1000);
- }
- function setvolume(mouseloc) {
- var bounds, part;
- bounds = elid("alarmvolume").getBoundingClientRect();
- part = (mouseloc.x - bounds.left) / (bounds.right - bounds.left);
- if (part < 0) { part = 0; }
- if (part > 1) { part = 1; }
- elid("alarmvolumeinner").style.width = 100 * part + "%";
- settings.volume = part;
- }
- function settingsMenu() {
- var buttons = [].concat(
- // { t: "header", text: "Alarms" },
- // createUservarInput("suppress", settings.activeSuppress, { t: "bool", n: "Suppress alarms when rs is active" }),
- // createUservarInput("alarm",settings.globalAlarm, { t: "alarm", n: "Enable global alarm" }),
- { t: "header", text: "Display Alerts" },
- createUservarInput("cache",settings.cache, { t: "bool", n: "Display Guthix Cache" }),
- createUservarInput("warband",settings.warband, { t: "bool", n: "Display Warbands" }),
- createUservarInput("goebies",settings.goebies, { t: "bool", n: "Display Geoby Suply Runs" }),
- createUservarInput("prifddinas",settings.prifddinas, { t: "bool", n: "Display All Prifddinas Hours" }),
- createUservarInput("Cadarn",settings.Cadarn, { t: "bool", n: "Display Cadarn Hours" }),
- createUservarInput("Amlodd",settings.Amlodd, { t: "bool", n: "Display Amlodd Hours" }),
- createUservarInput("Crwys",settings.Crwys, { t: "bool", n: "Display Crwys Hours" }),
- createUservarInput("Ithell",settings.Ithell, { t: "bool", n: "Display Ithell Hours" }),
- createUservarInput("Hefin",settings.Hefin, { t: "bool", n: "Display Hefin Hours" }),
- createUservarInput("Meilyr",settings.Meilyr, { t: "bool", n: "Display Meilyr Hours" }),
- createUservarInput("Trahaearn",settings.Trahaearn, { t: "bool", n: "Display Trahaearn Hours" }),
- createUservarInput("Iorwerth",settings.Iorwerth, { t: "bool", n: "Display Iorwerth Hours" }),
- { t: "h/11" },
- { t: "button:confirm", text: "Confirm" },
- { t: "button:cancel", text: "cancel" }
- );
- var box = promptbox2({ title: "Settings", style: "popup", width: 300, stylesheets: ["style.css"] }, buttons);
- box.cancel.onclick = box.frame.close.b();
- box.confirm.onclick = function () {
- // settings.activeSuppress = box.suppress.getValue();
- // settings.globalAlarm = box.alarm.getValue();
- settings.cache = box.cache.getValue();
- settings.warband = box.warband.getValue();
- settings.goebies = box.goebies.getValue();
- settings.prifddinas = box.prifddinas.getValue();
- settings.Cadarn = box.Cadarn.getValue();
- settings.Amlodd = box.Amlodd.getValue();
- settings.Crwys = box.Crwys.getValue();
- settings.Ithell = box.Ithell.getValue();
- settings.Hefin = box.Hefin.getValue();
- settings.Meilyr = box.Meilyr.getValue();
- settings.Trahaearn = box.Trahaearn.getValue();
- settings.Iorwerth = box.Iorwerth.getValue();
- box.frame.close();
- retrieveTimeline();
- };
- }
- function retrieveTimeline(){
- var Httpreq = new XMLHttpRequest(); // a new request
- Httpreq.open("GET","timeline.php",false);
- Httpreq.send(null);
- displayTimeline(JSON.parse(Httpreq.responseText));
- }
- function displayTimeline(data){
- var length = 10;
- var entry = "";
- var date;
- if(data.length < 10){
- length = data.length;
- }
- timelineroot.innerHTML = "";
- for(var count = 0; count < length; count++){
- if((data[count].type === "prifddinas" && settings['prifddinas'] && (settings[data[count].districts[0]] || settings[data[count].districts[1]])) || settings[data[count].type]) {
- entry = "<div class=\"entry\"><div class=\"time\">";
- date = new Date(data[count].time.date.substr(0,19).replace(" ","T"));
- entry += date.getUTCHours() + ":" + (date.getUTCMinutes()<10?'0':'') + date.getUTCMinutes();
- entry += "</div><div class=\"text\">";
- if(data[count].type === "prifddinas"){
- entry += "Prifddinas: ";
- entry += "<div class=\"popover\" title=\"" + districts[data[count].districts[0]].text + "\">" + data[count].districts[0] + "</div> and ";
- entry += "<div class=\"popover\" title=\"" + districts[data[count].districts[1]].text + "\">" + data[count].districts[1] + "</div> districts";
- } else {
- entry += data[count].text;
- }
- entry += "</div></div>";
- timelineroot.innerHTML += entry;
- }
- }
- }
- function updateClock(){
- var clock = document.getElementById("clock");
- var d1 = new Date();
- clock.innerHTML = d1.getUTCHours() + ":" + d1.getUTCMinutes() + ":" + d1.getUTCSeconds();
- }
- </script>
- </head>
- <body class="nis" onload="start();">
- <div id="settingsbar">
- <div style="display:flex; flex-direction:row; align-items:center; float:clear;">
- <div id="settingsbutton" onclick="settingsMenu();" title="Settings" class="nissmallimagebutton menubutton"></div>
- <div id="clock" style="padding-left:5px;color:white;">0:00:00</div>
- <!-- <div id="alarmvolume" title="Alarm volume"><div id="alarmvolumeinner" style="width: 50%;"></div></div> -->
- </div>
- <div class="nisseperator"></div>
- </div>
- <div id="timelinewrapper">
- <div id="timelineroot"></div>
- </div>
- </body>
Add Comment
Please, Sign In to add comment