Line | |
---|
1 | {footer_script} |
---|
2 | var 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>'; |
---|
3 | var 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>'; |
---|
4 | var 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>'; |
---|
5 | var up_to_date = '{"Gallery and extensions are up to date"|@translate|@escape:"javascript"}'; |
---|
6 | |
---|
7 | {literal} |
---|
8 | window.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"> {'Checking upgrades for gallery and plugins...'|@translate}</p> |
---|
Note: See
TracBrowser
for help on using the repository browser.