forked from perlorg/perlweb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathleo.js
41 lines (35 loc) · 1.34 KB
/
leo.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
$(document).ready(function(){
// // External link, add image + make open in new page
// $('.ext').filter(function(obj) {
// this.target="_blank";
// return 1;
// }).after(' <img src="/i/external.v1.png" alt="external link"/>');
//
// $("a:not(img)").filter(function(obj) {
// this.target="_blank";
// return 1;
// }).after(' <img src="/i/external.v1.png" alt="external link"/>');
//
var link_filter = function() {
// If it's an image, do NOT show icon
if($(this).find('img').length)
return 0;
// some widgets get an image via CSS
if( $(this).html().length == 0) {
return 0;
}
// If it's external, ok
if(this.hostname && this.hostname !== location.hostname) {
this.target="_blank";
$(this).after('<img class="extlink" src="/i/external.v1.png" alt="external link"/>');
}
return 0;
};
$('#content a').filter(link_filter);
$('#footer a').filter(link_filter);
$('.round').corner("7px top");
$('.module').corner("10px top");
//$('.button').corner("7px");
// Any divs that should get hidden onload should have this as a class
$('.hidediv').toggle();
});