Skip to content

Commit

Permalink
some more theme specific changes
Browse files Browse the repository at this point in the history
  • Loading branch information
vickeykumar committed Jun 20, 2024
1 parent c62a267 commit 859347f
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 4 deletions.
11 changes: 10 additions & 1 deletion src/resources/css/scribbler-global.css
Original file line number Diff line number Diff line change
Expand Up @@ -496,4 +496,13 @@ input[type=text],[type=email], select, textarea, email {

.opaq:hover {
opacity: 1;
}
}

/* theme specific class */
.accent-background {
background: var(--accent-color);
}
.rev-accent-background {
background: var(--rev-accent-color);
}
/* them classes ends */
7 changes: 6 additions & 1 deletion src/resources/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,12 @@ <h3 class="section__title">Share/Collaborate</h3>
<!-- chatgpt Section start -->
<script src="./js/chat-widget.js" defer></script>
<script>
window.addEventListener("load", () => {
$(document).ready(function() {
$('#select-theme').on('change', function() {
processtheme();
});
processtheme();
/* chatwidget */
window.ChatWidget.config.widgetTitle = "Ask GPT";
window.ChatWidget.config.greetingMessage =
"Hello there! Welcome to openrepl.com.\nAn opensource platform to write and run your code snippets in REPL.";
Expand Down
18 changes: 16 additions & 2 deletions src/resources/js/scribbler.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,20 @@ function ToggleFunction() {

var einst = null;
var direction = null;
// process dark and bright theme
const processtheme = () => {
var selectedOption = $('#select-theme').find(':selected');
var themedetected = selectedOption.closest('optgroup').attr('label');

if (themedetected === 'Bright') {
console.log('Bright theme selected.');
// want to add dark background for buttons for tooltip only if direction is vertical
if (direction==='vertical') $('.fullscreen-toggle').addClass('rev-accent-background');
} else if (themedetected === 'Dark') {
console.log('Dark theme selected.');
$('.fullscreen-toggle').removeClass('rev-accent-background');
}
};

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

function ToggleEditor(direction=null) {
function ToggleEditor() {
if (direction===null) {
// first time
if (ismob()) {
Expand Down Expand Up @@ -324,7 +338,7 @@ function ToggleRotateEditor() {
}
einst.destroy();
einst = null; // destroy and reset splitter
ToggleEditor(direction);
ToggleEditor();
}

function ToggleReconnect() {
Expand Down

0 comments on commit 859347f

Please sign in to comment.