Skip to content

Commit

Permalink
[Bugfix] timezone api fail
Browse files Browse the repository at this point in the history
  • Loading branch information
jackd248 committed Nov 12, 2016
1 parent d3295db commit fc446b0
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 12 deletions.
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
"name": "temps",
"productName": "Temps",
"website": "https://jackd248.github.io/temps/",
"version": "0.6.1",
"version": "0.6.2",
"icon": "assets/app.png",
"description": "A simple but smart menubar weather app",
"main": "src/app.js",
"electronVersion": "1.4.2",
"electronVersion": "1.4.6",
"keywords": [
"electron",
"temperature",
Expand Down Expand Up @@ -45,11 +45,11 @@
"electron-packager": "^8.0.0",
"electron-prebuilt": "^1.4.1",
"electron-installer-dmg": "0.1.2",
"electron-builder": "7.11.4",
"electron-builder": "8.3.0",
"standard": "^8.3.0"
},
"dependencies": {
"electron": "1.4.3",
"electron": "1.4.6",
"menubar": "^5.1.0",
"auto-launch": "^5.0.1",
"applescript": "^1.0.0",
Expand Down
3 changes: 2 additions & 1 deletion src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@ mb.on('show', function show () {
})

const appLauncher = new AutoLaunch({
name: 'temps'
name: 'temps',
isHidden: true
})

appLauncher.isEnabled().then(function (enabled) {
Expand Down
8 changes: 7 additions & 1 deletion src/components/timezone.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,13 @@ const getTimezone = function () {
if (err || !res.ok) {
utils.showErrorMessage('Failure during data fetching')
} else {
timeoffset = res.body.rawOffset + res.body.dstOffset
if (res.body.status === 'OVER_QUERY_LIMIT') {
const d = new Date()
const n = d.getTimezoneOffset()
timeoffset = n * 60 * -1
} else {
timeoffset = res.body.rawOffset + res.body.dstOffset
}
jQuery('#details .header .date').html(utils.getTodayDate())
utils.refreshClock()
utils.checkLoading()
Expand Down
5 changes: 3 additions & 2 deletions src/components/weather.js
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ const showHourlyWeatherData = function () {

jQuery('#chartjs-tooltip .icon').load('../../assets/icons/' + tooltip.footer[0] + '.svg', null, function () {
jQuery(this).find('svg path').css('fill', color.getColor())
jQuery(this).find('svg circle').css('fill', color.getColor())
})
let x = tooltip.x
if (x < 0) {
Expand Down Expand Up @@ -367,11 +368,11 @@ const showRain = function (nbDrop = 100) {
}

const showThunder = function () {
jQuery('#main').prepend('<div class="thunder"></div>')
jQuery('#main').append('<div class="thunder"></div>')
}

const showSnow = function () {
jQuery('#main').prepend('<div class="snow"></div>')
jQuery('#main').append('<div class="snow"></div>')
}

const getNumAnimTemp = function () {
Expand Down
4 changes: 2 additions & 2 deletions src/main/config.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "temps",
"version": "v0.6.1",
"version": "v0.6.2",
"apikey": "547bbdc38bd641bef6645cd2c4bc613f",
"timezone": {
"url": "https://maps.googleapis.com/maps/api/timezone/json",
"apikey": "AIzaSyD7CnHeMDQV_XCXlimoPwiPSB_83Wfq7LE",
"offset": 7200
"offset": 0
},
"weather": {
"url": {
Expand Down
2 changes: 1 addition & 1 deletion src/main/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ <h1>
<button class="quit pull-right">Quit</button>
</div>
<div class="footer">
<a href="https://jackd248.github.io/temps/" target="_blank" alt="temps">temps</a> - v0.6.1 &copy; 2016
<a href="https://jackd248.github.io/temps/" target="_blank" alt="temps">temps</a> - v0.6.2 &copy; 2016
</div>
</div>
</div>
Expand Down
3 changes: 2 additions & 1 deletion src/main/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,7 @@ h1:after {
top: 10px;
left: 10px;
position: absolute;
z-index: 2;
}

#main .settings img:hover, #main .settings:hover {
Expand Down Expand Up @@ -659,7 +660,7 @@ body {
background: none;
font-family: Androgyne;
background-image: url('http://www.wearewebstars.dk/codepen/img/s1.png'), url('http://www.wearewebstars.dk/codepen/img//s2.png'), url('http://www.wearewebstars.dk/codepen/img//s3.png');
height: 100%;
height: 300px;
left: 0;
position: absolute;
top: 0;
Expand Down
1 change: 1 addition & 0 deletions src/utilities/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ const showErrorMessage = function (message) {
const reset = function () {
jQuery('.drop').remove()
jQuery('.thunder').remove()
jQuery('.snow').remove()
jQuery('#chartjs-tooltip').css('opacity', 0)
}

Expand Down

0 comments on commit fc446b0

Please sign in to comment.