mirror of
https://github.com/Decentralized-ID/decentralized-id.github.io.git
synced 2024-12-26 07:39:31 -05:00
target blank
This commit is contained in:
parent
a8fcb710a6
commit
6bd786c704
@ -9,6 +9,7 @@
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% else %}
|
{% else %}
|
||||||
<script src="{{ '/assets/js/main.min.js' | relative_url }}"></script>
|
<script src="{{ '/assets/js/main.min.js' | relative_url }}"></script>
|
||||||
|
<script src="{{ '/assets/js/mod_outer_links.js' | absolute_url }}"></script>
|
||||||
<script defer src="https://use.fontawesome.com/releases/v5.7.1/js/all.js" integrity="sha384-eVEQC9zshBn0rFj4+TU78eNA19HMNigMviK/PU/FFjLXqa/GKPgX58rvt5Z8PLs7" crossorigin="anonymous"></script>
|
<script defer src="https://use.fontawesome.com/releases/v5.7.1/js/all.js" integrity="sha384-eVEQC9zshBn0rFj4+TU78eNA19HMNigMviK/PU/FFjLXqa/GKPgX58rvt5Z8PLs7" crossorigin="anonymous"></script>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
10
assets/js/mod_outer_links.js
Normal file
10
assets/js/mod_outer_links.js
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
$(function () {
|
||||||
|
// add `target="_blank"` to outgoing links.
|
||||||
|
var host = document.location.host;
|
||||||
|
$("a[href]").each(function() {
|
||||||
|
var re = new RegExp(host, "g");
|
||||||
|
if ($(this).attr("href").match(/\/\//) && !$(this).attr("href").match(re)) {
|
||||||
|
$(this).attr("target", "_blank");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
Loading…
Reference in New Issue
Block a user