Commit c67babb0 authored by Frederik Shull's avatar Frederik Shull

already opened story file gets reloaded when opened again

parent 68ec079f
......@@ -4,48 +4,49 @@ const $ = require('jquery');
const dialog = require('dialog');
const Languages = require('./js/Languages.js');
$(document).ready(function () {
// Check for API support
File.fileSupport();
// Set language
window.lang_obj = new Languages();
window.lang_obj.loadLanguages();
window.lang_obj.listLanguages();
window.lang_obj.setLanguage("English");
// Initialize editor
let editor = new Editor(ace);
//hide loading screen
$('#loader_bg').hide();
$('#loader').hide();
//$('#loader_bg').show();
//$('#loader').show();
// Events
$('#fileInput').on('change', function(e) {
if(File.openFile()) {
File.getDataFromFile();
}
});
$('#save_as').on('click', function(e) {
File.saveFile();
});
$('#generate_exe').on('click', function(e) {
if(File.getDataFromEditor()) {
generateExe();
}
});
$('#engtochi_text').on('click', function(e) {
engtochi();
});
$('#showloading').on('click', function(e) {
$('#loader_bg').show();
$('#loader').show();
});
//console.log(lang.lang_arr[0].language);
});
$(document).ready(function() {
// Check for API support
File.fileSupport();
// Set language
window.lang_obj = new Languages();
window.lang_obj.loadLanguages();
window.lang_obj.listLanguages();
window.lang_obj.setLanguage("English");
// Initialize editor
let editor = new Editor(ace);
//hide loading screen
$('#loader_bg').hide();
$('#loader').hide();
// $('#loader_bg').show();
// $('#loader').show();
// Events
$('#fileInput').change(function(e) {
if (File.openFile()) {
File.getDataFromFile();
}
$(this).val(''); // Sets the value to '' so the 'change' event is triggered even if the same file is opened again. Might be problematic if val needs to be used later again.
});
$('#save_as').click((e) => {
File.saveFile();
});
$('#generate_exe').click((e) => {
if (File.getDataFromEditor()) {
generateExe();
}
});
$('#engtochi_text').click((e) => {
engtochi();
});
$('#showloading').on('click', function(e) {
$('#loader_bg').show();
$('#loader').show();
});
//console.log(lang.lang_arr[0].language);
});
\ No newline at end of file
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