first upload
This commit is contained in:
parent
49508db0dd
commit
49a206e06e
445 changed files with 145982 additions and 0 deletions
228
rocky-austria/fileadmin/template-rocky/js/script.js
Normal file
228
rocky-austria/fileadmin/template-rocky/js/script.js
Normal file
|
@ -0,0 +1,228 @@
|
|||
$(document).ready(function() {
|
||||
|
||||
// Magnific Popup
|
||||
// $("a[rel=lightbox]").magnificPopup({
|
||||
// type: "image",
|
||||
// gallery: {
|
||||
// enabled: true
|
||||
// }
|
||||
// });
|
||||
|
||||
|
||||
$("#textSizer a").textresizer({
|
||||
target: "#pageWrap",
|
||||
type: "cssClass",
|
||||
sizes: ["normalText", "blackText"]
|
||||
});
|
||||
|
||||
|
||||
// automatically select previously selected header map
|
||||
var selectedHeaderMap = readCookie('header-map');
|
||||
if (selectedHeaderMap != null){
|
||||
$(".header-maps .map").hide();
|
||||
$("#"+selectedHeaderMap).show();
|
||||
}
|
||||
|
||||
$('img[usemap]').rwdImageMaps();
|
||||
|
||||
// $('body').prepend('<div id="fancy-content" style="display:none"></div>');
|
||||
// $("a[rel=lightbox]").parent().find('figcaption').hide();
|
||||
|
||||
// $("a[rel=lightbox]").click(function() {
|
||||
// var caption = $(this).parent().find('figcaption').text();
|
||||
|
||||
// $('#fancy-content').html('');
|
||||
// $('#fancy-content').text(caption);
|
||||
// });
|
||||
|
||||
$('.header-maps .switch>a').click(function (event){
|
||||
event.preventDefault();
|
||||
var target = $(event.target).data("target");
|
||||
$(".header-maps .map").hide();
|
||||
$("#"+target).show();
|
||||
createCookie('header-map', target, 7);
|
||||
})
|
||||
|
||||
$("a.dpnglossary.link").each(function (index, element){
|
||||
var options = {
|
||||
placement: "top",
|
||||
trigger: "hover",
|
||||
};
|
||||
new Tooltip(element, options);
|
||||
});
|
||||
|
||||
|
||||
$("a[rel=lightbox]").fancybox({
|
||||
prevEffect : 'none',
|
||||
nextEffect : 'none',
|
||||
closeBtn : true,
|
||||
helpers : {
|
||||
title : { type : 'inside' },
|
||||
buttons : {position: 'bottom'},
|
||||
position: 'bottom',
|
||||
},
|
||||
beforeShow : function() {
|
||||
//var caption = $('#fancy-content').text();
|
||||
var descElement = $(this.element).closest("figure").find("figcaption");
|
||||
console.log(descElement);
|
||||
var title = (this.title ? '' + this.title + '' : '')
|
||||
$desc = ((descElement.length > 0) ? descElement[0].innerText : title);
|
||||
this.title = ' <div class="counter">' + (this.index + 1) + ' / ' + this.group.length + '</div><div class="fancy-caption">' + $desc + '</div>';
|
||||
} // beforeShowlang: "en",
|
||||
});
|
||||
|
||||
// Add Wraps for Responsive Tables
|
||||
$("table").each(function() {
|
||||
$(this).wrap('<div class="table-wrap"></div>');
|
||||
});
|
||||
|
||||
calculateSubNavigationColumns();
|
||||
// adjustHeightStartContainer();
|
||||
|
||||
$('.toggle-button').click(function() {
|
||||
$(this).siblings('.toggle-content').slideToggle();
|
||||
customTimeline();
|
||||
});
|
||||
|
||||
// Mobile Navigation
|
||||
$("#mobile-nav > ul > li > a").click(function(e) {
|
||||
$(this).next().toggle();
|
||||
if($(this).hasClass("toggled")) {
|
||||
$(this).removeClass("toggled");
|
||||
} else {
|
||||
$(this).addClass("toggled");
|
||||
}
|
||||
e.preventDefault();
|
||||
});
|
||||
$("#mobile-nav > ul > li > ul > li > a").click(function(e) {
|
||||
if($(this).next().length > 0) {
|
||||
if(!($(this).hasClass("current"))) {
|
||||
$("#mobile-nav > ul > li > ul > li > ul").slideUp(300);
|
||||
$(this).next().slideToggle(300);
|
||||
$("#mobile-nav > ul > li > ul > li > a").removeClass("current");
|
||||
$(this).addClass("current");
|
||||
e.preventDefault();
|
||||
}
|
||||
}
|
||||
});
|
||||
$("#mobile-nav > ul > li > ul > li > ul > li > a").click(function(e) {
|
||||
if($(this).next().length > 0) {
|
||||
if(!($(this).hasClass("current"))) {
|
||||
$("#mobile-nav > ul > li > ul > li > ul > li > ul").slideUp(300);
|
||||
$(this).next().slideToggle(300);
|
||||
$("#mobile-nav > ul > li > ul > li > ul > li > a").removeClass("current");
|
||||
$(this).addClass("current");
|
||||
e.preventDefault();
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
// Function: Calculate Sub Navigation Columns
|
||||
function calculateSubNavigationColumns() {
|
||||
$(".footer .footer-menu .col-md-3 ul").each(function() {
|
||||
var numberOfItems = $(this).children("li").length;
|
||||
if(numberOfItems > 6) {
|
||||
$(this).addClass("two-col");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// Function: Adjust Height of StartContainer
|
||||
function adjustHeightStartContainer() {
|
||||
var leftHeight = $('#start-left').height();
|
||||
var rightHeight = $('#start-right').height();
|
||||
var Height = 0;
|
||||
|
||||
if(leftHeight > rightHeight) {
|
||||
Height = leftHeight;
|
||||
}
|
||||
else {
|
||||
Height = rightHeight;
|
||||
}
|
||||
|
||||
$('#start-left').height(Height);
|
||||
$('#start-right').height(Height);
|
||||
}
|
||||
|
||||
|
||||
$( window ).load( function() {
|
||||
customTimeline();
|
||||
})
|
||||
|
||||
function createCookie(name,value,days) {
|
||||
if (days) {
|
||||
var date = new Date();
|
||||
date.setTime(date.getTime()+(days*24*60*60*1000));
|
||||
var expires = "; expires="+date.toGMTString();
|
||||
}
|
||||
else var expires = "";
|
||||
document.cookie = name+"="+value+expires+"; path=/";
|
||||
}
|
||||
|
||||
function readCookie(name) {
|
||||
var nameEQ = name + "=";
|
||||
var ca = document.cookie.split(';');
|
||||
for(var i=0;i < ca.length;i++) {
|
||||
var c = ca[i];
|
||||
while (c.charAt(0)==' ') c = c.substring(1,c.length);
|
||||
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
function eraseCookie(name) {
|
||||
createCookie(name,"",-1);
|
||||
}
|
||||
|
||||
|
||||
|
||||
function customTimeline() {
|
||||
$( '.time-interval > div, .time-interval-major > div' ).each( function() {
|
||||
var val = $( this ).html();
|
||||
val = val.replace('B.C.', 'Mio');
|
||||
|
||||
var eras = '';
|
||||
if (val == '2500 Mio') {
|
||||
eras = 'Präkambrium und Kambrium';
|
||||
}
|
||||
else if (val == '443 Mio') {
|
||||
eras = 'Ordovizium, Silur, Devon';
|
||||
}
|
||||
else if (val == '359 Mio') {
|
||||
eras = 'Karbon';
|
||||
}
|
||||
else if (val == '299 Mio') {
|
||||
eras = 'Perm';
|
||||
}
|
||||
else if (val == '253 Mio') {
|
||||
eras = 'Trias';
|
||||
}
|
||||
else if (val == '201 Mio') {
|
||||
eras = 'Jura';
|
||||
}
|
||||
else if (val == '145 Mio') {
|
||||
eras = 'Kreide';
|
||||
}
|
||||
else if (val == '66 Mio') {
|
||||
eras = 'Paläogen';
|
||||
}
|
||||
else if (val == '23 Mio') {
|
||||
eras = 'Neogen'
|
||||
}
|
||||
else if (val == '2 Mio') {
|
||||
eras = 'Paläogen';
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (eras != '') {
|
||||
$( this ).html(val + '<div class="era">' + eras + '</div>');
|
||||
}
|
||||
else {
|
||||
$( this ).html(val);
|
||||
}
|
||||
});
|
||||
}
|
Loading…
Add table
editor.link_modal.header
Reference in a new issue