scroll and scall the beamer

This commit is contained in:
Oskar Hahn 2011-09-04 00:18:11 +02:00
parent 1b81cfee27
commit c22d35cd43
6 changed files with 47 additions and 1 deletions

View File

@ -46,6 +46,8 @@
</em>
</div>
{% endif %}
<a class="beamer_edit" href="{% url beamer_bigger %}">+</a> <a class="beamer_edit" href="{% url beamer_smaller %}">-</a> <br>
<a class="beamer_edit" href="{% url beamer_up %}">+</a> <a class="beamer_edit" href="{% url beamer_down %}">-</a> <br>
<table id="menu-overview" class="agendatable">
<tr>
<th style="width: 1px;">{% trans "Beamer" %}</th>

View File

@ -56,4 +56,12 @@ urlpatterns = patterns('agenda.views',
url(r'^item/print/$', 'print_agenda',
name='print_agenda'),
url(r'^beamer/bigger$', 'beamer_edit', {'direction': 'bigger'}, name='beamer_bigger'),
url(r'^beamer/smaller$', 'beamer_edit', {'direction': 'smaller'}, name='beamer_smaller'),
url(r'^beamer/up$', 'beamer_edit', {'direction': 'up'}, name='beamer_up'),
url(r'^beamer/down$', 'beamer_edit', {'direction': 'down'}, name='beamer_down'),
)

View File

@ -78,13 +78,30 @@ def beamer(request):
content = render_block_to_string(template, 'content', data)
jsondata = {'content': content,
'title': data['title'],
'time': datetime.now().strftime('%H:%M')}
'time': datetime.now().strftime('%H:%M'),
'bigger': config_get('bigger'),
'up': config_get('up')}
return ajax_request(jsondata)
else:
return render_to_response(template,
data,
context_instance=RequestContext(request))
@permission_required('agenda.can_manage_agenda')
def beamer_edit(request, direction):
if direction == 'bigger':
config_set('bigger', int(config_get('bigger', 100)) + 10)
elif direction == 'smaller':
config_set('bigger', int(config_get('bigger', 100)) - 10)
elif direction == 'up':
config_set('up', int(config_get('up', 0)) - 10)
elif direction == 'down':
config_set('up', int(config_get('up', 0)) + 10)
if request.is_ajax():
return ajax_request({})
return redirect(reverse('item_overview'))
def assignment_votes(item):
votes = []
@ -156,6 +173,8 @@ def set_active(request, item_id, summary=False):
item.set_active(summary)
except Item.DoesNotExist:
messages.error(request, _('Item ID %d does not exist.') % int(item_id))
config_set("bigger", 100)
config_set("up", 0)
if request.is_ajax():
return ajax_request({'active': item_id})

View File

@ -104,5 +104,18 @@ $(function() {
hideClosedSlides(true);
}
// controll beamer
$('.beamer_edit').click(function(event) {
event.preventDefault();
link = $(this);
$.ajax({
type: 'GET',
url: link.attr('href'),
dataType: 'json',
success: function(data) {
}
});
});
ko.applyBindings(ViewModel);
});

View File

@ -9,6 +9,9 @@ function presentation_reload() {
$('#content').html(data.content);
document.title = data.title;
$('#currentTime').html(data.time);
$('#content').clearQueue();
$('#content').animate({'font-size': data.bigger + '%'}, 200);
$('#content').animate({'margin-top': data.up + 'em'}, 200);
setTimeout("presentation_reload()", 500);
},
error: function () {

View File

@ -67,6 +67,7 @@ body{
left:100px;
top:150px;
right:40px;
z-index: -1;
}
.title
{