mirror of
https://github.com/KoboldAI/KoboldAI-Client.git
synced 2025-06-05 21:59:24 +02:00
Adjust default WI text box size
This commit is contained in:
@@ -148,7 +148,7 @@ function disconnect() {
|
||||
}
|
||||
|
||||
function reset_story() {
|
||||
console.log("Resetting story");
|
||||
//console.log("Resetting story");
|
||||
clearTimeout(calc_token_usage_timeout);
|
||||
clearTimeout(game_text_scroll_timeout);
|
||||
clearTimeout(font_size_cookie_timout);
|
||||
@@ -156,7 +156,7 @@ function reset_story() {
|
||||
finder_last_input = null;
|
||||
on_new_wi_item = null;
|
||||
current_chunk_number = null;
|
||||
console.log("resetting scroll_trigger_element");
|
||||
//console.log("resetting scroll_trigger_element");
|
||||
scroll_trigger_element = undefined;
|
||||
actions_data = {};
|
||||
world_info_data = {};
|
||||
@@ -530,7 +530,7 @@ function var_changed(data) {
|
||||
if ((data.classname == 'actions') && (data.name == 'Action Count')) {
|
||||
current_action = data.value;
|
||||
if (current_action <= 0) {
|
||||
console.log("setting action_count to "+current_action);
|
||||
//console.log("setting action_count to "+current_action);
|
||||
document.getElementById("story_prompt").classList.remove("hidden");
|
||||
scroll_trigger_element = undefined;
|
||||
document.getElementById("Selected Text").onscroll = undefined;
|
||||
@@ -1869,8 +1869,8 @@ function world_info_entry(data) {
|
||||
}
|
||||
|
||||
//resize comments/text boxes
|
||||
autoResize(comment, 100);
|
||||
autoResize(manual_text, 100);
|
||||
autoResize(comment, 60);
|
||||
autoResize(manual_text, 60);
|
||||
|
||||
//put focus back where it was
|
||||
if (document.getElementById(original_focus)) {
|
||||
@@ -2133,7 +2133,7 @@ function show_error_message(data) {
|
||||
$e("br", error_box_data)
|
||||
}
|
||||
} else {
|
||||
console.log(item);
|
||||
//console.log(item);
|
||||
$e("div", error_box_data, {'innerHTML': item, 'classes': ['console_text']})
|
||||
}
|
||||
}
|
||||
@@ -2406,7 +2406,7 @@ function select_game_text(event) {
|
||||
new_selected_game_chunk = document.selection.createRange().parentElement();
|
||||
} else if (document.selection.createRange().parentElement().id == 'gamescreen') {
|
||||
new_selected_game_chunk = null;
|
||||
console.log("Do nothing");
|
||||
//console.log("Do nothing");
|
||||
} else {
|
||||
new_selected_game_chunk = document.selection.createRange().parentElement().parentElement();
|
||||
}
|
||||
@@ -2416,7 +2416,7 @@ function select_game_text(event) {
|
||||
new_selected_game_chunk = window.getSelection().anchorNode.parentNode;
|
||||
} else if (window.getSelection().anchorNode.parentNode.id == "gamescreen") {
|
||||
new_selected_game_chunk = null;
|
||||
console.log("Do nothing");
|
||||
//console.log("Do nothing");
|
||||
} else {
|
||||
new_selected_game_chunk = window.getSelection().anchorNode.parentNode.parentNode;
|
||||
}
|
||||
@@ -2517,7 +2517,7 @@ function retry_from_here() {
|
||||
}
|
||||
if (chunk != null) {
|
||||
action_count = parseInt(document.getElementById("action_count").textContent);
|
||||
console.log(chunk);
|
||||
//console.log(chunk);
|
||||
for (let i = 0; i < (action_count-chunk); i++) {
|
||||
socket.emit('back', {});
|
||||
}
|
||||
@@ -2578,7 +2578,7 @@ function show_save_preset() {
|
||||
}
|
||||
|
||||
function autoResize(element, min_size=200) {
|
||||
console.log(min_size);
|
||||
//console.log(min_size);
|
||||
element.style.height = 'auto';
|
||||
if (min_size > element.scrollHeight) {
|
||||
element.style.height = min_size + "px";
|
||||
@@ -3058,7 +3058,7 @@ function add_tags(tags, data) {
|
||||
text.id = "world_info_tags_text_"+data.uid+"_blank";
|
||||
text.onblur = function () {
|
||||
if (this.textContent != "") {
|
||||
console.log(this.textContent);
|
||||
//console.log(this.textContent);
|
||||
on_new_wi_item = this.id;
|
||||
world_info_data[this.getAttribute('uid')]['key'].push(this.textContent);
|
||||
send_world_info(this.getAttribute('uid'));
|
||||
@@ -3584,7 +3584,7 @@ function detect_enter_submit(e) {
|
||||
} else {
|
||||
e.cancelBubble = true;
|
||||
}
|
||||
console.log("submitting");
|
||||
//console.log("submitting");
|
||||
document.getElementById("btnsubmit").onclick();
|
||||
setTimeout(function() {document.getElementById('input_text').value = '';}, 1);
|
||||
}
|
||||
@@ -4559,8 +4559,8 @@ process_cookies();
|
||||
// Parse themes for Finder
|
||||
for (const select of themeSelector.children) {
|
||||
let themeName = select.value;
|
||||
console.log(themeName)
|
||||
console.log("curve")
|
||||
//console.log(themeName)
|
||||
//console.log("curve")
|
||||
finder_actions.push({
|
||||
name: themeName,
|
||||
desc: "Apply this theme to change how KoboldAI looks!",
|
||||
@@ -4983,7 +4983,7 @@ let load_substitutions;
|
||||
// support is broken and overall that kinda sucks. Would be nice to
|
||||
// make a robust system for syncing multiple entries.
|
||||
|
||||
console.log("load", miniSubs)
|
||||
//console.log("load", miniSubs)
|
||||
|
||||
$(".substitution-card").remove();
|
||||
// we only get target, trueTarget, and such
|
||||
@@ -5084,8 +5084,8 @@ function infinite_scroll() {
|
||||
}
|
||||
|
||||
function run_infinite_scroll_update(action_type, actions, first_action) {
|
||||
console.log("action_type: "+action_type);
|
||||
console.log("first_action: "+first_action);
|
||||
//console.log("action_type: "+action_type);
|
||||
//console.log("first_action: "+first_action);
|
||||
if (action_type == "append") {
|
||||
if (document.getElementById('Selected Text Chunk '+actions[actions.length-1].id)) {
|
||||
document.getElementById('Selected Text Chunk '+actions[actions.length-1].id).scrollIntoView(false);
|
||||
@@ -5096,8 +5096,8 @@ function run_infinite_scroll_update(action_type, actions, first_action) {
|
||||
if (Math.min.apply(null,Object.keys(actions_data).map(Number).filter(function(x){return x>=0})) <= 0) {
|
||||
document.getElementById("story_prompt").classList.remove("hidden");
|
||||
} else {
|
||||
console.log("Appending, but adding infinite scroll");
|
||||
console.log(document.getElementById('Selected Text Chunk '+Math.min.apply(null,Object.keys(actions_data).map(Number).filter(function(x){return x>=0}))));
|
||||
//console.log("Appending, but adding infinite scroll");
|
||||
//console.log(document.getElementById('Selected Text Chunk '+Math.min.apply(null,Object.keys(actions_data).map(Number).filter(function(x){return x>=0}))));
|
||||
document.getElementById("Selected Text").onscroll = infinite_scroll;
|
||||
scroll_trigger_element = document.getElementById('Selected Text Chunk '+Math.min.apply(null,Object.keys(actions_data).map(Number).filter(function(x){return x>=0})));
|
||||
}
|
||||
@@ -5112,7 +5112,7 @@ function run_infinite_scroll_update(action_type, actions, first_action) {
|
||||
} else {
|
||||
//we just added more text and didn't hit the prompt. Move the scroll trigger back to the first non-prompt element
|
||||
for (id of Object.keys(actions_data).map(Number).filter(function(x){return x>0}).sort(function(a, b) {return a - b;})) {
|
||||
console.log("Checking for "+id);
|
||||
//console.log("Checking for "+id);
|
||||
if (document.getElementById('Selected Text Chunk '+id)) {
|
||||
scroll_trigger_element = document.getElementById('Selected Text Chunk '+id);
|
||||
break;
|
||||
|
Reference in New Issue
Block a user