insert modal dialog html from javascript

This avoids it being visible all the time in noscript
This commit is contained in:
Joey Hess 2012-07-30 16:11:16 -04:00
parent 703f24b83e
commit 2400c6faa3
2 changed files with 14 additions and 9 deletions

View file

@ -5,7 +5,17 @@
// Maximum update frequency is controlled by #{startdelay}
// and #{delay}, both in milliseconds.
$dead=0;
$dead = 0;
$connfailed =
'<div id="modal" class="modal fade">' +
' <div .modal-header>' +
' <h3>git-annex has shut down</h2>' +
' </div>' +
' <div class="modal-body">' +
' You can now close this browser window.' +
' </div>' +
'</div>' ;
(function( $ ) {
@ -25,7 +35,8 @@ $.LongPoll#{ident} = (function() {
$dead=1;
// blocked by many browsers
window.close();
$('#lostconnection').modal('show');
$('#modal').replaceWith($connfailed);
$('#modal').modal('show');
}
},
});

View file

@ -21,10 +21,4 @@
<div .container-fluid>
<div .row-fluid>
^{content}
<div #lostconnection .modal .fade>
<div .modal-header>
<h3>
git-annex has shut down
<div .modal-body>
<p>
You can now close this browser window.
<div #modal></div>