mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-03-13 15:36:42 +08:00
Expose a global replay() function to get replay data (#1808)
This allows the data to be exported for analysis using the console, e.g. with `copy(replay())`. I expect it can be used in future as the basis for the "ttr" file described in the TODO.
This commit is contained in:
parent
575d6dbf70
commit
439f4d1f1c
3 changed files with 11 additions and 0 deletions
|
@ -18,3 +18,5 @@ global.glarsesMode = toggleGlarses;
|
|||
global.filterDebug = Account.toggleFilterDebug;
|
||||
|
||||
global.stats = TestStats.getStats;
|
||||
|
||||
global.replay = Replay.getReplayExport;
|
||||
|
|
|
@ -24,3 +24,4 @@ import "./ready";
|
|||
import "./about-page";
|
||||
import * as Account from "./account";
|
||||
import * as TestStats from "./test-stats";
|
||||
import * as Replay from "./replay";
|
||||
|
|
|
@ -256,6 +256,13 @@ function playReplay() {
|
|||
);
|
||||
}
|
||||
|
||||
function getReplayExport() {
|
||||
return JSON.stringify({
|
||||
replayData: replayData,
|
||||
wordsList: wordsList,
|
||||
});
|
||||
}
|
||||
|
||||
$(".pageTest #playpauseReplayButton").click(async (event) => {
|
||||
if (toggleButton.className === "fas fa-play") {
|
||||
playReplay();
|
||||
|
@ -293,4 +300,5 @@ export {
|
|||
stopReplayRecording,
|
||||
addReplayEvent,
|
||||
replayGetWordsList,
|
||||
getReplayExport,
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue