Team:Freiburg/Templates/html/inlinejs.html
From 2014.igem.org
(Difference between revisions)
(7 intermediate revisions not shown) | |||
Line 2: | Line 2: | ||
<script> | <script> | ||
(function(){ | (function(){ | ||
- | + | function hasClass( elem, klass ) { | |
- | + | return (" " + elem.className + " " ).indexOf( " "+klass+" " ) > -1; | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
} | } | ||
- | // | + | // remove unnecessary css |
- | + | if (hasClass(document.body, 'mediawiki')){ | |
- | if ( | + | var unwantedStylesheets = document.head.querySelectorAll('head link[rel="stylesheet"], head style[type="text/css"]'); |
- | + | for (var i=0;i<unwantedStylesheets.length; i++){ | |
- | + | unwantedStylesheets[i].parentNode.removeChild(unwantedStylesheets[i]); | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
} | } | ||
} | } | ||
+ | function loadStylesheet(href) { | ||
+ | var link = document.createElement("link"); | ||
+ | link.href = href; | ||
+ | link.type = "text/css"; | ||
+ | link.rel = "stylesheet"; | ||
+ | document.getElementsByTagName("head")[0].appendChild(link); | ||
+ | }; | ||
+ | loadStylesheet('/Team:Freiburg/css/bootstrap.3.2.0.min.css?action=raw\u0026ctype=text/css'); | ||
+ | loadStylesheet('/Team:Freiburg/css/magnific-popup.css?action=raw\u0026ctype=text/css'); | ||
+ | loadStylesheet('/Team:Freiburg/css/jquery.qtip.min.css?action=raw\u0026ctype=text/css'); | ||
+ | loadStylesheet('/Team:Freiburg/css/styles_v2.css?action=raw\u0026ctype=text/css'); | ||
+ | loadStylesheet('/Team:Freiburg/css/styles_additional.css?action=raw\u0026ctype=text/css'); | ||
})(); | })(); | ||
</script> | </script> | ||
</html> | </html> |
Latest revision as of 12:05, 13 October 2014