diff options
| author | Yehonal <yehonal.azeroth@gmail.com> | 2018-12-20 17:43:53 +0100 |
|---|---|---|
| committer | Yehonal <yehonal.azeroth@gmail.com> | 2018-12-21 20:16:44 +0100 |
| commit | 5668e09a7bcc5b0ac72a29f457127f6763f07223 (patch) | |
| tree | e793a95b7829337013840eb7e9777e8241cfe4c1 | |
| parent | 936bda882b45692bcb7f4e20ae5e5b2b18717553 (diff) | |
| download | wiki-5668e09a7bcc5b0ac72a29f457127f6763f07223.tar.gz wiki-5668e09a7bcc5b0ac72a29f457127f6763f07223.tar.bz2 wiki-5668e09a7bcc5b0ac72a29f457127f6763f07223.zip | |
red link check improvements
| -rw-r--r-- | assets/js/red-links.js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/assets/js/red-links.js b/assets/js/red-links.js index 446db02..014f954 100644 --- a/assets/js/red-links.js +++ b/assets/js/red-links.js @@ -9,6 +9,11 @@ if (this.hostname != window.location.hostname) return; + var ext = this.href.split('.').pop().split(/\#|\?/)[0]; + + if (ext != "html") + this.css('color', 'red'); // pessimistic condition + var that = this; $.ajax({ type: 'HEAD', @@ -19,6 +24,8 @@ error: function (xhr, ajaxOptions, thrownError) { if (xhr.status == 404) { $(that).css('color', 'red'); + } else { + $(that).css('color', ''); } } }); |
