This commit is contained in:
Dan Witte 2010-08-13 23:06:08 -07:00
commit b859854d41
13 changed files with 44 additions and 78 deletions

View File

@ -209,8 +209,8 @@
accesskey="&viewMenu.accesskey;">
<menupopup id="menu_viewPopup">
<menuitem id="menu_tabview"
label="&showTabView2.label;"
accesskey="&showTabView2.accesskey;"
label="&showTabView.label;"
accesskey="&showTabView.accesskey;"
command="Browser:ToggleTabView"/>
<menu id="viewToolbarsMenu"
label="&viewToolbarsMenu.label;"

View File

@ -46,7 +46,7 @@ let TabView = {
delete this.windowTitle;
let brandBundle = document.getElementById("bundle_brand");
let brandShortName = brandBundle.getString("brandShortName");
let title = gNavigatorBundle.getFormattedString("tabView2.title", [brandShortName]);
let title = gNavigatorBundle.getFormattedString("tabView.title", [brandShortName]);
return this.windowTitle = title;
},
@ -197,34 +197,8 @@ let TabView = {
charCode == 160) { // alt + space
#else
if (event.ctrlKey && !event.metaKey && !event.shiftKey &&
!event.altKey && charCode == 32) { // ctrl + space
event.altKey && charCode == 32) { // ctrl + alt + space
#endif
// Don't handle this event if it's coming from a node that might allow
// multiple keyboard selection like selects or trees
let node = event.target;
switch (node.namespaceURI) {
case "http://www.w3.org/1999/xhtml":
// xhtml:select only allows multiple when the attr is set
if (node.localName == "select" && node.hasAttribute("multiple"))
return;
break;
case "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul":
switch (node.localName) {
case "listbox":
// xul:listbox is by default single
if (node.getAttribute("seltype") == "multiple")
return;
break;
case "tree":
// xul:tree is by default multiple
if (node.getAttribute("seltype") != "single")
return;
break;
}
}
event.stopPropagation();
event.preventDefault();
self.show();

View File

@ -941,9 +941,9 @@
</toolbarbutton>
<toolbarbutton id="tabview-button" class="toolbarbutton-1 chromeclass-toolbar-additional"
label="&tabViewButton2.label;"
label="&tabViewButton.label;"
command="Browser:ToggleTabView"
tooltiptext="&tabViewButton2.tooltip;"
tooltiptext="&tabViewButton.tooltip;"
removable="true"/>
<toolbarbutton id="tabs-closebutton"

View File

@ -726,7 +726,7 @@
<method name="updateTitlebar">
<body>
<![CDATA[
if (window.TabView && TabView.isVisible()) {
if (TabView && TabView.isVisible()) {
// ToDo: this will be removed when we gain ability to draw to the menu bar.
// Bug 586175
this.ownerDocument.title = TabView.windowTitle;

View File

@ -108,8 +108,8 @@ Drag.prototype = {
// proportionally or not
// checkItemStatus - (boolean) make sure this is a valid item which should be snapped
snapBounds: function Drag_snapBounds(bounds, stationaryCorner, assumeConstantSize, keepProportional, checkItemStatus) {
if (!stationaryCorner)
stationaryCorner || 'topleft';
if (!stationaryCorner)
stationaryCorner || 'topleft';
var update = false; // need to update
var updateX = false;
var updateY = false;

View File

@ -126,13 +126,15 @@ let GroupItem = function GroupItem(listOfEls, options) {
// ___ New Tab Button
this.$ntb = iQ("<div>")
.appendTo($container);
this.$ntb
.addClass('newTabButton')
.click(function() {
self.newTab();
})
.attr('title',
"New tab")
.appendTo($container);
});
(this.$ntb)[0].title = 'New tab';
// ___ Resizer
this.$resizer = iQ("<div>")
@ -167,7 +169,7 @@ let GroupItem = function GroupItem(listOfEls, options) {
this.$titleContainer = iQ('.title-container', this.$titlebar);
this.$title = iQ('.name', this.$titlebar);
this.$titleShield = iQ('.title-shield', this.$titlebar);
this.setTitle(options.title || this.defaultName);
this.setTitle(options.title || "");
var titleUnfocus = function() {
self.$titleShield.show();
@ -296,7 +298,7 @@ window.GroupItem.prototype = Utils.extend(new Item(), new Subscribable(), {
// ----------
// Variable: defaultName
// The prompt text for the title field.
defaultName: "Name this tab group…",
defaultName: "name this groupItem...",
// -----------
// Function: setActiveTab
@ -372,7 +374,7 @@ window.GroupItem.prototype = Utils.extend(new Item(), new Subscribable(), {
adjustTitleSize: function() {
Utils.assert(this.bounds, 'bounds needs to have been set');
let closeButton = iQ('.close', this.container);
var w = Math.min(this.bounds.width - parseInt(closeButton.width()) - parseInt(closeButton.css('right')),
var w = Math.min(this.bounds.width - closeButton.width() - closeButton.css('right'),
Math.max(150, this.getTitle().length * 6));
// The * 6 multiplier calculation is assuming that characters in the title
// are approximately 6 pixels wide. Bug 586545
@ -653,10 +655,7 @@ window.GroupItem.prototype = Utils.extend(new Item(), new Subscribable(), {
}
if (!options.dontArrange) {
// by default, we animate the item moving to its new position
let animate = typeof options.animate == "undefined" ? true :
options.animate;
this.arrange({ animate: animate });
this.arrange();
}
UI.setReorderTabsOnHide(this);
@ -1798,9 +1797,8 @@ window.GroupItems = {
// Function: killNewTabGroup
// Removes the New Tab Group, which is now defunct. See bug 575851 and comments therein.
killNewTabGroup: function() {
let newTabGroupTitle = "New Tabs";
this.groupItems.forEach(function(groupItem) {
if (groupItem.getTitle() == newTabGroupTitle && groupItem.locked.title) {
if (groupItem.getTitle() == 'New Tabs' && groupItem.locked.title) {
groupItem.removeAll();
groupItem.close();
}

View File

@ -531,7 +531,9 @@ iQClass.prototype = {
options = {};
let easings = {
tabviewBounce: "cubic-bezier(0.0, 0.63, .6, 1.29)",
tabviewBounce: "cubic-bezier(0.0, 0.63, .6, 1.0)",
// TODO: change 1.0 above to 1.29 after bug 575672 is fixed
easeInQuad: 'ease-in', // TODO: make it a real easeInQuad, or decide we don't care
fast: 'cubic-bezier(0.7,0,1,1)'
};

View File

@ -1048,7 +1048,7 @@ window.Items = {
var bounds2 = pair2.bounds;
if (bounds2.intersects(newBounds))
blocked = true;
return;
return;
});
if (!blocked) {

View File

@ -347,11 +347,11 @@ input.name {
padding-left: 20px;
}
.title-container:hover input.name {
input.name:hover {
border: 1px solid #ddd;
}
.title-container:hover input.name-locked {
input.name-locked:hover {
border: 1px solid transparent !important;
cursor: default;
}
@ -366,7 +366,7 @@ input.defaultName {
color: transparent;
}
.title-container:hover input.defaultName {
input.defaultName:hover {
color: #CCC;
}

View File

@ -107,12 +107,7 @@ var UIManager = {
this._currentTab = gBrowser.selectedTab;
// ___ Dev Menu
// This dev menu is not meant for shipping, nor is it of general
// interest, but we still need it for the time being. Change the
// false below to enable; just remember to change back before
// committing. Bug 586721 will track the ultimate removal.
if (false)
this._addDevMenu();
this._addDevMenu();
// When you click on the background/empty part of TabView,
// we create a new groupItem.
@ -158,10 +153,6 @@ var UIManager = {
GroupItems.reconstitute(groupItemsData, groupItemData);
GroupItems.killNewTabGroup(); // temporary?
// ___ tabs
TabItems.init();
TabItems.pausePainting();
if (firstTime) {
var padding = 10;
var infoWidth = 350;
@ -185,18 +176,15 @@ var UIManager = {
if (item.parent)
item.parent.remove(item);
groupItem.add(item, null, {animate: false});
groupItem.add(item);
});
// ___ make info item
let welcome = "How to organize your tabs";
let more = "";
let video = "http://videos-cdn.mozilla.net/firefox4beta/tabcandy_howto.webm";
var html =
"<div class='intro'>"
+ "<h1>" + welcome + "</h1>"
+ ( more && more.length ? "<div>" + more + "</div><br>" : "")
+ "<video src='" + video + "' "
+ "<h1>Welcome to Firefox Tab Sets</h1>" // TODO: This needs to be localized if it's kept in
+ "<div>(more goes here)</div><br>"
+ "<video src='http://people.mozilla.org/~araskin/movies/tabcandy_howto.webm' "
+ "width='100%' preload controls>"
+ "</div>";
@ -207,6 +195,10 @@ var UIManager = {
infoItem.html(html);
}
// ___ tabs
TabItems.init();
TabItems.pausePainting();
// ___ resizing
if (this._pageBounds)
this._resize(true);
@ -312,7 +304,7 @@ var UIManager = {
#ifdef XP_WIN
// Restore the full height when showing TabView
gTabViewFrame.style.marginTop = "22px";
gTabViewFrame.style.marginTop = 0;
#endif
gTabViewDeck.selectedIndex = 1;
gTabViewFrame.contentWindow.focus();
@ -644,7 +636,7 @@ var UIManager = {
!event.ctrlKey) {
#else
if (event.ctrlKey && !event.metaKey && !event.shiftKey &&
!event.altKey) {
event.altKey) {
#endif
var activeTab = self.getActiveTab();
if (activeTab)

View File

@ -56,7 +56,7 @@ function test() {
eventObject = { altKey: true };
} else {
charCode = 32;
eventObject = { ctrlKey: true };
eventObject = { altKey: true, ctrlKey: true };
}
var modifiers = EventUtils._parseModifiers(eventObject);
var keyDownDefaultHappened =

View File

@ -132,8 +132,8 @@
<!-- Toolbar items -->
<!ENTITY homeButton.label "Home">
<!ENTITY tabViewButton2.label "Tab Groups">
<!ENTITY tabViewButton2.tooltip "Group Your Tabs">
<!ENTITY tabViewButton.label "Tab Sets">
<!ENTITY tabViewButton.tooltip "Open a visual tab interface">
<!ENTITY bookmarksButton.label "Bookmarks">
<!ENTITY bookmarksButton.tooltip "Display your bookmarks">
@ -240,8 +240,8 @@
<!ENTITY viewMenu.label "View">
<!ENTITY viewMenu.accesskey "V">
<!ENTITY showTabView2.label "Group Your Tabs…">
<!ENTITY showTabView2.accesskey "G">
<!ENTITY showTabView.label "TabView">
<!ENTITY showTabView.accesskey "V">
<!ENTITY viewToolbarsMenu.label "Toolbars">
<!ENTITY viewToolbarsMenu.accesskey "T">
<!ENTITY viewSidebarMenu.label "Sidebar">

View File

@ -276,7 +276,7 @@ ctrlTab.showAll.label=;Show all #1 tabs
addKeywordTitleAutoFill=Search %S
# TabView
tabView2.title=%S - Group Your Tabs
tabView.title=%S Tab Sets
extensions.{972ce4c6-7e08-4474-a285-3208198ce6fd}.name=Default
extensions.{972ce4c6-7e08-4474-a285-3208198ce6fd}.description=The default theme.