diff --git a/index.html b/index.html index 8631389..28b1612 100644 --- a/index.html +++ b/index.html @@ -3379,6 +3379,7 @@ //read the url params, and autoload a shared story if found const foundStory = urlParams.get('s'); const foundScenario = urlParams.get('scenario'); + const foundChub = urlParams.get('chub'); const nofiltermode = urlParams.get('nofilter'); if (nofiltermode) { filter_enabled = false; @@ -3405,7 +3406,11 @@ } //purge url params window.history.replaceState(null, null, window.location.pathname); - } else { + } else if (foundChub && foundChub != "") { + display_scenarios(); + get_chubai_scenario(foundChub); + } + else { if (popup_aiselect) { display_models(); } @@ -4343,11 +4348,10 @@ },false); } - function get_chubai_scenario() + function get_chubai_scenario(chubstr="") { - inputBox("Enter chub.ai prompt URL","Import from chub.ai","","https://chub.ai/characters/Anonymous/example-character", ()=>{ - - let userinput = getInputBoxValue().trim(); + const loadchub = function(userinput) + { if(userinput=="") { //pass @@ -4452,7 +4456,17 @@ document.getElementById("scenariodesc").innerText = "Error: User input is invalid\n\n Please ensure you have input a valid Chub AI URL or ID."; } } - },false); + } + + if(chubstr=="") + { + inputBox("Enter chub.ai prompt URL","Import from chub.ai","","https://chub.ai/characters/Anonymous/example-character", ()=>{ + let userinput = getInputBoxValue().trim(); + loadchub(userinput); + },false); + }else{ + loadchub(chubstr); + } }