Permalink
Browse files

Update auto update module

Fixed updater module issues; everything should now work flawlessly (hopefully).
  • Loading branch information...
bluegill committed Mar 15, 2018
1 parent 3fa636a commit d430f621e67c4b6bbe5f07c266fe1c52c214ffd2
Showing with 115 additions and 232 deletions.
  1. +53 βˆ’127 app/static/css/preferences.css
  2. +8 βˆ’31 app/view/preferences.html
  3. +4 βˆ’10 app/view/preferences.js
  4. +3 βˆ’7 src/components/preferences.js
  5. +47 βˆ’57 src/components/updater.js
@@ -173,7 +173,6 @@ a:hover {
padding-bottom: 10px;
}


.button-text {
background: transparent !important;
color: #333;
@@ -187,7 +186,6 @@ a:hover {
opacity: 0.75;
}


.button-close {
display: block;
width: 12px;
@@ -319,6 +317,12 @@ input:checked+.slider:before {
z-index: 9999;
}

.backdrop.dark {
padding-top: 20px;
background: rgba(0, 0, 0, 0.75);
z-index: 999999;
}

.backdrop>.content {
margin: 35px auto;
background: rgba(255, 255, 255, 1);
@@ -336,49 +340,6 @@ input:checked+.slider:before {
display: block;
}

.button-update {
outline: none !important;
padding: 8px 14px;
background: #eee;
border-radius: 6px;
margin-right: 6px;
margin-left: -1px;
color: #333 !important;
border: none;
}

.button-update:hover {
opacity: 0.75;
}

.backdrop>.update {
margin: 60px auto;
background: rgba(238, 238, 238, 1);
box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.1);
border-radius: 4px;
width: 300px;
height: 154px;
padding: 1px 14px;
color: #000;
}

.backdrop>.update>p:last-child>a {
display: block;
}

.backdrop a[href="#cancel"] {
font-size: 10px;
color: #000;
margin-left: 3px;
border-bottom: 1px solid transparent;
width: 56px;
text-decoration: none;
}

.backdrop a[href="#cancel"]:hover {
border-bottom-color: #000;
}

#history .history-container>ul {
list-style-type: none;
margin: 0;
@@ -390,14 +351,6 @@ input:checked+.slider:before {
padding-top: 14px;
}

span.helper {
display: inline-block;
height: 100%;
vertical-align: middle;
}

#updatePrompt>.content>p:last-child {}

#history .history-container .screenshot {
list-style-type: none;
vertical-align: middle;
@@ -592,47 +545,6 @@ div.title {
margin-right: 2px;
}

.progress>.bar {
position: relative;
height: 6px;
display: block;
background-color: #ebebeb;
background-clip: padding-box;
margin: 0.5rem 0 1rem 0;
overflow: hidden;
border-radius: 6px;
}

.progress>.bar .indeterminate {
background-color: #3c9bfa;
border-radius: 6px;
}

.progress>.bar .indeterminate:before {
content: '';
position: absolute;
background-color: inherit;
top: 0;
left: 0;
bottom: 0;
will-change: left, right;
animation: indeterminate 3s linear infinite;
border-radius: 6px;
}

.progress>.bar .indeterminate:after {
content: '';
position: absolute;
background-color: inherit;
top: 0;
left: 0;
bottom: 0;
will-change: left, right;
animation: indeterminate 3s linear infinite;
animation-delay: 1.15s;
border-radius: 6px;
}

.icon-spin {
display: inline-block;
-webkit-animation: icon-spin 1s infinite linear;
@@ -657,50 +569,64 @@ div.title {
}
}

@keyframes indeterminate {
0% {
left: -35%;
right: 100%;
@keyframes fadeIn {
from {
opacity: 0;
}

60% {
left: 100%;
right: -90%;
to {
opacity: 1;
}
}

100% {
left: 100%;
right: -90%;
}
.hidden {
display: none;
}

@keyframes indeterminate-short {
0% {
left: -200%;
right: 100%;
}
span.helper {
display: inline-block;
height: 100%;
vertical-align: middle;
}

60% {
left: 107%;
right: -8%;
}
.spinner {
width: 40px;
height: 40px;

100% {
left: 107%;
right: -8%;
}
position: relative;
margin: 100px auto;
}

@keyframes fadeIn {
from {
opacity: 0;
}
.double-bounce1, .double-bounce2 {
width: 100%;
height: 100%;
border-radius: 50%;
background-color: #fff;
opacity: 0.6;
position: absolute;
top: 0;
left: 0;

-webkit-animation: sk-bounce 2.0s infinite ease-in-out;
animation: sk-bounce 2.0s infinite ease-in-out;
}

to {
opacity: 1;
}
.double-bounce2 {
-webkit-animation-delay: -1.0s;
animation-delay: -1.0s;
}

.hidden {
display: none;
@-webkit-keyframes sk-bounce {
0%, 100% { -webkit-transform: scale(0.0) }
50% { -webkit-transform: scale(1.0) }
}

@keyframes sk-bounce {
0%, 100% {
transform: scale(0.0);
-webkit-transform: scale(0.0);
} 50% {
transform: scale(1.0);
-webkit-transform: scale(1.0);
}
}
@@ -11,6 +11,13 @@
<app id="__preferences">
<button class="button-close close"></button>

<div id="loader" class="backdrop dark">
<div class="spinner">
<div class="double-bounce1"></div>
<div class="double-bounce2"></div>
</div>
</div>

<div id="servicePrompt" class="backdrop">
<div class="content">
<p class="label">Upload Path</p>
@@ -30,33 +37,6 @@
</div>
</div>

<div id="updatePrompt" class="backdrop">
<div class="content">
<i class="icon ion-ios-cloud-download-outline animated tada"></i>

<p>
<strong>Update Available</strong>
</p>

<p>
Please update the application to the latest version for the best experience.
</p>

<br/>

<p>
<a class="button-update" href="#download">Download & Install</a> or
<a class="button-text" href="#cancel">Cancel</a>
</p>

<div class="progress">
<div class="bar">
<div class="indeterminate"></div>
</div>
</div>
</div>
</div>

<div class="sidebar">
<ul>
<li id="#general" class="active"><i class="icon ion-ios-gear-outline"></i> General</li>
@@ -144,7 +124,6 @@ <h3>Services</h3>
<p class="subtitle">The URL shortener to use when shortening links</p>

<select name="shortenerService" class="control">
<option value="goo.gl">goo.gl</option>
<option value="is.gd">is.gd</option>
<option value="v.gd">v.gd</option>
</select>
@@ -162,8 +141,6 @@ <h3>Services</h3>
</div>
</app>

<script>
require('./preferences.js')
</script>
<script>require('./preferences.js')</script>
</body>
</html>
@@ -99,14 +99,14 @@ ipc.on('getOptions', (event, options) => {
}
})

ipc.on('showUpdate', (event) => {
showPrompt('#updatePrompt')
})

ipc.on('showService', (event, current) => {
showPrompt('#servicePrompt')
})

ipc.on('showLoader', (event, current) => {
showPrompt('#loader')
})

$('.sidebar li').click((event) => {
const url = event.target.id.split('#')[1]

@@ -134,12 +134,6 @@ $('a[href="#check"]').click(() => {
ipc.send('checkForUpdate')
})

$('a[href="#download"]').click(function () {
ipc.send('downloadUpdate')
$(this).parent().hide()
$('#updatePrompt .progress').show()
})

$('a[href="#cancel"]').click(() => {
$('.backdrop').hide()
})
@@ -136,7 +136,7 @@ module.exports = class {
fs.writeFileSync(path, json)
}

showWindow (update) {
showWindow () {
if (this.window) return

this.window = new BrowserWindow({
@@ -156,10 +156,6 @@ module.exports = class {

this.window.loadURL(`file://${__dirname}/../../app/view/preferences.html`)

this.window.once('ready-to-show', () => {
this.window.show()
})

this.window.on('closed', () => {
this.window = null
})
@@ -169,8 +165,8 @@ module.exports = class {
shell.openExternal(url)
})

this.window.webContents.on('did-finish-load', () => {
if (update) this.window.webContents.send('showUpdate')
this.window.once('ready-to-show', () => {
this.window.show()
})
}
}
Oops, something went wrong.

0 comments on commit d430f62

Please sign in to comment.