update bootstrap files to bootstrap3

This commit is contained in:
Sören Brunk 2014-04-07 19:37:03 +02:00
parent 4d4797b8c8
commit c8dccf9582
23 changed files with 8323 additions and 6251 deletions

46
static/js/longpolling.js Normal file
View file

@ -0,0 +1,46 @@
connfails=0;
longpollcallbacks = $.Callbacks();
// Updates a div with a specified id, by polling an url,
// which should return a new div, with the same id.
function longpoll_div(url, divid, cont, fail) {
$.ajax({
'url': url,
'dataType': 'html',
'success': function(data, status, jqxhr) {
$('#' + divid).replaceWith(data);
longpollcallbacks.fire();
connfails=0;
cont();
},
'error': function(jqxhr, msg, e) {
connfails=connfails+1;
// It's normal to get 1 failure per longpolling
// element when navigating away from a page.
// So 12 allows up to 4 longpolling elements per
// page.
if (connfails > 12) {
fail();
}
else {
cont();
}
}
});
}
function longpoll_data(url, cont) {
$.ajax({
'url': url,
'dataType': 'text',
'success': function(data, status, jqxhr) {
connfails=0;
cont(1, data);
},
'error': function(jqxhr, msg, e) {
connfails=connfails+1;
cont(0);
}
});
}