From d10e83d15c60d8c58553213831a9dadee4dcc585 Mon Sep 17 00:00:00 2001 From: tophf Date: Mon, 18 Dec 2017 09:55:32 +0300 Subject: [PATCH] editor: rewrite global search/replace --- .eslintrc | 6 +- _locales/en/messages.json | 20 + edit.html | 136 ++-- edit/codemirror-editing-hooks.js | 312 ++------ edit/global-search.css | 232 ++++++ edit/global-search.js | 895 +++++++++++++++++++++++ vendor/codemirror/addon/search/search.js | 252 ------- 7 files changed, 1286 insertions(+), 567 deletions(-) create mode 100644 edit/global-search.css create mode 100644 edit/global-search.js delete mode 100644 vendor/codemirror/addon/search/search.js diff --git a/.eslintrc b/.eslintrc index 2a121818..bc0641d0 100644 --- a/.eslintrc +++ b/.eslintrc @@ -81,7 +81,7 @@ rules: computed-property-spacing: [2, never] consistent-return: [0] constructor-super: [2] - curly: [2] + curly: [2, "multi-line"] default-case: [0] dot-location: [2, property] dot-notation: [0] @@ -121,7 +121,7 @@ rules: no-case-declarations: [2] no-class-assign: [2] no-cond-assign: [2, except-parens] - no-confusing-arrow: [1, {allowParens: true}] + no-confusing-arrow: [0, {allowParens: true}] no-const-assign: [2] no-constant-condition: [0] no-continue: [0] @@ -219,7 +219,7 @@ rules: no-unreachable: [2] no-unsafe-finally: [2] no-unsafe-negation: [2] - no-unused-expressions: [1, {allowShortCircuit: true, allowTernary: true}] + no-unused-expressions: [1] no-unused-labels: [0] no-unused-vars: [1, {args: after-used, vars: local, argsIgnorePattern: ^_}] no-use-before-define: [2, nofunc] diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 4f68662e..11148287 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -214,6 +214,14 @@ "message": "History", "description": "Used in various places to show a history log of something" }, + "genericNext": { + "message": "Next", + "description": "Used in various places to select/perform the next step/action" + }, + "genericPrevious": { + "message": "Previous", + "description": "Used in various places to select/perform the previous step/action" + }, "genericResetLabel": { "message": "Reset", "description": "Used in various parts of UI to indicate that something may be reset to its original state" @@ -737,6 +745,18 @@ "message": "Search", "description": "Label before the search input field in the editor shown on Ctrl-F" }, + "searchCaseSensitive": { + "message": "Case-sensitive", + "description": "Tooltip for the 'Aa' icon that enables case-sensitive search in the editor shown on Ctrl-F" + }, + "searchNumberOfResults": { + "message": "Number of matches", + "description": "Tooltip for the number of found search results in the editor shown on Ctrl-F" + }, + "searchNumberOfResults2": { + "message": "Number of matches in code and applies-to values", + "description": "Tooltip for the number of found search results in the editor shown on Ctrl-F" + }, "searchRegexp": { "message": "Use /re/ syntax for regexp search", "description": "Label after the search input field in the editor shown on Ctrl-F" diff --git a/edit.html b/edit.html index 67991061..b05c9629 100644 --- a/edit.html +++ b/edit.html @@ -3,8 +3,8 @@ - - + +