summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYehonal <yehonal.azeroth@gmail.com>2018-08-27 15:16:29 +0200
committerGitHub <noreply@github.com>2018-08-27 15:16:29 +0200
commit4148e2980e6ed81b45447c645d4be7313a6cb639 (patch)
treed12144b92c1579b86ac9d7e99a23b474e272f5cd
parenta685e0adf1e3679f45f22a9bd5bf143216d10624 (diff)
downloadwiki-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.js23
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);