source: extensions/autoupdate/trunk/template/head.tpl @ 32137

Last change on this file since 32137 was 9935, checked in by patdenice, 14 years ago
File size: 1.4 KB
Line 
1{footer_script}
2var error = '{"Unable to check upgrades..."|@translate|@escape:"javascript"}<br><a href="admin.php?action=check_autoupdate">{"Click here to check upgrades now"|@translate|@escape:"javascript"}</a>';
3var piwigo_upgrade = '{"A new version of Piwigo is available."|@translate|@escape:"javascript"}<br><a href="admin.php?page=plugin-autoupdate">{"Click here to upgrade automatically"|@translate|@escape:"javascript"}</a>';
4var ext_upgrade = '{"Some upgrades are available for extensions"|@translate|@escape:"javascript"}<br><a href="admin.php?page=plugin-autoupdate-ext">{"Click here to see upgrades"|@translate|@escape:"javascript"}</a>';
5var up_to_date = '{"Gallery and extensions are up to date"|@translate|@escape:"javascript"}';
6
7{literal}
8window.onload = function () {
9  jQuery.ajax({
10    type: 'GET',
11    url: 'ws.php',
12    dataType: 'json',
13    data: { method: 'pwg.extensions.checkUpdates', format: 'json' },
14    timeout: 10000,  // 10 sec timeout
15    success: function (data) {
16      if (data['stat'] == 'ok')
17        jQuery('#autoupdate').html(eval(data['result']));
18      else
19        jQuery('#autoupdate').html(error);
20    },
21    error: function() {
22     jQuery('#autoupdate').html(error);
23    }
24  });
25}
26{/literal}{/footer_script}
27<p id="autoupdate"><img src="plugins/autoupdate/template/ajax-loader.gif"> &nbsp; {'Checking upgrades for gallery and plugins...'|@translate}</p>
Note: See TracBrowser for help on using the repository browser.