Skip to content

Commit

Permalink
allow directly loading chub scenarios
Browse files Browse the repository at this point in the history
  • Loading branch information
Concedo authored and Concedo committed Oct 7, 2023
1 parent 1120dab commit f8105f6
Showing 1 changed file with 20 additions and 6 deletions.
26 changes: 20 additions & 6 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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();
}
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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);
}
}


Expand Down

0 comments on commit f8105f6

Please sign in to comment.