aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-07-30 16:11:16 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-07-30 16:11:16 -0400
commit2400c6faa34bc696c30253edb219a5ffad0b2a36 (patch)
treeff1b8dff395012f83f8629cf818de13b57d02ef4
parent703f24b83e1788955bf0a35525dc16fb2dbfb39a (diff)
insert modal dialog html from javascript
This avoids it being visible all the time in noscript
-rw-r--r--templates/longpolling.julius15
-rw-r--r--templates/page.hamlet8
2 files changed, 14 insertions, 9 deletions
diff --git a/templates/longpolling.julius b/templates/longpolling.julius
index a4077c3d5..0d18b8435 100644
--- a/templates/longpolling.julius
+++ b/templates/longpolling.julius
@@ -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');
}
},
});
diff --git a/templates/page.hamlet b/templates/page.hamlet
index ea8025d4f..67b19aaf7 100644
--- a/templates/page.hamlet
+++ b/templates/page.hamlet
@@ -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>