import { OutputSoundFile, TAPFile } from '../common/audio/CommodoreTape'; import { byteArrayToString, compressLZG, getBasePlatform, getFilenameForPath, getFilenamePrefix, loadScript } from '../common/util'; import { alertError, alertInfo, setWaitDialog, setWaitProgress } from './dialogs'; import { getCurrentEditorFilename, getCurrentMainFilename, getCurrentOutput, getCurrentProject, getPlatformStore, getWorkerParams, platform, platform_id, projectWindows } from './ui'; import { saveAs } from "file-saver"; declare var GIF; export function _shareEmbedLink(e) { if (getCurrentOutput() == null) { alertError("Please fix errors before sharing."); return true; } if (!(getCurrentOutput() instanceof Uint8Array)) { alertError("Can't share a Verilog executable yet. (It's not actually a ROM...)"); return true; } loadClipboardLibrary(); loadScript('lib/liblzg.js').then(() => { // TODO: Module is bad var name (conflicts with MAME) var lzgrom = compressLZG(window['Module'], Array.from(getCurrentOutput())); window['Module'] = null; // so we load it again next time var lzgb64 = btoa(byteArrayToString(lzgrom)); var embed = { p: platform_id, //n: current_project.mainPath, r: lzgb64 }; var linkqs = $.param(embed); var fulllink = get8bitworkshopLink(linkqs, 'player.html'); var iframelink = '