login bereich

This commit is contained in:
2018-03-22 20:13:07 +01:00
parent a74f6d0ee4
commit 5e1b34bfef
65 changed files with 1540 additions and 1057 deletions

View File

@@ -1,5 +1,13 @@
window.transitionend = 'webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd transitionend';
window.on_transitionend = function($element, do_function) {
if (Modernizr.csstransitions) {
$element.on(window.transitionend, do_function);
} else {
do_function(false)
}
};
$(function() {
var $body = $('body');

View File

@@ -29,7 +29,7 @@ $(function() {
create_reveal_elements($('html'));
function remove_reveal_animation(event) {
if (event.target === this) {
if (!event || event.target === this) {
$(this).removeClass('reveal_animation');
$(this).off(window.transitionend, remove_reveal_animation);
}
@@ -43,7 +43,7 @@ $(function() {
function reveal_element(element) {
window.requestAnimationFrame(function() {
$(element).on(window.transitionend, remove_reveal_animation);
window.on_transitionend($(element), remove_reveal_animation);
$(element).removeClass('reveal');
});
}

View File

@@ -55,17 +55,13 @@ $(function() {
$body.on('submit', '.control__item form', function(event) {
event.preventDefault();
var $form = $(this);
$form.addClass('loading');
$.ajax({
type: $form.attr('method'),
url: $form.attr('action'),
data: $form.serialize(),
success: function(data) {
if ($(data).hasClass('control__item__success')) {
var $control_item = $form.parents('.control__item');
$control_item.find('.control__item__close').trigger('click');
} else {
$form.replaceWith(data);
}
$form.replaceWith(data);
}
});
});
@@ -76,7 +72,7 @@ $(function() {
window.location = '#form';
}
$task_form.formset();
// $task_form.formset();
$task_form.on('formAdded', function(event) {
var $title = $(event.target).find('h3');
var id = parseInt($title.attr('data-id').match(/\d+/)[0]);
@@ -86,4 +82,49 @@ $(function() {
$task_form.on('formDeleted', function(event) {
$(event.target).hide();
});
/* DOWNLOADS */
var download_texts = [];
$('.download__item__title').each(function() {
var text = $(this).text().toLowerCase();
text = text + ' ' + $(this).next().text().toLowerCase();
text = text + ' ' + $(this).next().next().text().toLowerCase();
download_texts.push({
$element: $(this).parents('li'),
text: text
});
});
$body.on('input', '#downloads_search', function(event) {
var query = $(this).val().toLowerCase();
var query_list = $.trim(query).split(' ');
var matches = [];
for (var i = 0; i < download_texts.length; i++) {
var download_text_item = download_texts[i];
var matched = false;
if (!matched) {
for (var ii = 0; ii < query_list.length; ii++) {
var query_item = query_list[ii];
if (download_text_item.text.indexOf(query_item) >= 0) {
matched = true;
matches.push(download_text_item.$element);
}
}
}
}
$('#downloads li').each(function() {
$(this).parents('.downloads__section').css('display', 'none');
$(this).css('display', 'none');
});
for (i = 0; i < matches.length; i++) {
matches[i].removeAttr('style');
matches[i].parents('.downloads__section').removeAttr('style');
}
});
$('#downloads_search').trigger('input');
});

View File

@@ -1,47 +0,0 @@
$(function() {
'use strict';
var $body = $('body');
var download_texts = [];
$('.downloads__item__text').each(function() {
var text = $(this).text().toLowerCase();
text = text + '' + $(this).next().text().toLowerCase();
download_texts.push({
$element: $(this).parents('.downloads__item__frame'),
text: text
});
});
$body.on('input', '#downloads_search', function(event) {
var query = $(this).val().toLowerCase();
var query_list = $.trim(query).split(' ');
var matches = [];
for (var i = 0; i < download_texts.length; i++) {
var download_text_item = download_texts[i];
var matched = false;
if (!matched) {
for (var ii = 0; ii < query_list.length; ii++) {
var query_item = query_list[ii];
if (download_text_item.text.indexOf(query_item) >= 0) {
matched = true;
matches.push(download_text_item.$element);
}
}
}
}
$('.downloads__item__frame').each(function() {
$(this).parents('.downloads__section').css('display', 'none');
$(this).css('display', 'none');
});
for (i = 0; i < matches.length; i++) {
matches[i].removeAttr('style');
matches[i].parents('.downloads__section').removeAttr('style');
}
});
$('#downloads_search').trigger('input');
});

View File

@@ -0,0 +1,53 @@
var search = window.location.search;
if (search.indexOf('?page=1') === -1 && (search.indexOf('?page=') >= 0 || search.indexOf('&page=') >= 0)) {
document.getElementsByTagName("body")[0].classList.add('hidden');
window.location = window.location.pathname;
}
$(function() {
'use strict';
var $body = $('body');
$body.on('click', '.list__button', function(event) {
event.preventDefault();
var $button = $(this);
var $load_frame = $button.parents('.load__frame');
$button.width($button.width());
window.requestAnimationFrame(function() {
$load_frame.addClass('loading');
$load_frame.height($load_frame.outerHeight());
var load_frame_id = $load_frame.attr('id');
var $load_replace = $button.parents('.load__replace');
$.get($button.attr('href'), function(data) {
var loaded_data = $(data).find('#' + load_frame_id + ' .load__main').html();
$load_frame.addClass('loaded');
window.setTimeout(function() {
$load_replace.replaceWith(loaded_data);
window.on_transitionend($load_frame, function(event) {
if (!event || event.target === this) {
$load_frame.removeAttr('style');
$load_frame.removeClass('loading loaded');
$load_frame.off(window.transitionend)
}
});
$load_frame.height($load_frame.find('.load__main').height());
window.create_reveal_elements($load_frame);
init_auto_load();
}, 200);
});
});
});
function init_auto_load() {
$('.load__replace--auto').each(function() {
var that = this;
var elementWatcher = scrollMonitor.create(that);
elementWatcher.enterViewport(function() {
$(that).find('a').trigger('click');
});
});
}
init_auto_load();
});

View File

@@ -13,7 +13,8 @@ $(function() {
var href = $(this).attr('href');
var target = $(this).attr('target');
var is_event = $(this).hasClass('event');
if (href.indexOf('/') === 0 && !target && !is_event && !event.ctrlKey && !event.metaKey && !event.altKey && !event.shiftKey && !$('html').hasClass('cms-ready')) {
var is_load = $(this).hasClass('button--load');
if (href.indexOf('/') === 0 && !is_load && !target && !is_event && !event.ctrlKey && !event.metaKey && !event.altKey && !event.shiftKey && !$('html').hasClass('cms-ready')) {
event.preventDefault();
$body.addClass('unload loading');
window.setTimeout(function() {
@@ -86,7 +87,7 @@ $(function() {
window.navigation_is_open = true;
$body.removeClass('notification_open');
$navigation.one(window.transitionend, function() {
window.on_transitionend($navigation, function() {
window.requestAnimationFrame(function() {
$navigation.css('position', 'relative');
$navigation.off(window.transitionend);