diff options
| author | Yehonal <yehonal.azeroth@gmail.com> | 2018-08-27 15:16:29 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-08-27 15:16:29 +0200 |
| commit | 4148e2980e6ed81b45447c645d4be7313a6cb639 (patch) | |
| tree | d12144b92c1579b86ac9d7e99a23b474e272f5cd | |
| parent | a685e0adf1e3679f45f22a9bd5bf143216d10624 (diff) | |
| download | wiki-4148e2980e6ed81b45447c645d4be7313a6cb639.tar.gz wiki-4148e2980e6ed81b45447c645d4be7313a6cb639.tar.bz2 wiki-4148e2980e6ed81b45447c645d4be7313a6cb639.zip | |
Implemented "wiki red links" feature
Just a bit hacky but works
| -rw-r--r-- | assets/js/wiki-features.js | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/assets/js/wiki-features.js b/assets/js/wiki-features.js index 237bf05..4fb58a1 100644 --- a/assets/js/wiki-features.js +++ b/assets/js/wiki-features.js @@ -102,4 +102,27 @@ render[settings.showEffect](); }; + + // + // RED LINK FEATURE (Hacky) + // TODO: filter external links + $(window).load(function () { + $('a').each(function() { + var that=this; + $.ajax({ + type: 'HEAD', + url: this.href, + success: function() { + + }, + error: function (xhr, ajaxOptions, thrownError){ + if(xhr.status==404) { + console.log("err"); + $(that).css('color', 'red'); + } + } + }); + }); + }); + })(jQuery); |
