Se fuerza a que los enlaces externos abran siempre en una nueva página

This commit is contained in:
Manuel Cillero 2018-02-24 18:50:22 +01:00
parent d5080bf236
commit d2df3cf133
3 changed files with 95 additions and 87 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 136 B

After

Width:  |  Height:  |  Size: 196 B

Before After
Before After

View file

@ -1,4 +1,4 @@
if (window.jQuery) {
if (window.jQuery) {
$(window).load(function(){
if (window.devicePixelRatio > 1) {
var images = findImagesByRegexp('contacts_thumbnail', document);
@ -35,7 +35,7 @@
}
}
// Sized thumbnails
// Sized thumbnails
var images = findImagesByRegexp(/\/attachments\/thumbnail\/\d+\/\d+$/, document)
for(var i = 0; i < images.length; i++) {
var lowres = images[i].src;
@ -51,7 +51,7 @@
}
}
// People avatars
// People avatars
var images = findImagesByRegexp(/people\/avatar.*size=\d+$/, document)
for(var i = 0; i < images.length; i++) {
@ -60,9 +60,12 @@
var highres = lowres.replace(/size=(\d+)$/, "size=" + String(old_size*2));
images[i].src = highres;
}
}
// External links
$("a").filter(function() {
return this.hostname && this.hostname !== location.hostname;
}).addClass("external").attr("target", "_blank");
});
} else {
document.observe("dom:loaded", function() {
@ -87,7 +90,6 @@
images[i].width = old_size;
}
}
});
}

View file

@ -172,6 +172,12 @@ div#activity dt.icon {
word-wrap: break-word;
}
div.wiki .external {
padding-left: 0;
padding-right: 12px;
background-position: right 60%;
}
/**********************************************************/
/* 2. FONT ICONS */
/**********************************************************/