From 8abfd860f75c48a5a051a0e33f8fa5952b731663 Mon Sep 17 00:00:00 2001 From: Victor Porof Date: Wed, 18 Jul 2012 16:13:15 +0300 Subject: [PATCH 1/5] Bug 771481 - 'No scripts.' should be displayed in the dropdown when there are no scripts matching the search string; r=past --- browser/devtools/debugger/debugger-view.js | 24 +++++++++++--- browser/devtools/debugger/debugger.xul | 1 + .../browser_dbg_location-changes-blank.js | 7 +++++ .../test/browser_dbg_scripts-searching-02.js | 31 +++++++++++++++++++ .../chrome/browser/devtools/debugger.dtd | 2 +- .../browser/devtools/debugger.properties | 8 +++++ .../themes/gnomestripe/devtools/debugger.css | 1 + .../themes/pinstripe/devtools/debugger.css | 1 + .../themes/winstripe/devtools/debugger.css | 1 + 9 files changed, 71 insertions(+), 5 deletions(-) diff --git a/browser/devtools/debugger/debugger-view.js b/browser/devtools/debugger/debugger-view.js index 66cd035e2d6..126712fad8b 100644 --- a/browser/devtools/debugger/debugger-view.js +++ b/browser/devtools/debugger/debugger-view.js @@ -149,6 +149,8 @@ ScriptsView.prototype = { */ empty: function DVS_empty() { this._scripts.selectedIndex = -1; + this._scripts.setAttribute("label", L10N.getStr("noScriptsText")); + this._scripts.removeAttribute("tooltiptext"); while (this._scripts.firstChild) { this._scripts.removeChild(this._scripts.firstChild); @@ -425,9 +427,8 @@ ScriptsView.prototype = { return; } - let script = selectedItem.getUserData("sourceScript"); - this._preferredScript = script; - DebuggerController.SourceScripts.showScript(script); + this._preferredScript = selectedItem; + DebuggerController.SourceScripts.showScript(selectedItem.getUserData("sourceScript")); }, /** @@ -438,8 +439,15 @@ ScriptsView.prototype = { let scripts = this._scripts; let [file, line, token] = this._getSearchboxInfo(); + // If the webpage has no scripts, searching is redundant. + if (!scripts.itemCount) { + return; + } + // Presume we won't find anything. scripts.selectedItem = this._preferredScript; + scripts.setAttribute("label", this._preferredScript.label); + scripts.setAttribute("tooltiptext", this._preferredScript.value); // If we're not searching for a file anymore, unhide all the scripts. if (!file) { @@ -447,7 +455,9 @@ ScriptsView.prototype = { scripts.getItemAtIndex(i).hidden = false; } } else { - for (let i = 0, l = scripts.itemCount, found = false; i < l; i++) { + let found = false; + + for (let i = 0, l = scripts.itemCount; i < l; i++) { let item = scripts.getItemAtIndex(i); let target = item.label.toLowerCase(); @@ -458,6 +468,8 @@ ScriptsView.prototype = { if (!found) { found = true; scripts.selectedItem = item; + scripts.setAttribute("label", item.label); + scripts.setAttribute("tooltiptext", item.value); } } // Hide what doesn't match our search. @@ -465,6 +477,10 @@ ScriptsView.prototype = { item.hidden = true; } } + if (!found) { + scripts.setAttribute("label", L10N.getStr("noMatchingScriptsText")); + scripts.removeAttribute("tooltiptext"); + } } if (line > -1) { editor.setCaretPosition(line - 1); diff --git a/browser/devtools/debugger/debugger.xul b/browser/devtools/debugger/debugger.xul index e3ddeeeefb0..9c8fc8a0cd5 100644 --- a/browser/devtools/debugger/debugger.xul +++ b/browser/devtools/debugger/debugger.xul @@ -64,6 +64,7 @@ tabindex="0"/> - + diff --git a/browser/locales/en-US/chrome/browser/devtools/debugger.properties b/browser/locales/en-US/chrome/browser/devtools/debugger.properties index 33c5a72863a..ccabd54a17e 100644 --- a/browser/locales/en-US/chrome/browser/devtools/debugger.properties +++ b/browser/locales/en-US/chrome/browser/devtools/debugger.properties @@ -59,6 +59,14 @@ emptyStackText=No stacks to display. # breakpoints list when there are no breakpoints to display. emptyBreakpointsText=No breakpoints to display. +# LOCALIZATION NOTE (noScriptsText): The text to display in the menulist when +# there are no scripts. +noScriptsText=No scripts + +# LOCALIZATION NOTE (noMatchingScriptsText): The text to display in the +# menulist when there are no matching scripts after filtering. +noMatchingScriptsText=No matching scripts + # LOCALIZATION NOTE (breakpointMenuItem): The text for all the elements that # are displayed in the breakpoints menu item popup. breakpointMenuItem.enableSelf=Enable breakpoint diff --git a/browser/themes/gnomestripe/devtools/debugger.css b/browser/themes/gnomestripe/devtools/debugger.css index 8119f0013e9..124d9c3ac55 100644 --- a/browser/themes/gnomestripe/devtools/debugger.css +++ b/browser/themes/gnomestripe/devtools/debugger.css @@ -18,6 +18,7 @@ #scripts { max-width: 350px; + min-width: 150px; } /** diff --git a/browser/themes/pinstripe/devtools/debugger.css b/browser/themes/pinstripe/devtools/debugger.css index 43ed914f580..a73eab55503 100644 --- a/browser/themes/pinstripe/devtools/debugger.css +++ b/browser/themes/pinstripe/devtools/debugger.css @@ -20,6 +20,7 @@ #scripts { max-width: 350px; + min-width: 150px; } /** diff --git a/browser/themes/winstripe/devtools/debugger.css b/browser/themes/winstripe/devtools/debugger.css index 7628f7ec045..c1c23aab327 100644 --- a/browser/themes/winstripe/devtools/debugger.css +++ b/browser/themes/winstripe/devtools/debugger.css @@ -18,6 +18,7 @@ #scripts { max-width: 350px; + min-width: 150px; } /** From 3bead08c9a99313accf7b1dcf0c4cf6ca967f6ad Mon Sep 17 00:00:00 2001 From: Victor Porof Date: Wed, 18 Jul 2012 09:42:51 +0300 Subject: [PATCH 2/5] Bug 774220 - Script URLs should appear in tooltips even when the menu list is not open; r=past --- browser/devtools/debugger/debugger-view.js | 1 + 1 file changed, 1 insertion(+) diff --git a/browser/devtools/debugger/debugger-view.js b/browser/devtools/debugger/debugger-view.js index 126712fad8b..453ba4f6cd1 100644 --- a/browser/devtools/debugger/debugger-view.js +++ b/browser/devtools/debugger/debugger-view.js @@ -428,6 +428,7 @@ ScriptsView.prototype = { } this._preferredScript = selectedItem; + this._scripts.setAttribute("tooltiptext", selectedItem.value); DebuggerController.SourceScripts.showScript(selectedItem.getUserData("sourceScript")); }, From e47018bb889311f82effee24268ea1129042481f Mon Sep 17 00:00:00 2001 From: Paul Rouget Date: Fri, 13 Jul 2012 11:32:09 +0200 Subject: [PATCH 3/5] Bug 765564 - [devtb] Add a DevTools menu to the developer toolbar. r=dao --- browser/base/content/browser-appmenu.inc | 73 +++-------------- browser/base/content/browser-menubar.inc | 82 +++---------------- browser/base/content/browser-sets.inc | 81 ++++++++++++++++-- browser/base/content/browser.css | 6 ++ browser/base/content/browser.js | 77 ++++++----------- browser/base/content/browser.xul | 33 +++++--- .../locales/en-US/chrome/browser/browser.dtd | 1 + browser/themes/gnomestripe/browser.css | 9 ++ browser/themes/pinstripe/browser.css | 9 ++ browser/themes/winstripe/browser.css | 9 ++ 10 files changed, 180 insertions(+), 200 deletions(-) diff --git a/browser/base/content/browser-appmenu.inc b/browser/base/content/browser-appmenu.inc index e7f32cb2545..32c78147db9 100644 --- a/browser/base/content/browser-appmenu.inc +++ b/browser/base/content/browser-appmenu.inc @@ -142,68 +142,19 @@ - - + - - - - - - - + + + + + + + @@ -181,6 +181,71 @@ #endif + + +