[Pkg-mozext-commits] [compactheader] 123/441: New version 1.1.5 (beta1): Toggle icon of message flag button corresponding to the flag state of the message

David Prévot taffit at moszumanska.debian.org
Wed Mar 18 12:28:50 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository compactheader.

commit 0007107e06fd5c9905e85949ce625fbc2a8e8cf2
Author: joachim.herb <none at none>
Date:   Sun Jan 3 01:29:11 2010 +0000

    New version 1.1.5 (beta1):
    Toggle icon of message flag button corresponding to the flag state of the message
---
 chrome/CompactHeader/content/buttonsOverlay.js |  83 +++++++++++++++++++++++++
 chrome/CompactHeader/skin/gnome/flag-empty.png | Bin 0 -> 514 bytes
 chrome/CompactHeader/skin/gnome/flag.png       | Bin 0 -> 535 bytes
 3 files changed, 83 insertions(+)

diff --git a/chrome/CompactHeader/content/buttonsOverlay.js b/chrome/CompactHeader/content/buttonsOverlay.js
new file mode 100644
index 0000000..bbcec15
--- /dev/null
+++ b/chrome/CompactHeader/content/buttonsOverlay.js
@@ -0,0 +1,83 @@
+/*# -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
+# ***** BEGIN LICENSE BLOCK *****
+# Version: MPL 1.1/GPL 2.0/LGPL 2.1
+#
+# The contents of this file are subject to the Mozilla Public License Version
+# 1.1 (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+# http://www.mozilla.org/MPL/
+#
+# Software distributed under the License is distributed on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+# for the specific language governing rights and limitations under the
+# License.
+#
+# The Original Code is Mozilla Communicator client code, released
+# March 31, 1998.
+#
+# The Initial Developer of the Original Code is
+# Netscape Communications Corporation.
+# Portions created by the Initial Developer are Copyright (C) 1998-1999
+# the Initial Developer. All Rights Reserved.
+#
+# Contributor(s):
+#   Joachim Herb <joachim.herb at gmx.de>
+#
+# Alternatively, the contents of this file may be used under the terms of
+# either the GNU General Public License Version 2 or later (the "GPL"), or
+# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+# in which case the provisions of the GPL or the LGPL are applicable instead
+# of those above. If you wish to allow use of your version of this file only
+# under the terms of either the GPL or the LGPL, and not to allow others to
+# use your version of this file under the terms of the MPL, indicate your
+# decision by deleting the provisions above and replace them with the notice
+# and other provisions required by the GPL or the LGPL. If you do not delete
+# the provisions above, a recipient may use your version of this file under
+# the terms of any one of the MPL, the GPL or the LGPL.
+#
+# ***** END LICENSE BLOCK *****
+*/
+
+if(!org) var org={};
+if(!org.mozdev) org.mozdev={};
+if(!org.mozdev.compactHeader) org.mozdev.compactHeader = {};
+
+org.mozdev.compactHeader.buttons = function() {
+  var pub = {};
+  const MSG_FLAG_FLAGGED = 0x4;
+
+  pub.init = function () {
+    var mailSession = Components.classes["@mozilla.org/messenger/services/session;1"]
+                                .getService(Components.interfaces.nsIMsgMailSession);
+    var nsIFolderListener = Components.interfaces.nsIFolderListener;
+    mailSession.AddFolderListener(folderListener, nsIFolderListener.propertyFlagChanged);
+  }
+
+  pub.coheToggleStar = function () {
+    var starButton = document.getElementById("header-view-toolbox").getElementsByAttribute("id", "button-starMessages")[0];
+
+    if (starButton) {
+      //alert("test2");
+      var firstSelectedMessage = gFolderDisplay.selectedMessage;
+      if (firstSelectedMessage && firstSelectedMessage.isFlagged) {
+        starButton.setAttribute("flagged", "true");
+      }
+      else {
+        starButton.removeAttribute("flagged");
+      }
+    }
+  }
+
+  var folderListener = {
+    OnItemPropertyFlagChanged: function(item, property, oldFlag, newFlag) {
+      var changedFlag = oldFlag ^ newFlag;
+      
+      if (changedFlag & MSG_FLAG_FLAGGED) {
+        pub.coheToggleStar();
+      }
+    },
+  }
+  return pub;
+}();
+
+org.mozdev.compactHeader.buttons.init();
diff --git a/chrome/CompactHeader/skin/gnome/flag-empty.png b/chrome/CompactHeader/skin/gnome/flag-empty.png
new file mode 100644
index 0000000..528eba4
Binary files /dev/null and b/chrome/CompactHeader/skin/gnome/flag-empty.png differ
diff --git a/chrome/CompactHeader/skin/gnome/flag.png b/chrome/CompactHeader/skin/gnome/flag.png
new file mode 100644
index 0000000..972cb05
Binary files /dev/null and b/chrome/CompactHeader/skin/gnome/flag.png differ

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/compactheader.git



More information about the Pkg-mozext-commits mailing list