mirror of
https://github.com/mue/mue.git
synced 2026-07-13 20:13:47 +02:00
bug fixes
This commit is contained in:
@@ -26,7 +26,6 @@ export default class Widgets extends React.PureComponent {
|
||||
return enabled;
|
||||
}
|
||||
|
||||
// Render all the components
|
||||
render() {
|
||||
const { language, languagecode } = this.props;
|
||||
const enabled = this.enabled;
|
||||
|
||||
@@ -72,7 +72,7 @@ export default class Background extends React.PureComponent {
|
||||
this.setBackground(url);
|
||||
this.setCredit(photographer);
|
||||
|
||||
document.querySelector('#backgroundCredits').style.display = 'none'; // Hide the location icon
|
||||
//document.querySelector('#backgroundCredits').style.display = 'none'; // Hide the location icon
|
||||
}
|
||||
|
||||
async determineMode() {
|
||||
|
||||
@@ -13,7 +13,9 @@ export default class Favourite extends React.PureComponent {
|
||||
favourite() {
|
||||
if (localStorage.getItem('favourite')) {
|
||||
localStorage.removeItem('favourite');
|
||||
this.setState({ favourited: <StarIcon2 onClick={() => this.favourite()} /> });
|
||||
this.setState({
|
||||
favourited: <StarIcon2 onClick={() => this.favourite()} />
|
||||
});
|
||||
} else {
|
||||
const url = document.getElementById('backgroundImage').style.backgroundImage.replace('url("', '').replace('")', '');
|
||||
const credit = document.getElementById('credit').textContent;
|
||||
|
||||
@@ -18,6 +18,7 @@ export default class View extends React.PureComponent {
|
||||
|
||||
viewStuff() {
|
||||
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';
|
||||
@@ -30,11 +31,13 @@ export default class View extends React.PureComponent {
|
||||
this.setState({
|
||||
hidden: true
|
||||
});
|
||||
|
||||
this.setAttribute(0, 100);
|
||||
} else {
|
||||
this.setState({
|
||||
hidden: false
|
||||
});
|
||||
|
||||
this.setAttribute(localStorage.getItem('blur'), localStorage.getItem('brightness'));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,27 +5,27 @@ import Camera from '@material-ui/icons/PhotoCamera';
|
||||
import Resolution from '@material-ui/icons/Crop';
|
||||
import Photographer from '@material-ui/icons/Person';
|
||||
|
||||
export default class PhotoInformation extends React.PureComponent {
|
||||
render() {
|
||||
return (
|
||||
<div className='photoInformation'>
|
||||
<h1 id='photographer'>{this.props.language.credit}</h1>
|
||||
<Info className='photoInformationHover'/>
|
||||
<div className={this.props.className || 'infoCard'}>
|
||||
<Info className='infoIcon'/>
|
||||
<h1>{this.props.language.information}</h1>
|
||||
<hr/>
|
||||
<Location/>
|
||||
<span id='location'></span>
|
||||
<Camera/>
|
||||
<span id='camera'></span>
|
||||
<Resolution/>
|
||||
<span id='resolution'></span>
|
||||
<Photographer/>
|
||||
<span id='photographerCard'></span>
|
||||
</div>
|
||||
<span id='credit' style={{ 'display': 'none' }}></span>
|
||||
const PhotoInformation = (props) => {
|
||||
return (
|
||||
<div className='photoInformation'>
|
||||
<h1 id='photographer'>{props.language.credit}</h1>
|
||||
<Info className='photoInformationHover'/>
|
||||
<div className={props.className || 'infoCard'}>
|
||||
<Info className='infoIcon'/>
|
||||
<h1>{props.language.information}</h1>
|
||||
<hr/>
|
||||
<Location/>
|
||||
<span id='location'></span>
|
||||
<Camera/>
|
||||
<span id='camera'></span>
|
||||
<Resolution/>
|
||||
<span id='resolution'></span>
|
||||
<Photographer/>
|
||||
<span id='photographerCard'></span>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
<span id='credit' style={{ 'display': 'none' }}></span>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default PhotoInformation;
|
||||
@@ -16,14 +16,14 @@ export default class Greeting extends React.PureComponent {
|
||||
}
|
||||
|
||||
// Get current month & day
|
||||
const m = time.getMonth();
|
||||
const d = time.getDate();
|
||||
const month = time.getMonth();
|
||||
const date = time.getDate();
|
||||
|
||||
if (m === 11 && d === 25) {
|
||||
if (month === 11 && date === 25) {
|
||||
message = this.props.language.christmas; // If it's December 25th, set the greeting string to "Merry Christmas"
|
||||
} else if (m === 0 && d === 1) {
|
||||
} else if (month === 0 && date === 1) {
|
||||
message = this.props.language.newyear; // If the date is January 1st, set the greeting string to "Happy new year"
|
||||
} else if (m === 9 && d === 31) {
|
||||
} else if (month === 9 && date === 31) {
|
||||
message = this.props.language.halloween; // If it's October 31st, set the greeting string to "Happy Halloween"
|
||||
}
|
||||
|
||||
|
||||
@@ -30,11 +30,11 @@ export default class Navbar extends React.PureComponent {
|
||||
// toggle feedback button
|
||||
let feedbackHTML = (
|
||||
<Tooltip title='Feedback' placement='top'>
|
||||
<Report className='topicons' onClick={this.props.feedbackModalOpen} />
|
||||
<Report className='topicons' onClick={() => this.props.openModal('feedbackModal')} />
|
||||
</Tooltip>
|
||||
);
|
||||
|
||||
if (Constants.BETA_VERSION === false){
|
||||
if (Constants.BETA_VERSION === false) {
|
||||
feedbackHTML = null;
|
||||
}
|
||||
|
||||
@@ -48,11 +48,11 @@ export default class Navbar extends React.PureComponent {
|
||||
</div>
|
||||
{feedbackHTML}
|
||||
<Tooltip title={this.props.language.navbar.tooltips.update} placement='top'>
|
||||
<NewReleases className='refreshicon topicons' onClick={this.props.updateModalOpen} />
|
||||
<NewReleases className='refreshicon topicons' onClick={() => this.props.openModal('updateModal')} />
|
||||
</Tooltip>
|
||||
{refreshHTML}
|
||||
<Tooltip title={this.props.language.modals.settings} placement='top'>
|
||||
<Gear className='settings-icon topicons' onClick={this.props.mainModalOpen} />
|
||||
<Gear className='settings-icon topicons' onClick={() => this.props.openModal('mainModal')} />
|
||||
</Tooltip>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -14,12 +14,19 @@ export default class Notes extends React.PureComponent {
|
||||
|
||||
setNotes = (e) => {
|
||||
localStorage.setItem('notes', e.target.value);
|
||||
this.setState({ notes: e.target.value });
|
||||
this.setState({
|
||||
notes: e.target.value
|
||||
});
|
||||
};
|
||||
|
||||
pin() {
|
||||
document.getElementById('noteContainer').classList.toggle('visibilityshow');
|
||||
(localStorage.getItem('notesPinned') === 'true') ? localStorage.setItem('notesPinned', false) : localStorage.setItem('notesPinned', true);
|
||||
|
||||
if (localStorage.getItem('notesPinned') === 'true') {
|
||||
localStorage.setItem('notesPinned', false);
|
||||
} else {
|
||||
localStorage.setItem('notesPinned', true);
|
||||
}
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
|
||||
@@ -14,14 +14,15 @@
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
|
||||
export default class Pin extends React.PureComponent {
|
||||
render() {
|
||||
return <svg xmlns='http://www.w3.org/2000/svg' enableBackground='new 0 0 24 24' viewBox='0 0 24 24' fill='black' width='18px' height='18px'>
|
||||
<g><rect fill='none' height='24' width='24'/></g>
|
||||
<g><path d='M16,9V4l1,0c0.55,0,1-0.45,1-1v0c0-0.55-0.45-1-1-1H7C6.45,2,6,2.45,6,3v0 c0,0.55,0.45,1,1,1l1,0v5c0,1.66-1.34,3-3,3h0v2h5.97v7l1,1l1-1v-7H19v-2h0C17.34,12,16,10.66,16,9z' fillRule='evenodd'/></g>
|
||||
</svg>;
|
||||
}
|
||||
const Pin = () => {
|
||||
return (
|
||||
<svg xmlns='http://www.w3.org/2000/svg' enableBackground='new 0 0 24 24' viewBox='0 0 24 24' fill='black' width='18px' height='18px'>
|
||||
<g><rect fill='none' height='24' width='24'/></g>
|
||||
<g><path d='M16,9V4l1,0c0.55,0,1-0.45,1-1v0c0-0.55-0.45-1-1-1H7C6.45,2,6,2.45,6,3v0 c0,0.55,0.45,1,1,1l1,0v5c0,1.66-1.34,3-3,3h0v2h5.97v7l1,1l1-1v-7H19v-2h0C17.34,12,16,10.66,16,9z' fillRule='evenodd'/></g>
|
||||
</svg>
|
||||
);
|
||||
}
|
||||
|
||||
export default Pin;
|
||||
@@ -118,19 +118,27 @@ export default class Quote extends React.PureComponent {
|
||||
|
||||
componentDidMount() {
|
||||
if (localStorage.getItem('favouriteQuote')) {
|
||||
this.setState({ favourited: <StarIcon className='copyButton' onClick={() => this.favourite()} /> });
|
||||
this.setState({
|
||||
favourited: <StarIcon className='copyButton' onClick={() => this.favourite()} />
|
||||
});
|
||||
}
|
||||
|
||||
if (localStorage.getItem('favouriteQuoteEnabled') === 'false') {
|
||||
this.setState({ favourited: null });
|
||||
this.setState({
|
||||
favourited: null
|
||||
});
|
||||
}
|
||||
|
||||
if (localStorage.getItem('copyButton') === 'false') {
|
||||
this.setState({ copy: null });
|
||||
this.setState({
|
||||
copy: null
|
||||
});
|
||||
}
|
||||
|
||||
if (localStorage.getItem('tweetEnabled') === 'false') {
|
||||
this.setState({ tweet: null });
|
||||
if (localStorage.getItem('tweetButton') === 'false') {
|
||||
this.setState({
|
||||
tweet: null
|
||||
});
|
||||
}
|
||||
|
||||
this.getQuote();
|
||||
|
||||
@@ -33,12 +33,15 @@ export default class Search extends React.PureComponent {
|
||||
|
||||
const setting = localStorage.getItem('searchEngine');
|
||||
const info = searchEngines.find(i => i.settingsName === setting);
|
||||
|
||||
if (info !== undefined) {
|
||||
url = info.url;
|
||||
if (info.query) query = info.query;
|
||||
}
|
||||
|
||||
if (setting === 'custom') url = localStorage.getItem('customSearchEngine');
|
||||
if (setting === 'custom') {
|
||||
url = localStorage.getItem('customSearchEngine');
|
||||
}
|
||||
|
||||
const searchButton = () => {
|
||||
const value = document.getElementById('searchtext').value || 'mue fast';
|
||||
|
||||
@@ -20,12 +20,15 @@ export default class Clock extends React.PureComponent {
|
||||
|
||||
// Percentage
|
||||
if (localStorage.getItem('percentageComplete') === 'true') {
|
||||
return this.setState({ time: (now.getHours() / 24).toFixed(2).replace('0.', '') + '%'});
|
||||
return this.setState({
|
||||
time: (now.getHours() / 24).toFixed(2).replace('0.', '') + '%'
|
||||
});
|
||||
}
|
||||
|
||||
// Analog clock
|
||||
if (localStorage.getItem('analog') === 'true') {
|
||||
require('react-clock/dist/Clock.css'); // load analog clock css
|
||||
|
||||
this.setState({
|
||||
time: now
|
||||
});
|
||||
@@ -49,7 +52,9 @@ export default class Clock extends React.PureComponent {
|
||||
time = `${('00' + now.getHours()).slice(-2)}:${('00' + now.getMinutes()).slice(-2)}${sec}`;
|
||||
}
|
||||
|
||||
this.setState({ time: time });
|
||||
this.setState({
|
||||
time: time
|
||||
});
|
||||
} else {
|
||||
// 12 hour support
|
||||
let hours = now.getHours();
|
||||
|
||||
@@ -31,7 +31,8 @@ export default class DateWidget extends React.PureComponent {
|
||||
day = dateYear;
|
||||
year = dateDay;
|
||||
break;
|
||||
default: break; // DMY
|
||||
default:
|
||||
break; // DMY
|
||||
}
|
||||
|
||||
let format;
|
||||
|
||||
Reference in New Issue
Block a user