[Pkg-mozext-commits] [compactheader] 103/441: New version 1.1.0: Flat buttons in the header pane Additional classes for buttons in header pane.
David Prévot
taffit at moszumanska.debian.org
Wed Mar 18 12:28:48 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 cc4f4db907218c1c364eca35ce224a7928c7cb1a
Author: joachim.herb <none at none>
Date: Sat Dec 5 22:23:43 2009 +0000
New version 1.1.0: Flat buttons in the header pane
Additional classes for buttons in header pane.
---
.../CompactHeader/content/compactHeaderOverlay.js | 103 ++++++++++++++++++++-
chrome/CompactHeader/content/preferences.js | 35 +------
2 files changed, 101 insertions(+), 37 deletions(-)
diff --git a/chrome/CompactHeader/content/compactHeaderOverlay.js b/chrome/CompactHeader/content/compactHeaderOverlay.js
index f659388..6b38156 100644
--- a/chrome/CompactHeader/content/compactHeaderOverlay.js
+++ b/chrome/CompactHeader/content/compactHeaderOverlay.js
@@ -117,7 +117,7 @@ org.mozdev.compactHeader.pane = function() {
function coheOutputEmailAddresses(headerEntry, emailAddresses) {
/* function copied from comm-1.9.1/ mail/ base/ content/ msgHdrViewOverlay.js 771135e6aaf5 */
- if (!emailAddresses)
+ if (!emailAddresses)
return;
var addresses = {};
@@ -255,6 +255,8 @@ org.mozdev.compactHeader.pane = function() {
}
coheToggleHeaderContent();
+ setButtonStyle();
+ org.mozdev.customizeHeaderToolbar.messenger.saveToolboxData();
}
var coheMessageListener =
@@ -384,7 +386,7 @@ org.mozdev.compactHeader.pane = function() {
if (hdrButton.localName == "toolbaritem") {
var subButtons = hdrButton.querySelectorAll(".toolbarbutton-1");
for (var j=0; j<subButtons.length; j++) {
- addClass(subButtons[j], "msgHeaderView-button");
+ addClass(subButtons[j], "msgHeaderView-button-out");
}
} else {
if (hdrButton.type != "menu-button") {
@@ -432,7 +434,99 @@ org.mozdev.compactHeader.pane = function() {
}
}
}
-
+
+ function setButtonStyle() {
+ var hdrToolbar = document.getElementById("header-view-toolbar");
+ var hdrToolbox = document.getElementById("header-view-toolbox");
+ var buttons = hdrToolbar.querySelectorAll("toolbarbutton");
+ for (var i=0; i<buttons.length; i++) {
+ var button = buttons[i];
+ if (button) {
+ addClass(button, "customize-header-toolbar-button");
+ addClass(button, "customize-header-toolbar-" + button.id)
+ if (cohePrefBranch.getBoolPref("headersize.flatButtons")) {
+ if (button.type != "menu-button") {
+ addClass(button, "msgHeaderView-flat-button");
+ } else {
+ removeClass(button, "msgHeaderView-flat-button");
+ removeClass(button, "msgHeaderView-button");
+ removeClass(button, "msgHeaderView-button-out");
+ addClass(button, "msgHeaderView-flat-button-out");
+ }
+ } else {
+ if (button.type != "menu-button") {
+ removeClass(button, "msgHeaderView-flat-button");
+ } else {
+ removeClass(button, "msgHeaderView-flat-button");
+ removeClass(button, "msgHeaderView-button");
+ removeClass(button, "msgHeaderView-flat-button-out");
+ addClass(button, "msgHeaderView-button-out");
+ }
+ }
+ }
+ }
+
+ var buttons = hdrToolbar.querySelectorAll("toolbaritem");
+ for (var i=0; i<buttons.length; i++) {
+ var button = buttons[i];
+ if (button) {
+ addClass(button, "customize-header-toolbar-button");
+ addClass(button, "customize-header-toolbar-" + button.id)
+ if (cohePrefBranch.getBoolPref("headersize.flatButtons")) {
+ removeClass(button, "msgHeaderView-button-out-item");
+ addClass(button, "msgHeaderView-flat-button-out-item");
+ } else {
+ removeClass(button, "msgHeaderView-flat-button-out-item");
+ addClass(button, "msgHeaderView-button-out-item");
+ }
+ }
+ }
+
+ buttons = hdrToolbox.palette.querySelectorAll("toolbarbutton");
+ for (var i=0; i<buttons.length; i++) {
+ var button = buttons[i];
+ if (button) {
+ addClass(button, "customize-header-toolbar-button");
+ addClass(button, "customize-header-toolbar-" + button.id)
+ if (cohePrefBranch.getBoolPref("headersize.flatButtons")) {
+ if (button.getAttribute("type") != "menu-button") {
+ addClass(button, "msgHeaderView-flat-button");
+ } else {
+ removeClass(button, "msgHeaderView-flat-button");
+ removeClass(button, "msgHeaderView-button");
+ removeClass(button, "msgHeaderView-button-out");
+ addClass(button, "msgHeaderView-flat-button-out");
+ }
+ } else {
+ if (button.getAttribute("type") != "menu-button") {
+ removeClass(button, "msgHeaderView-flat-button");
+ } else {
+ removeClass(button, "msgHeaderView-flat-button");
+ removeClass(button, "msgHeaderView-button");
+ removeClass(button, "msgHeaderView-flat-button-out");
+ addClass(button, "msgHeaderView-button-out");
+ }
+ }
+ }
+ }
+
+ buttons = hdrToolbox.palette.querySelectorAll("toolbaritem");
+ for (var i=0; i<buttons.length; i++) {
+ var button = buttons[i];
+ if (button) {
+ addClass(button, "customize-header-toolbar-button");
+ addClass(button, "customize-header-toolbar-" + button.id)
+ if (cohePrefBranch.getBoolPref("headersize.flatButtons")) {
+ removeClass(button, "msgHeaderView-button-out-item");
+ addClass(button, "msgHeaderView-flat-button-out-item");
+ } else {
+ removeClass(button, "msgHeaderView-flat-button-out-item");
+ addClass(button, "msgHeaderView-button-out-item");
+ }
+ }
+ }
+ }
+
pub.coheToggleHeaderView = function() {
gCoheCollapsedHeaderViewMode = !gCoheCollapsedHeaderViewMode;
@@ -565,7 +659,8 @@ org.mozdev.compactHeader.pane = function() {
}
function removeClass(el, strClass) {
- el.className = el.className.replace(strClass, '');
+ var str = new RegExp(strClass, 'g');
+ el.className = el.className.replace(str, '');
}
function CoheCopyWebsiteAddress(websiteAddressNode)
diff --git a/chrome/CompactHeader/content/preferences.js b/chrome/CompactHeader/content/preferences.js
index 17907f0..544cb5b 100644
--- a/chrome/CompactHeader/content/preferences.js
+++ b/chrome/CompactHeader/content/preferences.js
@@ -42,39 +42,6 @@ org.mozdev.compactHeader.preferences = function() {
gXMLHttpRequest.send(null);
}
- function updateCohe()
- {
- var updateAMO = false;
- var updateMozdev = false;
-
- var gExtensionManager = Components.classes["@mozilla.org/extensions/manager;1"]
- .getService(Components.interfaces.nsIExtensionManager);
- var strCoheVersion = gExtensionManager.getItemForID("{58D4392A-842E-11DE-B51A-C7B855D89593}").version;
-
- if (gXMLHttpRequest.readyState == 4) {
- var data = gXMLHttpRequest.responseXML;
- var updates = data.getElementsByTagName("update");
- for (var i = 0; i < updates.length; i++) {
- var strServer, strVersion;
- var update = updates[i];
- strServer = update.getAttribute("server");
- strVersion = update.getAttribute("version");
- var x = Components.classes["@mozilla.org/xpcom/version-comparator;1"]
- .getService(Components.interfaces.nsIVersionComparator)
- .compare(strVersion, strCoheVersion);
-
- if ((strServer == "AMO") && (x > 0)) {
- updateAMO = true;
- document.getElementById("UpdateAMO").setAttribute("disabled", "false");
- } else if ((strServer == "mozdev") && (x > 0)) {
- updateAMO = true;
- document.getElementById("UpdateMOZDEV").setAttribute("disabled", "false");
- }
- }
- }
- }
-
-
pub.onLoad = function()
{
//document.getElementById("coheSearchUpdates").setAttribute("hidden", disableUpdate());
@@ -87,6 +54,7 @@ org.mozdev.compactHeader.preferences = function() {
loadPrefCheckbox("headersize.linkify", "checkbox.Linkify");
//loadPrefInt("headersize.addressstyle", "AddressStyle");
loadPrefCheckbox("headersize.addressstyle", "checkbox.ShowOnlyAddress");
+ loadPrefCheckbox("headersize.flatButtons", "checkbox.flatButtons");
}
///////////////////////////////////////////////////////////////////////////////
@@ -103,6 +71,7 @@ org.mozdev.compactHeader.preferences = function() {
savePrefCheckbox("headersize.linkify", "checkbox.Linkify");
//savePrefInt("headersize.addressstyle", "AddressStyle");
savePrefCheckbox("headersize.addressstyle", "checkbox.ShowOnlyAddress");
+ savePrefCheckbox("headersize.flatButtons", "checkbox.flatButtons");
return true;
}
--
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