This commit is contained in:
David Ralph
2020-11-05 16:01:31 +00:00
parent f6d8ccf6e7
commit e1510e8277
35 changed files with 127 additions and 239 deletions

View File

@@ -1,5 +1,5 @@
import React from 'react';
import * as Constants from '../../modules/constants';
import * as Constants from '../../modules/Constants';
export default class Background extends React.PureComponent {
gradientStyleBuilder(gradientSettings) {
@@ -80,11 +80,10 @@ export default class Background extends React.PureComponent {
this.setBackground(randomPhoto.url.default, null, randomPhoto.photographer);
this.setCredit(randomPhoto.photographer);
document.getElementById('location').textContent = randomPhoto.location;
} else if (customBackgroundColour) {
this.setBackground(null, customBackgroundColour, 'false');
} else if (customBackground !== '') { // Local
this.setBackground(customBackground, null, 'false');
} else if (customBackgroundVideo) {
}
else if (customBackgroundColour) this.setBackground(null, customBackgroundColour, 'false');
else if (customBackground !== '') this.setBackground(customBackground, null, 'false'); // Local
else if (customBackgroundVideo) {
document.getElementById('backgroundImage').innerHTML = `
<video autoplay muted loop id="backgroundVideo">
<source src="${customBackgroundVideo}"/>

View File

@@ -34,14 +34,9 @@ export default class DateWidget extends React.PureComponent {
let format;
switch (localStorage.getItem('shortFormat')) {
case 'dash':
format = `${day}-${month}-${year}`;
break;
case 'gaps':
format = `${day} - ${month} - ${year}`;
break;
default:
format = `${day}/${month}/${year}`;
case 'dash': format = `${day}-${month}-${year}`; break;
case 'gaps': format = `${day} - ${month} - ${year}`; break;
default: format = `${day}/${month}/${year}`;
}
this.setState({ date: format });

View File

@@ -17,7 +17,7 @@ export default class View extends React.PureComponent {
}
viewStuff() {
const elements = ['#searchBar', '.navbar-container', '.clock', '.greeting', '.quotediv', 'time'];
const elements = ['#searchBar', '.navbar-container', '.clock', '.greeting', '.quotediv', 'time']; // elements to hide
elements.forEach((element) => {
try {
(this.state.hidden === false) ? document.querySelector(element).style.display = 'none' : document.querySelector(element).style.display = 'block';

View File

@@ -19,8 +19,7 @@ export default class Notes extends React.PureComponent {
pin() {
document.getElementById('noteContainer').classList.toggle('visibilityshow');
if (localStorage.getItem('notesPinned') === 'true') localStorage.setItem('notesPinned', false);
else localStorage.setItem('notesPinned', true);
(localStorage.getItem('notesPinned') === 'true') ? localStorage.setItem('notesPinned', false) : localStorage.setItem('notesPinned', true);
}
componentDidMount() {

View File

@@ -2,7 +2,7 @@ import React from 'react';
import Quotes from '@muetab/quotes';
import FileCopy from '@material-ui/icons/FilterNone';
import { toast } from 'react-toastify';
import * as Constants from '../../modules/constants';
import * as Constants from '../../modules/Constants';
import TwitterIcon from '@material-ui/icons/Twitter';
import StarIcon from '@material-ui/icons/Star';
import StarIcon2 from '@material-ui/icons/StarBorder';

View File

@@ -14,7 +14,6 @@ export default class Search extends React.PureComponent {
}
startSpeechRecognition() {
if (localStorage.getItem('voiceSearch') === 'false') return;
const voiceSearch = new window.webkitSpeechRecognition();
voiceSearch.start();
voiceSearch.onresult = (event) => document.getElementById('searchtext').value = event.results[0][0].transcript;
@@ -34,8 +33,7 @@ export default class Search extends React.PureComponent {
if (info.query) query = info.query;
}
const custom = localStorage.getItem('customSearchEngine');
if (custom) url = custom;
if (setting === 'custom') url = localStorage.getItem('customSearchEngine');
const searchButton = () => {
const value = document.getElementById('searchtext').value || 'mue fast';