diff --git a/extension/content/firebug/css/cssPanel.js b/extension/content/firebug/css/cssPanel.js index 9bb3f4dd54..2a1927379c 100644 --- a/extension/content/firebug/css/cssPanel.js +++ b/extension/content/firebug/css/cssPanel.js @@ -1151,6 +1151,28 @@ Firebug.CSSStyleSheetPanel.prototype = Obj.extend(Firebug.Panel, ); } + var prop = Dom.getAncestorByClass(target, "cssProp"); + if (prop) + { + items.push( + { + label: "css.label.Copy_Property_Declaration", + tooltiptext: "css.tip.Copy_Property_Declaration", + command: Obj.bindFixed(this.copyPropertyDeclaration, this, prop) + }, + { + label: "css.label.Copy_Property_Name", + tooltiptext: "css.tip.Copy_Property_Name", + command: Obj.bindFixed(this.copyPropertyName, this, prop) + }, + { + label: "css.label.Copy_Property_Value", + tooltiptext: "css.tip.Copy_Property_Value", + command: Obj.bindFixed(this.copyPropertyValue, this, prop) + } + ); + } + var propValue = Dom.getAncestorByClass(target, "cssPropValue"); if (propValue) { @@ -1663,6 +1685,26 @@ Firebug.CSSStyleSheetPanel.prototype = Obj.extend(Firebug.Panel, { var props = this.getStyleDeclaration(cssSelector); System.copyToClipboard(props.join(Str.lineBreak())); + }, + + copyPropertyDeclaration: function(prop) + { + // xxxsz: repObject should be used instead + System.copyToClipboard(Str.trim(prop.textContent)); + }, + + copyPropertyName: function(prop) + { + // xxxsz: repObject should be used instead + var propName = prop.getElementsByClassName("cssPropName")[0]; + System.copyToClipboard(propName.textContent); + }, + + copyPropertyValue: function(prop) + { + // xxxsz: repObject should be used instead + var propValue = prop.getElementsByClassName("cssPropValue")[0]; + System.copyToClipboard(propValue.textContent); } }); diff --git a/extension/locale/en-US/firebug.properties b/extension/locale/en-US/firebug.properties index 19ebc9a891..10cee72501 100644 --- a/extension/locale/en-US/firebug.properties +++ b/extension/locale/en-US/firebug.properties @@ -969,6 +969,18 @@ css.tip.Copy_Rule_Declaration=Copy the rule including all its properties to the # Allows copying the current CSS rule's properties to the clipboard. Copy_Style_Declaration=Copy Style Declaration css.tip.Copy_Style_Declaration=Copy the rule's properties to the clipboard +# LOCALIZATION NOTE (css.label.Copy_Property_Declaration, css.tip.Copy_Property_Declaration, +# css.label.Copy_Property_Name, css.tip.Copy_Property_Name, css.label.Copy_Property_Value, +# css.tip.Copy_Property_Value): +# Menu item labels and tooltips used in CSS panel/Style side panel context menu. +# Allow copying the current CSS property's declaration/name/value to the clipboard. +css.label.Copy_Property_Declaration=Copy Property Declaration +css.tip.Copy_Property_Declaration=Copy the property's declaration to the clipboard +css.label.Copy_Property_Name=Copy Property Name +css.tip.Copy_Property_Name=Copy the property's name to the clipboard +css.label.Copy_Property_Value=Copy Property Value +css.tip.Copy_Property_Value=Copy the property's value to the clipboard + # LOCALIZATION NOTE (plural.Error_Count2): Semicolon list of plural forms. # A label used in for Firebug Start Button. Displays the number of JavaScript errors found by Firebug. # %1 = Number of errors