From 03b6f6c2630a0bd4c507f595519bbe840c2ee332 Mon Sep 17 00:00:00 2001 From: tophf Date: Wed, 6 Dec 2017 09:39:45 +0300 Subject: [PATCH] manage: search regexps, add search help, fix favicons toggle icon * the toggle icon is now a triangle, rotated when open --- _locales/en/messages.json | 6 ++--- js/messaging.js | 4 +-- manage.html | 22 +++++++++++------ manage/filters.js | 47 +++++++++++++++++++++++++++++++---- manage/manage.css | 52 ++++++++++++++++++++++++++++++++++++--- manage/manage.js | 10 +++++++- 6 files changed, 120 insertions(+), 21 deletions(-) diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 36ce385a..8606964b 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -691,9 +691,9 @@ "message": "Search contents", "description": "Label for the search filter textbox on the Manage styles page" }, - "searchStylesTooltip": { - "message": "To show styles for a URL, prefix it with 'url:'\nFor example, url:https://github.com/openstyles/stylus", - "description": "Label for the search filter textbox on the Manage styles page" + "searchStylesHelp": { + "message": " key focuses the search field.\nPlain text: search within the name, code, homepage URL and sites it is applied to. Words with less than 3 letters are ignored.\nMatching URL: prefix the search with , e.g. \nRegular expressions: include slashes and flags, e.g. \nExact words: wrap the query in double quotes, e.g. <\"Like this!\">", + "description": "Text in the minihelp displayed when clicking (i) icon to the right of the search input field on the Manage styles page" }, "sectionAdd": { "message": "Add another section", diff --git a/js/messaging.js b/js/messaging.js index 47c8900b..0936870c 100644 --- a/js/messaging.js +++ b/js/messaging.js @@ -286,9 +286,9 @@ function tryCatch(func, ...args) { } -function tryRegExp(regexp) { +function tryRegExp(regexp, flags) { try { - return new RegExp(regexp); + return new RegExp(regexp, flags); } catch (e) {} } diff --git a/manage.html b/manage.html index cb4793be..d9fa2f40 100644 --- a/manage.html +++ b/manage.html @@ -237,10 +237,12 @@ - +
+ + +
@@ -292,10 +294,11 @@ - - -