Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dropdown menu fixed in chat window #528

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions src/js/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,16 +74,34 @@ if(getVoice) {
});
}

var button_clicked=document.getElementsByClassName("button_clicked");
var f2=0,j;
for(j=0;j<button_clicked.length;j++)
{
button_clicked[j].addEventListener("click",()=>{
f2=1;
});
}
if(submitThemeColor) {
submitThemeColor.addEventListener("click",()=>{
localStorage.setItem("theme",theme);
if(f2===1)
alert("Success");
});
}

var message_pane_button_clicked=document.getElementsByClassName("message_pane_button_clicked");
var f1=0,i;
for(i=0;i<message_pane_button_clicked.length;i++)
{
message_pane_button_clicked[i].addEventListener("click",()=>{
f1=1;
});
}
if(submitMsgPaneColor) {
submitMsgPaneColor.addEventListener("click",()=>{
localStorage.setItem("msgTheme",msgTheme);
if(f1===1)
alert("Success");
});
}
Expand Down
18 changes: 9 additions & 9 deletions src/options.html
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,13 @@ <h3>Settings Page</h3>
<div class="row">
<div class="col-sm-4">
<div class="themeSelectors" id="preDefThemes">
<input type="button" id="black" class="btn theme" style="background-color: black;">
<input type="button" id="deeppink" class="btn theme" style="background-color: deeppink;">
<input type="button" id="chartreuse" class="btn theme" style="background-color: chartreuse;">
<input type="button" id="brown" class="btn theme" style="background-color: brown;">
<input type="button" id="black" class="btn theme button_clicked" style="background-color: black;">
<input type="button" id="deeppink" class="btn theme button_clicked" style="background-color: deeppink;">
<input type="button" id="chartreuse" class="btn theme button_clicked" style="background-color: chartreuse;">
<input type="button" id="brown" class="btn theme button_clicked" style="background-color: brown;">
<div class="theme-picker-container">
<p style="margin: 10px 0px 0px;">Color picker</p>
<button id="btn-color-theme" class="btn theme"></button>
<button id="btn-color-theme" class="btn theme button_clicked"></button>
<input type="input" id="inputbox" data-toggle="colorpicker" class="color-picker">
</div>
</div>
Expand All @@ -117,10 +117,10 @@ <h3>Settings Page</h3>
<div class="row">
<div class="col-sm-4">
<div class="themeSelectors" id="msgPaneThemes">
<input type="button" id="black" class="btn theme" style="background-color: black;">
<input type="button" id="deeppink" class="btn theme" style="background-color: deeppink;">
<input type="button" id="chartreuse" class="btn theme" style="background-color: chartreuse;">
<input type="button" id="brown" class="btn theme" style="background-color: brown;">
<input type="button" id="black" class="btn theme message_pane_button_clicked" style="background-color: black;">
<input type="button" id="deeppink" class="btn theme message_pane_button_clicked" style="background-color: deeppink;">
<input type="button" id="chartreuse" class="btn theme message_pane_button_clicked" style="background-color: chartreuse;">
<input type="button" id="brown" class="btn theme message_pane_button_clicked" style="background-color: brown;">
</div>
</div>
<div class="save-btn">
Expand Down
2 changes: 1 addition & 1 deletion src/popup.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
</div>
<div style="z-index: 2;" class="dropdown">
<div id="dropdown"><img src="images/dots.png" style="width: auto; height: 20px;"></div>
<div class="dropdown-content">
<div class="dropdown-content" id="dc">
<a href="https://chat.susi.ai/overview" target="_blank"><li>About<img src="images/about.svg" ></li></a>
<a href="" id="clear"><li>Clear Chat<img src="images/clearAll.svg" ></li></a>
<a id="export"><li>Export<img src="images/export.svg"></li></a>
Expand Down
16 changes: 15 additions & 1 deletion src/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -836,7 +836,20 @@ let sendUserSettingsToServer = (darkTheme, accessToken) => { // Sending user se
}
});
};

var f;
var dc=document.getElementsByClassName("dropdown-content")[0];
let show= ()=> {
if(f===0)
{
dc.style.display="flex";
f=1;
}
else
{
dc.style.display="none";
f=0;
}
};
let check = () => {
if (dark === false) {
dark = true;
Expand Down Expand Up @@ -923,6 +936,7 @@ scrollIconBottomElement.addEventListener("click", (e) => {

document.getElementById("check").addEventListener("click", check);
document.getElementById("speak").addEventListener("click", changeSpeak);
document.getElementById("dropdown").addEventListener("click",show);

textarea.addEventListener("input", (e) => {
if(e.target.value) {
Expand Down
2 changes: 1 addition & 1 deletion src/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ input:checked+.slider:before {
right: 10px;
}
.dropdown:hover .dropdown-content{
display: flex;
display: none;
}

#ddown{
Expand Down