Load abcjs from npm package

This also loads abcjs without script-loader.

Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
David Mehren 2021-06-06 18:16:44 +02:00
parent fddd97391b
commit fa1ed66088
No known key found for this signature in database
GPG key ID: 185982BA4C42B7C3
5 changed files with 30 additions and 22 deletions

View file

@ -142,6 +142,7 @@
"url": "https://github.com/hedgedoc/hedgedoc.git"
},
"devDependencies": {
"abcjs": "5.12.0",
"babel-cli": "6.26.0",
"babel-core": "6.26.3",
"babel-loader": "7.1.5",

View file

@ -20,6 +20,7 @@ import Plugin from 'markdown-it-regexp'
import mermaid from 'mermaid'
import handlebars from 'handlebars'
import 'gist-embed'
import abcjs from 'abcjs'
require('prismjs/themes/prism.css')
require('prismjs/components/prism-wiki')
@ -415,7 +416,7 @@ export function finishView (view) {
$value = $(value)
const $ele = $(value).parent().parent()
window.ABCJS.renderAbc(value, $value.text())
abcjs.renderAbc(value, $value.text())
$ele.addClass('abc')
$value.children().unwrap().unwrap()

File diff suppressed because one or more lines are too long

View file

@ -254,7 +254,6 @@ module.exports = {
'flowchart.js',
'js-sequence-diagrams',
'expose-loader?exposes=Viz!viz.js',
'script-loader!abcjs',
'expose-loader?exposes=io!socket.io-client',
'expose-loader?exposes=RevealMarkdown!reveal-markdown',
path.join(__dirname, 'public/js/index.js')
@ -286,7 +285,6 @@ module.exports = {
'flowchart.js',
'js-sequence-diagrams',
'expose-loader?exposes=Viz!viz.js',
'script-loader!abcjs',
'expose-loader?exposes=RevealMarkdown!reveal-markdown',
path.join(__dirname, 'public/js/pretty.js')
],
@ -321,7 +319,6 @@ module.exports = {
'flowchart.js',
'js-sequence-diagrams',
'expose-loader?exposes=Viz!viz.js',
'script-loader!abcjs',
'expose-loader?exposes=Reveal!reveal.js',
'expose-loader?exposes=RevealMarkdown!reveal-markdown',
path.join(__dirname, 'public/js/slide.js')
@ -340,7 +337,6 @@ module.exports = {
alias: {
'bootstrap-tooltip': path.join(__dirname, 'public/vendor/bootstrap/tooltip.min.js'),
'reveal-markdown': path.join(__dirname, 'public/js/reveal-markdown.js'),
abcjs: path.join(__dirname, 'public/vendor/abcjs_basic_3.1.1-min.js'),
raphael: path.join(__dirname, 'node_modules/raphael/raphael.no-deps.js')
}
},

View file

@ -580,6 +580,29 @@ abbrev@1:
resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8"
integrity sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==
abcjs@5.10.3:
version "5.10.3"
resolved "https://registry.yarnpkg.com/abcjs/-/abcjs-5.10.3.tgz#294702140ec1caa292859ba9d2af0452f7e9e046"
integrity sha512-YGmW4CUWd7T2/HqZa/SQOTE+lXg7Z68HwwpJhHJBvdHqLi1uLCiYva1ZRGhB/MPyl1QKqJMfF+LQ1jGAEK69XQ==
dependencies:
midi "https://github.com/paulrosen/MIDI.js.git#abcjs"
abcjs@5.11.0:
version "5.11.0"
resolved "https://registry.yarnpkg.com/abcjs/-/abcjs-5.11.0.tgz#397592ea6a56948aee64a8364f9a7a589e254300"
integrity sha512-kLehHwwttcTCVhKQaDkmqYbWBLAWmfyzYSbUQoEDAOTOX5RzDGakX8tXpzlsNHw6Lh8W8odZw44e0siwbG4TKA==
dependencies:
abcjs "5.10.3"
midi "https://github.com/paulrosen/MIDI.js.git#abcjs"
abcjs@5.12.0:
version "5.12.0"
resolved "https://registry.yarnpkg.com/abcjs/-/abcjs-5.12.0.tgz#06fec076d570821309b0a12598cd356cd589eb08"
integrity sha512-pvi7SjOAKT7cRyRtywUSwYB0SNtRHKLxZUZ9Oc4E+nvpBHr8Z2/M9Pfyv3oIaiEpxlWTFK+B/H5t/DckiNFgpg==
dependencies:
abcjs "5.11.0"
midi "https://github.com/paulrosen/MIDI.js.git#abcjs"
abstract-logging@^2.0.0:
version "2.0.1"
resolved "https://registry.yarnpkg.com/abstract-logging/-/abstract-logging-2.0.1.tgz#6b0c371df212db7129b57d2e7fcf282b8bf1c839"
@ -6584,6 +6607,10 @@ micromatch@^4.0.2:
braces "^3.0.1"
picomatch "^2.2.3"
"midi@https://github.com/paulrosen/MIDI.js.git#abcjs":
version "0.4.2"
resolved "https://github.com/paulrosen/MIDI.js.git#e593ffef81a0350f99448e3ab8111957145ff6b2"
miller-rabin@^4.0.0:
version "4.0.1"
resolved "https://registry.yarnpkg.com/miller-rabin/-/miller-rabin-4.0.1.tgz#f080351c865b0dc562a8462966daa53543c78a4d"