123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130 |
- var Options = "----------------------------------------|";
- function cookieLoad() {
- if (document.cookie.indexOf("OmnomIRC") >= 0) {
- Options = document.cookie.replace(/^.*OmnomIRC=(.+?)|.*/, "\$1");
- }
- else {
- document.cookie = "OmnomIRC=" + Options + ";expires=Sat, 20 Nov 2286 17:46:39 GMT;";
- }
- }
-
- function getOption(Option,def) {
- if (Option < 1 || Option > 40)
- return 0;
- result = Options.charAt(Option - 1);
- result;
- if (result == '-')
- return def;
- return result;
-
- }
-
- function setOption(Option, value,noRefresh) {
- if (Option < 1 || Option > 40)
- return;
- Options = Options.substring(0, Option - 1) + value + Options.substring(Option);
- document.cookie = "OmnomIRC=" + Options + ";expires=Sat, 20 Nov 2286 17:46:39 GMT;";
- if (!noRefresh)
- document.location.reload();
- }
-
- function getHTMLToggle(State, StateOn, StateOff,StateOnFunc,StateOffFunc) {
- result = "";
- if (State){
- result += "<b>";
- result += StateOn;
- result += "</b>";
- }
- else
- {
- result += '<a href="#" onclick="'+StateOnFunc+'">';
- result += StateOn;
- result += '</a>';
- }
- result += "</td><td>";
- if (!State)
- {
- result += "<b>";
- result += StateOff;
- result += "</b>";
- }
- else
- {
- result += '<a href="#" onclick="'+StateOffFunc+'">';
- result += StateOff;
- result += '</a>';
- }
- return result;
- }
- function clearCookies()
- {
- document.cookie = "OmnomIRC=a;expires=Thu, 01-Jan-1970 00:00:01 GMT;";
- document.cookie = "OmnomChannels=a;expires=Thu, 01-Jan-1970 00:00:01 GMT;";
- document.location.reload();
- }
- window.onLoad=cookieLoad();
- function showNotification(message)
- {
- if (window.webkitNotifications == undefined || window.webkitNotifications == null || !window.webkitNotifications)
- return 0;
- if (window.webkitNotifications.checkPermission() != 0)
- return 0;
- var n
- n = window.webkitNotifications.createNotification('http://www.omnimaga.org/favicon.ico', 'OmnomIRC Highlight', message);
- n.show();
- }
-
- function setAllowNotification()
- {
- if (window.webkitNotifications == undefined || window.webkitNotifications == null || !window.webkitNotifications)
- {
- alert("This feature only works in chrome.");
- return;
- }
- window.webkitNotifications.requestPermission(permissionGranted);
-
- }
-
- function permissionGranted()
- {
- if (window.webkitNotifications.checkPermission() == 0)
- {
- showNotification("Notifications Enabled!");
- setOption(7,'T');
- window.location.refresh(true);
- }
- }
|