@@ -8976,7 +8976,7 @@ Current version indicated by LITEVER below.
89768976 }
89778977 });
89788978 }
8979-
8979+
89808980 function kai_scenario_load(storyobj) //retain all current settings, but overwrite story and a few key items
89818981 {
89828982 temp_scenario = {
@@ -9009,21 +9009,21 @@ Current version indicated by LITEVER below.
90099009 temp_scenario.opmode = storyobj.savedsettings.opmode;
90109010 }
90119011 if(temp_scenario.opmode==1) //story
9012- {
9012+ {
90139013 temp_scenario.gui_type = storyobj.savedsettings.gui_type_story?storyobj.savedsettings.gui_type_story:0;
9014- }
9014+ }
90159015 else if(temp_scenario.opmode==2) //adventure
90169016 {
90179017 temp_scenario.adventure_context_mod = storyobj.savedsettings.adventure_context_mod?true:false;
90189018 temp_scenario.adventure_switch_mode = 1;
90199019 temp_scenario.gui_type = storyobj.savedsettings.gui_type_adventure?storyobj.savedsettings.gui_type_adventure:0;
90209020 }
90219021 else if(temp_scenario.opmode==3) //chat
9022- {
9023- temp_scenario.gui_type = storyobj.savedsettings.gui_type_chat?storyobj.savedsettings.gui_type_chat:0;
9022+ {
9023+ temp_scenario.gui_type = storyobj.savedsettings.gui_type_chat?storyobj.savedsettings.gui_type_chat:0;
90249024 }
90259025 else if(temp_scenario.opmode==4) //instruct
9026- {
9026+ {
90279027 temp_scenario.gui_type = storyobj.savedsettings.gui_type_instruct?storyobj.savedsettings.gui_type_instruct:0;
90289028 }
90299029
@@ -10429,7 +10429,7 @@ Current version indicated by LITEVER below.
1042910429 scenarios += `<button type="button" name="" class="scenarioitem purple btn btn-primary" onclick="hide_popups();document.getElementById('loadfileinput').click()">Load Character Card or JSON File</button>`;
1043010430 scenarios += `<button type="button" name="" class="scenarioitem purple btn btn-primary" onclick="hide_popups();display_scenariolibrary();">Load or Save Custom Scenario</button>`;
1043110431 scenarios += `<button type="button" name="" class="scenarioitem purple btn btn-primary" onclick="character_creator()">New Character Creator</button>`;
10432-
10432+
1043310433 for(let i=0;i<scenario_sources.length;++i) {
1043410434 scenarios += `<button type="button" name="" class="scenarioitem purple btn btn-primary" onclick="import_scenario(scenario_sources[${i}])">${scenario_sources[i].name}</button>`
1043510435 }
@@ -11712,9 +11712,9 @@ Current version indicated by LITEVER below.
1171211712 }
1171311713 }
1171411714 function fetch_openrouter_balance()
11715- {
11715+ {
1171611716 let desired_oai_key = document.getElementById("custom_oai_key").value.trim();
11717-
11717+
1171811718 let oaiheaders = {};
1171911719 if(desired_oai_key!="" && desired_oai_key!=dummy_api_key){
1172011720 oaiheaders["Authorization"] = "Bearer " + desired_oai_key;
@@ -12821,7 +12821,7 @@ Current version indicated by LITEVER below.
1282112821 let slotname = (testslot?`Server Slot `+(lbl)+` - `+tsdesc+``:`Server Slot `+(lbl)+` - [ Empty ]`);
1282212822 choices += `<option value=${i}${(selectedslot==i)?" selected":""}>${slotname}</option>`;
1282312823 }
12824- }
12824+ }
1282512825 else if(selectedlocation=="3") //local scenario
1282612826 {
1282712827 locationdesc.innerText = "Local Scenario Library stores your story as a Custom Scenario, without any generation settings.\nData is saved to a temporary cache and can be deleted by your browser. To avoid losing data, use the download save button.";
@@ -13090,10 +13090,10 @@ Current version indicated by LITEVER below.
1309013090 }
1309113091 else
1309213092 {
13093- import_compressed_story(loadedstorycompressed,false);
13093+ import_compressed_story(loadedstorycompressed,false);
1309413094 last_used_saveslot = slot;
1309513095 }
13096-
13096+
1309713097 if(switch_to_corpo)
1309813098 {
1309913099 localsettings.gui_type_chat = 3;
@@ -13301,7 +13301,7 @@ Current version indicated by LITEVER below.
1330113301 let selectedslot = document.getElementById("saveslotselecteddropdown").value;
1330213302 let selectedlocation = document.getElementById("saveslotlocationdropdown").value;
1330313303 let islocal = (selectedlocation=="1");
13304- let isscenario = (selectedlocation=="3");
13304+ let isscenario = (selectedlocation=="3");
1330513305 download_from_slot(selectedslot,islocal,isscenario);
1330613306 }
1330713307 function delete_from_curr_slot()
@@ -14308,7 +14308,7 @@ Current version indicated by LITEVER below.
1430814308 {
1430914309 document.body.classList.add(`theme-${i}`);
1431014310 }
14311- }
14311+ }
1431214312 }
1431314313
1431414314 function update_genimg_button_visiblility()
@@ -17612,7 +17612,7 @@ Current version indicated by LITEVER below.
1761217612 pending_context_preinjection += endmatcher;
1761317613 }
1761417614 }
17615-
17615+
1761617616 if (force_new_turn || ends_with_assistant_tag) {
1761717617 if (localsettings.inject_timestamps) {
1761817618 pending_context_preinjection += get_current_timestamp();
@@ -18112,7 +18112,7 @@ Current version indicated by LITEVER below.
1811218112 {
1811318113 seqs.push(me + "\:");
1811418114 }
18115- if(localsettings.chatopponent!="")
18115+ if(localsettings.chatopponent!="")
1811618116 {
1811718117 //NOTE: we do not add our opponents name as a stop sequence IF thinking is forced
1811818118 //the model just gets too confused and is likely to repeat the tag.
@@ -22500,14 +22500,14 @@ Current version indicated by LITEVER below.
2250022500 }
2250122501
2250222502 function classic_delete_turn(idx)
22503- {
22503+ {
2250422504 edit_chunk_save(idx,"",true);
2250522505 }
2250622506 function classic_edit_turn(idx)
2250722507 {
2250822508 let chatunits = []; //todo: eventually refactor
2250922509 let currctx = concat_gametext(false, "", "", "", false);
22510- currctx = replace_instruct_placeholders(currctx);
22510+ currctx = replace_instruct_placeholders(currctx);
2251122511 if(localsettings.opmode==3)
2251222512 {
2251322513 chatunits = repack_chat_history(currctx);
@@ -22527,28 +22527,28 @@ Current version indicated by LITEVER below.
2252722527
2252822528 let currmsg = chatunits[idx].msg;
2252922529 currmsg = stash_image_placeholders(currmsg, false);
22530-
22530+
2253122531 inputBoxOkCancel("Quickly edit a previous turn message","Quick Edit Turn",currmsg,"(Delete Turn)",()=>{
2253222532 let userinput = getInputBoxValue();
2253322533 edit_chunk_save(idx,userinput,true);
2253422534 },()=>{
2253522535 //do nothing on cancel
22536- },true,true);
22536+ },true,true);
2253722537 }
2253822538
2253922539 function classic_click_turn(button,idx,toggleopen = true)
2254022540 {
2254122541 let incomplete_resp = (synchro_pending_stream != "" || pending_response_id != "");
2254222542 if (incomplete_resp) { return; }
22543-
22543+
2254422544 function handleOutsideClickClassicTurn(event) {
2254522545 popupMenu.style.display = 'none';
2254622546 document.removeEventListener('click', handleOutsideClickClassicTurn);
2254722547 }
2254822548
2254922549 const rect = button.getBoundingClientRect();
2255022550 const popupMenu = document.getElementById('classicturnmenu');
22551-
22551+
2255222552 let popcontent = `<button type="button" onclick="classic_edit_turn(${idx})">Edit Turn</button>`;
2255322553 popcontent += `<button type="button" onclick="classic_delete_turn(${idx})">Delete Turn</button>`;
2255422554 popcontent += `<button type="button" onclick="">Cancel</button>`;
@@ -22843,7 +22843,7 @@ Current version indicated by LITEVER below.
2284322843
2284422844 let chatunits = [];
2284522845 let currctx = concat_gametext(false, "", "", "", false);
22846- currctx = replace_instruct_placeholders(currctx);
22846+ currctx = replace_instruct_placeholders(currctx);
2284722847 if(localsettings.opmode==3)
2284822848 {
2284922849 chatunits = repack_chat_history(currctx);
@@ -22960,7 +22960,7 @@ Current version indicated by LITEVER below.
2296022960 let idx = modified_turn;
2296122961 let chatunits = [];
2296222962 let currctx = concat_gametext(false, "", "", "", false);
22963- currctx = replace_instruct_placeholders(currctx);
22963+ currctx = replace_instruct_placeholders(currctx);
2296422964 if(localsettings.opmode==3)
2296522965 {
2296622966 chatunits = repack_chat_history(currctx);
@@ -22977,7 +22977,7 @@ Current version indicated by LITEVER below.
2297722977 {
2297822978 chatunits = repack_instruct_history(currctx, allow_blank);
2297922979 }
22980-
22980+
2298122981 let needsave = false;
2298222982
2298322983 let existing_msg_compare = stash_image_placeholders(chatunits[idx].msg,false);
@@ -23077,7 +23077,7 @@ Current version indicated by LITEVER below.
2307723077 let textarea = document.getElementById("corpo_edit_inp");
2307823078 let modified_message = textarea.value;
2307923079 edit_chunk_save(corpo_editing_turn, modified_message);
23080-
23080+
2308123081 }
2308223082 function corpo_edit_chunk_resend(idx)
2308323083 {
@@ -25052,7 +25052,7 @@ Current version indicated by LITEVER below.
2505225052
2505325053 //refactor - repack as turns
2505425054 let chatunits = [];
25055- input = replace_instruct_placeholders(input);
25055+ input = replace_instruct_placeholders(input);
2505625056 if(localsettings.opmode==3) //chat mode
2505725057 {
2505825058 chatunits = repack_chat_history(input);
@@ -27848,8 +27848,8 @@ Current version indicated by LITEVER below.
2784827848 <button type="button" style="font-size:12px; margin:2px; padding-left:2px; padding-right:2px; width:33%" name="localsave" class="btn btn-primary" onclick="hide_popups();save_file_button()">💾<br>Download Save</button>
2784927849 <button type="button" style="font-size:12px; margin:2px; padding-left:2px; padding-right:2px; width:33%" name="localload" class="btn btn-primary" onclick="hide_popups();load_file_button()">📁<br>Open File</button>
2785027850 <button type="button" style="font-size:12px; margin:2px; padding-left:2px; padding-right:2px; width:34%" name="shareurl" class="btn btn-primary" onclick="hide_popups();share_story_button()">🌐<br>Share</button>
27851- </div>
27852-
27851+ </div>
27852+
2785327853 <div style="margin-top:3px; text-align: center; align-self: center; width: 100%">
2785427854 <span style="font-weight:bold;text-decoration: underline;">Slot Storage Option</span>
2785527855 <span style="float:right; text-align: right;">
0 commit comments