Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a button to start updater #14

Merged
merged 1 commit into from
Jun 25, 2016
Merged
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
38 changes: 32 additions & 6 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -885,6 +885,25 @@ public function moveNewVersionInPlace() {
color: #555;
}

button {
font-family: 'Open Sans', Frutiger, Calibri, 'Myriad Pro', Myriad, sans-serif;
font-size: 13px;
font-weight: 600;
color: #555;
margin: 3px 3px 3px 0;
padding: 5px;
background-color: rgba(255, 255, 255, .95);
border-radius: 3px;
border: 1px solid rgba(240,240,240,.9);
cursor: pointer;
outline: none;
}

button:hover, button:focus {
background-color: rgba(240,240,240,.9);
color: #111;
}


</style>
</head>
Expand All @@ -911,7 +930,17 @@ public function moveNewVersionInPlace() {
<h2>Initializing</h2>
<div class="output">Current version is <?php echo($updater->getCurrentVersion()); ?>.<br>
<?php echo($updater->checkForUpdate()); ?><br>
<button id="recheck" class="button" onClick="window.location.reload()">Recheck</button></div>

<?php
if ($updater->updateAvailable()) {
?>
<button onClick="startUpdate()">Start update</button>
<?php
}
?>
<button onClick="window.location.reload()">Recheck</button>

</div>
</li>
<li id="step-check-files" class="step">
<h2>Check for expected files</h2>
Expand Down Expand Up @@ -1160,14 +1189,11 @@ function performStep(number, callback) {
}
};

<?php
if ($updater->updateAvailable()) {
?>
function startUpdate() {
currentStep('step-check-files');
performStep(1, performStepCallbacks[1]);
<?php
}
?>

</script>
<?php endif; ?>

Expand Down