1 Commits

Author SHA1 Message Date
Alcea e72f81ebfe Add files via upload
if (value.includes('soundcloud.com') || value.includes('m.soundcloud.com')) {
    const soundcloudRegex = /https?:\/\/(?:www\.|m\.)?soundcloud\.com\/[^\s'"\)]+/g;
    const soundcloudMatches = value.match(soundcloudRegex);
    if (soundcloudMatches && soundcloudMatches.length > 0) {
        const soundcloudUrl = soundcloudMatches[0];
        const debugLog = document.createElement('div');
        debugLog.style.fontSize = '12px';
        debugLog.style.color = '#666';
        debugLog.style.marginTop = '5px';
        //debugLog.textContent = `SoundCloud URL found: ${soundcloudUrl}`;
        postElement.appendChild(debugLog);
        const soundcloudEmbed = document.createElement('iframe');
        soundcloudEmbed.width = '100%';
        soundcloudEmbed.height = '266';
        soundcloudEmbed.scrolling = 'no';
        soundcloudEmbed.frameBorder = 'no';
        soundcloudEmbed.allow = 'autoplay';
        soundcloudEmbed.src = `https://alceawis.de/other/extra/scripts/fakesocialmedia/soundcloudfetch.php?scurl=${soundcloudUrl}`;
        soundcloudEmbed.style.marginTop = '10px';
        soundcloudEmbed.style.borderRadius = '8px';
        postElement.appendChild(soundcloudEmbed);
        soundcloudEmbed.onerror = function() {
            const errorMsg = document.createElement('div');
            errorMsg.style.color = 'red';
            errorMsg.style.fontSize = '12px';
            errorMsg.textContent = 'Failed to load SoundCloud embed';
            postElement.appendChild(errorMsg);
        };
    }
}
2025-09-06 12:36:47 +02:00