diff --git a/static/js/editors.js b/static/js/editors.js
index 99e06c7..7e7a4cb 100644
--- a/static/js/editors.js
+++ b/static/js/editors.js
@@ -263,7 +263,7 @@ var editors = {
editors.tabs.add({
id: "startPage",
- title: ' ' + config.label.start_page + '',
content: '
',
after: function () {
@@ -621,14 +621,24 @@ var editors = {
};
},
appendSearch: function (data, type, key) {
- var searcHTML = '';
+ var searcHTML = '',
+ key = key.toLowerCase();
for (var i = 0, ii = data.length; i < ii; i++) {
- var contents = data[i].contents[0],
- index = contents.indexOf(key);
- contents = contents.substring(0, index)
- + '' + key + ''
- + contents.substring(index + key.length);
+ var contents = '',
+ lowerCaseContents = data[i].contents[0].toLowerCase(),
+ matches = lowerCaseContents.split(key),
+ startIndex = 0,
+ endIndex = 0;
+ for (var j = 0, max = matches.length; j < max; j++) {
+ startIndex = endIndex + matches[j].length;
+ endIndex = startIndex + key.length;
+ var keyWord = data[i].contents[0].substring(startIndex, endIndex);
+ if (keyWord !== '') {
+ keyWord = '' + keyWord + '';
+ }
+ contents += matches[j] + keyWord;
+ }
searcHTML += '- '
+ contents + " " + data[i].path