From 4148e2980e6ed81b45447c645d4be7313a6cb639 Mon Sep 17 00:00:00 2001 From: Yehonal Date: Mon, 27 Aug 2018 15:16:29 +0200 Subject: Implemented "wiki red links" feature Just a bit hacky but works --- assets/js/wiki-features.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) 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); -- cgit