Bug 1320057. r=kmag, a=gchang
authorGijs Kruitbosch <gijskruitbosch@gmail.com>
Thu, 24 Nov 2016 13:09:58 +0000
changeset 352794 8a985f25512a475af1a53b7e4ff40407300d6e49
parent 352793 3ecd97ecc1cba09a60ab2112ba01be5e54cf4ca5
child 352795 c1681c600fd11590ad9f48c0ac14ccceb63f7d6b
push id6795
push userjlund@mozilla.com
push dateMon, 23 Jan 2017 14:19:46 +0000
treeherdermozilla-esr52@76101b503191 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskmag, gchang
bugs1320057
milestone52.0a2
Bug 1320057. r=kmag, a=gchang MozReview-Commit-ID: GlM44da7hYL
browser/extensions/pocket/content/panels/js/saved.js
browser/extensions/pocket/content/panels/js/vendor/jquery.tokeninput.min.js
--- a/browser/extensions/pocket/content/panels/js/saved.js
+++ b/browser/extensions/pocket/content/panels/js/saved.js
@@ -25,17 +25,19 @@ var PKT_SAVED_OVERLAY = function (option
     this.cxt_suggested_available = 0;
     this.cxt_entered = 0;
     this.cxt_suggested = 0;
     this.cxt_removed = 0;
     this.justaddedsuggested = false;
     this.fillTagContainer = function(tags, container, tagclass) {
         container.children().remove();
         for (var i = 0; i < tags.length; i++) {
-            var newtag = $('<li><a href="#" class="token_tag ' + tagclass + '">' + tags[i] + '</a></li>');
+            var newtag = $('<li><a href="#" class="token_tag"></a></li>');
+            newtag.find('a').text(tags[i]);
+            newtag.addClass(tagclass);
             container.append(newtag);
             this.cxt_suggested_available++;
         }
     };
     this.fillUserTags = function() {
         thePKT_SAVED.sendMessage("getTags", {}, function(resp)
         {
             if (typeof resp == 'object' && typeof resp.tags == 'object')
--- a/browser/extensions/pocket/content/panels/js/vendor/jquery.tokeninput.min.js
+++ b/browser/extensions/pocket/content/panels/js/vendor/jquery.tokeninput.min.js
@@ -44,18 +44,28 @@ var DEFAULT_SETTINGS = {
  // Prepopulation settings
     prePopulate: null,
     processPrePopulate: false,
 
  // Manipulation settings
     idPrefix: "token-input-",
 
  // Formatters
-    resultsFormatter: function(item){ return "<li>" + item[this.propertyToSearch]+ "</li>" },
-    tokenFormatter: function(item) { return "<li><p>" + item[this.propertyToSearch] + "</p></li>" },
+    resultsFormatter: function(item) {
+        let listItem = document.createElement("li");
+        listItem.textContent = item[this.propertyToSearch];
+        return listItem.outerHTML;
+    },
+    tokenFormatter: function(item) {
+        let listItem = document.createElement("li");
+        let p = document.createElement("p");
+        p.textContent = item[this.propertyToSearch];
+        listItem.appendChild(p);
+        return listItem.outerHTML;
+    },
 
     // Validations
     validateItem: null,
 
     // Force selections only on mouse click
     noHoverSelect: false,
 
  // Callbacks