{% extends "layout.html" %} {% from 'modalaceedit.html' import modal_ace_edit_head %} {% from 'modalaceedit.html' import modal_ace_edit_body %} {% from 'modalaceedit.html' import modal_ace_edit_button %} {% from 'modalaceedit.html' import modal_ace_edit_jsfooter %} {% set yamleditors={ "options":{ "textidstring":"yamloptions", "varstring":"optionsstring", "modalidstring":"modaloptionsid", "title":"Set Colors for textures", "editorvar":"editoroptions", "buttontext":"Open options", "buttonidstring":"yamloptionsbuttonid", "contentid":"optionstext" },"exportrul":{ "textidstring":"yamlexport", "varstring":"exportstring", "modalidstring":"modalexportid", "title":"The exported Rul-File", "editorvar":"editorexport", "buttontext":"Open Export", "buttonidstring":"yamlexportbuttonid", "contentid":"exporttext" },"importrul":{ "textidstring":"yamlimport", "varstring":"importstring", "modalidstring":"modalimportid", "title":"The imported Rul-File", "editorvar":"editorimport", "buttontext":"Open Import", "buttonidstring":"yamlimportbuttonid", "contentid":"importtext" } } %} {% block title %}World Editor{% endblock %} {% block head %} {{ modal_ace_edit_head(yamleditors) }} {% endblock %} {% block content %} {% for acekey in yamleditors %} {{ modal_ace_edit_body(yamleditors[acekey]) }} {% endfor %}

Select Edit Options

{{ modal_ace_edit_button(yamleditors["options"]) }} welcome put the rest into help text countries=> select new/country edit button, new color , [name,f1,f2,new button] missionzones=> dropdown-button [enable edit button, region, new] TODO: explain this stuff more
Enable [x]edit to change objects, [new] makes new objects sometimes you first need to select an appropiate value in dropdown field(s)
pressing [Del] in editmode deletes the selected object, color for region/country is randomly assigned but can be changed if two neighbor object have similar color
name: funding-Base: -Cap:
checks
this adds more background maps you can enable them by clicking on be aware that these maps are big and you need a fast internet connection to use these you get night lights and a bunch of planets other than earth
or {{ modal_ace_edit_button(yamleditors["importrul"]) }} {{ modal_ace_edit_button(yamleditors["exportrul"]) }}or
Start TODO: explain this stuff more
Enable [x]edit to change objects, [new] makes new objects sometimes you first need to select an appropiate value in dropdown field(s)
pressing [Del] in editmode deletes the selected object, color for region/country is randomly assigned but can be changed if two neighbor object have similar color
{% endblock %} {% block jsfooter %} $(document).ready(function() { $("#option").select2({dropdownAutoWidth: 'true',minimumResultsForSearch: -1}); }); $(document).ready(function() { $("#region-region").select2({dropdownAutoWidth: 'true',minimumResultsForSearch: -1}); }); //$(document).ready(function() { $("#region-city").select2({dropdownAutoWidth: 'true',minimumResultsForSearch: -1}); }); function togglebutton(string,s1,s2){ $("#"+string).prop('checked',! $("#"+string).prop('checked')); if ($("#"+string).prop('checked')){ $("#"+string+"button").addClass( "btn-warning" ); $("#"+string+"button").html( s1); }else{ $("#"+string+"button").removeClass( "btn-warning" ); $("#"+string+"button").html( s2); } } $(document ).on('click','#enable-texturebutton' ,function() { togglebutton("enable-texture","edit","no edit"); enable_edit_texture(); if ($("#enable-texture").prop('checked')){ $("#snapcollapse").addClass( "in" ); $("#texselcollapse").addClass( "in" ); }else{ $("#snapcollapse").removeClass( "in" ); $("#texselcollapse").removeClass( "in" ); } }); $(document ).on('click','#enable-texturesnapbutton' ,function() { togglebutton("enable-texturesnap","snap","no snap"); enable_edit_texturesnap(); }); $(document ).on('click','#enablenewtexture' ,function() { enable_new_texture(); }); $(document ).on('click','#enable-borderbutton' ,function() { togglebutton("enable-border","edit","no edit"); enable_edit_border(); }); $(document ).on('click','#enablenewborder' ,function() { enable_new_border(); }); $(document ).on('click','#enable-regionbutton' ,function() { togglebutton("enable-region","edit","no edit"); enable_edit_region(); }); $(document ).on('click','#enablenewregion' ,function() { enable_new_region(); }); $(document ).on('click','#enable-citybutton' ,function() { togglebutton("enable-city","edit","no edit"); enable_edit_city(); }); $(document ).on('click','#enablenewcity' ,function() { enable_new_city(); $("#newcityname").val( "STR_NEWCITYNAME_"+citycounter ); citycounter++; $("#cityregcollapse").addClass( "in" ); }); $(document ).on('click','#enable-countriesbutton' ,function() { togglebutton("enable-countries","edit","no edit"); enable_edit_countries(); }); $(document ).on('click','#enablenewcountries' ,function() { enable_new_countries(); $("#newcountryname").val( "STR_NEWCOUNTRYNAME_"+countrycounter ); countrycounter++; //$("#countriesregcollapse").addClass( "in" ); }); $(document ).on('click','#enable-missionzonebutton' ,function() { togglebutton("enable-missionzone","edit","no edit"); enable_edit_missionzone(); }); $(document ).on('click','#enablenewmissionzone' ,function() { enable_new_missionzones(); }); $(document ).on('click','#moremapsbutton', function() { $("#moremapsbutton").removeClass( "btn-warning" ); $("#moremapsbutton").addClass( "btn-success" ); $("#moremapsbutton").prop('disabled', true); $("#moremapsbutton").html('more maps '); addmoremaps(); }); $(function () { $(".btn").tooltip(); }); $(document ).on('click','#importbutton' ,fillmap); $(document ).on('click','#exportbutton' ,exportmap); $(document ).on('click','#downloadfile' ,function() { saveAs(new Blob([exportstring], { type: "text/plain;charset=utf-8;", }), "newworld.rul"); }); $('#uploadfile').bootstrapFileInput(); $(document ).on('change','#uploadfile' ,function(event) { var files = event.target.files; //FileList object for (var i = 0; i < files.length; i++) { var file = files[i]; var picReader = new FileReader(); picReader.addEventListener("load", function(event) { var textFile = event.target; console.log(textFile); editorimport.setValue(textFile.result); importstring=editorimport.getValue(); }); picReader.readAsText(file); } }); {{ modal_ace_edit_jsfooter(yamleditors) }} $(document).ready(doit); {% endblock %}