-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Format strophe tool page to make it readable.
- Loading branch information
Showing
27 changed files
with
1,094 additions
and
686 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,50 @@ | ||
|
||
|
||
{% include scripts/verovio_support_functions.html %} | ||
|
||
<script> | ||
// vim: ts=3 | ||
|
||
{% if page.verovio == "true" %} | ||
|
||
// list of rendering jobs that need to be done once verovio has been loaded: | ||
var VEROVIO_QUEUE = []; | ||
|
||
var vrvToolkit; | ||
|
||
|
||
////////////////////////////// | ||
// | ||
// Module -- this variable is needed by the WASM version of verovio. | ||
// The Module.onRuntimeInitialize() function will be called when | ||
// the verovio script has been loaded and is ready to render notation. | ||
// Once ready, the onRuntimeInitialized() function will render any | ||
// requests that were made for notation before verovio was ready. | ||
// | ||
|
||
var Module = { | ||
onRuntimeInitialized: function() { | ||
vrvToolkit = new verovio.toolkit(); | ||
console.log(`Verovio (WASM) ${vrvToolkit.getVersion()} loaded`); | ||
console.log("QUEUE", VEROVIO_QUEUE); | ||
for (var z=0; z<VEROVIO_QUEUE.length; z++) { | ||
updateSvgDisplay(VEROVIO_QUEUE[z].id, VEROVIO_QUEUE[z].options); | ||
} | ||
VEROVIO_QUEUE = []; | ||
function initializeVerovioScript() { | ||
verovio.module.onRuntimeInitialized = () => { | ||
vrvToolkit = new verovio.toolkit(); | ||
// Now process any queued rendering requests | ||
// console.log("QUEUE", VEROVIO_QUEUE); | ||
for (var z=0; z<VEROVIO_QUEUE.length; z++) { | ||
// console.log("RUNNING QUEUED JOB", VEROVIO_QUEUE[z]); | ||
updateSvgDisplay(VEROVIO_QUEUE[z].id, VEROVIO_QUEUE[z].options); | ||
} | ||
}; | ||
VEROVIO_QUEUE = []; | ||
} | ||
} | ||
|
||
|
||
|
||
document.addEventListener("DOMContentLoaded", function() { | ||
{% if site.local == "true" %} | ||
var script=document.createElement('script'); | ||
script.src="/js/local/verovio-toolkit-wasm.js"; | ||
var script = document.createElement('script'); | ||
script.src="{{site.baseurl}}/js/local/verovio-toolkit-wasm.js"; | ||
script.onload = initializeVerovioScript; | ||
document.body.appendChild(script); | ||
{% else %} | ||
var script=document.createElement('script'); | ||
script.src="https://verovio-script.humdrum.org/scripts/verovio-toolkit-wasm.js"; | ||
var script = document.createElement('script'); | ||
script.src = "https://verovio-script.humdrum.org/scripts/verovio-toolkit-wasm.js"; | ||
script.onload = initializeVerovioScript; | ||
document.body.appendChild(script); | ||
{% endif %} | ||
}); | ||
|
||
</script> | ||
|
||
{% endif %} | ||
|
||
{% if page.verovio == "true" %} | ||
{% include scripts/verovio_support_functions.html %} | ||
{% endif %} | ||
|
||
|
||
|
Oops, something went wrong.