2019-01-02 23:24:07 +01:00
/ *
# === === === === === === === === === === === === === === === === === === === === === === == #
# TITLE #
# Antimicrobial Resistance ( AMR ) Analysis #
# #
# SOURCE #
# https : //gitlab.com/msberends/AMR #
# #
# LICENCE #
2020-01-05 17:22:09 +01:00
# ( c ) 2018 - 2020 Berends MS , Luz CF et al . #
2019-01-02 23:24:07 +01:00
# #
# This R package is free software ; you can freely use and distribute #
# it for both personal and commercial purposes under the terms of the #
# GNU General Public License version 2.0 ( GNU GPL - 2 ) , as published by #
# the Free Software Foundation . #
# #
2020-01-05 17:22:09 +01:00
# We created this package for both routine data analysis and academic #
# research and it was publicly released in the hope that it will be #
# useful , but it comes WITHOUT ANY WARRANTY OR LIABILITY . #
2019-06-02 19:23:19 +02:00
# Visit our website for more info : https : //msberends.gitlab.io/AMR. #
2019-01-02 23:24:07 +01:00
# === === === === === === === === === === === === === === === === === === === === === === == #
* /
2019-06-02 19:50:22 +02:00
// Add updated Font Awesome 5.8.2 library
$ ( 'head' ) . append ( '<!-- Updated Font Awesome library --><link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.2/css/all.css">' ) ;
2018-12-30 10:27:28 +01:00
2019-05-10 16:44:59 +02:00
// Email template for new GitLab issues
//https://stackoverflow.com/a/33190494/4575331
//incoming+msberends-amr-9011429-5miwzuo1xo70wbz9r6fwv4dmg-issue@incoming.gitlab.com
2018-12-30 10:27:28 +01:00
$ ( document ) . ready ( function ( ) {
2019-01-21 15:53:01 +01:00
2019-06-07 22:47:37 +02:00
// add SurveyMonkey
2019-06-27 11:57:45 +02:00
// $('body').append('<script>(function(t,e,s,o){var n,a,c;t.SMCX=t.SMCX||[],e.getElementById(o)||(n=e.getElementsByTagName(s),a=n[n.length-1],c=e.createElement(s),c.type="text/javascript",c.async=!0,c.id=o,c.src=["https:"===location.protocol?"https://":"http://","widget.surveymonkey.com/collect/website/js/tRaiETqnLgj758hTBazgd_2BrwaGaWbg59AiLjNGdPaaJiBHKqgXKIw46VauwBvZ67.js"].join(""),a.parentNode.insertBefore(c,a))})(window,document,"script","smcx-sdk");</script>');
2019-06-07 22:47:37 +02:00
// add link to survey at home sidebar
2019-06-27 11:57:45 +02:00
// $('.template-home #sidebar .list-unstyled:first').append('<li><strong>Please fill in our survey at</strong> <br><a href="https://www.surveymonkey.com/r/AMR_for_R" target="_blank">https://www.surveymonkey.com/r/AMR_for_R</a></li>');
2019-06-07 22:47:37 +02:00
2019-06-02 19:50:22 +02:00
// remove version label from header
$ ( ".version.label" ) . remove ( ) ;
2019-01-21 15:53:01 +01:00
// redirect to GitLab
var url _old = window . location . href ;
var url _new = url _old . replace ( "github" , "gitlab" ) ;
if ( url _old != url _new ) {
2019-01-21 21:24:40 +01:00
window . location . replace ( url _new ) ;
2019-01-21 15:53:01 +01:00
}
2019-07-09 11:22:46 +02:00
// Replace 'Value' in manual to 'Returned value'
$ ( ".template-reference-topic h2#value" ) . text ( "Returned value" ) ;
2019-06-02 19:50:22 +02:00
// PR for 'R for Data Science' on How To pages
2019-02-11 10:27:10 +01:00
if ( $ ( ".template-article" ) . length > 0 ) {
2019-05-17 13:01:17 +02:00
$ ( '#sidebar' ) . prepend (
'<div id="r4ds">' +
' <a target="_blank" href="https://r4ds.had.co.nz/">' +
' Learn R reading this great book: R for Data Science.' +
' <br><br>' +
' Click to read it online - it was published for free.' +
' <img src="https://gitlab.com/msberends/AMR/raw/master/docs/cover_r4ds.png" height="100px">' +
' </a> ' +
' <hr>' +
'</div>' ) ;
2019-02-11 10:27:10 +01:00
}
2019-02-09 22:16:24 +01:00
2019-06-02 19:50:22 +02:00
// edit footer
2019-01-22 19:55:11 +01:00
$ ( 'footer' ) . html (
'<div>' +
2020-02-17 14:38:01 +01:00
'<p><code>AMR</code> (for R). Developed at the <a href="https://www.rug.nl">University of Groningen</a> in collaboration with non-profit organisations <a href="https://www.certe.nl">Certe Medical Diagnostics and Advice</a> and <a href="https://www.umcg.nl">University Medical Center Groningen</a>.</p>' +
'<a href="https://www.rug.nl"><img src="https://gitlab.com/msberends/AMR/raw/master/docs/logo_rug.png" class="footer_logo"></a>' +
2019-01-22 19:55:11 +01:00
'</div>' ) ;
2019-05-20 12:00:18 +02:00
// all links should open in new tab/window
2019-05-17 13:01:17 +02:00
$ ( 'footer' ) . html ( $ ( 'footer' ) . html ( ) . replace ( /href/g , 'target="_blank" href' ) ) ;
2019-01-02 23:24:07 +01:00
2019-02-14 15:18:17 +01:00
// doctoral titles of authors
function doct _tit ( x ) {
if ( typeof ( x ) != "undefined" ) {
2019-08-30 14:50:56 +02:00
// authors
x = x . replace ( /Author, maintainer/g , "Main developer" ) ;
x = x . replace ( /Author, contributor/g , "Main contributor" ) ;
x = x . replace ( /Author, thesis advisor/g , "Doctoral advisor" ) ;
2019-09-18 15:46:09 +02:00
x = x . replace ( "Alex" , "Prof. Dr. Alex" ) ;
x = x . replace ( "Bhanu" , "Prof. Dr. Bhanu" ) ;
x = x . replace ( "Casper" , "Prof. Dr. Casper" ) ;
x = x . replace ( "Corinna" , "Dr. Corinna" ) ;
2019-08-30 14:50:56 +02:00
// others
2019-09-18 15:46:09 +02:00
x = x . replace ( "Bart" , "Dr. Bart" ) ;
2019-11-04 11:35:34 +01:00
x = x . replace ( "Sofia" , "Dr. Sofia" ) ;
2019-09-18 15:46:09 +02:00
x = x . replace ( "Dennis" , "Dr. Dennis" ) ;
x = x . replace ( "Judith" , "Dr. Judith" ) ;
2019-02-14 15:18:17 +01:00
}
return ( x ) ;
}
$ ( ".template-authors" ) . html ( doct _tit ( $ ( ".template-authors" ) . html ( ) ) ) ;
2019-12-27 11:56:54 +01:00
$ ( ".template-citation-authors" ) . html ( doct _tit ( $ ( ".template-citation-authors" ) . html ( ) ) ) ;
2019-02-14 15:18:17 +01:00
$ ( ".developers" ) . html ( doct _tit ( $ ( ".developers" ) . html ( ) ) ) ;
2019-12-20 21:06:39 +01:00
// $("footer").html(doct_tit($("footer").html()));
2019-02-14 15:18:17 +01:00
2019-01-02 23:24:07 +01:00
// Edit title of manual
$ ( '.template-reference-index h1' ) . text ( 'Manual' ) ;
2018-12-30 10:27:28 +01:00
} ) ;
2019-01-08 16:23:45 +01:00
2019-01-21 21:24:40 +01:00
$ ( 'head' ) . append ( "<!-- Matomo --><script type='text/javascript'> var _paq = _paq || []; /* tracker methods like 'setCustomDimension' should be called before 'trackPageView' */ _paq.push(['setDomains', ['*.msberends.gitlab.io/AMR']]); _paq.push(['enableCrossDomainLinking']); _paq.push(['trackPageView']); _paq.push(['enableLinkTracking']); (function() { var u='https://analyse.uscloud.nl/'; _paq.push(['setTrackerUrl', u+'piwik.php']); _paq.push(['setSiteId', '3']); var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s); })();</script><!-- End Matomo Code -->" ) ;