aboutsummaryrefslogtreecommitdiffstats
path: root/pagemod.js
diff options
context:
space:
mode:
authorMatěj Cepl <mcepl@redhat.com>2009-11-15 23:38:56 +0100
committerMatěj Cepl <mcepl@redhat.com>2009-11-15 23:38:56 +0100
commitf6473374cf5984ebdb3e96edc1e176ae65bc2eac (patch)
tree851bcae1bcc7309d58b48c9d7bc1b7988a637e6f /pagemod.js
parent56c6054e53f51abe940561b49280feb569f8f846 (diff)
downloadbugzilla-triage-f6473374cf5984ebdb3e96edc1e176ae65bc2eac.tar.gz
We want to follow jetpack directory. Filtering out will be done before
merge to master.
Diffstat (limited to 'pagemod.js')
-rw-r--r--pagemod.js26
1 files changed, 26 insertions, 0 deletions
diff --git a/pagemod.js b/pagemod.js
new file mode 100644
index 0000000..02d4c16
--- /dev/null
+++ b/pagemod.js
@@ -0,0 +1,26 @@
+jetpack.future.import("pageMods");
+var callback = function(document){
+// check the current time if it is between 9 and 5
+// 'blacklist' the sites in options.matches
+var currentTime;
+var currentHour;
+currentTime = new Date();
+currentHour = currentTime.getHours();
+if (currentHour> 8 && currentHour <17){
+ document.title = "This site is blacklisted. Get some work done!";
+ $(document).find("body").css({border:"3px solid #000000"});
+ $(document).find("body").children().hide();
+ $(document).find("body").prepend($('<h1>Sorry this site is blacklisted until 17:00. sadface.'));
+ }
+};
+var options = {};
+
+options.matches = ["http://*.reddit.com/*",
+"http://*.cnn.com/*",
+"http://*.bbc.co.uk/*",
+"http://*.dpreview.com/*",
+"http://dpreview.com/*",
+"http://*.bloglines.com/*",
+"http://bloglines.com/*"];
+
+jetpack.pageMods.add(callback, options);