Skip to content

Commit

Permalink
Add new variable for visible tabs (mozilla#173)
Browse files Browse the repository at this point in the history
  • Loading branch information
KOLANICH authored and xabolcs committed Oct 6, 2014
1 parent f356a14 commit 0553dec
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 1 deletion.
4 changes: 4 additions & 0 deletions extension/chrome/content/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ get defaultTitle() {
return tabbrowser.getWindowTitleForBrowser(tabbrowser.mCurrentBrowser);
},

get tabsCount() {
var tabbrowser = document.getElementById("content");
return tabbrowser.visibleTabs ? tabbrowser.visibleTabs.length : tabbrowser.browsers.length;
},
get tabTitle() {
var tabbrowser = document.getElementById("content");
return tabbrowser.mCurrentBrowser.contentTitle;
Expand Down
4 changes: 4 additions & 0 deletions extension/chrome/content/messenger.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ get defaultTitle() {
return nightlyApp.getWindowTitleForMessenger(tabmail.currentTabInfo);
},

get tabsCount() {
var tabmail = document.getElementById("tabmail");
return tabmail.tabInfo.length;
},
get tabTitle() {
var tabmail = document.getElementById("tabmail");
return tabmail.currentTabInfo.title;
Expand Down
1 change: 1 addition & 0 deletions extension/chrome/content/nightly.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ variables: {
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",
Expand Down
3 changes: 3 additions & 0 deletions extension/chrome/content/suite.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ get defaultTitle() {
}
},

get tabsCount() {
return gBrowser.browsers.length;
},
get tabTitle() {
if (nightlyApp.oldUpdateTitlebar) {
return gBrowser.contentTitle;
Expand Down
2 changes: 1 addition & 1 deletion extension/chrome/content/titlebar/customize.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ init: function(aEvent)
paneTitle.addVariable("Compiler");
paneTitle.addVariable("Toolkit");
paneTitle.addVariable("Profile");

paneTitle.addVariable("TabsCount");
paneTitle.setupTree();
},

Expand Down
1 change: 1 addition & 0 deletions extension/chrome/locale/en-US/variables.properties
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ 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
1 change: 1 addition & 0 deletions extension/chrome/locale/sv-SE/variables.properties
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ variable.DefaultTitle.description=Standardprogramrubrik
variable.TabTitle.description=Rubrik för aktuell flik
variable.Profile.description=Aktuell profil
variable.Toolkit.description=Grafikverktyg
variable.TabsCount.description=Count of visible tabs
1 change: 1 addition & 0 deletions extension/chrome/locale/zh-CN/variables.properties
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ variable.DefaultTitle.description=默认应用程序标题
variable.TabTitle.description=当前标签标题
variable.Profile.description=当前配置文件
variable.Toolkit.description=图形工具包
variable.TabsCount.description=Count of visible tabs

0 comments on commit 0553dec

Please sign in to comment.