first commit

This commit is contained in:
2019-08-13 23:32:13 +02:00
commit 89ae9f3a3a
141 changed files with 168907 additions and 0 deletions

43
assets/js/bootstrap-select.js vendored Normal file
View File

@@ -0,0 +1,43 @@
/*
* bootstrap-select.js
*/
(function($) {
'use strict'; // jshint ;_;
$.fn.dropSelect = function(option) {
return this.each(function() {
var $this = $(this);
var display = $this.find('.dropdown-display'); // display span
var field = $this.find('input.dropdown-field'); // hidden input
var options = $this.find('ul.dropdown-menu > li > a');// select options
// when the hidden field is updated, update dropdown-toggle
var onFieldChange = function(event) {
var val = $(this).val();
var displayText = options.filter("[data-value='" + val + "']").html();
display.html(displayText);
};
// when an option is clicked, update the hidden field
var onOptionClick = function(event) {
// stop click from causing page refresh
event.preventDefault();
field.val($(this).attr('data-value'));
field.change();
};
field.change(onFieldChange);
options.click(onOptionClick);
});
};
// invoke on every div element with 'data-select=true'
$(function() {
$('div[data-select=true]').dropSelect();
});
})(window.jQuery);

113
assets/js/main.js Normal file
View File

@@ -0,0 +1,113 @@
(function ()
{
$('document').ready(function ()
{
// Prevent default for empty links
$('[href="#"]').click(function (e)
{
e.preventDefault()
});
// Adding data-parent to togglable nav items
$('#sidenav [data-toggle]').each(function ()
{
$(this).attr('data-parent', '#' + $(this).parent().parent().attr('id'));
});
/**
* Trigger window resize to update nvd3 charts
*/
$('[data-toggle="tab"]').on('shown.bs.tab', function (e)
{
window.dispatchEvent(new Event('resize'));
});
/**
* Enable tooltips everywhere
*/
$('[data-toggle="tooltip"]').tooltip();
/**
* Enable popovers everywhere
*/
$('[data-toggle="popover"]').popover();
// Activate animated progress bar
$('.bd-toggle-animated-progress').on('click', function ()
{
$(this).siblings('.progress').find('.progress-bar-striped').toggleClass('progress-bar-animated')
});
/**
* Enable Custom Scrollbars only for desktop
*/
var mobileDetect = new MobileDetect(window.navigator.userAgent);
if ( !mobileDetect.mobile() )
{
$('.custom-scrollbar').each(function ()
{
new PerfectScrollbar(this);
})
}
else
{
$('body').addClass('is-mobile');
}
/**
* Fix code block indentations
*/
$('code').each(function ()
{
var lines = $(this).html().split('\n');
if ( lines[0] === '' )
{
lines.shift()
}
var matches;
var indentation = (matches = /^\s+/.exec(lines[0])) !== null ? matches[0] : null;
if ( !!indentation )
{
lines = lines.map(function (line)
{
return line.replace(indentation, '');
});
$(this).html(lines.join('\n').trim());
}
});
/**
* Flip source-preview cards
*/
$('.toggle-source-preview').on('click', function ()
{
$(this).parents('.example').toggleClass('show-source');
});
});
/**
* Data tables fix header resize
*/
$(window).on('resize', function ()
{
$.fn.dataTable.tables({
visible: true,
api : true
}).columns.adjust();
});
/**
* Watching media step changes
*/
/*$(window).on('fuse::matchMediaChanged', function (ev, currentStep, isOrBelow, isOrAbove)
{
console.info('match media changed');
console.info(currentStep);
});*/
})();