X-Git-Url: https://git.donarmstrong.com/?p=dactyl.git;a=blobdiff_plain;f=common%2Fcontent%2Ftabs.js;h=fb155db8d36539cf5a309521d74ba06cfdb49c6e;hp=9b906607ecd12af76702e686cbd9c99fb37b6ac8;hb=8b6fcae7eaa413bc62d645d2d0c99835c47265e6;hpb=5ebd29f56d17f62011cdd596b1d351947ee534ff diff --git a/common/content/tabs.js b/common/content/tabs.js index 9b90660..fb155db 100644 --- a/common/content/tabs.js +++ b/common/content/tabs.js @@ -1,10 +1,10 @@ // Copyright (c) 2006-2008 by Martin Stubenschrott // Copyright (c) 2007-2011 by Doug Kearns -// Copyright (c) 2008-2011 by Kris Maglione +// Copyright (c) 2008-2012 Kris Maglione // // This work is licensed for reuse under an MIT license. Details are // given in the LICENSE.txt file included with this file. -/* use strict */ +"use strict"; /** @scope modules */ @@ -35,9 +35,9 @@ var Tabs = Module("tabs", { tabs.switchTo(event.originalTarget.getAttribute("identifier")); }; - this.tabBinding = styles.system.add("tab-binding", "chrome://browser/content/browser.xul", String.replace(<>, /tab-./g, function (m) config.OS.isMacOSX ? "tab-mac" : m), + */).replace(/tab-./g, function (m) config.OS.isMacOSX ? "tab-mac" : m), false, true); this.timeout(function () { @@ -78,10 +78,14 @@ var Tabs = Module("tabs", { if (!node("dactyl-tab-number")) { let img = node("tab-icon-image"); if (img) { - let dom = DOM( - - - .elements(), document).appendTo(img.parentNode); + let dom = DOM([ + ["xul:hbox", { highlight: "tab-number" }, + ["xul:label", { key: "icon", align: "center", highlight: "TabIconNumber", + class: "dactyl-tab-icon-number" }]], + ["xul:hbox", { highlight: "tab-number" }, + ["html:div", { key: "label", highlight: "TabNumber", + class: "dactyl-tab-number" }]]], + document).appendTo(img.parentNode); update(tab, { get dactylOrdinal() Number(dom.nodes.icon.value), @@ -235,8 +239,8 @@ var Tabs = Module("tabs", { if (func) func = bind(function (func) { func(this._groups) }, this, func); - if (window.TabView && TabView._initFrame) - TabView._initFrame(func); + if (window.TabView && window.TabView._initFrame) + window.TabView._initFrame(func); this._groups = iframe ? iframe.contentWindow : null; if (this._groups && !func) @@ -596,10 +600,10 @@ var Tabs = Module("tabs", { services.sessionStore.setTabState(to, tabState); } }, { - load: function init_load() { + load: function initLoad() { tabs.updateTabCount(); }, - commands: function init_commands() { + commands: function initCommands() { [ { name: ["bd[elete]"], @@ -1015,7 +1019,7 @@ var Tabs = Module("tabs", { { argCount: "0" }); } }, - completion: function init_completion() { + completion: function initCompletion() { completion.buffer = function buffer(context, visible) { let { tabs } = modules; @@ -1035,10 +1039,11 @@ var Tabs = Module("tabs", { group[1].push([i, tab.linkedBrowser]); }); - context.pushProcessor(0, function (item, text, next) <> - {item.indicator} - { next.call(this, item, text) } - ); + context.pushProcessor(0, function (item, text, next) [ + ["span", { highlight: "Indicator", style: "display: inline-block;" }, + item.indicator], + next.call(this, item, text) + ]); context.process[1] = function (item, text) template.bookmarkDescription(item, template.highlightFilter(text, this.filter)); context.anchored = false; @@ -1096,7 +1101,7 @@ var Tabs = Module("tabs", { }; }; }, - events: function init_events() { + events: function initEvents() { let tabContainer = config.tabbrowser.mTabContainer; function callback() { tabs.timeout(function () { this.updateTabCount(); }); @@ -1105,7 +1110,7 @@ var Tabs = Module("tabs", { events.listen(tabContainer, event, callback, false); events.listen(tabContainer, "TabSelect", tabs.closure._onTabSelect, false); }, - mappings: function init_mappings() { + mappings: function initMappings() { mappings.add([modes.COMMAND], ["", ""], "Execute the next mapping in a new tab", @@ -1199,7 +1204,7 @@ var Tabs = Module("tabs", { { count: true }); } }, - options: function init_options() { + options: function initOptions() { options.add(["showtabline", "stal"], "Define when the tab bar is visible", "string", true,