Commit e6e9a481 authored by Julian Rother's avatar Julian Rother
Browse files

Merge branch 'master' of git.fsmpi.rwth-aachen.de:videoagwebsite/videoagwebsite

parents f42fceb8 6db70161
......@@ -62,6 +62,12 @@ var moderator = {
},
editor: {
fromhtml: function (str) {
return str.replace('<br>', '\n')
},
tohtml: function (str) {
return str.replace('\n', '<br>')
},
init: function() {
var editable = $('.moderator_editor');
for (var i=0; i<editable.length; i++) {
......@@ -75,7 +81,7 @@ var moderator = {
content: function() {
return '<div class="row form-group">'+
'<span class="col-xs-12">'+
'<textarea class="form-control editor_value ctrl_enter_submit" rows="3" data-path="'+$(this.parentElement).data('path')+'">'+this.parentElement.getElementsByClassName('moderator_editor_value')[0].innerHTML+'</textarea>'+
'<textarea class="form-control editor_value ctrl_enter_submit" rows="3" data-path="'+$(this.parentElement).data('path')+'">'+moderator.editor.fromhtml(this.parentElement.getElementsByClassName('moderator_editor_value')[0].innerHTML)+'</textarea>'+
'</span>'+
'<span class="col-xs-12">'+
'<input class="btn btn-default pull-right" type="submit" data-path="'+$(this.parentElement).data('path')+'" data-reload="'+$(this.parentElement).data('reload')+'" value="save" onClick="moderator.editor.editbtnclick(this)">'+
......@@ -100,13 +106,14 @@ var moderator = {
var reload = $($(src)[0]).data('reload');
var value = $('.editor_value',src.parentElement.parentElement).val();
var editable = $('.moderator_editor');
for (var i=0; i<editable.length; i++) {
var e = $(editable[i]);
if (e.data('path') == path) {
$('.moderator_editor_sign',e).click();
$(".moderator_editor_value",e).html(value);
$(".moderator_editor_value",e).html(moderator.editor.tohtml(value));
}
}
moderator.api.set(path,value,reload);
......
......@@ -16,7 +16,7 @@
<a class="btn btn-default" href="{{ url_for('create', table='courses', handle=newhandle, title='Neue Veranstaltung', responsible=session.user.givenName, ref=url_for('course', handle=newhandle)) }}">Neue Veranstaltung</a>
</li>
{% endif %}
<li class="dropdown" style="padding-right: 0px">
<li class="dropdown pull-right" style="padding-right: 0px">
<button class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown">Gruppierung
<span class="caret"></span>
</button>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment