Commit 511b61d4 authored by Andreas Valder's avatar Andreas Valder

mod interface now working in firefox, still needs cleanup

parent 5b261a32
#!/usr/bin/env python
from server import *
if __name__ == '__main__':
......
......@@ -15,10 +15,10 @@ var moderatorinterface = {
return `
<div class="row form-group">
<span class="col-xs-12">
<textarea class="form-control" rows="3">`+this.parentElement.getElementsByClassName('modeditablevalue')[0].innerHTML+`</textarea>
<textarea class="form-control editorvalue" rows="3" data-path="`+$(this.parentElement).data('path')+`">`+this.parentElement.getElementsByClassName('modeditablevalue')[0].innerHTML+`</textarea>
</span>
<span class="col-xs-12">
<input class="btn btn-default pull-right" type="submit" data-path="`+$(this.parentElement).data('path')+`" value="save" onClick="moderatorinterface.edit()">
<input class="btn btn-default pull-right editorbtn" type="submit" data-path="`+$(this.parentElement).data('path')+`" value="save" onClick="moderatorinterface.edit(this)">
</span>
</div>
`;
......@@ -28,10 +28,9 @@ var moderatorinterface = {
}
})
},
edit: function () {
var event = window.event;
var value = $(event.srcElement)[0].parentElement.previousElementSibling.children[0].value;
var path = $($(event.srcElement)[0]).data('path');
edit: function (src) {
var path = $($(src)[0]).data('path');
var value = $(".editorvalue")[0].value;
var editable = $('.modeditable');
for (var i=0; i<editable.length; i++) {
......@@ -44,10 +43,9 @@ var moderatorinterface = {
}
moderatorinterface.set(path,value);
},
change: function() {
var event = window.event;
var value = $(event.srcElement)[0].checked;
var path = $($(event.srcElement)[0]).data('path');
change: function(src) {
var value = $(src)[0].checked;
var path = $(src).data('path');
moderatorinterface.set(path,value ? 1 : 0);
},
set: function(path,value) {
......
......@@ -167,6 +167,6 @@ $('#embedcodebtn').popover(
{% macro valuecheckbox (path,value) %}
{% if ismod() %}
<input type="checkbox" data-path="{{path|join('.')}}" {% if value %} checked {% endif %} onchange="moderatorinterface.change()"/>
<input type="checkbox" data-path="{{path|join('.')}}" {% if value %} checked {% endif %} onchange="moderatorinterface.change(this)"/>
{% endif %}
{% endmacro %}
{% extends "base.html" %}
{% set active_page = "schedule" %}
{% block content %}
<div class="panel-group" id="accordion">
<div class="panel panel-default">
......
  • Das funktioniert aber leider immer noch nicht im mobilen Firefox und in älteren Webkitbrowsern (wegen der "`").

  • Ist bekannt, aber das fix ich wenn ich daran noch mehr gemacht hab, solange ich da noch was dran frickel ist das angenehmer mit denen

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