diff options
author | Andreas Gohr <andi@splitbrain.org> | 2024-10-14 13:28:59 +0200 |
---|---|---|
committer | Andreas Gohr <andi@splitbrain.org> | 2024-10-14 13:28:59 +0200 |
commit | 8dcd6c40ec5247446641af9801af86d78bcfded9 (patch) | |
tree | 5e8f0c3978810f50fa49aaf0471ec9d2d3bebf12 /lib | |
parent | 3f677f5c17910f6da763ff741753e2a60300b257 (diff) | |
download | dokuwiki-8dcd6c40ec5247446641af9801af86d78bcfded9.tar.gz dokuwiki-8dcd6c40ec5247446641af9801af86d78bcfded9.zip |
Linkwizard: use strict comparisons
Diffstat (limited to 'lib')
-rw-r--r-- | lib/scripts/linkwiz.js | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/scripts/linkwiz.js b/lib/scripts/linkwiz.js index a78c8c52c..bdc825e0e 100644 --- a/lib/scripts/linkwiz.js +++ b/lib/scripts/linkwiz.js @@ -180,7 +180,7 @@ class LinkWizard { */ resultClick(a) { this.$entry.val(a.title); - if (a.title == '' || a.title.substr(a.title.length - 1) == ':') { + if (a.title === '' || a.title.charAt(a.title.length - 1) === ':') { this.autocomplete_exec(); } else { if (jQuery(a.nextSibling).is('span')) { @@ -205,14 +205,14 @@ class LinkWizard { } sel = DWgetSelection(this.textArea); - if (sel.start == 0 && sel.end == 0) { + if (sel.start === 0 && sel.end === 0) { sel = this.selection; } stxt = sel.getText(); // don't include trailing space in selection - if (stxt.charAt(stxt.length - 1) == ' ') { + if (stxt.charAt(stxt.length - 1) === ' ') { sel.end--; stxt = sel.getText(); } @@ -222,8 +222,8 @@ class LinkWizard { } // prepend colon inside namespaces for non namespace pages - if (this.textArea.form.id.value.indexOf(':') != -1 && - link.indexOf(':') == -1) { + if (this.textArea.form.id.value.indexOf(':') !== -1 && + link.indexOf(':') === -1) { link = ':' + link; } @@ -320,7 +320,7 @@ class LinkWizard { * Toggle the link wizard */ toggle() { - if (this.$wiz.css('display') == 'none') { + if (this.$wiz.css('display') === 'none') { this.show(); } else { this.hide(); |