Skip to content
This repository has been archived by the owner on Mar 10, 2021. It is now read-only.

Various style and bug fixes #11

Merged
merged 5 commits into from
Jul 20, 2019
Merged
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
5 changes: 4 additions & 1 deletion scss/chat.important.scss
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ div#starred-posts {
background-color: #000;
background-image: $bg-pattern;
color: #ddd;
.wmd-mini-button {
color: #ddd;
}
}

body.outside #container,
Expand Down Expand Up @@ -177,6 +180,6 @@ body.moderator-room {
display: none;
}

a {
a:not(.button, .tag, .wmd-mini-button) {
color: #38aff9;
}
3 changes: 3 additions & 0 deletions src/modules/CodeModeEditorModule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ export class CodeModeEditorModule {
private select?: HTMLSelectElement;
private btnSubmit = document.querySelector<HTMLButtonElement>('#sayit-button')!;
public init() {
if(!this.input) {
return;
}
this.codeMirror = CodeMirror(el => {
el.hidden = true;
this.input.insertAdjacentElement('beforebegin', el);
Expand Down
3 changes: 3 additions & 0 deletions src/modules/EmojiTranslatorModule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ import { emojiData } from "../utils/emojiData";
export class EmojiTranslatorModule {
public init() {
const input = document.getElementById("input") as HTMLTextAreaElement;
if(!input) {
return;
}
input.addEventListener("keyup", event => {
const { selectionStart, selectionEnd } = input;
if (event.which !== 32) return;
Expand Down
24 changes: 13 additions & 11 deletions src/modules/ThemeDomManipulationModule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,20 @@ const DARK_THEME_SO_LOGO_BASE64 =

export class ThemeDomManipulationModule {
public init() {
const container = document.getElementById("footer-logo");
if (!container) {
return;
}
const link = container.querySelector<HTMLAnchorElement>("a");
const img = container.querySelector<HTMLImageElement>("img");
const containers = document.querySelectorAll<HTMLElement>("#footer-logo, #header-logo");
this.replaceLogos([...containers]);
}
private replaceLogos(containers: HTMLElement[]) {
for(const container of containers) {
const link = container.querySelector<HTMLAnchorElement>("a");
const img = container.querySelector<HTMLImageElement>("img");

if (!link || !img) {
return;
}
if (link.href.includes("stackoverflow")) {
img.src = DARK_THEME_SO_LOGO_BASE64;
if (!link || !img) {
return;
}
if (link.href.includes("stackoverflow")) {
img.src = DARK_THEME_SO_LOGO_BASE64;
}
}
}
}