Bug 1165386 - Always show SPONSORED for any type of sponsored tiles and SUGGESTED for other suggested [r=adw, a=lizzard]
authorEd Lee <edilee@mozilla.com>
Mon, 18 May 2015 13:39:56 -0700
changeset 273269 64ecf96a453f9655e9b98238083d36d4f3ec68ed
parent 273268 f26c3976301ba22ee50fc04f24eb3d6f61e9379a
child 273270 b2de912de0380f04fe857df9bf906014290e6d02
push id4830
push userjlund@mozilla.com
push dateMon, 29 Jun 2015 20:18:48 +0000
treeherdermozilla-beta@4c2175bb0420 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersadw, lizzard
bugs1165386
milestone40.0a2
Bug 1165386 - Always show SPONSORED for any type of sponsored tiles and SUGGESTED for other suggested [r=adw, a=lizzard]
browser/base/content/newtab/grid.js
browser/base/content/newtab/intro.js
browser/base/content/newtab/sites.js
--- a/browser/base/content/newtab/grid.js
+++ b/browser/base/content/newtab/grid.js
@@ -163,17 +163,17 @@ let gGrid = {
       '  <span class="newtab-thumbnail"/>' +
       '  <span class="newtab-thumbnail enhanced-content"/>' +
       '  <span class="newtab-title"/>' +
       '</a>' +
       '<input type="button" title="' + newTabString("pin") + '"' +
       '       class="newtab-control newtab-control-pin"/>' +
       '<input type="button" title="' + newTabString("block") + '"' +
       '       class="newtab-control newtab-control-block"/>' +
-      '<span class="newtab-sponsored">' + newTabString("suggested.tag") + '</span>' +
+      '<span class="newtab-sponsored">' + newTabString("sponsored.button") + '</span>' +
       '<span class="newtab-suggested"/>';
 
     this._siteFragment = document.createDocumentFragment();
     this._siteFragment.appendChild(site);
   },
 
   /**
    * Make sure the correct number of rows and columns are visible
--- a/browser/base/content/newtab/intro.js
+++ b/browser/base/content/newtab/intro.js
@@ -42,20 +42,20 @@ let gIntro = {
    * _introPages.welcome and _introPages.update contain an array of
    * indices of paragraphs to be used to lookup text in _paragraphs
    * for each page of the intro.
    *
    * Similarly, _introPages.buttons is used to lookup text for buttons
    * on each page of the intro.
    */
   _introPages: {
-    "welcome": [[0,1],[2,3],[4,5]],
+    "welcome": [[0,1],[2,5],[4,3]],
     "update": [[6,5],[4,3],[0,1]],
     "buttons": [["skip", "continue"],["back", "next"],["back", "gotit"]],
-    "welcome-images": ["cog", "pin-remove", "suggested"],
+    "welcome-images": ["cog", "suggested", "pin-remove"],
     "update-images": ["suggested", "pin-remove", "cog"]
   },
 
   _paragraphs: [],
 
   _nodes: {},
 
   _images: {},
@@ -163,18 +163,19 @@ let gIntro = {
           image.innerHTML =
             '<div class="newtab-intro-cell' + imageClass + '">' +
             '  <div class="newtab-site newtab-intro-image-tile" type="sponsored">' +
             '    <a class="newtab-link">' +
             '      <span class="newtab-thumbnail"/>' +
             '      <span class="newtab-title">Example Title</span>' +
             '    </a>' +
             '    <input type="button" class="newtab-control newtab-control-pin"/>' +
-            '    <input type="button" class="newtab-control newtab-control-block"/>' + (imageClass ? "" :
-            '    <span class="newtab-sponsored">' + newTabString("suggested.tag") + '</span>') +
+            '    <input type="button" class="newtab-control newtab-control-block"/>' +
+            '    <span class="newtab-sponsored">' +
+                   newTabString(imageClass ? "sponsored.button" : "suggested.tag") + '</span>' +
             '  </div>' +
             '</div>';
             break;
       }
       this._images[this._imageTypes[type]] = image;
     });
   },
 
--- a/browser/base/content/newtab/sites.js
+++ b/browser/base/content/newtab/sites.js
@@ -129,16 +129,21 @@ Site.prototype = {
 
     let link = this._querySelector(".newtab-link");
     link.setAttribute("title", tooltip);
     link.setAttribute("href", url);
     this._querySelector(".newtab-title").textContent = title;
     this.node.setAttribute("type", this.link.type);
 
     if (this.link.targetedSite) {
+      if (this.node.getAttribute("type") != "sponsored") {
+        this._querySelector(".newtab-sponsored").textContent =
+          newTabString("suggested.tag");
+      }
+
       this.node.setAttribute("suggested", true);
       let targetedSite = `<strong> ${this.link.targetedName} </strong>`;
       this._querySelector(".newtab-suggested").innerHTML =
         `<div class='newtab-suggested-bounds'> ${newTabString("suggested.button", [targetedSite])} </div>`;
     }
 
     if (this.isPinned())
       this._updateAttributes(true);