diff --git a/extension/chrome/content/nightly.js b/extension/chrome/content/nightly.js index f6c54b1..8731a2b 100644 --- a/extension/chrome/content/nightly.js +++ b/extension/chrome/content/nightly.js @@ -15,20 +15,27 @@ variables: { return this._appInfo; }, + get titleversion() { return this.tabtitle + ' - ' + this.vendor + ' ' + this.name + ' ' + this.versionchannel + ' (' + this.appbuildid + ')'; }, + get defaulttitle() { return nightlyApp.defaultTitle; }, + get tabtitle() { return nightlyApp.tabTitle; }, get appid() this.appInfo.ID, + brandname: null, get vendor() { // Fix for vendor not being set in Mozilla Thunderbird return this.appInfo.name == "Thunderbird" && this.appInfo.vendor == "" ? "Mozilla" : this.appInfo.vendor; }, get name() this.appInfo.name, get version() this.appInfo.version, - get appbuildid() this.appInfo.appBuildID, - get platformbuildid() this.appInfo.platformBuildID, + get versionpretty() { return nightly.makeVersionPretty(this.version); }, + get displayversion() { return AppConstants.MOZ_APP_VERSION_DISPLAY; }, + get channel() { return nightly.updateChannel(); }, + get channelpretty() { return nightly.updateChannelPretty(); }, + get betarevision() { return nightly.betaRevision(this.version, this.displayversion); }, + get versionchannel() { return nightly.versionAndChannel(this.version, this.displayversion); }, get platformversion() this.appInfo.platformVersion, - get geckobuildid() this.appInfo.platformBuildID, - get geckoversion() this.appInfo.platformVersion, + get platformbuildid() this.appInfo.platformBuildID, + get appbuildid() this.appInfo.appBuildID, get changeset() { return nightly.getChangeset(); }, - brandname: null, get useragent() navigator.userAgent, get locale() { var registry = Components.classes["@mozilla.org/chrome/chrome-registry;1"] @@ -38,11 +45,9 @@ variables: { get os() this.appInfo.OS, get processor() this.appInfo.XPCOMABI.split("-")[0], get compiler() this.appInfo.XPCOMABI.split(/-(.*)$/)[1], - get defaulttitle() { return nightlyApp.defaultTitle; }, - get tabscount() { return nightlyApp.tabsCount; }, - get tabtitle() { return nightlyApp.tabTitle; }, - profile: null, toolkit: "cairo", + profile: null, + get tabscount() { return nightlyApp.tabsCount; }, flags: "" }, @@ -259,6 +264,42 @@ parseHTML: function(url, callback) { frame.contentDocument.location.href = url; }, +makeVersionPretty: function(ver) { + ver = ver.replace('0a2','0.0.0'); + ver = ver.replace('0a1','0.0.0'); + while (ver.match(new RegExp('\\.','g')).length < 3) { ver += '.0'; } + return ver; +}, +updateChannel: function() { + return Components.classes["@mozilla.org/preferences-service;1"] + .getService(Components.interfaces.nsIPrefService).getBranch("app.update.").getCharPref("channel"); +}, +updateChannelPretty: function() { + var channel = nightly.updateChannel(); + if (channel == 'release') { channel = 'Release' } + else if (channel == 'esr') { channel = 'ESR' } + else if (channel == 'beta') { channel = 'beta' } + else if (channel == 'aurora') { channel = 'Aurora' } + else if (channel == 'nightly') { channel = 'Nighty' } + else if (channel == 'default') { channel = 'Default' } + else channel = ''; + return channel; +}, +betaRevision: function(ver, displayversion) { + var beta = displayversion.replace(ver + 'b',''); + if (beta == displayversion) { beta = ''; }; + return beta; +}, +versionAndChannel: function(ver, displayversion) { + var channel = nightly.updateChannelPretty(); + var beta = nightly.betaRevision(ver, displayversion); + if (channel == 'Release' || channel == 'Default') { channel = ''; } + if (channel == 'beta' && beta != '') { channel += ' ' + beta; } + ver = nightly.makeVersionPretty(ver); + if (channel != '') { ver += ' ' + channel; } + return ver; +}, + pastebinAboutSupport: function() { nightly.parseHTML("about:support", function(doc) { var contents = doc.getElementById("contents"); diff --git a/extension/chrome/content/titlebar/customize.js b/extension/chrome/content/titlebar/customize.js index 3b49db2..1cb3e33 100644 --- a/extension/chrome/content/titlebar/customize.js +++ b/extension/chrome/content/titlebar/customize.js @@ -83,26 +83,33 @@ init: function(aEvent) paneTitle.bundle=document.getElementById("variablesBundle"); - paneTitle.addVariable("AppBuildID"); + paneTitle.addVariable("TitleVersion"); + paneTitle.addVariable("DefaultTitle"); + paneTitle.addVariable("TabTitle"); paneTitle.addVariable("AppID"); paneTitle.addVariable("BrandName"); + paneTitle.addVariable("Vendor"); + paneTitle.addVariable("Name"); + paneTitle.addVariable("Version"); + paneTitle.addVariable("VersionPretty"); + paneTitle.addVariable("DisplayVersion"); + paneTitle.addVariable("Channel"); + paneTitle.addVariable("ChannelPretty"); + paneTitle.addVariable("BetaRevision"); + paneTitle.addVariable("VersionChannel"); + paneTitle.addVariable("PlatformVersion"); + paneTitle.addVariable("PlatformBuildID"); + paneTitle.addVariable("AppBuildID"); paneTitle.addVariable("Changeset"); - paneTitle.addVariable("Compiler"); - paneTitle.addVariable("DefaultTitle"); - paneTitle.addVariable("GeckoVersion"); + paneTitle.addVariable("UserAgent"); paneTitle.addVariable("Locale"); - paneTitle.addVariable("Name"); paneTitle.addVariable("OS"); - paneTitle.addVariable("PlatformBuildID"); - paneTitle.addVariable("PlatformVersion"); paneTitle.addVariable("Processor"); + paneTitle.addVariable("Compiler"); + paneTitle.addVariable("Toolkit"); paneTitle.addVariable("Profile"); paneTitle.addVariable("TabsCount"); - paneTitle.addVariable("TabTitle"); - paneTitle.addVariable("Toolkit"); - paneTitle.addVariable("UserAgent"); - paneTitle.addVariable("Vendor"); - paneTitle.addVariable("Version"); + paneTitle.setupTree(); }, diff --git a/extension/chrome/locale/en-US/variables.properties b/extension/chrome/locale/en-US/variables.properties index 57d4d01..c055382 100644 --- a/extension/chrome/locale/en-US/variables.properties +++ b/extension/chrome/locale/en-US/variables.properties @@ -2,24 +2,29 @@ # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. # +variable.TitleVersion.description=Application Title and Version +variable.DefaultTitle.description=Default Application Title +variable.TabTitle.description=Current Tab's Title variable.AppID.description=Application Identifier +variable.BrandName.description=Application Brand Name variable.Vendor.description=Application Vendor variable.Name.description=Application Name variable.Version.description=Application Version +variable.VersionPretty.description=Application Version Pretty +variable.DisplayVersion.description=Application Display Version +variable.Channel.description=Application Update Channel +variable.ChannelPretty.description=Application Update Channel Pretty +variable.BetaRevision.description=Application Beta Revision +variable.VersionChannel.description=Application Version and Channel +variable.PlatformVersion.description=XUL Platform Version +variable.PlatformBuildID.description=XUL Platform Build Identifier variable.AppBuildID.description=Application Build Identifier variable.Changeset.description=Built from that changeset -variable.PlatformBuildID.description=XUL Platform Build Identifier -variable.PlatformVersion.description=XUL Platform Version -variable.GeckoBuildID.description=Gecko Build Identifier -variable.GeckoVersion.description=Gecko Version -variable.BrandName.description=Application Brand Name variable.UserAgent.description=User Agent String variable.Locale.description=Current Locale variable.OS.description=Compilation OS variable.Processor.description=Compilation Processor variable.Compiler.description=Compiler -variable.DefaultTitle.description=Default Application Title -variable.TabTitle.description=Current Tab's Title -variable.Profile.description=Current Profile variable.Toolkit.description=Graphics Toolkit -variable.TabsCount.description=Count of visible tabs +variable.Profile.description=Current Profile +variable.TabsCount.description=Number of visible tabs diff --git a/extension/chrome/skin/titlebar/titlebar.css b/extension/chrome/skin/titlebar/titlebar.css index 2491978..b0a3093 100644 --- a/extension/chrome/skin/titlebar/titlebar.css +++ b/extension/chrome/skin/titlebar/titlebar.css @@ -3,9 +3,9 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #variableTree { - height: 17em; + height: 23em; } #NightlyTesterOptions { - width: 42.75em; + width: 56em; }