diff --git a/README b/README
new file mode 100644
index 0000000..f05d5e1
--- /dev/null
+++ b/README
@@ -0,0 +1,4 @@
+Blinking Alert
+--------------
+
+Thunderbird add-on
diff --git a/src/chrome.manifest b/src/chrome.manifest
new file mode 100644
index 0000000..81ec422
--- /dev/null
+++ b/src/chrome.manifest
@@ -0,0 +1,5 @@
+content blinkingalert chrome/content/
+locale blinkingalert en chrome/locale/en/
+locale blinkingalert ja chrome/locale/ja/
+overlay chrome://messenger/content/preferences/notifications.xul chrome://blinkingalert/content/preferences/notifications.xul
+overlay chrome://messenger/content/newmailalert.xul chrome://blinkingalert/content/messenger/newmailalert.xul
diff --git a/src/chrome/content/messenger/newmailalert.js b/src/chrome/content/messenger/newmailalert.js
new file mode 100644
index 0000000..5526cac
--- /dev/null
+++ b/src/chrome/content/messenger/newmailalert.js
@@ -0,0 +1,122 @@
+/*
+ * Blinking Alert
+ *
+ * Copyright(c) 2007-2014 Iwasa Kazmi
+ * All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+(function(window) {
+
+ var debug = false;
+
+ var consoleService = Components.classes["@mozilla.org/consoleservice;1"]
+ .getService(Components.interfaces.nsIConsoleService);
+ function log(msg) {
+ if (debug) {
+ consoleService.logStringMessage("Blinking Alert : " + msg);
+ }
+ }
+
+ log("addEventListener");
+
+ window.addEventListener("load", function() {
+ log("onload");
+
+ // original handlers
+ var onAlertLoadOrig = window.onAlertLoad;
+ var fadeOutAlertOrig = window.fadeOutAlert;
+ var closeAlertOrig = window.closeAlert;
+
+ log("onAlertLoadOrig : " + typeof(onAlertLoadOrig));
+ log("fadeOutAlertOrig : " + typeof(fadeOutAlertOrig));
+ log("closeAlertOrig : " + typeof(closeAlertOrig));
+
+ // settings
+ var blinkInterval = 0;
+ var blinkColor = "#ff6600";
+ var disableAutoHide = false;
+ var closeOnClick = false;
+
+ // original background color
+ var origBackgroundColor = '';
+ var hasOrigBackgroundColor = false;
+
+ // replace fadeOutAlert()
+ window.fadeOutAlert = function() {
+ log("fadeOutAlert called");
+ if (!disableAutoHide && fadeOutAlertOrig != null) {
+ log("call original fadeOutAlert");
+ fadeOutAlertOrig();
+ fadeOutAlertOrig = null;
+ }
+ };
+
+ // handle click event
+ window.addEventListener("click", function() {
+ log("onclick");
+ if (closeOnClick && closeAlertOrig != null) {
+ log("call original closeAlert");
+ closeAlertOrig();
+ closeAlertOrig = null;
+ }
+ }, false);
+
+ // blinking function
+ var blink2 = null;
+ var blink1 = function() {
+ log("blink1");
+ var elem = document.getElementById("alertBox");
+ if (elem) {
+ if (!hasOrigBackgroundColor) {
+ origBackgroundColor = elem.style.backgroundColor;
+ hasOrigBackgroundColor = true;
+ }
+ elem.style.backgroundColor = blinkColor;
+ setTimeout(blink2, blinkInterval);
+ }
+ };
+
+ blink2 = function() {
+ log("blink2");
+ var elem = document.getElementById("alertBox");
+ if (elem) {
+ elem.style.backgroundColor = origBackgroundColor;
+ setTimeout(blink1, blinkInterval);
+ }
+ };
+
+ // read out our initial settings from prefs.
+ try {
+ var prefBranch = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefService).getBranch(null);
+ disableAutoHide = prefBranch.getBoolPref("extensions.blinkingAlert.disableAutoHide");
+ blinkInterval = prefBranch.getIntPref ("extensions.blinkingAlert.blinkInterval");
+ blinkColor = prefBranch.getCharPref("extensions.blinkingAlert.blinkColor");
+ closeOnClick = prefBranch.getBoolPref("extensions.blinkingAlert.closeOnClick");
+ } catch (ex) {}
+
+ // set time to start blinking
+ if (blinkInterval > 0) {
+ log("start blinking");
+ setTimeout(blink1, 0);
+ }
+ }, false);
+})(window);
+
diff --git a/src/chrome/content/messenger/newmailalert.xul b/src/chrome/content/messenger/newmailalert.xul
new file mode 100644
index 0000000..1ef0803
--- /dev/null
+++ b/src/chrome/content/messenger/newmailalert.xul
@@ -0,0 +1,32 @@
+
+
+
+
+
+
diff --git a/src/chrome/content/options.xul b/src/chrome/content/options.xul
new file mode 100644
index 0000000..d5b7b60
--- /dev/null
+++ b/src/chrome/content/options.xul
@@ -0,0 +1,45 @@
+
+
+
+
+
+
+
+
+ %notificationsDTD;
+]>
+
+
+
diff --git a/src/chrome/content/preferences/notifications.xul b/src/chrome/content/preferences/notifications.xul
new file mode 100644
index 0000000..501ace8
--- /dev/null
+++ b/src/chrome/content/preferences/notifications.xul
@@ -0,0 +1,52 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/chrome/locale/en/common.properties b/src/chrome/locale/en/common.properties
new file mode 100644
index 0000000..323cbc2
--- /dev/null
+++ b/src/chrome/locale/en/common.properties
@@ -0,0 +1 @@
+extensions.{06f79612-34ef-4f4b-beab-0902b61fcc4b}.description=Adds extra features to the new-mail alert
diff --git a/src/chrome/locale/en/notifications.dtd b/src/chrome/locale/en/notifications.dtd
new file mode 100644
index 0000000..4c63684
--- /dev/null
+++ b/src/chrome/locale/en/notifications.dtd
@@ -0,0 +1,32 @@
+
+
+
+
+
+
+
diff --git a/src/chrome/locale/ja/common.properties b/src/chrome/locale/ja/common.properties
new file mode 100644
index 0000000..f6d2ec5
--- /dev/null
+++ b/src/chrome/locale/ja/common.properties
@@ -0,0 +1 @@
+extensions.{06f79612-34ef-4f4b-beab-0902b61fcc4b}.description=新着メール通知に付加機能を追加します
diff --git a/src/chrome/locale/ja/notifications.dtd b/src/chrome/locale/ja/notifications.dtd
new file mode 100644
index 0000000..9660260
--- /dev/null
+++ b/src/chrome/locale/ja/notifications.dtd
@@ -0,0 +1,32 @@
+
+
+
+
+
+
+
diff --git a/src/defaults/preferences/blinkingalert.js b/src/defaults/preferences/blinkingalert.js
new file mode 100644
index 0000000..7bedebc
--- /dev/null
+++ b/src/defaults/preferences/blinkingalert.js
@@ -0,0 +1,29 @@
+/*
+ * Blinking Alert
+ *
+ * Copyright(c) 2007-2014 Iwasa Kazmi
+ * All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+pref("extensions.{06f79612-34ef-4f4b-beab-0902b61fcc4b}.description", "chrome://blinkingalert/locale/common.properties");
+pref('extensions.blinkingAlert.disableAutoHide', false);
+pref('extensions.blinkingAlert.blinkInterval', 0);
+pref('extensions.blinkingAlert.blinkColor', '#ff6600');
+pref('extensions.blinkingAlert.closeOnClick', false);
diff --git a/src/install.rdf b/src/install.rdf
new file mode 100644
index 0000000..0ce81db
--- /dev/null
+++ b/src/install.rdf
@@ -0,0 +1,21 @@
+
+
+
+ {06f79612-34ef-4f4b-beab-0902b61fcc4b}
+ 1.2.0
+ 2
+
+
+ {3550f703-e582-4d05-9a08-453d09bdfdc6}
+ 24.*
+ 60.*
+
+
+ Blinking Alert
+ Adds extra features to the new-mail alert
+ Iwasa Kazmi
+ http://sites.google.com/site/icantlivewithoutit/
+ chrome://blinkingalert/content/options.xul
+
+
\ No newline at end of file