2012-04-15 10:30:34 +02:00
|
|
|
$(function () {
|
2012-04-15 12:40:35 +02:00
|
|
|
$('.button').click(function (event) {
|
2012-04-15 10:30:34 +02:00
|
|
|
button = $(this);
|
2012-04-15 12:40:35 +02:00
|
|
|
if (button.hasClass('disabled')) {
|
|
|
|
event.preventDefault();
|
|
|
|
} else {
|
|
|
|
button.addClass('disabled');
|
|
|
|
setTimeout(function () {
|
|
|
|
button.removeClass('disabled');
|
|
|
|
}, 1000);
|
|
|
|
}
|
2012-04-15 10:30:34 +02:00
|
|
|
});
|
2013-05-06 20:17:13 +02:00
|
|
|
// activate an element to show it on projector
|
2012-04-20 22:43:12 +02:00
|
|
|
$('.activate_link').click(function(event) {
|
|
|
|
event.preventDefault();
|
|
|
|
var link = $(this);
|
|
|
|
$.ajax({
|
|
|
|
type: 'GET',
|
2013-01-08 23:05:35 +01:00
|
|
|
url: link.attr('href'),
|
2012-04-20 22:43:12 +02:00
|
|
|
dataType: 'json',
|
|
|
|
data: '',
|
|
|
|
success: function(data) {
|
2013-01-08 23:05:35 +01:00
|
|
|
$('.activate_link').removeClass('btn-primary');
|
2013-01-31 10:19:56 +01:00
|
|
|
$('.activate_link i').removeClass('icon-white');
|
2013-06-03 16:01:16 +02:00
|
|
|
$('tr').removeClass('activeline');
|
|
|
|
$('div').removeClass('activeline');
|
|
|
|
$('li').removeClass('activeline');
|
2013-01-31 10:19:56 +01:00
|
|
|
// is table line
|
|
|
|
if ( link.parent().parent().parent().is("tr") ) {
|
2013-06-03 16:01:16 +02:00
|
|
|
link.parent().parent().parent().addClass('activeline');
|
|
|
|
}
|
|
|
|
// is sortable list (agenda)
|
|
|
|
if ( link.parent().parent().parent().is("div") ) {
|
2013-01-31 10:19:56 +01:00
|
|
|
link.parent().parent().parent().addClass('activeline');
|
|
|
|
}
|
|
|
|
// is widget list item
|
|
|
|
if ( link.parent().is("li") ) {
|
|
|
|
link.parent().addClass('activeline');
|
|
|
|
}
|
2013-01-08 23:05:35 +01:00
|
|
|
link.addClass('btn-primary');
|
2013-01-31 10:19:56 +01:00
|
|
|
link.children('i').addClass('icon-white');
|
2013-10-04 11:38:39 +02:00
|
|
|
// set page_num to 1 if a pdf is activated
|
|
|
|
if ( link.hasClass('choose-pdf') ) {
|
|
|
|
$('#page_num').val(1);
|
|
|
|
}
|
2012-04-20 22:43:12 +02:00
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
2013-05-06 20:17:13 +02:00
|
|
|
// change status of an object (on/off)
|
|
|
|
$('.status_link').click(function(event) {
|
|
|
|
event.preventDefault();
|
|
|
|
var link = $(this);
|
|
|
|
$.ajax({
|
|
|
|
type: 'GET',
|
|
|
|
url: $(this).attr('href'),
|
|
|
|
dataType: 'json',
|
|
|
|
success: function(data) {
|
|
|
|
if (data.active) {
|
|
|
|
newclass = 'icon-on';
|
|
|
|
link.addClass('btn-success');
|
|
|
|
} else {
|
|
|
|
newclass = 'icon-off';
|
|
|
|
link.removeClass('btn-success');
|
|
|
|
}
|
|
|
|
link.children('i').removeClass('icon-off icon-on').addClass(newclass);
|
|
|
|
link.attr('href', data.link);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
2012-04-15 10:30:34 +02:00
|
|
|
});
|
2012-04-17 13:41:43 +02:00
|
|
|
|
|
|
|
|
|
|
|
function new_message(text, type) {
|
2012-04-17 14:45:25 +02:00
|
|
|
var message = $('#dummy-notification').clone(true);
|
|
|
|
$(message).removeAttr('id').addClass(type).children('em').html(text);
|
2012-04-17 13:41:43 +02:00
|
|
|
$('#notifications').append(message);
|
2012-04-17 14:45:25 +02:00
|
|
|
message.slideDown('fast');
|
2012-04-17 13:41:43 +02:00
|
|
|
}
|
2012-09-05 00:20:28 +02:00
|
|
|
|
|
|
|
|
|
|
|
// Functios for sidebar navigation
|
|
|
|
$(document).ready(function(){
|
|
|
|
// Resize navigation
|
|
|
|
$(window).resize(function(){
|
|
|
|
if($(this).width() < 1124) {
|
|
|
|
iconmenu();
|
|
|
|
if($(window).width() < 570) {
|
|
|
|
$('.table').each(function(){
|
|
|
|
if($(this).find('.table-wrapper').size() == 0) {
|
|
|
|
$(this).wrap('<div class="table-wrapper"></div>');
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
fullmenu();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
if($(window).width() < 1124) {
|
|
|
|
iconmenu();
|
|
|
|
if($(window).width() < 570) {
|
|
|
|
$('.table').each(function(){
|
|
|
|
if($(this).find('.table-wrapper').size() == 0) {
|
|
|
|
$(this).wrap('<div class="table-wrapper"></div>');
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
fullmenu();
|
|
|
|
}
|
|
|
|
// Sticky navigation
|
|
|
|
$(window).scroll(function(){
|
|
|
|
var el = $('.leftmenu > ul');
|
|
|
|
if($(window).width() > 479) {
|
|
|
|
if ( ($(this).scrollTop() > 80) && ($(this).scrollLeft() < 10)) {
|
|
|
|
el.css({'position':'fixed','top':'10px','width':'14.15%'});
|
|
|
|
} else {
|
|
|
|
el.css({'position': 'relative', 'top': '0','width':'auto'});
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
if (($(this).scrollTop() > 130) && ($(this).scrollLeft() < 10)){
|
|
|
|
el.css({'position':'fixed','top':'10px','width':'14.15%'});
|
|
|
|
} else {
|
|
|
|
el.css({'position': 'relative', 'top': '0','width':'auto'});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
// Submenu with drop down
|
|
|
|
$('.leftmenu a').click(function(e){
|
|
|
|
if($(this).siblings('ul').size() == 1){
|
|
|
|
e.preventDefault();
|
|
|
|
var submenu = $(this).siblings('ul');
|
|
|
|
if($(this).hasClass('open')) {
|
|
|
|
if($(this).parents('.leftmenu').hasClass('lefticon')) {
|
|
|
|
submenu.fadeOut();
|
|
|
|
} else {
|
|
|
|
submenu.slideUp('fast');
|
|
|
|
}
|
|
|
|
$(this).removeClass('open');
|
|
|
|
} else {
|
|
|
|
if($(this).parents('.leftmenu').hasClass('lefticon')) {
|
|
|
|
submenu.fadeIn();
|
|
|
|
} else {
|
|
|
|
submenu.slideDown('fast');
|
|
|
|
}
|
|
|
|
$(this).addClass('open');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
// Tooltips
|
2012-09-10 23:28:19 +02:00
|
|
|
$(this).tooltip({
|
|
|
|
selector: "a[rel=tooltip]",
|
|
|
|
placement: 'bottom'
|
|
|
|
});
|
2012-09-05 00:20:28 +02:00
|
|
|
$('h1').tooltip({
|
|
|
|
selector: "a[rel=tooltip]",
|
|
|
|
placement: 'bottom'
|
|
|
|
});
|
|
|
|
$('.tooltip-left').tooltip({
|
|
|
|
placement: 'left'
|
|
|
|
});
|
|
|
|
$('.tooltip-right').tooltip({
|
|
|
|
placement: 'right'
|
|
|
|
});
|
|
|
|
$('.tooltip-top').tooltip({
|
|
|
|
placement: 'top'
|
|
|
|
});
|
|
|
|
$('.tooltip-bottom').tooltip({
|
|
|
|
placement: 'bottom'
|
|
|
|
});
|
2013-06-03 16:01:16 +02:00
|
|
|
//Popover
|
|
|
|
$(this).popover({
|
|
|
|
selector: "a[rel=popover]",
|
|
|
|
placement: 'bottom',
|
|
|
|
html: true
|
|
|
|
});
|
|
|
|
|
2012-09-05 00:20:28 +02:00
|
|
|
// Resize menu and content container
|
|
|
|
function iconmenu(){
|
|
|
|
$('.leftmenu').removeClass('span2').addClass('lefticon').addClass('span1');
|
|
|
|
$('.leftmenu > ul > li > a').each(function(){
|
|
|
|
atitle = $(this).text();
|
|
|
|
$(this).attr({'rel':'tooltip','title':atitle});
|
|
|
|
});
|
|
|
|
$('#content').removeClass('span10').addClass('span11');
|
|
|
|
}
|
|
|
|
|
|
|
|
function fullmenu(){
|
|
|
|
$('.leftmenu').removeClass('span1').removeClass('lefticon').addClass('span2');
|
|
|
|
$('.leftmenu > ul > li > a').each(function(){
|
|
|
|
$(this).attr({'rel':'','title':''});
|
|
|
|
});
|
|
|
|
$('#content').removeClass('span11').addClass('span10');
|
|
|
|
}
|
|
|
|
});
|