// // NACHLADEN // /*** LOGIN-Fehler ***/ var error = false; error = getUrlVars()['error']; if (error) { error = decodeURIComponent((error + '').replace(/\+/g, '%20')); alert(error); } function getUrlVars() { var vars = [], hash; var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&'); for (var i = 0; i < hashes.length; i++) { hash = hashes[i].split('='); vars.push(hash[0]); vars[hash[0]] = hash[1]; } return vars; } jQuery(document).ready(function($) { /****************************************** * Hilfsfunktion für Typo3 * Menü-Eintrag aktivieren, wenn ausgeblendeter Unterpunkt aktiv ist */ $("#menue li.open:not(:has(ul)) a").addClass("aktiv"); /***************************************** * BibTeX toggle */ $('a.bibtextoggle').click(function() { $(this).parent('div').next('div').next('div').slideToggle(); return false; } ); // Colorbox wird jetzt standardmäßig mitgeladen. $.insert('https://www.uni-oldenburg.de/img/script/colorbox.css'); if (typeof colorbox_autostart == 'string') { jQuery.colorbox({ href: colorbox_autostart }); } // Diashow: wertet $("img.dias") aus if ($("img.dias").length) $.getScript("//www.uni-oldenburg.de/img/script/diashow.js"); // Workaround: Absoluten Pfad aus Links zu Ankern entfernen $("a[href^='http://www.uni-oldenburg.de/typo3/#']").each(function() { $(this).attr("href", $(this).attr("href").replace('http://www.uni-oldenburg.de/typo3/', '')); }); $("a[href^='http://www.uni-oldenburg.de/#']").each(function() { $(this).attr("href", $(this).attr("href").replace('http://www.uni-oldenburg.de/', '')); }); $("a[href^='typo3/#']").each(function() { $(this).attr("href", $(this).attr("href").replace('typo3/', '')); }); /** Links zu Namenregister-Einträgen in Thickbox-Links umwandeln (gilt für normale Links und Image-Map-Links) */ var a_thick = $("a[href^='http://www.uni-oldenburg.de/index/personen/']"); var a_person = $("a[href^='index/personen/']"); var area_thick = $("area[href^='http://www.uni-oldenburg.de/index/personen/']"); var area_person = $("area[href^='index/personen/']"); var lightbox = $("a[target^='lightbox']"); // IRO: MoveOnline var a_moveonline = $("a[href^='http://www.iro.uni-oldenburg.de/move/moveonline/cooperations/']"); var a_lehrendenregister = $("a[href*='KCarpenter1']"); /** Lightbox aktivieren */ // Colorbox if (($("a.thickbox") != null && $("a.thickbox").length) || ($("area.thickbox") != null && $("area.thickbox").length) || (a_thick != null && a_thick.length) || (a_person != null && a_person.length) || (area_thick != null && area_thick.length) || (lightbox != null && lightbox.length) || (area_person != null && area_person.length) || (a_lehrendenregister != null && a_lehrendenregister.length) || (a_moveonline != null && a_moveonline.length) || ($("a[href^='http://www.uni-oldenburg.de/admin/headers.php']").length) ) { var machColorbox = function() { // Namenregister der Lehrenden - Links umbiegen auf zentrales Namenregister if (a_lehrendenregister != null && a_lehrendenregister.length) $(a_lehrendenregister).each(function() { $(this).attr('title', 'Kontakt'); }); var winwidth = parseInt($(window).width())-40; var boxwidth = (parseInt(winwidth)<750)?winwidth:'710px'; $("a[href^='http://www.uni-oldenburg.de/index/personen/']").colorbox({ width: boxwidth, height: '80%', iframe: true, onComplete: function() { $("#cboxTitle").hide(); } }); $("a[href^='index/personen/']").colorbox({ width: boxwidth, height: '80%', iframe: true, onComplete: function() { $("#cboxTitle").hide(); } }); $("area[href^='http://www.uni-oldenburg.de/index/personen/']").colorbox({ width: boxwidth, height: '80%', iframe: true }); $("a[target^='lightbox']").each(function() { var lightb_target = $(this).attr("target"); var lightb_x = "95%"; var lightb_y = "95%"; if (lightb_target != 'lightbox') { var lightb_x = lightb_target.replace(/lightbox(\d+)x.*$/g, "$1"); lightb_x = lightb_x ? lightb_x : "95%"; var lightb_y = lightb_target.replace(/lightbox\d+x(\d+)[^\d]*$/g, "$1"); lightb_y = lightb_y ? lightb_y : "95%"; } $(this).colorbox({ width: lightb_x, height: lightb_y, iframe: true, onComplete: function() { $("#cboxTitle").hide(); } }); }); $("a[href^='http://www.uni-oldenburg.de/index/personen/']").each(function() { $(this).attr('href', $(this).attr('href') + '&iframe=ja'); }); $("a[href^='index/personen/']").each(function() { $(this).attr('href', $(this).attr('href') + '&iframe=ja'); }); $("area[href^='http://www.uni-oldenburg.de/index/personen/']").each(function() { $(this).attr('href', $(this).attr('href') + '&iframe=ja'); }); if ($("a.thickbox") != null && $("a.thickbox").length) { $("a.thickbox[href$='\\.JPG'],a.thickbox[href$='\\.jpg'],a.thickbox[href$='\\.jpeg'],a.thickbox[href$='\\.gif'],a.thickbox[href$='\\.png']").colorbox({ maxHeight: '95%', maxWidth: '96%' }); $("a.thickbox[href$='\\.html'],a.thickbox[href$='\\.htm'],a.thickbox[href$='\\/']").colorbox({ maxHeight: '80%', width: '95%', height: '95%', iframe: true }); } $("a[href^='http://www.uni-oldenburg.de/admin/headers.php']").colorbox({ width: boxwidth, height: '80%', iframe: true }); if (a_moveonline != null && a_moveonline.length) $(a_moveonline).colorbox({ width: "820px", height: '95%', iframe: true }); // Stud.IP $("a[href^='https://elearning.uni-oldenburg.de/resources_extern/']").colorbox({ width: "95%", height: '80%', iframe: true }); // YouTube $("a[href^='http://www.youtube.com/embed/']").colorbox({ width: "800px", height: '600px', iframe: true }); } machColorbox(); } var iframe_personen = $("iframe[src^='http://www.uni-oldenburg.de/index/personen/']"); if (iframe_personen != null) $("iframe[src^='http://www.uni-oldenburg.de/index/personen/']").each(function(i) { var ifra = $("iframe:eq(" + i + ")"); var perslink = $(ifra).attr('src'); var t3 = $('body').hasClass("t3"); $.ajax({ dataType: 'jsonp', jsonp: 'jsonp_callback', url: '//www.uni-oldenburg.de/index/personen/jsonp.php?link=' + perslink.replace(' ', '+') + '&htmlrahmen=nein' + (t3 ? '&t3=ja' : ''), success: function(data) { $(ifra).before(data.html).remove(); } }); $(".druckbutton").hide(); }) if ($(".klappliste").length) { $(".klappliste h4") .hover(function() { $(this).css({ 'cursor': 'pointer' }) }) .addClass('geschlossen') .click(function() { if ($(this).hasClass('geschlossen')) $(this).removeClass('geschlossen').addClass('offen').next().slideDown(); else $(this).removeClass('offen').addClass('geschlossen').next().slideUp(); }) .next().css({ 'display': 'none' }); // Erstes Element aufklappen: $(".klappliste h4:eq(0)").removeClass('geschlossen').addClass('offen').next().show(); } // Bewirkt, dass das dem mit .aufklappen ausgezeichneten Element direkt folgende Element durch Klicken auf- und zugeklappt wird if ($(".aufklappen").length) { $(".aufklappen") .css({ 'color': '#0000aa' }) //.prepend('
') .wrap('') .wrap(''); }); if ($('.uniol_tinyscrollbar').length) { $('.uniol_tinyscrollbar') .prepend(' ') .prepend(' ') .hover( function() { $(this).css({ 'cursor': 'pointer', 'text-decoration': 'underline' }); // if ($(this).hasClass('geschlossen')) $(this).removeClass('geschlossen').addClass('offen').next().slideDown(); }, function() { $(this).css({ 'text-decoration': 'none' }); } ) .addClass('geschlossen') .attr('title', 'Klicken zum Auf- und zuklappen') .click(function() { if (!$(":animated").length) { if ($(this).hasClass('geschlossen')) $(this).removeClass('geschlossen').addClass('offen').next().slideDown(); else $(this).removeClass('offen').addClass('geschlossen').next().slideUp(); } }) .next().css({ 'display': 'none' }); } // $(".ka-panel header h1, .ka-panel header h3").css({ // 'padding-right': '20px', // background: 'url(//www.uni-oldenburg.de/img/css3/png/plus.png) 99% 2px no-repeat', // cursor: 'pointer' // }); /************************************* * Tiny Scrollbar (JS-Scrollbalken für DIVs mit Overflow:hidden) * ***********************************/ $.insert('https://www.uni-oldenburg.de/img/script/tinyscrollbar/css/website.css'); $('.vkbox ul').addClass('maxheight200'); $('.rechte-spalte-block > div').addClass('maxheight200'); if($('.maxheight200').length) jQuery.getScript('https://www.uni-oldenburg.de/img/script/tinyscrollbar/js/jquery.tinyscrollbar.min.js', function() { $('.maxheight200').each(function() { if ($(this).height() >= 200) $(this) // falls erforderlich ... .css('overflow', 'visible') .removeClass('maxheight200') .wrap(' ') .tinyscrollbar({ sizethumb: 36 }); } }); // Intranetmeldungen //if (document.location.href == 'http://www.uni-oldenburg.de/') // $.getScript("http://www.uni-oldenburg.de/img/script/intranetmeldungen.js"); if (!($.cookie)) { $.getScript('https://www.uni-oldenburg.de/img/script/jquery.cookie.js', function() { cookie_funktionen(); }); } else cookie_funktionen(); /*************************************** Layout2012-Cookie auslesen */ var cookieneu; var neuwert; // var cookie_layout2012 = function() { //cookieneu = (jQuery.cookie('uniol_layout2012') == 'ja') ? 'nein' : 'ja'; //neuwert = (cookieneu == 'ja') ? 'NEUE' : 'BISHERIGE'; // 2012-02-21: immer ausführen //if (jQuery.cookie('uniol_layout2012') == 'ja' || true) { // $('#inhaltinfos p').prepend(' [Layout-Feedback] '); // Standard-Bannergrafik setzen, außer bei Seiten aus Typo3 und Seiten, die extra noch im alten Layout sind (z.B. BASS) if (!$("body").hasClass("css_2011") && !$("body").hasClass("t3") && $("#header").height() < 125) { $.insert("https://www.uni-oldenburg.de/img/css/orga/standard1_h85-banner.css"); } $("#horizMenue").css("backgroundColor", "rgb(240, 241, 245)"); //} // } var layout_umschalten = function() { cookieneu = ($.cookie('uniol_layout2012') == 'ja') ? 'nein' : 'ja'; $.cookie('uniol_layout2012', cookieneu, { expires: 100, path: '/', domain: 'uni-oldenburg.de' }); alert("Sie haben auf das " + neuwert + " Layout auf umgeschaltet. Bitte jetzt einmal den Browser zum Neu-Laden zwingen, um die Änderung sichtbar zu machen!"); document.location.href = document.location.href; } var horizNavi = function() { // 2012-02-21 : permanent auf 2012 schalten // if($.cookie('uniol_layout2012') == 'ja') $("body").addClass("css_2012"); //else $("body").addClass("css_2011") // 2012-02-21 : von 2012er Cookie unabhängig machen: if ( !($("#horizMenue").length)) { /* alte Seiten im neuen Layout */ var lang = $("html").attr("lang"); // Uni-Suchfeld nachladen $.getJSON("https://www.uni-oldenburg.de/img/script/unisuchformular.php?jsonp_callback=?", { lang: lang }, function(data) { $("#header").append(data); }); // Horizontalnavigation nachladen $.getJSON("https://www.uni-oldenburg.de/img/script/uninavi.php?jsonp_callback=?", { lang: lang }, function(data) { var header_mehr = $("#header").height() == '121' ? '0px' : '40px'; //alert($("#header").height()); $("#header") .append(data) .css({ "position": "relative", "paddingBottom": header_mehr }); //.animate({"paddingBottom":'70px'}); $("#page_margins3").css({ 'backgroundColor': 'rgb(240,241,245)' }); $("#main").css({ 'borderTop': '30px solid rgb(240,241,245)' }); $("#horizMenue").css({ height: '26px' }); var bereich = $("#navizeile a:eq(1)").text(); var bereich2 = $("#navizeile a:eq(2)").text(); if (bereich == '') { var naz = $("#navizeile").clone(); $(naz).find("span").remove(); $(naz).find("a").remove(); bereich = $(naz).text().trim(); } var bereiche = []; var bereiche_i = []; $("#horizMenueInnen > ul > li > a").each(function(i) { bereiche[$(this).text()] = i; bereiche_i[i] = $(this).text(); }); var horizMarkieren = function(bereich) { if (typeof bereiche[bereich] !== 'undefined') $("#horizMenueInnen > ul > li:eq(" + bereiche[bereich] + ")").addClass("open"); } var horizMarkierenUnterpunkt = function(unterpunktHref) { $("#horizMenueInnen a[href=" + unterpunktHref + "]").addClass("aktiv"); } if (typeof bereiche[bereich] !== 'undefined') horizMarkieren(bereich); // de if (bereich == 'Einrichtungen') horizMarkieren(bereiche_i[1]); else if (bereich == 'Verwaltung') horizMarkieren(bereiche_i[1]); else if (bereich == 'Die Universität') horizMarkieren(bereiche_i[1]); //$("#horizMenueInnen > ul > li:eq(1)").addClass("open"); else if (bereich == 'Internationales') horizMarkieren("International"); else if (bereich == 'Fk.') horizMarkieren(bereiche_i[5]); // Einzelne Seiten else if (document.location == 'http://www.uni-oldenburg.de/aktuell/') $("#horizMenueInnen > ul > li:eq(1)").addClass("open"); else if (document.location == 'http://www.studium.uni-oldenburg.de/') $("#horizMenueInnen > ul > li:eq(2)").addClass("open"); else if (document.location == 'http://www.international.uni-oldenburg.de/') $("#horizMenueInnen > ul > li:eq(5)").addClass("open"); else if (document.location == 'http://www.uni-oldenburg.de/weiterbildung/') $("#horizMenueInnen > ul > li:eq(6)").addClass("open"); // en else if (bereich == 'Institutions') horizMarkieren(bereiche_i[1]); if (bereich2 == 'Aktuelles') $("#horizMenueInnen a[href='http://www.uni-oldenburg.de/aktuelles/']").parent().addClass("open"); else if (bereich2 == 'C3L') $("#horizMenueInnen a[href='http://www.uni-oldenburg.de/c3l/']").parent().addClass("open"); else if (bereich2 == 'Fk. I') $("#horizMenueInnen a[href='http://www.uni-oldenburg.de/fk1/']").parent().addClass("open"); else if (bereich2 == 'Fk. II') $("#horizMenueInnen a[href='http://www.uni-oldenburg.de/fk2/']").parent().addClass("open"); else if (bereich2 == 'Fk. III') $("#horizMenueInnen a[href='http://www.uni-oldenburg.de/fk3/']").parent().addClass("open"); else if (bereich2 == 'Fk. IV') $("#horizMenueInnen a[href='http://www.uni-oldenburg.de/fk4/']").parent().addClass("open"); else if (bereich2 == 'Fk. V') $("#horizMenueInnen a[href='http://www.uni-oldenburg.de/fk5/']").parent().addClass("open"); }); } } // Horizontalnavigation ergaenzen /*** UNI-LOGIN ***/ if ($('#unilogin').length) { $('') .val([screen.width, screen.height].join('x')) .appendTo('#unilogin'); } $('#unilogin').click(function(e) { e.stopPropagation(); $('#unilogin').addClass('hover'); }); $('#unilogin_reset').click(function() { $('#unilogin').removeClass('hover'); }); $(document).click(function() { $('#unilogin').removeClass('hover'); }); /******************************************************************* * MouseOver-Aufklappen verborgener Menüeinträge in der Navi-Spalte ******************************************************************/ if ($(window).width() > 480) { $("#menue li.aktiv > ul > li").removeClass("unsichtbar"); var menueklapp = $("#menue").find("li.unsichtbar"); if (menueklapp != null && $(menueklapp).length) { $(".menuetitel a").css({ "backgroundPosition": "98% 50%", "backgroundImage": 'url(https://www.uni-oldenburg.de/img/css3/png/pfu.png)', "backgroundRepeat": "no-repeat" }); $("#menue li.open:has(li.unsichtbar) > a").addClass("klappzu").css({ "backgroundPosition": "98% 50%", "backgroundImage": 'url(https://www.uni-oldenburg.de/img/css3/png/pfu.png)', "backgroundRepeat": "no-repeat", "paddingRight":"20px" }); } $(".menuetitel").hoverIntent( function() { $(this).parent().find('li.unsichtbar').stop(true, true).slideDown(200); $("#menue > ul > li > ul").stop(true, true).slideUp(200); }, function() { // } ); $("#menue li a.klappzu").hoverIntent( function(event) { event.stopPropagation(); $(this).parent().children('ul').slideDown(200); $(this).parent().find('li.unsichtbar').stop(true, true).slideDown(200); $(this).parent().find('ul ul').stop(true, true).slideUp(200); }, function() { // } ); $("#menue").hoverIntent( function() { // }, function() { $("#menue ul").stop(true, true).slideDown(200); $('#menue li.unsichtbar').stop(true, true).slideUp(100); } ); } /************************************ * UNICMS-Link * **********************************/ function unicms_link() { var unicms_cookie = (jQuery.cookie('uniol_unicmslogin')); if (unicms_cookie != null) { $.ajax({ dataType: 'jsonp', jsonp: 'jsonp_callback', url: '//unicms.uni-oldenburg.de/test/user_allowed_to_edit_page.php?user=' + unicms_cookie + '&url=' + document.location, success: function(data) { if (data.id > 0) $("#inhaltinfos p").prepend(' [cms] '); ; } }); } } /** * Ruft alles auf, was Cookies benötigt */ var cookie_funktionen = function() { if (!$("body").hasClass("css_2011")) horizNavi(); //cookie_layout2012(); unicms_link(); } /******************************************* * MP3-Links -> Player nachladen * *****************************************/ // if($('a[href$=".mp3"],a[href$=".MP3"]').length > 0) { if ($('a:not(.mp3player)[href$=".mp3"],a:not(.mp3player)[href$=".MP3"]').length > 0) { if ($.jPlayer) mp3player(); else $.getScript('https://www.uni-oldenburg.de/img/script/jquery.jplayer.min.js', function() { mp3player(); }); } var mp3player = function() { // $.insert('http://jplayer.org/js/prettify/prettify-jPlayer.css'); //$.insert('http://jplayer.org/latest/skin/blue.monday/jplayer.blue.monday.css'); var mp3file = []; var mp3play = []; $('a:not(.mp3player)[href$=".mp3"],a:not(.mp3player)[href$=".MP3"]').each(function(i) { //ahref = this; $(this).addClass("mp3player"); mp3file[i] = $(this).attr('href'); mp3play[i] = $('').addClass("mp3bla").attr('id', 'mp3bla_' + i); mp3play[i].insertBefore(this); $(this).after(''); $("#mp3bla_" + i).jPlayer({ ready: function() { $("#mp3bla_" + i).jPlayer("setMedia", { mp3: mp3file[i] }); }, play: function() { // To avoid both jPlayers playing together. $(this).jPlayer("pauseOthers"); }, cssSelectorAncestor: "#jp_container_" + i, swfPath: "https://www.uni-oldenburg.de/img/script/jQuery.jPlayer.2.1.0", supplied: "mp3", wmode: "window" }); }); } /** Animiertes Scrollen zum Seitenanfang / zu Ankern innerhalb der selben Seite */ filterPath = function(string) { return string .replace(/^\//, '') .replace(/(index|default).[a-zA-Z]{3,4}$/, '') .replace(/\/$/, ''); } $('#inhalt a[href="#"]').attr("href", '#page'); $('').addClass('csc-linkToTop').attr("id","totopfix").html('').appendTo("body"); TOTOPFIX = 32; $(window).scroll(function() { return $('body').toggleClass('scrolled', $(this).scrollTop() > TOTOPFIX); }); $(function() { return $(document).scroll(); }); var locationPath = filterPath(location.pathname); $('.csc-linkToTop a[href*=#]').each(function() { var thisPath = filterPath(this.pathname) || locationPath; var marke = this.hash.replace(/#/, ''); if (locationPath == thisPath && (location.hostname == this.hostname || !this.hostname) && /* this.hash.replace(/#/,'')*/ marke) { if (!$('a[id="' + marke + '"]').length && !$('a[name="' + marke + '"]').length) { //alert(marke); $("#page").prepend(''); } var $target = $(this.hash), target = this.hash; if (target != '') { var targetOffset = $target.offset().top; $(this).click(function(event) { event.preventDefault(); $('html, body').animate({ scrollTop: 0 //targetOffset }, 1000, function() { // location.hash = target; }); }); } } }); $('ul.csc-menu-3 a').each(function() { var target = this.hash; if (target == '') { target = 'page'; } var targ = $(target).offset().top; //targ = (targ >= 32) ? (targ - 32) : 0; $(this).click(function(event) { event.preventDefault(); //location.hash = target; $('html, body').animate({ scrollTop: targ }, 400, function() { location.hash = target; }); }); }); /**********************/ /* Header-Bildwechsel, falls mehrere */ /**********************/ if (typeof UniOlHeaderSlides !== "undefined" && UniOlHeaderSlides.length > 1) { var UniOlHeaderSlidesZaehler = 1; var UniOlHeaderSlideImages = $("#keyvisual img"); var UniOlHeaderSlideImage1 = UniOlHeaderSlideImages[0]; var UniOlHeaderSlidesTempo = 1500; var UniOlHeaderSlidesExtrabild = true; $("#keyvisual").prepend(''); $("#keyvisual").prepend(''); var UniOlHeaderSlidesRun = function() { if (UniOlHeaderSlidesExtrabild) { $(document.getElementById("bg1")).css({ background: 'url(//www.uni-oldenburg.de/uploads/media/' + UniOlHeaderSlides[UniOlHeaderSlidesZaehler] + ') no-repeat' // , backgroundSize:'cover' }); $(document.getElementById("bg1")).fadeIn(UniOlHeaderSlidesTempo, function() { $(document.getElementById("bg2")).show(); }); UniOlHeaderSlidesZaehler++; if (UniOlHeaderSlidesZaehler >= UniOlHeaderSlides.length) UniOlHeaderSlidesZaehler = 0; UniOlHeaderSlidesExtrabild = !UniOlHeaderSlidesExtrabild; } else { $(document.getElementById("bg2")).css({ background: 'url(//www.uni-oldenburg.de/uploads/media/' + UniOlHeaderSlides[UniOlHeaderSlidesZaehler] + ') no-repeat' // , backgroundSize:'cover' }); UniOlHeaderSlidesZaehler++; if (UniOlHeaderSlidesZaehler >= UniOlHeaderSlides.length) UniOlHeaderSlidesZaehler = 0; $(document.getElementById("bg1")).fadeOut(UniOlHeaderSlidesTempo); UniOlHeaderSlidesExtrabild = !UniOlHeaderSlidesExtrabild; } } window.setInterval(UniOlHeaderSlidesRun, 6000); } /* Kalender: Listenansicht - bei unsichtbaren Details (css: tt_content 136072) diese per MouseOver einblenden */ $(".tx-cal-controller dd").each(function(){ if ($(this).height()=='0') { $(this).css({display:'none',height:'auto',overflow:'visible'}).prev("dt").addClass("ddmin"); } }); $(".tx-cal-controller dt.ddmin").hoverIntent( function(){ $(this).next().slideDown(200); }, function(){ $(this).next().slideUp(200); } ); });