OpenSlides/openslides/projector/static/javascript/projector.js
Emanuel Schuetze b082f8a8fc A lot of template improvements
- Translate group name in participant overview table.
- Move 'status_link' function from participants.js to utils.js for using in VoteCollector plugin.
- Added hook 'post_js' for VoteCollector plugin.
- Fixed poll id in poll_form.
- Improved 'show log' button
- Used welcome_title for default custom slide
- Used bootstraps' fluid grid nesting for responsive layout of widgets.
- Added microphone icon for 'add-me-to-list-of-speakers' button.
- Format motion identifier and title in (motion and account) widgets.
- Format list of speakers (slide, overlay, view, overview)
- Format list of speakers widget and view. Added view to link to current list of speakers (without add to list).
- Fixed motion slide. Made up/down animation faster and the scroll way shorter.
- Fixed icon name.
- Set default context of 'extra_javascript' to use kwargs['context']['extra_javascript'].append('...') without error.
- Fixed translation of motion state.

Moved css code.
2013-05-14 23:20:54 +02:00

63 lines
2.2 KiB
JavaScript

/**
* OpenSlides projector functions
*
* :copyright: 2011, 2012 by OpenSlides team, see AUTHORS.
* :license: GNU GPL, see LICENSE for more details.
*/
content_hash = null;
function presentation_reload() {
if ($('#config > #ajax').html() == 'on') {
$.ajax({
type: 'GET',
url: '/projector/',
dataType: 'json',
success: function(data) {
$('#currentTime').removeClass('ajax_error');
var new_content_hash = data['content_hash'];
if (new_content_hash != content_hash) {
$('#content').html(data.content);
content_hash = new_content_hash;
}
$('#scrollcontent').html(data.scrollcontent);
document.title = data.title;
$('#currentTime').html(data.time);
$('#content').clearQueue();
// content font-size
$('#content').animate({'font-size': data.bigger + '%'}, 200);
$('#content #sidebar').css({'font-size': '18px'}, 0);
$('#scrollcontent').animate({'font-size': data.bigger + '%'}, 100);
// content position
$('#scrollcontent').animate({'margin-top': data.up + 'em'}, 100);
// overlays
$('#overlays div').remove();
$.each(data['overlays'], function (index, overlay){
$('#overlays').append('<div id="overlay_' + overlay['name'] + '">' + overlay['html'] + '</div>');
});
setTimeout("presentation_reload()", 1000);
},
error: function () {
$('#currentTime').addClass('ajax_error');
setTimeout("presentation_reload()", 1000);
}
});
}
}
function switchajax() {
if ($('#config > #ajax').html() == 'on') {
$('#config > #ajax').html('off');
$('#ajaxswitcher').html('<a href="#" onClick="switchajax()">Ajax Anschalten</a>');
} else {
$('#config > #ajax').html('on');
$('#ajaxswitcher').html('<a href="#" onClick="switchajax()">Ajax Ausschalten</a>');
}
}
$(document).ready(function() {
switchajax();
switchajax();
presentation_reload();
});