diff options
| author | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2022-09-24 16:05:19 -0400 | 
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-09-24 16:05:19 -0400 | 
| commit | 1e91bf151f43ad05138e862ba4a03abad6929e5f (patch) | |
| tree | 174e3c65f91b094056127dc3d53d99ec6c711a9f /ext/js/display | |
| parent | b27d290509ae2ce9f2158b5d8f0c90e40828043b (diff) | |
DocumentUtil static (#2232)
* Make all methods static
The two non-static methods are kept for temporary compatibility
* Use this instead of class name now that functions are static
* Update test
* Don't instantiate DocumentUtil
* Remove temporary non-static methods
* Remove unused global declaration
Diffstat (limited to 'ext/js/display')
| -rw-r--r-- | ext/js/display/display.js | 4 | ||||
| -rw-r--r-- | ext/js/display/query-parser.js | 4 | 
2 files changed, 1 insertions, 7 deletions
| diff --git a/ext/js/display/display.js b/ext/js/display/display.js index d286bd5e..21bdc5a4 100644 --- a/ext/js/display/display.js +++ b/ext/js/display/display.js @@ -20,7 +20,6 @@   * DisplayGenerator   * DisplayHistory   * DisplayNotification - * DocumentUtil   * ElementOverflowController   * FrameEndpoint   * Frontend @@ -121,7 +120,6 @@ class Display extends EventDispatcher {          this._query = '';          this._fullQuery = '';          this._queryOffset = 0; -        this._documentUtil = new DocumentUtil();          this._progressIndicator = document.querySelector('#progress-indicator');          this._progressIndicatorTimer = null;          this._progressIndicatorVisible = new DynamicProperty(false); @@ -130,7 +128,6 @@ class Display extends EventDispatcher {          this._queryParserContainer = document.querySelector('#query-parser-container');          this._queryParser = new QueryParser({              getSearchContext: this._getSearchContext.bind(this), -            documentUtil: this._documentUtil,              japaneseUtil          });          this._contentScrollElement = document.querySelector('#content-scroll'); @@ -1498,7 +1495,6 @@ class Display extends EventDispatcher {              this._contentTextScanner = new TextScanner({                  node: window,                  getSearchContext: this._getSearchContext.bind(this), -                documentUtil: this._documentUtil,                  searchTerms: true,                  searchKanji: false,                  searchOnClick: true, diff --git a/ext/js/display/query-parser.js b/ext/js/display/query-parser.js index cc193a06..bafa9045 100644 --- a/ext/js/display/query-parser.js +++ b/ext/js/display/query-parser.js @@ -20,10 +20,9 @@   */  class QueryParser extends EventDispatcher { -    constructor({getSearchContext, documentUtil, japaneseUtil}) { +    constructor({getSearchContext, japaneseUtil}) {          super();          this._getSearchContext = getSearchContext; -        this._documentUtil = documentUtil;          this._japaneseUtil = japaneseUtil;          this._text = '';          this._setTextToken = null; @@ -39,7 +38,6 @@ class QueryParser extends EventDispatcher {          this._textScanner = new TextScanner({              node: this._queryParser,              getSearchContext, -            documentUtil,              searchTerms: true,              searchKanji: false,              searchOnClick: true |