- renamed default expression folder
- split localStorage functions into separate js
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 19 KiB |
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 19 KiB |
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 21 KiB |
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 19 KiB |
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 9.6 KiB After Width: | Height: | Size: 9.6 KiB |
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
@ -2,23 +2,25 @@ import { encode } from "../scripts/gpt-2-3-tokenizer/mod.js";
|
||||
|
||||
import {
|
||||
Generate,
|
||||
getSettings,
|
||||
/* getSettings,
|
||||
saveSettings,
|
||||
printMessages,
|
||||
clearChat,
|
||||
getChat,
|
||||
chat
|
||||
settings, */
|
||||
this_chid,
|
||||
settings,
|
||||
characters,
|
||||
online_status,
|
||||
main_api,
|
||||
api_server,
|
||||
api_key_novel,
|
||||
getCharacters,
|
||||
is_send_press,
|
||||
chat
|
||||
|
||||
} from "../script.js";
|
||||
|
||||
import { LoadLocal, SaveLocal, ClearLocal, CheckLocal, LoadLocalBool } from "./f-localStorage.js";
|
||||
|
||||
var NavToggle = document.getElementById("nav-toggle");
|
||||
var PanelPin = document.getElementById("rm_button_panel_pin");
|
||||
var SelectedCharacterTab = document.getElementById("rm_button_selected_ch");
|
||||
@ -39,30 +41,6 @@ var count_tokens;
|
||||
var perm_tokens;
|
||||
var ALC_Done;
|
||||
|
||||
////////////////// LOCAL STORAGE HANDLING /////////////////////
|
||||
|
||||
function SaveLocal(target, val) {
|
||||
localStorage.setItem(target, val);
|
||||
console.log('SaveLocal -- '+target+' : '+val);
|
||||
}
|
||||
function LoadLocal(target) {
|
||||
return localStorage.getItem(target);
|
||||
}
|
||||
function LoadLocalBool(target){
|
||||
let result = localStorage.getItem(target) === 'true';
|
||||
return result;
|
||||
}
|
||||
function CheckLocal() {
|
||||
console.log("----------local storage---------");
|
||||
var i;
|
||||
for (i = 0; i < localStorage.length; i++) {
|
||||
console.log(localStorage.key(i) +" : " +localStorage.getItem(localStorage.key(i)));
|
||||
}
|
||||
console.log("------------------------------");
|
||||
}
|
||||
function ClearLocal() {localStorage.clear();console.log('Removed All Local Storage');}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//RossAscends: Added function to format dates used in files and chat timestamps to a humanized format.
|
||||
//Mostly I wanted this to be for file names, but couldn't figure out exactly where the filename save code was as everything seemed to be connected.
|
||||
//Does not break old characters/chats, as the code just uses whatever timestamp exists in the chat.
|
||||
|
25
public/scripts/f-localStorage.js
Normal file
@ -0,0 +1,25 @@
|
||||
////////////////// LOCAL STORAGE HANDLING /////////////////////
|
||||
|
||||
export function SaveLocal(target, val) {
|
||||
localStorage.setItem(target, val);
|
||||
console.log('SaveLocal -- '+target+' : '+val);
|
||||
}
|
||||
export function LoadLocal(target) {
|
||||
return localStorage.getItem(target);
|
||||
}
|
||||
export function LoadLocalBool(target){
|
||||
let result = localStorage.getItem(target) === 'true';
|
||||
return result;
|
||||
}
|
||||
export function CheckLocal() {
|
||||
console.log("----------local storage---------");
|
||||
var i;
|
||||
for (i = 0; i < localStorage.length; i++) {
|
||||
console.log(localStorage.key(i) +" : " +localStorage.getItem(localStorage.key(i)));
|
||||
}
|
||||
console.log("------------------------------");
|
||||
}
|
||||
|
||||
export function ClearLocal() {localStorage.clear();console.log('Removed All Local Storage');}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////
|