index: release v1.18 with only altgr index linked
[sheet.git] / searchlocal.js
index eb4baf635da7f70002b9df7cad8623b7d538b062..6498e32e06c196aa0a6669ed1ae573c33933058f 100644 (file)
@@ -69,6 +69,7 @@ function filtertable(query, action) {
                query = match[2];
        }
 
+if (document.querySelector !== undefined) {
        if (query == '' && action == 'add') {
                // restore all columns if explicitly adding all ("+")
                filtercols(table, function(){return true}, 'add');
@@ -82,6 +83,7 @@ function filtertable(query, action) {
                }
                return filtercols(table, match, action || 'toggle');
        }
+}
 
        if (/^[A-Z0-9 ]{2,}$/.test(query)) {
                // category title if all uppercase
@@ -104,7 +106,7 @@ function filtertable(query, action) {
        else {
                // title text (case-insensitive unless caps in input)
                var match = function(row) {
-                       return row.cells[1].textContent.match(query, /[A-Z]/.test(query) ? '' : 'i');
+                       return row.cells[1].textContent.match(new RegExp(query, /[A-Z]/.test(query) ? '' : 'i'));
                };
        }
        filterrows(table, match, action || 'filter');