-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add new variable for visible tabs #173
Conversation
get tabsCount() { | ||
var tabbrowser = document.getElementById("content"); | ||
return tabbrowser.visibleTabs.length; | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a little update to do here... would you mind putting this getter before tabsTitle in all 3 files? That way we have it alphabetically sorted.
@@ -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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@KOLANICH please add this line to all variables.properties
files in the repository (extension/chrome/locale/*/variables.properties
). It's OK to add as unchanged i.e. untranslated strings.
The guys at BabelZilla will do the rest! :)
Good catch. Thanks @xabolcs! That's indeed something I missed. If all is fine and if it works in SeaMonkey too, feel free to merge the PR. |
I haven't yet tested this new NTT version, but does it support all the variables supported by the development version of the add-on, and in particular If it doesn't, I'm not going to install it into my usual profile, where I already have the Tab Counter extension to display my current number of tabs on a toolbar. Also, I'd like not to be the only one who is conscious of the existence of the above-mentioned mozillawiki page and keeps it up-to-date. |
@tonymec, this pull request adds a new variable, |
@@ -22,3 +22,4 @@ variable.DefaultTitle.description=默认应用程序标题 | |||
variable.TabTitle.description=当前标签标题 | |||
variable.Profile.description=当前配置文件 | |||
variable.Toolkit.description=图形工具包 | |||
variable.TabsCount.description=Count of tabs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Please use the same string (i.e. Count of visible tabs
) as in en-US
locale.
Simply just append the en-US
line (variable.TabsCount.description=Count of visible tabs
) to the other variables.properties
files.
One more commit please for sv-SE
: extension/chrome/locale/sv-SE/variables.properties
!
@xabolcs : IMHO when adding variables we shouldn't have to choose between one and the other. Couldn't this enhancement have been based on the set of variables already supported by the development version at AMO? Is it already too late to make it so? I'm already using both |
@tonymec, this PR should be based on |
@xabolcs : ah, good. I just noticed mozilla/master cannot be merged into tonymec/master, so I'm gonna remove my forked repo if I find how. Someday I may recreate it then from mozilla. |
Regarding the wiki page I think we should get all this content transferred over to this repositories wiki. Then both code and documentation are side-by-side. @xabolcs the commit message looks fine to me. If all works fine to you, we can get this landed. |
@@ -27,6 +27,9 @@ get defaultTitle() { | |||
} | |||
}, | |||
|
|||
get tabsCount() { | |||
return gBrowser.visibleTabs.length; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This throws because the lack of tab groups.
Timestamp: 10/01/2014 08:19:44 PM
Error: TypeError: gBrowser.visibleTabs is undefined
Source File: chrome://nightly/content/suite.js
Line: 31
gBrowser.tabs.length
would do the trick, but...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very strange. According to the docs, gBrowser is tabbrowser element, and it must have visibleTabs property.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Has SeaMonkey a different implementation? It might be...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It really doesn't have. Is SM mozilla project? It seems it is third-party project...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Its a product driven by the community. Similar to Thunderbird now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The tabbrowser implementations of SeaMonkey and Firefox are different. So different, in fact, that there is no hope of ever getting the Tab Mix Plus extension to work for SeaMonkey.
SeaMonkey, Firefox and Thunderbird are partly based on the same sources (for Gecko, Toolkit, NSS, NSPR etc.) but each of them has its own UI on top of those backends, and there are many differences between these three frontends; sometimes subtle, elusive ones; other times (as with Firefox's and SeaMonkey's tabbrowser implementations) the frontends are very different.
See among others https://developer.mozilla.org/en-US/Add-ons/SeaMonkey_2 about some differences between Firefox and SeaMonkey.
@KOLANICH, what about to rework this PR to support "(all) tabs count" ( |
Not yet. At first we should finish this issue: add displaying of count of visible tabs to the addon. |
OK. |
@@ -13,6 +13,10 @@ get defaultTitle() { | |||
return tabbrowser.getWindowTitleForBrowser(tabbrowser.mCurrentBrowser); | |||
}, | |||
|
|||
get tabsCount() { | |||
var tabbrowser = document.getElementById("content"); | |||
return tabbrowser.visibleTabs.length; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
visibleTabs
only available for Gecko 2 and up, so please use mTabs
(this doesn't exists anymore in recent Firefoxes) or browsers
(this is still available) here for Fx 3.6.
For example:
return tabbrowser.visibleTabs ? tabbrowser.visibleTabs.length : tabbrowser.browsers.length;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would really purpose that we finally get rid of this old cruft and kill support for Firefox <4.0. What value does it bring to us to keep maintaining a version really no-one is using or better should use anymore? It only makes our code way too complex for no value. IMO it's wasted time. I'm happy to file a new issue for this for discussion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See #161.
It only makes our code way too complex for no value.
It's already too complex, without these old cruft.
So let refactor the code with the same compatibility/functionality first. But this is off-topic here.
Thanks for the update @KOLANICH! I see you always rewrite your commits. May I ask you to amend the commit message to If this and the
is done for |
Why should we support old versions? Especially SUCH old versions? If a person uses such an old version of a browser, this means that he doesn't care about it, because he either doesn't care about security or doesn't know about the danger. This means that he is ordinary user, not IT geek. IT geeks (target group of this addon) understand that using old versions with tons of vulnerabilites is ultimately insecure. Also one more question. Why do we use History.md ? Is git log insufficient to generate changelog automatically? |
There are in NTT a lot of features, many of which are useful for any user, not only IT geeks. This said, the older a version, the less we need to support it; but NTT always did, and IMHO should continue to, support all three of Firefox, Thunderbird and SeaMonkey. The tabbrowsers of SeaMonkey and Firefox have drifted apart since the day Firefox was forked from the Suite: does tabbrowser.visibleTabs exist in SeaMonkey (which has no notion of "tab groups")? If it doesn't, we ought to get the number of tabs some other way. For instance by counting elements of tabbrowser.browsers DOM Inspector tells me that the elements of interest to us are structured as follows in SeaMonkey 2.32a1 (built on Gecko 35.0a1) (following the chain from parent to child, and omitting siblings): &35;document > window#main-window > hbox > vbox#appcontent > hbox#browser > tabbrowser#content > tabbox > tabpanels.plain > notificationbox.browser-notificationbox > browser > &35;document > HTML > etc. There is one XUL |
It has simply been proven that this file is kinda helpful when users want to have a look what has been changed. There is no need for them to dig through the code, find appropriate tags, and create a local diff. The update of this file is kinda easy via git-extras. |
Oh and looks like there is one missing piece still to be done. I will leave it up to @xabolcs to finally review and land it. Thanks! |
@whimboo, yes one nit is missing, but could be done at landing time. |
This PR was landed as 0553dec. |
OK, I will leave a comment in #152, that the tabs count part was implemented here. |
Now with useless resource string (why not to remove descriptions, tag names are already self-describing) and variants for SeaMonkey and Thunderbird.
This fixes issue #171.