mirror of
https://github.com/KoboldAI/KoboldAI-Client.git
synced 2025-06-05 21:59:24 +02:00
Changed deleteme to div
This commit is contained in:
@@ -470,6 +470,14 @@ def emit(*args, **kwargs):
|
||||
except AttributeError:
|
||||
return socketio.emit(*args, **kwargs)
|
||||
|
||||
#replacement for tpool.execute to maintain request contexts
|
||||
def replacement_tpool_execute(function, *args, **kwargs):
|
||||
|
||||
|
||||
def replacement_tpool_execute_2(function, queue, *args, **kwargs):
|
||||
return_data = function(*args, **kwargs)
|
||||
queue.put(return_data)
|
||||
|
||||
# marshmallow/apispec setup
|
||||
from apispec import APISpec
|
||||
from apispec.ext.marshmallow import MarshmallowPlugin
|
||||
|
@@ -116,7 +116,7 @@ function reset_story() {
|
||||
while (story_area.lastChild.id != 'story_prompt') {
|
||||
story_area.removeChild(story_area.lastChild);
|
||||
}
|
||||
dummy_span = document.createElement("span");
|
||||
dummy_span = document.createElement("div");
|
||||
dummy_span.id = "Delete Me";
|
||||
dummy_span.classList.add("noselect");
|
||||
text = "";
|
||||
@@ -2116,6 +2116,9 @@ function select_game_text(event) {
|
||||
if (document.selection) {
|
||||
if (document.selection.createRange().parentElement().id == 'story_prompt') {
|
||||
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");
|
||||
} else {
|
||||
new_selected_game_chunk = document.selection.createRange().parentElement().parentElement();
|
||||
}
|
||||
@@ -2123,6 +2126,9 @@ function select_game_text(event) {
|
||||
if(window.getSelection().anchorNode.parentNode) {
|
||||
if (window.getSelection().anchorNode.parentNode.id == 'story_prompt') {
|
||||
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");
|
||||
} else {
|
||||
new_selected_game_chunk = window.getSelection().anchorNode.parentNode.parentNode;
|
||||
}
|
||||
@@ -2137,7 +2143,7 @@ function select_game_text(event) {
|
||||
|
||||
//Check to see if new selection is a game chunk or something else
|
||||
|
||||
if (((new_selected_game_chunk.id == "story_prompt") || (new_selected_game_chunk.id.slice(0,20) == "Selected Text Chunk ")) && (document.activeElement.isContentEditable)) {
|
||||
if ((new_selected_game_chunk == null) || (((new_selected_game_chunk.id == "story_prompt") || (new_selected_game_chunk.id.slice(0,20) == "Selected Text Chunk ")) && (document.activeElement.isContentEditable))) {
|
||||
if (new_selected_game_chunk != selected_game_chunk) {
|
||||
for (item of document.getElementsByClassName("editing")) {
|
||||
item.classList.remove("editing");
|
||||
|
@@ -49,7 +49,7 @@
|
||||
<div id="disconnect_message"><center><h1>Disconnected</h1></center></div>
|
||||
<div class="gametext" id="Selected Text" contenteditable=true onblur="select_game_text(null);" onclick="select_game_text(null);" onkeyup="select_game_text(event);">
|
||||
<span id="story_prompt" class="var_sync_story_prompt var_sync_alt_story_prompt_length var_sync_alt_story_prompt_in_ai rawtext"></span>
|
||||
<span id="Delete Me" class="noselect" contenteditable=false>
|
||||
<div id="Delete Me" class="noselect" contenteditable=false>
|
||||
<span>
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@
|
||||
|
||||
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
Reference in New Issue
Block a user