Commit 06aad00d authored by David Gonçalves's avatar David Gonçalves 📖

merge

parents f9bc746e 82b9dd8f
......@@ -222,3 +222,7 @@ body::after {
#setlang:hover {
cursor:pointer;
}
#mp3file {
display:block;
}
......@@ -199,12 +199,36 @@
<span id="storyname_chi_text">Story name(Chinese): </span><input type="text" id="storynameb5" />
</div>
<div id="mp3Div">
<label for="mp3Input" id="mp3open">Open mp3 file:</label>
<br>
<input id="mp3Input" type="file">
<span class="css3-selectbox">
<select id="mp3_selector">
<option value="121">01.mp3</option>
<option value="120">02.mp3</option>
<option value="119">03.mp3</option>
<option value="118">04.mp3</option>
<option value="116">05.mp3</option>
<option value="115">06.mp3</option>
<option value="114">07.mp3</option>
<option value="113">08.mp3</option>
<option value="117">09.mp3</option>
<option value="125">10.mp3</option>
</select>
</span>
</div>
<!-- Place at bottom of page -->
<div class="loader_bg">
<div class="loader"></div>
<p id="loading_text">Generating. Please wait...</p>
</div>
<div id="mp3file">
</div>
</body>
</html>
......@@ -113,4 +113,13 @@ class File {
reader.readAsText(file);
}
static getmp3FromFile() {
let reader = new FileReader();
reader.onload = function() {
let data = reader.result;
$("#mp3file").html = data;
};
}
}
......@@ -25,6 +25,11 @@ $(document).ready(function() {
}
$(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.
});
$('#mp3Input').change(function(e) {
if (File.openFile()) {
File.getmp3FromFile();
}
});
$('#save_as').click((e) => {
File.saveFile();
});
......@@ -36,5 +41,5 @@ $(document).ready(function() {
$('#engtochi_text').click((e) => {
engtochi();
});
});
This diff is collapsed.
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