Skip to content

Commit

Permalink
Display proper error message when CSS selector fails + remove 'select…
Browse files Browse the repository at this point in the history
…bug' from the code (related to issue 5931)
  • Loading branch information
janodvarko committed Oct 4, 2012
1 parent 6b59070 commit e84ed5f
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 8 deletions.
20 changes: 15 additions & 5 deletions extension/content/firebug/css/selectorPanel.js
Expand Up @@ -360,24 +360,34 @@ var SelectorTemplate = domplate(BaseRep,
var WarningTemplate = domplate(Firebug.Rep,
{
noSelectionTag:
TR({"class": "selectbugWarning "},
TR({"class": "selectorWarning"},
TD({"class": "selectionElement"}, Locale.$STR("css.selector.noSelection"))
),

noSelectionResultsTag:
TR({"class": "selectbugWarning "},
TR({"class": "selectorWarning"},
TD({"class": "selectionElement"}, Locale.$STR("css.selector.noSelectionResults"))
),

selectErrorTag:
TR({"class": "selectbugWarning"},
TR({"class": "selectorWarning"},
TD({"class": "selectionElement"}, Locale.$STR("css.selector.selectorError"))
),

selectErrorTextTag:
TR({"class": "selectbugWarning"},
TD({"class": "selectionErrorText selectionElement"}, SPAN("$object"))
TR({"class": "selectorWarning"},
TD({"class": "selectionErrorText selectionElement"},
SPAN("$object|getErrorMessage")
)
),

getErrorMessage: function(object)
{
if (object.message)
return object.message;

return Locale.$STR("css.selector.unknownErrorMessage");
}
});

// ********************************************************************************************* //
Expand Down
4 changes: 4 additions & 0 deletions extension/locale/en-US/firebug.properties
Expand Up @@ -1674,3 +1674,7 @@ css.selector.Selection=Selection
panel.tip.selector=Displays elements matching a CSS selector
css.selector.TryASelector=Try a selector...

# LOCALIZATION NOTE (css.selector.unknownErrorMessage): An error message displayed
# to the user if querySelectorAll (used by the Selector side panel) fails and there is no
# explanantion coming from the platform.
css.selector.unknownErrorMessage=Failed to execute specified selector string
7 changes: 4 additions & 3 deletions extension/skin/classic/selector.css
@@ -1,12 +1,13 @@
/* Rules for selectbug's Selector panel elements */
/* Rules for Selector panel elements */

.cssSelectionTable {
width: 100%;
}
.selectionElement {
padding: 0 0 0 1ex;
}

.selectbugWarning {
.selectorWarning {
font-size: 11px;
color: gray;
padding: 2px 0 0 1ex;
Expand All @@ -18,7 +19,7 @@
background-color: #FFEBEB;
}

/* Rules for selectbug's effect on CSS stylesheet panel */
/* Rules for select panel's effect on CSS stylesheet panel */
.selectedSelectorRule {
border-color: Highlight !important;
background-color: #EBF5FF !important;
Expand Down

0 comments on commit e84ed5f

Please sign in to comment.