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

adding help text loop to loading page #917

Merged
merged 6 commits into from
Aug 11, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
fixing up text on loading page
  • Loading branch information
choldgraf committed Aug 8, 2019
commit 11fbfe9e98e691064b7d14aa708522efc64562aa
25 changes: 15 additions & 10 deletions binderhub/static/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,13 +145,19 @@ function build(providerSpec, log, path, pathType) {
update_favicon(BASE_URL + "favicon_building.ico");
// split provider prefix off of providerSpec
var spec = providerSpec.slice(providerSpec.indexOf('/') + 1);

var usual_time = 20000;
// Update the text of the loading page if it exists
if ($('div#loader-text').length > 0) {
$('div#loader-text p').text("Starting repository: " + spec);
$('div#loader-text p.launching').text("Starting repository: " + spec)
$('div#loader-text p.launch_info').text("Please be patient while your environment loads.")

window.setTimeout(function() {
$('div#loader-text p.launch_info').html("Launch may take longer the first few times this environment has been run.")
}, usual_time);

window.setTimeout(function() {
$('div#loader-text p').html("Repository " + spec + " is taking longer than usual to start, hang tight!")
}, 17000);
$('div#loader-text p.launch_info').html("Your session is taking longer than usual to start! <a href='https://gitter.im/binder' target='_blank'>Reach out in the Gitter channel to debug</a>")
}, usual_time * 4);
}

$('#build-progress .progress-bar').addClass('hidden');
Expand Down Expand Up @@ -187,15 +193,14 @@ function build(providerSpec, log, path, pathType) {
$('#phase-failed').removeClass('hidden');

$("#loader").addClass("paused");
$('div#loader-text p').html("Repository " + spec + " has failed to load!<br />See the logs for details.");

// If we fail for any reason, show an error message and logs
update_favicon(BASE_URL + "favicon_fail.ico");
// If we fail for any reason, we will show logs!
log.show();

// Show error on loading page
if ($('div#loader-text').length > 0) {
$('#loader').addClass("error");
$('div#loader-text p').html('Error loading ' + spec + '!<br /> See logs below for details.');
$('div#loader-text p.launching').html('Error loading ' + spec + '!<br /> See logs below for details.');
$('div#loader-text p.launch_info').html("");
}
image.close();
});
Expand Down Expand Up @@ -333,7 +338,7 @@ function loadingMain(providerSpec) {
build(providerSpec, log, path, pathType);

// Looping through help text every few seconds
setInterval(nextHelpText, 4000);
setInterval(nextHelpText, 6000);

return false;
}
Expand Down
22 changes: 20 additions & 2 deletions binderhub/static/loading.css
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,32 @@ https://ihatetomatoes.net for initial code templates.*/
padding-top: 100px;
}

div#loader-text {
min-height: 9em;
}

#loader-text p {
font-size: 2em;
z-index: 1002;
max-width: 750px;
text-align: center;
margin: 0px auto 10px auto;
}

#loader-text p.launching {
font-size: 2em;
font-weight: bold;
}

#loader-text p.launch_info {
font-size: 1.8em;
}

div#loader-links {
min-height: 6em;
}

#loader-links p {
font-size: 1.5em;
font-size: 1.3em;
text-align: center;
max-width:700px;
margin: 0px auto 10px auto;
Expand Down
3 changes: 2 additions & 1 deletion binderhub/templates/loading.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
{% block main %}
<div id="loader"></div>
<div id="loader-text">
<p>Loading your Binder...</p>
<p class="launching">Launching your Binder...</p>
<p class="launch_info"></p>
</div>
<div id="loader-links">
<p class="text-center">New to Binder? Check out the <a target="_blank" href="https://mybinder.readthedocs.io/en/latest/">Binder Documentation</a> for more information</p>
Expand Down