StringChaos commited on
Commit
d378c8c
1 Parent(s): 0f609e5

model store

Browse files
templates/problem.html CHANGED
@@ -319,18 +319,29 @@
319
  model.style.display = 'none';
320
  }
321
  });
 
 
 
 
 
322
  });
323
- });
324
- document.addEventListener('DOMContentLoaded', function () {
325
- var selectElement = document.getElementById('model-select');
326
- selectElement.value = 'GPT-4-Turbo-2024-04-09';
327
 
328
- var codeElement = document.getElementById('code-GPT-4-Turbo-2024-04-09');
 
 
 
 
 
 
 
329
  if (codeElement) {
330
  codeElement.style.display = 'block';
331
  }
 
 
332
  });
333
 
 
334
  </script>
335
 
336
  </body>
 
319
  model.style.display = 'none';
320
  }
321
  });
322
+
323
+ console.log(localStorage.getItem('lcbviz-currentModel'));
324
+ localStorage.setItem('lcbviz-currentModel', this.value);
325
+ console.log(localStorage.getItem('lcbviz-currentModel'));
326
+
327
  });
 
 
 
 
328
 
329
+
330
+
331
+ var currentModel = localStorage.getItem('lcbviz-currentModel');
332
+ currentModel = currentModel || 'GPT-4-Turbo-2024-04-09';
333
+ modelSelect.value = currentModel;
334
+ localStorage.setItem('lcbviz-currentModel', currentModel);
335
+ // Display the corresponding code element
336
+ var codeElement = document.getElementById('code-' + currentModel);
337
  if (codeElement) {
338
  codeElement.style.display = 'block';
339
  }
340
+ // Add an event listener to save the selected model to local storage when it changes
341
+
342
  });
343
 
344
+
345
  </script>
346
 
347
  </body>
templates/problem_mini.html CHANGED
@@ -319,18 +319,29 @@
319
  model.style.display = 'none';
320
  }
321
  });
 
 
 
 
 
322
  });
323
- });
324
- document.addEventListener('DOMContentLoaded', function () {
325
- var selectElement = document.getElementById('model-select');
326
- selectElement.value = 'GPT-4-Turbo-2024-04-09';
327
 
328
- var codeElement = document.getElementById('code-GPT-4-Turbo-2024-04-09');
 
 
 
 
 
 
 
329
  if (codeElement) {
330
  codeElement.style.display = 'block';
331
  }
 
 
332
  });
333
 
 
334
  </script>
335
 
336
  </body>
 
319
  model.style.display = 'none';
320
  }
321
  });
322
+
323
+ console.log(localStorage.getItem('lcbviz-currentModel'));
324
+ localStorage.setItem('lcbviz-currentModel', this.value);
325
+ console.log(localStorage.getItem('lcbviz-currentModel'));
326
+
327
  });
 
 
 
 
328
 
329
+
330
+
331
+ var currentModel = localStorage.getItem('lcbviz-currentModel');
332
+ currentModel = currentModel || 'GPT-4-Turbo-2024-04-09';
333
+ modelSelect.value = currentModel;
334
+ localStorage.setItem('lcbviz-currentModel', currentModel);
335
+ // Display the corresponding code element
336
+ var codeElement = document.getElementById('code-' + currentModel);
337
  if (codeElement) {
338
  codeElement.style.display = 'block';
339
  }
340
+ // Add an event listener to save the selected model to local storage when it changes
341
+
342
  });
343
 
344
+
345
  </script>
346
 
347
  </body>