OFFLINE ALERT

When in Work Offline Mode, the webpage you are on will display OFFLINE to alert you that you are in Offline Mode.

2014-03-11 या दिनांकाला. सर्वात नवीन आवृत्ती पाहा.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey, Greasemonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्क्रिप्ट व्यवस्थापक एक्स्टेंशन इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्क्रिप्ट व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्टाईल व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

// ==UserScript==
// @name           OFFLINE ALERT
// @author         Written by Jefferson Scher
// @namespace      Requested by *Barbiegirl* (thread http://userscripts.org/topics/91003)(thankyou Jefferson)
// @description    When in Work Offline Mode, the webpage you are on will display OFFLINE to alert you that you are in Offline Mode.
// @version        1.0
// @include        http://*
// @include        https://*
// @include        *
// @include        about:blank
// @include        about:newtab
// @include        about:*
// @include        data:image/*
// @include        file:///*
// @include        file:*
// @include        file:///C:/Users/*
// @include        file:///*
// @include        file:///*.PNG
// ==/UserScript==



GM_addStyle("#offlinenotice{position:fixed!important;top:0!important;left:0!important;background:#ccc!important;opacity:0.95!important;padding:25% 0!important;text-align:center!important;z-index:999!important;color:#CC0000!important;font-family:verdana!important;font-size:10em!important;}");

function offNotice(e){
  var d = document.createElement("div");
  d.id = "offlinenotice";
  d.style.height = window.innerHeight + "px";
  d.style.width = window.innerWidth + "px";
  d.appendChild(document.createTextNode("OFFLINE"));
  document.body.appendChild(d);
}

function removeNotice(e){
  var d = document.getElementById("offlinenotice");
  if (d) d.parentNode.removeChild(d);
}

document.body.addEventListener("offline", offNotice, false);
document.body.addEventListener("online", removeNotice, false);

function offNotice(e){
  var d = document.createElement("div");
  d.id = "offlinenotice";
  d.style.height = window.innerHeight + "px";
  d.style.width = window.innerWidth + "px";
  d.appendChild(document.createTextNode("OFFLINE"));
  document.body.appendChild(d);
  // Hide Flash players
  var players = document.querySelectorAll("object, embed");
  for (var i=0; i<players.length; i++){
    if (players[i].hasAttribute("type")){ if (players[i].getAttribute("type") == "application/x-shockwave-flash"){
      if (window.getComputedStyle(players[i],null).getPropertyValue("visibility") == "visible"){
        players[i].style.visibility = "hidden";
        players[i].setAttribute("offlinehidden", "yes");
      }
    }}
  }
}

function removeNotice(e){
  var d = document.getElementById("offlinenotice");
  if (d) d.parentNode.removeChild(d);
  // Restore Flash players
  var restoreset = document.querySelectorAll("object[offlinehidden], embed[offlinehidden]");
  for (var i=0; i<restoreset.length; i++){
    restoreset[i].style.visibility = "visible";
    restoreset[i].removeAttribute("offlinehidden");
  }
}