summaryrefslogtreecommitdiff
path: root/assets
diff options
context:
space:
mode:
authorYehonal <yehonal.azeroth@gmail.com>2018-12-31 12:44:35 +0100
committerYehonal <yehonal.azeroth@gmail.com>2018-12-31 12:44:35 +0100
commita9575d934d387e93cb5ff3ca1f5c51c4422f8875 (patch)
tree15b70c1ff21d4f82d7c7f55d3607d0d5d9b49e06 /assets
parent88800a6427a418b32923df4eeb4200b5e1daba99 (diff)
downloadwiki-a9575d934d387e93cb5ff3ca1f5c51c4422f8875.tar.gz
wiki-a9575d934d387e93cb5ff3ca1f5c51c4422f8875.tar.bz2
wiki-a9575d934d387e93cb5ff3ca1f5c51c4422f8875.zip
Implemented external links icon (wikipedia style)
Diffstat (limited to 'assets')
-rw-r--r--assets/images/external-link-ltr-icon.pngbin0 -> 151 bytes
-rw-r--r--assets/images/external.svg1
-rw-r--r--assets/js/red-links.js5
3 files changed, 5 insertions, 1 deletions
diff --git a/assets/images/external-link-ltr-icon.png b/assets/images/external-link-ltr-icon.png
new file mode 100644
index 0000000..9e97d37
--- /dev/null
+++ b/assets/images/external-link-ltr-icon.png
Binary files differ
diff --git a/assets/images/external.svg b/assets/images/external.svg
new file mode 100644
index 0000000..766d890
--- /dev/null
+++ b/assets/images/external.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12"> <path fill="#fff" stroke="#36c" d="M1.5 4.518h5.982V10.5H1.5z"/> <path fill="#36c" d="M5.765 1H11v5.39L9.427 7.937l-1.31-1.31L5.393 9.35l-2.69-2.688 2.81-2.808L4.2 2.544z"/> <path fill="#fff" d="M9.995 2.004l.022 4.885L8.2 5.07 5.32 7.95 4.09 6.723l2.882-2.88-1.85-1.852z"/> </svg> \ No newline at end of file
diff --git a/assets/js/red-links.js b/assets/js/red-links.js
index 065d3a9..8c1d719 100644
--- a/assets/js/red-links.js
+++ b/assets/js/red-links.js
@@ -7,8 +7,11 @@
function () {
$('a').each(function () {
// avoid red link for external urls
- if (this.hostname != window.location.hostname)
+ if (this.hostname != window.location.hostname) {
+ if ($(this).parents('#git-wiki-content').length > 0)
+ $(this).addClass("external-link");
return;
+ }
var ext = this.href.split('.').pop().split(/\#|\?/)[0];