Bug 608468 - Details View should include the add-on Summary text from AMO. r=dtownsend, a=blocking-final
authorBlair McBride <bmcbride@mozilla.com>
Wed, 19 Jan 2011 13:37:36 +1300
changeset 60841 4c1dd250fef3a46bdc9d10b24a05a43d2b97e0e5
parent 60840 7cab48d6f673ae5708fe7a44a53471c476b68638
child 60842 2f9ad4aa07958fdc0761e224f720925929a66686
push idunknown
push userunknown
push dateunknown
reviewersdtownsend, blocking-final
bugs608468
milestone2.0b10pre
Bug 608468 - Details View should include the add-on Summary text from AMO. r=dtownsend, a=blocking-final
toolkit/mozapps/extensions/content/extensions.js
toolkit/mozapps/extensions/content/extensions.xul
toolkit/mozapps/extensions/test/browser/browser_details.js
toolkit/themes/gnomestripe/mozapps/extensions/extensions.css
toolkit/themes/pinstripe/mozapps/extensions/extensions.css
toolkit/themes/winstripe/mozapps/extensions/extensions.css
--- a/toolkit/mozapps/extensions/content/extensions.js
+++ b/toolkit/mozapps/extensions/content/extensions.js
@@ -2242,18 +2242,25 @@ var gDetailView = {
       else
         screenshot.src = aAddon.screenshots[0].url;
       screenshot.hidden = false;
     } else {
       screenshot.hidden = true;
     }
 
     var desc = document.getElementById("detail-desc");
-    desc.textContent = aAddon.fullDescription ? aAddon.fullDescription
-                                              : aAddon.description;
+    desc.textContent = aAddon.description;
+
+    var fullDesc = document.getElementById("detail-fulldesc");
+    if (aAddon.fullDescription) {
+      fullDesc.textContent = aAddon.fullDescription;
+      fullDesc.hidden = false;
+    } else {
+      fullDesc.hidden = true;
+    }
 
     var contributions = document.getElementById("detail-contributions");
     if ("contributionURL" in aAddon && aAddon.contributionURL) {
       contributions.hidden = false;
       var amount = document.getElementById("detail-contrib-suggested");
       if (aAddon.contributionAmount) {
         amount.value = gStrings.ext.formatStringFromName("contributionAmount2",
                                                          [aAddon.contributionAmount],
--- a/toolkit/mozapps/extensions/content/extensions.xul
+++ b/toolkit/mozapps/extensions/content/extensions.xul
@@ -550,17 +550,20 @@
                       <spacer flex="5000"/> <!-- Necessary to allow the name to wrap -->
                     </hbox>
                     <label id="detail-creator" class="creator"/>
                   </vbox>
                   <hbox id="detail-desc-container" align="start">
                     <vbox pack="center"> <!-- Necessary to work around bug 394738 -->
                       <image id="detail-screenshot" hidden="true"/>
                     </vbox>
-                    <description id="detail-desc" flex="1"/>
+                    <vbox flex="1">
+                      <description id="detail-desc"/>
+                      <description id="detail-fulldesc"/>
+                    </vbox>
                   </hbox>
                   <vbox id="detail-contributions">
                     <description id="detail-contrib-description">
                       &detail.contributions.description;
                     </description>
                     <hbox align="center">
                       <label id="detail-contrib-suggested"/>
                       <spacer flex="1"/>
--- a/toolkit/mozapps/extensions/test/browser/browser_details.js
+++ b/toolkit/mozapps/extensions/test/browser/browser_details.js
@@ -148,17 +148,18 @@ function end_test() {
 add_test(function() {
   open_details("addon1@tests.mozilla.org", "extension", function() {
     is(get("detail-name").textContent, "Test add-on 1", "Name should be correct");
     is_element_visible(get("detail-version"), "Version should not be hidden");
     is(get("detail-version").value, "2.1", "Version should be correct");
     is(get("detail-icon").src, "chrome://foo/skin/icon64.png", "Icon should be correct");
     is_element_hidden(get("detail-creator"), "Creator should be hidden");
     is_element_hidden(get("detail-screenshot"), "Screenshot should be hidden");
-    is(get("detail-desc").textContent, "Longer description", "Description should be correct");
+    is(get("detail-desc").textContent, "Short description", "Description should be correct");
+    is(get("detail-fulldesc").textContent, "Longer description", "Full description should be correct");
 
     is_element_visible(get("detail-contributions"), "Contributions section should be visible");
     is_element_visible(get("detail-contrib-suggested"), "Contributions amount should be visible");
     ok(get("detail-contrib-suggested").value, "$0.99");
 
     is_element_hidden(get("detail-dateUpdated"), "Update date should be hidden");
 
     is_element_visible(get("detail-rating-row"), "Rating row should not be hidden");
@@ -253,16 +254,17 @@ add_test(function() {
     is_element_visible(get("detail-creator"), "Creator should not be hidden");
     is_element_visible(get("detail-creator")._creatorName, "Creator name should not be hidden");
     is(get("detail-creator")._creatorName.value, "Mozilla", "Creator should be correct");
     is_element_hidden(get("detail-creator")._creatorLink, "Creator link should be hidden");
 
     is_element_visible(get("detail-screenshot"), "Screenshot should be visible");
     is(get("detail-screenshot").src, "http://example.com/screenshot", "Should be showing the full sized screenshot");
     is(get("detail-desc").textContent, "Short description", "Description should be correct");
+    is_element_hidden(get("detail-fulldesc"), "Full description should be hidden");
 
     is_element_visible(get("detail-contributions"), "Contributions section should be visible");
     is_element_hidden(get("detail-contrib-suggested"), "Contributions amount should be hidden");
 
     is_element_visible(get("detail-dateUpdated"), "Update date should not be hidden");
     is(Date.parse(get("detail-dateUpdated").value), gDate.getTime(), "Update date should be correct");
 
     is_element_hidden(get("detail-rating-row"), "Rating should be hidden");
@@ -667,17 +669,18 @@ add_test(function() {
     }]);
 
     is(get("detail-name").textContent, "Test add-on replacement", "Name should be correct");
     is_element_visible(get("detail-version"), "Version should not be hidden");
     is(get("detail-version").value, "2.5", "Version should be correct");
     is(get("detail-icon").src, "chrome://foo/skin/icon264.png", "Icon should be correct");
     is_element_hidden(get("detail-creator"), "Creator should be hidden");
     is_element_hidden(get("detail-screenshot"), "Screenshot should be hidden");
-    is(get("detail-desc").textContent, "Longer description replacement", "Description should be correct");
+    is(get("detail-desc").textContent, "Short description replacement", "Description should be correct");
+    is(get("detail-fulldesc").textContent, "Longer description replacement", "Full description should be correct");
 
     is_element_hidden(get("detail-contributions"), "Contributions section should be hidden");
 
     is_element_hidden(get("detail-dateUpdated"), "Update date should be hidden");
 
     is_element_visible(get("detail-rating-row"), "Rating row should not be hidden");
     is_element_visible(get("detail-rating"), "Rating should not be hidden");
     is(get("detail-rating").averageRating, 2, "Rating should be correct");
--- a/toolkit/themes/gnomestripe/mozapps/extensions/extensions.css
+++ b/toolkit/themes/gnomestripe/mozapps/extensions/extensions.css
@@ -631,25 +631,29 @@
   max-width: 300px;
   max-height: 300px;
 }
 
 #detail-desc-container {
   margin-bottom: 2em;
 }
 
-#detail-desc {
+#detail-desc, #detail-fulldesc {
   -moz-margin-start: 6px;
   /* This is necessary to fix layout issues with multi-line descriptions, see
      bug 592712*/
   outline: solid transparent;
   white-space: pre-wrap;
   min-width: 10em;
 }
 
+#detail-fulldesc {
+  margin-top: 1em;
+}
+
 #detail-contributions {
   border-radius: 5px;
   border: 1px solid ThreeDShadow;
   margin-bottom: 2em;
   padding: 1em;
   background: ThreeDHighlight;
 }
 
--- a/toolkit/themes/pinstripe/mozapps/extensions/extensions.css
+++ b/toolkit/themes/pinstripe/mozapps/extensions/extensions.css
@@ -731,25 +731,29 @@
   max-width: 300px;
   max-height: 300px;
 }
 
 #detail-desc-container {
   margin-bottom: 2em;
 }
 
-#detail-desc {
+#detail-desc, #detail-fulldesc {
   -moz-margin-start: 6px;
   /* This is necessary to fix layout issues with multi-line descriptions, see
      bug 592712*/
   outline: solid transparent;
   white-space: pre-wrap;
   min-width: 10em;
 }
 
+#detail-fulldesc {
+  margin-top: 1em;
+}
+
 #detail-contributions {
   border-radius: 5px;
   border: 1px solid rgba(50, 65, 92, 0.3);
   margin-bottom: 2em;
   padding: 1em;
   background-color: rgba(255, 255, 255, 0.35);
 }
 
--- a/toolkit/themes/winstripe/mozapps/extensions/extensions.css
+++ b/toolkit/themes/winstripe/mozapps/extensions/extensions.css
@@ -797,25 +797,29 @@
   max-width: 300px;
   max-height: 300px;
 }
 
 #detail-desc-container {
   margin-bottom: 2em;
 }
 
-#detail-desc {
+#detail-desc, #detail-fulldesc {
   -moz-margin-start: 6px;
   /* This is necessary to fix layout issues with multi-line descriptions, see
      bug 592712*/
   outline: solid transparent;
   white-space: pre-wrap;
   min-width: 10em;
 }
 
+#detail-fulldesc {
+  margin-top: 1em;
+}
+
 #detail-contributions {
   border-radius: 5px;
   border: 1px solid #D2DBE8;
   margin-bottom: 2em;
   padding: 1em;
   background-color: #F3F7FB;
 }