Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Revert de6cbe6, cbc142e (Issue 5862: Crop long CSS values in Style si…

…de panel)
  • Loading branch information...
commit 6a9ed89024bcd199c3e56743d962505334047f7f 1 parent 068aef5
Simon Lindholm authored September 18, 2012

Showing 1 changed file with 4 additions and 41 deletions. Show diff stats Hide diff stats

  1. 45  extension/content/firebug/css/cssPanel.js
45  extension/content/firebug/css/cssPanel.js
@@ -50,14 +50,6 @@ var CSSDomplateBase =
50 50
     isSelectorEditable: function(rule)
51 51
     {
52 52
         return rule.isSelectorEditable && this.isEditable(rule);
53  
-    },
54  
-
55  
-    getPropertyValue: function(prop)
56  
-    {
57  
-        var limit = Options.get("stringCropLength");
58  
-        if (limit > 0)
59  
-            return Str.cropString(prop.value, limit);
60  
-        return prop.value;
61 53
     }
62 54
 };
63 55
 
@@ -78,7 +70,7 @@ var CSSPropTag = domplate(CSSDomplateBase,
78 70
             // Use a space here, so that "copy to clipboard" has it (issue 3266).
79 71
             SPAN({"class": "cssColon"}, ": "),
80 72
             SPAN({"class": "cssPropValue", $editable: "$rule|isEditable"},
81  
-                "$prop|getPropertyValue$prop.important"
  73
+                "$prop.value$prop.important"
82 74
             ),
83 75
             SPAN({"class": "cssSemi"}, ";"
84 76
         )
@@ -1294,11 +1286,10 @@ Firebug.CSSStyleSheetPanel.prototype = Obj.extend(Firebug.Panel,
1294 1286
         var propValue = Dom.getAncestorByClass(target, "cssPropValue");
1295 1287
         if (propValue)
1296 1288
         {
1297  
-            var styleRule = Firebug.getRepObject(propValue);
  1289
+            var text = propValue.textContent;
1298 1290
             var prop = Dom.getAncestorByClass(target, "cssProp");
1299 1291
             var propNameNode = prop.getElementsByClassName("cssPropName").item(0);
1300 1292
             var propName = propNameNode.textContent.toLowerCase();
1301  
-            var text = styleRule.style.getPropertyValue(propName);
1302 1293
             var cssValue;
1303 1294
 
1304 1295
             if (propName == "font" || propName == "font-family")
@@ -1681,11 +1672,12 @@ CSSEditor.prototype = domplate(Firebug.InlineEditor.prototype,
1681 1672
             this.panel.removeDisabledProperty(rule, propName);
1682 1673
         }
1683 1674
 
  1675
+        target.textContent = value;
  1676
+
1684 1677
         if (rule instanceof window.CSSStyleRule || rule instanceof window.Element)
1685 1678
         {
1686 1679
             if (Css.hasClass(target, "cssPropName"))
1687 1680
             {
1688  
-                target.textContent = value;
1689 1681
   
1690 1682
                 if (value && previousValue != value)  // name of property has changed.
1691 1683
                 {
@@ -1724,9 +1716,6 @@ CSSEditor.prototype = domplate(Firebug.InlineEditor.prototype,
1724 1716
             }
1725 1717
             else if (Dom.getAncestorByClass(target, "cssPropValue"))
1726 1718
             {
1727  
-                var limit = Options.get("stringCropLength");
1728  
-                target.textContent = limit > 0 ? Str.cropString(value, limit) : value;
1729  
-
1730 1719
                 propName = Dom.getChildByClass(row, "cssPropName").textContent;
1731 1720
                 propValue = Dom.getChildByClass(row, "cssPropValue").textContent;
1732 1721
   
@@ -1772,8 +1761,6 @@ CSSEditor.prototype = domplate(Firebug.InlineEditor.prototype,
1772 1761
         }
1773 1762
         else if (rule instanceof window.CSSImportRule && Css.hasClass(target, "cssMediaQuery"))
1774 1763
         {
1775  
-            target.textContent = value;
1776  
-
1777 1764
             if (FBTrace.DBG_CSS)
1778 1765
             {
1779 1766
                 FBTrace.sysout("CSSEditor.saveEdit: @import media query: " +
@@ -1792,8 +1779,6 @@ CSSEditor.prototype = domplate(Firebug.InlineEditor.prototype,
1792 1779
         }
1793 1780
         else if (rule instanceof window.CSSCharsetRule)
1794 1781
         {
1795  
-            target.textContent = value;
1796  
-            
1797 1782
             if (FBTrace.DBG_CSS)
1798 1783
                 FBTrace.sysout("CSSEditor.saveEdit: @charset: " + previousValue + "->" + value);
1799 1784
 
@@ -1841,28 +1826,6 @@ CSSEditor.prototype = domplate(Firebug.InlineEditor.prototype,
1841 1826
         }
1842 1827
     },
1843 1828
 
1844  
-    getInitialValue: function(target, value)
1845  
-    {
1846  
-        if (value == "")
1847  
-            return value;
1848  
-
1849  
-        var propValue = Dom.getAncestorByClass(target, "cssPropValue");
1850  
-        if (propValue)
1851  
-        {
1852  
-            var styleRule = Firebug.getRepObject(propValue);
1853  
-            var prop = Dom.getAncestorByClass(target, "cssProp");
1854  
-            var propNameNode = prop.getElementsByClassName("cssPropName").item(0);
1855  
-            var propName = propNameNode.textContent.toLowerCase();
1856  
-            value = styleRule.style.getPropertyValue(propName);
1857  
-
1858  
-            if (Options.get("colorDisplay") == "hex")
1859  
-                value = Css.rgbToHex(value);
1860  
-            else if (Options.get("colorDisplay") == "hsl")
1861  
-                value = Css.rgbToHSL(value);
1862  
-        }
1863  
-        return value;
1864  
-    },
1865  
-
1866 1829
     // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
1867 1830
 
1868 1831
     getAutoCompleteRange: function(value, offset)

0 notes on commit 6a9ed89

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