Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Display proper error message when CSS selector fails + remove 'select…

…bug' from the code (related to issue 5931)
  • Loading branch information...
commit e84ed5feecc42ad6f2128d927e35776e059256e8 1 parent 6b59070
Jan Odvarko authored October 04, 2012
20  extension/content/firebug/css/selectorPanel.js
@@ -360,24 +360,34 @@ var SelectorTemplate = domplate(BaseRep,
360 360
 var WarningTemplate = domplate(Firebug.Rep,
361 361
 {
362 362
     noSelectionTag:
363  
-        TR({"class": "selectbugWarning "},
  363
+        TR({"class": "selectorWarning"},
364 364
             TD({"class": "selectionElement"}, Locale.$STR("css.selector.noSelection"))
365 365
         ),
366 366
 
367 367
     noSelectionResultsTag:
368  
-        TR({"class": "selectbugWarning "},
  368
+        TR({"class": "selectorWarning"},
369 369
             TD({"class": "selectionElement"}, Locale.$STR("css.selector.noSelectionResults"))
370 370
         ),
371 371
 
372 372
     selectErrorTag:
373  
-        TR({"class": "selectbugWarning"},
  373
+        TR({"class": "selectorWarning"},
374 374
             TD({"class": "selectionElement"}, Locale.$STR("css.selector.selectorError"))
375 375
         ),
376 376
 
377 377
     selectErrorTextTag:
378  
-        TR({"class": "selectbugWarning"},
379  
-            TD({"class": "selectionErrorText selectionElement"}, SPAN("$object"))
  378
+        TR({"class": "selectorWarning"},
  379
+            TD({"class": "selectionErrorText selectionElement"},
  380
+                SPAN("$object|getErrorMessage")
  381
+            )
380 382
         ),
  383
+
  384
+    getErrorMessage: function(object)
  385
+    {
  386
+        if (object.message)
  387
+            return object.message;
  388
+
  389
+        return Locale.$STR("css.selector.unknownErrorMessage");
  390
+    }
381 391
 });
382 392
 
383 393
 // ********************************************************************************************* //
4  extension/locale/en-US/firebug.properties
@@ -1674,3 +1674,7 @@ css.selector.Selection=Selection
1674 1674
 panel.tip.selector=Displays elements matching a CSS selector
1675 1675
 css.selector.TryASelector=Try a selector...
1676 1676
 
  1677
+# LOCALIZATION NOTE (css.selector.unknownErrorMessage): An error message displayed
  1678
+# to the user if querySelectorAll (used by the Selector side panel) fails and there is no
  1679
+# explanantion coming from the platform.
  1680
+css.selector.unknownErrorMessage=Failed to execute specified selector string
7  extension/skin/classic/selector.css
... ...
@@ -1,4 +1,5 @@
1  
-/* Rules for selectbug's Selector panel elements */
  1
+/* Rules for Selector panel elements */
  2
+
2 3
 .cssSelectionTable {
3 4
     width: 100%;
4 5
 }
@@ -6,7 +7,7 @@
6 7
     padding: 0 0 0 1ex;
7 8
 }
8 9
 
9  
-.selectbugWarning {
  10
+.selectorWarning {
10 11
     font-size: 11px;
11 12
     color: gray;
12 13
     padding: 2px 0 0 1ex;
@@ -18,7 +19,7 @@
18 19
     background-color: #FFEBEB;
19 20
 }
20 21
 
21  
-/* Rules for selectbug's effect on CSS stylesheet panel */
  22
+/* Rules for select panel's effect on CSS stylesheet panel */
22 23
 .selectedSelectorRule {
23 24
     border-color: Highlight !important;
24 25
     background-color: #EBF5FF !important;

0 notes on commit e84ed5f

Please sign in to comment.
Something went wrong with that request. Please try again.