2012-04-25 22:48:27 +02:00
|
|
|
/**
|
|
|
|
* OpenSlides projector functions
|
|
|
|
*
|
|
|
|
* :copyright: 2011, 2012 by OpenSlides team, see AUTHORS.
|
|
|
|
* :license: GNU GPL, see LICENSE for more details.
|
|
|
|
*/
|
|
|
|
|
2012-03-06 08:19:49 +01:00
|
|
|
$(function() {
|
2012-04-10 20:09:10 +02:00
|
|
|
// activate an element to show it on projector
|
2012-03-06 08:19:49 +01:00
|
|
|
$('.activate_link').click(function(event) {
|
|
|
|
event.preventDefault();
|
2012-04-18 18:07:24 +02:00
|
|
|
var link = $(this);
|
2012-03-06 08:19:49 +01:00
|
|
|
$.ajax({
|
|
|
|
type: 'GET',
|
|
|
|
url: $(this).attr('href'),
|
|
|
|
dataType: 'json',
|
|
|
|
data: '',
|
|
|
|
success: function(data) {
|
2012-04-10 20:09:10 +02:00
|
|
|
$('.activate_link').removeClass('active');
|
2012-04-10 21:11:50 +02:00
|
|
|
$('li').removeClass('activeline');
|
2012-04-23 22:07:52 +02:00
|
|
|
$('div').removeClass('activeline');
|
2012-04-10 20:09:10 +02:00
|
|
|
link.addClass('active');
|
2012-04-18 18:07:24 +02:00
|
|
|
link.parent().addClass('activeline');
|
2012-03-06 08:19:49 +01:00
|
|
|
},
|
|
|
|
error: function () {
|
|
|
|
alert("Ajax Error");
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
// control the projector
|
|
|
|
$('.projector_edit').click(function(event) {
|
|
|
|
event.preventDefault();
|
2012-04-20 22:41:57 +02:00
|
|
|
var link = $(this);
|
2012-03-06 08:19:49 +01:00
|
|
|
$.ajax({
|
|
|
|
type: 'GET',
|
|
|
|
url: link.attr('href'),
|
|
|
|
dataType: 'json',
|
|
|
|
success: function(data) {
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
// control countdown
|
|
|
|
$('.projector_countdown').click(function(event) {
|
|
|
|
event.preventDefault();
|
2012-04-20 22:41:57 +02:00
|
|
|
var link = $(this);
|
2012-03-06 08:19:49 +01:00
|
|
|
$.ajax({
|
|
|
|
type: 'GET',
|
|
|
|
url: link.attr('href'),
|
|
|
|
dataType: 'json',
|
|
|
|
success: function(data) {
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
$('.countdown_visible_link').click(function(event) {
|
|
|
|
event.preventDefault();
|
2012-04-20 22:41:57 +02:00
|
|
|
var link = $(this);
|
2012-03-06 08:19:49 +01:00
|
|
|
$.ajax({
|
|
|
|
type: 'GET',
|
|
|
|
url: link.attr('href'),
|
|
|
|
dataType: 'json',
|
|
|
|
success: function(data) {
|
|
|
|
if (data.countdown_visible == "True") {
|
|
|
|
newclass = 'open';
|
|
|
|
} else {
|
|
|
|
newclass = 'closed';
|
|
|
|
}
|
|
|
|
link.removeClass('closed open').addClass(newclass);
|
|
|
|
link.attr('href', data.link);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|