aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/lib
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2024-10-14 13:28:59 +0200
committerAndreas Gohr <andi@splitbrain.org>2024-10-14 13:28:59 +0200
commit8dcd6c40ec5247446641af9801af86d78bcfded9 (patch)
tree5e8f0c3978810f50fa49aaf0471ec9d2d3bebf12 /lib
parent3f677f5c17910f6da763ff741753e2a60300b257 (diff)
downloaddokuwiki-8dcd6c40ec5247446641af9801af86d78bcfded9.tar.gz
dokuwiki-8dcd6c40ec5247446641af9801af86d78bcfded9.zip
Linkwizard: use strict comparisons
Diffstat (limited to 'lib')
-rw-r--r--lib/scripts/linkwiz.js12
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();