summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bitbake/lib/toaster/toastergui/static/js/libtoaster.js12
1 files changed, 8 insertions, 4 deletions
diff --git a/bitbake/lib/toaster/toastergui/static/js/libtoaster.js b/bitbake/lib/toaster/toastergui/static/js/libtoaster.js
index 34a3fbb1fb..c04f7aba2b 100644
--- a/bitbake/lib/toaster/toastergui/static/js/libtoaster.js
+++ b/bitbake/lib/toaster/toastergui/static/js/libtoaster.js
@@ -56,10 +56,14 @@ var libtoaster = (function (){
56 return 1; 56 return 1;
57 }, 57 },
58 highlighter: function (item) { 58 highlighter: function (item) {
59 if (item.hasOwnProperty('detail')) 59 /* Use jquery to escape the item name and detail */
60 /* Use jquery to escape the value as text into a span */ 60 var current = $("<span></span>").text(item.name + ' '+item.detail);
61 return $('<span></span>').text(item.name+' '+item.detail).get(0); 61 current = current.html();
62 return $('<span></span>').text(item.name).get(0); 62
63 var query = this.query.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, '\\$&')
64 return current.replace(new RegExp('(' + query + ')', 'ig'), function ($1, match) {
65 return '<strong>' + match + '</strong>'
66 })
63 }, 67 },
64 sorter: function (items) { return items; }, 68 sorter: function (items) { return items; },
65 xhrUrl: xhrUrl, 69 xhrUrl: xhrUrl,