Skip to content

Commit 53de840

Browse files
committed
some more theme specific changes
1 parent c62a267 commit 53de840

3 files changed

Lines changed: 31 additions & 4 deletions

File tree

src/resources/css/scribbler-global.css

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,4 +496,13 @@ input[type=text],[type=email], select, textarea, email {
496496

497497
.opaq:hover {
498498
opacity: 1;
499-
}
499+
}
500+
501+
/* theme specific class */
502+
.accent-background {
503+
background: var(--accent-color);
504+
}
505+
.rev-accent-background {
506+
background: var(--rev-accent-color);
507+
}
508+
/* them classes ends */

src/resources/index.html

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -671,7 +671,25 @@ <h3 class="section__title">Share/Collaborate</h3>
671671
<!-- chatgpt Section start -->
672672
<script src="./js/chat-widget.js" defer></script>
673673
<script>
674-
window.addEventListener("load", () => {
674+
const processtheme = (theme) => {
675+
var selectedOption = $('#select-theme').find(':selected');
676+
var themedetected = selectedOption.closest('optgroup').attr('label');
677+
678+
if (themedetected === 'Bright') {
679+
console.log('Bright theme selected.');
680+
$('.fullscreen-toggle').addClass('rev-accent-background');
681+
} else if (themedetected === 'Dark') {
682+
console.log('Dark theme selected.');
683+
$('.fullscreen-toggle').removeClass('rev-accent-background');
684+
}
685+
};
686+
687+
$(document).ready(function() {
688+
$('#select-theme').on('change', function() {
689+
processtheme();
690+
});
691+
processtheme();
692+
/* chatwidget */
675693
window.ChatWidget.config.widgetTitle = "Ask GPT";
676694
window.ChatWidget.config.greetingMessage =
677695
"Hello there! Welcome to openrepl.com.\nAn opensource platform to write and run your code snippets in REPL.";

src/resources/js/scribbler.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ function SaveSelectedNodeToFile(oldSelectedNodeId, errcallback=null) {
245245
}
246246
}
247247

248-
function ToggleEditor(direction=null) {
248+
function ToggleEditor() {
249249
if (direction===null) {
250250
// first time
251251
if (ismob()) {
@@ -324,7 +324,7 @@ function ToggleRotateEditor() {
324324
}
325325
einst.destroy();
326326
einst = null; // destroy and reset splitter
327-
ToggleEditor(direction);
327+
ToggleEditor();
328328
}
329329

330330
function ToggleReconnect() {

0 commit comments

Comments
 (0)