Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -168,12 +168,10 @@ <h4 class="fly-out__title">File:


<div class="btn-group">
<label class="file | btn btn--plain btn--small" for="score-file-picker">
<span>
Open a score <!--abbr title="Music Encoding Initiative">MEI</abbr> file-->
<input class="file__input" id="score-file-picker" type="file" accept=".mei,.mxl,.musicxml,.xml,.abc">
</span>
</label>
<button id="close-file" class="btn btn--plain btn--small" type="button">
<span>Close this file</span>
</button>

<button id="save-file" class="btn btn--plain btn--small" type="button"><span>Export as <abbr title="Music Encoding Initiative">MEI</abbr></span></button>

<button id="save-file-svg" class="btn btn--plain btn--small" type="button">
Expand Down
8 changes: 2 additions & 6 deletions src/js/bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,8 @@ function load_finish() {
console.log('This is not a valid XML or MEI file. However it could be ABC or Humdrum, for instance')
}
} catch {
$('#score-file-picker').val('')
console.log('This is not a valid XML or MEI file. However it could be ABC or Humdrum, for instance')
return false
}

vrvToolkit = new verovio.toolkit()
Expand All @@ -521,8 +522,6 @@ function load_finish() {
} catch {
if (!new_svg) {
console.log('Verovio could not generate SVG from non-MEI file.')
// loader_modal.close()
$('#score-file-picker').val('')
return false
}
}
Expand All @@ -533,8 +532,6 @@ function load_finish() {
mei = parser.parseFromString(data, 'text/xml')
} catch {
alert('Cannot parse this XML file as valid MEI.')
// loader_modal.close()
$('#score-file-picker').val('')
return false
}
} else {
Expand All @@ -550,7 +547,6 @@ function load_finish() {
} catch {
alert('Cannot parse this XML file as valid MEI.')
// loader_modal.close()
$('#score-file-picker').val('')
return false
}

Expand Down
2 changes: 1 addition & 1 deletion src/js/modules/Relations/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const relationTypes = {
neighbor: { key: 'n', color: 3 },
passing: { key: 'p', color: 4 },
repetition: { key: 't', color: 5 },
untyped: { color: 6 },
untyped: { key: 'y', color: 6 },
},

// The full list of pre-defined relations.
Expand Down
15 changes: 10 additions & 5 deletions src/js/modules/UI/MainMenu/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class MainMenu {
this.toggleBtn = document.getElementById('main-menu-toggle')

// File actions
this.filePicker = document.getElementById('score-file-picker')
this.closeFile = document.getElementById('close-file')
this.saveFile = document.getElementById('save-file')
this.saveAsSvg = document.getElementById('save-file-svg')
this.saveAsTxt = document.getElementById('save-graph-txt')
Expand All @@ -26,6 +26,10 @@ class MainMenu {
return this.toggle()
}

if (target == this.closeFile) {
window.location.reload()
}

if (target == this.saveFile) {
return save_mei()
}
Expand All @@ -40,10 +44,11 @@ class MainMenu {
}

onChange(e) {
if (e.composedPath().includes(this.filePicker)) {
load(e)
this.toggle(false)
}
// if (e.composedPath().includes(this.filePicker)) {
// load(e)
// this.toggle(false)
// }
return
}

toggle(state = !this.visible) {
Expand Down
Loading