Reduce console logs clutter

This commit is contained in:
SillyLossy
2023-06-01 01:02:51 +03:00
parent e6f54363cc
commit 13d012a3a2
6 changed files with 62 additions and 62 deletions

View File

@ -226,7 +226,7 @@ let converter;
reloadMarkdownProcessor(); reloadMarkdownProcessor();
// array for prompt token calculations // array for prompt token calculations
console.log('initializing Prompt Itemization Array on Startup'); console.debug('initializing Prompt Itemization Array on Startup');
let itemizedPrompts = []; let itemizedPrompts = [];
/* let bg_menu_toggle = false; */ /* let bg_menu_toggle = false; */
@ -448,7 +448,7 @@ async function getClientVersion() {
$('#version_display').text(displayVersion); $('#version_display').text(displayVersion);
$('#version_display_welcome').text(displayVersion); $('#version_display_welcome').text(displayVersion);
} catch (err) { } catch (err) {
console.log("Couldn't get client version", err); console.error("Couldn't get client version", err);
} }
} }
@ -1931,7 +1931,7 @@ async function Generate(type, { automatic_trigger, force_name2, resolve, reject,
for (let i = coreChat.length - 1, j = 0; i >= 0; i--, j++) { for (let i = coreChat.length - 1, j = 0; i >= 0; i--, j++) {
// For OpenAI it's only used in WI // For OpenAI it's only used in WI
if (main_api == 'openai' && !world_info) { if (main_api == 'openai' && !world_info) {
console.log('No WI, skipping chat2 for OAI'); console.debug('No WI, skipping chat2 for OAI');
break; break;
} }
@ -2031,7 +2031,7 @@ async function Generate(type, { automatic_trigger, force_name2, resolve, reject,
} }
let mesSend = []; let mesSend = [];
console.log('calling runGenerate'); console.debug('calling runGenerate');
streamingProcessor = isStreamingEnabled() ? new StreamingProcessor(type, force_name2) : false; streamingProcessor = isStreamingEnabled() ? new StreamingProcessor(type, force_name2) : false;
await runGenerate(); await runGenerate();
@ -2044,7 +2044,7 @@ async function Generate(type, { automatic_trigger, force_name2, resolve, reject,
generateOpenAIPromptCache(); generateOpenAIPromptCache();
} }
console.log('generating prompt'); console.debug('generating prompt');
chatString = ""; chatString = "";
arrMes = arrMes.reverse(); arrMes = arrMes.reverse();
arrMes.forEach(function (item, i, arr) {//For added anchors and others arrMes.forEach(function (item, i, arr) {//For added anchors and others
@ -2099,7 +2099,7 @@ async function Generate(type, { automatic_trigger, force_name2, resolve, reject,
return; return;
} }
console.log('--setting Prompt string'); console.debug('--setting Prompt string');
mesExmString = pinExmString ?? mesExamplesArray.slice(0, count_exm_add).join(''); mesExmString = pinExmString ?? mesExamplesArray.slice(0, count_exm_add).join('');
mesSendString = ''; mesSendString = '';
for (let j = 0; j < mesSend.length; j++) { for (let j = 0; j < mesSend.length; j++) {
@ -2147,7 +2147,7 @@ async function Generate(type, { automatic_trigger, force_name2, resolve, reject,
} }
function checkPromtSize() { function checkPromtSize() {
console.log('---checking Prompt size'); console.debug('---checking Prompt size');
setPromtString(); setPromtString();
const prompt = [ const prompt = [
worldInfoString, worldInfoString,
@ -2169,16 +2169,16 @@ async function Generate(type, { automatic_trigger, force_name2, resolve, reject,
checkPromtSize(); // and check size again.. checkPromtSize(); // and check size again..
} else { } else {
//end //end
console.log(`---mesSend.length = ${mesSend.length}`); console.debug(`---mesSend.length = ${mesSend.length}`);
} }
} }
} }
if (generatedPromtCache.length > 0 && main_api !== 'openai') { if (generatedPromtCache.length > 0 && main_api !== 'openai') {
console.log('---Generated Prompt Cache length: ' + generatedPromtCache.length); console.debug('---Generated Prompt Cache length: ' + generatedPromtCache.length);
checkPromtSize(); checkPromtSize();
} else { } else {
console.log('---calling setPromtString ' + generatedPromtCache.length) console.debug('---calling setPromtString ' + generatedPromtCache.length)
setPromtString(); setPromtString();
} }
@ -2263,7 +2263,7 @@ async function Generate(type, { automatic_trigger, force_name2, resolve, reject,
} }
let generate_url = getGenerateUrl(); let generate_url = getGenerateUrl();
console.log('rungenerate calling API'); console.debug('rungenerate calling API');
showStopButton(); showStopButton();
@ -2374,11 +2374,11 @@ async function Generate(type, { automatic_trigger, force_name2, resolve, reject,
if (!isImpersonate) { if (!isImpersonate) {
if (tokens_already_generated == 0) { if (tokens_already_generated == 0) {
console.log("New message"); console.debug("New message");
({ type, getMessage } = saveReply(type, getMessage, this_mes_is_name, title)); ({ type, getMessage } = saveReply(type, getMessage, this_mes_is_name, title));
} }
else { else {
console.log("Should append message"); console.debug("Should append message");
({ type, getMessage } = saveReply('append', getMessage, this_mes_is_name, title)); ({ type, getMessage } = saveReply('append', getMessage, this_mes_is_name, title));
} }
} else { } else {
@ -2395,7 +2395,7 @@ async function Generate(type, { automatic_trigger, force_name2, resolve, reject,
// if any tokens left to generate // if any tokens left to generate
if (getMultigenAmount() > 0) { if (getMultigenAmount() > 0) {
runGenerate(getMessage); runGenerate(getMessage);
console.log('returning to make generate again'); console.debug('returning to make generate again');
return; return;
} }
} }
@ -2450,9 +2450,9 @@ async function Generate(type, { automatic_trigger, force_name2, resolve, reject,
} }
if (power_user.auto_swipe) { if (power_user.auto_swipe) {
console.log('checking for autoswipeblacklist on non-streaming message'); console.debug('checking for autoswipeblacklist on non-streaming message');
function containsBlacklistedWords(getMessage, blacklist, threshold) { function containsBlacklistedWords(getMessage, blacklist, threshold) {
console.log('checking blacklisted words'); console.debug('checking blacklisted words');
const regex = new RegExp(`\\b(${blacklist.join('|')})\\b`, 'gi'); const regex = new RegExp(`\\b(${blacklist.join('|')})\\b`, 'gi');
const matches = getMessage.match(regex) || []; const matches = getMessage.match(regex) || [];
return matches.length >= threshold; return matches.length >= threshold;
@ -2461,7 +2461,7 @@ async function Generate(type, { automatic_trigger, force_name2, resolve, reject,
const generatedTextFiltered = (getMessage) => { const generatedTextFiltered = (getMessage) => {
if (power_user.auto_swipe_blacklist_threshold) { if (power_user.auto_swipe_blacklist_threshold) {
if (containsBlacklistedWords(getMessage, power_user.auto_swipe_blacklist, power_user.auto_swipe_blacklist_threshold)) { if (containsBlacklistedWords(getMessage, power_user.auto_swipe_blacklist, power_user.auto_swipe_blacklist_threshold)) {
console.log("Generated text has blacklisted words") console.debug("Generated text has blacklisted words")
return true return true
} }
} }
@ -2469,7 +2469,7 @@ async function Generate(type, { automatic_trigger, force_name2, resolve, reject,
return false return false
} }
if (generatedTextFiltered(getMessage)) { if (generatedTextFiltered(getMessage)) {
console.log('swiping right automatically'); console.debug('swiping right automatically');
swipe_right(); swipe_right();
return return
} }
@ -2480,7 +2480,7 @@ async function Generate(type, { automatic_trigger, force_name2, resolve, reject,
//console.log('runGenerate calling showSwipeBtns'); //console.log('runGenerate calling showSwipeBtns');
showSwipeButtons(); showSwipeButtons();
} }
console.log('/savechat called by /Generate'); console.debug('/savechat called by /Generate');
saveChatConditional(); saveChatConditional();
activateSendButtons(); activateSendButtons();
@ -2563,14 +2563,14 @@ export async function sendMessageAsUser(textareaText, messageBias) {
chat[chat.length - 1]['extra'] = {}; chat[chat.length - 1]['extra'] = {};
if (messageBias) { if (messageBias) {
console.log('checking bias'); console.debug('checking bias');
chat[chat.length - 1]['extra']['bias'] = messageBias; chat[chat.length - 1]['extra']['bias'] = messageBias;
} }
addOneMessage(chat[chat.length - 1]); addOneMessage(chat[chat.length - 1]);
// Wait for all handlers to finish before continuing with the prompt // Wait for all handlers to finish before continuing with the prompt
await eventSource.emit(event_types.MESSAGE_SENT, (chat.length - 1)); await eventSource.emit(event_types.MESSAGE_SENT, (chat.length - 1));
console.log('message sent as user'); console.debug('message sent as user');
} }
function getMaxContextSize() { function getMaxContextSize() {
@ -2690,7 +2690,7 @@ function getMultigenAmount() {
function promptItemize(itemizedPrompts, requestedMesId) { function promptItemize(itemizedPrompts, requestedMesId) {
var incomingMesId = Number(requestedMesId); var incomingMesId = Number(requestedMesId);
console.log(`looking for MesId ${incomingMesId}`); console.debug(`looking for MesId ${incomingMesId}`);
var thisPromptSet = undefined; var thisPromptSet = undefined;
for (var i = 0; i < itemizedPrompts.length; i++) { for (var i = 0; i < itemizedPrompts.length; i++) {
@ -3217,14 +3217,14 @@ function saveReply(type, getMessage, this_mes_is_name, title) {
chat[chat.length - 1]['mes'] = getMessage; chat[chat.length - 1]['mes'] = getMessage;
} }
} else if (type === 'append') { } else if (type === 'append') {
console.log("Trying to append.") console.debug("Trying to append.")
chat[chat.length - 1]['title'] = title; chat[chat.length - 1]['title'] = title;
chat[chat.length - 1]['mes'] += getMessage; chat[chat.length - 1]['mes'] += getMessage;
chat[chat.length - 1]['gen_started'] = generation_started; chat[chat.length - 1]['gen_started'] = generation_started;
chat[chat.length - 1]['gen_finished'] = generationFinished; chat[chat.length - 1]['gen_finished'] = generationFinished;
addOneMessage(chat[chat.length - 1], { type: 'swipe' }); addOneMessage(chat[chat.length - 1], { type: 'swipe' });
} else if (type === 'appendFinal') { } else if (type === 'appendFinal') {
console.log("Trying to appendFinal.") console.debug("Trying to appendFinal.")
chat[chat.length - 1]['title'] = title; chat[chat.length - 1]['title'] = title;
chat[chat.length - 1]['mes'] = getMessage; chat[chat.length - 1]['mes'] = getMessage;
chat[chat.length - 1]['gen_started'] = generation_started; chat[chat.length - 1]['gen_started'] = generation_started;
@ -3232,7 +3232,7 @@ function saveReply(type, getMessage, this_mes_is_name, title) {
addOneMessage(chat[chat.length - 1], { type: 'swipe' }); addOneMessage(chat[chat.length - 1], { type: 'swipe' });
} else { } else {
console.log('entering chat update routine for non-swipe post'); console.debug('entering chat update routine for non-swipe post');
chat[chat.length] = {}; chat[chat.length] = {};
chat[chat.length - 1]['extra'] = {}; chat[chat.length - 1]['extra'] = {};
chat[chat.length - 1]['name'] = name2; chat[chat.length - 1]['name'] = name2;
@ -3246,7 +3246,7 @@ function saveReply(type, getMessage, this_mes_is_name, title) {
chat[chat.length - 1]['gen_finished'] = generationFinished; chat[chat.length - 1]['gen_finished'] = generationFinished;
if (selected_group) { if (selected_group) {
console.log('entering chat update for groups'); console.debug('entering chat update for groups');
let avatarImg = 'img/ai4.png'; let avatarImg = 'img/ai4.png';
if (characters[this_chid].avatar != 'none') { if (characters[this_chid].avatar != 'none') {
avatarImg = getThumbnailUrl('avatar', characters[this_chid].avatar); avatarImg = getThumbnailUrl('avatar', characters[this_chid].avatar);
@ -3698,9 +3698,9 @@ function changeMainAPI() {
} }
// Hide common settings for OpenAI // Hide common settings for OpenAI
console.log('value?', selectedVal); console.debug('value?', selectedVal);
if (selectedVal == "openai") { if (selectedVal == "openai") {
console.log('hiding settings?'); console.debug('hiding settings?');
$("#common-gen-settings-block").css("display", "none"); $("#common-gen-settings-block").css("display", "none");
} else { } else {
$("#common-gen-settings-block").css("display", "block"); $("#common-gen-settings-block").css("display", "block");
@ -4993,7 +4993,7 @@ const swipe_right = () => {
complete: function () { complete: function () {
eventSource.emit(event_types.MESSAGE_SWIPED, (chat.length - 1)); eventSource.emit(event_types.MESSAGE_SWIPED, (chat.length - 1));
if (run_generate && !is_send_press && parseInt(chat[chat.length - 1]['swipe_id']) === chat[chat.length - 1]['swipes'].length) { if (run_generate && !is_send_press && parseInt(chat[chat.length - 1]['swipe_id']) === chat[chat.length - 1]['swipes'].length) {
console.log('caught here 2'); console.debug('caught here 2');
is_send_press = true; is_send_press = true;
$('.mes_buttons:last').hide(); $('.mes_buttons:last').hide();
Generate('swipe'); Generate('swipe');
@ -6086,7 +6086,7 @@ $(document).ready(function () {
$(this).prop("checked", false); $(this).prop("checked", false);
}); });
this_del_mes = 0; this_del_mes = 0;
console.log('canceled del msgs, calling showswipesbtns'); console.debug('canceled del msgs, calling showswipesbtns');
showSwipeButtons(); showSwipeButtons();
is_delete_mode = false; is_delete_mode = false;
}); });
@ -6116,7 +6116,7 @@ $(document).ready(function () {
this_del_mes = 0; this_del_mes = 0;
$('#chat .mes').last().addClass('last_mes'); $('#chat .mes').last().addClass('last_mes');
$('#chat .mes').eq(-2).removeClass('last_mes'); $('#chat .mes').eq(-2).removeClass('last_mes');
console.log('confirmed del msgs, calling showswipesbtns'); console.debug('confirmed del msgs, calling showswipesbtns');
showSwipeButtons(); showSwipeButtons();
is_delete_mode = false; is_delete_mode = false;
}); });
@ -6881,7 +6881,7 @@ $(document).ready(function () {
return; return;
} }
console.log('Label value OK, setting to the master input control', myText); console.debug('Label value OK, setting to the master input control', myText);
$(masterElement).val(myValue).trigger('input'); $(masterElement).val(myValue).trigger('input');
restoreCaretPosition($(this).get(0), caretPosition); restoreCaretPosition($(this).get(0), caretPosition);
}); });

View File

@ -79,7 +79,7 @@ observer.observe(document.documentElement, observerConfig);
/** /**
* Wait for an element before resolving a promise * Wait for an element before resolving a promise
* @param {String} querySelector - Selector of element to wait for * @param {String} querySelector - Selector of element to wait for
* @param {Integer} timeout - Milliseconds to wait before timing out, or 0 for no timeout * @param {Integer} timeout - Milliseconds to wait before timing out, or 0 for no timeout
*/ */
function waitForElement(querySelector, timeout) { function waitForElement(querySelector, timeout) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
@ -259,7 +259,7 @@ export function RA_CountCharTokens() {
(power_user.pin_examples ? characters[this_chid].mes_example : ''), (power_user.pin_examples ? characters[this_chid].mes_example : ''),
].join('\n').replace(/\r/gm, '').trim(); ].join('\n').replace(/\r/gm, '').trim();
perm_tokens = getTokenCount(perm_string); perm_tokens = getTokenCount(perm_string);
} else { console.log("RA_TC -- no valid char found, closing."); } // if neither, probably safety char or some error in loading } else { console.debug("RA_TC -- no valid char found, closing."); } // if neither, probably safety char or some error in loading
} }
// display the counted tokens // display the counted tokens
if (count_tokens < 1024 && perm_tokens < 1024) { if (count_tokens < 1024 && perm_tokens < 1024) {
@ -283,7 +283,7 @@ async function RA_autoloadchat() {
$(groupToAutoLoad).click(); $(groupToAutoLoad).click();
} }
// if the charcter list hadn't been loaded yet, try again. // if the charcter list hadn't been loaded yet, try again.
} else { setTimeout(RA_autoloadchat, 100); } } else { setTimeout(RA_autoloadchat, 100); }
} }
@ -428,13 +428,13 @@ function OpenNavPanels() {
//auto-open L nav if locked and previously open //auto-open L nav if locked and previously open
if (LoadLocalBool("LNavLockOn") == true && LoadLocalBool("LNavOpened") == true) { if (LoadLocalBool("LNavLockOn") == true && LoadLocalBool("LNavOpened") == true) {
console.log("RA -- clicking left nav to open"); console.debug("RA -- clicking left nav to open");
$("#leftNavDrawerIcon").click(); $("#leftNavDrawerIcon").click();
} }
//auto-open WI if locked and previously open //auto-open WI if locked and previously open
if (LoadLocalBool("WINavLockOn") == true && LoadLocalBool("WINavOpened") == true) { if (LoadLocalBool("WINavLockOn") == true && LoadLocalBool("WINavOpened") == true) {
console.log("RA -- clicking WI to open"); console.debug("RA -- clicking WI to open");
$("#WIDrawerIcon").click(); $("#WIDrawerIcon").click();
} }
} }
@ -563,10 +563,10 @@ function dragElement(elmnt) {
offsetLeft: ${elmnt.offsetLeft}, offsetTop: ${elmnt.offsetTop} offsetLeft: ${elmnt.offsetLeft}, offsetTop: ${elmnt.offsetTop}
winWidth: ${winWidth}, winHeight: ${winHeight} winWidth: ${winWidth}, winHeight: ${winHeight}
sheldWidth: ${sheldWidth} sheldWidth: ${sheldWidth}
X: ${elmnt.style.left} X: ${elmnt.style.left}
Y: ${elmnt.style.top} Y: ${elmnt.style.top}
MaxX: ${maxX}, MaxY: ${maxY} MaxX: ${maxX}, MaxY: ${maxY}
Topbar 1st X: ${((winWidth - sheldWidth) / 2)} Topbar 1st X: ${((winWidth - sheldWidth) / 2)}
TopBar lastX: ${((winWidth - sheldWidth) / 2) + sheldWidth} TopBar lastX: ${((winWidth - sheldWidth) / 2) + sheldWidth}
`); */ `); */
@ -651,14 +651,14 @@ $("document").ready(function () {
$(WIPanelPin).on("click", function () { $(WIPanelPin).on("click", function () {
SaveLocal("WINavLockOn", $(WIPanelPin).prop("checked")); SaveLocal("WINavLockOn", $(WIPanelPin).prop("checked"));
if ($(WIPanelPin).prop("checked") == true) { if ($(WIPanelPin).prop("checked") == true) {
console.log('adding pin class to WI'); console.debug('adding pin class to WI');
$(WorldInfo).addClass('pinnedOpen'); $(WorldInfo).addClass('pinnedOpen');
} else { } else {
console.log('removing pin class from WI'); console.debug('removing pin class from WI');
$(WorldInfo).removeClass('pinnedOpen'); $(WorldInfo).removeClass('pinnedOpen');
if ($(WorldInfo).hasClass('openDrawer') && $('.openDrawer').length > 1) { if ($(WorldInfo).hasClass('openDrawer') && $('.openDrawer').length > 1) {
console.log('closing WI after lock removal'); console.debug('closing WI after lock removal');
$(WorldInfo).slideToggle(200, "swing"); $(WorldInfo).slideToggle(200, "swing");
//$(WorldInfoDrawerIcon).toggleClass('openIcon closedIcon'); //$(WorldInfoDrawerIcon).toggleClass('openIcon closedIcon');
$(WorldInfo).toggleClass('openDrawer closedDrawer'); $(WorldInfo).toggleClass('openDrawer closedDrawer');
@ -673,7 +673,7 @@ $("document").ready(function () {
$(RightNavPanel).addClass('pinnedOpen'); $(RightNavPanel).addClass('pinnedOpen');
} }
if ($(RPanelPin).prop('checked' == true)) { if ($(RPanelPin).prop('checked' == true)) {
console.log('setting pin class via checkbox state'); console.debug('setting pin class via checkbox state');
$(RightNavPanel).addClass('pinnedOpen'); $(RightNavPanel).addClass('pinnedOpen');
} }
// read the state of left Nav Lock and apply to leftnav classlist // read the state of left Nav Lock and apply to leftnav classlist
@ -683,7 +683,7 @@ $("document").ready(function () {
$(LeftNavPanel).addClass('pinnedOpen'); $(LeftNavPanel).addClass('pinnedOpen');
} }
if ($(LPanelPin).prop('checked' == true)) { if ($(LPanelPin).prop('checked' == true)) {
console.log('setting pin class via checkbox state'); console.debug('setting pin class via checkbox state');
$(LeftNavPanel).addClass('pinnedOpen'); $(LeftNavPanel).addClass('pinnedOpen');
} }
@ -695,7 +695,7 @@ $("document").ready(function () {
} }
if ($(WIPanelPin).prop('checked' == true)) { if ($(WIPanelPin).prop('checked' == true)) {
console.log('setting pin class via checkbox state'); console.debug('setting pin class via checkbox state');
$(WorldInfo).addClass('pinnedOpen'); $(WorldInfo).addClass('pinnedOpen');
} }
@ -751,7 +751,7 @@ $("document").ready(function () {
SaveLocal('ActiveGroup', $(this).data('id')); SaveLocal('ActiveGroup', $(this).data('id'));
}); });
//this makes the chat input text area resize vertically to match the text size (limited by CSS at 50% window height) //this makes the chat input text area resize vertically to match the text size (limited by CSS at 50% window height)
$('#send_textarea').on('input', function () { $('#send_textarea').on('input', function () {
this.style.height = '40px'; this.style.height = '40px';
this.style.height = (this.scrollHeight) + 'px'; this.style.height = (this.scrollHeight) + 'px';
@ -842,7 +842,7 @@ $("document").ready(function () {
} }
if (event.ctrlKey && event.key == "ArrowUp") { //edits last USER message if chatbar is empty and focused if (event.ctrlKey && event.key == "ArrowUp") { //edits last USER message if chatbar is empty and focused
console.log('got ctrl+uparrow input'); console.debug('got ctrl+uparrow input');
if ( if (
$("#send_textarea").val() === '' && $("#send_textarea").val() === '' &&
chatbarInFocus === true && chatbarInFocus === true &&

View File

@ -188,7 +188,7 @@ async function validateImages(character, forceRedrawCached) {
if (spriteCache[character]) { if (spriteCache[character]) {
if (forceRedrawCached && $('#image_list').data('name') !== character) { if (forceRedrawCached && $('#image_list').data('name') !== character) {
console.log('force redrawing character sprites list') console.debug('force redrawing character sprites list')
drawSpritesList(character, labels, spriteCache[character]); drawSpritesList(character, labels, spriteCache[character]);
} }
@ -237,7 +237,7 @@ function getListItem(item, imageSrc, textClass) {
} }
async function getSpritesList(name) { async function getSpritesList(name) {
console.log('getting sprites list'); console.debug('getting sprites list');
try { try {
const result = await fetch(`/get_sprites?name=${encodeURIComponent(name)}`); const result = await fetch(`/get_sprites?name=${encodeURIComponent(name)}`);
@ -284,14 +284,14 @@ async function getExpressionsList() {
} }
async function setExpression(character, expression, force) { async function setExpression(character, expression, force) {
console.log('entered setExpressions'); console.debug('entered setExpressions');
await validateImages(character); await validateImages(character);
const img = $('img.expression'); const img = $('img.expression');
const sprite = (spriteCache[character] && spriteCache[character].find(x => x.label === expression)); const sprite = (spriteCache[character] && spriteCache[character].find(x => x.label === expression));
console.log('checking for expression images to show..'); console.debug('checking for expression images to show..');
if (sprite) { if (sprite) {
console.log('setting expression from character images folder'); console.debug('setting expression from character images folder');
img.attr('src', sprite.path); img.attr('src', sprite.path);
img.removeClass('default'); img.removeClass('default');
img.off('error'); img.off('error');
@ -308,7 +308,7 @@ async function setExpression(character, expression, force) {
} }
function setDefault() { function setDefault() {
console.log('setting default'); console.debug('setting default');
const defImgUrl = `/img/default-expressions/${expression}.png`; const defImgUrl = `/img/default-expressions/${expression}.png`;
//console.log(defImgUrl); //console.log(defImgUrl);
img.attr('src', defImgUrl); img.attr('src', defImgUrl);

View File

@ -83,7 +83,7 @@ async function loadSettings() {
Object.assign(extension_settings.chromadb, defaultSettings); Object.assign(extension_settings.chromadb, defaultSettings);
} }
console.log(`loading chromadb strat:${extension_settings.chromadb.strategy}`); console.debug(`loading chromadb strat:${extension_settings.chromadb.strategy}`);
$("#chromadb_strategy option[value=" + extension_settings.chromadb.strategy + "]").attr( $("#chromadb_strategy option[value=" + extension_settings.chromadb.strategy + "]").attr(
"selected", "selected",
"true" "true"
@ -95,7 +95,7 @@ async function loadSettings() {
} }
function onStrategyChange() { function onStrategyChange() {
console.log('changing chromadb strat'); console.debug('changing chromadb strat');
extension_settings.chromadb.strategy = $('#chromadb_strategy').val(); extension_settings.chromadb.strategy = $('#chromadb_strategy').val();
//$('#chromadb_strategy').select(extension_settings.chromadb.strategy); //$('#chromadb_strategy').select(extension_settings.chromadb.strategy);

View File

@ -2,10 +2,10 @@
export function SaveLocal(target, val) { export function SaveLocal(target, val) {
localStorage.setItem(target, val); localStorage.setItem(target, val);
console.log('SaveLocal -- ' + target + ' : ' + val); console.debug('SaveLocal -- ' + target + ' : ' + val);
} }
export function LoadLocal(target) { export function LoadLocal(target) {
console.log('LoadLocal -- ' + target); console.debug('LoadLocal -- ' + target);
return localStorage.getItem(target); return localStorage.getItem(target);
} }
@ -24,4 +24,4 @@ export function CheckLocal() {
export function ClearLocal() { localStorage.clear(); console.log('Removed All Local Storage'); } export function ClearLocal() { localStorage.clear(); console.log('Removed All Local Storage'); }
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////

View File

@ -426,14 +426,14 @@ function onTagRenameInput() {
} }
function onTagColorize(evt) { function onTagColorize(evt) {
console.log(evt); console.debug(evt);
const id = $(evt.target).closest('.tag_view_item').attr('id'); const id = $(evt.target).closest('.tag_view_item').attr('id');
const newColor = evt.detail.rgba; const newColor = evt.detail.rgba;
$(evt.target).parent().parent().find('.tag_view_name').css('background-color', newColor); $(evt.target).parent().parent().find('.tag_view_name').css('background-color', newColor);
$(`.tag[id="${id}"]`).css('background-color', newColor); $(`.tag[id="${id}"]`).css('background-color', newColor);
const tag = tags.find(x => x.id === id); const tag = tags.find(x => x.id === id);
tag.color = newColor; tag.color = newColor;
console.log(tag); console.debug(tag);
saveSettingsDebounced(); saveSettingsDebounced();
} }