diff --git a/Browser_IDE/IDEStartupMain.js b/Browser_IDE/IDEStartupMain.js index 367f683..2432f72 100644 --- a/Browser_IDE/IDEStartupMain.js +++ b/Browser_IDE/IDEStartupMain.js @@ -98,10 +98,18 @@ async function StartIDE() { setupIDEButtonEvents(); // uses current language // Create execution environment and project storage objects - // These constructors don't _do_ anything important. executionEnviroment = new ExecutionEnvironment(document.getElementById("ExecutionEnvironment"), activeLanguageSetup); appStorage = new AppStorage(); - storedProject = new IDBStoredProject(appStorage, activeLanguageSetup.getDefaultProject()); + + // Check if projectID exists in URL, if so, load that project + let projectID = SKO.projectID; + if (projectID) { + storedProject = new IDBStoredProject(appStorage, projectID); // Use project ID if available + } + else { + storedProject = new IDBStoredProject(appStorage, activeLanguageSetup.getDefaultProject()); // Default project + } + unifiedFS = new UnifiedFS(storedProject, executionEnviroment); // Setup callbacks/listeners diff --git a/Browser_IDE/splashKitOnlineEnvParams.js b/Browser_IDE/splashKitOnlineEnvParams.js index 42e00db..f84ddaf 100644 --- a/Browser_IDE/splashKitOnlineEnvParams.js +++ b/Browser_IDE/splashKitOnlineEnvParams.js @@ -28,5 +28,6 @@ let SKO = (function(){ useCompressedBinaries: getEnvParam("useCompressedBinaries", "on", true) == "on", useMinifiedInterface: getEnvParam("useMinifiedInterface") == "on", isPRPreview: getEnvParam("isPRPreview", isPreview ? "on" : "off") == "on", + projectID: getEnvParam("projectID", null, true) // add projectID }; })(); \ No newline at end of file