Skip to content

Commit 859347f

Browse files
committed
some more theme specific changes
1 parent c62a267 commit 859347f

File tree

3 files changed

+32
-4
lines changed

3 files changed

+32
-4
lines changed

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: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -671,7 +671,12 @@ <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+
$(document).ready(function() {
675+
$('#select-theme').on('change', function() {
676+
processtheme();
677+
});
678+
processtheme();
679+
/* chatwidget */
675680
window.ChatWidget.config.widgetTitle = "Ask GPT";
676681
window.ChatWidget.config.greetingMessage =
677682
"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: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,20 @@ function ToggleFunction() {
170170

171171
var einst = null;
172172
var direction = null;
173+
// process dark and bright theme
174+
const processtheme = () => {
175+
var selectedOption = $('#select-theme').find(':selected');
176+
var themedetected = selectedOption.closest('optgroup').attr('label');
177+
178+
if (themedetected === 'Bright') {
179+
console.log('Bright theme selected.');
180+
// want to add dark background for buttons for tooltip only if direction is vertical
181+
if (direction==='vertical') $('.fullscreen-toggle').addClass('rev-accent-background');
182+
} else if (themedetected === 'Dark') {
183+
console.log('Dark theme selected.');
184+
$('.fullscreen-toggle').removeClass('rev-accent-background');
185+
}
186+
};
173187

174188
// updates editor content by ID
175189
function updateEditorContent(cmd="", content="/* Welcome to openrepl! */", forceupdate=false) {
@@ -245,7 +259,7 @@ function SaveSelectedNodeToFile(oldSelectedNodeId, errcallback=null) {
245259
}
246260
}
247261

248-
function ToggleEditor(direction=null) {
262+
function ToggleEditor() {
249263
if (direction===null) {
250264
// first time
251265
if (ismob()) {
@@ -324,7 +338,7 @@ function ToggleRotateEditor() {
324338
}
325339
einst.destroy();
326340
einst = null; // destroy and reset splitter
327-
ToggleEditor(direction);
341+
ToggleEditor();
328342
}
329343

330344
function ToggleReconnect() {

0 commit comments

Comments
 (0)