]> ToastFreeware Gitweb - philipp/winterrodeln/wradmin.git/blobdiff - wradmin/templates/json_editor.html
Prevent some updates.
[philipp/winterrodeln/wradmin.git] / wradmin / templates / json_editor.html
index fb82fb553fd07e3fa73a7710a7464c851bbb01af..54996393fa8253bb3c7477bafe14064a21a15329 100644 (file)
 {% endblock %}
 
 {% block content %}
+
+<p><strong>Achtung:</strong> Das bearbeitete JSON wird derzeit nicht gespeichert. Es muss manuell eingetragen werden.</p>
+
 <div id='editor_holder'></div>
 <button id='submit'>Submit (console.log)</button>
 
 <script>
     JSONEditor.defaults.options = {simplemde: {spellChecker: false}};
+
     JSONEditor.defaults.languages.de = {
+    }
+
+    JSONEditor.defaults.languages.de_ = {
     error_notset: 'Eigenschaft ist nicht gesetzt',
     error_notempty: 'Wert erforderlich',
     error_enum: 'Wert muss einem der vorgegebenen entsprechen',
 
     // Initialize the editor with a JSON schema
     var editor = new JSONEditor(document.getElementById('editor_holder'), {
-        // https://www.winterrodeln.org/mediawiki/index.php?title=Winterrodeln:Datenschema/Rodelbahn/V1.json&action=raw
-        schema: {"$ref": "{{schema_url}}"},
+        schema: {"$ref": {{schema_url|tojson}}},
         theme: 'bootstrap4',
         ajax: true
     });
 
     editor.on('ready',() => {
-        // https://www.winterrodeln.org/mediawiki/index.php?title=Latschenh%C3%BCtte/Rodelbahn.json&action=raw
-        fetch("{{json_url}}").then(
+        fetch({{json_url|tojson}}).then(
             function(response) {
                 return response.json();
             }).then(