diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 6bc579ef..1c61b4c3 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -14,6 +14,7 @@ "@vuepic/vue-datepicker": "^8.1.1", "@vueuse/core": "^10.2.1", "@vueuse/math": "^10.2.1", + "@zip.js/zip.js": "^2.7.45", "chart.js": "^4.0.1", "date-fns": "^3.2.0", "firebase": "^10.0.0", @@ -1884,6 +1885,16 @@ } } }, + "node_modules/@zip.js/zip.js": { + "version": "2.7.45", + "resolved": "https://registry.npmjs.org/@zip.js/zip.js/-/zip.js-2.7.45.tgz", + "integrity": "sha512-Mm2EXF33DJQ/3GWWEWeP1UCqzpQ5+fiMvT3QWspsXY05DyqqxWu7a9awSzU4/spHMHVFrTjani1PR0vprgZpow==", + "engines": { + "bun": ">=0.7.0", + "deno": ">=1.0.0", + "node": ">=16.5.0" + } + }, "node_modules/ansi-regex": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", diff --git a/frontend/package.json b/frontend/package.json index 7a2122b4..76c640a1 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -35,6 +35,7 @@ "@vuepic/vue-datepicker": "^8.1.1", "@vueuse/core": "^10.2.1", "@vueuse/math": "^10.2.1", + "@zip.js/zip.js": "^2.7.45", "chart.js": "^4.0.1", "date-fns": "^3.2.0", "firebase": "^10.0.0", diff --git a/frontend/src/locales/de.json b/frontend/src/locales/de.json index b7845012..ec942ec7 100644 --- a/frontend/src/locales/de.json +++ b/frontend/src/locales/de.json @@ -38,6 +38,7 @@ "filetypeSng": "SongBeamer-Datei [.sng]", "filetypeTxt": "Text-Datei [.txt]", "filetypeXml": "OpenLyrics-Datei [.xml]", + "filetypeOsz": "OpenLP Service [.osz]", "formatMarkdown": "Als Markdown formatiert", "formatPlain": "Reines Textformat", "formatSlack": "Für Slack formatiert", diff --git a/frontend/src/utils.js b/frontend/src/utils.js index 8267249e..82d89a02 100644 --- a/frontend/src/utils.js +++ b/frontend/src/utils.js @@ -187,9 +187,9 @@ const parsedContent = (content, tuning, showChords, twoColumns) => { }; // file download -const download = (data, filename) => { +const download = (data, filename, isBlob = false) => { var a = document.createElement('a'); - var file = new Blob([data], { type:'text/plain;charset=UTF-8' }); + var file = isBlob ? data : new Blob([data], { type:'text/plain;charset=UTF-8' }); // IE10+ if (window.navigator.msSaveOrOpenBlob) { window.navigator.msSaveOrOpenBlob(file, filename); @@ -330,6 +330,39 @@ const browserPrefersDark = () => { // trigger mailto const mailto = (address) => window.location.href = 'mailto:' + address; +// build OpenLyrics XML for given song +const openLyricsXML = (song, version, locales = [], allTags = null) => { + const timestamp = (new Date()).toISOString().slice(0, -5); + const title = `