Textcreator LIVE V13.1 Cloud Music OS — Deel 14 van 23
Dit deel gaat direct verder onder deel 13.
Toegevoegd:
Export Engine V13.1
TXT export
PDF export verbeterd
JSON backup
Songcard export
Share functies
Plak dit onder deel 13.
<script>
/*
====================================================
TEXTCREATOR LIVE V13.1
PART 14
EXPORT ENGINE
====================================================
*/
const EXPORT_ENGINE={
version:"V13.1",
lastExport:null
};
/*
====================================================
GET CURRENT SONG DATA
====================================================
*/
function getExportSong(index,type="library"){
let song=null;
if(type==="library"){
song=
APP.generated[index];
}
if(type==="jukebox"){
song=
APP.songs[index];
}
if(!song){
return {
title:"Textcreator LIVE",
text:"Geen data"
};
}
return song;
}
/*
====================================================
CREATE TEXT EXPORT
====================================================
*/
function createTXTExport(song){
return `
🎵 TEXTCREATOR LIVE V13.1
Titel:
${
song.Titel ||
song.title ||
""
}
Maker:
${
song.Naam ||
song.name ||
song.User ||
""
}
Genre:
${
song.Genre ||
song.genre ||
""
}
Mood:
${
song.Mood ||
song.mood ||
""
}
Status:
${
song.status ||
""
}
Lyrics:
${
song.Lyrics ||
song.text ||
""
}
Suno:
${
song.Suno_URL ||
song.suno ||
""
}
🌍 @GoDoGood
`;
}
/*
====================================================
DOWNLOAD TXT
====================================================
*/
function exportTXT_V13(index,type="library"){
const song=
getExportSong(
index,
type
);
const content=
createTXTExport(song);
const blob=
new Blob(
[content],
{
type:"text/plain;charset=utf-8"
}
);
const link=
document.createElement(
"a"
);
link.href=
URL.createObjectURL(blob);
link.download=
"Textcreator-"+
Date.now()+
".txt";
link.click();
EXPORT_ENGINE.lastExport=
new Date();
}
/*
====================================================
PDF EXPORT
====================================================
*/
function exportPDF_V13(index,type="library"){
const song=
getExportSong(
index,
type
);
if(!window.jspdf){
alert(
"PDF engine niet geladen"
);
return;
}
const {jsPDF}=window.jspdf;
const pdf=
new jsPDF();
const text=
createTXTExport(song);
let y=15;
text.split(
"\n"
)
.forEach(line=>{
if(y>280){
pdf.addPage();
y=15;
}
pdf.text(
String(line).substring(
0,
95
),
10,
y
);
y+=7;
});
pdf.save(
"Textcreator-song.pdf"
);
EXPORT_ENGINE.lastExport=
new Date();
}
/*
====================================================
JSON BACKUP
====================================================
*/
function exportJSON(){
const backup={
application:
"Textcreator LIVE",
version:
"V13.1",
date:
new Date().toISOString(),
generated:
APP.generated,
jukebox:
APP.songs,
ai:
APP.ai
};
const blob=
new Blob(
[
JSON.stringify(
backup,
null,
2
)
],
{
type:
"application/json"
}
);
const link=
document.createElement(
"a"
);
link.href=
URL.createObjectURL(blob);
link.download=
"Textcreator-backup.json";
link.click();
}
/*
====================================================
SONG CARD GENERATOR
====================================================
*/
function createSongCard(index,type="library"){
const song=
getExportSong(
index,
type
);
const workspace=
document.getElementById(
"workspace"
);
if(!workspace)
return;
workspace.innerHTML=
`
<h2>
🎵 Song Card
</h2>
<div class="song-card">
<h3>
${
song.Titel ||
song.title ||
"Song"
}
</h3>
<p>
👤
${
song.Naam ||
song.name ||
song.User ||
""
}
</p>
<p>
🎼
${
song.Genre ||
song.genre ||
""
}
</p>
<p>
🌍 Suno:
${
song.Suno_URL ||
song.suno ||
""
}
</p>
</div>
`;
}
/*
====================================================
WHATSAPP SHARE V13.1
====================================================
*/
function shareWhatsApp_V13(index,type="library"){
const song=
getExportSong(
index,
type
);
const text=
`
🎵 ${
song.Titel ||
song.title ||
"Nieuwe Song"
}
👤 ${
song.Naam ||
song.name ||
song.User ||
""
}
🎧 Luisteren:
${
song.Suno_URL ||
song.suno ||
""
}
Gemaakt met:
Textcreator LIVE V13.1
🌍 @GoDoGood
`;
window.open(
"https://wa.me/?text="+
encodeURIComponent(text),
"_blank"
);
}
/*
====================================================
COPY SONG DATA
====================================================
*/
function copySongData(index,type="library"){
const song=
getExportSong(
index,
type
);
const text=
createTXTExport(song);
navigator.clipboard.writeText(
text
);
alert(
"🎵 Song gekopieerd"
);
}
/*
====================================================
EXPORT STATUS
====================================================
*/
function exportStatus(){
console.log(
"EXPORT ENGINE",
EXPORT_ENGINE
);
}
console.log(
"Export Engine V13.1 loaded"
);
</script>
Einde deel 14/23.
Volgend deel 15 van 23:
Database Layer
Sheet mapping
kolom herkenning
veilige data normalisatie
voorbereiding voor nieuwe Apps Script structuur.