playTone
diff --git a/docs/BarChart.html b/docs/BarChart.html
index 52b18d1c..fab28b2d 100644
--- a/docs/BarChart.html
+++ b/docs/BarChart.html
@@ -24,7 +24,7 @@
@@ -1097,7 +1097,7 @@ UnSel
diff --git a/docs/BoxPlot.html b/docs/BoxPlot.html
index 015482c4..2c5b0b27 100644
--- a/docs/BoxPlot.html
+++ b/docs/BoxPlot.html
@@ -24,7 +24,7 @@
@@ -1329,7 +1329,7 @@ Returns:
diff --git a/docs/BoxplotRect.html b/docs/BoxplotRect.html
index 3c3d6f62..70925bd7 100644
--- a/docs/BoxplotRect.html
+++ b/docs/BoxplotRect.html
@@ -24,7 +24,7 @@
@@ -408,7 +408,7 @@ UpdateRect<
diff --git a/docs/ChatLLM.html b/docs/ChatLLM.html
index 664cedbb..4fe82412 100644
--- a/docs/ChatLLM.html
+++ b/docs/ChatLLM.html
@@ -24,7 +24,7 @@
@@ -100,7 +100,7 @@ new ChatLLMSource:
@@ -201,7 +201,7 @@ (async) Source:
@@ -285,7 +285,7 @@ Create
Source:
@@ -370,7 +370,7 @@ GetDe
Source:
@@ -453,7 +453,7 @@ Pro
Source:
@@ -557,7 +557,7 @@ Reset
Source:
@@ -640,7 +640,7 @@ SetEventsSource:
@@ -723,7 +723,7 @@ ToggleSource:
@@ -878,7 +878,7 @@ fa
Source:
@@ -951,7 +951,7 @@ Returns:
diff --git a/docs/Constants.html b/docs/Constants.html
index 5113ddb3..c537d43d 100644
--- a/docs/Constants.html
+++ b/docs/Constants.html
@@ -24,7 +24,7 @@
@@ -181,7 +181,7 @@ Classes
diff --git a/docs/Constants_ConvertHexToRGBString.html b/docs/Constants_ConvertHexToRGBString.html
index 75394c72..9e0b772a 100644
--- a/docs/Constants_ConvertHexToRGBString.html
+++ b/docs/Constants_ConvertHexToRGBString.html
@@ -24,7 +24,7 @@
@@ -239,7 +239,7 @@ Returns:
diff --git a/docs/Constants_ConvertRGBStringToHex.html b/docs/Constants_ConvertRGBStringToHex.html
index 14d7556e..0fd4d71a 100644
--- a/docs/Constants_ConvertRGBStringToHex.html
+++ b/docs/Constants_ConvertRGBStringToHex.html
@@ -24,7 +24,7 @@
@@ -239,7 +239,7 @@ Returns:
diff --git a/docs/Constants_GetStyleArrayFromString.html b/docs/Constants_GetStyleArrayFromString.html
index ec0e3abc..85463d6e 100644
--- a/docs/Constants_GetStyleArrayFromString.html
+++ b/docs/Constants_GetStyleArrayFromString.html
@@ -24,7 +24,7 @@
@@ -239,7 +239,7 @@ Returns:
diff --git a/docs/Constants_GetStyleStringFromArray.html b/docs/Constants_GetStyleStringFromArray.html
index 8155f559..83bbc618 100644
--- a/docs/Constants_GetStyleStringFromArray.html
+++ b/docs/Constants_GetStyleStringFromArray.html
@@ -24,7 +24,7 @@
@@ -239,7 +239,7 @@ Returns:
diff --git a/docs/Control.html b/docs/Control.html
index 8606bfa0..c76ad6ab 100644
--- a/docs/Control.html
+++ b/docs/Control.html
@@ -24,7 +24,7 @@
@@ -344,7 +344,7 @@ Returns:
diff --git a/docs/Description.html b/docs/Description.html
index f28c4145..7143987a 100644
--- a/docs/Description.html
+++ b/docs/Description.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new Descri
Source:
@@ -200,7 +200,7 @@ Create
Source:
@@ -283,7 +283,7 @@ DestroySource:
@@ -366,7 +366,7 @@ PopulateD
Source:
@@ -449,7 +449,7 @@ ToggleSource:
@@ -573,7 +573,7 @@ Parameters:
diff --git a/docs/Display.html b/docs/Display.html
index 937f0efd..31600168 100644
--- a/docs/Display.html
+++ b/docs/Display.html
@@ -24,7 +24,7 @@
@@ -1575,7 +1575,7 @@ toggleT
diff --git a/docs/HeatMap.html b/docs/HeatMap.html
index 30b65009..8921f908 100644
--- a/docs/HeatMap.html
+++ b/docs/HeatMap.html
@@ -24,7 +24,7 @@
@@ -1493,7 +1493,7 @@ update
diff --git a/docs/HeatMapRect.html b/docs/HeatMapRect.html
index 2d32914e..97acbd2e 100644
--- a/docs/HeatMapRect.html
+++ b/docs/HeatMapRect.html
@@ -24,7 +24,7 @@
@@ -256,7 +256,7 @@ UpdateRect<
diff --git a/docs/Helper.html b/docs/Helper.html
index 33a4b8af..fa0ca485 100644
--- a/docs/Helper.html
+++ b/docs/Helper.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new HelperSource:
@@ -200,7 +200,7 @@ (static) Source:
@@ -355,7 +355,7 @@ Returns:
diff --git a/docs/Histogram.html b/docs/Histogram.html
index 8d05052c..cebf3417 100644
--- a/docs/Histogram.html
+++ b/docs/Histogram.html
@@ -24,7 +24,7 @@
@@ -422,7 +422,7 @@ SetMaxMin
diff --git a/docs/Layer0Point.html b/docs/Layer0Point.html
index c847ffe9..d7053be5 100644
--- a/docs/Layer0Point.html
+++ b/docs/Layer0Point.html
@@ -24,7 +24,7 @@
@@ -547,7 +547,7 @@ Returns:
diff --git a/docs/Layer1Point.html b/docs/Layer1Point.html
index 6ce2628e..4dd81951 100644
--- a/docs/Layer1Point.html
+++ b/docs/Layer1Point.html
@@ -24,7 +24,7 @@
@@ -547,7 +547,7 @@ Returns:
diff --git a/docs/LinePlot.html b/docs/LinePlot.html
index 37744fd7..e00b766f 100644
--- a/docs/LinePlot.html
+++ b/docs/LinePlot.html
@@ -24,7 +24,7 @@
@@ -725,7 +725,7 @@ Update
diff --git a/docs/LogError.html b/docs/LogError.html
index 9281b16a..b22a5497 100644
--- a/docs/LogError.html
+++ b/docs/LogError.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new LogError<
Source:
@@ -200,7 +200,7 @@ LogAb
Source:
@@ -335,7 +335,7 @@ Log
Source:
@@ -470,7 +470,7 @@ Lo
Source:
@@ -631,7 +631,7 @@ LogNotArra
Source:
@@ -766,7 +766,7 @@ Log
Source:
@@ -896,7 +896,7 @@ Parameters:
diff --git a/docs/Menu.html b/docs/Menu.html
index 0c418037..c21a5924 100644
--- a/docs/Menu.html
+++ b/docs/Menu.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new MenuSource:
@@ -201,7 +201,7 @@ CreateMenu<
Source:
@@ -285,7 +285,7 @@ Handl
Source:
@@ -368,7 +368,90 @@ Source:
-
- constants.js, line 844
+ constants.js, line 876
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ NotifyOfLLMReset()
+
+
+
+
+
+
+ Notifies the user that the LLM will be reset.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+
@@ -451,7 +534,7 @@ PopulateD
- Source:
@@ -534,7 +617,7 @@ SaveDataSource:
@@ -617,7 +700,7 @@ ToggleSource:
@@ -741,7 +824,7 @@ Parameters:
diff --git a/docs/Point.html b/docs/Point.html
index e9903cb5..af8388c0 100644
--- a/docs/Point.html
+++ b/docs/Point.html
@@ -24,7 +24,7 @@
@@ -547,7 +547,7 @@ Returns:
diff --git a/docs/Position.html b/docs/Position.html
index be3a8f17..0e66ba43 100644
--- a/docs/Position.html
+++ b/docs/Position.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new Position<
- Source:
@@ -165,7 +165,7 @@ new Position<
diff --git a/docs/Resources.html b/docs/Resources.html
index 6ec6de01..70b507b6 100644
--- a/docs/Resources.html
+++ b/docs/Resources.html
@@ -24,7 +24,7 @@
@@ -200,7 +200,7 @@ GetStringSource:
@@ -329,7 +329,7 @@ Returns:
diff --git a/docs/Review.html b/docs/Review.html
index 9d2226b2..1f476b4e 100644
--- a/docs/Review.html
+++ b/docs/Review.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new ReviewSource:
@@ -200,7 +200,7 @@ Toggl
- Source:
@@ -324,7 +324,7 @@ Parameters:
diff --git a/docs/ScatterPlot.html b/docs/ScatterPlot.html
index 544da78b..5cead09d 100644
--- a/docs/ScatterPlot.html
+++ b/docs/ScatterPlot.html
@@ -24,7 +24,7 @@
@@ -1427,7 +1427,7 @@ SetLineLa
diff --git a/docs/Segmented.html b/docs/Segmented.html
index ce786aee..4824dd59 100644
--- a/docs/Segmented.html
+++ b/docs/Segmented.html
@@ -24,7 +24,7 @@
@@ -892,7 +892,7 @@ UnSel
diff --git a/docs/Tracker.html b/docs/Tracker.html
index dea73e14..e590510b 100644
--- a/docs/Tracker.html
+++ b/docs/Tracker.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new TrackerSource:
@@ -200,7 +200,7 @@ DataSetupSource:
@@ -283,7 +283,7 @@ DeleteSource:
@@ -366,7 +366,7 @@ Do
- Source:
@@ -449,7 +449,7 @@ GetTrac
- Source:
@@ -557,7 +557,7 @@ LogEventSource:
@@ -692,7 +692,7 @@ SaveTr
- Source:
@@ -827,7 +827,7 @@ isUn
- Source:
@@ -956,7 +956,7 @@ Returns:
diff --git a/docs/audio.js.html b/docs/audio.js.html
index 4fc80eab..b00c498a 100644
--- a/docs/audio.js.html
+++ b/docs/audio.js.html
@@ -24,7 +24,7 @@
@@ -638,7 +638,7 @@ audio.js
diff --git a/docs/barplot.js.html b/docs/barplot.js.html
index bf935fe2..aa9fffe5 100644
--- a/docs/barplot.js.html
+++ b/docs/barplot.js.html
@@ -24,7 +24,7 @@
@@ -372,7 +372,7 @@ barplot.js
diff --git a/docs/boxplot.js.html b/docs/boxplot.js.html
index 4bdb587f..4cc26111 100644
--- a/docs/boxplot.js.html
+++ b/docs/boxplot.js.html
@@ -24,7 +24,7 @@
@@ -796,7 +796,7 @@ boxplot.js
diff --git a/docs/constants.js.html b/docs/constants.js.html
index 591d73d7..32d8bacc 100644
--- a/docs/constants.js.html
+++ b/docs/constants.js.html
@@ -24,7 +24,7 @@
@@ -314,6 +314,7 @@ constants.js
openai: 'OpenAI Vision',
gemini: 'Gemini Pro Vision',
multi: 'Multiple AI',
+ processing: 'Processing Chart...',
},
},
};
@@ -484,7 +485,7 @@ constants.js
</div>
</div>
<div class="modal-footer">
- <button type="button" id="save_and_close_menu">Save and Close</button>
+ <button type="button" id="save_and_close_menu" aria-labelledby="save_and_close_text"><span id="save_and_close_text">Save and Close</span></button>
<button type="button" id="close_menu">Close</button>
</div>
</div>
@@ -620,6 +621,16 @@ constants.js
}
},
]);
+
+ // trigger notification that LLM will be reset
+ // this is done on change of LLM model, multi settings, or skill level
+ constants.events.push([
+ document.getElementById('LLM_model'),
+ 'change',
+ function (e) {
+ menu.NotifyOfLLMReset();
+ },
+ ]);
}
/**
@@ -761,6 +772,9 @@ constants.js
document.getElementById('LLM_preferences').value =
constants.LLMPreferences;
}
+ if (document.getElementById('LLM_reset_notification')) {
+ document.getElementById('LLM_reset_notification').remove();
+ }
}
/**
@@ -818,6 +832,24 @@ constants.js
.setAttribute('aria-live', constants.ariaMode);
}
+ /**
+ * Notifies the user that the LLM will be reset.
+ */
+ NotifyOfLLMReset() {
+ let html =
+ '<p id="LLM_reset_notification">Note: Changes in LLM settings will reset any existing conversation.</p>';
+ document
+ .getElementById('save_and_close_menu')
+ .insertAdjacentHTML('beforebegin', html);
+
+ // add to aria button text
+ document
+ .getElementById('save_and_close_menu')
+ .setAttribute(
+ 'aria-labelledby',
+ 'save_and_close_text LLM_reset_notification'
+ );
+ }
/**
* Handles changes to the LLM model and multi-modal settings.
* We reset if we change the LLM model, multi settings, or skill level.
@@ -936,8 +968,11 @@ constants.js
</button>
</div>
<div class="modal-body">
+ <div id="chatLLM_chat_history_wrapper">
<div id="chatLLM_chat_history" aria-live="${constants.ariaMode}" aria-relevant="additions">
</div>
+ <p id="chatLLM_copy_all_wrapper"><button id="chatLLM_copy_all">Copy all to clipboard</button></p>
+ </div>
<div id="chatLLM_content">
<p><input type="text" id="chatLLM_input" class="form-control" name="chatLLM_input" aria-labelledby="chatLLM_title" size="50"></p>
<div class="LLM_suggestions">
@@ -1079,10 +1114,41 @@ constants.js
document.getElementById('reset_chatLLM'),
'click',
function (e) {
- chatLLM.Toggle(false);
chatLLM.ResetChatHistory();
},
]);
+
+ // copy to clipboard
+ constants.events.push([
+ document.getElementById('chatLLM_copy_all'),
+ 'click',
+ function (e) {
+ let text = document.getElementById('chatLLM_chat_history').innerText;
+ // need newlines instead of paragraphs headings etc
+ text = text.replace(/<p>/g, '\n').replace(/<\/p>/g, '\n');
+ text = text.replace(/<h\d>/g, '\n').replace(/<\/h\d>/g, '\n');
+ text = text.replace(/<.*?>/g, '');
+
+ navigator.clipboard.writeText(text);
+ },
+ ]);
+ constants.events.push([
+ document.getElementById('chatLLM_chat_history'),
+ 'click',
+ function (e) {
+ // we're delegating here, so set the event on child .chatLLM_message_copy_button
+ if (e.target.matches('.chatLLM_message_copy_button')) {
+ // get the innerText of the element before the button
+ let text = e.target.closest('p').previousElementSibling.innerText;
+ // need newlines instead of paragraphs headings etc
+ text = text.replace(/<p>/g, '\n').replace(/<\/p>/g, '\n');
+ text = text.replace(/<h\d>/g, '\n').replace(/<\/h\d>/g, '\n');
+ text = text.replace(/<.*?>/g, '');
+
+ navigator.clipboard.writeText(text);
+ }
+ },
+ ]);
}
/**
@@ -1163,7 +1229,7 @@ constants.js
*/
ProcessLLMResponse(data, model) {
chatLLM.WaitingSound(false);
- console.log('LLM response: ', data);
+ //console.log('LLM response: ', data);
let text = '';
let LLMName = resources.GetString(model);
@@ -1367,9 +1433,9 @@ constants.js
};
// Generate the content
- console.log('LLM request: ', prompt, image);
+ //console.log('LLM request: ', prompt, image);
const result = await model.generateContent([prompt, image]);
- console.log(result.response.text());
+ //console.log(result.response.text());
// Process the response
chatLLM.ProcessLLMResponse(result.response, 'gemini');
@@ -1409,6 +1475,12 @@ constants.js
<p class="chatLLM_message_text">${text}</p>
</div>
`;
+ // add a copy button to actual messages
+ if (user != 'User' && text != resources.GetString('processing')) {
+ html += `
+ <p class="chatLLM_message_copy"><button class="chatLLM_message_copy_button">Copy</button></p>
+ `;
+ }
this.RenderChatMessage(html);
}
@@ -1486,7 +1558,11 @@ constants.js
// get name from resource
let LLMName = resources.GetString(constants.LLMModel);
this.firstTime = false;
- this.DisplayChatMessage(LLMName, 'Processing Chart...', true);
+ this.DisplayChatMessage(
+ LLMName,
+ resources.GetString('processing'),
+ true
+ );
let defaultPrompt = this.GetDefaultPrompt();
this.Submit(defaultPrompt, true);
}
@@ -2282,7 +2358,7 @@ constants.js
diff --git a/docs/controls.js.html b/docs/controls.js.html
index fb8a89b4..3fbf1e2e 100644
--- a/docs/controls.js.html
+++ b/docs/controls.js.html
@@ -24,7 +24,7 @@
@@ -3268,7 +3268,7 @@ controls.js
diff --git a/docs/display.js.html b/docs/display.js.html
index a4ee9c53..1f9acd2b 100644
--- a/docs/display.js.html
+++ b/docs/display.js.html
@@ -24,7 +24,7 @@
@@ -1256,7 +1256,7 @@ display.js
diff --git a/docs/global.html b/docs/global.html
index 05f0215f..f8d03800 100644
--- a/docs/global.html
+++ b/docs/global.html
@@ -24,7 +24,7 @@
@@ -1141,7 +1141,7 @@ Parameters:
diff --git a/docs/heatmap.js.html b/docs/heatmap.js.html
index 1d6889a9..9d586522 100644
--- a/docs/heatmap.js.html
+++ b/docs/heatmap.js.html
@@ -24,7 +24,7 @@
@@ -452,7 +452,7 @@ heatmap.js
diff --git a/docs/histogram.js.html b/docs/histogram.js.html
index 86072184..6b459dcd 100644
--- a/docs/histogram.js.html
+++ b/docs/histogram.js.html
@@ -24,7 +24,7 @@
@@ -247,7 +247,7 @@ histogram.js
diff --git a/docs/index.html b/docs/index.html
index a84a0904..008cca1c 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -24,7 +24,7 @@
@@ -57,7 +57,7 @@
diff --git a/docs/init.js.html b/docs/init.js.html
index 613333f3..7c72dea3 100644
--- a/docs/init.js.html
+++ b/docs/init.js.html
@@ -24,7 +24,7 @@
@@ -531,7 +531,7 @@ init.js
diff --git a/docs/lineplot.js.html b/docs/lineplot.js.html
index 03a2adb0..14254718 100644
--- a/docs/lineplot.js.html
+++ b/docs/lineplot.js.html
@@ -24,7 +24,7 @@
@@ -305,7 +305,7 @@ lineplot.js
diff --git a/docs/scatterplot.js.html b/docs/scatterplot.js.html
index 2e7aca1e..1fa53947 100644
--- a/docs/scatterplot.js.html
+++ b/docs/scatterplot.js.html
@@ -24,7 +24,7 @@
@@ -886,7 +886,7 @@ scatterplot.js
diff --git a/docs/segmented.js.html b/docs/segmented.js.html
index c6e5fa00..9a7c6124 100644
--- a/docs/segmented.js.html
+++ b/docs/segmented.js.html
@@ -24,7 +24,7 @@
@@ -377,7 +377,7 @@ segmented.js
UnSel
diff --git a/docs/BoxPlot.html b/docs/BoxPlot.html
index 015482c4..2c5b0b27 100644
--- a/docs/BoxPlot.html
+++ b/docs/BoxPlot.html
@@ -24,7 +24,7 @@
@@ -1329,7 +1329,7 @@ Returns:
diff --git a/docs/BoxplotRect.html b/docs/BoxplotRect.html
index 3c3d6f62..70925bd7 100644
--- a/docs/BoxplotRect.html
+++ b/docs/BoxplotRect.html
@@ -24,7 +24,7 @@
@@ -408,7 +408,7 @@ UpdateRect<
diff --git a/docs/ChatLLM.html b/docs/ChatLLM.html
index 664cedbb..4fe82412 100644
--- a/docs/ChatLLM.html
+++ b/docs/ChatLLM.html
@@ -24,7 +24,7 @@
@@ -100,7 +100,7 @@ new ChatLLMSource:
@@ -201,7 +201,7 @@ (async) Source:
@@ -285,7 +285,7 @@ Create
Source:
@@ -370,7 +370,7 @@ GetDe
Source:
@@ -453,7 +453,7 @@ Pro
Source:
@@ -557,7 +557,7 @@ Reset
Source:
@@ -640,7 +640,7 @@ SetEventsSource:
@@ -723,7 +723,7 @@ ToggleSource:
@@ -878,7 +878,7 @@ fa
Source:
@@ -951,7 +951,7 @@ Returns:
diff --git a/docs/Constants.html b/docs/Constants.html
index 5113ddb3..c537d43d 100644
--- a/docs/Constants.html
+++ b/docs/Constants.html
@@ -24,7 +24,7 @@
@@ -181,7 +181,7 @@ Classes
diff --git a/docs/Constants_ConvertHexToRGBString.html b/docs/Constants_ConvertHexToRGBString.html
index 75394c72..9e0b772a 100644
--- a/docs/Constants_ConvertHexToRGBString.html
+++ b/docs/Constants_ConvertHexToRGBString.html
@@ -24,7 +24,7 @@
@@ -239,7 +239,7 @@ Returns:
diff --git a/docs/Constants_ConvertRGBStringToHex.html b/docs/Constants_ConvertRGBStringToHex.html
index 14d7556e..0fd4d71a 100644
--- a/docs/Constants_ConvertRGBStringToHex.html
+++ b/docs/Constants_ConvertRGBStringToHex.html
@@ -24,7 +24,7 @@
@@ -239,7 +239,7 @@ Returns:
diff --git a/docs/Constants_GetStyleArrayFromString.html b/docs/Constants_GetStyleArrayFromString.html
index ec0e3abc..85463d6e 100644
--- a/docs/Constants_GetStyleArrayFromString.html
+++ b/docs/Constants_GetStyleArrayFromString.html
@@ -24,7 +24,7 @@
@@ -239,7 +239,7 @@ Returns:
diff --git a/docs/Constants_GetStyleStringFromArray.html b/docs/Constants_GetStyleStringFromArray.html
index 8155f559..83bbc618 100644
--- a/docs/Constants_GetStyleStringFromArray.html
+++ b/docs/Constants_GetStyleStringFromArray.html
@@ -24,7 +24,7 @@
@@ -239,7 +239,7 @@ Returns:
diff --git a/docs/Control.html b/docs/Control.html
index 8606bfa0..c76ad6ab 100644
--- a/docs/Control.html
+++ b/docs/Control.html
@@ -24,7 +24,7 @@
@@ -344,7 +344,7 @@ Returns:
diff --git a/docs/Description.html b/docs/Description.html
index f28c4145..7143987a 100644
--- a/docs/Description.html
+++ b/docs/Description.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new Descri
Source:
@@ -200,7 +200,7 @@ Create
Source:
@@ -283,7 +283,7 @@ DestroySource:
@@ -366,7 +366,7 @@ PopulateD
Source:
@@ -449,7 +449,7 @@ ToggleSource:
@@ -573,7 +573,7 @@ Parameters:
diff --git a/docs/Display.html b/docs/Display.html
index 937f0efd..31600168 100644
--- a/docs/Display.html
+++ b/docs/Display.html
@@ -24,7 +24,7 @@
@@ -1575,7 +1575,7 @@ toggleT
diff --git a/docs/HeatMap.html b/docs/HeatMap.html
index 30b65009..8921f908 100644
--- a/docs/HeatMap.html
+++ b/docs/HeatMap.html
@@ -24,7 +24,7 @@
@@ -1493,7 +1493,7 @@ update
diff --git a/docs/HeatMapRect.html b/docs/HeatMapRect.html
index 2d32914e..97acbd2e 100644
--- a/docs/HeatMapRect.html
+++ b/docs/HeatMapRect.html
@@ -24,7 +24,7 @@
@@ -256,7 +256,7 @@ UpdateRect<
diff --git a/docs/Helper.html b/docs/Helper.html
index 33a4b8af..fa0ca485 100644
--- a/docs/Helper.html
+++ b/docs/Helper.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new HelperSource:
@@ -200,7 +200,7 @@ (static) Source:
@@ -355,7 +355,7 @@ Returns:
diff --git a/docs/Histogram.html b/docs/Histogram.html
index 8d05052c..cebf3417 100644
--- a/docs/Histogram.html
+++ b/docs/Histogram.html
@@ -24,7 +24,7 @@
@@ -422,7 +422,7 @@ SetMaxMin
diff --git a/docs/Layer0Point.html b/docs/Layer0Point.html
index c847ffe9..d7053be5 100644
--- a/docs/Layer0Point.html
+++ b/docs/Layer0Point.html
@@ -24,7 +24,7 @@
@@ -547,7 +547,7 @@ Returns:
diff --git a/docs/Layer1Point.html b/docs/Layer1Point.html
index 6ce2628e..4dd81951 100644
--- a/docs/Layer1Point.html
+++ b/docs/Layer1Point.html
@@ -24,7 +24,7 @@
@@ -547,7 +547,7 @@ Returns:
diff --git a/docs/LinePlot.html b/docs/LinePlot.html
index 37744fd7..e00b766f 100644
--- a/docs/LinePlot.html
+++ b/docs/LinePlot.html
@@ -24,7 +24,7 @@
@@ -725,7 +725,7 @@ Update
diff --git a/docs/LogError.html b/docs/LogError.html
index 9281b16a..b22a5497 100644
--- a/docs/LogError.html
+++ b/docs/LogError.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new LogError<
Source:
@@ -200,7 +200,7 @@ LogAb
Source:
@@ -335,7 +335,7 @@ Log
Source:
@@ -470,7 +470,7 @@ Lo
Source:
@@ -631,7 +631,7 @@ LogNotArra
Source:
@@ -766,7 +766,7 @@ Log
Source:
@@ -896,7 +896,7 @@ Parameters:
diff --git a/docs/Menu.html b/docs/Menu.html
index 0c418037..c21a5924 100644
--- a/docs/Menu.html
+++ b/docs/Menu.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new MenuSource:
@@ -201,7 +201,7 @@ CreateMenu<
Source:
@@ -285,7 +285,7 @@ Handl
Source:
@@ -368,7 +368,90 @@ Source:
-
- constants.js, line 844
+ constants.js, line 876
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ NotifyOfLLMReset()
+
+
+
+
+
+
+ Notifies the user that the LLM will be reset.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+
@@ -451,7 +534,7 @@ PopulateD
- Source:
@@ -534,7 +617,7 @@ SaveDataSource:
@@ -617,7 +700,7 @@ ToggleSource:
@@ -741,7 +824,7 @@ Parameters:
diff --git a/docs/Point.html b/docs/Point.html
index e9903cb5..af8388c0 100644
--- a/docs/Point.html
+++ b/docs/Point.html
@@ -24,7 +24,7 @@
@@ -547,7 +547,7 @@ Returns:
diff --git a/docs/Position.html b/docs/Position.html
index be3a8f17..0e66ba43 100644
--- a/docs/Position.html
+++ b/docs/Position.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new Position<
- Source:
@@ -165,7 +165,7 @@ new Position<
diff --git a/docs/Resources.html b/docs/Resources.html
index 6ec6de01..70b507b6 100644
--- a/docs/Resources.html
+++ b/docs/Resources.html
@@ -24,7 +24,7 @@
@@ -200,7 +200,7 @@ GetStringSource:
@@ -329,7 +329,7 @@ Returns:
diff --git a/docs/Review.html b/docs/Review.html
index 9d2226b2..1f476b4e 100644
--- a/docs/Review.html
+++ b/docs/Review.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new ReviewSource:
@@ -200,7 +200,7 @@ Toggl
- Source:
@@ -324,7 +324,7 @@ Parameters:
diff --git a/docs/ScatterPlot.html b/docs/ScatterPlot.html
index 544da78b..5cead09d 100644
--- a/docs/ScatterPlot.html
+++ b/docs/ScatterPlot.html
@@ -24,7 +24,7 @@
@@ -1427,7 +1427,7 @@ SetLineLa
diff --git a/docs/Segmented.html b/docs/Segmented.html
index ce786aee..4824dd59 100644
--- a/docs/Segmented.html
+++ b/docs/Segmented.html
@@ -24,7 +24,7 @@
@@ -892,7 +892,7 @@ UnSel
diff --git a/docs/Tracker.html b/docs/Tracker.html
index dea73e14..e590510b 100644
--- a/docs/Tracker.html
+++ b/docs/Tracker.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new TrackerSource:
@@ -200,7 +200,7 @@ DataSetupSource:
@@ -283,7 +283,7 @@ DeleteSource:
@@ -366,7 +366,7 @@ Do
- Source:
@@ -449,7 +449,7 @@ GetTrac
- Source:
@@ -557,7 +557,7 @@ LogEventSource:
@@ -692,7 +692,7 @@ SaveTr
- Source:
@@ -827,7 +827,7 @@ isUn
- Source:
@@ -956,7 +956,7 @@ Returns:
diff --git a/docs/audio.js.html b/docs/audio.js.html
index 4fc80eab..b00c498a 100644
--- a/docs/audio.js.html
+++ b/docs/audio.js.html
@@ -24,7 +24,7 @@
@@ -638,7 +638,7 @@ audio.js
diff --git a/docs/barplot.js.html b/docs/barplot.js.html
index bf935fe2..aa9fffe5 100644
--- a/docs/barplot.js.html
+++ b/docs/barplot.js.html
@@ -24,7 +24,7 @@
@@ -372,7 +372,7 @@ barplot.js
diff --git a/docs/boxplot.js.html b/docs/boxplot.js.html
index 4bdb587f..4cc26111 100644
--- a/docs/boxplot.js.html
+++ b/docs/boxplot.js.html
@@ -24,7 +24,7 @@
@@ -796,7 +796,7 @@ boxplot.js
diff --git a/docs/constants.js.html b/docs/constants.js.html
index 591d73d7..32d8bacc 100644
--- a/docs/constants.js.html
+++ b/docs/constants.js.html
@@ -24,7 +24,7 @@
@@ -314,6 +314,7 @@ constants.js
openai: 'OpenAI Vision',
gemini: 'Gemini Pro Vision',
multi: 'Multiple AI',
+ processing: 'Processing Chart...',
},
},
};
@@ -484,7 +485,7 @@ constants.js
</div>
</div>
<div class="modal-footer">
- <button type="button" id="save_and_close_menu">Save and Close</button>
+ <button type="button" id="save_and_close_menu" aria-labelledby="save_and_close_text"><span id="save_and_close_text">Save and Close</span></button>
<button type="button" id="close_menu">Close</button>
</div>
</div>
@@ -620,6 +621,16 @@ constants.js
}
},
]);
+
+ // trigger notification that LLM will be reset
+ // this is done on change of LLM model, multi settings, or skill level
+ constants.events.push([
+ document.getElementById('LLM_model'),
+ 'change',
+ function (e) {
+ menu.NotifyOfLLMReset();
+ },
+ ]);
}
/**
@@ -761,6 +772,9 @@ constants.js
document.getElementById('LLM_preferences').value =
constants.LLMPreferences;
}
+ if (document.getElementById('LLM_reset_notification')) {
+ document.getElementById('LLM_reset_notification').remove();
+ }
}
/**
@@ -818,6 +832,24 @@ constants.js
.setAttribute('aria-live', constants.ariaMode);
}
+ /**
+ * Notifies the user that the LLM will be reset.
+ */
+ NotifyOfLLMReset() {
+ let html =
+ '<p id="LLM_reset_notification">Note: Changes in LLM settings will reset any existing conversation.</p>';
+ document
+ .getElementById('save_and_close_menu')
+ .insertAdjacentHTML('beforebegin', html);
+
+ // add to aria button text
+ document
+ .getElementById('save_and_close_menu')
+ .setAttribute(
+ 'aria-labelledby',
+ 'save_and_close_text LLM_reset_notification'
+ );
+ }
/**
* Handles changes to the LLM model and multi-modal settings.
* We reset if we change the LLM model, multi settings, or skill level.
@@ -936,8 +968,11 @@ constants.js
</button>
</div>
<div class="modal-body">
+ <div id="chatLLM_chat_history_wrapper">
<div id="chatLLM_chat_history" aria-live="${constants.ariaMode}" aria-relevant="additions">
</div>
+ <p id="chatLLM_copy_all_wrapper"><button id="chatLLM_copy_all">Copy all to clipboard</button></p>
+ </div>
<div id="chatLLM_content">
<p><input type="text" id="chatLLM_input" class="form-control" name="chatLLM_input" aria-labelledby="chatLLM_title" size="50"></p>
<div class="LLM_suggestions">
@@ -1079,10 +1114,41 @@ constants.js
document.getElementById('reset_chatLLM'),
'click',
function (e) {
- chatLLM.Toggle(false);
chatLLM.ResetChatHistory();
},
]);
+
+ // copy to clipboard
+ constants.events.push([
+ document.getElementById('chatLLM_copy_all'),
+ 'click',
+ function (e) {
+ let text = document.getElementById('chatLLM_chat_history').innerText;
+ // need newlines instead of paragraphs headings etc
+ text = text.replace(/<p>/g, '\n').replace(/<\/p>/g, '\n');
+ text = text.replace(/<h\d>/g, '\n').replace(/<\/h\d>/g, '\n');
+ text = text.replace(/<.*?>/g, '');
+
+ navigator.clipboard.writeText(text);
+ },
+ ]);
+ constants.events.push([
+ document.getElementById('chatLLM_chat_history'),
+ 'click',
+ function (e) {
+ // we're delegating here, so set the event on child .chatLLM_message_copy_button
+ if (e.target.matches('.chatLLM_message_copy_button')) {
+ // get the innerText of the element before the button
+ let text = e.target.closest('p').previousElementSibling.innerText;
+ // need newlines instead of paragraphs headings etc
+ text = text.replace(/<p>/g, '\n').replace(/<\/p>/g, '\n');
+ text = text.replace(/<h\d>/g, '\n').replace(/<\/h\d>/g, '\n');
+ text = text.replace(/<.*?>/g, '');
+
+ navigator.clipboard.writeText(text);
+ }
+ },
+ ]);
}
/**
@@ -1163,7 +1229,7 @@ constants.js
*/
ProcessLLMResponse(data, model) {
chatLLM.WaitingSound(false);
- console.log('LLM response: ', data);
+ //console.log('LLM response: ', data);
let text = '';
let LLMName = resources.GetString(model);
@@ -1367,9 +1433,9 @@ constants.js
};
// Generate the content
- console.log('LLM request: ', prompt, image);
+ //console.log('LLM request: ', prompt, image);
const result = await model.generateContent([prompt, image]);
- console.log(result.response.text());
+ //console.log(result.response.text());
// Process the response
chatLLM.ProcessLLMResponse(result.response, 'gemini');
@@ -1409,6 +1475,12 @@ constants.js
<p class="chatLLM_message_text">${text}</p>
</div>
`;
+ // add a copy button to actual messages
+ if (user != 'User' && text != resources.GetString('processing')) {
+ html += `
+ <p class="chatLLM_message_copy"><button class="chatLLM_message_copy_button">Copy</button></p>
+ `;
+ }
this.RenderChatMessage(html);
}
@@ -1486,7 +1558,11 @@ constants.js
// get name from resource
let LLMName = resources.GetString(constants.LLMModel);
this.firstTime = false;
- this.DisplayChatMessage(LLMName, 'Processing Chart...', true);
+ this.DisplayChatMessage(
+ LLMName,
+ resources.GetString('processing'),
+ true
+ );
let defaultPrompt = this.GetDefaultPrompt();
this.Submit(defaultPrompt, true);
}
@@ -2282,7 +2358,7 @@ constants.js
diff --git a/docs/controls.js.html b/docs/controls.js.html
index fb8a89b4..3fbf1e2e 100644
--- a/docs/controls.js.html
+++ b/docs/controls.js.html
@@ -24,7 +24,7 @@
@@ -3268,7 +3268,7 @@ controls.js
diff --git a/docs/display.js.html b/docs/display.js.html
index a4ee9c53..1f9acd2b 100644
--- a/docs/display.js.html
+++ b/docs/display.js.html
@@ -24,7 +24,7 @@
@@ -1256,7 +1256,7 @@ display.js
diff --git a/docs/global.html b/docs/global.html
index 05f0215f..f8d03800 100644
--- a/docs/global.html
+++ b/docs/global.html
@@ -24,7 +24,7 @@
@@ -1141,7 +1141,7 @@ Parameters:
diff --git a/docs/heatmap.js.html b/docs/heatmap.js.html
index 1d6889a9..9d586522 100644
--- a/docs/heatmap.js.html
+++ b/docs/heatmap.js.html
@@ -24,7 +24,7 @@
@@ -452,7 +452,7 @@ heatmap.js
diff --git a/docs/histogram.js.html b/docs/histogram.js.html
index 86072184..6b459dcd 100644
--- a/docs/histogram.js.html
+++ b/docs/histogram.js.html
@@ -24,7 +24,7 @@
@@ -247,7 +247,7 @@ histogram.js
diff --git a/docs/index.html b/docs/index.html
index a84a0904..008cca1c 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -24,7 +24,7 @@
@@ -57,7 +57,7 @@
diff --git a/docs/init.js.html b/docs/init.js.html
index 613333f3..7c72dea3 100644
--- a/docs/init.js.html
+++ b/docs/init.js.html
@@ -24,7 +24,7 @@
@@ -531,7 +531,7 @@ init.js
diff --git a/docs/lineplot.js.html b/docs/lineplot.js.html
index 03a2adb0..14254718 100644
--- a/docs/lineplot.js.html
+++ b/docs/lineplot.js.html
@@ -24,7 +24,7 @@
@@ -305,7 +305,7 @@ lineplot.js
diff --git a/docs/scatterplot.js.html b/docs/scatterplot.js.html
index 2e7aca1e..1fa53947 100644
--- a/docs/scatterplot.js.html
+++ b/docs/scatterplot.js.html
@@ -24,7 +24,7 @@
@@ -886,7 +886,7 @@ scatterplot.js
diff --git a/docs/segmented.js.html b/docs/segmented.js.html
index c6e5fa00..9a7c6124 100644
--- a/docs/segmented.js.html
+++ b/docs/segmented.js.html
@@ -24,7 +24,7 @@
@@ -377,7 +377,7 @@ segmented.js
Returns:
diff --git a/docs/BoxplotRect.html b/docs/BoxplotRect.html index 3c3d6f62..70925bd7 100644 --- a/docs/BoxplotRect.html +++ b/docs/BoxplotRect.html @@ -24,7 +24,7 @@
UpdateRect<
diff --git a/docs/ChatLLM.html b/docs/ChatLLM.html
index 664cedbb..4fe82412 100644
--- a/docs/ChatLLM.html
+++ b/docs/ChatLLM.html
@@ -24,7 +24,7 @@
@@ -100,7 +100,7 @@ new ChatLLMSource:
@@ -201,7 +201,7 @@ (async) Source:
@@ -285,7 +285,7 @@ Create
Source:
@@ -370,7 +370,7 @@ GetDe
Source:
@@ -453,7 +453,7 @@ Pro
Source:
@@ -557,7 +557,7 @@ Reset
Source:
@@ -640,7 +640,7 @@ SetEventsSource:
@@ -723,7 +723,7 @@ ToggleSource:
@@ -878,7 +878,7 @@ fa
Source:
@@ -951,7 +951,7 @@ Returns:
diff --git a/docs/Constants.html b/docs/Constants.html
index 5113ddb3..c537d43d 100644
--- a/docs/Constants.html
+++ b/docs/Constants.html
@@ -24,7 +24,7 @@
@@ -181,7 +181,7 @@ Classes
diff --git a/docs/Constants_ConvertHexToRGBString.html b/docs/Constants_ConvertHexToRGBString.html
index 75394c72..9e0b772a 100644
--- a/docs/Constants_ConvertHexToRGBString.html
+++ b/docs/Constants_ConvertHexToRGBString.html
@@ -24,7 +24,7 @@
@@ -239,7 +239,7 @@ Returns:
diff --git a/docs/Constants_ConvertRGBStringToHex.html b/docs/Constants_ConvertRGBStringToHex.html
index 14d7556e..0fd4d71a 100644
--- a/docs/Constants_ConvertRGBStringToHex.html
+++ b/docs/Constants_ConvertRGBStringToHex.html
@@ -24,7 +24,7 @@
@@ -239,7 +239,7 @@ Returns:
diff --git a/docs/Constants_GetStyleArrayFromString.html b/docs/Constants_GetStyleArrayFromString.html
index ec0e3abc..85463d6e 100644
--- a/docs/Constants_GetStyleArrayFromString.html
+++ b/docs/Constants_GetStyleArrayFromString.html
@@ -24,7 +24,7 @@
@@ -239,7 +239,7 @@ Returns:
diff --git a/docs/Constants_GetStyleStringFromArray.html b/docs/Constants_GetStyleStringFromArray.html
index 8155f559..83bbc618 100644
--- a/docs/Constants_GetStyleStringFromArray.html
+++ b/docs/Constants_GetStyleStringFromArray.html
@@ -24,7 +24,7 @@
@@ -239,7 +239,7 @@ Returns:
diff --git a/docs/Control.html b/docs/Control.html
index 8606bfa0..c76ad6ab 100644
--- a/docs/Control.html
+++ b/docs/Control.html
@@ -24,7 +24,7 @@
@@ -344,7 +344,7 @@ Returns:
diff --git a/docs/Description.html b/docs/Description.html
index f28c4145..7143987a 100644
--- a/docs/Description.html
+++ b/docs/Description.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new Descri
Source:
@@ -200,7 +200,7 @@ Create
Source:
@@ -283,7 +283,7 @@ DestroySource:
@@ -366,7 +366,7 @@ PopulateD
Source:
@@ -449,7 +449,7 @@ ToggleSource:
@@ -573,7 +573,7 @@ Parameters:
diff --git a/docs/Display.html b/docs/Display.html
index 937f0efd..31600168 100644
--- a/docs/Display.html
+++ b/docs/Display.html
@@ -24,7 +24,7 @@
@@ -1575,7 +1575,7 @@ toggleT
diff --git a/docs/HeatMap.html b/docs/HeatMap.html
index 30b65009..8921f908 100644
--- a/docs/HeatMap.html
+++ b/docs/HeatMap.html
@@ -24,7 +24,7 @@
@@ -1493,7 +1493,7 @@ update
diff --git a/docs/HeatMapRect.html b/docs/HeatMapRect.html
index 2d32914e..97acbd2e 100644
--- a/docs/HeatMapRect.html
+++ b/docs/HeatMapRect.html
@@ -24,7 +24,7 @@
@@ -256,7 +256,7 @@ UpdateRect<
diff --git a/docs/Helper.html b/docs/Helper.html
index 33a4b8af..fa0ca485 100644
--- a/docs/Helper.html
+++ b/docs/Helper.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new HelperSource:
@@ -200,7 +200,7 @@ (static) Source:
@@ -355,7 +355,7 @@ Returns:
diff --git a/docs/Histogram.html b/docs/Histogram.html
index 8d05052c..cebf3417 100644
--- a/docs/Histogram.html
+++ b/docs/Histogram.html
@@ -24,7 +24,7 @@
@@ -422,7 +422,7 @@ SetMaxMin
diff --git a/docs/Layer0Point.html b/docs/Layer0Point.html
index c847ffe9..d7053be5 100644
--- a/docs/Layer0Point.html
+++ b/docs/Layer0Point.html
@@ -24,7 +24,7 @@
@@ -547,7 +547,7 @@ Returns:
diff --git a/docs/Layer1Point.html b/docs/Layer1Point.html
index 6ce2628e..4dd81951 100644
--- a/docs/Layer1Point.html
+++ b/docs/Layer1Point.html
@@ -24,7 +24,7 @@
@@ -547,7 +547,7 @@ Returns:
diff --git a/docs/LinePlot.html b/docs/LinePlot.html
index 37744fd7..e00b766f 100644
--- a/docs/LinePlot.html
+++ b/docs/LinePlot.html
@@ -24,7 +24,7 @@
@@ -725,7 +725,7 @@ Update
diff --git a/docs/LogError.html b/docs/LogError.html
index 9281b16a..b22a5497 100644
--- a/docs/LogError.html
+++ b/docs/LogError.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new LogError<
Source:
@@ -200,7 +200,7 @@ LogAb
Source:
@@ -335,7 +335,7 @@ Log
Source:
@@ -470,7 +470,7 @@ Lo
Source:
@@ -631,7 +631,7 @@ LogNotArra
Source:
@@ -766,7 +766,7 @@ Log
Source:
@@ -896,7 +896,7 @@ Parameters:
diff --git a/docs/Menu.html b/docs/Menu.html
index 0c418037..c21a5924 100644
--- a/docs/Menu.html
+++ b/docs/Menu.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new MenuSource:
@@ -201,7 +201,7 @@ CreateMenu<
Source:
@@ -285,7 +285,7 @@ Handl
Source:
@@ -368,7 +368,90 @@ Source:
-
- constants.js, line 844
+ constants.js, line 876
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ NotifyOfLLMReset()
+
+
+
+
+
+
+ Notifies the user that the LLM will be reset.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+
@@ -451,7 +534,7 @@ PopulateD
- Source:
@@ -534,7 +617,7 @@ SaveDataSource:
@@ -617,7 +700,7 @@ ToggleSource:
@@ -741,7 +824,7 @@ Parameters:
diff --git a/docs/Point.html b/docs/Point.html
index e9903cb5..af8388c0 100644
--- a/docs/Point.html
+++ b/docs/Point.html
@@ -24,7 +24,7 @@
@@ -547,7 +547,7 @@ Returns:
diff --git a/docs/Position.html b/docs/Position.html
index be3a8f17..0e66ba43 100644
--- a/docs/Position.html
+++ b/docs/Position.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new Position<
- Source:
@@ -165,7 +165,7 @@ new Position<
diff --git a/docs/Resources.html b/docs/Resources.html
index 6ec6de01..70b507b6 100644
--- a/docs/Resources.html
+++ b/docs/Resources.html
@@ -24,7 +24,7 @@
@@ -200,7 +200,7 @@ GetStringSource:
@@ -329,7 +329,7 @@ Returns:
diff --git a/docs/Review.html b/docs/Review.html
index 9d2226b2..1f476b4e 100644
--- a/docs/Review.html
+++ b/docs/Review.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new ReviewSource:
@@ -200,7 +200,7 @@ Toggl
- Source:
@@ -324,7 +324,7 @@ Parameters:
diff --git a/docs/ScatterPlot.html b/docs/ScatterPlot.html
index 544da78b..5cead09d 100644
--- a/docs/ScatterPlot.html
+++ b/docs/ScatterPlot.html
@@ -24,7 +24,7 @@
@@ -1427,7 +1427,7 @@ SetLineLa
diff --git a/docs/Segmented.html b/docs/Segmented.html
index ce786aee..4824dd59 100644
--- a/docs/Segmented.html
+++ b/docs/Segmented.html
@@ -24,7 +24,7 @@
@@ -892,7 +892,7 @@ UnSel
diff --git a/docs/Tracker.html b/docs/Tracker.html
index dea73e14..e590510b 100644
--- a/docs/Tracker.html
+++ b/docs/Tracker.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new TrackerSource:
@@ -200,7 +200,7 @@ DataSetupSource:
@@ -283,7 +283,7 @@ DeleteSource:
@@ -366,7 +366,7 @@ Do
- Source:
@@ -449,7 +449,7 @@ GetTrac
- Source:
@@ -557,7 +557,7 @@ LogEventSource:
@@ -692,7 +692,7 @@ SaveTr
- Source:
@@ -827,7 +827,7 @@ isUn
- Source:
@@ -956,7 +956,7 @@ Returns:
diff --git a/docs/audio.js.html b/docs/audio.js.html
index 4fc80eab..b00c498a 100644
--- a/docs/audio.js.html
+++ b/docs/audio.js.html
@@ -24,7 +24,7 @@
@@ -638,7 +638,7 @@ audio.js
diff --git a/docs/barplot.js.html b/docs/barplot.js.html
index bf935fe2..aa9fffe5 100644
--- a/docs/barplot.js.html
+++ b/docs/barplot.js.html
@@ -24,7 +24,7 @@
@@ -372,7 +372,7 @@ barplot.js
diff --git a/docs/boxplot.js.html b/docs/boxplot.js.html
index 4bdb587f..4cc26111 100644
--- a/docs/boxplot.js.html
+++ b/docs/boxplot.js.html
@@ -24,7 +24,7 @@
@@ -796,7 +796,7 @@ boxplot.js
diff --git a/docs/constants.js.html b/docs/constants.js.html
index 591d73d7..32d8bacc 100644
--- a/docs/constants.js.html
+++ b/docs/constants.js.html
@@ -24,7 +24,7 @@
@@ -314,6 +314,7 @@ constants.js
openai: 'OpenAI Vision',
gemini: 'Gemini Pro Vision',
multi: 'Multiple AI',
+ processing: 'Processing Chart...',
},
},
};
@@ -484,7 +485,7 @@ constants.js
</div>
</div>
<div class="modal-footer">
- <button type="button" id="save_and_close_menu">Save and Close</button>
+ <button type="button" id="save_and_close_menu" aria-labelledby="save_and_close_text"><span id="save_and_close_text">Save and Close</span></button>
<button type="button" id="close_menu">Close</button>
</div>
</div>
@@ -620,6 +621,16 @@ constants.js
}
},
]);
+
+ // trigger notification that LLM will be reset
+ // this is done on change of LLM model, multi settings, or skill level
+ constants.events.push([
+ document.getElementById('LLM_model'),
+ 'change',
+ function (e) {
+ menu.NotifyOfLLMReset();
+ },
+ ]);
}
/**
@@ -761,6 +772,9 @@ constants.js
document.getElementById('LLM_preferences').value =
constants.LLMPreferences;
}
+ if (document.getElementById('LLM_reset_notification')) {
+ document.getElementById('LLM_reset_notification').remove();
+ }
}
/**
@@ -818,6 +832,24 @@ constants.js
.setAttribute('aria-live', constants.ariaMode);
}
+ /**
+ * Notifies the user that the LLM will be reset.
+ */
+ NotifyOfLLMReset() {
+ let html =
+ '<p id="LLM_reset_notification">Note: Changes in LLM settings will reset any existing conversation.</p>';
+ document
+ .getElementById('save_and_close_menu')
+ .insertAdjacentHTML('beforebegin', html);
+
+ // add to aria button text
+ document
+ .getElementById('save_and_close_menu')
+ .setAttribute(
+ 'aria-labelledby',
+ 'save_and_close_text LLM_reset_notification'
+ );
+ }
/**
* Handles changes to the LLM model and multi-modal settings.
* We reset if we change the LLM model, multi settings, or skill level.
@@ -936,8 +968,11 @@ constants.js
</button>
</div>
<div class="modal-body">
+ <div id="chatLLM_chat_history_wrapper">
<div id="chatLLM_chat_history" aria-live="${constants.ariaMode}" aria-relevant="additions">
</div>
+ <p id="chatLLM_copy_all_wrapper"><button id="chatLLM_copy_all">Copy all to clipboard</button></p>
+ </div>
<div id="chatLLM_content">
<p><input type="text" id="chatLLM_input" class="form-control" name="chatLLM_input" aria-labelledby="chatLLM_title" size="50"></p>
<div class="LLM_suggestions">
@@ -1079,10 +1114,41 @@ constants.js
document.getElementById('reset_chatLLM'),
'click',
function (e) {
- chatLLM.Toggle(false);
chatLLM.ResetChatHistory();
},
]);
+
+ // copy to clipboard
+ constants.events.push([
+ document.getElementById('chatLLM_copy_all'),
+ 'click',
+ function (e) {
+ let text = document.getElementById('chatLLM_chat_history').innerText;
+ // need newlines instead of paragraphs headings etc
+ text = text.replace(/<p>/g, '\n').replace(/<\/p>/g, '\n');
+ text = text.replace(/<h\d>/g, '\n').replace(/<\/h\d>/g, '\n');
+ text = text.replace(/<.*?>/g, '');
+
+ navigator.clipboard.writeText(text);
+ },
+ ]);
+ constants.events.push([
+ document.getElementById('chatLLM_chat_history'),
+ 'click',
+ function (e) {
+ // we're delegating here, so set the event on child .chatLLM_message_copy_button
+ if (e.target.matches('.chatLLM_message_copy_button')) {
+ // get the innerText of the element before the button
+ let text = e.target.closest('p').previousElementSibling.innerText;
+ // need newlines instead of paragraphs headings etc
+ text = text.replace(/<p>/g, '\n').replace(/<\/p>/g, '\n');
+ text = text.replace(/<h\d>/g, '\n').replace(/<\/h\d>/g, '\n');
+ text = text.replace(/<.*?>/g, '');
+
+ navigator.clipboard.writeText(text);
+ }
+ },
+ ]);
}
/**
@@ -1163,7 +1229,7 @@ constants.js
*/
ProcessLLMResponse(data, model) {
chatLLM.WaitingSound(false);
- console.log('LLM response: ', data);
+ //console.log('LLM response: ', data);
let text = '';
let LLMName = resources.GetString(model);
@@ -1367,9 +1433,9 @@ constants.js
};
// Generate the content
- console.log('LLM request: ', prompt, image);
+ //console.log('LLM request: ', prompt, image);
const result = await model.generateContent([prompt, image]);
- console.log(result.response.text());
+ //console.log(result.response.text());
// Process the response
chatLLM.ProcessLLMResponse(result.response, 'gemini');
@@ -1409,6 +1475,12 @@ constants.js
<p class="chatLLM_message_text">${text}</p>
</div>
`;
+ // add a copy button to actual messages
+ if (user != 'User' && text != resources.GetString('processing')) {
+ html += `
+ <p class="chatLLM_message_copy"><button class="chatLLM_message_copy_button">Copy</button></p>
+ `;
+ }
this.RenderChatMessage(html);
}
@@ -1486,7 +1558,11 @@ constants.js
// get name from resource
let LLMName = resources.GetString(constants.LLMModel);
this.firstTime = false;
- this.DisplayChatMessage(LLMName, 'Processing Chart...', true);
+ this.DisplayChatMessage(
+ LLMName,
+ resources.GetString('processing'),
+ true
+ );
let defaultPrompt = this.GetDefaultPrompt();
this.Submit(defaultPrompt, true);
}
@@ -2282,7 +2358,7 @@ constants.js
diff --git a/docs/controls.js.html b/docs/controls.js.html
index fb8a89b4..3fbf1e2e 100644
--- a/docs/controls.js.html
+++ b/docs/controls.js.html
@@ -24,7 +24,7 @@
@@ -3268,7 +3268,7 @@ controls.js
diff --git a/docs/display.js.html b/docs/display.js.html
index a4ee9c53..1f9acd2b 100644
--- a/docs/display.js.html
+++ b/docs/display.js.html
@@ -24,7 +24,7 @@
@@ -1256,7 +1256,7 @@ display.js
diff --git a/docs/global.html b/docs/global.html
index 05f0215f..f8d03800 100644
--- a/docs/global.html
+++ b/docs/global.html
@@ -24,7 +24,7 @@
@@ -1141,7 +1141,7 @@ Parameters:
diff --git a/docs/heatmap.js.html b/docs/heatmap.js.html
index 1d6889a9..9d586522 100644
--- a/docs/heatmap.js.html
+++ b/docs/heatmap.js.html
@@ -24,7 +24,7 @@
@@ -452,7 +452,7 @@ heatmap.js
diff --git a/docs/histogram.js.html b/docs/histogram.js.html
index 86072184..6b459dcd 100644
--- a/docs/histogram.js.html
+++ b/docs/histogram.js.html
@@ -24,7 +24,7 @@
@@ -247,7 +247,7 @@ histogram.js
diff --git a/docs/index.html b/docs/index.html
index a84a0904..008cca1c 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -24,7 +24,7 @@
@@ -57,7 +57,7 @@
diff --git a/docs/init.js.html b/docs/init.js.html
index 613333f3..7c72dea3 100644
--- a/docs/init.js.html
+++ b/docs/init.js.html
@@ -24,7 +24,7 @@
@@ -531,7 +531,7 @@ init.js
diff --git a/docs/lineplot.js.html b/docs/lineplot.js.html
index 03a2adb0..14254718 100644
--- a/docs/lineplot.js.html
+++ b/docs/lineplot.js.html
@@ -24,7 +24,7 @@
@@ -305,7 +305,7 @@ lineplot.js
diff --git a/docs/scatterplot.js.html b/docs/scatterplot.js.html
index 2e7aca1e..1fa53947 100644
--- a/docs/scatterplot.js.html
+++ b/docs/scatterplot.js.html
@@ -24,7 +24,7 @@
@@ -886,7 +886,7 @@ scatterplot.js
diff --git a/docs/segmented.js.html b/docs/segmented.js.html
index c6e5fa00..9a7c6124 100644
--- a/docs/segmented.js.html
+++ b/docs/segmented.js.html
@@ -24,7 +24,7 @@
@@ -377,7 +377,7 @@ segmented.js
new ChatLLMSource:
@@ -201,7 +201,7 @@ (async) Source:
@@ -285,7 +285,7 @@ Create
Source:
@@ -370,7 +370,7 @@ GetDe
Source:
@@ -453,7 +453,7 @@ Pro
Source:
@@ -557,7 +557,7 @@ Reset
Source:
@@ -640,7 +640,7 @@ SetEventsSource:
@@ -723,7 +723,7 @@ ToggleSource:
@@ -878,7 +878,7 @@ fa
Source:
@@ -951,7 +951,7 @@ Returns:
diff --git a/docs/Constants.html b/docs/Constants.html
index 5113ddb3..c537d43d 100644
--- a/docs/Constants.html
+++ b/docs/Constants.html
@@ -24,7 +24,7 @@
@@ -181,7 +181,7 @@ Classes
diff --git a/docs/Constants_ConvertHexToRGBString.html b/docs/Constants_ConvertHexToRGBString.html
index 75394c72..9e0b772a 100644
--- a/docs/Constants_ConvertHexToRGBString.html
+++ b/docs/Constants_ConvertHexToRGBString.html
@@ -24,7 +24,7 @@
@@ -239,7 +239,7 @@ Returns:
diff --git a/docs/Constants_ConvertRGBStringToHex.html b/docs/Constants_ConvertRGBStringToHex.html
index 14d7556e..0fd4d71a 100644
--- a/docs/Constants_ConvertRGBStringToHex.html
+++ b/docs/Constants_ConvertRGBStringToHex.html
@@ -24,7 +24,7 @@
@@ -239,7 +239,7 @@ Returns:
diff --git a/docs/Constants_GetStyleArrayFromString.html b/docs/Constants_GetStyleArrayFromString.html
index ec0e3abc..85463d6e 100644
--- a/docs/Constants_GetStyleArrayFromString.html
+++ b/docs/Constants_GetStyleArrayFromString.html
@@ -24,7 +24,7 @@
@@ -239,7 +239,7 @@ Returns:
diff --git a/docs/Constants_GetStyleStringFromArray.html b/docs/Constants_GetStyleStringFromArray.html
index 8155f559..83bbc618 100644
--- a/docs/Constants_GetStyleStringFromArray.html
+++ b/docs/Constants_GetStyleStringFromArray.html
@@ -24,7 +24,7 @@
@@ -239,7 +239,7 @@ Returns:
diff --git a/docs/Control.html b/docs/Control.html
index 8606bfa0..c76ad6ab 100644
--- a/docs/Control.html
+++ b/docs/Control.html
@@ -24,7 +24,7 @@
@@ -344,7 +344,7 @@ Returns:
diff --git a/docs/Description.html b/docs/Description.html
index f28c4145..7143987a 100644
--- a/docs/Description.html
+++ b/docs/Description.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new Descri
Source:
@@ -200,7 +200,7 @@ Create
Source:
@@ -283,7 +283,7 @@ DestroySource:
@@ -366,7 +366,7 @@ PopulateD
Source:
@@ -449,7 +449,7 @@ ToggleSource:
@@ -573,7 +573,7 @@ Parameters:
diff --git a/docs/Display.html b/docs/Display.html
index 937f0efd..31600168 100644
--- a/docs/Display.html
+++ b/docs/Display.html
@@ -24,7 +24,7 @@
@@ -1575,7 +1575,7 @@ toggleT
diff --git a/docs/HeatMap.html b/docs/HeatMap.html
index 30b65009..8921f908 100644
--- a/docs/HeatMap.html
+++ b/docs/HeatMap.html
@@ -24,7 +24,7 @@
@@ -1493,7 +1493,7 @@ update
diff --git a/docs/HeatMapRect.html b/docs/HeatMapRect.html
index 2d32914e..97acbd2e 100644
--- a/docs/HeatMapRect.html
+++ b/docs/HeatMapRect.html
@@ -24,7 +24,7 @@
@@ -256,7 +256,7 @@ UpdateRect<
diff --git a/docs/Helper.html b/docs/Helper.html
index 33a4b8af..fa0ca485 100644
--- a/docs/Helper.html
+++ b/docs/Helper.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new HelperSource:
@@ -200,7 +200,7 @@ (static) Source:
@@ -355,7 +355,7 @@ Returns:
diff --git a/docs/Histogram.html b/docs/Histogram.html
index 8d05052c..cebf3417 100644
--- a/docs/Histogram.html
+++ b/docs/Histogram.html
@@ -24,7 +24,7 @@
@@ -422,7 +422,7 @@ SetMaxMin
diff --git a/docs/Layer0Point.html b/docs/Layer0Point.html
index c847ffe9..d7053be5 100644
--- a/docs/Layer0Point.html
+++ b/docs/Layer0Point.html
@@ -24,7 +24,7 @@
@@ -547,7 +547,7 @@ Returns:
diff --git a/docs/Layer1Point.html b/docs/Layer1Point.html
index 6ce2628e..4dd81951 100644
--- a/docs/Layer1Point.html
+++ b/docs/Layer1Point.html
@@ -24,7 +24,7 @@
@@ -547,7 +547,7 @@ Returns:
diff --git a/docs/LinePlot.html b/docs/LinePlot.html
index 37744fd7..e00b766f 100644
--- a/docs/LinePlot.html
+++ b/docs/LinePlot.html
@@ -24,7 +24,7 @@
@@ -725,7 +725,7 @@ Update
diff --git a/docs/LogError.html b/docs/LogError.html
index 9281b16a..b22a5497 100644
--- a/docs/LogError.html
+++ b/docs/LogError.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new LogError<
Source:
@@ -200,7 +200,7 @@ LogAb
Source:
@@ -335,7 +335,7 @@ Log
Source:
@@ -470,7 +470,7 @@ Lo
Source:
@@ -631,7 +631,7 @@ LogNotArra
Source:
@@ -766,7 +766,7 @@ Log
Source:
@@ -896,7 +896,7 @@ Parameters:
diff --git a/docs/Menu.html b/docs/Menu.html
index 0c418037..c21a5924 100644
--- a/docs/Menu.html
+++ b/docs/Menu.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new MenuSource:
@@ -201,7 +201,7 @@ CreateMenu<
Source:
@@ -285,7 +285,7 @@ Handl
Source:
@@ -368,7 +368,90 @@ Source:
-
- constants.js, line 844
+ constants.js, line 876
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ NotifyOfLLMReset()
+
+
+
+
+
+
+ Notifies the user that the LLM will be reset.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+
@@ -451,7 +534,7 @@ PopulateD
- Source:
@@ -534,7 +617,7 @@ SaveDataSource:
@@ -617,7 +700,7 @@ ToggleSource:
@@ -741,7 +824,7 @@ Parameters:
diff --git a/docs/Point.html b/docs/Point.html
index e9903cb5..af8388c0 100644
--- a/docs/Point.html
+++ b/docs/Point.html
@@ -24,7 +24,7 @@
@@ -547,7 +547,7 @@ Returns:
diff --git a/docs/Position.html b/docs/Position.html
index be3a8f17..0e66ba43 100644
--- a/docs/Position.html
+++ b/docs/Position.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new Position<
- Source:
@@ -165,7 +165,7 @@ new Position<
diff --git a/docs/Resources.html b/docs/Resources.html
index 6ec6de01..70b507b6 100644
--- a/docs/Resources.html
+++ b/docs/Resources.html
@@ -24,7 +24,7 @@
@@ -200,7 +200,7 @@ GetStringSource:
@@ -329,7 +329,7 @@ Returns:
diff --git a/docs/Review.html b/docs/Review.html
index 9d2226b2..1f476b4e 100644
--- a/docs/Review.html
+++ b/docs/Review.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new ReviewSource:
@@ -200,7 +200,7 @@ Toggl
- Source:
@@ -324,7 +324,7 @@ Parameters:
diff --git a/docs/ScatterPlot.html b/docs/ScatterPlot.html
index 544da78b..5cead09d 100644
--- a/docs/ScatterPlot.html
+++ b/docs/ScatterPlot.html
@@ -24,7 +24,7 @@
@@ -1427,7 +1427,7 @@ SetLineLa
diff --git a/docs/Segmented.html b/docs/Segmented.html
index ce786aee..4824dd59 100644
--- a/docs/Segmented.html
+++ b/docs/Segmented.html
@@ -24,7 +24,7 @@
@@ -892,7 +892,7 @@ UnSel
diff --git a/docs/Tracker.html b/docs/Tracker.html
index dea73e14..e590510b 100644
--- a/docs/Tracker.html
+++ b/docs/Tracker.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new TrackerSource:
@@ -200,7 +200,7 @@ DataSetupSource:
@@ -283,7 +283,7 @@ DeleteSource:
@@ -366,7 +366,7 @@ Do
- Source:
@@ -449,7 +449,7 @@ GetTrac
- Source:
@@ -557,7 +557,7 @@ LogEventSource:
@@ -692,7 +692,7 @@ SaveTr
- Source:
@@ -827,7 +827,7 @@ isUn
- Source:
@@ -956,7 +956,7 @@ Returns:
diff --git a/docs/audio.js.html b/docs/audio.js.html
index 4fc80eab..b00c498a 100644
--- a/docs/audio.js.html
+++ b/docs/audio.js.html
@@ -24,7 +24,7 @@
@@ -638,7 +638,7 @@ audio.js
diff --git a/docs/barplot.js.html b/docs/barplot.js.html
index bf935fe2..aa9fffe5 100644
--- a/docs/barplot.js.html
+++ b/docs/barplot.js.html
@@ -24,7 +24,7 @@
@@ -372,7 +372,7 @@ barplot.js
diff --git a/docs/boxplot.js.html b/docs/boxplot.js.html
index 4bdb587f..4cc26111 100644
--- a/docs/boxplot.js.html
+++ b/docs/boxplot.js.html
@@ -24,7 +24,7 @@
@@ -796,7 +796,7 @@ boxplot.js
diff --git a/docs/constants.js.html b/docs/constants.js.html
index 591d73d7..32d8bacc 100644
--- a/docs/constants.js.html
+++ b/docs/constants.js.html
@@ -24,7 +24,7 @@
@@ -314,6 +314,7 @@ constants.js
openai: 'OpenAI Vision',
gemini: 'Gemini Pro Vision',
multi: 'Multiple AI',
+ processing: 'Processing Chart...',
},
},
};
@@ -484,7 +485,7 @@ constants.js
</div>
</div>
<div class="modal-footer">
- <button type="button" id="save_and_close_menu">Save and Close</button>
+ <button type="button" id="save_and_close_menu" aria-labelledby="save_and_close_text"><span id="save_and_close_text">Save and Close</span></button>
<button type="button" id="close_menu">Close</button>
</div>
</div>
@@ -620,6 +621,16 @@ constants.js
}
},
]);
+
+ // trigger notification that LLM will be reset
+ // this is done on change of LLM model, multi settings, or skill level
+ constants.events.push([
+ document.getElementById('LLM_model'),
+ 'change',
+ function (e) {
+ menu.NotifyOfLLMReset();
+ },
+ ]);
}
/**
@@ -761,6 +772,9 @@ constants.js
document.getElementById('LLM_preferences').value =
constants.LLMPreferences;
}
+ if (document.getElementById('LLM_reset_notification')) {
+ document.getElementById('LLM_reset_notification').remove();
+ }
}
/**
@@ -818,6 +832,24 @@ constants.js
.setAttribute('aria-live', constants.ariaMode);
}
+ /**
+ * Notifies the user that the LLM will be reset.
+ */
+ NotifyOfLLMReset() {
+ let html =
+ '<p id="LLM_reset_notification">Note: Changes in LLM settings will reset any existing conversation.</p>';
+ document
+ .getElementById('save_and_close_menu')
+ .insertAdjacentHTML('beforebegin', html);
+
+ // add to aria button text
+ document
+ .getElementById('save_and_close_menu')
+ .setAttribute(
+ 'aria-labelledby',
+ 'save_and_close_text LLM_reset_notification'
+ );
+ }
/**
* Handles changes to the LLM model and multi-modal settings.
* We reset if we change the LLM model, multi settings, or skill level.
@@ -936,8 +968,11 @@ constants.js
</button>
</div>
<div class="modal-body">
+ <div id="chatLLM_chat_history_wrapper">
<div id="chatLLM_chat_history" aria-live="${constants.ariaMode}" aria-relevant="additions">
</div>
+ <p id="chatLLM_copy_all_wrapper"><button id="chatLLM_copy_all">Copy all to clipboard</button></p>
+ </div>
<div id="chatLLM_content">
<p><input type="text" id="chatLLM_input" class="form-control" name="chatLLM_input" aria-labelledby="chatLLM_title" size="50"></p>
<div class="LLM_suggestions">
@@ -1079,10 +1114,41 @@ constants.js
document.getElementById('reset_chatLLM'),
'click',
function (e) {
- chatLLM.Toggle(false);
chatLLM.ResetChatHistory();
},
]);
+
+ // copy to clipboard
+ constants.events.push([
+ document.getElementById('chatLLM_copy_all'),
+ 'click',
+ function (e) {
+ let text = document.getElementById('chatLLM_chat_history').innerText;
+ // need newlines instead of paragraphs headings etc
+ text = text.replace(/<p>/g, '\n').replace(/<\/p>/g, '\n');
+ text = text.replace(/<h\d>/g, '\n').replace(/<\/h\d>/g, '\n');
+ text = text.replace(/<.*?>/g, '');
+
+ navigator.clipboard.writeText(text);
+ },
+ ]);
+ constants.events.push([
+ document.getElementById('chatLLM_chat_history'),
+ 'click',
+ function (e) {
+ // we're delegating here, so set the event on child .chatLLM_message_copy_button
+ if (e.target.matches('.chatLLM_message_copy_button')) {
+ // get the innerText of the element before the button
+ let text = e.target.closest('p').previousElementSibling.innerText;
+ // need newlines instead of paragraphs headings etc
+ text = text.replace(/<p>/g, '\n').replace(/<\/p>/g, '\n');
+ text = text.replace(/<h\d>/g, '\n').replace(/<\/h\d>/g, '\n');
+ text = text.replace(/<.*?>/g, '');
+
+ navigator.clipboard.writeText(text);
+ }
+ },
+ ]);
}
/**
@@ -1163,7 +1229,7 @@ constants.js
*/
ProcessLLMResponse(data, model) {
chatLLM.WaitingSound(false);
- console.log('LLM response: ', data);
+ //console.log('LLM response: ', data);
let text = '';
let LLMName = resources.GetString(model);
@@ -1367,9 +1433,9 @@ constants.js
};
// Generate the content
- console.log('LLM request: ', prompt, image);
+ //console.log('LLM request: ', prompt, image);
const result = await model.generateContent([prompt, image]);
- console.log(result.response.text());
+ //console.log(result.response.text());
// Process the response
chatLLM.ProcessLLMResponse(result.response, 'gemini');
@@ -1409,6 +1475,12 @@ constants.js
<p class="chatLLM_message_text">${text}</p>
</div>
`;
+ // add a copy button to actual messages
+ if (user != 'User' && text != resources.GetString('processing')) {
+ html += `
+ <p class="chatLLM_message_copy"><button class="chatLLM_message_copy_button">Copy</button></p>
+ `;
+ }
this.RenderChatMessage(html);
}
@@ -1486,7 +1558,11 @@ constants.js
// get name from resource
let LLMName = resources.GetString(constants.LLMModel);
this.firstTime = false;
- this.DisplayChatMessage(LLMName, 'Processing Chart...', true);
+ this.DisplayChatMessage(
+ LLMName,
+ resources.GetString('processing'),
+ true
+ );
let defaultPrompt = this.GetDefaultPrompt();
this.Submit(defaultPrompt, true);
}
@@ -2282,7 +2358,7 @@ constants.js
diff --git a/docs/controls.js.html b/docs/controls.js.html
index fb8a89b4..3fbf1e2e 100644
--- a/docs/controls.js.html
+++ b/docs/controls.js.html
@@ -24,7 +24,7 @@
@@ -3268,7 +3268,7 @@ controls.js
diff --git a/docs/display.js.html b/docs/display.js.html
index a4ee9c53..1f9acd2b 100644
--- a/docs/display.js.html
+++ b/docs/display.js.html
@@ -24,7 +24,7 @@
@@ -1256,7 +1256,7 @@ display.js
diff --git a/docs/global.html b/docs/global.html
index 05f0215f..f8d03800 100644
--- a/docs/global.html
+++ b/docs/global.html
@@ -24,7 +24,7 @@
@@ -1141,7 +1141,7 @@ Parameters:
diff --git a/docs/heatmap.js.html b/docs/heatmap.js.html
index 1d6889a9..9d586522 100644
--- a/docs/heatmap.js.html
+++ b/docs/heatmap.js.html
@@ -24,7 +24,7 @@
@@ -452,7 +452,7 @@ heatmap.js
diff --git a/docs/histogram.js.html b/docs/histogram.js.html
index 86072184..6b459dcd 100644
--- a/docs/histogram.js.html
+++ b/docs/histogram.js.html
@@ -24,7 +24,7 @@
@@ -247,7 +247,7 @@ histogram.js
diff --git a/docs/index.html b/docs/index.html
index a84a0904..008cca1c 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -24,7 +24,7 @@
@@ -57,7 +57,7 @@
diff --git a/docs/init.js.html b/docs/init.js.html
index 613333f3..7c72dea3 100644
--- a/docs/init.js.html
+++ b/docs/init.js.html
@@ -24,7 +24,7 @@
@@ -531,7 +531,7 @@ init.js
diff --git a/docs/lineplot.js.html b/docs/lineplot.js.html
index 03a2adb0..14254718 100644
--- a/docs/lineplot.js.html
+++ b/docs/lineplot.js.html
@@ -24,7 +24,7 @@
@@ -305,7 +305,7 @@ lineplot.js
diff --git a/docs/scatterplot.js.html b/docs/scatterplot.js.html
index 2e7aca1e..1fa53947 100644
--- a/docs/scatterplot.js.html
+++ b/docs/scatterplot.js.html
@@ -24,7 +24,7 @@
@@ -886,7 +886,7 @@ scatterplot.js
diff --git a/docs/segmented.js.html b/docs/segmented.js.html
index c6e5fa00..9a7c6124 100644
--- a/docs/segmented.js.html
+++ b/docs/segmented.js.html
@@ -24,7 +24,7 @@
@@ -377,7 +377,7 @@ segmented.js
(async) Source:
@@ -285,7 +285,7 @@ Create
Source:
@@ -370,7 +370,7 @@ GetDe
Source:
@@ -453,7 +453,7 @@ Pro
Source:
@@ -557,7 +557,7 @@ Reset
Source:
@@ -640,7 +640,7 @@ SetEventsSource:
@@ -723,7 +723,7 @@ ToggleSource:
@@ -878,7 +878,7 @@ fa
Source:
@@ -951,7 +951,7 @@ Returns:
diff --git a/docs/Constants.html b/docs/Constants.html
index 5113ddb3..c537d43d 100644
--- a/docs/Constants.html
+++ b/docs/Constants.html
@@ -24,7 +24,7 @@
@@ -181,7 +181,7 @@ Classes
diff --git a/docs/Constants_ConvertHexToRGBString.html b/docs/Constants_ConvertHexToRGBString.html
index 75394c72..9e0b772a 100644
--- a/docs/Constants_ConvertHexToRGBString.html
+++ b/docs/Constants_ConvertHexToRGBString.html
@@ -24,7 +24,7 @@
@@ -239,7 +239,7 @@ Returns:
diff --git a/docs/Constants_ConvertRGBStringToHex.html b/docs/Constants_ConvertRGBStringToHex.html
index 14d7556e..0fd4d71a 100644
--- a/docs/Constants_ConvertRGBStringToHex.html
+++ b/docs/Constants_ConvertRGBStringToHex.html
@@ -24,7 +24,7 @@
@@ -239,7 +239,7 @@ Returns:
diff --git a/docs/Constants_GetStyleArrayFromString.html b/docs/Constants_GetStyleArrayFromString.html
index ec0e3abc..85463d6e 100644
--- a/docs/Constants_GetStyleArrayFromString.html
+++ b/docs/Constants_GetStyleArrayFromString.html
@@ -24,7 +24,7 @@
@@ -239,7 +239,7 @@ Returns:
diff --git a/docs/Constants_GetStyleStringFromArray.html b/docs/Constants_GetStyleStringFromArray.html
index 8155f559..83bbc618 100644
--- a/docs/Constants_GetStyleStringFromArray.html
+++ b/docs/Constants_GetStyleStringFromArray.html
@@ -24,7 +24,7 @@
@@ -239,7 +239,7 @@ Returns:
diff --git a/docs/Control.html b/docs/Control.html
index 8606bfa0..c76ad6ab 100644
--- a/docs/Control.html
+++ b/docs/Control.html
@@ -24,7 +24,7 @@
@@ -344,7 +344,7 @@ Returns:
diff --git a/docs/Description.html b/docs/Description.html
index f28c4145..7143987a 100644
--- a/docs/Description.html
+++ b/docs/Description.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new Descri
Source:
@@ -200,7 +200,7 @@ Create
Source:
@@ -283,7 +283,7 @@ DestroySource:
@@ -366,7 +366,7 @@ PopulateD
Source:
@@ -449,7 +449,7 @@ ToggleSource:
@@ -573,7 +573,7 @@ Parameters:
diff --git a/docs/Display.html b/docs/Display.html
index 937f0efd..31600168 100644
--- a/docs/Display.html
+++ b/docs/Display.html
@@ -24,7 +24,7 @@
@@ -1575,7 +1575,7 @@ toggleT
diff --git a/docs/HeatMap.html b/docs/HeatMap.html
index 30b65009..8921f908 100644
--- a/docs/HeatMap.html
+++ b/docs/HeatMap.html
@@ -24,7 +24,7 @@
@@ -1493,7 +1493,7 @@ update
diff --git a/docs/HeatMapRect.html b/docs/HeatMapRect.html
index 2d32914e..97acbd2e 100644
--- a/docs/HeatMapRect.html
+++ b/docs/HeatMapRect.html
@@ -24,7 +24,7 @@
@@ -256,7 +256,7 @@ UpdateRect<
diff --git a/docs/Helper.html b/docs/Helper.html
index 33a4b8af..fa0ca485 100644
--- a/docs/Helper.html
+++ b/docs/Helper.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new HelperSource:
@@ -200,7 +200,7 @@ (static) Source:
@@ -355,7 +355,7 @@ Returns:
diff --git a/docs/Histogram.html b/docs/Histogram.html
index 8d05052c..cebf3417 100644
--- a/docs/Histogram.html
+++ b/docs/Histogram.html
@@ -24,7 +24,7 @@
@@ -422,7 +422,7 @@ SetMaxMin
diff --git a/docs/Layer0Point.html b/docs/Layer0Point.html
index c847ffe9..d7053be5 100644
--- a/docs/Layer0Point.html
+++ b/docs/Layer0Point.html
@@ -24,7 +24,7 @@
@@ -547,7 +547,7 @@ Returns:
diff --git a/docs/Layer1Point.html b/docs/Layer1Point.html
index 6ce2628e..4dd81951 100644
--- a/docs/Layer1Point.html
+++ b/docs/Layer1Point.html
@@ -24,7 +24,7 @@
@@ -547,7 +547,7 @@ Returns:
diff --git a/docs/LinePlot.html b/docs/LinePlot.html
index 37744fd7..e00b766f 100644
--- a/docs/LinePlot.html
+++ b/docs/LinePlot.html
@@ -24,7 +24,7 @@
@@ -725,7 +725,7 @@ Update
diff --git a/docs/LogError.html b/docs/LogError.html
index 9281b16a..b22a5497 100644
--- a/docs/LogError.html
+++ b/docs/LogError.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new LogError<
Source:
@@ -200,7 +200,7 @@ LogAb
Source:
@@ -335,7 +335,7 @@ Log
Source:
@@ -470,7 +470,7 @@ Lo
Source:
@@ -631,7 +631,7 @@ LogNotArra
Source:
@@ -766,7 +766,7 @@ Log
Source:
@@ -896,7 +896,7 @@ Parameters:
diff --git a/docs/Menu.html b/docs/Menu.html
index 0c418037..c21a5924 100644
--- a/docs/Menu.html
+++ b/docs/Menu.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new MenuSource:
@@ -201,7 +201,7 @@ CreateMenu<
Source:
@@ -285,7 +285,7 @@ Handl
Source:
@@ -368,7 +368,90 @@ Source:
-
- constants.js, line 844
+ constants.js, line 876
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ NotifyOfLLMReset()
+
+
+
+
+
+
+ Notifies the user that the LLM will be reset.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+
@@ -451,7 +534,7 @@ PopulateD
- Source:
@@ -534,7 +617,7 @@ SaveDataSource:
@@ -617,7 +700,7 @@ ToggleSource:
@@ -741,7 +824,7 @@ Parameters:
diff --git a/docs/Point.html b/docs/Point.html
index e9903cb5..af8388c0 100644
--- a/docs/Point.html
+++ b/docs/Point.html
@@ -24,7 +24,7 @@
@@ -547,7 +547,7 @@ Returns:
diff --git a/docs/Position.html b/docs/Position.html
index be3a8f17..0e66ba43 100644
--- a/docs/Position.html
+++ b/docs/Position.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new Position<
- Source:
@@ -165,7 +165,7 @@ new Position<
diff --git a/docs/Resources.html b/docs/Resources.html
index 6ec6de01..70b507b6 100644
--- a/docs/Resources.html
+++ b/docs/Resources.html
@@ -24,7 +24,7 @@
@@ -200,7 +200,7 @@ GetStringSource:
@@ -329,7 +329,7 @@ Returns:
diff --git a/docs/Review.html b/docs/Review.html
index 9d2226b2..1f476b4e 100644
--- a/docs/Review.html
+++ b/docs/Review.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new ReviewSource:
@@ -200,7 +200,7 @@ Toggl
- Source:
@@ -324,7 +324,7 @@ Parameters:
diff --git a/docs/ScatterPlot.html b/docs/ScatterPlot.html
index 544da78b..5cead09d 100644
--- a/docs/ScatterPlot.html
+++ b/docs/ScatterPlot.html
@@ -24,7 +24,7 @@
@@ -1427,7 +1427,7 @@ SetLineLa
diff --git a/docs/Segmented.html b/docs/Segmented.html
index ce786aee..4824dd59 100644
--- a/docs/Segmented.html
+++ b/docs/Segmented.html
@@ -24,7 +24,7 @@
@@ -892,7 +892,7 @@ UnSel
diff --git a/docs/Tracker.html b/docs/Tracker.html
index dea73e14..e590510b 100644
--- a/docs/Tracker.html
+++ b/docs/Tracker.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new TrackerSource:
@@ -200,7 +200,7 @@ DataSetupSource:
@@ -283,7 +283,7 @@ DeleteSource:
@@ -366,7 +366,7 @@ Do
- Source:
@@ -449,7 +449,7 @@ GetTrac
- Source:
@@ -557,7 +557,7 @@ LogEventSource:
@@ -692,7 +692,7 @@ SaveTr
- Source:
@@ -827,7 +827,7 @@ isUn
- Source:
@@ -956,7 +956,7 @@ Returns:
diff --git a/docs/audio.js.html b/docs/audio.js.html
index 4fc80eab..b00c498a 100644
--- a/docs/audio.js.html
+++ b/docs/audio.js.html
@@ -24,7 +24,7 @@
@@ -638,7 +638,7 @@ audio.js
diff --git a/docs/barplot.js.html b/docs/barplot.js.html
index bf935fe2..aa9fffe5 100644
--- a/docs/barplot.js.html
+++ b/docs/barplot.js.html
@@ -24,7 +24,7 @@
@@ -372,7 +372,7 @@ barplot.js
diff --git a/docs/boxplot.js.html b/docs/boxplot.js.html
index 4bdb587f..4cc26111 100644
--- a/docs/boxplot.js.html
+++ b/docs/boxplot.js.html
@@ -24,7 +24,7 @@
@@ -796,7 +796,7 @@ boxplot.js
diff --git a/docs/constants.js.html b/docs/constants.js.html
index 591d73d7..32d8bacc 100644
--- a/docs/constants.js.html
+++ b/docs/constants.js.html
@@ -24,7 +24,7 @@
@@ -314,6 +314,7 @@ constants.js
openai: 'OpenAI Vision',
gemini: 'Gemini Pro Vision',
multi: 'Multiple AI',
+ processing: 'Processing Chart...',
},
},
};
@@ -484,7 +485,7 @@ constants.js
</div>
</div>
<div class="modal-footer">
- <button type="button" id="save_and_close_menu">Save and Close</button>
+ <button type="button" id="save_and_close_menu" aria-labelledby="save_and_close_text"><span id="save_and_close_text">Save and Close</span></button>
<button type="button" id="close_menu">Close</button>
</div>
</div>
@@ -620,6 +621,16 @@ constants.js
}
},
]);
+
+ // trigger notification that LLM will be reset
+ // this is done on change of LLM model, multi settings, or skill level
+ constants.events.push([
+ document.getElementById('LLM_model'),
+ 'change',
+ function (e) {
+ menu.NotifyOfLLMReset();
+ },
+ ]);
}
/**
@@ -761,6 +772,9 @@ constants.js
document.getElementById('LLM_preferences').value =
constants.LLMPreferences;
}
+ if (document.getElementById('LLM_reset_notification')) {
+ document.getElementById('LLM_reset_notification').remove();
+ }
}
/**
@@ -818,6 +832,24 @@ constants.js
.setAttribute('aria-live', constants.ariaMode);
}
+ /**
+ * Notifies the user that the LLM will be reset.
+ */
+ NotifyOfLLMReset() {
+ let html =
+ '<p id="LLM_reset_notification">Note: Changes in LLM settings will reset any existing conversation.</p>';
+ document
+ .getElementById('save_and_close_menu')
+ .insertAdjacentHTML('beforebegin', html);
+
+ // add to aria button text
+ document
+ .getElementById('save_and_close_menu')
+ .setAttribute(
+ 'aria-labelledby',
+ 'save_and_close_text LLM_reset_notification'
+ );
+ }
/**
* Handles changes to the LLM model and multi-modal settings.
* We reset if we change the LLM model, multi settings, or skill level.
@@ -936,8 +968,11 @@ constants.js
</button>
</div>
<div class="modal-body">
+ <div id="chatLLM_chat_history_wrapper">
<div id="chatLLM_chat_history" aria-live="${constants.ariaMode}" aria-relevant="additions">
</div>
+ <p id="chatLLM_copy_all_wrapper"><button id="chatLLM_copy_all">Copy all to clipboard</button></p>
+ </div>
<div id="chatLLM_content">
<p><input type="text" id="chatLLM_input" class="form-control" name="chatLLM_input" aria-labelledby="chatLLM_title" size="50"></p>
<div class="LLM_suggestions">
@@ -1079,10 +1114,41 @@ constants.js
document.getElementById('reset_chatLLM'),
'click',
function (e) {
- chatLLM.Toggle(false);
chatLLM.ResetChatHistory();
},
]);
+
+ // copy to clipboard
+ constants.events.push([
+ document.getElementById('chatLLM_copy_all'),
+ 'click',
+ function (e) {
+ let text = document.getElementById('chatLLM_chat_history').innerText;
+ // need newlines instead of paragraphs headings etc
+ text = text.replace(/<p>/g, '\n').replace(/<\/p>/g, '\n');
+ text = text.replace(/<h\d>/g, '\n').replace(/<\/h\d>/g, '\n');
+ text = text.replace(/<.*?>/g, '');
+
+ navigator.clipboard.writeText(text);
+ },
+ ]);
+ constants.events.push([
+ document.getElementById('chatLLM_chat_history'),
+ 'click',
+ function (e) {
+ // we're delegating here, so set the event on child .chatLLM_message_copy_button
+ if (e.target.matches('.chatLLM_message_copy_button')) {
+ // get the innerText of the element before the button
+ let text = e.target.closest('p').previousElementSibling.innerText;
+ // need newlines instead of paragraphs headings etc
+ text = text.replace(/<p>/g, '\n').replace(/<\/p>/g, '\n');
+ text = text.replace(/<h\d>/g, '\n').replace(/<\/h\d>/g, '\n');
+ text = text.replace(/<.*?>/g, '');
+
+ navigator.clipboard.writeText(text);
+ }
+ },
+ ]);
}
/**
@@ -1163,7 +1229,7 @@ constants.js
*/
ProcessLLMResponse(data, model) {
chatLLM.WaitingSound(false);
- console.log('LLM response: ', data);
+ //console.log('LLM response: ', data);
let text = '';
let LLMName = resources.GetString(model);
@@ -1367,9 +1433,9 @@ constants.js
};
// Generate the content
- console.log('LLM request: ', prompt, image);
+ //console.log('LLM request: ', prompt, image);
const result = await model.generateContent([prompt, image]);
- console.log(result.response.text());
+ //console.log(result.response.text());
// Process the response
chatLLM.ProcessLLMResponse(result.response, 'gemini');
@@ -1409,6 +1475,12 @@ constants.js
<p class="chatLLM_message_text">${text}</p>
</div>
`;
+ // add a copy button to actual messages
+ if (user != 'User' && text != resources.GetString('processing')) {
+ html += `
+ <p class="chatLLM_message_copy"><button class="chatLLM_message_copy_button">Copy</button></p>
+ `;
+ }
this.RenderChatMessage(html);
}
@@ -1486,7 +1558,11 @@ constants.js
// get name from resource
let LLMName = resources.GetString(constants.LLMModel);
this.firstTime = false;
- this.DisplayChatMessage(LLMName, 'Processing Chart...', true);
+ this.DisplayChatMessage(
+ LLMName,
+ resources.GetString('processing'),
+ true
+ );
let defaultPrompt = this.GetDefaultPrompt();
this.Submit(defaultPrompt, true);
}
@@ -2282,7 +2358,7 @@ constants.js
diff --git a/docs/controls.js.html b/docs/controls.js.html
index fb8a89b4..3fbf1e2e 100644
--- a/docs/controls.js.html
+++ b/docs/controls.js.html
@@ -24,7 +24,7 @@
@@ -3268,7 +3268,7 @@ controls.js
diff --git a/docs/display.js.html b/docs/display.js.html
index a4ee9c53..1f9acd2b 100644
--- a/docs/display.js.html
+++ b/docs/display.js.html
@@ -24,7 +24,7 @@
@@ -1256,7 +1256,7 @@ display.js
diff --git a/docs/global.html b/docs/global.html
index 05f0215f..f8d03800 100644
--- a/docs/global.html
+++ b/docs/global.html
@@ -24,7 +24,7 @@
@@ -1141,7 +1141,7 @@ Parameters:
diff --git a/docs/heatmap.js.html b/docs/heatmap.js.html
index 1d6889a9..9d586522 100644
--- a/docs/heatmap.js.html
+++ b/docs/heatmap.js.html
@@ -24,7 +24,7 @@
@@ -452,7 +452,7 @@ heatmap.js
diff --git a/docs/histogram.js.html b/docs/histogram.js.html
index 86072184..6b459dcd 100644
--- a/docs/histogram.js.html
+++ b/docs/histogram.js.html
@@ -24,7 +24,7 @@
@@ -247,7 +247,7 @@ histogram.js
diff --git a/docs/index.html b/docs/index.html
index a84a0904..008cca1c 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -24,7 +24,7 @@
@@ -57,7 +57,7 @@
diff --git a/docs/init.js.html b/docs/init.js.html
index 613333f3..7c72dea3 100644
--- a/docs/init.js.html
+++ b/docs/init.js.html
@@ -24,7 +24,7 @@
@@ -531,7 +531,7 @@ init.js
diff --git a/docs/lineplot.js.html b/docs/lineplot.js.html
index 03a2adb0..14254718 100644
--- a/docs/lineplot.js.html
+++ b/docs/lineplot.js.html
@@ -24,7 +24,7 @@
@@ -305,7 +305,7 @@ lineplot.js
diff --git a/docs/scatterplot.js.html b/docs/scatterplot.js.html
index 2e7aca1e..1fa53947 100644
--- a/docs/scatterplot.js.html
+++ b/docs/scatterplot.js.html
@@ -24,7 +24,7 @@
@@ -886,7 +886,7 @@ scatterplot.js
diff --git a/docs/segmented.js.html b/docs/segmented.js.html
index c6e5fa00..9a7c6124 100644
--- a/docs/segmented.js.html
+++ b/docs/segmented.js.html
@@ -24,7 +24,7 @@
@@ -377,7 +377,7 @@ segmented.js
GetDe
Source:
@@ -453,7 +453,7 @@ Pro
Source:
@@ -557,7 +557,7 @@ Reset
Source:
@@ -640,7 +640,7 @@ SetEventsSource:
@@ -723,7 +723,7 @@ ToggleSource:
@@ -878,7 +878,7 @@ fa
Source:
@@ -951,7 +951,7 @@ Returns:
diff --git a/docs/Constants.html b/docs/Constants.html
index 5113ddb3..c537d43d 100644
--- a/docs/Constants.html
+++ b/docs/Constants.html
@@ -24,7 +24,7 @@
@@ -181,7 +181,7 @@ Classes
diff --git a/docs/Constants_ConvertHexToRGBString.html b/docs/Constants_ConvertHexToRGBString.html
index 75394c72..9e0b772a 100644
--- a/docs/Constants_ConvertHexToRGBString.html
+++ b/docs/Constants_ConvertHexToRGBString.html
@@ -24,7 +24,7 @@
@@ -239,7 +239,7 @@ Returns:
diff --git a/docs/Constants_ConvertRGBStringToHex.html b/docs/Constants_ConvertRGBStringToHex.html
index 14d7556e..0fd4d71a 100644
--- a/docs/Constants_ConvertRGBStringToHex.html
+++ b/docs/Constants_ConvertRGBStringToHex.html
@@ -24,7 +24,7 @@
@@ -239,7 +239,7 @@ Returns:
diff --git a/docs/Constants_GetStyleArrayFromString.html b/docs/Constants_GetStyleArrayFromString.html
index ec0e3abc..85463d6e 100644
--- a/docs/Constants_GetStyleArrayFromString.html
+++ b/docs/Constants_GetStyleArrayFromString.html
@@ -24,7 +24,7 @@
@@ -239,7 +239,7 @@ Returns:
diff --git a/docs/Constants_GetStyleStringFromArray.html b/docs/Constants_GetStyleStringFromArray.html
index 8155f559..83bbc618 100644
--- a/docs/Constants_GetStyleStringFromArray.html
+++ b/docs/Constants_GetStyleStringFromArray.html
@@ -24,7 +24,7 @@
@@ -239,7 +239,7 @@ Returns:
diff --git a/docs/Control.html b/docs/Control.html
index 8606bfa0..c76ad6ab 100644
--- a/docs/Control.html
+++ b/docs/Control.html
@@ -24,7 +24,7 @@
@@ -344,7 +344,7 @@ Returns:
diff --git a/docs/Description.html b/docs/Description.html
index f28c4145..7143987a 100644
--- a/docs/Description.html
+++ b/docs/Description.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new Descri
Source:
@@ -200,7 +200,7 @@ Create
Source:
@@ -283,7 +283,7 @@ DestroySource:
@@ -366,7 +366,7 @@ PopulateD
Source:
@@ -449,7 +449,7 @@ ToggleSource:
@@ -573,7 +573,7 @@ Parameters:
diff --git a/docs/Display.html b/docs/Display.html
index 937f0efd..31600168 100644
--- a/docs/Display.html
+++ b/docs/Display.html
@@ -24,7 +24,7 @@
@@ -1575,7 +1575,7 @@ toggleT
diff --git a/docs/HeatMap.html b/docs/HeatMap.html
index 30b65009..8921f908 100644
--- a/docs/HeatMap.html
+++ b/docs/HeatMap.html
@@ -24,7 +24,7 @@
@@ -1493,7 +1493,7 @@ update
diff --git a/docs/HeatMapRect.html b/docs/HeatMapRect.html
index 2d32914e..97acbd2e 100644
--- a/docs/HeatMapRect.html
+++ b/docs/HeatMapRect.html
@@ -24,7 +24,7 @@
@@ -256,7 +256,7 @@ UpdateRect<
diff --git a/docs/Helper.html b/docs/Helper.html
index 33a4b8af..fa0ca485 100644
--- a/docs/Helper.html
+++ b/docs/Helper.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new HelperSource:
@@ -200,7 +200,7 @@ (static) Source:
@@ -355,7 +355,7 @@ Returns:
diff --git a/docs/Histogram.html b/docs/Histogram.html
index 8d05052c..cebf3417 100644
--- a/docs/Histogram.html
+++ b/docs/Histogram.html
@@ -24,7 +24,7 @@
@@ -422,7 +422,7 @@ SetMaxMin
diff --git a/docs/Layer0Point.html b/docs/Layer0Point.html
index c847ffe9..d7053be5 100644
--- a/docs/Layer0Point.html
+++ b/docs/Layer0Point.html
@@ -24,7 +24,7 @@
@@ -547,7 +547,7 @@ Returns:
diff --git a/docs/Layer1Point.html b/docs/Layer1Point.html
index 6ce2628e..4dd81951 100644
--- a/docs/Layer1Point.html
+++ b/docs/Layer1Point.html
@@ -24,7 +24,7 @@
@@ -547,7 +547,7 @@ Returns:
diff --git a/docs/LinePlot.html b/docs/LinePlot.html
index 37744fd7..e00b766f 100644
--- a/docs/LinePlot.html
+++ b/docs/LinePlot.html
@@ -24,7 +24,7 @@
@@ -725,7 +725,7 @@ Update
diff --git a/docs/LogError.html b/docs/LogError.html
index 9281b16a..b22a5497 100644
--- a/docs/LogError.html
+++ b/docs/LogError.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new LogError<
Source:
@@ -200,7 +200,7 @@ LogAb
Source:
@@ -335,7 +335,7 @@ Log
Source:
@@ -470,7 +470,7 @@ Lo
Source:
@@ -631,7 +631,7 @@ LogNotArra
Source:
@@ -766,7 +766,7 @@ Log
Source:
@@ -896,7 +896,7 @@ Parameters:
diff --git a/docs/Menu.html b/docs/Menu.html
index 0c418037..c21a5924 100644
--- a/docs/Menu.html
+++ b/docs/Menu.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new MenuSource:
@@ -201,7 +201,7 @@ CreateMenu<
Source:
@@ -285,7 +285,7 @@ Handl
Source:
@@ -368,7 +368,90 @@ Source:
-
- constants.js, line 844
+ constants.js, line 876
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ NotifyOfLLMReset()
+
+
+
+
+
+
+ Notifies the user that the LLM will be reset.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+
@@ -451,7 +534,7 @@ PopulateD
- Source:
@@ -534,7 +617,7 @@ SaveDataSource:
@@ -617,7 +700,7 @@ ToggleSource:
@@ -741,7 +824,7 @@ Parameters:
diff --git a/docs/Point.html b/docs/Point.html
index e9903cb5..af8388c0 100644
--- a/docs/Point.html
+++ b/docs/Point.html
@@ -24,7 +24,7 @@
@@ -547,7 +547,7 @@ Returns:
diff --git a/docs/Position.html b/docs/Position.html
index be3a8f17..0e66ba43 100644
--- a/docs/Position.html
+++ b/docs/Position.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new Position<
- Source:
@@ -165,7 +165,7 @@ new Position<
diff --git a/docs/Resources.html b/docs/Resources.html
index 6ec6de01..70b507b6 100644
--- a/docs/Resources.html
+++ b/docs/Resources.html
@@ -24,7 +24,7 @@
@@ -200,7 +200,7 @@ GetStringSource:
@@ -329,7 +329,7 @@ Returns:
diff --git a/docs/Review.html b/docs/Review.html
index 9d2226b2..1f476b4e 100644
--- a/docs/Review.html
+++ b/docs/Review.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new ReviewSource:
@@ -200,7 +200,7 @@ Toggl
- Source:
@@ -324,7 +324,7 @@ Parameters:
diff --git a/docs/ScatterPlot.html b/docs/ScatterPlot.html
index 544da78b..5cead09d 100644
--- a/docs/ScatterPlot.html
+++ b/docs/ScatterPlot.html
@@ -24,7 +24,7 @@
@@ -1427,7 +1427,7 @@ SetLineLa
diff --git a/docs/Segmented.html b/docs/Segmented.html
index ce786aee..4824dd59 100644
--- a/docs/Segmented.html
+++ b/docs/Segmented.html
@@ -24,7 +24,7 @@
@@ -892,7 +892,7 @@ UnSel
diff --git a/docs/Tracker.html b/docs/Tracker.html
index dea73e14..e590510b 100644
--- a/docs/Tracker.html
+++ b/docs/Tracker.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new TrackerSource:
@@ -200,7 +200,7 @@ DataSetupSource:
@@ -283,7 +283,7 @@ DeleteSource:
@@ -366,7 +366,7 @@ Do
- Source:
@@ -449,7 +449,7 @@ GetTrac
- Source:
@@ -557,7 +557,7 @@ LogEventSource:
@@ -692,7 +692,7 @@ SaveTr
- Source:
@@ -827,7 +827,7 @@ isUn
- Source:
@@ -956,7 +956,7 @@ Returns:
diff --git a/docs/audio.js.html b/docs/audio.js.html
index 4fc80eab..b00c498a 100644
--- a/docs/audio.js.html
+++ b/docs/audio.js.html
@@ -24,7 +24,7 @@
@@ -638,7 +638,7 @@ audio.js
diff --git a/docs/barplot.js.html b/docs/barplot.js.html
index bf935fe2..aa9fffe5 100644
--- a/docs/barplot.js.html
+++ b/docs/barplot.js.html
@@ -24,7 +24,7 @@
@@ -372,7 +372,7 @@ barplot.js
diff --git a/docs/boxplot.js.html b/docs/boxplot.js.html
index 4bdb587f..4cc26111 100644
--- a/docs/boxplot.js.html
+++ b/docs/boxplot.js.html
@@ -24,7 +24,7 @@
@@ -796,7 +796,7 @@ boxplot.js
diff --git a/docs/constants.js.html b/docs/constants.js.html
index 591d73d7..32d8bacc 100644
--- a/docs/constants.js.html
+++ b/docs/constants.js.html
@@ -24,7 +24,7 @@
@@ -314,6 +314,7 @@ constants.js
openai: 'OpenAI Vision',
gemini: 'Gemini Pro Vision',
multi: 'Multiple AI',
+ processing: 'Processing Chart...',
},
},
};
@@ -484,7 +485,7 @@ constants.js
</div>
</div>
<div class="modal-footer">
- <button type="button" id="save_and_close_menu">Save and Close</button>
+ <button type="button" id="save_and_close_menu" aria-labelledby="save_and_close_text"><span id="save_and_close_text">Save and Close</span></button>
<button type="button" id="close_menu">Close</button>
</div>
</div>
@@ -620,6 +621,16 @@ constants.js
}
},
]);
+
+ // trigger notification that LLM will be reset
+ // this is done on change of LLM model, multi settings, or skill level
+ constants.events.push([
+ document.getElementById('LLM_model'),
+ 'change',
+ function (e) {
+ menu.NotifyOfLLMReset();
+ },
+ ]);
}
/**
@@ -761,6 +772,9 @@ constants.js
document.getElementById('LLM_preferences').value =
constants.LLMPreferences;
}
+ if (document.getElementById('LLM_reset_notification')) {
+ document.getElementById('LLM_reset_notification').remove();
+ }
}
/**
@@ -818,6 +832,24 @@ constants.js
.setAttribute('aria-live', constants.ariaMode);
}
+ /**
+ * Notifies the user that the LLM will be reset.
+ */
+ NotifyOfLLMReset() {
+ let html =
+ '<p id="LLM_reset_notification">Note: Changes in LLM settings will reset any existing conversation.</p>';
+ document
+ .getElementById('save_and_close_menu')
+ .insertAdjacentHTML('beforebegin', html);
+
+ // add to aria button text
+ document
+ .getElementById('save_and_close_menu')
+ .setAttribute(
+ 'aria-labelledby',
+ 'save_and_close_text LLM_reset_notification'
+ );
+ }
/**
* Handles changes to the LLM model and multi-modal settings.
* We reset if we change the LLM model, multi settings, or skill level.
@@ -936,8 +968,11 @@ constants.js
</button>
</div>
<div class="modal-body">
+ <div id="chatLLM_chat_history_wrapper">
<div id="chatLLM_chat_history" aria-live="${constants.ariaMode}" aria-relevant="additions">
</div>
+ <p id="chatLLM_copy_all_wrapper"><button id="chatLLM_copy_all">Copy all to clipboard</button></p>
+ </div>
<div id="chatLLM_content">
<p><input type="text" id="chatLLM_input" class="form-control" name="chatLLM_input" aria-labelledby="chatLLM_title" size="50"></p>
<div class="LLM_suggestions">
@@ -1079,10 +1114,41 @@ constants.js
document.getElementById('reset_chatLLM'),
'click',
function (e) {
- chatLLM.Toggle(false);
chatLLM.ResetChatHistory();
},
]);
+
+ // copy to clipboard
+ constants.events.push([
+ document.getElementById('chatLLM_copy_all'),
+ 'click',
+ function (e) {
+ let text = document.getElementById('chatLLM_chat_history').innerText;
+ // need newlines instead of paragraphs headings etc
+ text = text.replace(/<p>/g, '\n').replace(/<\/p>/g, '\n');
+ text = text.replace(/<h\d>/g, '\n').replace(/<\/h\d>/g, '\n');
+ text = text.replace(/<.*?>/g, '');
+
+ navigator.clipboard.writeText(text);
+ },
+ ]);
+ constants.events.push([
+ document.getElementById('chatLLM_chat_history'),
+ 'click',
+ function (e) {
+ // we're delegating here, so set the event on child .chatLLM_message_copy_button
+ if (e.target.matches('.chatLLM_message_copy_button')) {
+ // get the innerText of the element before the button
+ let text = e.target.closest('p').previousElementSibling.innerText;
+ // need newlines instead of paragraphs headings etc
+ text = text.replace(/<p>/g, '\n').replace(/<\/p>/g, '\n');
+ text = text.replace(/<h\d>/g, '\n').replace(/<\/h\d>/g, '\n');
+ text = text.replace(/<.*?>/g, '');
+
+ navigator.clipboard.writeText(text);
+ }
+ },
+ ]);
}
/**
@@ -1163,7 +1229,7 @@ constants.js
*/
ProcessLLMResponse(data, model) {
chatLLM.WaitingSound(false);
- console.log('LLM response: ', data);
+ //console.log('LLM response: ', data);
let text = '';
let LLMName = resources.GetString(model);
@@ -1367,9 +1433,9 @@ constants.js
};
// Generate the content
- console.log('LLM request: ', prompt, image);
+ //console.log('LLM request: ', prompt, image);
const result = await model.generateContent([prompt, image]);
- console.log(result.response.text());
+ //console.log(result.response.text());
// Process the response
chatLLM.ProcessLLMResponse(result.response, 'gemini');
@@ -1409,6 +1475,12 @@ constants.js
<p class="chatLLM_message_text">${text}</p>
</div>
`;
+ // add a copy button to actual messages
+ if (user != 'User' && text != resources.GetString('processing')) {
+ html += `
+ <p class="chatLLM_message_copy"><button class="chatLLM_message_copy_button">Copy</button></p>
+ `;
+ }
this.RenderChatMessage(html);
}
@@ -1486,7 +1558,11 @@ constants.js
// get name from resource
let LLMName = resources.GetString(constants.LLMModel);
this.firstTime = false;
- this.DisplayChatMessage(LLMName, 'Processing Chart...', true);
+ this.DisplayChatMessage(
+ LLMName,
+ resources.GetString('processing'),
+ true
+ );
let defaultPrompt = this.GetDefaultPrompt();
this.Submit(defaultPrompt, true);
}
@@ -2282,7 +2358,7 @@ constants.js
diff --git a/docs/controls.js.html b/docs/controls.js.html
index fb8a89b4..3fbf1e2e 100644
--- a/docs/controls.js.html
+++ b/docs/controls.js.html
@@ -24,7 +24,7 @@
@@ -3268,7 +3268,7 @@ controls.js
diff --git a/docs/display.js.html b/docs/display.js.html
index a4ee9c53..1f9acd2b 100644
--- a/docs/display.js.html
+++ b/docs/display.js.html
@@ -24,7 +24,7 @@
@@ -1256,7 +1256,7 @@ display.js
diff --git a/docs/global.html b/docs/global.html
index 05f0215f..f8d03800 100644
--- a/docs/global.html
+++ b/docs/global.html
@@ -24,7 +24,7 @@
@@ -1141,7 +1141,7 @@ Parameters:
diff --git a/docs/heatmap.js.html b/docs/heatmap.js.html
index 1d6889a9..9d586522 100644
--- a/docs/heatmap.js.html
+++ b/docs/heatmap.js.html
@@ -24,7 +24,7 @@
@@ -452,7 +452,7 @@ heatmap.js
diff --git a/docs/histogram.js.html b/docs/histogram.js.html
index 86072184..6b459dcd 100644
--- a/docs/histogram.js.html
+++ b/docs/histogram.js.html
@@ -24,7 +24,7 @@
@@ -247,7 +247,7 @@ histogram.js
diff --git a/docs/index.html b/docs/index.html
index a84a0904..008cca1c 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -24,7 +24,7 @@
@@ -57,7 +57,7 @@
diff --git a/docs/init.js.html b/docs/init.js.html
index 613333f3..7c72dea3 100644
--- a/docs/init.js.html
+++ b/docs/init.js.html
@@ -24,7 +24,7 @@
@@ -531,7 +531,7 @@ init.js
diff --git a/docs/lineplot.js.html b/docs/lineplot.js.html
index 03a2adb0..14254718 100644
--- a/docs/lineplot.js.html
+++ b/docs/lineplot.js.html
@@ -24,7 +24,7 @@
@@ -305,7 +305,7 @@ lineplot.js
diff --git a/docs/scatterplot.js.html b/docs/scatterplot.js.html
index 2e7aca1e..1fa53947 100644
--- a/docs/scatterplot.js.html
+++ b/docs/scatterplot.js.html
@@ -24,7 +24,7 @@
@@ -886,7 +886,7 @@ scatterplot.js
diff --git a/docs/segmented.js.html b/docs/segmented.js.html
index c6e5fa00..9a7c6124 100644
--- a/docs/segmented.js.html
+++ b/docs/segmented.js.html
@@ -24,7 +24,7 @@
@@ -377,7 +377,7 @@ segmented.js
Reset
Source:
@@ -640,7 +640,7 @@ SetEventsSource:
@@ -723,7 +723,7 @@ ToggleSource:
@@ -878,7 +878,7 @@ fa
Source:
@@ -951,7 +951,7 @@ Returns:
diff --git a/docs/Constants.html b/docs/Constants.html
index 5113ddb3..c537d43d 100644
--- a/docs/Constants.html
+++ b/docs/Constants.html
@@ -24,7 +24,7 @@
@@ -181,7 +181,7 @@ Classes
diff --git a/docs/Constants_ConvertHexToRGBString.html b/docs/Constants_ConvertHexToRGBString.html
index 75394c72..9e0b772a 100644
--- a/docs/Constants_ConvertHexToRGBString.html
+++ b/docs/Constants_ConvertHexToRGBString.html
@@ -24,7 +24,7 @@
@@ -239,7 +239,7 @@ Returns:
diff --git a/docs/Constants_ConvertRGBStringToHex.html b/docs/Constants_ConvertRGBStringToHex.html
index 14d7556e..0fd4d71a 100644
--- a/docs/Constants_ConvertRGBStringToHex.html
+++ b/docs/Constants_ConvertRGBStringToHex.html
@@ -24,7 +24,7 @@
@@ -239,7 +239,7 @@ Returns:
diff --git a/docs/Constants_GetStyleArrayFromString.html b/docs/Constants_GetStyleArrayFromString.html
index ec0e3abc..85463d6e 100644
--- a/docs/Constants_GetStyleArrayFromString.html
+++ b/docs/Constants_GetStyleArrayFromString.html
@@ -24,7 +24,7 @@
@@ -239,7 +239,7 @@ Returns:
diff --git a/docs/Constants_GetStyleStringFromArray.html b/docs/Constants_GetStyleStringFromArray.html
index 8155f559..83bbc618 100644
--- a/docs/Constants_GetStyleStringFromArray.html
+++ b/docs/Constants_GetStyleStringFromArray.html
@@ -24,7 +24,7 @@
@@ -239,7 +239,7 @@ Returns:
diff --git a/docs/Control.html b/docs/Control.html
index 8606bfa0..c76ad6ab 100644
--- a/docs/Control.html
+++ b/docs/Control.html
@@ -24,7 +24,7 @@
@@ -344,7 +344,7 @@ Returns:
diff --git a/docs/Description.html b/docs/Description.html
index f28c4145..7143987a 100644
--- a/docs/Description.html
+++ b/docs/Description.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new Descri
Source:
@@ -200,7 +200,7 @@ Create
Source:
@@ -283,7 +283,7 @@ DestroySource:
@@ -366,7 +366,7 @@ PopulateD
Source:
@@ -449,7 +449,7 @@ ToggleSource:
@@ -573,7 +573,7 @@ Parameters:
diff --git a/docs/Display.html b/docs/Display.html
index 937f0efd..31600168 100644
--- a/docs/Display.html
+++ b/docs/Display.html
@@ -24,7 +24,7 @@
@@ -1575,7 +1575,7 @@ toggleT
diff --git a/docs/HeatMap.html b/docs/HeatMap.html
index 30b65009..8921f908 100644
--- a/docs/HeatMap.html
+++ b/docs/HeatMap.html
@@ -24,7 +24,7 @@
@@ -1493,7 +1493,7 @@ update
diff --git a/docs/HeatMapRect.html b/docs/HeatMapRect.html
index 2d32914e..97acbd2e 100644
--- a/docs/HeatMapRect.html
+++ b/docs/HeatMapRect.html
@@ -24,7 +24,7 @@
@@ -256,7 +256,7 @@ UpdateRect<
diff --git a/docs/Helper.html b/docs/Helper.html
index 33a4b8af..fa0ca485 100644
--- a/docs/Helper.html
+++ b/docs/Helper.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new HelperSource:
@@ -200,7 +200,7 @@ (static) Source:
@@ -355,7 +355,7 @@ Returns:
diff --git a/docs/Histogram.html b/docs/Histogram.html
index 8d05052c..cebf3417 100644
--- a/docs/Histogram.html
+++ b/docs/Histogram.html
@@ -24,7 +24,7 @@
@@ -422,7 +422,7 @@ SetMaxMin
diff --git a/docs/Layer0Point.html b/docs/Layer0Point.html
index c847ffe9..d7053be5 100644
--- a/docs/Layer0Point.html
+++ b/docs/Layer0Point.html
@@ -24,7 +24,7 @@
@@ -547,7 +547,7 @@ Returns:
diff --git a/docs/Layer1Point.html b/docs/Layer1Point.html
index 6ce2628e..4dd81951 100644
--- a/docs/Layer1Point.html
+++ b/docs/Layer1Point.html
@@ -24,7 +24,7 @@
@@ -547,7 +547,7 @@ Returns:
diff --git a/docs/LinePlot.html b/docs/LinePlot.html
index 37744fd7..e00b766f 100644
--- a/docs/LinePlot.html
+++ b/docs/LinePlot.html
@@ -24,7 +24,7 @@
@@ -725,7 +725,7 @@ Update
diff --git a/docs/LogError.html b/docs/LogError.html
index 9281b16a..b22a5497 100644
--- a/docs/LogError.html
+++ b/docs/LogError.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new LogError<
Source:
@@ -200,7 +200,7 @@ LogAb
Source:
@@ -335,7 +335,7 @@ Log
Source:
@@ -470,7 +470,7 @@ Lo
Source:
@@ -631,7 +631,7 @@ LogNotArra
Source:
@@ -766,7 +766,7 @@ Log
Source:
@@ -896,7 +896,7 @@ Parameters:
diff --git a/docs/Menu.html b/docs/Menu.html
index 0c418037..c21a5924 100644
--- a/docs/Menu.html
+++ b/docs/Menu.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new MenuSource:
@@ -201,7 +201,7 @@ CreateMenu<
Source:
@@ -285,7 +285,7 @@ Handl
Source:
@@ -368,7 +368,90 @@ Source:
-
- constants.js, line 844
+ constants.js, line 876
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ NotifyOfLLMReset()
+
+
+
+
+
+
+ Notifies the user that the LLM will be reset.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+
@@ -451,7 +534,7 @@ PopulateD
- Source:
@@ -534,7 +617,7 @@ SaveDataSource:
@@ -617,7 +700,7 @@ ToggleSource:
@@ -741,7 +824,7 @@ Parameters:
diff --git a/docs/Point.html b/docs/Point.html
index e9903cb5..af8388c0 100644
--- a/docs/Point.html
+++ b/docs/Point.html
@@ -24,7 +24,7 @@
@@ -547,7 +547,7 @@ Returns:
diff --git a/docs/Position.html b/docs/Position.html
index be3a8f17..0e66ba43 100644
--- a/docs/Position.html
+++ b/docs/Position.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new Position<
- Source:
@@ -165,7 +165,7 @@ new Position<
diff --git a/docs/Resources.html b/docs/Resources.html
index 6ec6de01..70b507b6 100644
--- a/docs/Resources.html
+++ b/docs/Resources.html
@@ -24,7 +24,7 @@
@@ -200,7 +200,7 @@ GetStringSource:
@@ -329,7 +329,7 @@ Returns:
diff --git a/docs/Review.html b/docs/Review.html
index 9d2226b2..1f476b4e 100644
--- a/docs/Review.html
+++ b/docs/Review.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new ReviewSource:
@@ -200,7 +200,7 @@ Toggl
- Source:
@@ -324,7 +324,7 @@ Parameters:
diff --git a/docs/ScatterPlot.html b/docs/ScatterPlot.html
index 544da78b..5cead09d 100644
--- a/docs/ScatterPlot.html
+++ b/docs/ScatterPlot.html
@@ -24,7 +24,7 @@
@@ -1427,7 +1427,7 @@ SetLineLa
diff --git a/docs/Segmented.html b/docs/Segmented.html
index ce786aee..4824dd59 100644
--- a/docs/Segmented.html
+++ b/docs/Segmented.html
@@ -24,7 +24,7 @@
@@ -892,7 +892,7 @@ UnSel
diff --git a/docs/Tracker.html b/docs/Tracker.html
index dea73e14..e590510b 100644
--- a/docs/Tracker.html
+++ b/docs/Tracker.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new TrackerSource:
@@ -200,7 +200,7 @@ DataSetupSource:
@@ -283,7 +283,7 @@ DeleteSource:
@@ -366,7 +366,7 @@ Do
- Source:
@@ -449,7 +449,7 @@ GetTrac
- Source:
@@ -557,7 +557,7 @@ LogEventSource:
@@ -692,7 +692,7 @@ SaveTr
- Source:
@@ -827,7 +827,7 @@ isUn
- Source:
@@ -956,7 +956,7 @@ Returns:
diff --git a/docs/audio.js.html b/docs/audio.js.html
index 4fc80eab..b00c498a 100644
--- a/docs/audio.js.html
+++ b/docs/audio.js.html
@@ -24,7 +24,7 @@
@@ -638,7 +638,7 @@ audio.js
diff --git a/docs/barplot.js.html b/docs/barplot.js.html
index bf935fe2..aa9fffe5 100644
--- a/docs/barplot.js.html
+++ b/docs/barplot.js.html
@@ -24,7 +24,7 @@
@@ -372,7 +372,7 @@ barplot.js
diff --git a/docs/boxplot.js.html b/docs/boxplot.js.html
index 4bdb587f..4cc26111 100644
--- a/docs/boxplot.js.html
+++ b/docs/boxplot.js.html
@@ -24,7 +24,7 @@
@@ -796,7 +796,7 @@ boxplot.js
diff --git a/docs/constants.js.html b/docs/constants.js.html
index 591d73d7..32d8bacc 100644
--- a/docs/constants.js.html
+++ b/docs/constants.js.html
@@ -24,7 +24,7 @@
@@ -314,6 +314,7 @@ constants.js
openai: 'OpenAI Vision',
gemini: 'Gemini Pro Vision',
multi: 'Multiple AI',
+ processing: 'Processing Chart...',
},
},
};
@@ -484,7 +485,7 @@ constants.js
</div>
</div>
<div class="modal-footer">
- <button type="button" id="save_and_close_menu">Save and Close</button>
+ <button type="button" id="save_and_close_menu" aria-labelledby="save_and_close_text"><span id="save_and_close_text">Save and Close</span></button>
<button type="button" id="close_menu">Close</button>
</div>
</div>
@@ -620,6 +621,16 @@ constants.js
}
},
]);
+
+ // trigger notification that LLM will be reset
+ // this is done on change of LLM model, multi settings, or skill level
+ constants.events.push([
+ document.getElementById('LLM_model'),
+ 'change',
+ function (e) {
+ menu.NotifyOfLLMReset();
+ },
+ ]);
}
/**
@@ -761,6 +772,9 @@ constants.js
document.getElementById('LLM_preferences').value =
constants.LLMPreferences;
}
+ if (document.getElementById('LLM_reset_notification')) {
+ document.getElementById('LLM_reset_notification').remove();
+ }
}
/**
@@ -818,6 +832,24 @@ constants.js
.setAttribute('aria-live', constants.ariaMode);
}
+ /**
+ * Notifies the user that the LLM will be reset.
+ */
+ NotifyOfLLMReset() {
+ let html =
+ '<p id="LLM_reset_notification">Note: Changes in LLM settings will reset any existing conversation.</p>';
+ document
+ .getElementById('save_and_close_menu')
+ .insertAdjacentHTML('beforebegin', html);
+
+ // add to aria button text
+ document
+ .getElementById('save_and_close_menu')
+ .setAttribute(
+ 'aria-labelledby',
+ 'save_and_close_text LLM_reset_notification'
+ );
+ }
/**
* Handles changes to the LLM model and multi-modal settings.
* We reset if we change the LLM model, multi settings, or skill level.
@@ -936,8 +968,11 @@ constants.js
</button>
</div>
<div class="modal-body">
+ <div id="chatLLM_chat_history_wrapper">
<div id="chatLLM_chat_history" aria-live="${constants.ariaMode}" aria-relevant="additions">
</div>
+ <p id="chatLLM_copy_all_wrapper"><button id="chatLLM_copy_all">Copy all to clipboard</button></p>
+ </div>
<div id="chatLLM_content">
<p><input type="text" id="chatLLM_input" class="form-control" name="chatLLM_input" aria-labelledby="chatLLM_title" size="50"></p>
<div class="LLM_suggestions">
@@ -1079,10 +1114,41 @@ constants.js
document.getElementById('reset_chatLLM'),
'click',
function (e) {
- chatLLM.Toggle(false);
chatLLM.ResetChatHistory();
},
]);
+
+ // copy to clipboard
+ constants.events.push([
+ document.getElementById('chatLLM_copy_all'),
+ 'click',
+ function (e) {
+ let text = document.getElementById('chatLLM_chat_history').innerText;
+ // need newlines instead of paragraphs headings etc
+ text = text.replace(/<p>/g, '\n').replace(/<\/p>/g, '\n');
+ text = text.replace(/<h\d>/g, '\n').replace(/<\/h\d>/g, '\n');
+ text = text.replace(/<.*?>/g, '');
+
+ navigator.clipboard.writeText(text);
+ },
+ ]);
+ constants.events.push([
+ document.getElementById('chatLLM_chat_history'),
+ 'click',
+ function (e) {
+ // we're delegating here, so set the event on child .chatLLM_message_copy_button
+ if (e.target.matches('.chatLLM_message_copy_button')) {
+ // get the innerText of the element before the button
+ let text = e.target.closest('p').previousElementSibling.innerText;
+ // need newlines instead of paragraphs headings etc
+ text = text.replace(/<p>/g, '\n').replace(/<\/p>/g, '\n');
+ text = text.replace(/<h\d>/g, '\n').replace(/<\/h\d>/g, '\n');
+ text = text.replace(/<.*?>/g, '');
+
+ navigator.clipboard.writeText(text);
+ }
+ },
+ ]);
}
/**
@@ -1163,7 +1229,7 @@ constants.js
*/
ProcessLLMResponse(data, model) {
chatLLM.WaitingSound(false);
- console.log('LLM response: ', data);
+ //console.log('LLM response: ', data);
let text = '';
let LLMName = resources.GetString(model);
@@ -1367,9 +1433,9 @@ constants.js
};
// Generate the content
- console.log('LLM request: ', prompt, image);
+ //console.log('LLM request: ', prompt, image);
const result = await model.generateContent([prompt, image]);
- console.log(result.response.text());
+ //console.log(result.response.text());
// Process the response
chatLLM.ProcessLLMResponse(result.response, 'gemini');
@@ -1409,6 +1475,12 @@ constants.js
<p class="chatLLM_message_text">${text}</p>
</div>
`;
+ // add a copy button to actual messages
+ if (user != 'User' && text != resources.GetString('processing')) {
+ html += `
+ <p class="chatLLM_message_copy"><button class="chatLLM_message_copy_button">Copy</button></p>
+ `;
+ }
this.RenderChatMessage(html);
}
@@ -1486,7 +1558,11 @@ constants.js
// get name from resource
let LLMName = resources.GetString(constants.LLMModel);
this.firstTime = false;
- this.DisplayChatMessage(LLMName, 'Processing Chart...', true);
+ this.DisplayChatMessage(
+ LLMName,
+ resources.GetString('processing'),
+ true
+ );
let defaultPrompt = this.GetDefaultPrompt();
this.Submit(defaultPrompt, true);
}
@@ -2282,7 +2358,7 @@ constants.js
diff --git a/docs/controls.js.html b/docs/controls.js.html
index fb8a89b4..3fbf1e2e 100644
--- a/docs/controls.js.html
+++ b/docs/controls.js.html
@@ -24,7 +24,7 @@
@@ -3268,7 +3268,7 @@ controls.js
diff --git a/docs/display.js.html b/docs/display.js.html
index a4ee9c53..1f9acd2b 100644
--- a/docs/display.js.html
+++ b/docs/display.js.html
@@ -24,7 +24,7 @@
@@ -1256,7 +1256,7 @@ display.js
diff --git a/docs/global.html b/docs/global.html
index 05f0215f..f8d03800 100644
--- a/docs/global.html
+++ b/docs/global.html
@@ -24,7 +24,7 @@
@@ -1141,7 +1141,7 @@ Parameters:
diff --git a/docs/heatmap.js.html b/docs/heatmap.js.html
index 1d6889a9..9d586522 100644
--- a/docs/heatmap.js.html
+++ b/docs/heatmap.js.html
@@ -24,7 +24,7 @@
@@ -452,7 +452,7 @@ heatmap.js
diff --git a/docs/histogram.js.html b/docs/histogram.js.html
index 86072184..6b459dcd 100644
--- a/docs/histogram.js.html
+++ b/docs/histogram.js.html
@@ -24,7 +24,7 @@
@@ -247,7 +247,7 @@ histogram.js
diff --git a/docs/index.html b/docs/index.html
index a84a0904..008cca1c 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -24,7 +24,7 @@
@@ -57,7 +57,7 @@
diff --git a/docs/init.js.html b/docs/init.js.html
index 613333f3..7c72dea3 100644
--- a/docs/init.js.html
+++ b/docs/init.js.html
@@ -24,7 +24,7 @@
@@ -531,7 +531,7 @@ init.js
diff --git a/docs/lineplot.js.html b/docs/lineplot.js.html
index 03a2adb0..14254718 100644
--- a/docs/lineplot.js.html
+++ b/docs/lineplot.js.html
@@ -24,7 +24,7 @@
@@ -305,7 +305,7 @@ lineplot.js
diff --git a/docs/scatterplot.js.html b/docs/scatterplot.js.html
index 2e7aca1e..1fa53947 100644
--- a/docs/scatterplot.js.html
+++ b/docs/scatterplot.js.html
@@ -24,7 +24,7 @@
@@ -886,7 +886,7 @@ scatterplot.js
diff --git a/docs/segmented.js.html b/docs/segmented.js.html
index c6e5fa00..9a7c6124 100644
--- a/docs/segmented.js.html
+++ b/docs/segmented.js.html
@@ -24,7 +24,7 @@
@@ -377,7 +377,7 @@ segmented.js
ToggleSource:
@@ -878,7 +878,7 @@ fa
Source:
@@ -951,7 +951,7 @@ Returns:
diff --git a/docs/Constants.html b/docs/Constants.html
index 5113ddb3..c537d43d 100644
--- a/docs/Constants.html
+++ b/docs/Constants.html
@@ -24,7 +24,7 @@
@@ -181,7 +181,7 @@ Classes
diff --git a/docs/Constants_ConvertHexToRGBString.html b/docs/Constants_ConvertHexToRGBString.html
index 75394c72..9e0b772a 100644
--- a/docs/Constants_ConvertHexToRGBString.html
+++ b/docs/Constants_ConvertHexToRGBString.html
@@ -24,7 +24,7 @@
@@ -239,7 +239,7 @@ Returns:
diff --git a/docs/Constants_ConvertRGBStringToHex.html b/docs/Constants_ConvertRGBStringToHex.html
index 14d7556e..0fd4d71a 100644
--- a/docs/Constants_ConvertRGBStringToHex.html
+++ b/docs/Constants_ConvertRGBStringToHex.html
@@ -24,7 +24,7 @@
@@ -239,7 +239,7 @@ Returns:
diff --git a/docs/Constants_GetStyleArrayFromString.html b/docs/Constants_GetStyleArrayFromString.html
index ec0e3abc..85463d6e 100644
--- a/docs/Constants_GetStyleArrayFromString.html
+++ b/docs/Constants_GetStyleArrayFromString.html
@@ -24,7 +24,7 @@
@@ -239,7 +239,7 @@ Returns:
diff --git a/docs/Constants_GetStyleStringFromArray.html b/docs/Constants_GetStyleStringFromArray.html
index 8155f559..83bbc618 100644
--- a/docs/Constants_GetStyleStringFromArray.html
+++ b/docs/Constants_GetStyleStringFromArray.html
@@ -24,7 +24,7 @@
@@ -239,7 +239,7 @@ Returns:
diff --git a/docs/Control.html b/docs/Control.html
index 8606bfa0..c76ad6ab 100644
--- a/docs/Control.html
+++ b/docs/Control.html
@@ -24,7 +24,7 @@
@@ -344,7 +344,7 @@ Returns:
diff --git a/docs/Description.html b/docs/Description.html
index f28c4145..7143987a 100644
--- a/docs/Description.html
+++ b/docs/Description.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new Descri
Source:
@@ -200,7 +200,7 @@ Create
Source:
@@ -283,7 +283,7 @@ DestroySource:
@@ -366,7 +366,7 @@ PopulateD
Source:
@@ -449,7 +449,7 @@ ToggleSource:
@@ -573,7 +573,7 @@ Parameters:
diff --git a/docs/Display.html b/docs/Display.html
index 937f0efd..31600168 100644
--- a/docs/Display.html
+++ b/docs/Display.html
@@ -24,7 +24,7 @@
@@ -1575,7 +1575,7 @@ toggleT
diff --git a/docs/HeatMap.html b/docs/HeatMap.html
index 30b65009..8921f908 100644
--- a/docs/HeatMap.html
+++ b/docs/HeatMap.html
@@ -24,7 +24,7 @@
@@ -1493,7 +1493,7 @@ update
diff --git a/docs/HeatMapRect.html b/docs/HeatMapRect.html
index 2d32914e..97acbd2e 100644
--- a/docs/HeatMapRect.html
+++ b/docs/HeatMapRect.html
@@ -24,7 +24,7 @@
@@ -256,7 +256,7 @@ UpdateRect<
diff --git a/docs/Helper.html b/docs/Helper.html
index 33a4b8af..fa0ca485 100644
--- a/docs/Helper.html
+++ b/docs/Helper.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new HelperSource:
@@ -200,7 +200,7 @@ (static) Source:
@@ -355,7 +355,7 @@ Returns:
diff --git a/docs/Histogram.html b/docs/Histogram.html
index 8d05052c..cebf3417 100644
--- a/docs/Histogram.html
+++ b/docs/Histogram.html
@@ -24,7 +24,7 @@
@@ -422,7 +422,7 @@ SetMaxMin
diff --git a/docs/Layer0Point.html b/docs/Layer0Point.html
index c847ffe9..d7053be5 100644
--- a/docs/Layer0Point.html
+++ b/docs/Layer0Point.html
@@ -24,7 +24,7 @@
@@ -547,7 +547,7 @@ Returns:
diff --git a/docs/Layer1Point.html b/docs/Layer1Point.html
index 6ce2628e..4dd81951 100644
--- a/docs/Layer1Point.html
+++ b/docs/Layer1Point.html
@@ -24,7 +24,7 @@
@@ -547,7 +547,7 @@ Returns:
diff --git a/docs/LinePlot.html b/docs/LinePlot.html
index 37744fd7..e00b766f 100644
--- a/docs/LinePlot.html
+++ b/docs/LinePlot.html
@@ -24,7 +24,7 @@
@@ -725,7 +725,7 @@ Update
diff --git a/docs/LogError.html b/docs/LogError.html
index 9281b16a..b22a5497 100644
--- a/docs/LogError.html
+++ b/docs/LogError.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new LogError<
Source:
@@ -200,7 +200,7 @@ LogAb
Source:
@@ -335,7 +335,7 @@ Log
Source:
@@ -470,7 +470,7 @@ Lo
Source:
@@ -631,7 +631,7 @@ LogNotArra
Source:
@@ -766,7 +766,7 @@ Log
Source:
@@ -896,7 +896,7 @@ Parameters:
diff --git a/docs/Menu.html b/docs/Menu.html
index 0c418037..c21a5924 100644
--- a/docs/Menu.html
+++ b/docs/Menu.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new MenuSource:
@@ -201,7 +201,7 @@ CreateMenu<
Source:
@@ -285,7 +285,7 @@ Handl
Source:
@@ -368,7 +368,90 @@ Source:
-
- constants.js, line 844
+ constants.js, line 876
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ NotifyOfLLMReset()
+
+
+
+
+
+
+ Notifies the user that the LLM will be reset.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+
@@ -451,7 +534,7 @@ PopulateD
- Source:
@@ -534,7 +617,7 @@ SaveDataSource:
@@ -617,7 +700,7 @@ ToggleSource:
@@ -741,7 +824,7 @@ Parameters:
diff --git a/docs/Point.html b/docs/Point.html
index e9903cb5..af8388c0 100644
--- a/docs/Point.html
+++ b/docs/Point.html
@@ -24,7 +24,7 @@
@@ -547,7 +547,7 @@ Returns:
diff --git a/docs/Position.html b/docs/Position.html
index be3a8f17..0e66ba43 100644
--- a/docs/Position.html
+++ b/docs/Position.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new Position<
- Source:
@@ -165,7 +165,7 @@ new Position<
diff --git a/docs/Resources.html b/docs/Resources.html
index 6ec6de01..70b507b6 100644
--- a/docs/Resources.html
+++ b/docs/Resources.html
@@ -24,7 +24,7 @@
@@ -200,7 +200,7 @@ GetStringSource:
@@ -329,7 +329,7 @@ Returns:
diff --git a/docs/Review.html b/docs/Review.html
index 9d2226b2..1f476b4e 100644
--- a/docs/Review.html
+++ b/docs/Review.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new ReviewSource:
@@ -200,7 +200,7 @@ Toggl
- Source:
@@ -324,7 +324,7 @@ Parameters:
diff --git a/docs/ScatterPlot.html b/docs/ScatterPlot.html
index 544da78b..5cead09d 100644
--- a/docs/ScatterPlot.html
+++ b/docs/ScatterPlot.html
@@ -24,7 +24,7 @@
@@ -1427,7 +1427,7 @@ SetLineLa
diff --git a/docs/Segmented.html b/docs/Segmented.html
index ce786aee..4824dd59 100644
--- a/docs/Segmented.html
+++ b/docs/Segmented.html
@@ -24,7 +24,7 @@
@@ -892,7 +892,7 @@ UnSel
diff --git a/docs/Tracker.html b/docs/Tracker.html
index dea73e14..e590510b 100644
--- a/docs/Tracker.html
+++ b/docs/Tracker.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new TrackerSource:
@@ -200,7 +200,7 @@ DataSetupSource:
@@ -283,7 +283,7 @@ DeleteSource:
@@ -366,7 +366,7 @@ Do
- Source:
@@ -449,7 +449,7 @@ GetTrac
- Source:
@@ -557,7 +557,7 @@ LogEventSource:
@@ -692,7 +692,7 @@ SaveTr
- Source:
@@ -827,7 +827,7 @@ isUn
- Source:
@@ -956,7 +956,7 @@ Returns:
diff --git a/docs/audio.js.html b/docs/audio.js.html
index 4fc80eab..b00c498a 100644
--- a/docs/audio.js.html
+++ b/docs/audio.js.html
@@ -24,7 +24,7 @@
@@ -638,7 +638,7 @@ audio.js
diff --git a/docs/barplot.js.html b/docs/barplot.js.html
index bf935fe2..aa9fffe5 100644
--- a/docs/barplot.js.html
+++ b/docs/barplot.js.html
@@ -24,7 +24,7 @@
@@ -372,7 +372,7 @@ barplot.js
diff --git a/docs/boxplot.js.html b/docs/boxplot.js.html
index 4bdb587f..4cc26111 100644
--- a/docs/boxplot.js.html
+++ b/docs/boxplot.js.html
@@ -24,7 +24,7 @@
@@ -796,7 +796,7 @@ boxplot.js
diff --git a/docs/constants.js.html b/docs/constants.js.html
index 591d73d7..32d8bacc 100644
--- a/docs/constants.js.html
+++ b/docs/constants.js.html
@@ -24,7 +24,7 @@
@@ -314,6 +314,7 @@ constants.js
openai: 'OpenAI Vision',
gemini: 'Gemini Pro Vision',
multi: 'Multiple AI',
+ processing: 'Processing Chart...',
},
},
};
@@ -484,7 +485,7 @@ constants.js
</div>
</div>
<div class="modal-footer">
- <button type="button" id="save_and_close_menu">Save and Close</button>
+ <button type="button" id="save_and_close_menu" aria-labelledby="save_and_close_text"><span id="save_and_close_text">Save and Close</span></button>
<button type="button" id="close_menu">Close</button>
</div>
</div>
@@ -620,6 +621,16 @@ constants.js
}
},
]);
+
+ // trigger notification that LLM will be reset
+ // this is done on change of LLM model, multi settings, or skill level
+ constants.events.push([
+ document.getElementById('LLM_model'),
+ 'change',
+ function (e) {
+ menu.NotifyOfLLMReset();
+ },
+ ]);
}
/**
@@ -761,6 +772,9 @@ constants.js
document.getElementById('LLM_preferences').value =
constants.LLMPreferences;
}
+ if (document.getElementById('LLM_reset_notification')) {
+ document.getElementById('LLM_reset_notification').remove();
+ }
}
/**
@@ -818,6 +832,24 @@ constants.js
.setAttribute('aria-live', constants.ariaMode);
}
+ /**
+ * Notifies the user that the LLM will be reset.
+ */
+ NotifyOfLLMReset() {
+ let html =
+ '<p id="LLM_reset_notification">Note: Changes in LLM settings will reset any existing conversation.</p>';
+ document
+ .getElementById('save_and_close_menu')
+ .insertAdjacentHTML('beforebegin', html);
+
+ // add to aria button text
+ document
+ .getElementById('save_and_close_menu')
+ .setAttribute(
+ 'aria-labelledby',
+ 'save_and_close_text LLM_reset_notification'
+ );
+ }
/**
* Handles changes to the LLM model and multi-modal settings.
* We reset if we change the LLM model, multi settings, or skill level.
@@ -936,8 +968,11 @@ constants.js
</button>
</div>
<div class="modal-body">
+ <div id="chatLLM_chat_history_wrapper">
<div id="chatLLM_chat_history" aria-live="${constants.ariaMode}" aria-relevant="additions">
</div>
+ <p id="chatLLM_copy_all_wrapper"><button id="chatLLM_copy_all">Copy all to clipboard</button></p>
+ </div>
<div id="chatLLM_content">
<p><input type="text" id="chatLLM_input" class="form-control" name="chatLLM_input" aria-labelledby="chatLLM_title" size="50"></p>
<div class="LLM_suggestions">
@@ -1079,10 +1114,41 @@ constants.js
document.getElementById('reset_chatLLM'),
'click',
function (e) {
- chatLLM.Toggle(false);
chatLLM.ResetChatHistory();
},
]);
+
+ // copy to clipboard
+ constants.events.push([
+ document.getElementById('chatLLM_copy_all'),
+ 'click',
+ function (e) {
+ let text = document.getElementById('chatLLM_chat_history').innerText;
+ // need newlines instead of paragraphs headings etc
+ text = text.replace(/<p>/g, '\n').replace(/<\/p>/g, '\n');
+ text = text.replace(/<h\d>/g, '\n').replace(/<\/h\d>/g, '\n');
+ text = text.replace(/<.*?>/g, '');
+
+ navigator.clipboard.writeText(text);
+ },
+ ]);
+ constants.events.push([
+ document.getElementById('chatLLM_chat_history'),
+ 'click',
+ function (e) {
+ // we're delegating here, so set the event on child .chatLLM_message_copy_button
+ if (e.target.matches('.chatLLM_message_copy_button')) {
+ // get the innerText of the element before the button
+ let text = e.target.closest('p').previousElementSibling.innerText;
+ // need newlines instead of paragraphs headings etc
+ text = text.replace(/<p>/g, '\n').replace(/<\/p>/g, '\n');
+ text = text.replace(/<h\d>/g, '\n').replace(/<\/h\d>/g, '\n');
+ text = text.replace(/<.*?>/g, '');
+
+ navigator.clipboard.writeText(text);
+ }
+ },
+ ]);
}
/**
@@ -1163,7 +1229,7 @@ constants.js
*/
ProcessLLMResponse(data, model) {
chatLLM.WaitingSound(false);
- console.log('LLM response: ', data);
+ //console.log('LLM response: ', data);
let text = '';
let LLMName = resources.GetString(model);
@@ -1367,9 +1433,9 @@ constants.js
};
// Generate the content
- console.log('LLM request: ', prompt, image);
+ //console.log('LLM request: ', prompt, image);
const result = await model.generateContent([prompt, image]);
- console.log(result.response.text());
+ //console.log(result.response.text());
// Process the response
chatLLM.ProcessLLMResponse(result.response, 'gemini');
@@ -1409,6 +1475,12 @@ constants.js
<p class="chatLLM_message_text">${text}</p>
</div>
`;
+ // add a copy button to actual messages
+ if (user != 'User' && text != resources.GetString('processing')) {
+ html += `
+ <p class="chatLLM_message_copy"><button class="chatLLM_message_copy_button">Copy</button></p>
+ `;
+ }
this.RenderChatMessage(html);
}
@@ -1486,7 +1558,11 @@ constants.js
// get name from resource
let LLMName = resources.GetString(constants.LLMModel);
this.firstTime = false;
- this.DisplayChatMessage(LLMName, 'Processing Chart...', true);
+ this.DisplayChatMessage(
+ LLMName,
+ resources.GetString('processing'),
+ true
+ );
let defaultPrompt = this.GetDefaultPrompt();
this.Submit(defaultPrompt, true);
}
@@ -2282,7 +2358,7 @@ constants.js
diff --git a/docs/controls.js.html b/docs/controls.js.html
index fb8a89b4..3fbf1e2e 100644
--- a/docs/controls.js.html
+++ b/docs/controls.js.html
@@ -24,7 +24,7 @@
@@ -3268,7 +3268,7 @@ controls.js
diff --git a/docs/display.js.html b/docs/display.js.html
index a4ee9c53..1f9acd2b 100644
--- a/docs/display.js.html
+++ b/docs/display.js.html
@@ -24,7 +24,7 @@
@@ -1256,7 +1256,7 @@ display.js
diff --git a/docs/global.html b/docs/global.html
index 05f0215f..f8d03800 100644
--- a/docs/global.html
+++ b/docs/global.html
@@ -24,7 +24,7 @@
@@ -1141,7 +1141,7 @@ Parameters:
diff --git a/docs/heatmap.js.html b/docs/heatmap.js.html
index 1d6889a9..9d586522 100644
--- a/docs/heatmap.js.html
+++ b/docs/heatmap.js.html
@@ -24,7 +24,7 @@
@@ -452,7 +452,7 @@ heatmap.js
diff --git a/docs/histogram.js.html b/docs/histogram.js.html
index 86072184..6b459dcd 100644
--- a/docs/histogram.js.html
+++ b/docs/histogram.js.html
@@ -24,7 +24,7 @@
@@ -247,7 +247,7 @@ histogram.js
diff --git a/docs/index.html b/docs/index.html
index a84a0904..008cca1c 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -24,7 +24,7 @@
@@ -57,7 +57,7 @@
diff --git a/docs/init.js.html b/docs/init.js.html
index 613333f3..7c72dea3 100644
--- a/docs/init.js.html
+++ b/docs/init.js.html
@@ -24,7 +24,7 @@
@@ -531,7 +531,7 @@ init.js
diff --git a/docs/lineplot.js.html b/docs/lineplot.js.html
index 03a2adb0..14254718 100644
--- a/docs/lineplot.js.html
+++ b/docs/lineplot.js.html
@@ -24,7 +24,7 @@
@@ -305,7 +305,7 @@ lineplot.js
diff --git a/docs/scatterplot.js.html b/docs/scatterplot.js.html
index 2e7aca1e..1fa53947 100644
--- a/docs/scatterplot.js.html
+++ b/docs/scatterplot.js.html
@@ -24,7 +24,7 @@
@@ -886,7 +886,7 @@ scatterplot.js
diff --git a/docs/segmented.js.html b/docs/segmented.js.html
index c6e5fa00..9a7c6124 100644
--- a/docs/segmented.js.html
+++ b/docs/segmented.js.html
@@ -24,7 +24,7 @@
@@ -377,7 +377,7 @@ segmented.js
Returns:
diff --git a/docs/Constants.html b/docs/Constants.html index 5113ddb3..c537d43d 100644 --- a/docs/Constants.html +++ b/docs/Constants.html @@ -24,7 +24,7 @@
Classes
diff --git a/docs/Constants_ConvertHexToRGBString.html b/docs/Constants_ConvertHexToRGBString.html index 75394c72..9e0b772a 100644 --- a/docs/Constants_ConvertHexToRGBString.html +++ b/docs/Constants_ConvertHexToRGBString.html @@ -24,7 +24,7 @@
Returns:
diff --git a/docs/Constants_ConvertRGBStringToHex.html b/docs/Constants_ConvertRGBStringToHex.html index 14d7556e..0fd4d71a 100644 --- a/docs/Constants_ConvertRGBStringToHex.html +++ b/docs/Constants_ConvertRGBStringToHex.html @@ -24,7 +24,7 @@
Returns:
diff --git a/docs/Constants_GetStyleArrayFromString.html b/docs/Constants_GetStyleArrayFromString.html index ec0e3abc..85463d6e 100644 --- a/docs/Constants_GetStyleArrayFromString.html +++ b/docs/Constants_GetStyleArrayFromString.html @@ -24,7 +24,7 @@
Returns:
diff --git a/docs/Constants_GetStyleStringFromArray.html b/docs/Constants_GetStyleStringFromArray.html index 8155f559..83bbc618 100644 --- a/docs/Constants_GetStyleStringFromArray.html +++ b/docs/Constants_GetStyleStringFromArray.html @@ -24,7 +24,7 @@
Returns:
diff --git a/docs/Control.html b/docs/Control.html index 8606bfa0..c76ad6ab 100644 --- a/docs/Control.html +++ b/docs/Control.html @@ -24,7 +24,7 @@
Returns:
diff --git a/docs/Description.html b/docs/Description.html index f28c4145..7143987a 100644 --- a/docs/Description.html +++ b/docs/Description.html @@ -24,7 +24,7 @@
new Descri
Source:
@@ -200,7 +200,7 @@ Create
Source:
@@ -283,7 +283,7 @@ DestroySource:
@@ -366,7 +366,7 @@ PopulateD
Source:
@@ -449,7 +449,7 @@ ToggleSource:
@@ -573,7 +573,7 @@ Parameters:
diff --git a/docs/Display.html b/docs/Display.html
index 937f0efd..31600168 100644
--- a/docs/Display.html
+++ b/docs/Display.html
@@ -24,7 +24,7 @@
@@ -1575,7 +1575,7 @@ toggleT
diff --git a/docs/HeatMap.html b/docs/HeatMap.html
index 30b65009..8921f908 100644
--- a/docs/HeatMap.html
+++ b/docs/HeatMap.html
@@ -24,7 +24,7 @@
@@ -1493,7 +1493,7 @@ update
diff --git a/docs/HeatMapRect.html b/docs/HeatMapRect.html
index 2d32914e..97acbd2e 100644
--- a/docs/HeatMapRect.html
+++ b/docs/HeatMapRect.html
@@ -24,7 +24,7 @@
@@ -256,7 +256,7 @@ UpdateRect<
diff --git a/docs/Helper.html b/docs/Helper.html
index 33a4b8af..fa0ca485 100644
--- a/docs/Helper.html
+++ b/docs/Helper.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new HelperSource:
@@ -200,7 +200,7 @@ (static) Source:
@@ -355,7 +355,7 @@ Returns:
diff --git a/docs/Histogram.html b/docs/Histogram.html
index 8d05052c..cebf3417 100644
--- a/docs/Histogram.html
+++ b/docs/Histogram.html
@@ -24,7 +24,7 @@
@@ -422,7 +422,7 @@ SetMaxMin
diff --git a/docs/Layer0Point.html b/docs/Layer0Point.html
index c847ffe9..d7053be5 100644
--- a/docs/Layer0Point.html
+++ b/docs/Layer0Point.html
@@ -24,7 +24,7 @@
@@ -547,7 +547,7 @@ Returns:
diff --git a/docs/Layer1Point.html b/docs/Layer1Point.html
index 6ce2628e..4dd81951 100644
--- a/docs/Layer1Point.html
+++ b/docs/Layer1Point.html
@@ -24,7 +24,7 @@
@@ -547,7 +547,7 @@ Returns:
diff --git a/docs/LinePlot.html b/docs/LinePlot.html
index 37744fd7..e00b766f 100644
--- a/docs/LinePlot.html
+++ b/docs/LinePlot.html
@@ -24,7 +24,7 @@
@@ -725,7 +725,7 @@ Update
diff --git a/docs/LogError.html b/docs/LogError.html
index 9281b16a..b22a5497 100644
--- a/docs/LogError.html
+++ b/docs/LogError.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new LogError<
Source:
@@ -200,7 +200,7 @@ LogAb
Source:
@@ -335,7 +335,7 @@ Log
Source:
@@ -470,7 +470,7 @@ Lo
Source:
@@ -631,7 +631,7 @@ LogNotArra
Source:
@@ -766,7 +766,7 @@ Log
Source:
@@ -896,7 +896,7 @@ Parameters:
diff --git a/docs/Menu.html b/docs/Menu.html
index 0c418037..c21a5924 100644
--- a/docs/Menu.html
+++ b/docs/Menu.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new MenuSource:
@@ -201,7 +201,7 @@ CreateMenu<
Source:
@@ -285,7 +285,7 @@ Handl
Source:
@@ -368,7 +368,90 @@ Source:
-
- constants.js, line 844
+ constants.js, line 876
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ NotifyOfLLMReset()
+
+
+
+
+
+
+ Notifies the user that the LLM will be reset.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+
@@ -451,7 +534,7 @@ PopulateD
- Source:
@@ -534,7 +617,7 @@ SaveDataSource:
@@ -617,7 +700,7 @@ ToggleSource:
@@ -741,7 +824,7 @@ Parameters:
diff --git a/docs/Point.html b/docs/Point.html
index e9903cb5..af8388c0 100644
--- a/docs/Point.html
+++ b/docs/Point.html
@@ -24,7 +24,7 @@
@@ -547,7 +547,7 @@ Returns:
diff --git a/docs/Position.html b/docs/Position.html
index be3a8f17..0e66ba43 100644
--- a/docs/Position.html
+++ b/docs/Position.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new Position<
- Source:
@@ -165,7 +165,7 @@ new Position<
diff --git a/docs/Resources.html b/docs/Resources.html
index 6ec6de01..70b507b6 100644
--- a/docs/Resources.html
+++ b/docs/Resources.html
@@ -24,7 +24,7 @@
@@ -200,7 +200,7 @@ GetStringSource:
@@ -329,7 +329,7 @@ Returns:
diff --git a/docs/Review.html b/docs/Review.html
index 9d2226b2..1f476b4e 100644
--- a/docs/Review.html
+++ b/docs/Review.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new ReviewSource:
@@ -200,7 +200,7 @@ Toggl
- Source:
@@ -324,7 +324,7 @@ Parameters:
diff --git a/docs/ScatterPlot.html b/docs/ScatterPlot.html
index 544da78b..5cead09d 100644
--- a/docs/ScatterPlot.html
+++ b/docs/ScatterPlot.html
@@ -24,7 +24,7 @@
@@ -1427,7 +1427,7 @@ SetLineLa
diff --git a/docs/Segmented.html b/docs/Segmented.html
index ce786aee..4824dd59 100644
--- a/docs/Segmented.html
+++ b/docs/Segmented.html
@@ -24,7 +24,7 @@
@@ -892,7 +892,7 @@ UnSel
diff --git a/docs/Tracker.html b/docs/Tracker.html
index dea73e14..e590510b 100644
--- a/docs/Tracker.html
+++ b/docs/Tracker.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new TrackerSource:
@@ -200,7 +200,7 @@ DataSetupSource:
@@ -283,7 +283,7 @@ DeleteSource:
@@ -366,7 +366,7 @@ Do
- Source:
@@ -449,7 +449,7 @@ GetTrac
- Source:
@@ -557,7 +557,7 @@ LogEventSource:
@@ -692,7 +692,7 @@ SaveTr
- Source:
@@ -827,7 +827,7 @@ isUn
- Source:
@@ -956,7 +956,7 @@ Returns:
diff --git a/docs/audio.js.html b/docs/audio.js.html
index 4fc80eab..b00c498a 100644
--- a/docs/audio.js.html
+++ b/docs/audio.js.html
@@ -24,7 +24,7 @@
@@ -638,7 +638,7 @@ audio.js
diff --git a/docs/barplot.js.html b/docs/barplot.js.html
index bf935fe2..aa9fffe5 100644
--- a/docs/barplot.js.html
+++ b/docs/barplot.js.html
@@ -24,7 +24,7 @@
@@ -372,7 +372,7 @@ barplot.js
diff --git a/docs/boxplot.js.html b/docs/boxplot.js.html
index 4bdb587f..4cc26111 100644
--- a/docs/boxplot.js.html
+++ b/docs/boxplot.js.html
@@ -24,7 +24,7 @@
@@ -796,7 +796,7 @@ boxplot.js
diff --git a/docs/constants.js.html b/docs/constants.js.html
index 591d73d7..32d8bacc 100644
--- a/docs/constants.js.html
+++ b/docs/constants.js.html
@@ -24,7 +24,7 @@
@@ -314,6 +314,7 @@ constants.js
openai: 'OpenAI Vision',
gemini: 'Gemini Pro Vision',
multi: 'Multiple AI',
+ processing: 'Processing Chart...',
},
},
};
@@ -484,7 +485,7 @@ constants.js
</div>
</div>
<div class="modal-footer">
- <button type="button" id="save_and_close_menu">Save and Close</button>
+ <button type="button" id="save_and_close_menu" aria-labelledby="save_and_close_text"><span id="save_and_close_text">Save and Close</span></button>
<button type="button" id="close_menu">Close</button>
</div>
</div>
@@ -620,6 +621,16 @@ constants.js
}
},
]);
+
+ // trigger notification that LLM will be reset
+ // this is done on change of LLM model, multi settings, or skill level
+ constants.events.push([
+ document.getElementById('LLM_model'),
+ 'change',
+ function (e) {
+ menu.NotifyOfLLMReset();
+ },
+ ]);
}
/**
@@ -761,6 +772,9 @@ constants.js
document.getElementById('LLM_preferences').value =
constants.LLMPreferences;
}
+ if (document.getElementById('LLM_reset_notification')) {
+ document.getElementById('LLM_reset_notification').remove();
+ }
}
/**
@@ -818,6 +832,24 @@ constants.js
.setAttribute('aria-live', constants.ariaMode);
}
+ /**
+ * Notifies the user that the LLM will be reset.
+ */
+ NotifyOfLLMReset() {
+ let html =
+ '<p id="LLM_reset_notification">Note: Changes in LLM settings will reset any existing conversation.</p>';
+ document
+ .getElementById('save_and_close_menu')
+ .insertAdjacentHTML('beforebegin', html);
+
+ // add to aria button text
+ document
+ .getElementById('save_and_close_menu')
+ .setAttribute(
+ 'aria-labelledby',
+ 'save_and_close_text LLM_reset_notification'
+ );
+ }
/**
* Handles changes to the LLM model and multi-modal settings.
* We reset if we change the LLM model, multi settings, or skill level.
@@ -936,8 +968,11 @@ constants.js
</button>
</div>
<div class="modal-body">
+ <div id="chatLLM_chat_history_wrapper">
<div id="chatLLM_chat_history" aria-live="${constants.ariaMode}" aria-relevant="additions">
</div>
+ <p id="chatLLM_copy_all_wrapper"><button id="chatLLM_copy_all">Copy all to clipboard</button></p>
+ </div>
<div id="chatLLM_content">
<p><input type="text" id="chatLLM_input" class="form-control" name="chatLLM_input" aria-labelledby="chatLLM_title" size="50"></p>
<div class="LLM_suggestions">
@@ -1079,10 +1114,41 @@ constants.js
document.getElementById('reset_chatLLM'),
'click',
function (e) {
- chatLLM.Toggle(false);
chatLLM.ResetChatHistory();
},
]);
+
+ // copy to clipboard
+ constants.events.push([
+ document.getElementById('chatLLM_copy_all'),
+ 'click',
+ function (e) {
+ let text = document.getElementById('chatLLM_chat_history').innerText;
+ // need newlines instead of paragraphs headings etc
+ text = text.replace(/<p>/g, '\n').replace(/<\/p>/g, '\n');
+ text = text.replace(/<h\d>/g, '\n').replace(/<\/h\d>/g, '\n');
+ text = text.replace(/<.*?>/g, '');
+
+ navigator.clipboard.writeText(text);
+ },
+ ]);
+ constants.events.push([
+ document.getElementById('chatLLM_chat_history'),
+ 'click',
+ function (e) {
+ // we're delegating here, so set the event on child .chatLLM_message_copy_button
+ if (e.target.matches('.chatLLM_message_copy_button')) {
+ // get the innerText of the element before the button
+ let text = e.target.closest('p').previousElementSibling.innerText;
+ // need newlines instead of paragraphs headings etc
+ text = text.replace(/<p>/g, '\n').replace(/<\/p>/g, '\n');
+ text = text.replace(/<h\d>/g, '\n').replace(/<\/h\d>/g, '\n');
+ text = text.replace(/<.*?>/g, '');
+
+ navigator.clipboard.writeText(text);
+ }
+ },
+ ]);
}
/**
@@ -1163,7 +1229,7 @@ constants.js
*/
ProcessLLMResponse(data, model) {
chatLLM.WaitingSound(false);
- console.log('LLM response: ', data);
+ //console.log('LLM response: ', data);
let text = '';
let LLMName = resources.GetString(model);
@@ -1367,9 +1433,9 @@ constants.js
};
// Generate the content
- console.log('LLM request: ', prompt, image);
+ //console.log('LLM request: ', prompt, image);
const result = await model.generateContent([prompt, image]);
- console.log(result.response.text());
+ //console.log(result.response.text());
// Process the response
chatLLM.ProcessLLMResponse(result.response, 'gemini');
@@ -1409,6 +1475,12 @@ constants.js
<p class="chatLLM_message_text">${text}</p>
</div>
`;
+ // add a copy button to actual messages
+ if (user != 'User' && text != resources.GetString('processing')) {
+ html += `
+ <p class="chatLLM_message_copy"><button class="chatLLM_message_copy_button">Copy</button></p>
+ `;
+ }
this.RenderChatMessage(html);
}
@@ -1486,7 +1558,11 @@ constants.js
// get name from resource
let LLMName = resources.GetString(constants.LLMModel);
this.firstTime = false;
- this.DisplayChatMessage(LLMName, 'Processing Chart...', true);
+ this.DisplayChatMessage(
+ LLMName,
+ resources.GetString('processing'),
+ true
+ );
let defaultPrompt = this.GetDefaultPrompt();
this.Submit(defaultPrompt, true);
}
@@ -2282,7 +2358,7 @@ constants.js
diff --git a/docs/controls.js.html b/docs/controls.js.html
index fb8a89b4..3fbf1e2e 100644
--- a/docs/controls.js.html
+++ b/docs/controls.js.html
@@ -24,7 +24,7 @@
@@ -3268,7 +3268,7 @@ controls.js
diff --git a/docs/display.js.html b/docs/display.js.html
index a4ee9c53..1f9acd2b 100644
--- a/docs/display.js.html
+++ b/docs/display.js.html
@@ -24,7 +24,7 @@
@@ -1256,7 +1256,7 @@ display.js
diff --git a/docs/global.html b/docs/global.html
index 05f0215f..f8d03800 100644
--- a/docs/global.html
+++ b/docs/global.html
@@ -24,7 +24,7 @@
@@ -1141,7 +1141,7 @@ Parameters:
diff --git a/docs/heatmap.js.html b/docs/heatmap.js.html
index 1d6889a9..9d586522 100644
--- a/docs/heatmap.js.html
+++ b/docs/heatmap.js.html
@@ -24,7 +24,7 @@
@@ -452,7 +452,7 @@ heatmap.js
diff --git a/docs/histogram.js.html b/docs/histogram.js.html
index 86072184..6b459dcd 100644
--- a/docs/histogram.js.html
+++ b/docs/histogram.js.html
@@ -24,7 +24,7 @@
@@ -247,7 +247,7 @@ histogram.js
diff --git a/docs/index.html b/docs/index.html
index a84a0904..008cca1c 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -24,7 +24,7 @@
@@ -57,7 +57,7 @@
diff --git a/docs/init.js.html b/docs/init.js.html
index 613333f3..7c72dea3 100644
--- a/docs/init.js.html
+++ b/docs/init.js.html
@@ -24,7 +24,7 @@
@@ -531,7 +531,7 @@ init.js
diff --git a/docs/lineplot.js.html b/docs/lineplot.js.html
index 03a2adb0..14254718 100644
--- a/docs/lineplot.js.html
+++ b/docs/lineplot.js.html
@@ -24,7 +24,7 @@
@@ -305,7 +305,7 @@ lineplot.js
diff --git a/docs/scatterplot.js.html b/docs/scatterplot.js.html
index 2e7aca1e..1fa53947 100644
--- a/docs/scatterplot.js.html
+++ b/docs/scatterplot.js.html
@@ -24,7 +24,7 @@
@@ -886,7 +886,7 @@ scatterplot.js
diff --git a/docs/segmented.js.html b/docs/segmented.js.html
index c6e5fa00..9a7c6124 100644
--- a/docs/segmented.js.html
+++ b/docs/segmented.js.html
@@ -24,7 +24,7 @@
@@ -377,7 +377,7 @@ segmented.js
DestroySource:
@@ -366,7 +366,7 @@ PopulateD
Source:
@@ -449,7 +449,7 @@ ToggleSource:
@@ -573,7 +573,7 @@ Parameters:
diff --git a/docs/Display.html b/docs/Display.html
index 937f0efd..31600168 100644
--- a/docs/Display.html
+++ b/docs/Display.html
@@ -24,7 +24,7 @@
@@ -1575,7 +1575,7 @@ toggleT
diff --git a/docs/HeatMap.html b/docs/HeatMap.html
index 30b65009..8921f908 100644
--- a/docs/HeatMap.html
+++ b/docs/HeatMap.html
@@ -24,7 +24,7 @@
@@ -1493,7 +1493,7 @@ update
diff --git a/docs/HeatMapRect.html b/docs/HeatMapRect.html
index 2d32914e..97acbd2e 100644
--- a/docs/HeatMapRect.html
+++ b/docs/HeatMapRect.html
@@ -24,7 +24,7 @@
@@ -256,7 +256,7 @@ UpdateRect<
diff --git a/docs/Helper.html b/docs/Helper.html
index 33a4b8af..fa0ca485 100644
--- a/docs/Helper.html
+++ b/docs/Helper.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new HelperSource:
@@ -200,7 +200,7 @@ (static) Source:
@@ -355,7 +355,7 @@ Returns:
diff --git a/docs/Histogram.html b/docs/Histogram.html
index 8d05052c..cebf3417 100644
--- a/docs/Histogram.html
+++ b/docs/Histogram.html
@@ -24,7 +24,7 @@
@@ -422,7 +422,7 @@ SetMaxMin
diff --git a/docs/Layer0Point.html b/docs/Layer0Point.html
index c847ffe9..d7053be5 100644
--- a/docs/Layer0Point.html
+++ b/docs/Layer0Point.html
@@ -24,7 +24,7 @@
@@ -547,7 +547,7 @@ Returns:
diff --git a/docs/Layer1Point.html b/docs/Layer1Point.html
index 6ce2628e..4dd81951 100644
--- a/docs/Layer1Point.html
+++ b/docs/Layer1Point.html
@@ -24,7 +24,7 @@
@@ -547,7 +547,7 @@ Returns:
diff --git a/docs/LinePlot.html b/docs/LinePlot.html
index 37744fd7..e00b766f 100644
--- a/docs/LinePlot.html
+++ b/docs/LinePlot.html
@@ -24,7 +24,7 @@
@@ -725,7 +725,7 @@ Update
diff --git a/docs/LogError.html b/docs/LogError.html
index 9281b16a..b22a5497 100644
--- a/docs/LogError.html
+++ b/docs/LogError.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new LogError<
Source:
@@ -200,7 +200,7 @@ LogAb
Source:
@@ -335,7 +335,7 @@ Log
Source:
@@ -470,7 +470,7 @@ Lo
Source:
@@ -631,7 +631,7 @@ LogNotArra
Source:
@@ -766,7 +766,7 @@ Log
Source:
@@ -896,7 +896,7 @@ Parameters:
diff --git a/docs/Menu.html b/docs/Menu.html
index 0c418037..c21a5924 100644
--- a/docs/Menu.html
+++ b/docs/Menu.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new MenuSource:
@@ -201,7 +201,7 @@ CreateMenu<
Source:
@@ -285,7 +285,7 @@ Handl
Source:
@@ -368,7 +368,90 @@ Source:
-
- constants.js, line 844
+ constants.js, line 876
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ NotifyOfLLMReset()
+
+
+
+
+
+
+ Notifies the user that the LLM will be reset.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+
@@ -451,7 +534,7 @@ PopulateD
- Source:
@@ -534,7 +617,7 @@ SaveDataSource:
@@ -617,7 +700,7 @@ ToggleSource:
@@ -741,7 +824,7 @@ Parameters:
diff --git a/docs/Point.html b/docs/Point.html
index e9903cb5..af8388c0 100644
--- a/docs/Point.html
+++ b/docs/Point.html
@@ -24,7 +24,7 @@
@@ -547,7 +547,7 @@ Returns:
diff --git a/docs/Position.html b/docs/Position.html
index be3a8f17..0e66ba43 100644
--- a/docs/Position.html
+++ b/docs/Position.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new Position<
- Source:
@@ -165,7 +165,7 @@ new Position<
diff --git a/docs/Resources.html b/docs/Resources.html
index 6ec6de01..70b507b6 100644
--- a/docs/Resources.html
+++ b/docs/Resources.html
@@ -24,7 +24,7 @@
@@ -200,7 +200,7 @@ GetStringSource:
@@ -329,7 +329,7 @@ Returns:
diff --git a/docs/Review.html b/docs/Review.html
index 9d2226b2..1f476b4e 100644
--- a/docs/Review.html
+++ b/docs/Review.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new ReviewSource:
@@ -200,7 +200,7 @@ Toggl
- Source:
@@ -324,7 +324,7 @@ Parameters:
diff --git a/docs/ScatterPlot.html b/docs/ScatterPlot.html
index 544da78b..5cead09d 100644
--- a/docs/ScatterPlot.html
+++ b/docs/ScatterPlot.html
@@ -24,7 +24,7 @@
@@ -1427,7 +1427,7 @@ SetLineLa
diff --git a/docs/Segmented.html b/docs/Segmented.html
index ce786aee..4824dd59 100644
--- a/docs/Segmented.html
+++ b/docs/Segmented.html
@@ -24,7 +24,7 @@
@@ -892,7 +892,7 @@ UnSel
diff --git a/docs/Tracker.html b/docs/Tracker.html
index dea73e14..e590510b 100644
--- a/docs/Tracker.html
+++ b/docs/Tracker.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new TrackerSource:
@@ -200,7 +200,7 @@ DataSetupSource:
@@ -283,7 +283,7 @@ DeleteSource:
@@ -366,7 +366,7 @@ Do
- Source:
@@ -449,7 +449,7 @@ GetTrac
- Source:
@@ -557,7 +557,7 @@ LogEventSource:
@@ -692,7 +692,7 @@ SaveTr
- Source:
@@ -827,7 +827,7 @@ isUn
- Source:
@@ -956,7 +956,7 @@ Returns:
diff --git a/docs/audio.js.html b/docs/audio.js.html
index 4fc80eab..b00c498a 100644
--- a/docs/audio.js.html
+++ b/docs/audio.js.html
@@ -24,7 +24,7 @@
@@ -638,7 +638,7 @@ audio.js
diff --git a/docs/barplot.js.html b/docs/barplot.js.html
index bf935fe2..aa9fffe5 100644
--- a/docs/barplot.js.html
+++ b/docs/barplot.js.html
@@ -24,7 +24,7 @@
@@ -372,7 +372,7 @@ barplot.js
diff --git a/docs/boxplot.js.html b/docs/boxplot.js.html
index 4bdb587f..4cc26111 100644
--- a/docs/boxplot.js.html
+++ b/docs/boxplot.js.html
@@ -24,7 +24,7 @@
@@ -796,7 +796,7 @@ boxplot.js
diff --git a/docs/constants.js.html b/docs/constants.js.html
index 591d73d7..32d8bacc 100644
--- a/docs/constants.js.html
+++ b/docs/constants.js.html
@@ -24,7 +24,7 @@
@@ -314,6 +314,7 @@ constants.js
openai: 'OpenAI Vision',
gemini: 'Gemini Pro Vision',
multi: 'Multiple AI',
+ processing: 'Processing Chart...',
},
},
};
@@ -484,7 +485,7 @@ constants.js
</div>
</div>
<div class="modal-footer">
- <button type="button" id="save_and_close_menu">Save and Close</button>
+ <button type="button" id="save_and_close_menu" aria-labelledby="save_and_close_text"><span id="save_and_close_text">Save and Close</span></button>
<button type="button" id="close_menu">Close</button>
</div>
</div>
@@ -620,6 +621,16 @@ constants.js
}
},
]);
+
+ // trigger notification that LLM will be reset
+ // this is done on change of LLM model, multi settings, or skill level
+ constants.events.push([
+ document.getElementById('LLM_model'),
+ 'change',
+ function (e) {
+ menu.NotifyOfLLMReset();
+ },
+ ]);
}
/**
@@ -761,6 +772,9 @@ constants.js
document.getElementById('LLM_preferences').value =
constants.LLMPreferences;
}
+ if (document.getElementById('LLM_reset_notification')) {
+ document.getElementById('LLM_reset_notification').remove();
+ }
}
/**
@@ -818,6 +832,24 @@ constants.js
.setAttribute('aria-live', constants.ariaMode);
}
+ /**
+ * Notifies the user that the LLM will be reset.
+ */
+ NotifyOfLLMReset() {
+ let html =
+ '<p id="LLM_reset_notification">Note: Changes in LLM settings will reset any existing conversation.</p>';
+ document
+ .getElementById('save_and_close_menu')
+ .insertAdjacentHTML('beforebegin', html);
+
+ // add to aria button text
+ document
+ .getElementById('save_and_close_menu')
+ .setAttribute(
+ 'aria-labelledby',
+ 'save_and_close_text LLM_reset_notification'
+ );
+ }
/**
* Handles changes to the LLM model and multi-modal settings.
* We reset if we change the LLM model, multi settings, or skill level.
@@ -936,8 +968,11 @@ constants.js
</button>
</div>
<div class="modal-body">
+ <div id="chatLLM_chat_history_wrapper">
<div id="chatLLM_chat_history" aria-live="${constants.ariaMode}" aria-relevant="additions">
</div>
+ <p id="chatLLM_copy_all_wrapper"><button id="chatLLM_copy_all">Copy all to clipboard</button></p>
+ </div>
<div id="chatLLM_content">
<p><input type="text" id="chatLLM_input" class="form-control" name="chatLLM_input" aria-labelledby="chatLLM_title" size="50"></p>
<div class="LLM_suggestions">
@@ -1079,10 +1114,41 @@ constants.js
document.getElementById('reset_chatLLM'),
'click',
function (e) {
- chatLLM.Toggle(false);
chatLLM.ResetChatHistory();
},
]);
+
+ // copy to clipboard
+ constants.events.push([
+ document.getElementById('chatLLM_copy_all'),
+ 'click',
+ function (e) {
+ let text = document.getElementById('chatLLM_chat_history').innerText;
+ // need newlines instead of paragraphs headings etc
+ text = text.replace(/<p>/g, '\n').replace(/<\/p>/g, '\n');
+ text = text.replace(/<h\d>/g, '\n').replace(/<\/h\d>/g, '\n');
+ text = text.replace(/<.*?>/g, '');
+
+ navigator.clipboard.writeText(text);
+ },
+ ]);
+ constants.events.push([
+ document.getElementById('chatLLM_chat_history'),
+ 'click',
+ function (e) {
+ // we're delegating here, so set the event on child .chatLLM_message_copy_button
+ if (e.target.matches('.chatLLM_message_copy_button')) {
+ // get the innerText of the element before the button
+ let text = e.target.closest('p').previousElementSibling.innerText;
+ // need newlines instead of paragraphs headings etc
+ text = text.replace(/<p>/g, '\n').replace(/<\/p>/g, '\n');
+ text = text.replace(/<h\d>/g, '\n').replace(/<\/h\d>/g, '\n');
+ text = text.replace(/<.*?>/g, '');
+
+ navigator.clipboard.writeText(text);
+ }
+ },
+ ]);
}
/**
@@ -1163,7 +1229,7 @@ constants.js
*/
ProcessLLMResponse(data, model) {
chatLLM.WaitingSound(false);
- console.log('LLM response: ', data);
+ //console.log('LLM response: ', data);
let text = '';
let LLMName = resources.GetString(model);
@@ -1367,9 +1433,9 @@ constants.js
};
// Generate the content
- console.log('LLM request: ', prompt, image);
+ //console.log('LLM request: ', prompt, image);
const result = await model.generateContent([prompt, image]);
- console.log(result.response.text());
+ //console.log(result.response.text());
// Process the response
chatLLM.ProcessLLMResponse(result.response, 'gemini');
@@ -1409,6 +1475,12 @@ constants.js
<p class="chatLLM_message_text">${text}</p>
</div>
`;
+ // add a copy button to actual messages
+ if (user != 'User' && text != resources.GetString('processing')) {
+ html += `
+ <p class="chatLLM_message_copy"><button class="chatLLM_message_copy_button">Copy</button></p>
+ `;
+ }
this.RenderChatMessage(html);
}
@@ -1486,7 +1558,11 @@ constants.js
// get name from resource
let LLMName = resources.GetString(constants.LLMModel);
this.firstTime = false;
- this.DisplayChatMessage(LLMName, 'Processing Chart...', true);
+ this.DisplayChatMessage(
+ LLMName,
+ resources.GetString('processing'),
+ true
+ );
let defaultPrompt = this.GetDefaultPrompt();
this.Submit(defaultPrompt, true);
}
@@ -2282,7 +2358,7 @@ constants.js
diff --git a/docs/controls.js.html b/docs/controls.js.html
index fb8a89b4..3fbf1e2e 100644
--- a/docs/controls.js.html
+++ b/docs/controls.js.html
@@ -24,7 +24,7 @@
@@ -3268,7 +3268,7 @@ controls.js
diff --git a/docs/display.js.html b/docs/display.js.html
index a4ee9c53..1f9acd2b 100644
--- a/docs/display.js.html
+++ b/docs/display.js.html
@@ -24,7 +24,7 @@
@@ -1256,7 +1256,7 @@ display.js
diff --git a/docs/global.html b/docs/global.html
index 05f0215f..f8d03800 100644
--- a/docs/global.html
+++ b/docs/global.html
@@ -24,7 +24,7 @@
@@ -1141,7 +1141,7 @@ Parameters:
diff --git a/docs/heatmap.js.html b/docs/heatmap.js.html
index 1d6889a9..9d586522 100644
--- a/docs/heatmap.js.html
+++ b/docs/heatmap.js.html
@@ -24,7 +24,7 @@
@@ -452,7 +452,7 @@ heatmap.js
diff --git a/docs/histogram.js.html b/docs/histogram.js.html
index 86072184..6b459dcd 100644
--- a/docs/histogram.js.html
+++ b/docs/histogram.js.html
@@ -24,7 +24,7 @@
@@ -247,7 +247,7 @@ histogram.js
diff --git a/docs/index.html b/docs/index.html
index a84a0904..008cca1c 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -24,7 +24,7 @@
@@ -57,7 +57,7 @@
diff --git a/docs/init.js.html b/docs/init.js.html
index 613333f3..7c72dea3 100644
--- a/docs/init.js.html
+++ b/docs/init.js.html
@@ -24,7 +24,7 @@
@@ -531,7 +531,7 @@ init.js
diff --git a/docs/lineplot.js.html b/docs/lineplot.js.html
index 03a2adb0..14254718 100644
--- a/docs/lineplot.js.html
+++ b/docs/lineplot.js.html
@@ -24,7 +24,7 @@
@@ -305,7 +305,7 @@ lineplot.js
diff --git a/docs/scatterplot.js.html b/docs/scatterplot.js.html
index 2e7aca1e..1fa53947 100644
--- a/docs/scatterplot.js.html
+++ b/docs/scatterplot.js.html
@@ -24,7 +24,7 @@
@@ -886,7 +886,7 @@ scatterplot.js
diff --git a/docs/segmented.js.html b/docs/segmented.js.html
index c6e5fa00..9a7c6124 100644
--- a/docs/segmented.js.html
+++ b/docs/segmented.js.html
@@ -24,7 +24,7 @@
@@ -377,7 +377,7 @@ segmented.js
ToggleSource:
@@ -573,7 +573,7 @@ Parameters:
diff --git a/docs/Display.html b/docs/Display.html
index 937f0efd..31600168 100644
--- a/docs/Display.html
+++ b/docs/Display.html
@@ -24,7 +24,7 @@
@@ -1575,7 +1575,7 @@ toggleT
diff --git a/docs/HeatMap.html b/docs/HeatMap.html
index 30b65009..8921f908 100644
--- a/docs/HeatMap.html
+++ b/docs/HeatMap.html
@@ -24,7 +24,7 @@
@@ -1493,7 +1493,7 @@ update
diff --git a/docs/HeatMapRect.html b/docs/HeatMapRect.html
index 2d32914e..97acbd2e 100644
--- a/docs/HeatMapRect.html
+++ b/docs/HeatMapRect.html
@@ -24,7 +24,7 @@
@@ -256,7 +256,7 @@ UpdateRect<
diff --git a/docs/Helper.html b/docs/Helper.html
index 33a4b8af..fa0ca485 100644
--- a/docs/Helper.html
+++ b/docs/Helper.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new HelperSource:
@@ -200,7 +200,7 @@ (static) Source:
@@ -355,7 +355,7 @@ Returns:
diff --git a/docs/Histogram.html b/docs/Histogram.html
index 8d05052c..cebf3417 100644
--- a/docs/Histogram.html
+++ b/docs/Histogram.html
@@ -24,7 +24,7 @@
@@ -422,7 +422,7 @@ SetMaxMin
diff --git a/docs/Layer0Point.html b/docs/Layer0Point.html
index c847ffe9..d7053be5 100644
--- a/docs/Layer0Point.html
+++ b/docs/Layer0Point.html
@@ -24,7 +24,7 @@
@@ -547,7 +547,7 @@ Returns:
diff --git a/docs/Layer1Point.html b/docs/Layer1Point.html
index 6ce2628e..4dd81951 100644
--- a/docs/Layer1Point.html
+++ b/docs/Layer1Point.html
@@ -24,7 +24,7 @@
@@ -547,7 +547,7 @@ Returns:
diff --git a/docs/LinePlot.html b/docs/LinePlot.html
index 37744fd7..e00b766f 100644
--- a/docs/LinePlot.html
+++ b/docs/LinePlot.html
@@ -24,7 +24,7 @@
@@ -725,7 +725,7 @@ Update
diff --git a/docs/LogError.html b/docs/LogError.html
index 9281b16a..b22a5497 100644
--- a/docs/LogError.html
+++ b/docs/LogError.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new LogError<
Source:
@@ -200,7 +200,7 @@ LogAb
Source:
@@ -335,7 +335,7 @@ Log
Source:
@@ -470,7 +470,7 @@ Lo
Source:
@@ -631,7 +631,7 @@ LogNotArra
Source:
@@ -766,7 +766,7 @@ Log
Source:
@@ -896,7 +896,7 @@ Parameters:
diff --git a/docs/Menu.html b/docs/Menu.html
index 0c418037..c21a5924 100644
--- a/docs/Menu.html
+++ b/docs/Menu.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new MenuSource:
@@ -201,7 +201,7 @@ CreateMenu<
Source:
@@ -285,7 +285,7 @@ Handl
Source:
@@ -368,7 +368,90 @@ Source:
-
- constants.js, line 844
+ constants.js, line 876
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ NotifyOfLLMReset()
+
+
+
+
+
+
+ Notifies the user that the LLM will be reset.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+
@@ -451,7 +534,7 @@ PopulateD
- Source:
@@ -534,7 +617,7 @@ SaveDataSource:
@@ -617,7 +700,7 @@ ToggleSource:
@@ -741,7 +824,7 @@ Parameters:
diff --git a/docs/Point.html b/docs/Point.html
index e9903cb5..af8388c0 100644
--- a/docs/Point.html
+++ b/docs/Point.html
@@ -24,7 +24,7 @@
@@ -547,7 +547,7 @@ Returns:
diff --git a/docs/Position.html b/docs/Position.html
index be3a8f17..0e66ba43 100644
--- a/docs/Position.html
+++ b/docs/Position.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new Position<
- Source:
@@ -165,7 +165,7 @@ new Position<
diff --git a/docs/Resources.html b/docs/Resources.html
index 6ec6de01..70b507b6 100644
--- a/docs/Resources.html
+++ b/docs/Resources.html
@@ -24,7 +24,7 @@
@@ -200,7 +200,7 @@ GetStringSource:
@@ -329,7 +329,7 @@ Returns:
diff --git a/docs/Review.html b/docs/Review.html
index 9d2226b2..1f476b4e 100644
--- a/docs/Review.html
+++ b/docs/Review.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new ReviewSource:
@@ -200,7 +200,7 @@ Toggl
- Source:
@@ -324,7 +324,7 @@ Parameters:
diff --git a/docs/ScatterPlot.html b/docs/ScatterPlot.html
index 544da78b..5cead09d 100644
--- a/docs/ScatterPlot.html
+++ b/docs/ScatterPlot.html
@@ -24,7 +24,7 @@
@@ -1427,7 +1427,7 @@ SetLineLa
diff --git a/docs/Segmented.html b/docs/Segmented.html
index ce786aee..4824dd59 100644
--- a/docs/Segmented.html
+++ b/docs/Segmented.html
@@ -24,7 +24,7 @@
@@ -892,7 +892,7 @@ UnSel
diff --git a/docs/Tracker.html b/docs/Tracker.html
index dea73e14..e590510b 100644
--- a/docs/Tracker.html
+++ b/docs/Tracker.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new TrackerSource:
@@ -200,7 +200,7 @@ DataSetupSource:
@@ -283,7 +283,7 @@ DeleteSource:
@@ -366,7 +366,7 @@ Do
- Source:
@@ -449,7 +449,7 @@ GetTrac
- Source:
@@ -557,7 +557,7 @@ LogEventSource:
@@ -692,7 +692,7 @@ SaveTr
- Source:
@@ -827,7 +827,7 @@ isUn
- Source:
@@ -956,7 +956,7 @@ Returns:
diff --git a/docs/audio.js.html b/docs/audio.js.html
index 4fc80eab..b00c498a 100644
--- a/docs/audio.js.html
+++ b/docs/audio.js.html
@@ -24,7 +24,7 @@
@@ -638,7 +638,7 @@ audio.js
diff --git a/docs/barplot.js.html b/docs/barplot.js.html
index bf935fe2..aa9fffe5 100644
--- a/docs/barplot.js.html
+++ b/docs/barplot.js.html
@@ -24,7 +24,7 @@
@@ -372,7 +372,7 @@ barplot.js
diff --git a/docs/boxplot.js.html b/docs/boxplot.js.html
index 4bdb587f..4cc26111 100644
--- a/docs/boxplot.js.html
+++ b/docs/boxplot.js.html
@@ -24,7 +24,7 @@
@@ -796,7 +796,7 @@ boxplot.js
diff --git a/docs/constants.js.html b/docs/constants.js.html
index 591d73d7..32d8bacc 100644
--- a/docs/constants.js.html
+++ b/docs/constants.js.html
@@ -24,7 +24,7 @@
@@ -314,6 +314,7 @@ constants.js
openai: 'OpenAI Vision',
gemini: 'Gemini Pro Vision',
multi: 'Multiple AI',
+ processing: 'Processing Chart...',
},
},
};
@@ -484,7 +485,7 @@ constants.js
</div>
</div>
<div class="modal-footer">
- <button type="button" id="save_and_close_menu">Save and Close</button>
+ <button type="button" id="save_and_close_menu" aria-labelledby="save_and_close_text"><span id="save_and_close_text">Save and Close</span></button>
<button type="button" id="close_menu">Close</button>
</div>
</div>
@@ -620,6 +621,16 @@ constants.js
}
},
]);
+
+ // trigger notification that LLM will be reset
+ // this is done on change of LLM model, multi settings, or skill level
+ constants.events.push([
+ document.getElementById('LLM_model'),
+ 'change',
+ function (e) {
+ menu.NotifyOfLLMReset();
+ },
+ ]);
}
/**
@@ -761,6 +772,9 @@ constants.js
document.getElementById('LLM_preferences').value =
constants.LLMPreferences;
}
+ if (document.getElementById('LLM_reset_notification')) {
+ document.getElementById('LLM_reset_notification').remove();
+ }
}
/**
@@ -818,6 +832,24 @@ constants.js
.setAttribute('aria-live', constants.ariaMode);
}
+ /**
+ * Notifies the user that the LLM will be reset.
+ */
+ NotifyOfLLMReset() {
+ let html =
+ '<p id="LLM_reset_notification">Note: Changes in LLM settings will reset any existing conversation.</p>';
+ document
+ .getElementById('save_and_close_menu')
+ .insertAdjacentHTML('beforebegin', html);
+
+ // add to aria button text
+ document
+ .getElementById('save_and_close_menu')
+ .setAttribute(
+ 'aria-labelledby',
+ 'save_and_close_text LLM_reset_notification'
+ );
+ }
/**
* Handles changes to the LLM model and multi-modal settings.
* We reset if we change the LLM model, multi settings, or skill level.
@@ -936,8 +968,11 @@ constants.js
</button>
</div>
<div class="modal-body">
+ <div id="chatLLM_chat_history_wrapper">
<div id="chatLLM_chat_history" aria-live="${constants.ariaMode}" aria-relevant="additions">
</div>
+ <p id="chatLLM_copy_all_wrapper"><button id="chatLLM_copy_all">Copy all to clipboard</button></p>
+ </div>
<div id="chatLLM_content">
<p><input type="text" id="chatLLM_input" class="form-control" name="chatLLM_input" aria-labelledby="chatLLM_title" size="50"></p>
<div class="LLM_suggestions">
@@ -1079,10 +1114,41 @@ constants.js
document.getElementById('reset_chatLLM'),
'click',
function (e) {
- chatLLM.Toggle(false);
chatLLM.ResetChatHistory();
},
]);
+
+ // copy to clipboard
+ constants.events.push([
+ document.getElementById('chatLLM_copy_all'),
+ 'click',
+ function (e) {
+ let text = document.getElementById('chatLLM_chat_history').innerText;
+ // need newlines instead of paragraphs headings etc
+ text = text.replace(/<p>/g, '\n').replace(/<\/p>/g, '\n');
+ text = text.replace(/<h\d>/g, '\n').replace(/<\/h\d>/g, '\n');
+ text = text.replace(/<.*?>/g, '');
+
+ navigator.clipboard.writeText(text);
+ },
+ ]);
+ constants.events.push([
+ document.getElementById('chatLLM_chat_history'),
+ 'click',
+ function (e) {
+ // we're delegating here, so set the event on child .chatLLM_message_copy_button
+ if (e.target.matches('.chatLLM_message_copy_button')) {
+ // get the innerText of the element before the button
+ let text = e.target.closest('p').previousElementSibling.innerText;
+ // need newlines instead of paragraphs headings etc
+ text = text.replace(/<p>/g, '\n').replace(/<\/p>/g, '\n');
+ text = text.replace(/<h\d>/g, '\n').replace(/<\/h\d>/g, '\n');
+ text = text.replace(/<.*?>/g, '');
+
+ navigator.clipboard.writeText(text);
+ }
+ },
+ ]);
}
/**
@@ -1163,7 +1229,7 @@ constants.js
*/
ProcessLLMResponse(data, model) {
chatLLM.WaitingSound(false);
- console.log('LLM response: ', data);
+ //console.log('LLM response: ', data);
let text = '';
let LLMName = resources.GetString(model);
@@ -1367,9 +1433,9 @@ constants.js
};
// Generate the content
- console.log('LLM request: ', prompt, image);
+ //console.log('LLM request: ', prompt, image);
const result = await model.generateContent([prompt, image]);
- console.log(result.response.text());
+ //console.log(result.response.text());
// Process the response
chatLLM.ProcessLLMResponse(result.response, 'gemini');
@@ -1409,6 +1475,12 @@ constants.js
<p class="chatLLM_message_text">${text}</p>
</div>
`;
+ // add a copy button to actual messages
+ if (user != 'User' && text != resources.GetString('processing')) {
+ html += `
+ <p class="chatLLM_message_copy"><button class="chatLLM_message_copy_button">Copy</button></p>
+ `;
+ }
this.RenderChatMessage(html);
}
@@ -1486,7 +1558,11 @@ constants.js
// get name from resource
let LLMName = resources.GetString(constants.LLMModel);
this.firstTime = false;
- this.DisplayChatMessage(LLMName, 'Processing Chart...', true);
+ this.DisplayChatMessage(
+ LLMName,
+ resources.GetString('processing'),
+ true
+ );
let defaultPrompt = this.GetDefaultPrompt();
this.Submit(defaultPrompt, true);
}
@@ -2282,7 +2358,7 @@ constants.js
diff --git a/docs/controls.js.html b/docs/controls.js.html
index fb8a89b4..3fbf1e2e 100644
--- a/docs/controls.js.html
+++ b/docs/controls.js.html
@@ -24,7 +24,7 @@
@@ -3268,7 +3268,7 @@ controls.js
diff --git a/docs/display.js.html b/docs/display.js.html
index a4ee9c53..1f9acd2b 100644
--- a/docs/display.js.html
+++ b/docs/display.js.html
@@ -24,7 +24,7 @@
@@ -1256,7 +1256,7 @@ display.js
diff --git a/docs/global.html b/docs/global.html
index 05f0215f..f8d03800 100644
--- a/docs/global.html
+++ b/docs/global.html
@@ -24,7 +24,7 @@
@@ -1141,7 +1141,7 @@ Parameters:
diff --git a/docs/heatmap.js.html b/docs/heatmap.js.html
index 1d6889a9..9d586522 100644
--- a/docs/heatmap.js.html
+++ b/docs/heatmap.js.html
@@ -24,7 +24,7 @@
@@ -452,7 +452,7 @@ heatmap.js
diff --git a/docs/histogram.js.html b/docs/histogram.js.html
index 86072184..6b459dcd 100644
--- a/docs/histogram.js.html
+++ b/docs/histogram.js.html
@@ -24,7 +24,7 @@
@@ -247,7 +247,7 @@ histogram.js
diff --git a/docs/index.html b/docs/index.html
index a84a0904..008cca1c 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -24,7 +24,7 @@
@@ -57,7 +57,7 @@
diff --git a/docs/init.js.html b/docs/init.js.html
index 613333f3..7c72dea3 100644
--- a/docs/init.js.html
+++ b/docs/init.js.html
@@ -24,7 +24,7 @@
@@ -531,7 +531,7 @@ init.js
diff --git a/docs/lineplot.js.html b/docs/lineplot.js.html
index 03a2adb0..14254718 100644
--- a/docs/lineplot.js.html
+++ b/docs/lineplot.js.html
@@ -24,7 +24,7 @@
@@ -305,7 +305,7 @@ lineplot.js
diff --git a/docs/scatterplot.js.html b/docs/scatterplot.js.html
index 2e7aca1e..1fa53947 100644
--- a/docs/scatterplot.js.html
+++ b/docs/scatterplot.js.html
@@ -24,7 +24,7 @@
@@ -886,7 +886,7 @@ scatterplot.js
diff --git a/docs/segmented.js.html b/docs/segmented.js.html
index c6e5fa00..9a7c6124 100644
--- a/docs/segmented.js.html
+++ b/docs/segmented.js.html
@@ -24,7 +24,7 @@
@@ -377,7 +377,7 @@ segmented.js
toggleT
diff --git a/docs/HeatMap.html b/docs/HeatMap.html
index 30b65009..8921f908 100644
--- a/docs/HeatMap.html
+++ b/docs/HeatMap.html
@@ -24,7 +24,7 @@
@@ -1493,7 +1493,7 @@ update
diff --git a/docs/HeatMapRect.html b/docs/HeatMapRect.html
index 2d32914e..97acbd2e 100644
--- a/docs/HeatMapRect.html
+++ b/docs/HeatMapRect.html
@@ -24,7 +24,7 @@
@@ -256,7 +256,7 @@ UpdateRect<
diff --git a/docs/Helper.html b/docs/Helper.html
index 33a4b8af..fa0ca485 100644
--- a/docs/Helper.html
+++ b/docs/Helper.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new HelperSource:
@@ -200,7 +200,7 @@ (static) Source:
@@ -355,7 +355,7 @@ Returns:
diff --git a/docs/Histogram.html b/docs/Histogram.html
index 8d05052c..cebf3417 100644
--- a/docs/Histogram.html
+++ b/docs/Histogram.html
@@ -24,7 +24,7 @@
@@ -422,7 +422,7 @@ SetMaxMin
diff --git a/docs/Layer0Point.html b/docs/Layer0Point.html
index c847ffe9..d7053be5 100644
--- a/docs/Layer0Point.html
+++ b/docs/Layer0Point.html
@@ -24,7 +24,7 @@
@@ -547,7 +547,7 @@ Returns:
diff --git a/docs/Layer1Point.html b/docs/Layer1Point.html
index 6ce2628e..4dd81951 100644
--- a/docs/Layer1Point.html
+++ b/docs/Layer1Point.html
@@ -24,7 +24,7 @@
@@ -547,7 +547,7 @@ Returns:
diff --git a/docs/LinePlot.html b/docs/LinePlot.html
index 37744fd7..e00b766f 100644
--- a/docs/LinePlot.html
+++ b/docs/LinePlot.html
@@ -24,7 +24,7 @@
@@ -725,7 +725,7 @@ Update
diff --git a/docs/LogError.html b/docs/LogError.html
index 9281b16a..b22a5497 100644
--- a/docs/LogError.html
+++ b/docs/LogError.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new LogError<
Source:
@@ -200,7 +200,7 @@ LogAb
Source:
@@ -335,7 +335,7 @@ Log
Source:
@@ -470,7 +470,7 @@ Lo
Source:
@@ -631,7 +631,7 @@ LogNotArra
Source:
@@ -766,7 +766,7 @@ Log
Source:
@@ -896,7 +896,7 @@ Parameters:
diff --git a/docs/Menu.html b/docs/Menu.html
index 0c418037..c21a5924 100644
--- a/docs/Menu.html
+++ b/docs/Menu.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new MenuSource:
@@ -201,7 +201,7 @@ CreateMenu<
Source:
@@ -285,7 +285,7 @@ Handl
Source:
@@ -368,7 +368,90 @@ Source:
-
- constants.js, line 844
+ constants.js, line 876
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ NotifyOfLLMReset()
+
+
+
+
+
+
+ Notifies the user that the LLM will be reset.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+
@@ -451,7 +534,7 @@ PopulateD
- Source:
@@ -534,7 +617,7 @@ SaveDataSource:
@@ -617,7 +700,7 @@ ToggleSource:
@@ -741,7 +824,7 @@ Parameters:
diff --git a/docs/Point.html b/docs/Point.html
index e9903cb5..af8388c0 100644
--- a/docs/Point.html
+++ b/docs/Point.html
@@ -24,7 +24,7 @@
@@ -547,7 +547,7 @@ Returns:
diff --git a/docs/Position.html b/docs/Position.html
index be3a8f17..0e66ba43 100644
--- a/docs/Position.html
+++ b/docs/Position.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new Position<
- Source:
@@ -165,7 +165,7 @@ new Position<
diff --git a/docs/Resources.html b/docs/Resources.html
index 6ec6de01..70b507b6 100644
--- a/docs/Resources.html
+++ b/docs/Resources.html
@@ -24,7 +24,7 @@
@@ -200,7 +200,7 @@ GetStringSource:
@@ -329,7 +329,7 @@ Returns:
diff --git a/docs/Review.html b/docs/Review.html
index 9d2226b2..1f476b4e 100644
--- a/docs/Review.html
+++ b/docs/Review.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new ReviewSource:
@@ -200,7 +200,7 @@ Toggl
- Source:
@@ -324,7 +324,7 @@ Parameters:
diff --git a/docs/ScatterPlot.html b/docs/ScatterPlot.html
index 544da78b..5cead09d 100644
--- a/docs/ScatterPlot.html
+++ b/docs/ScatterPlot.html
@@ -24,7 +24,7 @@
@@ -1427,7 +1427,7 @@ SetLineLa
diff --git a/docs/Segmented.html b/docs/Segmented.html
index ce786aee..4824dd59 100644
--- a/docs/Segmented.html
+++ b/docs/Segmented.html
@@ -24,7 +24,7 @@
@@ -892,7 +892,7 @@ UnSel
diff --git a/docs/Tracker.html b/docs/Tracker.html
index dea73e14..e590510b 100644
--- a/docs/Tracker.html
+++ b/docs/Tracker.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new TrackerSource:
@@ -200,7 +200,7 @@ DataSetupSource:
@@ -283,7 +283,7 @@ DeleteSource:
@@ -366,7 +366,7 @@ Do
- Source:
@@ -449,7 +449,7 @@ GetTrac
- Source:
@@ -557,7 +557,7 @@ LogEventSource:
@@ -692,7 +692,7 @@ SaveTr
- Source:
@@ -827,7 +827,7 @@ isUn
- Source:
@@ -956,7 +956,7 @@ Returns:
diff --git a/docs/audio.js.html b/docs/audio.js.html
index 4fc80eab..b00c498a 100644
--- a/docs/audio.js.html
+++ b/docs/audio.js.html
@@ -24,7 +24,7 @@
@@ -638,7 +638,7 @@ audio.js
diff --git a/docs/barplot.js.html b/docs/barplot.js.html
index bf935fe2..aa9fffe5 100644
--- a/docs/barplot.js.html
+++ b/docs/barplot.js.html
@@ -24,7 +24,7 @@
@@ -372,7 +372,7 @@ barplot.js
diff --git a/docs/boxplot.js.html b/docs/boxplot.js.html
index 4bdb587f..4cc26111 100644
--- a/docs/boxplot.js.html
+++ b/docs/boxplot.js.html
@@ -24,7 +24,7 @@
@@ -796,7 +796,7 @@ boxplot.js
diff --git a/docs/constants.js.html b/docs/constants.js.html
index 591d73d7..32d8bacc 100644
--- a/docs/constants.js.html
+++ b/docs/constants.js.html
@@ -24,7 +24,7 @@
@@ -314,6 +314,7 @@ constants.js
openai: 'OpenAI Vision',
gemini: 'Gemini Pro Vision',
multi: 'Multiple AI',
+ processing: 'Processing Chart...',
},
},
};
@@ -484,7 +485,7 @@ constants.js
</div>
</div>
<div class="modal-footer">
- <button type="button" id="save_and_close_menu">Save and Close</button>
+ <button type="button" id="save_and_close_menu" aria-labelledby="save_and_close_text"><span id="save_and_close_text">Save and Close</span></button>
<button type="button" id="close_menu">Close</button>
</div>
</div>
@@ -620,6 +621,16 @@ constants.js
}
},
]);
+
+ // trigger notification that LLM will be reset
+ // this is done on change of LLM model, multi settings, or skill level
+ constants.events.push([
+ document.getElementById('LLM_model'),
+ 'change',
+ function (e) {
+ menu.NotifyOfLLMReset();
+ },
+ ]);
}
/**
@@ -761,6 +772,9 @@ constants.js
document.getElementById('LLM_preferences').value =
constants.LLMPreferences;
}
+ if (document.getElementById('LLM_reset_notification')) {
+ document.getElementById('LLM_reset_notification').remove();
+ }
}
/**
@@ -818,6 +832,24 @@ constants.js
.setAttribute('aria-live', constants.ariaMode);
}
+ /**
+ * Notifies the user that the LLM will be reset.
+ */
+ NotifyOfLLMReset() {
+ let html =
+ '<p id="LLM_reset_notification">Note: Changes in LLM settings will reset any existing conversation.</p>';
+ document
+ .getElementById('save_and_close_menu')
+ .insertAdjacentHTML('beforebegin', html);
+
+ // add to aria button text
+ document
+ .getElementById('save_and_close_menu')
+ .setAttribute(
+ 'aria-labelledby',
+ 'save_and_close_text LLM_reset_notification'
+ );
+ }
/**
* Handles changes to the LLM model and multi-modal settings.
* We reset if we change the LLM model, multi settings, or skill level.
@@ -936,8 +968,11 @@ constants.js
</button>
</div>
<div class="modal-body">
+ <div id="chatLLM_chat_history_wrapper">
<div id="chatLLM_chat_history" aria-live="${constants.ariaMode}" aria-relevant="additions">
</div>
+ <p id="chatLLM_copy_all_wrapper"><button id="chatLLM_copy_all">Copy all to clipboard</button></p>
+ </div>
<div id="chatLLM_content">
<p><input type="text" id="chatLLM_input" class="form-control" name="chatLLM_input" aria-labelledby="chatLLM_title" size="50"></p>
<div class="LLM_suggestions">
@@ -1079,10 +1114,41 @@ constants.js
document.getElementById('reset_chatLLM'),
'click',
function (e) {
- chatLLM.Toggle(false);
chatLLM.ResetChatHistory();
},
]);
+
+ // copy to clipboard
+ constants.events.push([
+ document.getElementById('chatLLM_copy_all'),
+ 'click',
+ function (e) {
+ let text = document.getElementById('chatLLM_chat_history').innerText;
+ // need newlines instead of paragraphs headings etc
+ text = text.replace(/<p>/g, '\n').replace(/<\/p>/g, '\n');
+ text = text.replace(/<h\d>/g, '\n').replace(/<\/h\d>/g, '\n');
+ text = text.replace(/<.*?>/g, '');
+
+ navigator.clipboard.writeText(text);
+ },
+ ]);
+ constants.events.push([
+ document.getElementById('chatLLM_chat_history'),
+ 'click',
+ function (e) {
+ // we're delegating here, so set the event on child .chatLLM_message_copy_button
+ if (e.target.matches('.chatLLM_message_copy_button')) {
+ // get the innerText of the element before the button
+ let text = e.target.closest('p').previousElementSibling.innerText;
+ // need newlines instead of paragraphs headings etc
+ text = text.replace(/<p>/g, '\n').replace(/<\/p>/g, '\n');
+ text = text.replace(/<h\d>/g, '\n').replace(/<\/h\d>/g, '\n');
+ text = text.replace(/<.*?>/g, '');
+
+ navigator.clipboard.writeText(text);
+ }
+ },
+ ]);
}
/**
@@ -1163,7 +1229,7 @@ constants.js
*/
ProcessLLMResponse(data, model) {
chatLLM.WaitingSound(false);
- console.log('LLM response: ', data);
+ //console.log('LLM response: ', data);
let text = '';
let LLMName = resources.GetString(model);
@@ -1367,9 +1433,9 @@ constants.js
};
// Generate the content
- console.log('LLM request: ', prompt, image);
+ //console.log('LLM request: ', prompt, image);
const result = await model.generateContent([prompt, image]);
- console.log(result.response.text());
+ //console.log(result.response.text());
// Process the response
chatLLM.ProcessLLMResponse(result.response, 'gemini');
@@ -1409,6 +1475,12 @@ constants.js
<p class="chatLLM_message_text">${text}</p>
</div>
`;
+ // add a copy button to actual messages
+ if (user != 'User' && text != resources.GetString('processing')) {
+ html += `
+ <p class="chatLLM_message_copy"><button class="chatLLM_message_copy_button">Copy</button></p>
+ `;
+ }
this.RenderChatMessage(html);
}
@@ -1486,7 +1558,11 @@ constants.js
// get name from resource
let LLMName = resources.GetString(constants.LLMModel);
this.firstTime = false;
- this.DisplayChatMessage(LLMName, 'Processing Chart...', true);
+ this.DisplayChatMessage(
+ LLMName,
+ resources.GetString('processing'),
+ true
+ );
let defaultPrompt = this.GetDefaultPrompt();
this.Submit(defaultPrompt, true);
}
@@ -2282,7 +2358,7 @@ constants.js
diff --git a/docs/controls.js.html b/docs/controls.js.html
index fb8a89b4..3fbf1e2e 100644
--- a/docs/controls.js.html
+++ b/docs/controls.js.html
@@ -24,7 +24,7 @@
@@ -3268,7 +3268,7 @@ controls.js
diff --git a/docs/display.js.html b/docs/display.js.html
index a4ee9c53..1f9acd2b 100644
--- a/docs/display.js.html
+++ b/docs/display.js.html
@@ -24,7 +24,7 @@
@@ -1256,7 +1256,7 @@ display.js
diff --git a/docs/global.html b/docs/global.html
index 05f0215f..f8d03800 100644
--- a/docs/global.html
+++ b/docs/global.html
@@ -24,7 +24,7 @@
@@ -1141,7 +1141,7 @@ Parameters:
diff --git a/docs/heatmap.js.html b/docs/heatmap.js.html
index 1d6889a9..9d586522 100644
--- a/docs/heatmap.js.html
+++ b/docs/heatmap.js.html
@@ -24,7 +24,7 @@
@@ -452,7 +452,7 @@ heatmap.js
diff --git a/docs/histogram.js.html b/docs/histogram.js.html
index 86072184..6b459dcd 100644
--- a/docs/histogram.js.html
+++ b/docs/histogram.js.html
@@ -24,7 +24,7 @@
@@ -247,7 +247,7 @@ histogram.js
diff --git a/docs/index.html b/docs/index.html
index a84a0904..008cca1c 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -24,7 +24,7 @@
@@ -57,7 +57,7 @@
diff --git a/docs/init.js.html b/docs/init.js.html
index 613333f3..7c72dea3 100644
--- a/docs/init.js.html
+++ b/docs/init.js.html
@@ -24,7 +24,7 @@
@@ -531,7 +531,7 @@ init.js
diff --git a/docs/lineplot.js.html b/docs/lineplot.js.html
index 03a2adb0..14254718 100644
--- a/docs/lineplot.js.html
+++ b/docs/lineplot.js.html
@@ -24,7 +24,7 @@
@@ -305,7 +305,7 @@ lineplot.js
diff --git a/docs/scatterplot.js.html b/docs/scatterplot.js.html
index 2e7aca1e..1fa53947 100644
--- a/docs/scatterplot.js.html
+++ b/docs/scatterplot.js.html
@@ -24,7 +24,7 @@
@@ -886,7 +886,7 @@ scatterplot.js
diff --git a/docs/segmented.js.html b/docs/segmented.js.html
index c6e5fa00..9a7c6124 100644
--- a/docs/segmented.js.html
+++ b/docs/segmented.js.html
@@ -24,7 +24,7 @@
@@ -377,7 +377,7 @@ segmented.js
update
diff --git a/docs/HeatMapRect.html b/docs/HeatMapRect.html
index 2d32914e..97acbd2e 100644
--- a/docs/HeatMapRect.html
+++ b/docs/HeatMapRect.html
@@ -24,7 +24,7 @@
@@ -256,7 +256,7 @@ UpdateRect<
diff --git a/docs/Helper.html b/docs/Helper.html
index 33a4b8af..fa0ca485 100644
--- a/docs/Helper.html
+++ b/docs/Helper.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new HelperSource:
@@ -200,7 +200,7 @@ (static) Source:
@@ -355,7 +355,7 @@ Returns:
diff --git a/docs/Histogram.html b/docs/Histogram.html
index 8d05052c..cebf3417 100644
--- a/docs/Histogram.html
+++ b/docs/Histogram.html
@@ -24,7 +24,7 @@
@@ -422,7 +422,7 @@ SetMaxMin
diff --git a/docs/Layer0Point.html b/docs/Layer0Point.html
index c847ffe9..d7053be5 100644
--- a/docs/Layer0Point.html
+++ b/docs/Layer0Point.html
@@ -24,7 +24,7 @@
@@ -547,7 +547,7 @@ Returns:
diff --git a/docs/Layer1Point.html b/docs/Layer1Point.html
index 6ce2628e..4dd81951 100644
--- a/docs/Layer1Point.html
+++ b/docs/Layer1Point.html
@@ -24,7 +24,7 @@
@@ -547,7 +547,7 @@ Returns:
diff --git a/docs/LinePlot.html b/docs/LinePlot.html
index 37744fd7..e00b766f 100644
--- a/docs/LinePlot.html
+++ b/docs/LinePlot.html
@@ -24,7 +24,7 @@
@@ -725,7 +725,7 @@ Update
diff --git a/docs/LogError.html b/docs/LogError.html
index 9281b16a..b22a5497 100644
--- a/docs/LogError.html
+++ b/docs/LogError.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new LogError<
Source:
@@ -200,7 +200,7 @@ LogAb
Source:
@@ -335,7 +335,7 @@ Log
Source:
@@ -470,7 +470,7 @@ Lo
Source:
@@ -631,7 +631,7 @@ LogNotArra
Source:
@@ -766,7 +766,7 @@ Log
Source:
@@ -896,7 +896,7 @@ Parameters:
diff --git a/docs/Menu.html b/docs/Menu.html
index 0c418037..c21a5924 100644
--- a/docs/Menu.html
+++ b/docs/Menu.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new MenuSource:
@@ -201,7 +201,7 @@ CreateMenu<
Source:
@@ -285,7 +285,7 @@ Handl
Source:
@@ -368,7 +368,90 @@ Source:
-
- constants.js, line 844
+ constants.js, line 876
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ NotifyOfLLMReset()
+
+
+
+
+
+
+ Notifies the user that the LLM will be reset.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+
@@ -451,7 +534,7 @@ PopulateD
- Source:
@@ -534,7 +617,7 @@ SaveDataSource:
@@ -617,7 +700,7 @@ ToggleSource:
@@ -741,7 +824,7 @@ Parameters:
diff --git a/docs/Point.html b/docs/Point.html
index e9903cb5..af8388c0 100644
--- a/docs/Point.html
+++ b/docs/Point.html
@@ -24,7 +24,7 @@
@@ -547,7 +547,7 @@ Returns:
diff --git a/docs/Position.html b/docs/Position.html
index be3a8f17..0e66ba43 100644
--- a/docs/Position.html
+++ b/docs/Position.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new Position<
- Source:
@@ -165,7 +165,7 @@ new Position<
diff --git a/docs/Resources.html b/docs/Resources.html
index 6ec6de01..70b507b6 100644
--- a/docs/Resources.html
+++ b/docs/Resources.html
@@ -24,7 +24,7 @@
@@ -200,7 +200,7 @@ GetStringSource:
@@ -329,7 +329,7 @@ Returns:
diff --git a/docs/Review.html b/docs/Review.html
index 9d2226b2..1f476b4e 100644
--- a/docs/Review.html
+++ b/docs/Review.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new ReviewSource:
@@ -200,7 +200,7 @@ Toggl
- Source:
@@ -324,7 +324,7 @@ Parameters:
diff --git a/docs/ScatterPlot.html b/docs/ScatterPlot.html
index 544da78b..5cead09d 100644
--- a/docs/ScatterPlot.html
+++ b/docs/ScatterPlot.html
@@ -24,7 +24,7 @@
@@ -1427,7 +1427,7 @@ SetLineLa
diff --git a/docs/Segmented.html b/docs/Segmented.html
index ce786aee..4824dd59 100644
--- a/docs/Segmented.html
+++ b/docs/Segmented.html
@@ -24,7 +24,7 @@
@@ -892,7 +892,7 @@ UnSel
diff --git a/docs/Tracker.html b/docs/Tracker.html
index dea73e14..e590510b 100644
--- a/docs/Tracker.html
+++ b/docs/Tracker.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new TrackerSource:
@@ -200,7 +200,7 @@ DataSetupSource:
@@ -283,7 +283,7 @@ DeleteSource:
@@ -366,7 +366,7 @@ Do
- Source:
@@ -449,7 +449,7 @@ GetTrac
- Source:
@@ -557,7 +557,7 @@ LogEventSource:
@@ -692,7 +692,7 @@ SaveTr
- Source:
@@ -827,7 +827,7 @@ isUn
- Source:
@@ -956,7 +956,7 @@ Returns:
diff --git a/docs/audio.js.html b/docs/audio.js.html
index 4fc80eab..b00c498a 100644
--- a/docs/audio.js.html
+++ b/docs/audio.js.html
@@ -24,7 +24,7 @@
@@ -638,7 +638,7 @@ audio.js
diff --git a/docs/barplot.js.html b/docs/barplot.js.html
index bf935fe2..aa9fffe5 100644
--- a/docs/barplot.js.html
+++ b/docs/barplot.js.html
@@ -24,7 +24,7 @@
@@ -372,7 +372,7 @@ barplot.js
diff --git a/docs/boxplot.js.html b/docs/boxplot.js.html
index 4bdb587f..4cc26111 100644
--- a/docs/boxplot.js.html
+++ b/docs/boxplot.js.html
@@ -24,7 +24,7 @@
@@ -796,7 +796,7 @@ boxplot.js
diff --git a/docs/constants.js.html b/docs/constants.js.html
index 591d73d7..32d8bacc 100644
--- a/docs/constants.js.html
+++ b/docs/constants.js.html
@@ -24,7 +24,7 @@
@@ -314,6 +314,7 @@ constants.js
openai: 'OpenAI Vision',
gemini: 'Gemini Pro Vision',
multi: 'Multiple AI',
+ processing: 'Processing Chart...',
},
},
};
@@ -484,7 +485,7 @@ constants.js
</div>
</div>
<div class="modal-footer">
- <button type="button" id="save_and_close_menu">Save and Close</button>
+ <button type="button" id="save_and_close_menu" aria-labelledby="save_and_close_text"><span id="save_and_close_text">Save and Close</span></button>
<button type="button" id="close_menu">Close</button>
</div>
</div>
@@ -620,6 +621,16 @@ constants.js
}
},
]);
+
+ // trigger notification that LLM will be reset
+ // this is done on change of LLM model, multi settings, or skill level
+ constants.events.push([
+ document.getElementById('LLM_model'),
+ 'change',
+ function (e) {
+ menu.NotifyOfLLMReset();
+ },
+ ]);
}
/**
@@ -761,6 +772,9 @@ constants.js
document.getElementById('LLM_preferences').value =
constants.LLMPreferences;
}
+ if (document.getElementById('LLM_reset_notification')) {
+ document.getElementById('LLM_reset_notification').remove();
+ }
}
/**
@@ -818,6 +832,24 @@ constants.js
.setAttribute('aria-live', constants.ariaMode);
}
+ /**
+ * Notifies the user that the LLM will be reset.
+ */
+ NotifyOfLLMReset() {
+ let html =
+ '<p id="LLM_reset_notification">Note: Changes in LLM settings will reset any existing conversation.</p>';
+ document
+ .getElementById('save_and_close_menu')
+ .insertAdjacentHTML('beforebegin', html);
+
+ // add to aria button text
+ document
+ .getElementById('save_and_close_menu')
+ .setAttribute(
+ 'aria-labelledby',
+ 'save_and_close_text LLM_reset_notification'
+ );
+ }
/**
* Handles changes to the LLM model and multi-modal settings.
* We reset if we change the LLM model, multi settings, or skill level.
@@ -936,8 +968,11 @@ constants.js
</button>
</div>
<div class="modal-body">
+ <div id="chatLLM_chat_history_wrapper">
<div id="chatLLM_chat_history" aria-live="${constants.ariaMode}" aria-relevant="additions">
</div>
+ <p id="chatLLM_copy_all_wrapper"><button id="chatLLM_copy_all">Copy all to clipboard</button></p>
+ </div>
<div id="chatLLM_content">
<p><input type="text" id="chatLLM_input" class="form-control" name="chatLLM_input" aria-labelledby="chatLLM_title" size="50"></p>
<div class="LLM_suggestions">
@@ -1079,10 +1114,41 @@ constants.js
document.getElementById('reset_chatLLM'),
'click',
function (e) {
- chatLLM.Toggle(false);
chatLLM.ResetChatHistory();
},
]);
+
+ // copy to clipboard
+ constants.events.push([
+ document.getElementById('chatLLM_copy_all'),
+ 'click',
+ function (e) {
+ let text = document.getElementById('chatLLM_chat_history').innerText;
+ // need newlines instead of paragraphs headings etc
+ text = text.replace(/<p>/g, '\n').replace(/<\/p>/g, '\n');
+ text = text.replace(/<h\d>/g, '\n').replace(/<\/h\d>/g, '\n');
+ text = text.replace(/<.*?>/g, '');
+
+ navigator.clipboard.writeText(text);
+ },
+ ]);
+ constants.events.push([
+ document.getElementById('chatLLM_chat_history'),
+ 'click',
+ function (e) {
+ // we're delegating here, so set the event on child .chatLLM_message_copy_button
+ if (e.target.matches('.chatLLM_message_copy_button')) {
+ // get the innerText of the element before the button
+ let text = e.target.closest('p').previousElementSibling.innerText;
+ // need newlines instead of paragraphs headings etc
+ text = text.replace(/<p>/g, '\n').replace(/<\/p>/g, '\n');
+ text = text.replace(/<h\d>/g, '\n').replace(/<\/h\d>/g, '\n');
+ text = text.replace(/<.*?>/g, '');
+
+ navigator.clipboard.writeText(text);
+ }
+ },
+ ]);
}
/**
@@ -1163,7 +1229,7 @@ constants.js
*/
ProcessLLMResponse(data, model) {
chatLLM.WaitingSound(false);
- console.log('LLM response: ', data);
+ //console.log('LLM response: ', data);
let text = '';
let LLMName = resources.GetString(model);
@@ -1367,9 +1433,9 @@ constants.js
};
// Generate the content
- console.log('LLM request: ', prompt, image);
+ //console.log('LLM request: ', prompt, image);
const result = await model.generateContent([prompt, image]);
- console.log(result.response.text());
+ //console.log(result.response.text());
// Process the response
chatLLM.ProcessLLMResponse(result.response, 'gemini');
@@ -1409,6 +1475,12 @@ constants.js
<p class="chatLLM_message_text">${text}</p>
</div>
`;
+ // add a copy button to actual messages
+ if (user != 'User' && text != resources.GetString('processing')) {
+ html += `
+ <p class="chatLLM_message_copy"><button class="chatLLM_message_copy_button">Copy</button></p>
+ `;
+ }
this.RenderChatMessage(html);
}
@@ -1486,7 +1558,11 @@ constants.js
// get name from resource
let LLMName = resources.GetString(constants.LLMModel);
this.firstTime = false;
- this.DisplayChatMessage(LLMName, 'Processing Chart...', true);
+ this.DisplayChatMessage(
+ LLMName,
+ resources.GetString('processing'),
+ true
+ );
let defaultPrompt = this.GetDefaultPrompt();
this.Submit(defaultPrompt, true);
}
@@ -2282,7 +2358,7 @@ constants.js
diff --git a/docs/controls.js.html b/docs/controls.js.html
index fb8a89b4..3fbf1e2e 100644
--- a/docs/controls.js.html
+++ b/docs/controls.js.html
@@ -24,7 +24,7 @@
@@ -3268,7 +3268,7 @@ controls.js
diff --git a/docs/display.js.html b/docs/display.js.html
index a4ee9c53..1f9acd2b 100644
--- a/docs/display.js.html
+++ b/docs/display.js.html
@@ -24,7 +24,7 @@
@@ -1256,7 +1256,7 @@ display.js
diff --git a/docs/global.html b/docs/global.html
index 05f0215f..f8d03800 100644
--- a/docs/global.html
+++ b/docs/global.html
@@ -24,7 +24,7 @@
@@ -1141,7 +1141,7 @@ Parameters:
diff --git a/docs/heatmap.js.html b/docs/heatmap.js.html
index 1d6889a9..9d586522 100644
--- a/docs/heatmap.js.html
+++ b/docs/heatmap.js.html
@@ -24,7 +24,7 @@
@@ -452,7 +452,7 @@ heatmap.js
diff --git a/docs/histogram.js.html b/docs/histogram.js.html
index 86072184..6b459dcd 100644
--- a/docs/histogram.js.html
+++ b/docs/histogram.js.html
@@ -24,7 +24,7 @@
@@ -247,7 +247,7 @@ histogram.js
diff --git a/docs/index.html b/docs/index.html
index a84a0904..008cca1c 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -24,7 +24,7 @@
@@ -57,7 +57,7 @@
diff --git a/docs/init.js.html b/docs/init.js.html
index 613333f3..7c72dea3 100644
--- a/docs/init.js.html
+++ b/docs/init.js.html
@@ -24,7 +24,7 @@
@@ -531,7 +531,7 @@ init.js
diff --git a/docs/lineplot.js.html b/docs/lineplot.js.html
index 03a2adb0..14254718 100644
--- a/docs/lineplot.js.html
+++ b/docs/lineplot.js.html
@@ -24,7 +24,7 @@
@@ -305,7 +305,7 @@ lineplot.js
diff --git a/docs/scatterplot.js.html b/docs/scatterplot.js.html
index 2e7aca1e..1fa53947 100644
--- a/docs/scatterplot.js.html
+++ b/docs/scatterplot.js.html
@@ -24,7 +24,7 @@
@@ -886,7 +886,7 @@ scatterplot.js
diff --git a/docs/segmented.js.html b/docs/segmented.js.html
index c6e5fa00..9a7c6124 100644
--- a/docs/segmented.js.html
+++ b/docs/segmented.js.html
@@ -24,7 +24,7 @@
@@ -377,7 +377,7 @@ segmented.js
UpdateRect<
diff --git a/docs/Helper.html b/docs/Helper.html
index 33a4b8af..fa0ca485 100644
--- a/docs/Helper.html
+++ b/docs/Helper.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new HelperSource:
@@ -200,7 +200,7 @@ (static) Source:
@@ -355,7 +355,7 @@ Returns:
diff --git a/docs/Histogram.html b/docs/Histogram.html
index 8d05052c..cebf3417 100644
--- a/docs/Histogram.html
+++ b/docs/Histogram.html
@@ -24,7 +24,7 @@
@@ -422,7 +422,7 @@ SetMaxMin
diff --git a/docs/Layer0Point.html b/docs/Layer0Point.html
index c847ffe9..d7053be5 100644
--- a/docs/Layer0Point.html
+++ b/docs/Layer0Point.html
@@ -24,7 +24,7 @@
@@ -547,7 +547,7 @@ Returns:
diff --git a/docs/Layer1Point.html b/docs/Layer1Point.html
index 6ce2628e..4dd81951 100644
--- a/docs/Layer1Point.html
+++ b/docs/Layer1Point.html
@@ -24,7 +24,7 @@
@@ -547,7 +547,7 @@ Returns:
diff --git a/docs/LinePlot.html b/docs/LinePlot.html
index 37744fd7..e00b766f 100644
--- a/docs/LinePlot.html
+++ b/docs/LinePlot.html
@@ -24,7 +24,7 @@
@@ -725,7 +725,7 @@ Update
diff --git a/docs/LogError.html b/docs/LogError.html
index 9281b16a..b22a5497 100644
--- a/docs/LogError.html
+++ b/docs/LogError.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new LogError<
Source:
@@ -200,7 +200,7 @@ LogAb
Source:
@@ -335,7 +335,7 @@ Log
Source:
@@ -470,7 +470,7 @@ Lo
Source:
@@ -631,7 +631,7 @@ LogNotArra
Source:
@@ -766,7 +766,7 @@ Log
Source:
@@ -896,7 +896,7 @@ Parameters:
diff --git a/docs/Menu.html b/docs/Menu.html
index 0c418037..c21a5924 100644
--- a/docs/Menu.html
+++ b/docs/Menu.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new MenuSource:
@@ -201,7 +201,7 @@ CreateMenu<
Source:
@@ -285,7 +285,7 @@ Handl
Source:
@@ -368,7 +368,90 @@ Source:
-
- constants.js, line 844
+ constants.js, line 876
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ NotifyOfLLMReset()
+
+
+
+
+
+
+ Notifies the user that the LLM will be reset.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+
@@ -451,7 +534,7 @@ PopulateD
- Source:
@@ -534,7 +617,7 @@ SaveDataSource:
@@ -617,7 +700,7 @@ ToggleSource:
@@ -741,7 +824,7 @@ Parameters:
diff --git a/docs/Point.html b/docs/Point.html
index e9903cb5..af8388c0 100644
--- a/docs/Point.html
+++ b/docs/Point.html
@@ -24,7 +24,7 @@
@@ -547,7 +547,7 @@ Returns:
diff --git a/docs/Position.html b/docs/Position.html
index be3a8f17..0e66ba43 100644
--- a/docs/Position.html
+++ b/docs/Position.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new Position<
- Source:
@@ -165,7 +165,7 @@ new Position<
diff --git a/docs/Resources.html b/docs/Resources.html
index 6ec6de01..70b507b6 100644
--- a/docs/Resources.html
+++ b/docs/Resources.html
@@ -24,7 +24,7 @@
@@ -200,7 +200,7 @@ GetStringSource:
@@ -329,7 +329,7 @@ Returns:
diff --git a/docs/Review.html b/docs/Review.html
index 9d2226b2..1f476b4e 100644
--- a/docs/Review.html
+++ b/docs/Review.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new ReviewSource:
@@ -200,7 +200,7 @@ Toggl
- Source:
@@ -324,7 +324,7 @@ Parameters:
diff --git a/docs/ScatterPlot.html b/docs/ScatterPlot.html
index 544da78b..5cead09d 100644
--- a/docs/ScatterPlot.html
+++ b/docs/ScatterPlot.html
@@ -24,7 +24,7 @@
@@ -1427,7 +1427,7 @@ SetLineLa
diff --git a/docs/Segmented.html b/docs/Segmented.html
index ce786aee..4824dd59 100644
--- a/docs/Segmented.html
+++ b/docs/Segmented.html
@@ -24,7 +24,7 @@
@@ -892,7 +892,7 @@ UnSel
diff --git a/docs/Tracker.html b/docs/Tracker.html
index dea73e14..e590510b 100644
--- a/docs/Tracker.html
+++ b/docs/Tracker.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new TrackerSource:
@@ -200,7 +200,7 @@ DataSetupSource:
@@ -283,7 +283,7 @@ DeleteSource:
@@ -366,7 +366,7 @@ Do
- Source:
@@ -449,7 +449,7 @@ GetTrac
- Source:
@@ -557,7 +557,7 @@ LogEventSource:
@@ -692,7 +692,7 @@ SaveTr
- Source:
@@ -827,7 +827,7 @@ isUn
- Source:
@@ -956,7 +956,7 @@ Returns:
diff --git a/docs/audio.js.html b/docs/audio.js.html
index 4fc80eab..b00c498a 100644
--- a/docs/audio.js.html
+++ b/docs/audio.js.html
@@ -24,7 +24,7 @@
@@ -638,7 +638,7 @@ audio.js
diff --git a/docs/barplot.js.html b/docs/barplot.js.html
index bf935fe2..aa9fffe5 100644
--- a/docs/barplot.js.html
+++ b/docs/barplot.js.html
@@ -24,7 +24,7 @@
@@ -372,7 +372,7 @@ barplot.js
diff --git a/docs/boxplot.js.html b/docs/boxplot.js.html
index 4bdb587f..4cc26111 100644
--- a/docs/boxplot.js.html
+++ b/docs/boxplot.js.html
@@ -24,7 +24,7 @@
@@ -796,7 +796,7 @@ boxplot.js
diff --git a/docs/constants.js.html b/docs/constants.js.html
index 591d73d7..32d8bacc 100644
--- a/docs/constants.js.html
+++ b/docs/constants.js.html
@@ -24,7 +24,7 @@
@@ -314,6 +314,7 @@ constants.js
openai: 'OpenAI Vision',
gemini: 'Gemini Pro Vision',
multi: 'Multiple AI',
+ processing: 'Processing Chart...',
},
},
};
@@ -484,7 +485,7 @@ constants.js
</div>
</div>
<div class="modal-footer">
- <button type="button" id="save_and_close_menu">Save and Close</button>
+ <button type="button" id="save_and_close_menu" aria-labelledby="save_and_close_text"><span id="save_and_close_text">Save and Close</span></button>
<button type="button" id="close_menu">Close</button>
</div>
</div>
@@ -620,6 +621,16 @@ constants.js
}
},
]);
+
+ // trigger notification that LLM will be reset
+ // this is done on change of LLM model, multi settings, or skill level
+ constants.events.push([
+ document.getElementById('LLM_model'),
+ 'change',
+ function (e) {
+ menu.NotifyOfLLMReset();
+ },
+ ]);
}
/**
@@ -761,6 +772,9 @@ constants.js
document.getElementById('LLM_preferences').value =
constants.LLMPreferences;
}
+ if (document.getElementById('LLM_reset_notification')) {
+ document.getElementById('LLM_reset_notification').remove();
+ }
}
/**
@@ -818,6 +832,24 @@ constants.js
.setAttribute('aria-live', constants.ariaMode);
}
+ /**
+ * Notifies the user that the LLM will be reset.
+ */
+ NotifyOfLLMReset() {
+ let html =
+ '<p id="LLM_reset_notification">Note: Changes in LLM settings will reset any existing conversation.</p>';
+ document
+ .getElementById('save_and_close_menu')
+ .insertAdjacentHTML('beforebegin', html);
+
+ // add to aria button text
+ document
+ .getElementById('save_and_close_menu')
+ .setAttribute(
+ 'aria-labelledby',
+ 'save_and_close_text LLM_reset_notification'
+ );
+ }
/**
* Handles changes to the LLM model and multi-modal settings.
* We reset if we change the LLM model, multi settings, or skill level.
@@ -936,8 +968,11 @@ constants.js
</button>
</div>
<div class="modal-body">
+ <div id="chatLLM_chat_history_wrapper">
<div id="chatLLM_chat_history" aria-live="${constants.ariaMode}" aria-relevant="additions">
</div>
+ <p id="chatLLM_copy_all_wrapper"><button id="chatLLM_copy_all">Copy all to clipboard</button></p>
+ </div>
<div id="chatLLM_content">
<p><input type="text" id="chatLLM_input" class="form-control" name="chatLLM_input" aria-labelledby="chatLLM_title" size="50"></p>
<div class="LLM_suggestions">
@@ -1079,10 +1114,41 @@ constants.js
document.getElementById('reset_chatLLM'),
'click',
function (e) {
- chatLLM.Toggle(false);
chatLLM.ResetChatHistory();
},
]);
+
+ // copy to clipboard
+ constants.events.push([
+ document.getElementById('chatLLM_copy_all'),
+ 'click',
+ function (e) {
+ let text = document.getElementById('chatLLM_chat_history').innerText;
+ // need newlines instead of paragraphs headings etc
+ text = text.replace(/<p>/g, '\n').replace(/<\/p>/g, '\n');
+ text = text.replace(/<h\d>/g, '\n').replace(/<\/h\d>/g, '\n');
+ text = text.replace(/<.*?>/g, '');
+
+ navigator.clipboard.writeText(text);
+ },
+ ]);
+ constants.events.push([
+ document.getElementById('chatLLM_chat_history'),
+ 'click',
+ function (e) {
+ // we're delegating here, so set the event on child .chatLLM_message_copy_button
+ if (e.target.matches('.chatLLM_message_copy_button')) {
+ // get the innerText of the element before the button
+ let text = e.target.closest('p').previousElementSibling.innerText;
+ // need newlines instead of paragraphs headings etc
+ text = text.replace(/<p>/g, '\n').replace(/<\/p>/g, '\n');
+ text = text.replace(/<h\d>/g, '\n').replace(/<\/h\d>/g, '\n');
+ text = text.replace(/<.*?>/g, '');
+
+ navigator.clipboard.writeText(text);
+ }
+ },
+ ]);
}
/**
@@ -1163,7 +1229,7 @@ constants.js
*/
ProcessLLMResponse(data, model) {
chatLLM.WaitingSound(false);
- console.log('LLM response: ', data);
+ //console.log('LLM response: ', data);
let text = '';
let LLMName = resources.GetString(model);
@@ -1367,9 +1433,9 @@ constants.js
};
// Generate the content
- console.log('LLM request: ', prompt, image);
+ //console.log('LLM request: ', prompt, image);
const result = await model.generateContent([prompt, image]);
- console.log(result.response.text());
+ //console.log(result.response.text());
// Process the response
chatLLM.ProcessLLMResponse(result.response, 'gemini');
@@ -1409,6 +1475,12 @@ constants.js
<p class="chatLLM_message_text">${text}</p>
</div>
`;
+ // add a copy button to actual messages
+ if (user != 'User' && text != resources.GetString('processing')) {
+ html += `
+ <p class="chatLLM_message_copy"><button class="chatLLM_message_copy_button">Copy</button></p>
+ `;
+ }
this.RenderChatMessage(html);
}
@@ -1486,7 +1558,11 @@ constants.js
// get name from resource
let LLMName = resources.GetString(constants.LLMModel);
this.firstTime = false;
- this.DisplayChatMessage(LLMName, 'Processing Chart...', true);
+ this.DisplayChatMessage(
+ LLMName,
+ resources.GetString('processing'),
+ true
+ );
let defaultPrompt = this.GetDefaultPrompt();
this.Submit(defaultPrompt, true);
}
@@ -2282,7 +2358,7 @@ constants.js
diff --git a/docs/controls.js.html b/docs/controls.js.html
index fb8a89b4..3fbf1e2e 100644
--- a/docs/controls.js.html
+++ b/docs/controls.js.html
@@ -24,7 +24,7 @@
@@ -3268,7 +3268,7 @@ controls.js
diff --git a/docs/display.js.html b/docs/display.js.html
index a4ee9c53..1f9acd2b 100644
--- a/docs/display.js.html
+++ b/docs/display.js.html
@@ -24,7 +24,7 @@
@@ -1256,7 +1256,7 @@ display.js
diff --git a/docs/global.html b/docs/global.html
index 05f0215f..f8d03800 100644
--- a/docs/global.html
+++ b/docs/global.html
@@ -24,7 +24,7 @@
@@ -1141,7 +1141,7 @@ Parameters:
diff --git a/docs/heatmap.js.html b/docs/heatmap.js.html
index 1d6889a9..9d586522 100644
--- a/docs/heatmap.js.html
+++ b/docs/heatmap.js.html
@@ -24,7 +24,7 @@
@@ -452,7 +452,7 @@ heatmap.js
diff --git a/docs/histogram.js.html b/docs/histogram.js.html
index 86072184..6b459dcd 100644
--- a/docs/histogram.js.html
+++ b/docs/histogram.js.html
@@ -24,7 +24,7 @@
@@ -247,7 +247,7 @@ histogram.js
diff --git a/docs/index.html b/docs/index.html
index a84a0904..008cca1c 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -24,7 +24,7 @@
@@ -57,7 +57,7 @@
diff --git a/docs/init.js.html b/docs/init.js.html
index 613333f3..7c72dea3 100644
--- a/docs/init.js.html
+++ b/docs/init.js.html
@@ -24,7 +24,7 @@
@@ -531,7 +531,7 @@ init.js
diff --git a/docs/lineplot.js.html b/docs/lineplot.js.html
index 03a2adb0..14254718 100644
--- a/docs/lineplot.js.html
+++ b/docs/lineplot.js.html
@@ -24,7 +24,7 @@
@@ -305,7 +305,7 @@ lineplot.js
diff --git a/docs/scatterplot.js.html b/docs/scatterplot.js.html
index 2e7aca1e..1fa53947 100644
--- a/docs/scatterplot.js.html
+++ b/docs/scatterplot.js.html
@@ -24,7 +24,7 @@
@@ -886,7 +886,7 @@ scatterplot.js
diff --git a/docs/segmented.js.html b/docs/segmented.js.html
index c6e5fa00..9a7c6124 100644
--- a/docs/segmented.js.html
+++ b/docs/segmented.js.html
@@ -24,7 +24,7 @@
@@ -377,7 +377,7 @@ segmented.js
new HelperSource:
@@ -200,7 +200,7 @@ (static) Source:
@@ -355,7 +355,7 @@ Returns:
diff --git a/docs/Histogram.html b/docs/Histogram.html
index 8d05052c..cebf3417 100644
--- a/docs/Histogram.html
+++ b/docs/Histogram.html
@@ -24,7 +24,7 @@
@@ -422,7 +422,7 @@ SetMaxMin
diff --git a/docs/Layer0Point.html b/docs/Layer0Point.html
index c847ffe9..d7053be5 100644
--- a/docs/Layer0Point.html
+++ b/docs/Layer0Point.html
@@ -24,7 +24,7 @@
@@ -547,7 +547,7 @@ Returns:
diff --git a/docs/Layer1Point.html b/docs/Layer1Point.html
index 6ce2628e..4dd81951 100644
--- a/docs/Layer1Point.html
+++ b/docs/Layer1Point.html
@@ -24,7 +24,7 @@
@@ -547,7 +547,7 @@ Returns:
diff --git a/docs/LinePlot.html b/docs/LinePlot.html
index 37744fd7..e00b766f 100644
--- a/docs/LinePlot.html
+++ b/docs/LinePlot.html
@@ -24,7 +24,7 @@
@@ -725,7 +725,7 @@ Update
diff --git a/docs/LogError.html b/docs/LogError.html
index 9281b16a..b22a5497 100644
--- a/docs/LogError.html
+++ b/docs/LogError.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new LogError<
Source:
@@ -200,7 +200,7 @@ LogAb
Source:
@@ -335,7 +335,7 @@ Log
Source:
@@ -470,7 +470,7 @@ Lo
Source:
@@ -631,7 +631,7 @@ LogNotArra
Source:
@@ -766,7 +766,7 @@ Log
Source:
@@ -896,7 +896,7 @@ Parameters:
diff --git a/docs/Menu.html b/docs/Menu.html
index 0c418037..c21a5924 100644
--- a/docs/Menu.html
+++ b/docs/Menu.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new MenuSource:
@@ -201,7 +201,7 @@ CreateMenu<
Source:
@@ -285,7 +285,7 @@ Handl
Source:
@@ -368,7 +368,90 @@ Source:
-
- constants.js, line 844
+ constants.js, line 876
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ NotifyOfLLMReset()
+
+
+
+
+
+
+ Notifies the user that the LLM will be reset.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+
@@ -451,7 +534,7 @@ PopulateD
- Source:
@@ -534,7 +617,7 @@ SaveDataSource:
@@ -617,7 +700,7 @@ ToggleSource:
@@ -741,7 +824,7 @@ Parameters:
diff --git a/docs/Point.html b/docs/Point.html
index e9903cb5..af8388c0 100644
--- a/docs/Point.html
+++ b/docs/Point.html
@@ -24,7 +24,7 @@
@@ -547,7 +547,7 @@ Returns:
diff --git a/docs/Position.html b/docs/Position.html
index be3a8f17..0e66ba43 100644
--- a/docs/Position.html
+++ b/docs/Position.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new Position<
- Source:
@@ -165,7 +165,7 @@ new Position<
diff --git a/docs/Resources.html b/docs/Resources.html
index 6ec6de01..70b507b6 100644
--- a/docs/Resources.html
+++ b/docs/Resources.html
@@ -24,7 +24,7 @@
@@ -200,7 +200,7 @@ GetStringSource:
@@ -329,7 +329,7 @@ Returns:
diff --git a/docs/Review.html b/docs/Review.html
index 9d2226b2..1f476b4e 100644
--- a/docs/Review.html
+++ b/docs/Review.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new ReviewSource:
@@ -200,7 +200,7 @@ Toggl
- Source:
@@ -324,7 +324,7 @@ Parameters:
diff --git a/docs/ScatterPlot.html b/docs/ScatterPlot.html
index 544da78b..5cead09d 100644
--- a/docs/ScatterPlot.html
+++ b/docs/ScatterPlot.html
@@ -24,7 +24,7 @@
@@ -1427,7 +1427,7 @@ SetLineLa
diff --git a/docs/Segmented.html b/docs/Segmented.html
index ce786aee..4824dd59 100644
--- a/docs/Segmented.html
+++ b/docs/Segmented.html
@@ -24,7 +24,7 @@
@@ -892,7 +892,7 @@ UnSel
diff --git a/docs/Tracker.html b/docs/Tracker.html
index dea73e14..e590510b 100644
--- a/docs/Tracker.html
+++ b/docs/Tracker.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new TrackerSource:
@@ -200,7 +200,7 @@ DataSetupSource:
@@ -283,7 +283,7 @@ DeleteSource:
@@ -366,7 +366,7 @@ Do
- Source:
@@ -449,7 +449,7 @@ GetTrac
- Source:
@@ -557,7 +557,7 @@ LogEventSource:
@@ -692,7 +692,7 @@ SaveTr
- Source:
@@ -827,7 +827,7 @@ isUn
- Source:
@@ -956,7 +956,7 @@ Returns:
diff --git a/docs/audio.js.html b/docs/audio.js.html
index 4fc80eab..b00c498a 100644
--- a/docs/audio.js.html
+++ b/docs/audio.js.html
@@ -24,7 +24,7 @@
@@ -638,7 +638,7 @@ audio.js
diff --git a/docs/barplot.js.html b/docs/barplot.js.html
index bf935fe2..aa9fffe5 100644
--- a/docs/barplot.js.html
+++ b/docs/barplot.js.html
@@ -24,7 +24,7 @@
@@ -372,7 +372,7 @@ barplot.js
diff --git a/docs/boxplot.js.html b/docs/boxplot.js.html
index 4bdb587f..4cc26111 100644
--- a/docs/boxplot.js.html
+++ b/docs/boxplot.js.html
@@ -24,7 +24,7 @@
@@ -796,7 +796,7 @@ boxplot.js
diff --git a/docs/constants.js.html b/docs/constants.js.html
index 591d73d7..32d8bacc 100644
--- a/docs/constants.js.html
+++ b/docs/constants.js.html
@@ -24,7 +24,7 @@
@@ -314,6 +314,7 @@ constants.js
openai: 'OpenAI Vision',
gemini: 'Gemini Pro Vision',
multi: 'Multiple AI',
+ processing: 'Processing Chart...',
},
},
};
@@ -484,7 +485,7 @@ constants.js
</div>
</div>
<div class="modal-footer">
- <button type="button" id="save_and_close_menu">Save and Close</button>
+ <button type="button" id="save_and_close_menu" aria-labelledby="save_and_close_text"><span id="save_and_close_text">Save and Close</span></button>
<button type="button" id="close_menu">Close</button>
</div>
</div>
@@ -620,6 +621,16 @@ constants.js
}
},
]);
+
+ // trigger notification that LLM will be reset
+ // this is done on change of LLM model, multi settings, or skill level
+ constants.events.push([
+ document.getElementById('LLM_model'),
+ 'change',
+ function (e) {
+ menu.NotifyOfLLMReset();
+ },
+ ]);
}
/**
@@ -761,6 +772,9 @@ constants.js
document.getElementById('LLM_preferences').value =
constants.LLMPreferences;
}
+ if (document.getElementById('LLM_reset_notification')) {
+ document.getElementById('LLM_reset_notification').remove();
+ }
}
/**
@@ -818,6 +832,24 @@ constants.js
.setAttribute('aria-live', constants.ariaMode);
}
+ /**
+ * Notifies the user that the LLM will be reset.
+ */
+ NotifyOfLLMReset() {
+ let html =
+ '<p id="LLM_reset_notification">Note: Changes in LLM settings will reset any existing conversation.</p>';
+ document
+ .getElementById('save_and_close_menu')
+ .insertAdjacentHTML('beforebegin', html);
+
+ // add to aria button text
+ document
+ .getElementById('save_and_close_menu')
+ .setAttribute(
+ 'aria-labelledby',
+ 'save_and_close_text LLM_reset_notification'
+ );
+ }
/**
* Handles changes to the LLM model and multi-modal settings.
* We reset if we change the LLM model, multi settings, or skill level.
@@ -936,8 +968,11 @@ constants.js
</button>
</div>
<div class="modal-body">
+ <div id="chatLLM_chat_history_wrapper">
<div id="chatLLM_chat_history" aria-live="${constants.ariaMode}" aria-relevant="additions">
</div>
+ <p id="chatLLM_copy_all_wrapper"><button id="chatLLM_copy_all">Copy all to clipboard</button></p>
+ </div>
<div id="chatLLM_content">
<p><input type="text" id="chatLLM_input" class="form-control" name="chatLLM_input" aria-labelledby="chatLLM_title" size="50"></p>
<div class="LLM_suggestions">
@@ -1079,10 +1114,41 @@ constants.js
document.getElementById('reset_chatLLM'),
'click',
function (e) {
- chatLLM.Toggle(false);
chatLLM.ResetChatHistory();
},
]);
+
+ // copy to clipboard
+ constants.events.push([
+ document.getElementById('chatLLM_copy_all'),
+ 'click',
+ function (e) {
+ let text = document.getElementById('chatLLM_chat_history').innerText;
+ // need newlines instead of paragraphs headings etc
+ text = text.replace(/<p>/g, '\n').replace(/<\/p>/g, '\n');
+ text = text.replace(/<h\d>/g, '\n').replace(/<\/h\d>/g, '\n');
+ text = text.replace(/<.*?>/g, '');
+
+ navigator.clipboard.writeText(text);
+ },
+ ]);
+ constants.events.push([
+ document.getElementById('chatLLM_chat_history'),
+ 'click',
+ function (e) {
+ // we're delegating here, so set the event on child .chatLLM_message_copy_button
+ if (e.target.matches('.chatLLM_message_copy_button')) {
+ // get the innerText of the element before the button
+ let text = e.target.closest('p').previousElementSibling.innerText;
+ // need newlines instead of paragraphs headings etc
+ text = text.replace(/<p>/g, '\n').replace(/<\/p>/g, '\n');
+ text = text.replace(/<h\d>/g, '\n').replace(/<\/h\d>/g, '\n');
+ text = text.replace(/<.*?>/g, '');
+
+ navigator.clipboard.writeText(text);
+ }
+ },
+ ]);
}
/**
@@ -1163,7 +1229,7 @@ constants.js
*/
ProcessLLMResponse(data, model) {
chatLLM.WaitingSound(false);
- console.log('LLM response: ', data);
+ //console.log('LLM response: ', data);
let text = '';
let LLMName = resources.GetString(model);
@@ -1367,9 +1433,9 @@ constants.js
};
// Generate the content
- console.log('LLM request: ', prompt, image);
+ //console.log('LLM request: ', prompt, image);
const result = await model.generateContent([prompt, image]);
- console.log(result.response.text());
+ //console.log(result.response.text());
// Process the response
chatLLM.ProcessLLMResponse(result.response, 'gemini');
@@ -1409,6 +1475,12 @@ constants.js
<p class="chatLLM_message_text">${text}</p>
</div>
`;
+ // add a copy button to actual messages
+ if (user != 'User' && text != resources.GetString('processing')) {
+ html += `
+ <p class="chatLLM_message_copy"><button class="chatLLM_message_copy_button">Copy</button></p>
+ `;
+ }
this.RenderChatMessage(html);
}
@@ -1486,7 +1558,11 @@ constants.js
// get name from resource
let LLMName = resources.GetString(constants.LLMModel);
this.firstTime = false;
- this.DisplayChatMessage(LLMName, 'Processing Chart...', true);
+ this.DisplayChatMessage(
+ LLMName,
+ resources.GetString('processing'),
+ true
+ );
let defaultPrompt = this.GetDefaultPrompt();
this.Submit(defaultPrompt, true);
}
@@ -2282,7 +2358,7 @@ constants.js
diff --git a/docs/controls.js.html b/docs/controls.js.html
index fb8a89b4..3fbf1e2e 100644
--- a/docs/controls.js.html
+++ b/docs/controls.js.html
@@ -24,7 +24,7 @@
@@ -3268,7 +3268,7 @@ controls.js
diff --git a/docs/display.js.html b/docs/display.js.html
index a4ee9c53..1f9acd2b 100644
--- a/docs/display.js.html
+++ b/docs/display.js.html
@@ -24,7 +24,7 @@
@@ -1256,7 +1256,7 @@ display.js
diff --git a/docs/global.html b/docs/global.html
index 05f0215f..f8d03800 100644
--- a/docs/global.html
+++ b/docs/global.html
@@ -24,7 +24,7 @@
@@ -1141,7 +1141,7 @@ Parameters:
diff --git a/docs/heatmap.js.html b/docs/heatmap.js.html
index 1d6889a9..9d586522 100644
--- a/docs/heatmap.js.html
+++ b/docs/heatmap.js.html
@@ -24,7 +24,7 @@
@@ -452,7 +452,7 @@ heatmap.js
diff --git a/docs/histogram.js.html b/docs/histogram.js.html
index 86072184..6b459dcd 100644
--- a/docs/histogram.js.html
+++ b/docs/histogram.js.html
@@ -24,7 +24,7 @@
@@ -247,7 +247,7 @@ histogram.js
diff --git a/docs/index.html b/docs/index.html
index a84a0904..008cca1c 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -24,7 +24,7 @@
@@ -57,7 +57,7 @@
diff --git a/docs/init.js.html b/docs/init.js.html
index 613333f3..7c72dea3 100644
--- a/docs/init.js.html
+++ b/docs/init.js.html
@@ -24,7 +24,7 @@
@@ -531,7 +531,7 @@ init.js
diff --git a/docs/lineplot.js.html b/docs/lineplot.js.html
index 03a2adb0..14254718 100644
--- a/docs/lineplot.js.html
+++ b/docs/lineplot.js.html
@@ -24,7 +24,7 @@
@@ -305,7 +305,7 @@ lineplot.js
diff --git a/docs/scatterplot.js.html b/docs/scatterplot.js.html
index 2e7aca1e..1fa53947 100644
--- a/docs/scatterplot.js.html
+++ b/docs/scatterplot.js.html
@@ -24,7 +24,7 @@
@@ -886,7 +886,7 @@ scatterplot.js
diff --git a/docs/segmented.js.html b/docs/segmented.js.html
index c6e5fa00..9a7c6124 100644
--- a/docs/segmented.js.html
+++ b/docs/segmented.js.html
@@ -24,7 +24,7 @@
@@ -377,7 +377,7 @@ segmented.js
Returns:
diff --git a/docs/Histogram.html b/docs/Histogram.html index 8d05052c..cebf3417 100644 --- a/docs/Histogram.html +++ b/docs/Histogram.html @@ -24,7 +24,7 @@
SetMaxMin
diff --git a/docs/Layer0Point.html b/docs/Layer0Point.html
index c847ffe9..d7053be5 100644
--- a/docs/Layer0Point.html
+++ b/docs/Layer0Point.html
@@ -24,7 +24,7 @@
@@ -547,7 +547,7 @@ Returns:
diff --git a/docs/Layer1Point.html b/docs/Layer1Point.html
index 6ce2628e..4dd81951 100644
--- a/docs/Layer1Point.html
+++ b/docs/Layer1Point.html
@@ -24,7 +24,7 @@
@@ -547,7 +547,7 @@ Returns:
diff --git a/docs/LinePlot.html b/docs/LinePlot.html
index 37744fd7..e00b766f 100644
--- a/docs/LinePlot.html
+++ b/docs/LinePlot.html
@@ -24,7 +24,7 @@
@@ -725,7 +725,7 @@ Update
diff --git a/docs/LogError.html b/docs/LogError.html
index 9281b16a..b22a5497 100644
--- a/docs/LogError.html
+++ b/docs/LogError.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new LogError<
Source:
@@ -200,7 +200,7 @@ LogAb
Source:
@@ -335,7 +335,7 @@ Log
Source:
@@ -470,7 +470,7 @@ Lo
Source:
@@ -631,7 +631,7 @@ LogNotArra
Source:
@@ -766,7 +766,7 @@ Log
Source:
@@ -896,7 +896,7 @@ Parameters:
diff --git a/docs/Menu.html b/docs/Menu.html
index 0c418037..c21a5924 100644
--- a/docs/Menu.html
+++ b/docs/Menu.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new MenuSource:
@@ -201,7 +201,7 @@ CreateMenu<
Source:
@@ -285,7 +285,7 @@ Handl
Source:
@@ -368,7 +368,90 @@ Source:
-
- constants.js, line 844
+ constants.js, line 876
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ NotifyOfLLMReset()
+
+
+
+
+
+
+ Notifies the user that the LLM will be reset.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+
@@ -451,7 +534,7 @@ PopulateD
- Source:
@@ -534,7 +617,7 @@ SaveDataSource:
@@ -617,7 +700,7 @@ ToggleSource:
@@ -741,7 +824,7 @@ Parameters:
diff --git a/docs/Point.html b/docs/Point.html
index e9903cb5..af8388c0 100644
--- a/docs/Point.html
+++ b/docs/Point.html
@@ -24,7 +24,7 @@
@@ -547,7 +547,7 @@ Returns:
diff --git a/docs/Position.html b/docs/Position.html
index be3a8f17..0e66ba43 100644
--- a/docs/Position.html
+++ b/docs/Position.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new Position<
- Source:
@@ -165,7 +165,7 @@ new Position<
diff --git a/docs/Resources.html b/docs/Resources.html
index 6ec6de01..70b507b6 100644
--- a/docs/Resources.html
+++ b/docs/Resources.html
@@ -24,7 +24,7 @@
@@ -200,7 +200,7 @@ GetStringSource:
@@ -329,7 +329,7 @@ Returns:
diff --git a/docs/Review.html b/docs/Review.html
index 9d2226b2..1f476b4e 100644
--- a/docs/Review.html
+++ b/docs/Review.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new ReviewSource:
@@ -200,7 +200,7 @@ Toggl
- Source:
@@ -324,7 +324,7 @@ Parameters:
diff --git a/docs/ScatterPlot.html b/docs/ScatterPlot.html
index 544da78b..5cead09d 100644
--- a/docs/ScatterPlot.html
+++ b/docs/ScatterPlot.html
@@ -24,7 +24,7 @@
@@ -1427,7 +1427,7 @@ SetLineLa
diff --git a/docs/Segmented.html b/docs/Segmented.html
index ce786aee..4824dd59 100644
--- a/docs/Segmented.html
+++ b/docs/Segmented.html
@@ -24,7 +24,7 @@
@@ -892,7 +892,7 @@ UnSel
diff --git a/docs/Tracker.html b/docs/Tracker.html
index dea73e14..e590510b 100644
--- a/docs/Tracker.html
+++ b/docs/Tracker.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new TrackerSource:
@@ -200,7 +200,7 @@ DataSetupSource:
@@ -283,7 +283,7 @@ DeleteSource:
@@ -366,7 +366,7 @@ Do
- Source:
@@ -449,7 +449,7 @@ GetTrac
- Source:
@@ -557,7 +557,7 @@ LogEventSource:
@@ -692,7 +692,7 @@ SaveTr
- Source:
@@ -827,7 +827,7 @@ isUn
- Source:
@@ -956,7 +956,7 @@ Returns:
diff --git a/docs/audio.js.html b/docs/audio.js.html
index 4fc80eab..b00c498a 100644
--- a/docs/audio.js.html
+++ b/docs/audio.js.html
@@ -24,7 +24,7 @@
@@ -638,7 +638,7 @@ audio.js
diff --git a/docs/barplot.js.html b/docs/barplot.js.html
index bf935fe2..aa9fffe5 100644
--- a/docs/barplot.js.html
+++ b/docs/barplot.js.html
@@ -24,7 +24,7 @@
@@ -372,7 +372,7 @@ barplot.js
diff --git a/docs/boxplot.js.html b/docs/boxplot.js.html
index 4bdb587f..4cc26111 100644
--- a/docs/boxplot.js.html
+++ b/docs/boxplot.js.html
@@ -24,7 +24,7 @@
@@ -796,7 +796,7 @@ boxplot.js
diff --git a/docs/constants.js.html b/docs/constants.js.html
index 591d73d7..32d8bacc 100644
--- a/docs/constants.js.html
+++ b/docs/constants.js.html
@@ -24,7 +24,7 @@
@@ -314,6 +314,7 @@ constants.js
openai: 'OpenAI Vision',
gemini: 'Gemini Pro Vision',
multi: 'Multiple AI',
+ processing: 'Processing Chart...',
},
},
};
@@ -484,7 +485,7 @@ constants.js
</div>
</div>
<div class="modal-footer">
- <button type="button" id="save_and_close_menu">Save and Close</button>
+ <button type="button" id="save_and_close_menu" aria-labelledby="save_and_close_text"><span id="save_and_close_text">Save and Close</span></button>
<button type="button" id="close_menu">Close</button>
</div>
</div>
@@ -620,6 +621,16 @@ constants.js
}
},
]);
+
+ // trigger notification that LLM will be reset
+ // this is done on change of LLM model, multi settings, or skill level
+ constants.events.push([
+ document.getElementById('LLM_model'),
+ 'change',
+ function (e) {
+ menu.NotifyOfLLMReset();
+ },
+ ]);
}
/**
@@ -761,6 +772,9 @@ constants.js
document.getElementById('LLM_preferences').value =
constants.LLMPreferences;
}
+ if (document.getElementById('LLM_reset_notification')) {
+ document.getElementById('LLM_reset_notification').remove();
+ }
}
/**
@@ -818,6 +832,24 @@ constants.js
.setAttribute('aria-live', constants.ariaMode);
}
+ /**
+ * Notifies the user that the LLM will be reset.
+ */
+ NotifyOfLLMReset() {
+ let html =
+ '<p id="LLM_reset_notification">Note: Changes in LLM settings will reset any existing conversation.</p>';
+ document
+ .getElementById('save_and_close_menu')
+ .insertAdjacentHTML('beforebegin', html);
+
+ // add to aria button text
+ document
+ .getElementById('save_and_close_menu')
+ .setAttribute(
+ 'aria-labelledby',
+ 'save_and_close_text LLM_reset_notification'
+ );
+ }
/**
* Handles changes to the LLM model and multi-modal settings.
* We reset if we change the LLM model, multi settings, or skill level.
@@ -936,8 +968,11 @@ constants.js
</button>
</div>
<div class="modal-body">
+ <div id="chatLLM_chat_history_wrapper">
<div id="chatLLM_chat_history" aria-live="${constants.ariaMode}" aria-relevant="additions">
</div>
+ <p id="chatLLM_copy_all_wrapper"><button id="chatLLM_copy_all">Copy all to clipboard</button></p>
+ </div>
<div id="chatLLM_content">
<p><input type="text" id="chatLLM_input" class="form-control" name="chatLLM_input" aria-labelledby="chatLLM_title" size="50"></p>
<div class="LLM_suggestions">
@@ -1079,10 +1114,41 @@ constants.js
document.getElementById('reset_chatLLM'),
'click',
function (e) {
- chatLLM.Toggle(false);
chatLLM.ResetChatHistory();
},
]);
+
+ // copy to clipboard
+ constants.events.push([
+ document.getElementById('chatLLM_copy_all'),
+ 'click',
+ function (e) {
+ let text = document.getElementById('chatLLM_chat_history').innerText;
+ // need newlines instead of paragraphs headings etc
+ text = text.replace(/<p>/g, '\n').replace(/<\/p>/g, '\n');
+ text = text.replace(/<h\d>/g, '\n').replace(/<\/h\d>/g, '\n');
+ text = text.replace(/<.*?>/g, '');
+
+ navigator.clipboard.writeText(text);
+ },
+ ]);
+ constants.events.push([
+ document.getElementById('chatLLM_chat_history'),
+ 'click',
+ function (e) {
+ // we're delegating here, so set the event on child .chatLLM_message_copy_button
+ if (e.target.matches('.chatLLM_message_copy_button')) {
+ // get the innerText of the element before the button
+ let text = e.target.closest('p').previousElementSibling.innerText;
+ // need newlines instead of paragraphs headings etc
+ text = text.replace(/<p>/g, '\n').replace(/<\/p>/g, '\n');
+ text = text.replace(/<h\d>/g, '\n').replace(/<\/h\d>/g, '\n');
+ text = text.replace(/<.*?>/g, '');
+
+ navigator.clipboard.writeText(text);
+ }
+ },
+ ]);
}
/**
@@ -1163,7 +1229,7 @@ constants.js
*/
ProcessLLMResponse(data, model) {
chatLLM.WaitingSound(false);
- console.log('LLM response: ', data);
+ //console.log('LLM response: ', data);
let text = '';
let LLMName = resources.GetString(model);
@@ -1367,9 +1433,9 @@ constants.js
};
// Generate the content
- console.log('LLM request: ', prompt, image);
+ //console.log('LLM request: ', prompt, image);
const result = await model.generateContent([prompt, image]);
- console.log(result.response.text());
+ //console.log(result.response.text());
// Process the response
chatLLM.ProcessLLMResponse(result.response, 'gemini');
@@ -1409,6 +1475,12 @@ constants.js
<p class="chatLLM_message_text">${text}</p>
</div>
`;
+ // add a copy button to actual messages
+ if (user != 'User' && text != resources.GetString('processing')) {
+ html += `
+ <p class="chatLLM_message_copy"><button class="chatLLM_message_copy_button">Copy</button></p>
+ `;
+ }
this.RenderChatMessage(html);
}
@@ -1486,7 +1558,11 @@ constants.js
// get name from resource
let LLMName = resources.GetString(constants.LLMModel);
this.firstTime = false;
- this.DisplayChatMessage(LLMName, 'Processing Chart...', true);
+ this.DisplayChatMessage(
+ LLMName,
+ resources.GetString('processing'),
+ true
+ );
let defaultPrompt = this.GetDefaultPrompt();
this.Submit(defaultPrompt, true);
}
@@ -2282,7 +2358,7 @@ constants.js
diff --git a/docs/controls.js.html b/docs/controls.js.html
index fb8a89b4..3fbf1e2e 100644
--- a/docs/controls.js.html
+++ b/docs/controls.js.html
@@ -24,7 +24,7 @@
@@ -3268,7 +3268,7 @@ controls.js
diff --git a/docs/display.js.html b/docs/display.js.html
index a4ee9c53..1f9acd2b 100644
--- a/docs/display.js.html
+++ b/docs/display.js.html
@@ -24,7 +24,7 @@
@@ -1256,7 +1256,7 @@ display.js
diff --git a/docs/global.html b/docs/global.html
index 05f0215f..f8d03800 100644
--- a/docs/global.html
+++ b/docs/global.html
@@ -24,7 +24,7 @@
@@ -1141,7 +1141,7 @@ Parameters:
diff --git a/docs/heatmap.js.html b/docs/heatmap.js.html
index 1d6889a9..9d586522 100644
--- a/docs/heatmap.js.html
+++ b/docs/heatmap.js.html
@@ -24,7 +24,7 @@
@@ -452,7 +452,7 @@ heatmap.js
diff --git a/docs/histogram.js.html b/docs/histogram.js.html
index 86072184..6b459dcd 100644
--- a/docs/histogram.js.html
+++ b/docs/histogram.js.html
@@ -24,7 +24,7 @@
@@ -247,7 +247,7 @@ histogram.js
diff --git a/docs/index.html b/docs/index.html
index a84a0904..008cca1c 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -24,7 +24,7 @@
@@ -57,7 +57,7 @@
diff --git a/docs/init.js.html b/docs/init.js.html
index 613333f3..7c72dea3 100644
--- a/docs/init.js.html
+++ b/docs/init.js.html
@@ -24,7 +24,7 @@
@@ -531,7 +531,7 @@ init.js
diff --git a/docs/lineplot.js.html b/docs/lineplot.js.html
index 03a2adb0..14254718 100644
--- a/docs/lineplot.js.html
+++ b/docs/lineplot.js.html
@@ -24,7 +24,7 @@
@@ -305,7 +305,7 @@ lineplot.js
diff --git a/docs/scatterplot.js.html b/docs/scatterplot.js.html
index 2e7aca1e..1fa53947 100644
--- a/docs/scatterplot.js.html
+++ b/docs/scatterplot.js.html
@@ -24,7 +24,7 @@
@@ -886,7 +886,7 @@ scatterplot.js
diff --git a/docs/segmented.js.html b/docs/segmented.js.html
index c6e5fa00..9a7c6124 100644
--- a/docs/segmented.js.html
+++ b/docs/segmented.js.html
@@ -24,7 +24,7 @@
@@ -377,7 +377,7 @@ segmented.js
Returns:
diff --git a/docs/Layer1Point.html b/docs/Layer1Point.html index 6ce2628e..4dd81951 100644 --- a/docs/Layer1Point.html +++ b/docs/Layer1Point.html @@ -24,7 +24,7 @@
Returns:
diff --git a/docs/LinePlot.html b/docs/LinePlot.html index 37744fd7..e00b766f 100644 --- a/docs/LinePlot.html +++ b/docs/LinePlot.html @@ -24,7 +24,7 @@
Update
diff --git a/docs/LogError.html b/docs/LogError.html
index 9281b16a..b22a5497 100644
--- a/docs/LogError.html
+++ b/docs/LogError.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new LogError<
Source:
@@ -200,7 +200,7 @@ LogAb
Source:
@@ -335,7 +335,7 @@ Log
Source:
@@ -470,7 +470,7 @@ Lo
Source:
@@ -631,7 +631,7 @@ LogNotArra
Source:
@@ -766,7 +766,7 @@ Log
Source:
@@ -896,7 +896,7 @@ Parameters:
diff --git a/docs/Menu.html b/docs/Menu.html
index 0c418037..c21a5924 100644
--- a/docs/Menu.html
+++ b/docs/Menu.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new MenuSource:
@@ -201,7 +201,7 @@ CreateMenu<
Source:
@@ -285,7 +285,7 @@ Handl
Source:
@@ -368,7 +368,90 @@ Source:
-
- constants.js, line 844
+ constants.js, line 876
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ NotifyOfLLMReset()
+
+
+
+
+
+
+ Notifies the user that the LLM will be reset.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+
@@ -451,7 +534,7 @@ PopulateD
- Source:
@@ -534,7 +617,7 @@ SaveDataSource:
@@ -617,7 +700,7 @@ ToggleSource:
@@ -741,7 +824,7 @@ Parameters:
diff --git a/docs/Point.html b/docs/Point.html
index e9903cb5..af8388c0 100644
--- a/docs/Point.html
+++ b/docs/Point.html
@@ -24,7 +24,7 @@
@@ -547,7 +547,7 @@ Returns:
diff --git a/docs/Position.html b/docs/Position.html
index be3a8f17..0e66ba43 100644
--- a/docs/Position.html
+++ b/docs/Position.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new Position<
- Source:
@@ -165,7 +165,7 @@ new Position<
diff --git a/docs/Resources.html b/docs/Resources.html
index 6ec6de01..70b507b6 100644
--- a/docs/Resources.html
+++ b/docs/Resources.html
@@ -24,7 +24,7 @@
@@ -200,7 +200,7 @@ GetStringSource:
@@ -329,7 +329,7 @@ Returns:
diff --git a/docs/Review.html b/docs/Review.html
index 9d2226b2..1f476b4e 100644
--- a/docs/Review.html
+++ b/docs/Review.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new ReviewSource:
@@ -200,7 +200,7 @@ Toggl
- Source:
@@ -324,7 +324,7 @@ Parameters:
diff --git a/docs/ScatterPlot.html b/docs/ScatterPlot.html
index 544da78b..5cead09d 100644
--- a/docs/ScatterPlot.html
+++ b/docs/ScatterPlot.html
@@ -24,7 +24,7 @@
@@ -1427,7 +1427,7 @@ SetLineLa
diff --git a/docs/Segmented.html b/docs/Segmented.html
index ce786aee..4824dd59 100644
--- a/docs/Segmented.html
+++ b/docs/Segmented.html
@@ -24,7 +24,7 @@
@@ -892,7 +892,7 @@ UnSel
diff --git a/docs/Tracker.html b/docs/Tracker.html
index dea73e14..e590510b 100644
--- a/docs/Tracker.html
+++ b/docs/Tracker.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new TrackerSource:
@@ -200,7 +200,7 @@ DataSetupSource:
@@ -283,7 +283,7 @@ DeleteSource:
@@ -366,7 +366,7 @@ Do
- Source:
@@ -449,7 +449,7 @@ GetTrac
- Source:
@@ -557,7 +557,7 @@ LogEventSource:
@@ -692,7 +692,7 @@ SaveTr
- Source:
@@ -827,7 +827,7 @@ isUn
- Source:
@@ -956,7 +956,7 @@ Returns:
diff --git a/docs/audio.js.html b/docs/audio.js.html
index 4fc80eab..b00c498a 100644
--- a/docs/audio.js.html
+++ b/docs/audio.js.html
@@ -24,7 +24,7 @@
@@ -638,7 +638,7 @@ audio.js
diff --git a/docs/barplot.js.html b/docs/barplot.js.html
index bf935fe2..aa9fffe5 100644
--- a/docs/barplot.js.html
+++ b/docs/barplot.js.html
@@ -24,7 +24,7 @@
@@ -372,7 +372,7 @@ barplot.js
diff --git a/docs/boxplot.js.html b/docs/boxplot.js.html
index 4bdb587f..4cc26111 100644
--- a/docs/boxplot.js.html
+++ b/docs/boxplot.js.html
@@ -24,7 +24,7 @@
@@ -796,7 +796,7 @@ boxplot.js
diff --git a/docs/constants.js.html b/docs/constants.js.html
index 591d73d7..32d8bacc 100644
--- a/docs/constants.js.html
+++ b/docs/constants.js.html
@@ -24,7 +24,7 @@
@@ -314,6 +314,7 @@ constants.js
openai: 'OpenAI Vision',
gemini: 'Gemini Pro Vision',
multi: 'Multiple AI',
+ processing: 'Processing Chart...',
},
},
};
@@ -484,7 +485,7 @@ constants.js
</div>
</div>
<div class="modal-footer">
- <button type="button" id="save_and_close_menu">Save and Close</button>
+ <button type="button" id="save_and_close_menu" aria-labelledby="save_and_close_text"><span id="save_and_close_text">Save and Close</span></button>
<button type="button" id="close_menu">Close</button>
</div>
</div>
@@ -620,6 +621,16 @@ constants.js
}
},
]);
+
+ // trigger notification that LLM will be reset
+ // this is done on change of LLM model, multi settings, or skill level
+ constants.events.push([
+ document.getElementById('LLM_model'),
+ 'change',
+ function (e) {
+ menu.NotifyOfLLMReset();
+ },
+ ]);
}
/**
@@ -761,6 +772,9 @@ constants.js
document.getElementById('LLM_preferences').value =
constants.LLMPreferences;
}
+ if (document.getElementById('LLM_reset_notification')) {
+ document.getElementById('LLM_reset_notification').remove();
+ }
}
/**
@@ -818,6 +832,24 @@ constants.js
.setAttribute('aria-live', constants.ariaMode);
}
+ /**
+ * Notifies the user that the LLM will be reset.
+ */
+ NotifyOfLLMReset() {
+ let html =
+ '<p id="LLM_reset_notification">Note: Changes in LLM settings will reset any existing conversation.</p>';
+ document
+ .getElementById('save_and_close_menu')
+ .insertAdjacentHTML('beforebegin', html);
+
+ // add to aria button text
+ document
+ .getElementById('save_and_close_menu')
+ .setAttribute(
+ 'aria-labelledby',
+ 'save_and_close_text LLM_reset_notification'
+ );
+ }
/**
* Handles changes to the LLM model and multi-modal settings.
* We reset if we change the LLM model, multi settings, or skill level.
@@ -936,8 +968,11 @@ constants.js
</button>
</div>
<div class="modal-body">
+ <div id="chatLLM_chat_history_wrapper">
<div id="chatLLM_chat_history" aria-live="${constants.ariaMode}" aria-relevant="additions">
</div>
+ <p id="chatLLM_copy_all_wrapper"><button id="chatLLM_copy_all">Copy all to clipboard</button></p>
+ </div>
<div id="chatLLM_content">
<p><input type="text" id="chatLLM_input" class="form-control" name="chatLLM_input" aria-labelledby="chatLLM_title" size="50"></p>
<div class="LLM_suggestions">
@@ -1079,10 +1114,41 @@ constants.js
document.getElementById('reset_chatLLM'),
'click',
function (e) {
- chatLLM.Toggle(false);
chatLLM.ResetChatHistory();
},
]);
+
+ // copy to clipboard
+ constants.events.push([
+ document.getElementById('chatLLM_copy_all'),
+ 'click',
+ function (e) {
+ let text = document.getElementById('chatLLM_chat_history').innerText;
+ // need newlines instead of paragraphs headings etc
+ text = text.replace(/<p>/g, '\n').replace(/<\/p>/g, '\n');
+ text = text.replace(/<h\d>/g, '\n').replace(/<\/h\d>/g, '\n');
+ text = text.replace(/<.*?>/g, '');
+
+ navigator.clipboard.writeText(text);
+ },
+ ]);
+ constants.events.push([
+ document.getElementById('chatLLM_chat_history'),
+ 'click',
+ function (e) {
+ // we're delegating here, so set the event on child .chatLLM_message_copy_button
+ if (e.target.matches('.chatLLM_message_copy_button')) {
+ // get the innerText of the element before the button
+ let text = e.target.closest('p').previousElementSibling.innerText;
+ // need newlines instead of paragraphs headings etc
+ text = text.replace(/<p>/g, '\n').replace(/<\/p>/g, '\n');
+ text = text.replace(/<h\d>/g, '\n').replace(/<\/h\d>/g, '\n');
+ text = text.replace(/<.*?>/g, '');
+
+ navigator.clipboard.writeText(text);
+ }
+ },
+ ]);
}
/**
@@ -1163,7 +1229,7 @@ constants.js
*/
ProcessLLMResponse(data, model) {
chatLLM.WaitingSound(false);
- console.log('LLM response: ', data);
+ //console.log('LLM response: ', data);
let text = '';
let LLMName = resources.GetString(model);
@@ -1367,9 +1433,9 @@ constants.js
};
// Generate the content
- console.log('LLM request: ', prompt, image);
+ //console.log('LLM request: ', prompt, image);
const result = await model.generateContent([prompt, image]);
- console.log(result.response.text());
+ //console.log(result.response.text());
// Process the response
chatLLM.ProcessLLMResponse(result.response, 'gemini');
@@ -1409,6 +1475,12 @@ constants.js
<p class="chatLLM_message_text">${text}</p>
</div>
`;
+ // add a copy button to actual messages
+ if (user != 'User' && text != resources.GetString('processing')) {
+ html += `
+ <p class="chatLLM_message_copy"><button class="chatLLM_message_copy_button">Copy</button></p>
+ `;
+ }
this.RenderChatMessage(html);
}
@@ -1486,7 +1558,11 @@ constants.js
// get name from resource
let LLMName = resources.GetString(constants.LLMModel);
this.firstTime = false;
- this.DisplayChatMessage(LLMName, 'Processing Chart...', true);
+ this.DisplayChatMessage(
+ LLMName,
+ resources.GetString('processing'),
+ true
+ );
let defaultPrompt = this.GetDefaultPrompt();
this.Submit(defaultPrompt, true);
}
@@ -2282,7 +2358,7 @@ constants.js
diff --git a/docs/controls.js.html b/docs/controls.js.html
index fb8a89b4..3fbf1e2e 100644
--- a/docs/controls.js.html
+++ b/docs/controls.js.html
@@ -24,7 +24,7 @@
@@ -3268,7 +3268,7 @@ controls.js
diff --git a/docs/display.js.html b/docs/display.js.html
index a4ee9c53..1f9acd2b 100644
--- a/docs/display.js.html
+++ b/docs/display.js.html
@@ -24,7 +24,7 @@
@@ -1256,7 +1256,7 @@ display.js
diff --git a/docs/global.html b/docs/global.html
index 05f0215f..f8d03800 100644
--- a/docs/global.html
+++ b/docs/global.html
@@ -24,7 +24,7 @@
@@ -1141,7 +1141,7 @@ Parameters:
diff --git a/docs/heatmap.js.html b/docs/heatmap.js.html
index 1d6889a9..9d586522 100644
--- a/docs/heatmap.js.html
+++ b/docs/heatmap.js.html
@@ -24,7 +24,7 @@
@@ -452,7 +452,7 @@ heatmap.js
diff --git a/docs/histogram.js.html b/docs/histogram.js.html
index 86072184..6b459dcd 100644
--- a/docs/histogram.js.html
+++ b/docs/histogram.js.html
@@ -24,7 +24,7 @@
@@ -247,7 +247,7 @@ histogram.js
diff --git a/docs/index.html b/docs/index.html
index a84a0904..008cca1c 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -24,7 +24,7 @@
@@ -57,7 +57,7 @@
diff --git a/docs/init.js.html b/docs/init.js.html
index 613333f3..7c72dea3 100644
--- a/docs/init.js.html
+++ b/docs/init.js.html
@@ -24,7 +24,7 @@
@@ -531,7 +531,7 @@ init.js
diff --git a/docs/lineplot.js.html b/docs/lineplot.js.html
index 03a2adb0..14254718 100644
--- a/docs/lineplot.js.html
+++ b/docs/lineplot.js.html
@@ -24,7 +24,7 @@
@@ -305,7 +305,7 @@ lineplot.js
diff --git a/docs/scatterplot.js.html b/docs/scatterplot.js.html
index 2e7aca1e..1fa53947 100644
--- a/docs/scatterplot.js.html
+++ b/docs/scatterplot.js.html
@@ -24,7 +24,7 @@
@@ -886,7 +886,7 @@ scatterplot.js
diff --git a/docs/segmented.js.html b/docs/segmented.js.html
index c6e5fa00..9a7c6124 100644
--- a/docs/segmented.js.html
+++ b/docs/segmented.js.html
@@ -24,7 +24,7 @@
@@ -377,7 +377,7 @@ segmented.js
new LogError<
Source:
@@ -200,7 +200,7 @@ LogAb
Source:
@@ -335,7 +335,7 @@ Log
Source:
@@ -470,7 +470,7 @@ Lo
Source:
@@ -631,7 +631,7 @@ LogNotArra
Source:
@@ -766,7 +766,7 @@ Log
Source:
@@ -896,7 +896,7 @@ Parameters:
diff --git a/docs/Menu.html b/docs/Menu.html
index 0c418037..c21a5924 100644
--- a/docs/Menu.html
+++ b/docs/Menu.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new MenuSource:
@@ -201,7 +201,7 @@ CreateMenu<
Source:
@@ -285,7 +285,7 @@ Handl
Source:
@@ -368,7 +368,90 @@ Source:
-
- constants.js, line 844
+ constants.js, line 876
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ NotifyOfLLMReset()
+
+
+
+
+
+
+ Notifies the user that the LLM will be reset.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+
@@ -451,7 +534,7 @@ PopulateD
- Source:
@@ -534,7 +617,7 @@ SaveDataSource:
@@ -617,7 +700,7 @@ ToggleSource:
@@ -741,7 +824,7 @@ Parameters:
diff --git a/docs/Point.html b/docs/Point.html
index e9903cb5..af8388c0 100644
--- a/docs/Point.html
+++ b/docs/Point.html
@@ -24,7 +24,7 @@
@@ -547,7 +547,7 @@ Returns:
diff --git a/docs/Position.html b/docs/Position.html
index be3a8f17..0e66ba43 100644
--- a/docs/Position.html
+++ b/docs/Position.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new Position<
- Source:
@@ -165,7 +165,7 @@ new Position<
diff --git a/docs/Resources.html b/docs/Resources.html
index 6ec6de01..70b507b6 100644
--- a/docs/Resources.html
+++ b/docs/Resources.html
@@ -24,7 +24,7 @@
@@ -200,7 +200,7 @@ GetStringSource:
@@ -329,7 +329,7 @@ Returns:
diff --git a/docs/Review.html b/docs/Review.html
index 9d2226b2..1f476b4e 100644
--- a/docs/Review.html
+++ b/docs/Review.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new ReviewSource:
@@ -200,7 +200,7 @@ Toggl
- Source:
@@ -324,7 +324,7 @@ Parameters:
diff --git a/docs/ScatterPlot.html b/docs/ScatterPlot.html
index 544da78b..5cead09d 100644
--- a/docs/ScatterPlot.html
+++ b/docs/ScatterPlot.html
@@ -24,7 +24,7 @@
@@ -1427,7 +1427,7 @@ SetLineLa
diff --git a/docs/Segmented.html b/docs/Segmented.html
index ce786aee..4824dd59 100644
--- a/docs/Segmented.html
+++ b/docs/Segmented.html
@@ -24,7 +24,7 @@
@@ -892,7 +892,7 @@ UnSel
diff --git a/docs/Tracker.html b/docs/Tracker.html
index dea73e14..e590510b 100644
--- a/docs/Tracker.html
+++ b/docs/Tracker.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new TrackerSource:
@@ -200,7 +200,7 @@ DataSetupSource:
@@ -283,7 +283,7 @@ DeleteSource:
@@ -366,7 +366,7 @@ Do
- Source:
@@ -449,7 +449,7 @@ GetTrac
- Source:
@@ -557,7 +557,7 @@ LogEventSource:
@@ -692,7 +692,7 @@ SaveTr
- Source:
@@ -827,7 +827,7 @@ isUn
- Source:
@@ -956,7 +956,7 @@ Returns:
diff --git a/docs/audio.js.html b/docs/audio.js.html
index 4fc80eab..b00c498a 100644
--- a/docs/audio.js.html
+++ b/docs/audio.js.html
@@ -24,7 +24,7 @@
@@ -638,7 +638,7 @@ audio.js
diff --git a/docs/barplot.js.html b/docs/barplot.js.html
index bf935fe2..aa9fffe5 100644
--- a/docs/barplot.js.html
+++ b/docs/barplot.js.html
@@ -24,7 +24,7 @@
@@ -372,7 +372,7 @@ barplot.js
diff --git a/docs/boxplot.js.html b/docs/boxplot.js.html
index 4bdb587f..4cc26111 100644
--- a/docs/boxplot.js.html
+++ b/docs/boxplot.js.html
@@ -24,7 +24,7 @@
@@ -796,7 +796,7 @@ boxplot.js
diff --git a/docs/constants.js.html b/docs/constants.js.html
index 591d73d7..32d8bacc 100644
--- a/docs/constants.js.html
+++ b/docs/constants.js.html
@@ -24,7 +24,7 @@
@@ -314,6 +314,7 @@ constants.js
openai: 'OpenAI Vision',
gemini: 'Gemini Pro Vision',
multi: 'Multiple AI',
+ processing: 'Processing Chart...',
},
},
};
@@ -484,7 +485,7 @@ constants.js
</div>
</div>
<div class="modal-footer">
- <button type="button" id="save_and_close_menu">Save and Close</button>
+ <button type="button" id="save_and_close_menu" aria-labelledby="save_and_close_text"><span id="save_and_close_text">Save and Close</span></button>
<button type="button" id="close_menu">Close</button>
</div>
</div>
@@ -620,6 +621,16 @@ constants.js
}
},
]);
+
+ // trigger notification that LLM will be reset
+ // this is done on change of LLM model, multi settings, or skill level
+ constants.events.push([
+ document.getElementById('LLM_model'),
+ 'change',
+ function (e) {
+ menu.NotifyOfLLMReset();
+ },
+ ]);
}
/**
@@ -761,6 +772,9 @@ constants.js
document.getElementById('LLM_preferences').value =
constants.LLMPreferences;
}
+ if (document.getElementById('LLM_reset_notification')) {
+ document.getElementById('LLM_reset_notification').remove();
+ }
}
/**
@@ -818,6 +832,24 @@ constants.js
.setAttribute('aria-live', constants.ariaMode);
}
+ /**
+ * Notifies the user that the LLM will be reset.
+ */
+ NotifyOfLLMReset() {
+ let html =
+ '<p id="LLM_reset_notification">Note: Changes in LLM settings will reset any existing conversation.</p>';
+ document
+ .getElementById('save_and_close_menu')
+ .insertAdjacentHTML('beforebegin', html);
+
+ // add to aria button text
+ document
+ .getElementById('save_and_close_menu')
+ .setAttribute(
+ 'aria-labelledby',
+ 'save_and_close_text LLM_reset_notification'
+ );
+ }
/**
* Handles changes to the LLM model and multi-modal settings.
* We reset if we change the LLM model, multi settings, or skill level.
@@ -936,8 +968,11 @@ constants.js
</button>
</div>
<div class="modal-body">
+ <div id="chatLLM_chat_history_wrapper">
<div id="chatLLM_chat_history" aria-live="${constants.ariaMode}" aria-relevant="additions">
</div>
+ <p id="chatLLM_copy_all_wrapper"><button id="chatLLM_copy_all">Copy all to clipboard</button></p>
+ </div>
<div id="chatLLM_content">
<p><input type="text" id="chatLLM_input" class="form-control" name="chatLLM_input" aria-labelledby="chatLLM_title" size="50"></p>
<div class="LLM_suggestions">
@@ -1079,10 +1114,41 @@ constants.js
document.getElementById('reset_chatLLM'),
'click',
function (e) {
- chatLLM.Toggle(false);
chatLLM.ResetChatHistory();
},
]);
+
+ // copy to clipboard
+ constants.events.push([
+ document.getElementById('chatLLM_copy_all'),
+ 'click',
+ function (e) {
+ let text = document.getElementById('chatLLM_chat_history').innerText;
+ // need newlines instead of paragraphs headings etc
+ text = text.replace(/<p>/g, '\n').replace(/<\/p>/g, '\n');
+ text = text.replace(/<h\d>/g, '\n').replace(/<\/h\d>/g, '\n');
+ text = text.replace(/<.*?>/g, '');
+
+ navigator.clipboard.writeText(text);
+ },
+ ]);
+ constants.events.push([
+ document.getElementById('chatLLM_chat_history'),
+ 'click',
+ function (e) {
+ // we're delegating here, so set the event on child .chatLLM_message_copy_button
+ if (e.target.matches('.chatLLM_message_copy_button')) {
+ // get the innerText of the element before the button
+ let text = e.target.closest('p').previousElementSibling.innerText;
+ // need newlines instead of paragraphs headings etc
+ text = text.replace(/<p>/g, '\n').replace(/<\/p>/g, '\n');
+ text = text.replace(/<h\d>/g, '\n').replace(/<\/h\d>/g, '\n');
+ text = text.replace(/<.*?>/g, '');
+
+ navigator.clipboard.writeText(text);
+ }
+ },
+ ]);
}
/**
@@ -1163,7 +1229,7 @@ constants.js
*/
ProcessLLMResponse(data, model) {
chatLLM.WaitingSound(false);
- console.log('LLM response: ', data);
+ //console.log('LLM response: ', data);
let text = '';
let LLMName = resources.GetString(model);
@@ -1367,9 +1433,9 @@ constants.js
};
// Generate the content
- console.log('LLM request: ', prompt, image);
+ //console.log('LLM request: ', prompt, image);
const result = await model.generateContent([prompt, image]);
- console.log(result.response.text());
+ //console.log(result.response.text());
// Process the response
chatLLM.ProcessLLMResponse(result.response, 'gemini');
@@ -1409,6 +1475,12 @@ constants.js
<p class="chatLLM_message_text">${text}</p>
</div>
`;
+ // add a copy button to actual messages
+ if (user != 'User' && text != resources.GetString('processing')) {
+ html += `
+ <p class="chatLLM_message_copy"><button class="chatLLM_message_copy_button">Copy</button></p>
+ `;
+ }
this.RenderChatMessage(html);
}
@@ -1486,7 +1558,11 @@ constants.js
// get name from resource
let LLMName = resources.GetString(constants.LLMModel);
this.firstTime = false;
- this.DisplayChatMessage(LLMName, 'Processing Chart...', true);
+ this.DisplayChatMessage(
+ LLMName,
+ resources.GetString('processing'),
+ true
+ );
let defaultPrompt = this.GetDefaultPrompt();
this.Submit(defaultPrompt, true);
}
@@ -2282,7 +2358,7 @@ constants.js
diff --git a/docs/controls.js.html b/docs/controls.js.html
index fb8a89b4..3fbf1e2e 100644
--- a/docs/controls.js.html
+++ b/docs/controls.js.html
@@ -24,7 +24,7 @@
@@ -3268,7 +3268,7 @@ controls.js
diff --git a/docs/display.js.html b/docs/display.js.html
index a4ee9c53..1f9acd2b 100644
--- a/docs/display.js.html
+++ b/docs/display.js.html
@@ -24,7 +24,7 @@
@@ -1256,7 +1256,7 @@ display.js
diff --git a/docs/global.html b/docs/global.html
index 05f0215f..f8d03800 100644
--- a/docs/global.html
+++ b/docs/global.html
@@ -24,7 +24,7 @@
@@ -1141,7 +1141,7 @@ Parameters:
diff --git a/docs/heatmap.js.html b/docs/heatmap.js.html
index 1d6889a9..9d586522 100644
--- a/docs/heatmap.js.html
+++ b/docs/heatmap.js.html
@@ -24,7 +24,7 @@
@@ -452,7 +452,7 @@ heatmap.js
diff --git a/docs/histogram.js.html b/docs/histogram.js.html
index 86072184..6b459dcd 100644
--- a/docs/histogram.js.html
+++ b/docs/histogram.js.html
@@ -24,7 +24,7 @@
@@ -247,7 +247,7 @@ histogram.js
diff --git a/docs/index.html b/docs/index.html
index a84a0904..008cca1c 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -24,7 +24,7 @@
@@ -57,7 +57,7 @@
diff --git a/docs/init.js.html b/docs/init.js.html
index 613333f3..7c72dea3 100644
--- a/docs/init.js.html
+++ b/docs/init.js.html
@@ -24,7 +24,7 @@
@@ -531,7 +531,7 @@ init.js
diff --git a/docs/lineplot.js.html b/docs/lineplot.js.html
index 03a2adb0..14254718 100644
--- a/docs/lineplot.js.html
+++ b/docs/lineplot.js.html
@@ -24,7 +24,7 @@
@@ -305,7 +305,7 @@ lineplot.js
diff --git a/docs/scatterplot.js.html b/docs/scatterplot.js.html
index 2e7aca1e..1fa53947 100644
--- a/docs/scatterplot.js.html
+++ b/docs/scatterplot.js.html
@@ -24,7 +24,7 @@
@@ -886,7 +886,7 @@ scatterplot.js
diff --git a/docs/segmented.js.html b/docs/segmented.js.html
index c6e5fa00..9a7c6124 100644
--- a/docs/segmented.js.html
+++ b/docs/segmented.js.html
@@ -24,7 +24,7 @@
@@ -377,7 +377,7 @@ segmented.js
Log
Source:
@@ -470,7 +470,7 @@ Lo
Source:
@@ -631,7 +631,7 @@ LogNotArra
Source:
@@ -766,7 +766,7 @@ Log
Source:
@@ -896,7 +896,7 @@ Parameters:
diff --git a/docs/Menu.html b/docs/Menu.html
index 0c418037..c21a5924 100644
--- a/docs/Menu.html
+++ b/docs/Menu.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new MenuSource:
@@ -201,7 +201,7 @@ CreateMenu<
Source:
@@ -285,7 +285,7 @@ Handl
Source:
@@ -368,7 +368,90 @@ Source:
-
- constants.js, line 844
+ constants.js, line 876
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ NotifyOfLLMReset()
+
+
+
+
+
+
+ Notifies the user that the LLM will be reset.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+
@@ -451,7 +534,7 @@ PopulateD
- Source:
@@ -534,7 +617,7 @@ SaveDataSource:
@@ -617,7 +700,7 @@ ToggleSource:
@@ -741,7 +824,7 @@ Parameters:
diff --git a/docs/Point.html b/docs/Point.html
index e9903cb5..af8388c0 100644
--- a/docs/Point.html
+++ b/docs/Point.html
@@ -24,7 +24,7 @@
@@ -547,7 +547,7 @@ Returns:
diff --git a/docs/Position.html b/docs/Position.html
index be3a8f17..0e66ba43 100644
--- a/docs/Position.html
+++ b/docs/Position.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new Position<
- Source:
@@ -165,7 +165,7 @@ new Position<
diff --git a/docs/Resources.html b/docs/Resources.html
index 6ec6de01..70b507b6 100644
--- a/docs/Resources.html
+++ b/docs/Resources.html
@@ -24,7 +24,7 @@
@@ -200,7 +200,7 @@ GetStringSource:
@@ -329,7 +329,7 @@ Returns:
diff --git a/docs/Review.html b/docs/Review.html
index 9d2226b2..1f476b4e 100644
--- a/docs/Review.html
+++ b/docs/Review.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new ReviewSource:
@@ -200,7 +200,7 @@ Toggl
- Source:
@@ -324,7 +324,7 @@ Parameters:
diff --git a/docs/ScatterPlot.html b/docs/ScatterPlot.html
index 544da78b..5cead09d 100644
--- a/docs/ScatterPlot.html
+++ b/docs/ScatterPlot.html
@@ -24,7 +24,7 @@
@@ -1427,7 +1427,7 @@ SetLineLa
diff --git a/docs/Segmented.html b/docs/Segmented.html
index ce786aee..4824dd59 100644
--- a/docs/Segmented.html
+++ b/docs/Segmented.html
@@ -24,7 +24,7 @@
@@ -892,7 +892,7 @@ UnSel
diff --git a/docs/Tracker.html b/docs/Tracker.html
index dea73e14..e590510b 100644
--- a/docs/Tracker.html
+++ b/docs/Tracker.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new TrackerSource:
@@ -200,7 +200,7 @@ DataSetupSource:
@@ -283,7 +283,7 @@ DeleteSource:
@@ -366,7 +366,7 @@ Do
- Source:
@@ -449,7 +449,7 @@ GetTrac
- Source:
@@ -557,7 +557,7 @@ LogEventSource:
@@ -692,7 +692,7 @@ SaveTr
- Source:
@@ -827,7 +827,7 @@ isUn
- Source:
@@ -956,7 +956,7 @@ Returns:
diff --git a/docs/audio.js.html b/docs/audio.js.html
index 4fc80eab..b00c498a 100644
--- a/docs/audio.js.html
+++ b/docs/audio.js.html
@@ -24,7 +24,7 @@
@@ -638,7 +638,7 @@ audio.js
diff --git a/docs/barplot.js.html b/docs/barplot.js.html
index bf935fe2..aa9fffe5 100644
--- a/docs/barplot.js.html
+++ b/docs/barplot.js.html
@@ -24,7 +24,7 @@
@@ -372,7 +372,7 @@ barplot.js
diff --git a/docs/boxplot.js.html b/docs/boxplot.js.html
index 4bdb587f..4cc26111 100644
--- a/docs/boxplot.js.html
+++ b/docs/boxplot.js.html
@@ -24,7 +24,7 @@
@@ -796,7 +796,7 @@ boxplot.js
diff --git a/docs/constants.js.html b/docs/constants.js.html
index 591d73d7..32d8bacc 100644
--- a/docs/constants.js.html
+++ b/docs/constants.js.html
@@ -24,7 +24,7 @@
@@ -314,6 +314,7 @@ constants.js
openai: 'OpenAI Vision',
gemini: 'Gemini Pro Vision',
multi: 'Multiple AI',
+ processing: 'Processing Chart...',
},
},
};
@@ -484,7 +485,7 @@ constants.js
</div>
</div>
<div class="modal-footer">
- <button type="button" id="save_and_close_menu">Save and Close</button>
+ <button type="button" id="save_and_close_menu" aria-labelledby="save_and_close_text"><span id="save_and_close_text">Save and Close</span></button>
<button type="button" id="close_menu">Close</button>
</div>
</div>
@@ -620,6 +621,16 @@ constants.js
}
},
]);
+
+ // trigger notification that LLM will be reset
+ // this is done on change of LLM model, multi settings, or skill level
+ constants.events.push([
+ document.getElementById('LLM_model'),
+ 'change',
+ function (e) {
+ menu.NotifyOfLLMReset();
+ },
+ ]);
}
/**
@@ -761,6 +772,9 @@ constants.js
document.getElementById('LLM_preferences').value =
constants.LLMPreferences;
}
+ if (document.getElementById('LLM_reset_notification')) {
+ document.getElementById('LLM_reset_notification').remove();
+ }
}
/**
@@ -818,6 +832,24 @@ constants.js
.setAttribute('aria-live', constants.ariaMode);
}
+ /**
+ * Notifies the user that the LLM will be reset.
+ */
+ NotifyOfLLMReset() {
+ let html =
+ '<p id="LLM_reset_notification">Note: Changes in LLM settings will reset any existing conversation.</p>';
+ document
+ .getElementById('save_and_close_menu')
+ .insertAdjacentHTML('beforebegin', html);
+
+ // add to aria button text
+ document
+ .getElementById('save_and_close_menu')
+ .setAttribute(
+ 'aria-labelledby',
+ 'save_and_close_text LLM_reset_notification'
+ );
+ }
/**
* Handles changes to the LLM model and multi-modal settings.
* We reset if we change the LLM model, multi settings, or skill level.
@@ -936,8 +968,11 @@ constants.js
</button>
</div>
<div class="modal-body">
+ <div id="chatLLM_chat_history_wrapper">
<div id="chatLLM_chat_history" aria-live="${constants.ariaMode}" aria-relevant="additions">
</div>
+ <p id="chatLLM_copy_all_wrapper"><button id="chatLLM_copy_all">Copy all to clipboard</button></p>
+ </div>
<div id="chatLLM_content">
<p><input type="text" id="chatLLM_input" class="form-control" name="chatLLM_input" aria-labelledby="chatLLM_title" size="50"></p>
<div class="LLM_suggestions">
@@ -1079,10 +1114,41 @@ constants.js
document.getElementById('reset_chatLLM'),
'click',
function (e) {
- chatLLM.Toggle(false);
chatLLM.ResetChatHistory();
},
]);
+
+ // copy to clipboard
+ constants.events.push([
+ document.getElementById('chatLLM_copy_all'),
+ 'click',
+ function (e) {
+ let text = document.getElementById('chatLLM_chat_history').innerText;
+ // need newlines instead of paragraphs headings etc
+ text = text.replace(/<p>/g, '\n').replace(/<\/p>/g, '\n');
+ text = text.replace(/<h\d>/g, '\n').replace(/<\/h\d>/g, '\n');
+ text = text.replace(/<.*?>/g, '');
+
+ navigator.clipboard.writeText(text);
+ },
+ ]);
+ constants.events.push([
+ document.getElementById('chatLLM_chat_history'),
+ 'click',
+ function (e) {
+ // we're delegating here, so set the event on child .chatLLM_message_copy_button
+ if (e.target.matches('.chatLLM_message_copy_button')) {
+ // get the innerText of the element before the button
+ let text = e.target.closest('p').previousElementSibling.innerText;
+ // need newlines instead of paragraphs headings etc
+ text = text.replace(/<p>/g, '\n').replace(/<\/p>/g, '\n');
+ text = text.replace(/<h\d>/g, '\n').replace(/<\/h\d>/g, '\n');
+ text = text.replace(/<.*?>/g, '');
+
+ navigator.clipboard.writeText(text);
+ }
+ },
+ ]);
}
/**
@@ -1163,7 +1229,7 @@ constants.js
*/
ProcessLLMResponse(data, model) {
chatLLM.WaitingSound(false);
- console.log('LLM response: ', data);
+ //console.log('LLM response: ', data);
let text = '';
let LLMName = resources.GetString(model);
@@ -1367,9 +1433,9 @@ constants.js
};
// Generate the content
- console.log('LLM request: ', prompt, image);
+ //console.log('LLM request: ', prompt, image);
const result = await model.generateContent([prompt, image]);
- console.log(result.response.text());
+ //console.log(result.response.text());
// Process the response
chatLLM.ProcessLLMResponse(result.response, 'gemini');
@@ -1409,6 +1475,12 @@ constants.js
<p class="chatLLM_message_text">${text}</p>
</div>
`;
+ // add a copy button to actual messages
+ if (user != 'User' && text != resources.GetString('processing')) {
+ html += `
+ <p class="chatLLM_message_copy"><button class="chatLLM_message_copy_button">Copy</button></p>
+ `;
+ }
this.RenderChatMessage(html);
}
@@ -1486,7 +1558,11 @@ constants.js
// get name from resource
let LLMName = resources.GetString(constants.LLMModel);
this.firstTime = false;
- this.DisplayChatMessage(LLMName, 'Processing Chart...', true);
+ this.DisplayChatMessage(
+ LLMName,
+ resources.GetString('processing'),
+ true
+ );
let defaultPrompt = this.GetDefaultPrompt();
this.Submit(defaultPrompt, true);
}
@@ -2282,7 +2358,7 @@ constants.js
diff --git a/docs/controls.js.html b/docs/controls.js.html
index fb8a89b4..3fbf1e2e 100644
--- a/docs/controls.js.html
+++ b/docs/controls.js.html
@@ -24,7 +24,7 @@
@@ -3268,7 +3268,7 @@ controls.js
diff --git a/docs/display.js.html b/docs/display.js.html
index a4ee9c53..1f9acd2b 100644
--- a/docs/display.js.html
+++ b/docs/display.js.html
@@ -24,7 +24,7 @@
@@ -1256,7 +1256,7 @@ display.js
diff --git a/docs/global.html b/docs/global.html
index 05f0215f..f8d03800 100644
--- a/docs/global.html
+++ b/docs/global.html
@@ -24,7 +24,7 @@
@@ -1141,7 +1141,7 @@ Parameters:
diff --git a/docs/heatmap.js.html b/docs/heatmap.js.html
index 1d6889a9..9d586522 100644
--- a/docs/heatmap.js.html
+++ b/docs/heatmap.js.html
@@ -24,7 +24,7 @@
@@ -452,7 +452,7 @@ heatmap.js
diff --git a/docs/histogram.js.html b/docs/histogram.js.html
index 86072184..6b459dcd 100644
--- a/docs/histogram.js.html
+++ b/docs/histogram.js.html
@@ -24,7 +24,7 @@
@@ -247,7 +247,7 @@ histogram.js
diff --git a/docs/index.html b/docs/index.html
index a84a0904..008cca1c 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -24,7 +24,7 @@
@@ -57,7 +57,7 @@
diff --git a/docs/init.js.html b/docs/init.js.html
index 613333f3..7c72dea3 100644
--- a/docs/init.js.html
+++ b/docs/init.js.html
@@ -24,7 +24,7 @@
@@ -531,7 +531,7 @@ init.js
diff --git a/docs/lineplot.js.html b/docs/lineplot.js.html
index 03a2adb0..14254718 100644
--- a/docs/lineplot.js.html
+++ b/docs/lineplot.js.html
@@ -24,7 +24,7 @@
@@ -305,7 +305,7 @@ lineplot.js
diff --git a/docs/scatterplot.js.html b/docs/scatterplot.js.html
index 2e7aca1e..1fa53947 100644
--- a/docs/scatterplot.js.html
+++ b/docs/scatterplot.js.html
@@ -24,7 +24,7 @@
@@ -886,7 +886,7 @@ scatterplot.js
diff --git a/docs/segmented.js.html b/docs/segmented.js.html
index c6e5fa00..9a7c6124 100644
--- a/docs/segmented.js.html
+++ b/docs/segmented.js.html
@@ -24,7 +24,7 @@
@@ -377,7 +377,7 @@ segmented.js
LogNotArra
Source:
@@ -766,7 +766,7 @@ Log
Source:
@@ -896,7 +896,7 @@ Parameters:
diff --git a/docs/Menu.html b/docs/Menu.html
index 0c418037..c21a5924 100644
--- a/docs/Menu.html
+++ b/docs/Menu.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new MenuSource:
@@ -201,7 +201,7 @@ CreateMenu<
Source:
@@ -285,7 +285,7 @@ Handl
Source:
@@ -368,7 +368,90 @@ Source:
-
- constants.js, line 844
+ constants.js, line 876
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ NotifyOfLLMReset()
+
+
+
+
+
+
+ Notifies the user that the LLM will be reset.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+
@@ -451,7 +534,7 @@ PopulateD
- Source:
@@ -534,7 +617,7 @@ SaveDataSource:
@@ -617,7 +700,7 @@ ToggleSource:
@@ -741,7 +824,7 @@ Parameters:
diff --git a/docs/Point.html b/docs/Point.html
index e9903cb5..af8388c0 100644
--- a/docs/Point.html
+++ b/docs/Point.html
@@ -24,7 +24,7 @@
@@ -547,7 +547,7 @@ Returns:
diff --git a/docs/Position.html b/docs/Position.html
index be3a8f17..0e66ba43 100644
--- a/docs/Position.html
+++ b/docs/Position.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new Position<
- Source:
@@ -165,7 +165,7 @@ new Position<
diff --git a/docs/Resources.html b/docs/Resources.html
index 6ec6de01..70b507b6 100644
--- a/docs/Resources.html
+++ b/docs/Resources.html
@@ -24,7 +24,7 @@
@@ -200,7 +200,7 @@ GetStringSource:
@@ -329,7 +329,7 @@ Returns:
diff --git a/docs/Review.html b/docs/Review.html
index 9d2226b2..1f476b4e 100644
--- a/docs/Review.html
+++ b/docs/Review.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new ReviewSource:
@@ -200,7 +200,7 @@ Toggl
- Source:
@@ -324,7 +324,7 @@ Parameters:
diff --git a/docs/ScatterPlot.html b/docs/ScatterPlot.html
index 544da78b..5cead09d 100644
--- a/docs/ScatterPlot.html
+++ b/docs/ScatterPlot.html
@@ -24,7 +24,7 @@
@@ -1427,7 +1427,7 @@ SetLineLa
diff --git a/docs/Segmented.html b/docs/Segmented.html
index ce786aee..4824dd59 100644
--- a/docs/Segmented.html
+++ b/docs/Segmented.html
@@ -24,7 +24,7 @@
@@ -892,7 +892,7 @@ UnSel
diff --git a/docs/Tracker.html b/docs/Tracker.html
index dea73e14..e590510b 100644
--- a/docs/Tracker.html
+++ b/docs/Tracker.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new TrackerSource:
@@ -200,7 +200,7 @@ DataSetupSource:
@@ -283,7 +283,7 @@ DeleteSource:
@@ -366,7 +366,7 @@ Do
- Source:
@@ -449,7 +449,7 @@ GetTrac
- Source:
@@ -557,7 +557,7 @@ LogEventSource:
@@ -692,7 +692,7 @@ SaveTr
- Source:
@@ -827,7 +827,7 @@ isUn
- Source:
@@ -956,7 +956,7 @@ Returns:
diff --git a/docs/audio.js.html b/docs/audio.js.html
index 4fc80eab..b00c498a 100644
--- a/docs/audio.js.html
+++ b/docs/audio.js.html
@@ -24,7 +24,7 @@
@@ -638,7 +638,7 @@ audio.js
diff --git a/docs/barplot.js.html b/docs/barplot.js.html
index bf935fe2..aa9fffe5 100644
--- a/docs/barplot.js.html
+++ b/docs/barplot.js.html
@@ -24,7 +24,7 @@
@@ -372,7 +372,7 @@ barplot.js
diff --git a/docs/boxplot.js.html b/docs/boxplot.js.html
index 4bdb587f..4cc26111 100644
--- a/docs/boxplot.js.html
+++ b/docs/boxplot.js.html
@@ -24,7 +24,7 @@
@@ -796,7 +796,7 @@ boxplot.js
diff --git a/docs/constants.js.html b/docs/constants.js.html
index 591d73d7..32d8bacc 100644
--- a/docs/constants.js.html
+++ b/docs/constants.js.html
@@ -24,7 +24,7 @@
@@ -314,6 +314,7 @@ constants.js
openai: 'OpenAI Vision',
gemini: 'Gemini Pro Vision',
multi: 'Multiple AI',
+ processing: 'Processing Chart...',
},
},
};
@@ -484,7 +485,7 @@ constants.js
</div>
</div>
<div class="modal-footer">
- <button type="button" id="save_and_close_menu">Save and Close</button>
+ <button type="button" id="save_and_close_menu" aria-labelledby="save_and_close_text"><span id="save_and_close_text">Save and Close</span></button>
<button type="button" id="close_menu">Close</button>
</div>
</div>
@@ -620,6 +621,16 @@ constants.js
}
},
]);
+
+ // trigger notification that LLM will be reset
+ // this is done on change of LLM model, multi settings, or skill level
+ constants.events.push([
+ document.getElementById('LLM_model'),
+ 'change',
+ function (e) {
+ menu.NotifyOfLLMReset();
+ },
+ ]);
}
/**
@@ -761,6 +772,9 @@ constants.js
document.getElementById('LLM_preferences').value =
constants.LLMPreferences;
}
+ if (document.getElementById('LLM_reset_notification')) {
+ document.getElementById('LLM_reset_notification').remove();
+ }
}
/**
@@ -818,6 +832,24 @@ constants.js
.setAttribute('aria-live', constants.ariaMode);
}
+ /**
+ * Notifies the user that the LLM will be reset.
+ */
+ NotifyOfLLMReset() {
+ let html =
+ '<p id="LLM_reset_notification">Note: Changes in LLM settings will reset any existing conversation.</p>';
+ document
+ .getElementById('save_and_close_menu')
+ .insertAdjacentHTML('beforebegin', html);
+
+ // add to aria button text
+ document
+ .getElementById('save_and_close_menu')
+ .setAttribute(
+ 'aria-labelledby',
+ 'save_and_close_text LLM_reset_notification'
+ );
+ }
/**
* Handles changes to the LLM model and multi-modal settings.
* We reset if we change the LLM model, multi settings, or skill level.
@@ -936,8 +968,11 @@ constants.js
</button>
</div>
<div class="modal-body">
+ <div id="chatLLM_chat_history_wrapper">
<div id="chatLLM_chat_history" aria-live="${constants.ariaMode}" aria-relevant="additions">
</div>
+ <p id="chatLLM_copy_all_wrapper"><button id="chatLLM_copy_all">Copy all to clipboard</button></p>
+ </div>
<div id="chatLLM_content">
<p><input type="text" id="chatLLM_input" class="form-control" name="chatLLM_input" aria-labelledby="chatLLM_title" size="50"></p>
<div class="LLM_suggestions">
@@ -1079,10 +1114,41 @@ constants.js
document.getElementById('reset_chatLLM'),
'click',
function (e) {
- chatLLM.Toggle(false);
chatLLM.ResetChatHistory();
},
]);
+
+ // copy to clipboard
+ constants.events.push([
+ document.getElementById('chatLLM_copy_all'),
+ 'click',
+ function (e) {
+ let text = document.getElementById('chatLLM_chat_history').innerText;
+ // need newlines instead of paragraphs headings etc
+ text = text.replace(/<p>/g, '\n').replace(/<\/p>/g, '\n');
+ text = text.replace(/<h\d>/g, '\n').replace(/<\/h\d>/g, '\n');
+ text = text.replace(/<.*?>/g, '');
+
+ navigator.clipboard.writeText(text);
+ },
+ ]);
+ constants.events.push([
+ document.getElementById('chatLLM_chat_history'),
+ 'click',
+ function (e) {
+ // we're delegating here, so set the event on child .chatLLM_message_copy_button
+ if (e.target.matches('.chatLLM_message_copy_button')) {
+ // get the innerText of the element before the button
+ let text = e.target.closest('p').previousElementSibling.innerText;
+ // need newlines instead of paragraphs headings etc
+ text = text.replace(/<p>/g, '\n').replace(/<\/p>/g, '\n');
+ text = text.replace(/<h\d>/g, '\n').replace(/<\/h\d>/g, '\n');
+ text = text.replace(/<.*?>/g, '');
+
+ navigator.clipboard.writeText(text);
+ }
+ },
+ ]);
}
/**
@@ -1163,7 +1229,7 @@ constants.js
*/
ProcessLLMResponse(data, model) {
chatLLM.WaitingSound(false);
- console.log('LLM response: ', data);
+ //console.log('LLM response: ', data);
let text = '';
let LLMName = resources.GetString(model);
@@ -1367,9 +1433,9 @@ constants.js
};
// Generate the content
- console.log('LLM request: ', prompt, image);
+ //console.log('LLM request: ', prompt, image);
const result = await model.generateContent([prompt, image]);
- console.log(result.response.text());
+ //console.log(result.response.text());
// Process the response
chatLLM.ProcessLLMResponse(result.response, 'gemini');
@@ -1409,6 +1475,12 @@ constants.js
<p class="chatLLM_message_text">${text}</p>
</div>
`;
+ // add a copy button to actual messages
+ if (user != 'User' && text != resources.GetString('processing')) {
+ html += `
+ <p class="chatLLM_message_copy"><button class="chatLLM_message_copy_button">Copy</button></p>
+ `;
+ }
this.RenderChatMessage(html);
}
@@ -1486,7 +1558,11 @@ constants.js
// get name from resource
let LLMName = resources.GetString(constants.LLMModel);
this.firstTime = false;
- this.DisplayChatMessage(LLMName, 'Processing Chart...', true);
+ this.DisplayChatMessage(
+ LLMName,
+ resources.GetString('processing'),
+ true
+ );
let defaultPrompt = this.GetDefaultPrompt();
this.Submit(defaultPrompt, true);
}
@@ -2282,7 +2358,7 @@ constants.js
diff --git a/docs/controls.js.html b/docs/controls.js.html
index fb8a89b4..3fbf1e2e 100644
--- a/docs/controls.js.html
+++ b/docs/controls.js.html
@@ -24,7 +24,7 @@
@@ -3268,7 +3268,7 @@ controls.js
diff --git a/docs/display.js.html b/docs/display.js.html
index a4ee9c53..1f9acd2b 100644
--- a/docs/display.js.html
+++ b/docs/display.js.html
@@ -24,7 +24,7 @@
@@ -1256,7 +1256,7 @@ display.js
diff --git a/docs/global.html b/docs/global.html
index 05f0215f..f8d03800 100644
--- a/docs/global.html
+++ b/docs/global.html
@@ -24,7 +24,7 @@
@@ -1141,7 +1141,7 @@ Parameters:
diff --git a/docs/heatmap.js.html b/docs/heatmap.js.html
index 1d6889a9..9d586522 100644
--- a/docs/heatmap.js.html
+++ b/docs/heatmap.js.html
@@ -24,7 +24,7 @@
@@ -452,7 +452,7 @@ heatmap.js
diff --git a/docs/histogram.js.html b/docs/histogram.js.html
index 86072184..6b459dcd 100644
--- a/docs/histogram.js.html
+++ b/docs/histogram.js.html
@@ -24,7 +24,7 @@
@@ -247,7 +247,7 @@ histogram.js
diff --git a/docs/index.html b/docs/index.html
index a84a0904..008cca1c 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -24,7 +24,7 @@
@@ -57,7 +57,7 @@
diff --git a/docs/init.js.html b/docs/init.js.html
index 613333f3..7c72dea3 100644
--- a/docs/init.js.html
+++ b/docs/init.js.html
@@ -24,7 +24,7 @@
@@ -531,7 +531,7 @@ init.js
diff --git a/docs/lineplot.js.html b/docs/lineplot.js.html
index 03a2adb0..14254718 100644
--- a/docs/lineplot.js.html
+++ b/docs/lineplot.js.html
@@ -24,7 +24,7 @@
@@ -305,7 +305,7 @@ lineplot.js
diff --git a/docs/scatterplot.js.html b/docs/scatterplot.js.html
index 2e7aca1e..1fa53947 100644
--- a/docs/scatterplot.js.html
+++ b/docs/scatterplot.js.html
@@ -24,7 +24,7 @@
@@ -886,7 +886,7 @@ scatterplot.js
diff --git a/docs/segmented.js.html b/docs/segmented.js.html
index c6e5fa00..9a7c6124 100644
--- a/docs/segmented.js.html
+++ b/docs/segmented.js.html
@@ -24,7 +24,7 @@
@@ -377,7 +377,7 @@ segmented.js
Parameters:
diff --git a/docs/Menu.html b/docs/Menu.html index 0c418037..c21a5924 100644 --- a/docs/Menu.html +++ b/docs/Menu.html @@ -24,7 +24,7 @@
new MenuSource:
@@ -201,7 +201,7 @@ CreateMenu<
Source:
@@ -285,7 +285,7 @@ Handl
Source:
@@ -368,7 +368,90 @@ Source:
-
- constants.js, line 844
+ constants.js, line 876
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Handl
Source:
@@ -368,7 +368,90 @@ Source:
-
- constants.js, line 844
+ constants.js, line 876
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
- - constants.js, line 844 + constants.js, line 876 +
NotifyOfLLMReset()
+ + + + + +-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
- Source: +
- @@ -451,7 +534,7 @@
- Source:
- @@ -534,7 +617,7 @@
- @@ -617,7 +700,7 @@
- @@ -741,7 +824,7 @@
- Source:
- @@ -165,7 +165,7 @@
- @@ -329,7 +329,7 @@
- @@ -200,7 +200,7 @@
- Source:
- @@ -324,7 +324,7 @@
- @@ -200,7 +200,7 @@
- @@ -283,7 +283,7 @@
- @@ -366,7 +366,7 @@
- Source:
- @@ -449,7 +449,7 @@
- Source:
- @@ -557,7 +557,7 @@
- @@ -692,7 +692,7 @@
- Source:
- @@ -827,7 +827,7 @@
- Source:
- @@ -956,7 +956,7 @@
PopulateD
SaveDataSource:
ToggleSource:
Parameters:
diff --git a/docs/Point.html b/docs/Point.html
index e9903cb5..af8388c0 100644
--- a/docs/Point.html
+++ b/docs/Point.html
@@ -24,7 +24,7 @@
@@ -547,7 +547,7 @@ Returns:
diff --git a/docs/Position.html b/docs/Position.html
index be3a8f17..0e66ba43 100644
--- a/docs/Position.html
+++ b/docs/Position.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new Position<
new Position<
diff --git a/docs/Resources.html b/docs/Resources.html
index 6ec6de01..70b507b6 100644
--- a/docs/Resources.html
+++ b/docs/Resources.html
@@ -24,7 +24,7 @@
@@ -200,7 +200,7 @@ GetStringSource:
Returns:
diff --git a/docs/Review.html b/docs/Review.html
index 9d2226b2..1f476b4e 100644
--- a/docs/Review.html
+++ b/docs/Review.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new ReviewSource:
Toggl
Parameters:
diff --git a/docs/ScatterPlot.html b/docs/ScatterPlot.html
index 544da78b..5cead09d 100644
--- a/docs/ScatterPlot.html
+++ b/docs/ScatterPlot.html
@@ -24,7 +24,7 @@
@@ -1427,7 +1427,7 @@ SetLineLa
diff --git a/docs/Segmented.html b/docs/Segmented.html
index ce786aee..4824dd59 100644
--- a/docs/Segmented.html
+++ b/docs/Segmented.html
@@ -24,7 +24,7 @@
@@ -892,7 +892,7 @@ UnSel
diff --git a/docs/Tracker.html b/docs/Tracker.html
index dea73e14..e590510b 100644
--- a/docs/Tracker.html
+++ b/docs/Tracker.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new TrackerSource:
DataSetupSource:
DeleteSource:
Do
GetTrac
LogEventSource:
SaveTr
isUn
Returns:
diff --git a/docs/audio.js.html b/docs/audio.js.html
index 4fc80eab..b00c498a 100644
--- a/docs/audio.js.html
+++ b/docs/audio.js.html
@@ -24,7 +24,7 @@
@@ -638,7 +638,7 @@ audio.js
diff --git a/docs/barplot.js.html b/docs/barplot.js.html
index bf935fe2..aa9fffe5 100644
--- a/docs/barplot.js.html
+++ b/docs/barplot.js.html
@@ -24,7 +24,7 @@
@@ -372,7 +372,7 @@ barplot.js
diff --git a/docs/boxplot.js.html b/docs/boxplot.js.html
index 4bdb587f..4cc26111 100644
--- a/docs/boxplot.js.html
+++ b/docs/boxplot.js.html
@@ -24,7 +24,7 @@
@@ -796,7 +796,7 @@ boxplot.js
diff --git a/docs/constants.js.html b/docs/constants.js.html
index 591d73d7..32d8bacc 100644
--- a/docs/constants.js.html
+++ b/docs/constants.js.html
@@ -24,7 +24,7 @@
@@ -314,6 +314,7 @@ constants.js
openai: 'OpenAI Vision',
gemini: 'Gemini Pro Vision',
multi: 'Multiple AI',
+ processing: 'Processing Chart...',
},
},
};
@@ -484,7 +485,7 @@ constants.js
</div>
</div>
<div class="modal-footer">
- <button type="button" id="save_and_close_menu">Save and Close</button>
+ <button type="button" id="save_and_close_menu" aria-labelledby="save_and_close_text"><span id="save_and_close_text">Save and Close</span></button>
<button type="button" id="close_menu">Close</button>
</div>
</div>
@@ -620,6 +621,16 @@ constants.js
}
},
]);
+
+ // trigger notification that LLM will be reset
+ // this is done on change of LLM model, multi settings, or skill level
+ constants.events.push([
+ document.getElementById('LLM_model'),
+ 'change',
+ function (e) {
+ menu.NotifyOfLLMReset();
+ },
+ ]);
}
/**
@@ -761,6 +772,9 @@ constants.js
document.getElementById('LLM_preferences').value =
constants.LLMPreferences;
}
+ if (document.getElementById('LLM_reset_notification')) {
+ document.getElementById('LLM_reset_notification').remove();
+ }
}
/**
@@ -818,6 +832,24 @@ constants.js
.setAttribute('aria-live', constants.ariaMode);
}
+ /**
+ * Notifies the user that the LLM will be reset.
+ */
+ NotifyOfLLMReset() {
+ let html =
+ '<p id="LLM_reset_notification">Note: Changes in LLM settings will reset any existing conversation.</p>';
+ document
+ .getElementById('save_and_close_menu')
+ .insertAdjacentHTML('beforebegin', html);
+
+ // add to aria button text
+ document
+ .getElementById('save_and_close_menu')
+ .setAttribute(
+ 'aria-labelledby',
+ 'save_and_close_text LLM_reset_notification'
+ );
+ }
/**
* Handles changes to the LLM model and multi-modal settings.
* We reset if we change the LLM model, multi settings, or skill level.
@@ -936,8 +968,11 @@ constants.js
</button>
</div>
<div class="modal-body">
+ <div id="chatLLM_chat_history_wrapper">
<div id="chatLLM_chat_history" aria-live="${constants.ariaMode}" aria-relevant="additions">
</div>
+ <p id="chatLLM_copy_all_wrapper"><button id="chatLLM_copy_all">Copy all to clipboard</button></p>
+ </div>
<div id="chatLLM_content">
<p><input type="text" id="chatLLM_input" class="form-control" name="chatLLM_input" aria-labelledby="chatLLM_title" size="50"></p>
<div class="LLM_suggestions">
@@ -1079,10 +1114,41 @@ constants.js
document.getElementById('reset_chatLLM'),
'click',
function (e) {
- chatLLM.Toggle(false);
chatLLM.ResetChatHistory();
},
]);
+
+ // copy to clipboard
+ constants.events.push([
+ document.getElementById('chatLLM_copy_all'),
+ 'click',
+ function (e) {
+ let text = document.getElementById('chatLLM_chat_history').innerText;
+ // need newlines instead of paragraphs headings etc
+ text = text.replace(/<p>/g, '\n').replace(/<\/p>/g, '\n');
+ text = text.replace(/<h\d>/g, '\n').replace(/<\/h\d>/g, '\n');
+ text = text.replace(/<.*?>/g, '');
+
+ navigator.clipboard.writeText(text);
+ },
+ ]);
+ constants.events.push([
+ document.getElementById('chatLLM_chat_history'),
+ 'click',
+ function (e) {
+ // we're delegating here, so set the event on child .chatLLM_message_copy_button
+ if (e.target.matches('.chatLLM_message_copy_button')) {
+ // get the innerText of the element before the button
+ let text = e.target.closest('p').previousElementSibling.innerText;
+ // need newlines instead of paragraphs headings etc
+ text = text.replace(/<p>/g, '\n').replace(/<\/p>/g, '\n');
+ text = text.replace(/<h\d>/g, '\n').replace(/<\/h\d>/g, '\n');
+ text = text.replace(/<.*?>/g, '');
+
+ navigator.clipboard.writeText(text);
+ }
+ },
+ ]);
}
/**
@@ -1163,7 +1229,7 @@ constants.js
*/
ProcessLLMResponse(data, model) {
chatLLM.WaitingSound(false);
- console.log('LLM response: ', data);
+ //console.log('LLM response: ', data);
let text = '';
let LLMName = resources.GetString(model);
@@ -1367,9 +1433,9 @@ constants.js
};
// Generate the content
- console.log('LLM request: ', prompt, image);
+ //console.log('LLM request: ', prompt, image);
const result = await model.generateContent([prompt, image]);
- console.log(result.response.text());
+ //console.log(result.response.text());
// Process the response
chatLLM.ProcessLLMResponse(result.response, 'gemini');
@@ -1409,6 +1475,12 @@ constants.js
<p class="chatLLM_message_text">${text}</p>
</div>
`;
+ // add a copy button to actual messages
+ if (user != 'User' && text != resources.GetString('processing')) {
+ html += `
+ <p class="chatLLM_message_copy"><button class="chatLLM_message_copy_button">Copy</button></p>
+ `;
+ }
this.RenderChatMessage(html);
}
@@ -1486,7 +1558,11 @@ constants.js
// get name from resource
let LLMName = resources.GetString(constants.LLMModel);
this.firstTime = false;
- this.DisplayChatMessage(LLMName, 'Processing Chart...', true);
+ this.DisplayChatMessage(
+ LLMName,
+ resources.GetString('processing'),
+ true
+ );
let defaultPrompt = this.GetDefaultPrompt();
this.Submit(defaultPrompt, true);
}
@@ -2282,7 +2358,7 @@ constants.js
diff --git a/docs/controls.js.html b/docs/controls.js.html
index fb8a89b4..3fbf1e2e 100644
--- a/docs/controls.js.html
+++ b/docs/controls.js.html
@@ -24,7 +24,7 @@
@@ -3268,7 +3268,7 @@ controls.js
diff --git a/docs/display.js.html b/docs/display.js.html
index a4ee9c53..1f9acd2b 100644
--- a/docs/display.js.html
+++ b/docs/display.js.html
@@ -24,7 +24,7 @@
@@ -1256,7 +1256,7 @@ display.js
diff --git a/docs/global.html b/docs/global.html
index 05f0215f..f8d03800 100644
--- a/docs/global.html
+++ b/docs/global.html
@@ -24,7 +24,7 @@
@@ -1141,7 +1141,7 @@ Parameters:
diff --git a/docs/heatmap.js.html b/docs/heatmap.js.html
index 1d6889a9..9d586522 100644
--- a/docs/heatmap.js.html
+++ b/docs/heatmap.js.html
@@ -24,7 +24,7 @@
@@ -452,7 +452,7 @@ heatmap.js
diff --git a/docs/histogram.js.html b/docs/histogram.js.html
index 86072184..6b459dcd 100644
--- a/docs/histogram.js.html
+++ b/docs/histogram.js.html
@@ -24,7 +24,7 @@
@@ -247,7 +247,7 @@ histogram.js
diff --git a/docs/index.html b/docs/index.html
index a84a0904..008cca1c 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -24,7 +24,7 @@
@@ -57,7 +57,7 @@
diff --git a/docs/init.js.html b/docs/init.js.html
index 613333f3..7c72dea3 100644
--- a/docs/init.js.html
+++ b/docs/init.js.html
@@ -24,7 +24,7 @@
@@ -531,7 +531,7 @@ init.js
diff --git a/docs/lineplot.js.html b/docs/lineplot.js.html
index 03a2adb0..14254718 100644
--- a/docs/lineplot.js.html
+++ b/docs/lineplot.js.html
@@ -24,7 +24,7 @@
@@ -305,7 +305,7 @@ lineplot.js
diff --git a/docs/scatterplot.js.html b/docs/scatterplot.js.html
index 2e7aca1e..1fa53947 100644
--- a/docs/scatterplot.js.html
+++ b/docs/scatterplot.js.html
@@ -24,7 +24,7 @@
@@ -886,7 +886,7 @@ scatterplot.js
diff --git a/docs/segmented.js.html b/docs/segmented.js.html
index c6e5fa00..9a7c6124 100644
--- a/docs/segmented.js.html
+++ b/docs/segmented.js.html
@@ -24,7 +24,7 @@
@@ -377,7 +377,7 @@ segmented.js
ToggleSource:
Parameters:
diff --git a/docs/Point.html b/docs/Point.html
index e9903cb5..af8388c0 100644
--- a/docs/Point.html
+++ b/docs/Point.html
@@ -24,7 +24,7 @@
@@ -547,7 +547,7 @@ Returns:
diff --git a/docs/Position.html b/docs/Position.html
index be3a8f17..0e66ba43 100644
--- a/docs/Position.html
+++ b/docs/Position.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new Position<
new Position<
diff --git a/docs/Resources.html b/docs/Resources.html
index 6ec6de01..70b507b6 100644
--- a/docs/Resources.html
+++ b/docs/Resources.html
@@ -24,7 +24,7 @@
@@ -200,7 +200,7 @@ GetStringSource:
Returns:
diff --git a/docs/Review.html b/docs/Review.html
index 9d2226b2..1f476b4e 100644
--- a/docs/Review.html
+++ b/docs/Review.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new ReviewSource:
Toggl
Parameters:
diff --git a/docs/ScatterPlot.html b/docs/ScatterPlot.html
index 544da78b..5cead09d 100644
--- a/docs/ScatterPlot.html
+++ b/docs/ScatterPlot.html
@@ -24,7 +24,7 @@
@@ -1427,7 +1427,7 @@ SetLineLa
diff --git a/docs/Segmented.html b/docs/Segmented.html
index ce786aee..4824dd59 100644
--- a/docs/Segmented.html
+++ b/docs/Segmented.html
@@ -24,7 +24,7 @@
@@ -892,7 +892,7 @@ UnSel
diff --git a/docs/Tracker.html b/docs/Tracker.html
index dea73e14..e590510b 100644
--- a/docs/Tracker.html
+++ b/docs/Tracker.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new TrackerSource:
DataSetupSource:
DeleteSource:
Do
GetTrac
LogEventSource:
SaveTr
isUn
Returns:
diff --git a/docs/audio.js.html b/docs/audio.js.html
index 4fc80eab..b00c498a 100644
--- a/docs/audio.js.html
+++ b/docs/audio.js.html
@@ -24,7 +24,7 @@
@@ -638,7 +638,7 @@ audio.js
diff --git a/docs/barplot.js.html b/docs/barplot.js.html
index bf935fe2..aa9fffe5 100644
--- a/docs/barplot.js.html
+++ b/docs/barplot.js.html
@@ -24,7 +24,7 @@
@@ -372,7 +372,7 @@ barplot.js
diff --git a/docs/boxplot.js.html b/docs/boxplot.js.html
index 4bdb587f..4cc26111 100644
--- a/docs/boxplot.js.html
+++ b/docs/boxplot.js.html
@@ -24,7 +24,7 @@
@@ -796,7 +796,7 @@ boxplot.js
diff --git a/docs/constants.js.html b/docs/constants.js.html
index 591d73d7..32d8bacc 100644
--- a/docs/constants.js.html
+++ b/docs/constants.js.html
@@ -24,7 +24,7 @@
@@ -314,6 +314,7 @@ constants.js
openai: 'OpenAI Vision',
gemini: 'Gemini Pro Vision',
multi: 'Multiple AI',
+ processing: 'Processing Chart...',
},
},
};
@@ -484,7 +485,7 @@ constants.js
</div>
</div>
<div class="modal-footer">
- <button type="button" id="save_and_close_menu">Save and Close</button>
+ <button type="button" id="save_and_close_menu" aria-labelledby="save_and_close_text"><span id="save_and_close_text">Save and Close</span></button>
<button type="button" id="close_menu">Close</button>
</div>
</div>
@@ -620,6 +621,16 @@ constants.js
}
},
]);
+
+ // trigger notification that LLM will be reset
+ // this is done on change of LLM model, multi settings, or skill level
+ constants.events.push([
+ document.getElementById('LLM_model'),
+ 'change',
+ function (e) {
+ menu.NotifyOfLLMReset();
+ },
+ ]);
}
/**
@@ -761,6 +772,9 @@ constants.js
document.getElementById('LLM_preferences').value =
constants.LLMPreferences;
}
+ if (document.getElementById('LLM_reset_notification')) {
+ document.getElementById('LLM_reset_notification').remove();
+ }
}
/**
@@ -818,6 +832,24 @@ constants.js
.setAttribute('aria-live', constants.ariaMode);
}
+ /**
+ * Notifies the user that the LLM will be reset.
+ */
+ NotifyOfLLMReset() {
+ let html =
+ '<p id="LLM_reset_notification">Note: Changes in LLM settings will reset any existing conversation.</p>';
+ document
+ .getElementById('save_and_close_menu')
+ .insertAdjacentHTML('beforebegin', html);
+
+ // add to aria button text
+ document
+ .getElementById('save_and_close_menu')
+ .setAttribute(
+ 'aria-labelledby',
+ 'save_and_close_text LLM_reset_notification'
+ );
+ }
/**
* Handles changes to the LLM model and multi-modal settings.
* We reset if we change the LLM model, multi settings, or skill level.
@@ -936,8 +968,11 @@ constants.js
</button>
</div>
<div class="modal-body">
+ <div id="chatLLM_chat_history_wrapper">
<div id="chatLLM_chat_history" aria-live="${constants.ariaMode}" aria-relevant="additions">
</div>
+ <p id="chatLLM_copy_all_wrapper"><button id="chatLLM_copy_all">Copy all to clipboard</button></p>
+ </div>
<div id="chatLLM_content">
<p><input type="text" id="chatLLM_input" class="form-control" name="chatLLM_input" aria-labelledby="chatLLM_title" size="50"></p>
<div class="LLM_suggestions">
@@ -1079,10 +1114,41 @@ constants.js
document.getElementById('reset_chatLLM'),
'click',
function (e) {
- chatLLM.Toggle(false);
chatLLM.ResetChatHistory();
},
]);
+
+ // copy to clipboard
+ constants.events.push([
+ document.getElementById('chatLLM_copy_all'),
+ 'click',
+ function (e) {
+ let text = document.getElementById('chatLLM_chat_history').innerText;
+ // need newlines instead of paragraphs headings etc
+ text = text.replace(/<p>/g, '\n').replace(/<\/p>/g, '\n');
+ text = text.replace(/<h\d>/g, '\n').replace(/<\/h\d>/g, '\n');
+ text = text.replace(/<.*?>/g, '');
+
+ navigator.clipboard.writeText(text);
+ },
+ ]);
+ constants.events.push([
+ document.getElementById('chatLLM_chat_history'),
+ 'click',
+ function (e) {
+ // we're delegating here, so set the event on child .chatLLM_message_copy_button
+ if (e.target.matches('.chatLLM_message_copy_button')) {
+ // get the innerText of the element before the button
+ let text = e.target.closest('p').previousElementSibling.innerText;
+ // need newlines instead of paragraphs headings etc
+ text = text.replace(/<p>/g, '\n').replace(/<\/p>/g, '\n');
+ text = text.replace(/<h\d>/g, '\n').replace(/<\/h\d>/g, '\n');
+ text = text.replace(/<.*?>/g, '');
+
+ navigator.clipboard.writeText(text);
+ }
+ },
+ ]);
}
/**
@@ -1163,7 +1229,7 @@ constants.js
*/
ProcessLLMResponse(data, model) {
chatLLM.WaitingSound(false);
- console.log('LLM response: ', data);
+ //console.log('LLM response: ', data);
let text = '';
let LLMName = resources.GetString(model);
@@ -1367,9 +1433,9 @@ constants.js
};
// Generate the content
- console.log('LLM request: ', prompt, image);
+ //console.log('LLM request: ', prompt, image);
const result = await model.generateContent([prompt, image]);
- console.log(result.response.text());
+ //console.log(result.response.text());
// Process the response
chatLLM.ProcessLLMResponse(result.response, 'gemini');
@@ -1409,6 +1475,12 @@ constants.js
<p class="chatLLM_message_text">${text}</p>
</div>
`;
+ // add a copy button to actual messages
+ if (user != 'User' && text != resources.GetString('processing')) {
+ html += `
+ <p class="chatLLM_message_copy"><button class="chatLLM_message_copy_button">Copy</button></p>
+ `;
+ }
this.RenderChatMessage(html);
}
@@ -1486,7 +1558,11 @@ constants.js
// get name from resource
let LLMName = resources.GetString(constants.LLMModel);
this.firstTime = false;
- this.DisplayChatMessage(LLMName, 'Processing Chart...', true);
+ this.DisplayChatMessage(
+ LLMName,
+ resources.GetString('processing'),
+ true
+ );
let defaultPrompt = this.GetDefaultPrompt();
this.Submit(defaultPrompt, true);
}
@@ -2282,7 +2358,7 @@ constants.js
diff --git a/docs/controls.js.html b/docs/controls.js.html
index fb8a89b4..3fbf1e2e 100644
--- a/docs/controls.js.html
+++ b/docs/controls.js.html
@@ -24,7 +24,7 @@
@@ -3268,7 +3268,7 @@ controls.js
diff --git a/docs/display.js.html b/docs/display.js.html
index a4ee9c53..1f9acd2b 100644
--- a/docs/display.js.html
+++ b/docs/display.js.html
@@ -24,7 +24,7 @@
@@ -1256,7 +1256,7 @@ display.js
diff --git a/docs/global.html b/docs/global.html
index 05f0215f..f8d03800 100644
--- a/docs/global.html
+++ b/docs/global.html
@@ -24,7 +24,7 @@
@@ -1141,7 +1141,7 @@ Parameters:
diff --git a/docs/heatmap.js.html b/docs/heatmap.js.html
index 1d6889a9..9d586522 100644
--- a/docs/heatmap.js.html
+++ b/docs/heatmap.js.html
@@ -24,7 +24,7 @@
@@ -452,7 +452,7 @@ heatmap.js
diff --git a/docs/histogram.js.html b/docs/histogram.js.html
index 86072184..6b459dcd 100644
--- a/docs/histogram.js.html
+++ b/docs/histogram.js.html
@@ -24,7 +24,7 @@
@@ -247,7 +247,7 @@ histogram.js
diff --git a/docs/index.html b/docs/index.html
index a84a0904..008cca1c 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -24,7 +24,7 @@
@@ -57,7 +57,7 @@
diff --git a/docs/init.js.html b/docs/init.js.html
index 613333f3..7c72dea3 100644
--- a/docs/init.js.html
+++ b/docs/init.js.html
@@ -24,7 +24,7 @@
@@ -531,7 +531,7 @@ init.js
diff --git a/docs/lineplot.js.html b/docs/lineplot.js.html
index 03a2adb0..14254718 100644
--- a/docs/lineplot.js.html
+++ b/docs/lineplot.js.html
@@ -24,7 +24,7 @@
@@ -305,7 +305,7 @@ lineplot.js
diff --git a/docs/scatterplot.js.html b/docs/scatterplot.js.html
index 2e7aca1e..1fa53947 100644
--- a/docs/scatterplot.js.html
+++ b/docs/scatterplot.js.html
@@ -24,7 +24,7 @@
@@ -886,7 +886,7 @@ scatterplot.js
diff --git a/docs/segmented.js.html b/docs/segmented.js.html
index c6e5fa00..9a7c6124 100644
--- a/docs/segmented.js.html
+++ b/docs/segmented.js.html
@@ -24,7 +24,7 @@
@@ -377,7 +377,7 @@ segmented.js
Returns:
diff --git a/docs/Position.html b/docs/Position.html index be3a8f17..0e66ba43 100644 --- a/docs/Position.html +++ b/docs/Position.html @@ -24,7 +24,7 @@
new Position<
new Position<
diff --git a/docs/Resources.html b/docs/Resources.html
index 6ec6de01..70b507b6 100644
--- a/docs/Resources.html
+++ b/docs/Resources.html
@@ -24,7 +24,7 @@
@@ -200,7 +200,7 @@ GetStringSource:
Returns:
diff --git a/docs/Review.html b/docs/Review.html
index 9d2226b2..1f476b4e 100644
--- a/docs/Review.html
+++ b/docs/Review.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new ReviewSource:
Toggl
Parameters:
diff --git a/docs/ScatterPlot.html b/docs/ScatterPlot.html
index 544da78b..5cead09d 100644
--- a/docs/ScatterPlot.html
+++ b/docs/ScatterPlot.html
@@ -24,7 +24,7 @@
@@ -1427,7 +1427,7 @@ SetLineLa
diff --git a/docs/Segmented.html b/docs/Segmented.html
index ce786aee..4824dd59 100644
--- a/docs/Segmented.html
+++ b/docs/Segmented.html
@@ -24,7 +24,7 @@
@@ -892,7 +892,7 @@ UnSel
diff --git a/docs/Tracker.html b/docs/Tracker.html
index dea73e14..e590510b 100644
--- a/docs/Tracker.html
+++ b/docs/Tracker.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new TrackerSource:
DataSetupSource:
DeleteSource:
Do
GetTrac
LogEventSource:
SaveTr
isUn
Returns:
diff --git a/docs/audio.js.html b/docs/audio.js.html
index 4fc80eab..b00c498a 100644
--- a/docs/audio.js.html
+++ b/docs/audio.js.html
@@ -24,7 +24,7 @@
@@ -638,7 +638,7 @@ audio.js
diff --git a/docs/barplot.js.html b/docs/barplot.js.html
index bf935fe2..aa9fffe5 100644
--- a/docs/barplot.js.html
+++ b/docs/barplot.js.html
@@ -24,7 +24,7 @@
@@ -372,7 +372,7 @@ barplot.js
diff --git a/docs/boxplot.js.html b/docs/boxplot.js.html
index 4bdb587f..4cc26111 100644
--- a/docs/boxplot.js.html
+++ b/docs/boxplot.js.html
@@ -24,7 +24,7 @@
@@ -796,7 +796,7 @@ boxplot.js
diff --git a/docs/constants.js.html b/docs/constants.js.html
index 591d73d7..32d8bacc 100644
--- a/docs/constants.js.html
+++ b/docs/constants.js.html
@@ -24,7 +24,7 @@
@@ -314,6 +314,7 @@ constants.js
openai: 'OpenAI Vision',
gemini: 'Gemini Pro Vision',
multi: 'Multiple AI',
+ processing: 'Processing Chart...',
},
},
};
@@ -484,7 +485,7 @@ constants.js
</div>
</div>
<div class="modal-footer">
- <button type="button" id="save_and_close_menu">Save and Close</button>
+ <button type="button" id="save_and_close_menu" aria-labelledby="save_and_close_text"><span id="save_and_close_text">Save and Close</span></button>
<button type="button" id="close_menu">Close</button>
</div>
</div>
@@ -620,6 +621,16 @@ constants.js
}
},
]);
+
+ // trigger notification that LLM will be reset
+ // this is done on change of LLM model, multi settings, or skill level
+ constants.events.push([
+ document.getElementById('LLM_model'),
+ 'change',
+ function (e) {
+ menu.NotifyOfLLMReset();
+ },
+ ]);
}
/**
@@ -761,6 +772,9 @@ constants.js
document.getElementById('LLM_preferences').value =
constants.LLMPreferences;
}
+ if (document.getElementById('LLM_reset_notification')) {
+ document.getElementById('LLM_reset_notification').remove();
+ }
}
/**
@@ -818,6 +832,24 @@ constants.js
.setAttribute('aria-live', constants.ariaMode);
}
+ /**
+ * Notifies the user that the LLM will be reset.
+ */
+ NotifyOfLLMReset() {
+ let html =
+ '<p id="LLM_reset_notification">Note: Changes in LLM settings will reset any existing conversation.</p>';
+ document
+ .getElementById('save_and_close_menu')
+ .insertAdjacentHTML('beforebegin', html);
+
+ // add to aria button text
+ document
+ .getElementById('save_and_close_menu')
+ .setAttribute(
+ 'aria-labelledby',
+ 'save_and_close_text LLM_reset_notification'
+ );
+ }
/**
* Handles changes to the LLM model and multi-modal settings.
* We reset if we change the LLM model, multi settings, or skill level.
@@ -936,8 +968,11 @@ constants.js
</button>
</div>
<div class="modal-body">
+ <div id="chatLLM_chat_history_wrapper">
<div id="chatLLM_chat_history" aria-live="${constants.ariaMode}" aria-relevant="additions">
</div>
+ <p id="chatLLM_copy_all_wrapper"><button id="chatLLM_copy_all">Copy all to clipboard</button></p>
+ </div>
<div id="chatLLM_content">
<p><input type="text" id="chatLLM_input" class="form-control" name="chatLLM_input" aria-labelledby="chatLLM_title" size="50"></p>
<div class="LLM_suggestions">
@@ -1079,10 +1114,41 @@ constants.js
document.getElementById('reset_chatLLM'),
'click',
function (e) {
- chatLLM.Toggle(false);
chatLLM.ResetChatHistory();
},
]);
+
+ // copy to clipboard
+ constants.events.push([
+ document.getElementById('chatLLM_copy_all'),
+ 'click',
+ function (e) {
+ let text = document.getElementById('chatLLM_chat_history').innerText;
+ // need newlines instead of paragraphs headings etc
+ text = text.replace(/<p>/g, '\n').replace(/<\/p>/g, '\n');
+ text = text.replace(/<h\d>/g, '\n').replace(/<\/h\d>/g, '\n');
+ text = text.replace(/<.*?>/g, '');
+
+ navigator.clipboard.writeText(text);
+ },
+ ]);
+ constants.events.push([
+ document.getElementById('chatLLM_chat_history'),
+ 'click',
+ function (e) {
+ // we're delegating here, so set the event on child .chatLLM_message_copy_button
+ if (e.target.matches('.chatLLM_message_copy_button')) {
+ // get the innerText of the element before the button
+ let text = e.target.closest('p').previousElementSibling.innerText;
+ // need newlines instead of paragraphs headings etc
+ text = text.replace(/<p>/g, '\n').replace(/<\/p>/g, '\n');
+ text = text.replace(/<h\d>/g, '\n').replace(/<\/h\d>/g, '\n');
+ text = text.replace(/<.*?>/g, '');
+
+ navigator.clipboard.writeText(text);
+ }
+ },
+ ]);
}
/**
@@ -1163,7 +1229,7 @@ constants.js
*/
ProcessLLMResponse(data, model) {
chatLLM.WaitingSound(false);
- console.log('LLM response: ', data);
+ //console.log('LLM response: ', data);
let text = '';
let LLMName = resources.GetString(model);
@@ -1367,9 +1433,9 @@ constants.js
};
// Generate the content
- console.log('LLM request: ', prompt, image);
+ //console.log('LLM request: ', prompt, image);
const result = await model.generateContent([prompt, image]);
- console.log(result.response.text());
+ //console.log(result.response.text());
// Process the response
chatLLM.ProcessLLMResponse(result.response, 'gemini');
@@ -1409,6 +1475,12 @@ constants.js
<p class="chatLLM_message_text">${text}</p>
</div>
`;
+ // add a copy button to actual messages
+ if (user != 'User' && text != resources.GetString('processing')) {
+ html += `
+ <p class="chatLLM_message_copy"><button class="chatLLM_message_copy_button">Copy</button></p>
+ `;
+ }
this.RenderChatMessage(html);
}
@@ -1486,7 +1558,11 @@ constants.js
// get name from resource
let LLMName = resources.GetString(constants.LLMModel);
this.firstTime = false;
- this.DisplayChatMessage(LLMName, 'Processing Chart...', true);
+ this.DisplayChatMessage(
+ LLMName,
+ resources.GetString('processing'),
+ true
+ );
let defaultPrompt = this.GetDefaultPrompt();
this.Submit(defaultPrompt, true);
}
@@ -2282,7 +2358,7 @@ constants.js
diff --git a/docs/controls.js.html b/docs/controls.js.html
index fb8a89b4..3fbf1e2e 100644
--- a/docs/controls.js.html
+++ b/docs/controls.js.html
@@ -24,7 +24,7 @@
@@ -3268,7 +3268,7 @@ controls.js
diff --git a/docs/display.js.html b/docs/display.js.html
index a4ee9c53..1f9acd2b 100644
--- a/docs/display.js.html
+++ b/docs/display.js.html
@@ -24,7 +24,7 @@
@@ -1256,7 +1256,7 @@ display.js
diff --git a/docs/global.html b/docs/global.html
index 05f0215f..f8d03800 100644
--- a/docs/global.html
+++ b/docs/global.html
@@ -24,7 +24,7 @@
@@ -1141,7 +1141,7 @@ Parameters:
diff --git a/docs/heatmap.js.html b/docs/heatmap.js.html
index 1d6889a9..9d586522 100644
--- a/docs/heatmap.js.html
+++ b/docs/heatmap.js.html
@@ -24,7 +24,7 @@
@@ -452,7 +452,7 @@ heatmap.js
diff --git a/docs/histogram.js.html b/docs/histogram.js.html
index 86072184..6b459dcd 100644
--- a/docs/histogram.js.html
+++ b/docs/histogram.js.html
@@ -24,7 +24,7 @@
@@ -247,7 +247,7 @@ histogram.js
diff --git a/docs/index.html b/docs/index.html
index a84a0904..008cca1c 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -24,7 +24,7 @@
@@ -57,7 +57,7 @@
diff --git a/docs/init.js.html b/docs/init.js.html
index 613333f3..7c72dea3 100644
--- a/docs/init.js.html
+++ b/docs/init.js.html
@@ -24,7 +24,7 @@
@@ -531,7 +531,7 @@ init.js
diff --git a/docs/lineplot.js.html b/docs/lineplot.js.html
index 03a2adb0..14254718 100644
--- a/docs/lineplot.js.html
+++ b/docs/lineplot.js.html
@@ -24,7 +24,7 @@
@@ -305,7 +305,7 @@ lineplot.js
diff --git a/docs/scatterplot.js.html b/docs/scatterplot.js.html
index 2e7aca1e..1fa53947 100644
--- a/docs/scatterplot.js.html
+++ b/docs/scatterplot.js.html
@@ -24,7 +24,7 @@
@@ -886,7 +886,7 @@ scatterplot.js
diff --git a/docs/segmented.js.html b/docs/segmented.js.html
index c6e5fa00..9a7c6124 100644
--- a/docs/segmented.js.html
+++ b/docs/segmented.js.html
@@ -24,7 +24,7 @@
@@ -377,7 +377,7 @@ segmented.js
diff --git a/docs/Resources.html b/docs/Resources.html index 6ec6de01..70b507b6 100644 --- a/docs/Resources.html +++ b/docs/Resources.html @@ -24,7 +24,7 @@
GetStringSource:
Returns:
diff --git a/docs/Review.html b/docs/Review.html
index 9d2226b2..1f476b4e 100644
--- a/docs/Review.html
+++ b/docs/Review.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new ReviewSource:
Toggl
Parameters:
diff --git a/docs/ScatterPlot.html b/docs/ScatterPlot.html
index 544da78b..5cead09d 100644
--- a/docs/ScatterPlot.html
+++ b/docs/ScatterPlot.html
@@ -24,7 +24,7 @@
@@ -1427,7 +1427,7 @@ SetLineLa
diff --git a/docs/Segmented.html b/docs/Segmented.html
index ce786aee..4824dd59 100644
--- a/docs/Segmented.html
+++ b/docs/Segmented.html
@@ -24,7 +24,7 @@
@@ -892,7 +892,7 @@ UnSel
diff --git a/docs/Tracker.html b/docs/Tracker.html
index dea73e14..e590510b 100644
--- a/docs/Tracker.html
+++ b/docs/Tracker.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new TrackerSource:
DataSetupSource:
DeleteSource:
Do
GetTrac
LogEventSource:
SaveTr
isUn
Returns:
diff --git a/docs/audio.js.html b/docs/audio.js.html
index 4fc80eab..b00c498a 100644
--- a/docs/audio.js.html
+++ b/docs/audio.js.html
@@ -24,7 +24,7 @@
@@ -638,7 +638,7 @@ audio.js
diff --git a/docs/barplot.js.html b/docs/barplot.js.html
index bf935fe2..aa9fffe5 100644
--- a/docs/barplot.js.html
+++ b/docs/barplot.js.html
@@ -24,7 +24,7 @@
@@ -372,7 +372,7 @@ barplot.js
diff --git a/docs/boxplot.js.html b/docs/boxplot.js.html
index 4bdb587f..4cc26111 100644
--- a/docs/boxplot.js.html
+++ b/docs/boxplot.js.html
@@ -24,7 +24,7 @@
@@ -796,7 +796,7 @@ boxplot.js
diff --git a/docs/constants.js.html b/docs/constants.js.html
index 591d73d7..32d8bacc 100644
--- a/docs/constants.js.html
+++ b/docs/constants.js.html
@@ -24,7 +24,7 @@
@@ -314,6 +314,7 @@ constants.js
openai: 'OpenAI Vision',
gemini: 'Gemini Pro Vision',
multi: 'Multiple AI',
+ processing: 'Processing Chart...',
},
},
};
@@ -484,7 +485,7 @@ constants.js
</div>
</div>
<div class="modal-footer">
- <button type="button" id="save_and_close_menu">Save and Close</button>
+ <button type="button" id="save_and_close_menu" aria-labelledby="save_and_close_text"><span id="save_and_close_text">Save and Close</span></button>
<button type="button" id="close_menu">Close</button>
</div>
</div>
@@ -620,6 +621,16 @@ constants.js
}
},
]);
+
+ // trigger notification that LLM will be reset
+ // this is done on change of LLM model, multi settings, or skill level
+ constants.events.push([
+ document.getElementById('LLM_model'),
+ 'change',
+ function (e) {
+ menu.NotifyOfLLMReset();
+ },
+ ]);
}
/**
@@ -761,6 +772,9 @@ constants.js
document.getElementById('LLM_preferences').value =
constants.LLMPreferences;
}
+ if (document.getElementById('LLM_reset_notification')) {
+ document.getElementById('LLM_reset_notification').remove();
+ }
}
/**
@@ -818,6 +832,24 @@ constants.js
.setAttribute('aria-live', constants.ariaMode);
}
+ /**
+ * Notifies the user that the LLM will be reset.
+ */
+ NotifyOfLLMReset() {
+ let html =
+ '<p id="LLM_reset_notification">Note: Changes in LLM settings will reset any existing conversation.</p>';
+ document
+ .getElementById('save_and_close_menu')
+ .insertAdjacentHTML('beforebegin', html);
+
+ // add to aria button text
+ document
+ .getElementById('save_and_close_menu')
+ .setAttribute(
+ 'aria-labelledby',
+ 'save_and_close_text LLM_reset_notification'
+ );
+ }
/**
* Handles changes to the LLM model and multi-modal settings.
* We reset if we change the LLM model, multi settings, or skill level.
@@ -936,8 +968,11 @@ constants.js
</button>
</div>
<div class="modal-body">
+ <div id="chatLLM_chat_history_wrapper">
<div id="chatLLM_chat_history" aria-live="${constants.ariaMode}" aria-relevant="additions">
</div>
+ <p id="chatLLM_copy_all_wrapper"><button id="chatLLM_copy_all">Copy all to clipboard</button></p>
+ </div>
<div id="chatLLM_content">
<p><input type="text" id="chatLLM_input" class="form-control" name="chatLLM_input" aria-labelledby="chatLLM_title" size="50"></p>
<div class="LLM_suggestions">
@@ -1079,10 +1114,41 @@ constants.js
document.getElementById('reset_chatLLM'),
'click',
function (e) {
- chatLLM.Toggle(false);
chatLLM.ResetChatHistory();
},
]);
+
+ // copy to clipboard
+ constants.events.push([
+ document.getElementById('chatLLM_copy_all'),
+ 'click',
+ function (e) {
+ let text = document.getElementById('chatLLM_chat_history').innerText;
+ // need newlines instead of paragraphs headings etc
+ text = text.replace(/<p>/g, '\n').replace(/<\/p>/g, '\n');
+ text = text.replace(/<h\d>/g, '\n').replace(/<\/h\d>/g, '\n');
+ text = text.replace(/<.*?>/g, '');
+
+ navigator.clipboard.writeText(text);
+ },
+ ]);
+ constants.events.push([
+ document.getElementById('chatLLM_chat_history'),
+ 'click',
+ function (e) {
+ // we're delegating here, so set the event on child .chatLLM_message_copy_button
+ if (e.target.matches('.chatLLM_message_copy_button')) {
+ // get the innerText of the element before the button
+ let text = e.target.closest('p').previousElementSibling.innerText;
+ // need newlines instead of paragraphs headings etc
+ text = text.replace(/<p>/g, '\n').replace(/<\/p>/g, '\n');
+ text = text.replace(/<h\d>/g, '\n').replace(/<\/h\d>/g, '\n');
+ text = text.replace(/<.*?>/g, '');
+
+ navigator.clipboard.writeText(text);
+ }
+ },
+ ]);
}
/**
@@ -1163,7 +1229,7 @@ constants.js
*/
ProcessLLMResponse(data, model) {
chatLLM.WaitingSound(false);
- console.log('LLM response: ', data);
+ //console.log('LLM response: ', data);
let text = '';
let LLMName = resources.GetString(model);
@@ -1367,9 +1433,9 @@ constants.js
};
// Generate the content
- console.log('LLM request: ', prompt, image);
+ //console.log('LLM request: ', prompt, image);
const result = await model.generateContent([prompt, image]);
- console.log(result.response.text());
+ //console.log(result.response.text());
// Process the response
chatLLM.ProcessLLMResponse(result.response, 'gemini');
@@ -1409,6 +1475,12 @@ constants.js
<p class="chatLLM_message_text">${text}</p>
</div>
`;
+ // add a copy button to actual messages
+ if (user != 'User' && text != resources.GetString('processing')) {
+ html += `
+ <p class="chatLLM_message_copy"><button class="chatLLM_message_copy_button">Copy</button></p>
+ `;
+ }
this.RenderChatMessage(html);
}
@@ -1486,7 +1558,11 @@ constants.js
// get name from resource
let LLMName = resources.GetString(constants.LLMModel);
this.firstTime = false;
- this.DisplayChatMessage(LLMName, 'Processing Chart...', true);
+ this.DisplayChatMessage(
+ LLMName,
+ resources.GetString('processing'),
+ true
+ );
let defaultPrompt = this.GetDefaultPrompt();
this.Submit(defaultPrompt, true);
}
@@ -2282,7 +2358,7 @@ constants.js
diff --git a/docs/controls.js.html b/docs/controls.js.html
index fb8a89b4..3fbf1e2e 100644
--- a/docs/controls.js.html
+++ b/docs/controls.js.html
@@ -24,7 +24,7 @@
@@ -3268,7 +3268,7 @@ controls.js
diff --git a/docs/display.js.html b/docs/display.js.html
index a4ee9c53..1f9acd2b 100644
--- a/docs/display.js.html
+++ b/docs/display.js.html
@@ -24,7 +24,7 @@
@@ -1256,7 +1256,7 @@ display.js
diff --git a/docs/global.html b/docs/global.html
index 05f0215f..f8d03800 100644
--- a/docs/global.html
+++ b/docs/global.html
@@ -24,7 +24,7 @@
@@ -1141,7 +1141,7 @@ Parameters:
diff --git a/docs/heatmap.js.html b/docs/heatmap.js.html
index 1d6889a9..9d586522 100644
--- a/docs/heatmap.js.html
+++ b/docs/heatmap.js.html
@@ -24,7 +24,7 @@
@@ -452,7 +452,7 @@ heatmap.js
diff --git a/docs/histogram.js.html b/docs/histogram.js.html
index 86072184..6b459dcd 100644
--- a/docs/histogram.js.html
+++ b/docs/histogram.js.html
@@ -24,7 +24,7 @@
@@ -247,7 +247,7 @@ histogram.js
diff --git a/docs/index.html b/docs/index.html
index a84a0904..008cca1c 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -24,7 +24,7 @@
@@ -57,7 +57,7 @@
diff --git a/docs/init.js.html b/docs/init.js.html
index 613333f3..7c72dea3 100644
--- a/docs/init.js.html
+++ b/docs/init.js.html
@@ -24,7 +24,7 @@
@@ -531,7 +531,7 @@ init.js
diff --git a/docs/lineplot.js.html b/docs/lineplot.js.html
index 03a2adb0..14254718 100644
--- a/docs/lineplot.js.html
+++ b/docs/lineplot.js.html
@@ -24,7 +24,7 @@
@@ -305,7 +305,7 @@ lineplot.js
diff --git a/docs/scatterplot.js.html b/docs/scatterplot.js.html
index 2e7aca1e..1fa53947 100644
--- a/docs/scatterplot.js.html
+++ b/docs/scatterplot.js.html
@@ -24,7 +24,7 @@
@@ -886,7 +886,7 @@ scatterplot.js
diff --git a/docs/segmented.js.html b/docs/segmented.js.html
index c6e5fa00..9a7c6124 100644
--- a/docs/segmented.js.html
+++ b/docs/segmented.js.html
@@ -24,7 +24,7 @@
@@ -377,7 +377,7 @@ segmented.js
Returns:
diff --git a/docs/Review.html b/docs/Review.html index 9d2226b2..1f476b4e 100644 --- a/docs/Review.html +++ b/docs/Review.html @@ -24,7 +24,7 @@
new ReviewSource:
Toggl
Parameters:
diff --git a/docs/ScatterPlot.html b/docs/ScatterPlot.html
index 544da78b..5cead09d 100644
--- a/docs/ScatterPlot.html
+++ b/docs/ScatterPlot.html
@@ -24,7 +24,7 @@
@@ -1427,7 +1427,7 @@ SetLineLa
diff --git a/docs/Segmented.html b/docs/Segmented.html
index ce786aee..4824dd59 100644
--- a/docs/Segmented.html
+++ b/docs/Segmented.html
@@ -24,7 +24,7 @@
@@ -892,7 +892,7 @@ UnSel
diff --git a/docs/Tracker.html b/docs/Tracker.html
index dea73e14..e590510b 100644
--- a/docs/Tracker.html
+++ b/docs/Tracker.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new TrackerSource:
DataSetupSource:
DeleteSource:
Do
GetTrac
LogEventSource:
SaveTr
isUn
Returns:
diff --git a/docs/audio.js.html b/docs/audio.js.html
index 4fc80eab..b00c498a 100644
--- a/docs/audio.js.html
+++ b/docs/audio.js.html
@@ -24,7 +24,7 @@
@@ -638,7 +638,7 @@ audio.js
diff --git a/docs/barplot.js.html b/docs/barplot.js.html
index bf935fe2..aa9fffe5 100644
--- a/docs/barplot.js.html
+++ b/docs/barplot.js.html
@@ -24,7 +24,7 @@
@@ -372,7 +372,7 @@ barplot.js
diff --git a/docs/boxplot.js.html b/docs/boxplot.js.html
index 4bdb587f..4cc26111 100644
--- a/docs/boxplot.js.html
+++ b/docs/boxplot.js.html
@@ -24,7 +24,7 @@
@@ -796,7 +796,7 @@ boxplot.js
diff --git a/docs/constants.js.html b/docs/constants.js.html
index 591d73d7..32d8bacc 100644
--- a/docs/constants.js.html
+++ b/docs/constants.js.html
@@ -24,7 +24,7 @@
@@ -314,6 +314,7 @@ constants.js
openai: 'OpenAI Vision',
gemini: 'Gemini Pro Vision',
multi: 'Multiple AI',
+ processing: 'Processing Chart...',
},
},
};
@@ -484,7 +485,7 @@ constants.js
</div>
</div>
<div class="modal-footer">
- <button type="button" id="save_and_close_menu">Save and Close</button>
+ <button type="button" id="save_and_close_menu" aria-labelledby="save_and_close_text"><span id="save_and_close_text">Save and Close</span></button>
<button type="button" id="close_menu">Close</button>
</div>
</div>
@@ -620,6 +621,16 @@ constants.js
}
},
]);
+
+ // trigger notification that LLM will be reset
+ // this is done on change of LLM model, multi settings, or skill level
+ constants.events.push([
+ document.getElementById('LLM_model'),
+ 'change',
+ function (e) {
+ menu.NotifyOfLLMReset();
+ },
+ ]);
}
/**
@@ -761,6 +772,9 @@ constants.js
document.getElementById('LLM_preferences').value =
constants.LLMPreferences;
}
+ if (document.getElementById('LLM_reset_notification')) {
+ document.getElementById('LLM_reset_notification').remove();
+ }
}
/**
@@ -818,6 +832,24 @@ constants.js
.setAttribute('aria-live', constants.ariaMode);
}
+ /**
+ * Notifies the user that the LLM will be reset.
+ */
+ NotifyOfLLMReset() {
+ let html =
+ '<p id="LLM_reset_notification">Note: Changes in LLM settings will reset any existing conversation.</p>';
+ document
+ .getElementById('save_and_close_menu')
+ .insertAdjacentHTML('beforebegin', html);
+
+ // add to aria button text
+ document
+ .getElementById('save_and_close_menu')
+ .setAttribute(
+ 'aria-labelledby',
+ 'save_and_close_text LLM_reset_notification'
+ );
+ }
/**
* Handles changes to the LLM model and multi-modal settings.
* We reset if we change the LLM model, multi settings, or skill level.
@@ -936,8 +968,11 @@ constants.js
</button>
</div>
<div class="modal-body">
+ <div id="chatLLM_chat_history_wrapper">
<div id="chatLLM_chat_history" aria-live="${constants.ariaMode}" aria-relevant="additions">
</div>
+ <p id="chatLLM_copy_all_wrapper"><button id="chatLLM_copy_all">Copy all to clipboard</button></p>
+ </div>
<div id="chatLLM_content">
<p><input type="text" id="chatLLM_input" class="form-control" name="chatLLM_input" aria-labelledby="chatLLM_title" size="50"></p>
<div class="LLM_suggestions">
@@ -1079,10 +1114,41 @@ constants.js
document.getElementById('reset_chatLLM'),
'click',
function (e) {
- chatLLM.Toggle(false);
chatLLM.ResetChatHistory();
},
]);
+
+ // copy to clipboard
+ constants.events.push([
+ document.getElementById('chatLLM_copy_all'),
+ 'click',
+ function (e) {
+ let text = document.getElementById('chatLLM_chat_history').innerText;
+ // need newlines instead of paragraphs headings etc
+ text = text.replace(/<p>/g, '\n').replace(/<\/p>/g, '\n');
+ text = text.replace(/<h\d>/g, '\n').replace(/<\/h\d>/g, '\n');
+ text = text.replace(/<.*?>/g, '');
+
+ navigator.clipboard.writeText(text);
+ },
+ ]);
+ constants.events.push([
+ document.getElementById('chatLLM_chat_history'),
+ 'click',
+ function (e) {
+ // we're delegating here, so set the event on child .chatLLM_message_copy_button
+ if (e.target.matches('.chatLLM_message_copy_button')) {
+ // get the innerText of the element before the button
+ let text = e.target.closest('p').previousElementSibling.innerText;
+ // need newlines instead of paragraphs headings etc
+ text = text.replace(/<p>/g, '\n').replace(/<\/p>/g, '\n');
+ text = text.replace(/<h\d>/g, '\n').replace(/<\/h\d>/g, '\n');
+ text = text.replace(/<.*?>/g, '');
+
+ navigator.clipboard.writeText(text);
+ }
+ },
+ ]);
}
/**
@@ -1163,7 +1229,7 @@ constants.js
*/
ProcessLLMResponse(data, model) {
chatLLM.WaitingSound(false);
- console.log('LLM response: ', data);
+ //console.log('LLM response: ', data);
let text = '';
let LLMName = resources.GetString(model);
@@ -1367,9 +1433,9 @@ constants.js
};
// Generate the content
- console.log('LLM request: ', prompt, image);
+ //console.log('LLM request: ', prompt, image);
const result = await model.generateContent([prompt, image]);
- console.log(result.response.text());
+ //console.log(result.response.text());
// Process the response
chatLLM.ProcessLLMResponse(result.response, 'gemini');
@@ -1409,6 +1475,12 @@ constants.js
<p class="chatLLM_message_text">${text}</p>
</div>
`;
+ // add a copy button to actual messages
+ if (user != 'User' && text != resources.GetString('processing')) {
+ html += `
+ <p class="chatLLM_message_copy"><button class="chatLLM_message_copy_button">Copy</button></p>
+ `;
+ }
this.RenderChatMessage(html);
}
@@ -1486,7 +1558,11 @@ constants.js
// get name from resource
let LLMName = resources.GetString(constants.LLMModel);
this.firstTime = false;
- this.DisplayChatMessage(LLMName, 'Processing Chart...', true);
+ this.DisplayChatMessage(
+ LLMName,
+ resources.GetString('processing'),
+ true
+ );
let defaultPrompt = this.GetDefaultPrompt();
this.Submit(defaultPrompt, true);
}
@@ -2282,7 +2358,7 @@ constants.js
diff --git a/docs/controls.js.html b/docs/controls.js.html
index fb8a89b4..3fbf1e2e 100644
--- a/docs/controls.js.html
+++ b/docs/controls.js.html
@@ -24,7 +24,7 @@
@@ -3268,7 +3268,7 @@ controls.js
diff --git a/docs/display.js.html b/docs/display.js.html
index a4ee9c53..1f9acd2b 100644
--- a/docs/display.js.html
+++ b/docs/display.js.html
@@ -24,7 +24,7 @@
@@ -1256,7 +1256,7 @@ display.js
diff --git a/docs/global.html b/docs/global.html
index 05f0215f..f8d03800 100644
--- a/docs/global.html
+++ b/docs/global.html
@@ -24,7 +24,7 @@
@@ -1141,7 +1141,7 @@ Parameters:
diff --git a/docs/heatmap.js.html b/docs/heatmap.js.html
index 1d6889a9..9d586522 100644
--- a/docs/heatmap.js.html
+++ b/docs/heatmap.js.html
@@ -24,7 +24,7 @@
@@ -452,7 +452,7 @@ heatmap.js
diff --git a/docs/histogram.js.html b/docs/histogram.js.html
index 86072184..6b459dcd 100644
--- a/docs/histogram.js.html
+++ b/docs/histogram.js.html
@@ -24,7 +24,7 @@
@@ -247,7 +247,7 @@ histogram.js
diff --git a/docs/index.html b/docs/index.html
index a84a0904..008cca1c 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -24,7 +24,7 @@
@@ -57,7 +57,7 @@
diff --git a/docs/init.js.html b/docs/init.js.html
index 613333f3..7c72dea3 100644
--- a/docs/init.js.html
+++ b/docs/init.js.html
@@ -24,7 +24,7 @@
@@ -531,7 +531,7 @@ init.js
diff --git a/docs/lineplot.js.html b/docs/lineplot.js.html
index 03a2adb0..14254718 100644
--- a/docs/lineplot.js.html
+++ b/docs/lineplot.js.html
@@ -24,7 +24,7 @@
@@ -305,7 +305,7 @@ lineplot.js
diff --git a/docs/scatterplot.js.html b/docs/scatterplot.js.html
index 2e7aca1e..1fa53947 100644
--- a/docs/scatterplot.js.html
+++ b/docs/scatterplot.js.html
@@ -24,7 +24,7 @@
@@ -886,7 +886,7 @@ scatterplot.js
diff --git a/docs/segmented.js.html b/docs/segmented.js.html
index c6e5fa00..9a7c6124 100644
--- a/docs/segmented.js.html
+++ b/docs/segmented.js.html
@@ -24,7 +24,7 @@
@@ -377,7 +377,7 @@ segmented.js
Parameters:
diff --git a/docs/ScatterPlot.html b/docs/ScatterPlot.html index 544da78b..5cead09d 100644 --- a/docs/ScatterPlot.html +++ b/docs/ScatterPlot.html @@ -24,7 +24,7 @@
SetLineLa
diff --git a/docs/Segmented.html b/docs/Segmented.html
index ce786aee..4824dd59 100644
--- a/docs/Segmented.html
+++ b/docs/Segmented.html
@@ -24,7 +24,7 @@
@@ -892,7 +892,7 @@ UnSel
diff --git a/docs/Tracker.html b/docs/Tracker.html
index dea73e14..e590510b 100644
--- a/docs/Tracker.html
+++ b/docs/Tracker.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new TrackerSource:
DataSetupSource:
DeleteSource:
Do
GetTrac
LogEventSource:
SaveTr
isUn
Returns:
diff --git a/docs/audio.js.html b/docs/audio.js.html
index 4fc80eab..b00c498a 100644
--- a/docs/audio.js.html
+++ b/docs/audio.js.html
@@ -24,7 +24,7 @@
@@ -638,7 +638,7 @@ audio.js
diff --git a/docs/barplot.js.html b/docs/barplot.js.html
index bf935fe2..aa9fffe5 100644
--- a/docs/barplot.js.html
+++ b/docs/barplot.js.html
@@ -24,7 +24,7 @@
@@ -372,7 +372,7 @@ barplot.js
diff --git a/docs/boxplot.js.html b/docs/boxplot.js.html
index 4bdb587f..4cc26111 100644
--- a/docs/boxplot.js.html
+++ b/docs/boxplot.js.html
@@ -24,7 +24,7 @@
@@ -796,7 +796,7 @@ boxplot.js
diff --git a/docs/constants.js.html b/docs/constants.js.html
index 591d73d7..32d8bacc 100644
--- a/docs/constants.js.html
+++ b/docs/constants.js.html
@@ -24,7 +24,7 @@
@@ -314,6 +314,7 @@ constants.js
openai: 'OpenAI Vision',
gemini: 'Gemini Pro Vision',
multi: 'Multiple AI',
+ processing: 'Processing Chart...',
},
},
};
@@ -484,7 +485,7 @@ constants.js
</div>
</div>
<div class="modal-footer">
- <button type="button" id="save_and_close_menu">Save and Close</button>
+ <button type="button" id="save_and_close_menu" aria-labelledby="save_and_close_text"><span id="save_and_close_text">Save and Close</span></button>
<button type="button" id="close_menu">Close</button>
</div>
</div>
@@ -620,6 +621,16 @@ constants.js
}
},
]);
+
+ // trigger notification that LLM will be reset
+ // this is done on change of LLM model, multi settings, or skill level
+ constants.events.push([
+ document.getElementById('LLM_model'),
+ 'change',
+ function (e) {
+ menu.NotifyOfLLMReset();
+ },
+ ]);
}
/**
@@ -761,6 +772,9 @@ constants.js
document.getElementById('LLM_preferences').value =
constants.LLMPreferences;
}
+ if (document.getElementById('LLM_reset_notification')) {
+ document.getElementById('LLM_reset_notification').remove();
+ }
}
/**
@@ -818,6 +832,24 @@ constants.js
.setAttribute('aria-live', constants.ariaMode);
}
+ /**
+ * Notifies the user that the LLM will be reset.
+ */
+ NotifyOfLLMReset() {
+ let html =
+ '<p id="LLM_reset_notification">Note: Changes in LLM settings will reset any existing conversation.</p>';
+ document
+ .getElementById('save_and_close_menu')
+ .insertAdjacentHTML('beforebegin', html);
+
+ // add to aria button text
+ document
+ .getElementById('save_and_close_menu')
+ .setAttribute(
+ 'aria-labelledby',
+ 'save_and_close_text LLM_reset_notification'
+ );
+ }
/**
* Handles changes to the LLM model and multi-modal settings.
* We reset if we change the LLM model, multi settings, or skill level.
@@ -936,8 +968,11 @@ constants.js
</button>
</div>
<div class="modal-body">
+ <div id="chatLLM_chat_history_wrapper">
<div id="chatLLM_chat_history" aria-live="${constants.ariaMode}" aria-relevant="additions">
</div>
+ <p id="chatLLM_copy_all_wrapper"><button id="chatLLM_copy_all">Copy all to clipboard</button></p>
+ </div>
<div id="chatLLM_content">
<p><input type="text" id="chatLLM_input" class="form-control" name="chatLLM_input" aria-labelledby="chatLLM_title" size="50"></p>
<div class="LLM_suggestions">
@@ -1079,10 +1114,41 @@ constants.js
document.getElementById('reset_chatLLM'),
'click',
function (e) {
- chatLLM.Toggle(false);
chatLLM.ResetChatHistory();
},
]);
+
+ // copy to clipboard
+ constants.events.push([
+ document.getElementById('chatLLM_copy_all'),
+ 'click',
+ function (e) {
+ let text = document.getElementById('chatLLM_chat_history').innerText;
+ // need newlines instead of paragraphs headings etc
+ text = text.replace(/<p>/g, '\n').replace(/<\/p>/g, '\n');
+ text = text.replace(/<h\d>/g, '\n').replace(/<\/h\d>/g, '\n');
+ text = text.replace(/<.*?>/g, '');
+
+ navigator.clipboard.writeText(text);
+ },
+ ]);
+ constants.events.push([
+ document.getElementById('chatLLM_chat_history'),
+ 'click',
+ function (e) {
+ // we're delegating here, so set the event on child .chatLLM_message_copy_button
+ if (e.target.matches('.chatLLM_message_copy_button')) {
+ // get the innerText of the element before the button
+ let text = e.target.closest('p').previousElementSibling.innerText;
+ // need newlines instead of paragraphs headings etc
+ text = text.replace(/<p>/g, '\n').replace(/<\/p>/g, '\n');
+ text = text.replace(/<h\d>/g, '\n').replace(/<\/h\d>/g, '\n');
+ text = text.replace(/<.*?>/g, '');
+
+ navigator.clipboard.writeText(text);
+ }
+ },
+ ]);
}
/**
@@ -1163,7 +1229,7 @@ constants.js
*/
ProcessLLMResponse(data, model) {
chatLLM.WaitingSound(false);
- console.log('LLM response: ', data);
+ //console.log('LLM response: ', data);
let text = '';
let LLMName = resources.GetString(model);
@@ -1367,9 +1433,9 @@ constants.js
};
// Generate the content
- console.log('LLM request: ', prompt, image);
+ //console.log('LLM request: ', prompt, image);
const result = await model.generateContent([prompt, image]);
- console.log(result.response.text());
+ //console.log(result.response.text());
// Process the response
chatLLM.ProcessLLMResponse(result.response, 'gemini');
@@ -1409,6 +1475,12 @@ constants.js
<p class="chatLLM_message_text">${text}</p>
</div>
`;
+ // add a copy button to actual messages
+ if (user != 'User' && text != resources.GetString('processing')) {
+ html += `
+ <p class="chatLLM_message_copy"><button class="chatLLM_message_copy_button">Copy</button></p>
+ `;
+ }
this.RenderChatMessage(html);
}
@@ -1486,7 +1558,11 @@ constants.js
// get name from resource
let LLMName = resources.GetString(constants.LLMModel);
this.firstTime = false;
- this.DisplayChatMessage(LLMName, 'Processing Chart...', true);
+ this.DisplayChatMessage(
+ LLMName,
+ resources.GetString('processing'),
+ true
+ );
let defaultPrompt = this.GetDefaultPrompt();
this.Submit(defaultPrompt, true);
}
@@ -2282,7 +2358,7 @@ constants.js
diff --git a/docs/controls.js.html b/docs/controls.js.html
index fb8a89b4..3fbf1e2e 100644
--- a/docs/controls.js.html
+++ b/docs/controls.js.html
@@ -24,7 +24,7 @@
@@ -3268,7 +3268,7 @@ controls.js
diff --git a/docs/display.js.html b/docs/display.js.html
index a4ee9c53..1f9acd2b 100644
--- a/docs/display.js.html
+++ b/docs/display.js.html
@@ -24,7 +24,7 @@
@@ -1256,7 +1256,7 @@ display.js
diff --git a/docs/global.html b/docs/global.html
index 05f0215f..f8d03800 100644
--- a/docs/global.html
+++ b/docs/global.html
@@ -24,7 +24,7 @@
@@ -1141,7 +1141,7 @@ Parameters:
diff --git a/docs/heatmap.js.html b/docs/heatmap.js.html
index 1d6889a9..9d586522 100644
--- a/docs/heatmap.js.html
+++ b/docs/heatmap.js.html
@@ -24,7 +24,7 @@
@@ -452,7 +452,7 @@ heatmap.js
diff --git a/docs/histogram.js.html b/docs/histogram.js.html
index 86072184..6b459dcd 100644
--- a/docs/histogram.js.html
+++ b/docs/histogram.js.html
@@ -24,7 +24,7 @@
@@ -247,7 +247,7 @@ histogram.js
diff --git a/docs/index.html b/docs/index.html
index a84a0904..008cca1c 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -24,7 +24,7 @@
@@ -57,7 +57,7 @@
diff --git a/docs/init.js.html b/docs/init.js.html
index 613333f3..7c72dea3 100644
--- a/docs/init.js.html
+++ b/docs/init.js.html
@@ -24,7 +24,7 @@
@@ -531,7 +531,7 @@ init.js
diff --git a/docs/lineplot.js.html b/docs/lineplot.js.html
index 03a2adb0..14254718 100644
--- a/docs/lineplot.js.html
+++ b/docs/lineplot.js.html
@@ -24,7 +24,7 @@
@@ -305,7 +305,7 @@ lineplot.js
diff --git a/docs/scatterplot.js.html b/docs/scatterplot.js.html
index 2e7aca1e..1fa53947 100644
--- a/docs/scatterplot.js.html
+++ b/docs/scatterplot.js.html
@@ -24,7 +24,7 @@
@@ -886,7 +886,7 @@ scatterplot.js
diff --git a/docs/segmented.js.html b/docs/segmented.js.html
index c6e5fa00..9a7c6124 100644
--- a/docs/segmented.js.html
+++ b/docs/segmented.js.html
@@ -24,7 +24,7 @@
@@ -377,7 +377,7 @@ segmented.js
UnSel
diff --git a/docs/Tracker.html b/docs/Tracker.html
index dea73e14..e590510b 100644
--- a/docs/Tracker.html
+++ b/docs/Tracker.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ new TrackerSource:
DataSetupSource:
DeleteSource:
Do
GetTrac
LogEventSource:
SaveTr
isUn
Returns:
diff --git a/docs/audio.js.html b/docs/audio.js.html
index 4fc80eab..b00c498a 100644
--- a/docs/audio.js.html
+++ b/docs/audio.js.html
@@ -24,7 +24,7 @@
@@ -638,7 +638,7 @@ audio.js
diff --git a/docs/barplot.js.html b/docs/barplot.js.html
index bf935fe2..aa9fffe5 100644
--- a/docs/barplot.js.html
+++ b/docs/barplot.js.html
@@ -24,7 +24,7 @@
@@ -372,7 +372,7 @@ barplot.js
diff --git a/docs/boxplot.js.html b/docs/boxplot.js.html
index 4bdb587f..4cc26111 100644
--- a/docs/boxplot.js.html
+++ b/docs/boxplot.js.html
@@ -24,7 +24,7 @@
@@ -796,7 +796,7 @@ boxplot.js
diff --git a/docs/constants.js.html b/docs/constants.js.html
index 591d73d7..32d8bacc 100644
--- a/docs/constants.js.html
+++ b/docs/constants.js.html
@@ -24,7 +24,7 @@
@@ -314,6 +314,7 @@ constants.js
openai: 'OpenAI Vision',
gemini: 'Gemini Pro Vision',
multi: 'Multiple AI',
+ processing: 'Processing Chart...',
},
},
};
@@ -484,7 +485,7 @@ constants.js
</div>
</div>
<div class="modal-footer">
- <button type="button" id="save_and_close_menu">Save and Close</button>
+ <button type="button" id="save_and_close_menu" aria-labelledby="save_and_close_text"><span id="save_and_close_text">Save and Close</span></button>
<button type="button" id="close_menu">Close</button>
</div>
</div>
@@ -620,6 +621,16 @@ constants.js
}
},
]);
+
+ // trigger notification that LLM will be reset
+ // this is done on change of LLM model, multi settings, or skill level
+ constants.events.push([
+ document.getElementById('LLM_model'),
+ 'change',
+ function (e) {
+ menu.NotifyOfLLMReset();
+ },
+ ]);
}
/**
@@ -761,6 +772,9 @@ constants.js
document.getElementById('LLM_preferences').value =
constants.LLMPreferences;
}
+ if (document.getElementById('LLM_reset_notification')) {
+ document.getElementById('LLM_reset_notification').remove();
+ }
}
/**
@@ -818,6 +832,24 @@ constants.js
.setAttribute('aria-live', constants.ariaMode);
}
+ /**
+ * Notifies the user that the LLM will be reset.
+ */
+ NotifyOfLLMReset() {
+ let html =
+ '<p id="LLM_reset_notification">Note: Changes in LLM settings will reset any existing conversation.</p>';
+ document
+ .getElementById('save_and_close_menu')
+ .insertAdjacentHTML('beforebegin', html);
+
+ // add to aria button text
+ document
+ .getElementById('save_and_close_menu')
+ .setAttribute(
+ 'aria-labelledby',
+ 'save_and_close_text LLM_reset_notification'
+ );
+ }
/**
* Handles changes to the LLM model and multi-modal settings.
* We reset if we change the LLM model, multi settings, or skill level.
@@ -936,8 +968,11 @@ constants.js
</button>
</div>
<div class="modal-body">
+ <div id="chatLLM_chat_history_wrapper">
<div id="chatLLM_chat_history" aria-live="${constants.ariaMode}" aria-relevant="additions">
</div>
+ <p id="chatLLM_copy_all_wrapper"><button id="chatLLM_copy_all">Copy all to clipboard</button></p>
+ </div>
<div id="chatLLM_content">
<p><input type="text" id="chatLLM_input" class="form-control" name="chatLLM_input" aria-labelledby="chatLLM_title" size="50"></p>
<div class="LLM_suggestions">
@@ -1079,10 +1114,41 @@ constants.js
document.getElementById('reset_chatLLM'),
'click',
function (e) {
- chatLLM.Toggle(false);
chatLLM.ResetChatHistory();
},
]);
+
+ // copy to clipboard
+ constants.events.push([
+ document.getElementById('chatLLM_copy_all'),
+ 'click',
+ function (e) {
+ let text = document.getElementById('chatLLM_chat_history').innerText;
+ // need newlines instead of paragraphs headings etc
+ text = text.replace(/<p>/g, '\n').replace(/<\/p>/g, '\n');
+ text = text.replace(/<h\d>/g, '\n').replace(/<\/h\d>/g, '\n');
+ text = text.replace(/<.*?>/g, '');
+
+ navigator.clipboard.writeText(text);
+ },
+ ]);
+ constants.events.push([
+ document.getElementById('chatLLM_chat_history'),
+ 'click',
+ function (e) {
+ // we're delegating here, so set the event on child .chatLLM_message_copy_button
+ if (e.target.matches('.chatLLM_message_copy_button')) {
+ // get the innerText of the element before the button
+ let text = e.target.closest('p').previousElementSibling.innerText;
+ // need newlines instead of paragraphs headings etc
+ text = text.replace(/<p>/g, '\n').replace(/<\/p>/g, '\n');
+ text = text.replace(/<h\d>/g, '\n').replace(/<\/h\d>/g, '\n');
+ text = text.replace(/<.*?>/g, '');
+
+ navigator.clipboard.writeText(text);
+ }
+ },
+ ]);
}
/**
@@ -1163,7 +1229,7 @@ constants.js
*/
ProcessLLMResponse(data, model) {
chatLLM.WaitingSound(false);
- console.log('LLM response: ', data);
+ //console.log('LLM response: ', data);
let text = '';
let LLMName = resources.GetString(model);
@@ -1367,9 +1433,9 @@ constants.js
};
// Generate the content
- console.log('LLM request: ', prompt, image);
+ //console.log('LLM request: ', prompt, image);
const result = await model.generateContent([prompt, image]);
- console.log(result.response.text());
+ //console.log(result.response.text());
// Process the response
chatLLM.ProcessLLMResponse(result.response, 'gemini');
@@ -1409,6 +1475,12 @@ constants.js
<p class="chatLLM_message_text">${text}</p>
</div>
`;
+ // add a copy button to actual messages
+ if (user != 'User' && text != resources.GetString('processing')) {
+ html += `
+ <p class="chatLLM_message_copy"><button class="chatLLM_message_copy_button">Copy</button></p>
+ `;
+ }
this.RenderChatMessage(html);
}
@@ -1486,7 +1558,11 @@ constants.js
// get name from resource
let LLMName = resources.GetString(constants.LLMModel);
this.firstTime = false;
- this.DisplayChatMessage(LLMName, 'Processing Chart...', true);
+ this.DisplayChatMessage(
+ LLMName,
+ resources.GetString('processing'),
+ true
+ );
let defaultPrompt = this.GetDefaultPrompt();
this.Submit(defaultPrompt, true);
}
@@ -2282,7 +2358,7 @@ constants.js
diff --git a/docs/controls.js.html b/docs/controls.js.html
index fb8a89b4..3fbf1e2e 100644
--- a/docs/controls.js.html
+++ b/docs/controls.js.html
@@ -24,7 +24,7 @@
@@ -3268,7 +3268,7 @@ controls.js
diff --git a/docs/display.js.html b/docs/display.js.html
index a4ee9c53..1f9acd2b 100644
--- a/docs/display.js.html
+++ b/docs/display.js.html
@@ -24,7 +24,7 @@
@@ -1256,7 +1256,7 @@ display.js
diff --git a/docs/global.html b/docs/global.html
index 05f0215f..f8d03800 100644
--- a/docs/global.html
+++ b/docs/global.html
@@ -24,7 +24,7 @@
@@ -1141,7 +1141,7 @@ Parameters:
diff --git a/docs/heatmap.js.html b/docs/heatmap.js.html
index 1d6889a9..9d586522 100644
--- a/docs/heatmap.js.html
+++ b/docs/heatmap.js.html
@@ -24,7 +24,7 @@
@@ -452,7 +452,7 @@ heatmap.js
diff --git a/docs/histogram.js.html b/docs/histogram.js.html
index 86072184..6b459dcd 100644
--- a/docs/histogram.js.html
+++ b/docs/histogram.js.html
@@ -24,7 +24,7 @@
@@ -247,7 +247,7 @@ histogram.js
diff --git a/docs/index.html b/docs/index.html
index a84a0904..008cca1c 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -24,7 +24,7 @@
@@ -57,7 +57,7 @@
diff --git a/docs/init.js.html b/docs/init.js.html
index 613333f3..7c72dea3 100644
--- a/docs/init.js.html
+++ b/docs/init.js.html
@@ -24,7 +24,7 @@
@@ -531,7 +531,7 @@ init.js
diff --git a/docs/lineplot.js.html b/docs/lineplot.js.html
index 03a2adb0..14254718 100644
--- a/docs/lineplot.js.html
+++ b/docs/lineplot.js.html
@@ -24,7 +24,7 @@
@@ -305,7 +305,7 @@ lineplot.js
diff --git a/docs/scatterplot.js.html b/docs/scatterplot.js.html
index 2e7aca1e..1fa53947 100644
--- a/docs/scatterplot.js.html
+++ b/docs/scatterplot.js.html
@@ -24,7 +24,7 @@
@@ -886,7 +886,7 @@ scatterplot.js
diff --git a/docs/segmented.js.html b/docs/segmented.js.html
index c6e5fa00..9a7c6124 100644
--- a/docs/segmented.js.html
+++ b/docs/segmented.js.html
@@ -24,7 +24,7 @@
@@ -377,7 +377,7 @@ segmented.js
new TrackerSource:
DataSetupSource:
DeleteSource:
Do
GetTrac
LogEventSource:
SaveTr
isUn
Returns:
diff --git a/docs/audio.js.html b/docs/audio.js.html
index 4fc80eab..b00c498a 100644
--- a/docs/audio.js.html
+++ b/docs/audio.js.html
@@ -24,7 +24,7 @@
@@ -638,7 +638,7 @@ audio.js
diff --git a/docs/barplot.js.html b/docs/barplot.js.html
index bf935fe2..aa9fffe5 100644
--- a/docs/barplot.js.html
+++ b/docs/barplot.js.html
@@ -24,7 +24,7 @@
@@ -372,7 +372,7 @@ barplot.js
diff --git a/docs/boxplot.js.html b/docs/boxplot.js.html
index 4bdb587f..4cc26111 100644
--- a/docs/boxplot.js.html
+++ b/docs/boxplot.js.html
@@ -24,7 +24,7 @@
@@ -796,7 +796,7 @@ boxplot.js
diff --git a/docs/constants.js.html b/docs/constants.js.html
index 591d73d7..32d8bacc 100644
--- a/docs/constants.js.html
+++ b/docs/constants.js.html
@@ -24,7 +24,7 @@
@@ -314,6 +314,7 @@ constants.js
openai: 'OpenAI Vision',
gemini: 'Gemini Pro Vision',
multi: 'Multiple AI',
+ processing: 'Processing Chart...',
},
},
};
@@ -484,7 +485,7 @@ constants.js
</div>
</div>
<div class="modal-footer">
- <button type="button" id="save_and_close_menu">Save and Close</button>
+ <button type="button" id="save_and_close_menu" aria-labelledby="save_and_close_text"><span id="save_and_close_text">Save and Close</span></button>
<button type="button" id="close_menu">Close</button>
</div>
</div>
@@ -620,6 +621,16 @@ constants.js
}
},
]);
+
+ // trigger notification that LLM will be reset
+ // this is done on change of LLM model, multi settings, or skill level
+ constants.events.push([
+ document.getElementById('LLM_model'),
+ 'change',
+ function (e) {
+ menu.NotifyOfLLMReset();
+ },
+ ]);
}
/**
@@ -761,6 +772,9 @@ constants.js
document.getElementById('LLM_preferences').value =
constants.LLMPreferences;
}
+ if (document.getElementById('LLM_reset_notification')) {
+ document.getElementById('LLM_reset_notification').remove();
+ }
}
/**
@@ -818,6 +832,24 @@ constants.js
.setAttribute('aria-live', constants.ariaMode);
}
+ /**
+ * Notifies the user that the LLM will be reset.
+ */
+ NotifyOfLLMReset() {
+ let html =
+ '<p id="LLM_reset_notification">Note: Changes in LLM settings will reset any existing conversation.</p>';
+ document
+ .getElementById('save_and_close_menu')
+ .insertAdjacentHTML('beforebegin', html);
+
+ // add to aria button text
+ document
+ .getElementById('save_and_close_menu')
+ .setAttribute(
+ 'aria-labelledby',
+ 'save_and_close_text LLM_reset_notification'
+ );
+ }
/**
* Handles changes to the LLM model and multi-modal settings.
* We reset if we change the LLM model, multi settings, or skill level.
@@ -936,8 +968,11 @@ constants.js
</button>
</div>
<div class="modal-body">
+ <div id="chatLLM_chat_history_wrapper">
<div id="chatLLM_chat_history" aria-live="${constants.ariaMode}" aria-relevant="additions">
</div>
+ <p id="chatLLM_copy_all_wrapper"><button id="chatLLM_copy_all">Copy all to clipboard</button></p>
+ </div>
<div id="chatLLM_content">
<p><input type="text" id="chatLLM_input" class="form-control" name="chatLLM_input" aria-labelledby="chatLLM_title" size="50"></p>
<div class="LLM_suggestions">
@@ -1079,10 +1114,41 @@ constants.js
document.getElementById('reset_chatLLM'),
'click',
function (e) {
- chatLLM.Toggle(false);
chatLLM.ResetChatHistory();
},
]);
+
+ // copy to clipboard
+ constants.events.push([
+ document.getElementById('chatLLM_copy_all'),
+ 'click',
+ function (e) {
+ let text = document.getElementById('chatLLM_chat_history').innerText;
+ // need newlines instead of paragraphs headings etc
+ text = text.replace(/<p>/g, '\n').replace(/<\/p>/g, '\n');
+ text = text.replace(/<h\d>/g, '\n').replace(/<\/h\d>/g, '\n');
+ text = text.replace(/<.*?>/g, '');
+
+ navigator.clipboard.writeText(text);
+ },
+ ]);
+ constants.events.push([
+ document.getElementById('chatLLM_chat_history'),
+ 'click',
+ function (e) {
+ // we're delegating here, so set the event on child .chatLLM_message_copy_button
+ if (e.target.matches('.chatLLM_message_copy_button')) {
+ // get the innerText of the element before the button
+ let text = e.target.closest('p').previousElementSibling.innerText;
+ // need newlines instead of paragraphs headings etc
+ text = text.replace(/<p>/g, '\n').replace(/<\/p>/g, '\n');
+ text = text.replace(/<h\d>/g, '\n').replace(/<\/h\d>/g, '\n');
+ text = text.replace(/<.*?>/g, '');
+
+ navigator.clipboard.writeText(text);
+ }
+ },
+ ]);
}
/**
@@ -1163,7 +1229,7 @@ constants.js
*/
ProcessLLMResponse(data, model) {
chatLLM.WaitingSound(false);
- console.log('LLM response: ', data);
+ //console.log('LLM response: ', data);
let text = '';
let LLMName = resources.GetString(model);
@@ -1367,9 +1433,9 @@ constants.js
};
// Generate the content
- console.log('LLM request: ', prompt, image);
+ //console.log('LLM request: ', prompt, image);
const result = await model.generateContent([prompt, image]);
- console.log(result.response.text());
+ //console.log(result.response.text());
// Process the response
chatLLM.ProcessLLMResponse(result.response, 'gemini');
@@ -1409,6 +1475,12 @@ constants.js
<p class="chatLLM_message_text">${text}</p>
</div>
`;
+ // add a copy button to actual messages
+ if (user != 'User' && text != resources.GetString('processing')) {
+ html += `
+ <p class="chatLLM_message_copy"><button class="chatLLM_message_copy_button">Copy</button></p>
+ `;
+ }
this.RenderChatMessage(html);
}
@@ -1486,7 +1558,11 @@ constants.js
// get name from resource
let LLMName = resources.GetString(constants.LLMModel);
this.firstTime = false;
- this.DisplayChatMessage(LLMName, 'Processing Chart...', true);
+ this.DisplayChatMessage(
+ LLMName,
+ resources.GetString('processing'),
+ true
+ );
let defaultPrompt = this.GetDefaultPrompt();
this.Submit(defaultPrompt, true);
}
@@ -2282,7 +2358,7 @@ constants.js
diff --git a/docs/controls.js.html b/docs/controls.js.html
index fb8a89b4..3fbf1e2e 100644
--- a/docs/controls.js.html
+++ b/docs/controls.js.html
@@ -24,7 +24,7 @@
@@ -3268,7 +3268,7 @@ controls.js
diff --git a/docs/display.js.html b/docs/display.js.html
index a4ee9c53..1f9acd2b 100644
--- a/docs/display.js.html
+++ b/docs/display.js.html
@@ -24,7 +24,7 @@
@@ -1256,7 +1256,7 @@ display.js
diff --git a/docs/global.html b/docs/global.html
index 05f0215f..f8d03800 100644
--- a/docs/global.html
+++ b/docs/global.html
@@ -24,7 +24,7 @@
@@ -1141,7 +1141,7 @@ Parameters:
diff --git a/docs/heatmap.js.html b/docs/heatmap.js.html
index 1d6889a9..9d586522 100644
--- a/docs/heatmap.js.html
+++ b/docs/heatmap.js.html
@@ -24,7 +24,7 @@
@@ -452,7 +452,7 @@ heatmap.js
diff --git a/docs/histogram.js.html b/docs/histogram.js.html
index 86072184..6b459dcd 100644
--- a/docs/histogram.js.html
+++ b/docs/histogram.js.html
@@ -24,7 +24,7 @@
@@ -247,7 +247,7 @@ histogram.js
diff --git a/docs/index.html b/docs/index.html
index a84a0904..008cca1c 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -24,7 +24,7 @@
@@ -57,7 +57,7 @@
diff --git a/docs/init.js.html b/docs/init.js.html
index 613333f3..7c72dea3 100644
--- a/docs/init.js.html
+++ b/docs/init.js.html
@@ -24,7 +24,7 @@
@@ -531,7 +531,7 @@ init.js
diff --git a/docs/lineplot.js.html b/docs/lineplot.js.html
index 03a2adb0..14254718 100644
--- a/docs/lineplot.js.html
+++ b/docs/lineplot.js.html
@@ -24,7 +24,7 @@
@@ -305,7 +305,7 @@ lineplot.js
diff --git a/docs/scatterplot.js.html b/docs/scatterplot.js.html
index 2e7aca1e..1fa53947 100644
--- a/docs/scatterplot.js.html
+++ b/docs/scatterplot.js.html
@@ -24,7 +24,7 @@
@@ -886,7 +886,7 @@ scatterplot.js
diff --git a/docs/segmented.js.html b/docs/segmented.js.html
index c6e5fa00..9a7c6124 100644
--- a/docs/segmented.js.html
+++ b/docs/segmented.js.html
@@ -24,7 +24,7 @@
@@ -377,7 +377,7 @@ segmented.js
DataSetupSource:
DeleteSource:
Do
GetTrac
LogEventSource:
SaveTr
isUn
Returns:
diff --git a/docs/audio.js.html b/docs/audio.js.html
index 4fc80eab..b00c498a 100644
--- a/docs/audio.js.html
+++ b/docs/audio.js.html
@@ -24,7 +24,7 @@
@@ -638,7 +638,7 @@ audio.js
diff --git a/docs/barplot.js.html b/docs/barplot.js.html
index bf935fe2..aa9fffe5 100644
--- a/docs/barplot.js.html
+++ b/docs/barplot.js.html
@@ -24,7 +24,7 @@
@@ -372,7 +372,7 @@ barplot.js
diff --git a/docs/boxplot.js.html b/docs/boxplot.js.html
index 4bdb587f..4cc26111 100644
--- a/docs/boxplot.js.html
+++ b/docs/boxplot.js.html
@@ -24,7 +24,7 @@
@@ -796,7 +796,7 @@ boxplot.js
diff --git a/docs/constants.js.html b/docs/constants.js.html
index 591d73d7..32d8bacc 100644
--- a/docs/constants.js.html
+++ b/docs/constants.js.html
@@ -24,7 +24,7 @@
@@ -314,6 +314,7 @@ constants.js
openai: 'OpenAI Vision',
gemini: 'Gemini Pro Vision',
multi: 'Multiple AI',
+ processing: 'Processing Chart...',
},
},
};
@@ -484,7 +485,7 @@ constants.js
</div>
</div>
<div class="modal-footer">
- <button type="button" id="save_and_close_menu">Save and Close</button>
+ <button type="button" id="save_and_close_menu" aria-labelledby="save_and_close_text"><span id="save_and_close_text">Save and Close</span></button>
<button type="button" id="close_menu">Close</button>
</div>
</div>
@@ -620,6 +621,16 @@ constants.js
}
},
]);
+
+ // trigger notification that LLM will be reset
+ // this is done on change of LLM model, multi settings, or skill level
+ constants.events.push([
+ document.getElementById('LLM_model'),
+ 'change',
+ function (e) {
+ menu.NotifyOfLLMReset();
+ },
+ ]);
}
/**
@@ -761,6 +772,9 @@ constants.js
document.getElementById('LLM_preferences').value =
constants.LLMPreferences;
}
+ if (document.getElementById('LLM_reset_notification')) {
+ document.getElementById('LLM_reset_notification').remove();
+ }
}
/**
@@ -818,6 +832,24 @@ constants.js
.setAttribute('aria-live', constants.ariaMode);
}
+ /**
+ * Notifies the user that the LLM will be reset.
+ */
+ NotifyOfLLMReset() {
+ let html =
+ '<p id="LLM_reset_notification">Note: Changes in LLM settings will reset any existing conversation.</p>';
+ document
+ .getElementById('save_and_close_menu')
+ .insertAdjacentHTML('beforebegin', html);
+
+ // add to aria button text
+ document
+ .getElementById('save_and_close_menu')
+ .setAttribute(
+ 'aria-labelledby',
+ 'save_and_close_text LLM_reset_notification'
+ );
+ }
/**
* Handles changes to the LLM model and multi-modal settings.
* We reset if we change the LLM model, multi settings, or skill level.
@@ -936,8 +968,11 @@ constants.js
</button>
</div>
<div class="modal-body">
+ <div id="chatLLM_chat_history_wrapper">
<div id="chatLLM_chat_history" aria-live="${constants.ariaMode}" aria-relevant="additions">
</div>
+ <p id="chatLLM_copy_all_wrapper"><button id="chatLLM_copy_all">Copy all to clipboard</button></p>
+ </div>
<div id="chatLLM_content">
<p><input type="text" id="chatLLM_input" class="form-control" name="chatLLM_input" aria-labelledby="chatLLM_title" size="50"></p>
<div class="LLM_suggestions">
@@ -1079,10 +1114,41 @@ constants.js
document.getElementById('reset_chatLLM'),
'click',
function (e) {
- chatLLM.Toggle(false);
chatLLM.ResetChatHistory();
},
]);
+
+ // copy to clipboard
+ constants.events.push([
+ document.getElementById('chatLLM_copy_all'),
+ 'click',
+ function (e) {
+ let text = document.getElementById('chatLLM_chat_history').innerText;
+ // need newlines instead of paragraphs headings etc
+ text = text.replace(/<p>/g, '\n').replace(/<\/p>/g, '\n');
+ text = text.replace(/<h\d>/g, '\n').replace(/<\/h\d>/g, '\n');
+ text = text.replace(/<.*?>/g, '');
+
+ navigator.clipboard.writeText(text);
+ },
+ ]);
+ constants.events.push([
+ document.getElementById('chatLLM_chat_history'),
+ 'click',
+ function (e) {
+ // we're delegating here, so set the event on child .chatLLM_message_copy_button
+ if (e.target.matches('.chatLLM_message_copy_button')) {
+ // get the innerText of the element before the button
+ let text = e.target.closest('p').previousElementSibling.innerText;
+ // need newlines instead of paragraphs headings etc
+ text = text.replace(/<p>/g, '\n').replace(/<\/p>/g, '\n');
+ text = text.replace(/<h\d>/g, '\n').replace(/<\/h\d>/g, '\n');
+ text = text.replace(/<.*?>/g, '');
+
+ navigator.clipboard.writeText(text);
+ }
+ },
+ ]);
}
/**
@@ -1163,7 +1229,7 @@ constants.js
*/
ProcessLLMResponse(data, model) {
chatLLM.WaitingSound(false);
- console.log('LLM response: ', data);
+ //console.log('LLM response: ', data);
let text = '';
let LLMName = resources.GetString(model);
@@ -1367,9 +1433,9 @@ constants.js
};
// Generate the content
- console.log('LLM request: ', prompt, image);
+ //console.log('LLM request: ', prompt, image);
const result = await model.generateContent([prompt, image]);
- console.log(result.response.text());
+ //console.log(result.response.text());
// Process the response
chatLLM.ProcessLLMResponse(result.response, 'gemini');
@@ -1409,6 +1475,12 @@ constants.js
<p class="chatLLM_message_text">${text}</p>
</div>
`;
+ // add a copy button to actual messages
+ if (user != 'User' && text != resources.GetString('processing')) {
+ html += `
+ <p class="chatLLM_message_copy"><button class="chatLLM_message_copy_button">Copy</button></p>
+ `;
+ }
this.RenderChatMessage(html);
}
@@ -1486,7 +1558,11 @@ constants.js
// get name from resource
let LLMName = resources.GetString(constants.LLMModel);
this.firstTime = false;
- this.DisplayChatMessage(LLMName, 'Processing Chart...', true);
+ this.DisplayChatMessage(
+ LLMName,
+ resources.GetString('processing'),
+ true
+ );
let defaultPrompt = this.GetDefaultPrompt();
this.Submit(defaultPrompt, true);
}
@@ -2282,7 +2358,7 @@ constants.js
diff --git a/docs/controls.js.html b/docs/controls.js.html
index fb8a89b4..3fbf1e2e 100644
--- a/docs/controls.js.html
+++ b/docs/controls.js.html
@@ -24,7 +24,7 @@
@@ -3268,7 +3268,7 @@ controls.js
diff --git a/docs/display.js.html b/docs/display.js.html
index a4ee9c53..1f9acd2b 100644
--- a/docs/display.js.html
+++ b/docs/display.js.html
@@ -24,7 +24,7 @@
@@ -1256,7 +1256,7 @@ display.js
diff --git a/docs/global.html b/docs/global.html
index 05f0215f..f8d03800 100644
--- a/docs/global.html
+++ b/docs/global.html
@@ -24,7 +24,7 @@
@@ -1141,7 +1141,7 @@ Parameters:
diff --git a/docs/heatmap.js.html b/docs/heatmap.js.html
index 1d6889a9..9d586522 100644
--- a/docs/heatmap.js.html
+++ b/docs/heatmap.js.html
@@ -24,7 +24,7 @@
@@ -452,7 +452,7 @@ heatmap.js
diff --git a/docs/histogram.js.html b/docs/histogram.js.html
index 86072184..6b459dcd 100644
--- a/docs/histogram.js.html
+++ b/docs/histogram.js.html
@@ -24,7 +24,7 @@
@@ -247,7 +247,7 @@ histogram.js
diff --git a/docs/index.html b/docs/index.html
index a84a0904..008cca1c 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -24,7 +24,7 @@
@@ -57,7 +57,7 @@
diff --git a/docs/init.js.html b/docs/init.js.html
index 613333f3..7c72dea3 100644
--- a/docs/init.js.html
+++ b/docs/init.js.html
@@ -24,7 +24,7 @@
@@ -531,7 +531,7 @@ init.js
diff --git a/docs/lineplot.js.html b/docs/lineplot.js.html
index 03a2adb0..14254718 100644
--- a/docs/lineplot.js.html
+++ b/docs/lineplot.js.html
@@ -24,7 +24,7 @@
@@ -305,7 +305,7 @@ lineplot.js
diff --git a/docs/scatterplot.js.html b/docs/scatterplot.js.html
index 2e7aca1e..1fa53947 100644
--- a/docs/scatterplot.js.html
+++ b/docs/scatterplot.js.html
@@ -24,7 +24,7 @@
@@ -886,7 +886,7 @@ scatterplot.js
diff --git a/docs/segmented.js.html b/docs/segmented.js.html
index c6e5fa00..9a7c6124 100644
--- a/docs/segmented.js.html
+++ b/docs/segmented.js.html
@@ -24,7 +24,7 @@
@@ -377,7 +377,7 @@ segmented.js
DeleteSource:
Do
GetTrac
LogEventSource:
SaveTr
isUn
Returns:
diff --git a/docs/audio.js.html b/docs/audio.js.html
index 4fc80eab..b00c498a 100644
--- a/docs/audio.js.html
+++ b/docs/audio.js.html
@@ -24,7 +24,7 @@
@@ -638,7 +638,7 @@ audio.js
diff --git a/docs/barplot.js.html b/docs/barplot.js.html
index bf935fe2..aa9fffe5 100644
--- a/docs/barplot.js.html
+++ b/docs/barplot.js.html
@@ -24,7 +24,7 @@
@@ -372,7 +372,7 @@ barplot.js
diff --git a/docs/boxplot.js.html b/docs/boxplot.js.html
index 4bdb587f..4cc26111 100644
--- a/docs/boxplot.js.html
+++ b/docs/boxplot.js.html
@@ -24,7 +24,7 @@
@@ -796,7 +796,7 @@ boxplot.js
diff --git a/docs/constants.js.html b/docs/constants.js.html
index 591d73d7..32d8bacc 100644
--- a/docs/constants.js.html
+++ b/docs/constants.js.html
@@ -24,7 +24,7 @@
@@ -314,6 +314,7 @@ constants.js
openai: 'OpenAI Vision',
gemini: 'Gemini Pro Vision',
multi: 'Multiple AI',
+ processing: 'Processing Chart...',
},
},
};
@@ -484,7 +485,7 @@ constants.js
</div>
</div>
<div class="modal-footer">
- <button type="button" id="save_and_close_menu">Save and Close</button>
+ <button type="button" id="save_and_close_menu" aria-labelledby="save_and_close_text"><span id="save_and_close_text">Save and Close</span></button>
<button type="button" id="close_menu">Close</button>
</div>
</div>
@@ -620,6 +621,16 @@ constants.js
}
},
]);
+
+ // trigger notification that LLM will be reset
+ // this is done on change of LLM model, multi settings, or skill level
+ constants.events.push([
+ document.getElementById('LLM_model'),
+ 'change',
+ function (e) {
+ menu.NotifyOfLLMReset();
+ },
+ ]);
}
/**
@@ -761,6 +772,9 @@ constants.js
document.getElementById('LLM_preferences').value =
constants.LLMPreferences;
}
+ if (document.getElementById('LLM_reset_notification')) {
+ document.getElementById('LLM_reset_notification').remove();
+ }
}
/**
@@ -818,6 +832,24 @@ constants.js
.setAttribute('aria-live', constants.ariaMode);
}
+ /**
+ * Notifies the user that the LLM will be reset.
+ */
+ NotifyOfLLMReset() {
+ let html =
+ '<p id="LLM_reset_notification">Note: Changes in LLM settings will reset any existing conversation.</p>';
+ document
+ .getElementById('save_and_close_menu')
+ .insertAdjacentHTML('beforebegin', html);
+
+ // add to aria button text
+ document
+ .getElementById('save_and_close_menu')
+ .setAttribute(
+ 'aria-labelledby',
+ 'save_and_close_text LLM_reset_notification'
+ );
+ }
/**
* Handles changes to the LLM model and multi-modal settings.
* We reset if we change the LLM model, multi settings, or skill level.
@@ -936,8 +968,11 @@ constants.js
</button>
</div>
<div class="modal-body">
+ <div id="chatLLM_chat_history_wrapper">
<div id="chatLLM_chat_history" aria-live="${constants.ariaMode}" aria-relevant="additions">
</div>
+ <p id="chatLLM_copy_all_wrapper"><button id="chatLLM_copy_all">Copy all to clipboard</button></p>
+ </div>
<div id="chatLLM_content">
<p><input type="text" id="chatLLM_input" class="form-control" name="chatLLM_input" aria-labelledby="chatLLM_title" size="50"></p>
<div class="LLM_suggestions">
@@ -1079,10 +1114,41 @@ constants.js
document.getElementById('reset_chatLLM'),
'click',
function (e) {
- chatLLM.Toggle(false);
chatLLM.ResetChatHistory();
},
]);
+
+ // copy to clipboard
+ constants.events.push([
+ document.getElementById('chatLLM_copy_all'),
+ 'click',
+ function (e) {
+ let text = document.getElementById('chatLLM_chat_history').innerText;
+ // need newlines instead of paragraphs headings etc
+ text = text.replace(/<p>/g, '\n').replace(/<\/p>/g, '\n');
+ text = text.replace(/<h\d>/g, '\n').replace(/<\/h\d>/g, '\n');
+ text = text.replace(/<.*?>/g, '');
+
+ navigator.clipboard.writeText(text);
+ },
+ ]);
+ constants.events.push([
+ document.getElementById('chatLLM_chat_history'),
+ 'click',
+ function (e) {
+ // we're delegating here, so set the event on child .chatLLM_message_copy_button
+ if (e.target.matches('.chatLLM_message_copy_button')) {
+ // get the innerText of the element before the button
+ let text = e.target.closest('p').previousElementSibling.innerText;
+ // need newlines instead of paragraphs headings etc
+ text = text.replace(/<p>/g, '\n').replace(/<\/p>/g, '\n');
+ text = text.replace(/<h\d>/g, '\n').replace(/<\/h\d>/g, '\n');
+ text = text.replace(/<.*?>/g, '');
+
+ navigator.clipboard.writeText(text);
+ }
+ },
+ ]);
}
/**
@@ -1163,7 +1229,7 @@ constants.js
*/
ProcessLLMResponse(data, model) {
chatLLM.WaitingSound(false);
- console.log('LLM response: ', data);
+ //console.log('LLM response: ', data);
let text = '';
let LLMName = resources.GetString(model);
@@ -1367,9 +1433,9 @@ constants.js
};
// Generate the content
- console.log('LLM request: ', prompt, image);
+ //console.log('LLM request: ', prompt, image);
const result = await model.generateContent([prompt, image]);
- console.log(result.response.text());
+ //console.log(result.response.text());
// Process the response
chatLLM.ProcessLLMResponse(result.response, 'gemini');
@@ -1409,6 +1475,12 @@ constants.js
<p class="chatLLM_message_text">${text}</p>
</div>
`;
+ // add a copy button to actual messages
+ if (user != 'User' && text != resources.GetString('processing')) {
+ html += `
+ <p class="chatLLM_message_copy"><button class="chatLLM_message_copy_button">Copy</button></p>
+ `;
+ }
this.RenderChatMessage(html);
}
@@ -1486,7 +1558,11 @@ constants.js
// get name from resource
let LLMName = resources.GetString(constants.LLMModel);
this.firstTime = false;
- this.DisplayChatMessage(LLMName, 'Processing Chart...', true);
+ this.DisplayChatMessage(
+ LLMName,
+ resources.GetString('processing'),
+ true
+ );
let defaultPrompt = this.GetDefaultPrompt();
this.Submit(defaultPrompt, true);
}
@@ -2282,7 +2358,7 @@ constants.js
diff --git a/docs/controls.js.html b/docs/controls.js.html
index fb8a89b4..3fbf1e2e 100644
--- a/docs/controls.js.html
+++ b/docs/controls.js.html
@@ -24,7 +24,7 @@
@@ -3268,7 +3268,7 @@ controls.js
diff --git a/docs/display.js.html b/docs/display.js.html
index a4ee9c53..1f9acd2b 100644
--- a/docs/display.js.html
+++ b/docs/display.js.html
@@ -24,7 +24,7 @@
@@ -1256,7 +1256,7 @@ display.js
diff --git a/docs/global.html b/docs/global.html
index 05f0215f..f8d03800 100644
--- a/docs/global.html
+++ b/docs/global.html
@@ -24,7 +24,7 @@
@@ -1141,7 +1141,7 @@ Parameters:
diff --git a/docs/heatmap.js.html b/docs/heatmap.js.html
index 1d6889a9..9d586522 100644
--- a/docs/heatmap.js.html
+++ b/docs/heatmap.js.html
@@ -24,7 +24,7 @@
@@ -452,7 +452,7 @@ heatmap.js
diff --git a/docs/histogram.js.html b/docs/histogram.js.html
index 86072184..6b459dcd 100644
--- a/docs/histogram.js.html
+++ b/docs/histogram.js.html
@@ -24,7 +24,7 @@
@@ -247,7 +247,7 @@ histogram.js
diff --git a/docs/index.html b/docs/index.html
index a84a0904..008cca1c 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -24,7 +24,7 @@
@@ -57,7 +57,7 @@
diff --git a/docs/init.js.html b/docs/init.js.html
index 613333f3..7c72dea3 100644
--- a/docs/init.js.html
+++ b/docs/init.js.html
@@ -24,7 +24,7 @@
@@ -531,7 +531,7 @@ init.js
diff --git a/docs/lineplot.js.html b/docs/lineplot.js.html
index 03a2adb0..14254718 100644
--- a/docs/lineplot.js.html
+++ b/docs/lineplot.js.html
@@ -24,7 +24,7 @@
@@ -305,7 +305,7 @@ lineplot.js
diff --git a/docs/scatterplot.js.html b/docs/scatterplot.js.html
index 2e7aca1e..1fa53947 100644
--- a/docs/scatterplot.js.html
+++ b/docs/scatterplot.js.html
@@ -24,7 +24,7 @@
@@ -886,7 +886,7 @@ scatterplot.js
diff --git a/docs/segmented.js.html b/docs/segmented.js.html
index c6e5fa00..9a7c6124 100644
--- a/docs/segmented.js.html
+++ b/docs/segmented.js.html
@@ -24,7 +24,7 @@
@@ -377,7 +377,7 @@ segmented.js
GetTrac
LogEventSource:
SaveTr
isUn
Returns:
diff --git a/docs/audio.js.html b/docs/audio.js.html
index 4fc80eab..b00c498a 100644
--- a/docs/audio.js.html
+++ b/docs/audio.js.html
@@ -24,7 +24,7 @@
@@ -638,7 +638,7 @@ audio.js
diff --git a/docs/barplot.js.html b/docs/barplot.js.html
index bf935fe2..aa9fffe5 100644
--- a/docs/barplot.js.html
+++ b/docs/barplot.js.html
@@ -24,7 +24,7 @@
@@ -372,7 +372,7 @@ barplot.js
diff --git a/docs/boxplot.js.html b/docs/boxplot.js.html
index 4bdb587f..4cc26111 100644
--- a/docs/boxplot.js.html
+++ b/docs/boxplot.js.html
@@ -24,7 +24,7 @@
@@ -796,7 +796,7 @@ boxplot.js
diff --git a/docs/constants.js.html b/docs/constants.js.html
index 591d73d7..32d8bacc 100644
--- a/docs/constants.js.html
+++ b/docs/constants.js.html
@@ -24,7 +24,7 @@
@@ -314,6 +314,7 @@ constants.js
openai: 'OpenAI Vision',
gemini: 'Gemini Pro Vision',
multi: 'Multiple AI',
+ processing: 'Processing Chart...',
},
},
};
@@ -484,7 +485,7 @@ constants.js
</div>
</div>
<div class="modal-footer">
- <button type="button" id="save_and_close_menu">Save and Close</button>
+ <button type="button" id="save_and_close_menu" aria-labelledby="save_and_close_text"><span id="save_and_close_text">Save and Close</span></button>
<button type="button" id="close_menu">Close</button>
</div>
</div>
@@ -620,6 +621,16 @@ constants.js
}
},
]);
+
+ // trigger notification that LLM will be reset
+ // this is done on change of LLM model, multi settings, or skill level
+ constants.events.push([
+ document.getElementById('LLM_model'),
+ 'change',
+ function (e) {
+ menu.NotifyOfLLMReset();
+ },
+ ]);
}
/**
@@ -761,6 +772,9 @@ constants.js
document.getElementById('LLM_preferences').value =
constants.LLMPreferences;
}
+ if (document.getElementById('LLM_reset_notification')) {
+ document.getElementById('LLM_reset_notification').remove();
+ }
}
/**
@@ -818,6 +832,24 @@ constants.js
.setAttribute('aria-live', constants.ariaMode);
}
+ /**
+ * Notifies the user that the LLM will be reset.
+ */
+ NotifyOfLLMReset() {
+ let html =
+ '<p id="LLM_reset_notification">Note: Changes in LLM settings will reset any existing conversation.</p>';
+ document
+ .getElementById('save_and_close_menu')
+ .insertAdjacentHTML('beforebegin', html);
+
+ // add to aria button text
+ document
+ .getElementById('save_and_close_menu')
+ .setAttribute(
+ 'aria-labelledby',
+ 'save_and_close_text LLM_reset_notification'
+ );
+ }
/**
* Handles changes to the LLM model and multi-modal settings.
* We reset if we change the LLM model, multi settings, or skill level.
@@ -936,8 +968,11 @@ constants.js
</button>
</div>
<div class="modal-body">
+ <div id="chatLLM_chat_history_wrapper">
<div id="chatLLM_chat_history" aria-live="${constants.ariaMode}" aria-relevant="additions">
</div>
+ <p id="chatLLM_copy_all_wrapper"><button id="chatLLM_copy_all">Copy all to clipboard</button></p>
+ </div>
<div id="chatLLM_content">
<p><input type="text" id="chatLLM_input" class="form-control" name="chatLLM_input" aria-labelledby="chatLLM_title" size="50"></p>
<div class="LLM_suggestions">
@@ -1079,10 +1114,41 @@ constants.js
document.getElementById('reset_chatLLM'),
'click',
function (e) {
- chatLLM.Toggle(false);
chatLLM.ResetChatHistory();
},
]);
+
+ // copy to clipboard
+ constants.events.push([
+ document.getElementById('chatLLM_copy_all'),
+ 'click',
+ function (e) {
+ let text = document.getElementById('chatLLM_chat_history').innerText;
+ // need newlines instead of paragraphs headings etc
+ text = text.replace(/<p>/g, '\n').replace(/<\/p>/g, '\n');
+ text = text.replace(/<h\d>/g, '\n').replace(/<\/h\d>/g, '\n');
+ text = text.replace(/<.*?>/g, '');
+
+ navigator.clipboard.writeText(text);
+ },
+ ]);
+ constants.events.push([
+ document.getElementById('chatLLM_chat_history'),
+ 'click',
+ function (e) {
+ // we're delegating here, so set the event on child .chatLLM_message_copy_button
+ if (e.target.matches('.chatLLM_message_copy_button')) {
+ // get the innerText of the element before the button
+ let text = e.target.closest('p').previousElementSibling.innerText;
+ // need newlines instead of paragraphs headings etc
+ text = text.replace(/<p>/g, '\n').replace(/<\/p>/g, '\n');
+ text = text.replace(/<h\d>/g, '\n').replace(/<\/h\d>/g, '\n');
+ text = text.replace(/<.*?>/g, '');
+
+ navigator.clipboard.writeText(text);
+ }
+ },
+ ]);
}
/**
@@ -1163,7 +1229,7 @@ constants.js
*/
ProcessLLMResponse(data, model) {
chatLLM.WaitingSound(false);
- console.log('LLM response: ', data);
+ //console.log('LLM response: ', data);
let text = '';
let LLMName = resources.GetString(model);
@@ -1367,9 +1433,9 @@ constants.js
};
// Generate the content
- console.log('LLM request: ', prompt, image);
+ //console.log('LLM request: ', prompt, image);
const result = await model.generateContent([prompt, image]);
- console.log(result.response.text());
+ //console.log(result.response.text());
// Process the response
chatLLM.ProcessLLMResponse(result.response, 'gemini');
@@ -1409,6 +1475,12 @@ constants.js
<p class="chatLLM_message_text">${text}</p>
</div>
`;
+ // add a copy button to actual messages
+ if (user != 'User' && text != resources.GetString('processing')) {
+ html += `
+ <p class="chatLLM_message_copy"><button class="chatLLM_message_copy_button">Copy</button></p>
+ `;
+ }
this.RenderChatMessage(html);
}
@@ -1486,7 +1558,11 @@ constants.js
// get name from resource
let LLMName = resources.GetString(constants.LLMModel);
this.firstTime = false;
- this.DisplayChatMessage(LLMName, 'Processing Chart...', true);
+ this.DisplayChatMessage(
+ LLMName,
+ resources.GetString('processing'),
+ true
+ );
let defaultPrompt = this.GetDefaultPrompt();
this.Submit(defaultPrompt, true);
}
@@ -2282,7 +2358,7 @@ constants.js
diff --git a/docs/controls.js.html b/docs/controls.js.html
index fb8a89b4..3fbf1e2e 100644
--- a/docs/controls.js.html
+++ b/docs/controls.js.html
@@ -24,7 +24,7 @@
@@ -3268,7 +3268,7 @@ controls.js
diff --git a/docs/display.js.html b/docs/display.js.html
index a4ee9c53..1f9acd2b 100644
--- a/docs/display.js.html
+++ b/docs/display.js.html
@@ -24,7 +24,7 @@
@@ -1256,7 +1256,7 @@ display.js
diff --git a/docs/global.html b/docs/global.html
index 05f0215f..f8d03800 100644
--- a/docs/global.html
+++ b/docs/global.html
@@ -24,7 +24,7 @@
@@ -1141,7 +1141,7 @@ Parameters:
diff --git a/docs/heatmap.js.html b/docs/heatmap.js.html
index 1d6889a9..9d586522 100644
--- a/docs/heatmap.js.html
+++ b/docs/heatmap.js.html
@@ -24,7 +24,7 @@
@@ -452,7 +452,7 @@ heatmap.js
diff --git a/docs/histogram.js.html b/docs/histogram.js.html
index 86072184..6b459dcd 100644
--- a/docs/histogram.js.html
+++ b/docs/histogram.js.html
@@ -24,7 +24,7 @@
@@ -247,7 +247,7 @@ histogram.js
diff --git a/docs/index.html b/docs/index.html
index a84a0904..008cca1c 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -24,7 +24,7 @@
@@ -57,7 +57,7 @@
diff --git a/docs/init.js.html b/docs/init.js.html
index 613333f3..7c72dea3 100644
--- a/docs/init.js.html
+++ b/docs/init.js.html
@@ -24,7 +24,7 @@
@@ -531,7 +531,7 @@ init.js
diff --git a/docs/lineplot.js.html b/docs/lineplot.js.html
index 03a2adb0..14254718 100644
--- a/docs/lineplot.js.html
+++ b/docs/lineplot.js.html
@@ -24,7 +24,7 @@
@@ -305,7 +305,7 @@ lineplot.js
diff --git a/docs/scatterplot.js.html b/docs/scatterplot.js.html
index 2e7aca1e..1fa53947 100644
--- a/docs/scatterplot.js.html
+++ b/docs/scatterplot.js.html
@@ -24,7 +24,7 @@
@@ -886,7 +886,7 @@ scatterplot.js
diff --git a/docs/segmented.js.html b/docs/segmented.js.html
index c6e5fa00..9a7c6124 100644
--- a/docs/segmented.js.html
+++ b/docs/segmented.js.html
@@ -24,7 +24,7 @@
@@ -377,7 +377,7 @@ segmented.js
SaveTr
isUn
Returns:
diff --git a/docs/audio.js.html b/docs/audio.js.html
index 4fc80eab..b00c498a 100644
--- a/docs/audio.js.html
+++ b/docs/audio.js.html
@@ -24,7 +24,7 @@
@@ -638,7 +638,7 @@ audio.js
diff --git a/docs/barplot.js.html b/docs/barplot.js.html
index bf935fe2..aa9fffe5 100644
--- a/docs/barplot.js.html
+++ b/docs/barplot.js.html
@@ -24,7 +24,7 @@
@@ -372,7 +372,7 @@ barplot.js
diff --git a/docs/boxplot.js.html b/docs/boxplot.js.html
index 4bdb587f..4cc26111 100644
--- a/docs/boxplot.js.html
+++ b/docs/boxplot.js.html
@@ -24,7 +24,7 @@
@@ -796,7 +796,7 @@ boxplot.js
diff --git a/docs/constants.js.html b/docs/constants.js.html
index 591d73d7..32d8bacc 100644
--- a/docs/constants.js.html
+++ b/docs/constants.js.html
@@ -24,7 +24,7 @@
@@ -314,6 +314,7 @@ constants.js
openai: 'OpenAI Vision',
gemini: 'Gemini Pro Vision',
multi: 'Multiple AI',
+ processing: 'Processing Chart...',
},
},
};
@@ -484,7 +485,7 @@ constants.js
</div>
</div>
<div class="modal-footer">
- <button type="button" id="save_and_close_menu">Save and Close</button>
+ <button type="button" id="save_and_close_menu" aria-labelledby="save_and_close_text"><span id="save_and_close_text">Save and Close</span></button>
<button type="button" id="close_menu">Close</button>
</div>
</div>
@@ -620,6 +621,16 @@ constants.js
}
},
]);
+
+ // trigger notification that LLM will be reset
+ // this is done on change of LLM model, multi settings, or skill level
+ constants.events.push([
+ document.getElementById('LLM_model'),
+ 'change',
+ function (e) {
+ menu.NotifyOfLLMReset();
+ },
+ ]);
}
/**
@@ -761,6 +772,9 @@ constants.js
document.getElementById('LLM_preferences').value =
constants.LLMPreferences;
}
+ if (document.getElementById('LLM_reset_notification')) {
+ document.getElementById('LLM_reset_notification').remove();
+ }
}
/**
@@ -818,6 +832,24 @@ constants.js
.setAttribute('aria-live', constants.ariaMode);
}
+ /**
+ * Notifies the user that the LLM will be reset.
+ */
+ NotifyOfLLMReset() {
+ let html =
+ '<p id="LLM_reset_notification">Note: Changes in LLM settings will reset any existing conversation.</p>';
+ document
+ .getElementById('save_and_close_menu')
+ .insertAdjacentHTML('beforebegin', html);
+
+ // add to aria button text
+ document
+ .getElementById('save_and_close_menu')
+ .setAttribute(
+ 'aria-labelledby',
+ 'save_and_close_text LLM_reset_notification'
+ );
+ }
/**
* Handles changes to the LLM model and multi-modal settings.
* We reset if we change the LLM model, multi settings, or skill level.
@@ -936,8 +968,11 @@ constants.js
</button>
</div>
<div class="modal-body">
+ <div id="chatLLM_chat_history_wrapper">
<div id="chatLLM_chat_history" aria-live="${constants.ariaMode}" aria-relevant="additions">
</div>
+ <p id="chatLLM_copy_all_wrapper"><button id="chatLLM_copy_all">Copy all to clipboard</button></p>
+ </div>
<div id="chatLLM_content">
<p><input type="text" id="chatLLM_input" class="form-control" name="chatLLM_input" aria-labelledby="chatLLM_title" size="50"></p>
<div class="LLM_suggestions">
@@ -1079,10 +1114,41 @@ constants.js
document.getElementById('reset_chatLLM'),
'click',
function (e) {
- chatLLM.Toggle(false);
chatLLM.ResetChatHistory();
},
]);
+
+ // copy to clipboard
+ constants.events.push([
+ document.getElementById('chatLLM_copy_all'),
+ 'click',
+ function (e) {
+ let text = document.getElementById('chatLLM_chat_history').innerText;
+ // need newlines instead of paragraphs headings etc
+ text = text.replace(/<p>/g, '\n').replace(/<\/p>/g, '\n');
+ text = text.replace(/<h\d>/g, '\n').replace(/<\/h\d>/g, '\n');
+ text = text.replace(/<.*?>/g, '');
+
+ navigator.clipboard.writeText(text);
+ },
+ ]);
+ constants.events.push([
+ document.getElementById('chatLLM_chat_history'),
+ 'click',
+ function (e) {
+ // we're delegating here, so set the event on child .chatLLM_message_copy_button
+ if (e.target.matches('.chatLLM_message_copy_button')) {
+ // get the innerText of the element before the button
+ let text = e.target.closest('p').previousElementSibling.innerText;
+ // need newlines instead of paragraphs headings etc
+ text = text.replace(/<p>/g, '\n').replace(/<\/p>/g, '\n');
+ text = text.replace(/<h\d>/g, '\n').replace(/<\/h\d>/g, '\n');
+ text = text.replace(/<.*?>/g, '');
+
+ navigator.clipboard.writeText(text);
+ }
+ },
+ ]);
}
/**
@@ -1163,7 +1229,7 @@ constants.js
*/
ProcessLLMResponse(data, model) {
chatLLM.WaitingSound(false);
- console.log('LLM response: ', data);
+ //console.log('LLM response: ', data);
let text = '';
let LLMName = resources.GetString(model);
@@ -1367,9 +1433,9 @@ constants.js
};
// Generate the content
- console.log('LLM request: ', prompt, image);
+ //console.log('LLM request: ', prompt, image);
const result = await model.generateContent([prompt, image]);
- console.log(result.response.text());
+ //console.log(result.response.text());
// Process the response
chatLLM.ProcessLLMResponse(result.response, 'gemini');
@@ -1409,6 +1475,12 @@ constants.js
<p class="chatLLM_message_text">${text}</p>
</div>
`;
+ // add a copy button to actual messages
+ if (user != 'User' && text != resources.GetString('processing')) {
+ html += `
+ <p class="chatLLM_message_copy"><button class="chatLLM_message_copy_button">Copy</button></p>
+ `;
+ }
this.RenderChatMessage(html);
}
@@ -1486,7 +1558,11 @@ constants.js
// get name from resource
let LLMName = resources.GetString(constants.LLMModel);
this.firstTime = false;
- this.DisplayChatMessage(LLMName, 'Processing Chart...', true);
+ this.DisplayChatMessage(
+ LLMName,
+ resources.GetString('processing'),
+ true
+ );
let defaultPrompt = this.GetDefaultPrompt();
this.Submit(defaultPrompt, true);
}
@@ -2282,7 +2358,7 @@ constants.js
diff --git a/docs/controls.js.html b/docs/controls.js.html
index fb8a89b4..3fbf1e2e 100644
--- a/docs/controls.js.html
+++ b/docs/controls.js.html
@@ -24,7 +24,7 @@
@@ -3268,7 +3268,7 @@ controls.js
diff --git a/docs/display.js.html b/docs/display.js.html
index a4ee9c53..1f9acd2b 100644
--- a/docs/display.js.html
+++ b/docs/display.js.html
@@ -24,7 +24,7 @@
@@ -1256,7 +1256,7 @@ display.js
diff --git a/docs/global.html b/docs/global.html
index 05f0215f..f8d03800 100644
--- a/docs/global.html
+++ b/docs/global.html
@@ -24,7 +24,7 @@
@@ -1141,7 +1141,7 @@ Parameters:
diff --git a/docs/heatmap.js.html b/docs/heatmap.js.html
index 1d6889a9..9d586522 100644
--- a/docs/heatmap.js.html
+++ b/docs/heatmap.js.html
@@ -24,7 +24,7 @@
@@ -452,7 +452,7 @@ heatmap.js
diff --git a/docs/histogram.js.html b/docs/histogram.js.html
index 86072184..6b459dcd 100644
--- a/docs/histogram.js.html
+++ b/docs/histogram.js.html
@@ -24,7 +24,7 @@
@@ -247,7 +247,7 @@ histogram.js
diff --git a/docs/index.html b/docs/index.html
index a84a0904..008cca1c 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -24,7 +24,7 @@
@@ -57,7 +57,7 @@
diff --git a/docs/init.js.html b/docs/init.js.html
index 613333f3..7c72dea3 100644
--- a/docs/init.js.html
+++ b/docs/init.js.html
@@ -24,7 +24,7 @@
@@ -531,7 +531,7 @@ init.js
diff --git a/docs/lineplot.js.html b/docs/lineplot.js.html
index 03a2adb0..14254718 100644
--- a/docs/lineplot.js.html
+++ b/docs/lineplot.js.html
@@ -24,7 +24,7 @@
@@ -305,7 +305,7 @@ lineplot.js
diff --git a/docs/scatterplot.js.html b/docs/scatterplot.js.html
index 2e7aca1e..1fa53947 100644
--- a/docs/scatterplot.js.html
+++ b/docs/scatterplot.js.html
@@ -24,7 +24,7 @@
@@ -886,7 +886,7 @@ scatterplot.js
diff --git a/docs/segmented.js.html b/docs/segmented.js.html
index c6e5fa00..9a7c6124 100644
--- a/docs/segmented.js.html
+++ b/docs/segmented.js.html
@@ -24,7 +24,7 @@
@@ -377,7 +377,7 @@ segmented.js
Returns:
diff --git a/docs/audio.js.html b/docs/audio.js.html index 4fc80eab..b00c498a 100644 --- a/docs/audio.js.html +++ b/docs/audio.js.html @@ -24,7 +24,7 @@
audio.js
diff --git a/docs/barplot.js.html b/docs/barplot.js.html index bf935fe2..aa9fffe5 100644 --- a/docs/barplot.js.html +++ b/docs/barplot.js.html @@ -24,7 +24,7 @@
barplot.js
diff --git a/docs/boxplot.js.html b/docs/boxplot.js.html index 4bdb587f..4cc26111 100644 --- a/docs/boxplot.js.html +++ b/docs/boxplot.js.html @@ -24,7 +24,7 @@
boxplot.js
diff --git a/docs/constants.js.html b/docs/constants.js.html index 591d73d7..32d8bacc 100644 --- a/docs/constants.js.html +++ b/docs/constants.js.html @@ -24,7 +24,7 @@
constants.js
openai: 'OpenAI Vision', gemini: 'Gemini Pro Vision', multi: 'Multiple AI', + processing: 'Processing Chart...', }, }, }; @@ -484,7 +485,7 @@constants.js
</div> </div> <div class="modal-footer"> - <button type="button" id="save_and_close_menu">Save and Close</button> + <button type="button" id="save_and_close_menu" aria-labelledby="save_and_close_text"><span id="save_and_close_text">Save and Close</span></button> <button type="button" id="close_menu">Close</button> </div> </div> @@ -620,6 +621,16 @@constants.js
} }, ]); + + // trigger notification that LLM will be reset + // this is done on change of LLM model, multi settings, or skill level + constants.events.push([ + document.getElementById('LLM_model'), + 'change', + function (e) { + menu.NotifyOfLLMReset(); + }, + ]); } /** @@ -761,6 +772,9 @@constants.js
document.getElementById('LLM_preferences').value = constants.LLMPreferences; } + if (document.getElementById('LLM_reset_notification')) { + document.getElementById('LLM_reset_notification').remove(); + } } /** @@ -818,6 +832,24 @@constants.js
.setAttribute('aria-live', constants.ariaMode); } + /** + * Notifies the user that the LLM will be reset. + */ + NotifyOfLLMReset() { + let html = + '<p id="LLM_reset_notification">Note: Changes in LLM settings will reset any existing conversation.</p>'; + document + .getElementById('save_and_close_menu') + .insertAdjacentHTML('beforebegin', html); + + // add to aria button text + document + .getElementById('save_and_close_menu') + .setAttribute( + 'aria-labelledby', + 'save_and_close_text LLM_reset_notification' + ); + } /** * Handles changes to the LLM model and multi-modal settings. * We reset if we change the LLM model, multi settings, or skill level. @@ -936,8 +968,11 @@constants.js
</button> </div> <div class="modal-body"> + <div id="chatLLM_chat_history_wrapper"> <div id="chatLLM_chat_history" aria-live="${constants.ariaMode}" aria-relevant="additions"> </div> + <p id="chatLLM_copy_all_wrapper"><button id="chatLLM_copy_all">Copy all to clipboard</button></p> + </div> <div id="chatLLM_content"> <p><input type="text" id="chatLLM_input" class="form-control" name="chatLLM_input" aria-labelledby="chatLLM_title" size="50"></p> <div class="LLM_suggestions"> @@ -1079,10 +1114,41 @@constants.js
document.getElementById('reset_chatLLM'), 'click', function (e) { - chatLLM.Toggle(false); chatLLM.ResetChatHistory(); }, ]); + + // copy to clipboard + constants.events.push([ + document.getElementById('chatLLM_copy_all'), + 'click', + function (e) { + let text = document.getElementById('chatLLM_chat_history').innerText; + // need newlines instead of paragraphs headings etc + text = text.replace(/<p>/g, '\n').replace(/<\/p>/g, '\n'); + text = text.replace(/<h\d>/g, '\n').replace(/<\/h\d>/g, '\n'); + text = text.replace(/<.*?>/g, ''); + + navigator.clipboard.writeText(text); + }, + ]); + constants.events.push([ + document.getElementById('chatLLM_chat_history'), + 'click', + function (e) { + // we're delegating here, so set the event on child .chatLLM_message_copy_button + if (e.target.matches('.chatLLM_message_copy_button')) { + // get the innerText of the element before the button + let text = e.target.closest('p').previousElementSibling.innerText; + // need newlines instead of paragraphs headings etc + text = text.replace(/<p>/g, '\n').replace(/<\/p>/g, '\n'); + text = text.replace(/<h\d>/g, '\n').replace(/<\/h\d>/g, '\n'); + text = text.replace(/<.*?>/g, ''); + + navigator.clipboard.writeText(text); + } + }, + ]); } /** @@ -1163,7 +1229,7 @@constants.js
*/ ProcessLLMResponse(data, model) { chatLLM.WaitingSound(false); - console.log('LLM response: ', data); + //console.log('LLM response: ', data); let text = ''; let LLMName = resources.GetString(model); @@ -1367,9 +1433,9 @@constants.js
}; // Generate the content - console.log('LLM request: ', prompt, image); + //console.log('LLM request: ', prompt, image); const result = await model.generateContent([prompt, image]); - console.log(result.response.text()); + //console.log(result.response.text()); // Process the response chatLLM.ProcessLLMResponse(result.response, 'gemini'); @@ -1409,6 +1475,12 @@constants.js
<p class="chatLLM_message_text">${text}</p> </div> `; + // add a copy button to actual messages + if (user != 'User' && text != resources.GetString('processing')) { + html += ` + <p class="chatLLM_message_copy"><button class="chatLLM_message_copy_button">Copy</button></p> + `; + } this.RenderChatMessage(html); } @@ -1486,7 +1558,11 @@constants.js
// get name from resource let LLMName = resources.GetString(constants.LLMModel); this.firstTime = false; - this.DisplayChatMessage(LLMName, 'Processing Chart...', true); + this.DisplayChatMessage( + LLMName, + resources.GetString('processing'), + true + ); let defaultPrompt = this.GetDefaultPrompt(); this.Submit(defaultPrompt, true); } @@ -2282,7 +2358,7 @@constants.js
diff --git a/docs/controls.js.html b/docs/controls.js.html index fb8a89b4..3fbf1e2e 100644 --- a/docs/controls.js.html +++ b/docs/controls.js.html @@ -24,7 +24,7 @@
controls.js
diff --git a/docs/display.js.html b/docs/display.js.html index a4ee9c53..1f9acd2b 100644 --- a/docs/display.js.html +++ b/docs/display.js.html @@ -24,7 +24,7 @@
display.js
diff --git a/docs/global.html b/docs/global.html index 05f0215f..f8d03800 100644 --- a/docs/global.html +++ b/docs/global.html @@ -24,7 +24,7 @@
Parameters:
diff --git a/docs/heatmap.js.html b/docs/heatmap.js.html index 1d6889a9..9d586522 100644 --- a/docs/heatmap.js.html +++ b/docs/heatmap.js.html @@ -24,7 +24,7 @@
heatmap.js
diff --git a/docs/histogram.js.html b/docs/histogram.js.html index 86072184..6b459dcd 100644 --- a/docs/histogram.js.html +++ b/docs/histogram.js.html @@ -24,7 +24,7 @@
histogram.js
diff --git a/docs/index.html b/docs/index.html index a84a0904..008cca1c 100644 --- a/docs/index.html +++ b/docs/index.html @@ -24,7 +24,7 @@
diff --git a/docs/init.js.html b/docs/init.js.html index 613333f3..7c72dea3 100644 --- a/docs/init.js.html +++ b/docs/init.js.html @@ -24,7 +24,7 @@
init.js
diff --git a/docs/lineplot.js.html b/docs/lineplot.js.html index 03a2adb0..14254718 100644 --- a/docs/lineplot.js.html +++ b/docs/lineplot.js.html @@ -24,7 +24,7 @@
lineplot.js
diff --git a/docs/scatterplot.js.html b/docs/scatterplot.js.html index 2e7aca1e..1fa53947 100644 --- a/docs/scatterplot.js.html +++ b/docs/scatterplot.js.html @@ -24,7 +24,7 @@
scatterplot.js
diff --git a/docs/segmented.js.html b/docs/segmented.js.html index c6e5fa00..9a7c6124 100644 --- a/docs/segmented.js.html +++ b/docs/segmented.js.html @@ -24,7 +24,7 @@