|
Revision 9707, 0.8 KB
(checked in by patdenice, 2 years ago)
|
|
New version 2.2
|
| Line | |
|---|
| 1 | {html_head} |
|---|
| 2 | <script type="text/javascript"> |
|---|
| 3 | var mess_error = '{'Unable to check upgrades...'|@translate}<br><a href="admin.php?action=check_autoupdate">{'Click here to check upgrades now'|@translate}</a>'; |
|---|
| 4 | |
|---|
| 5 | window.onload = function () {ldelim} |
|---|
| 6 | jQuery.ajax({ldelim} |
|---|
| 7 | type: 'GET', |
|---|
| 8 | url: 'plugins/autoupdate/ajax/check_updates.php', |
|---|
| 9 | dataType: 'text', |
|---|
| 10 | timeout: 10000, // 10 sec timeout |
|---|
| 11 | success: function (data) {ldelim} |
|---|
| 12 | var reg = new RegExp("(warning|notice)","i"); |
|---|
| 13 | if (data.match(reg)) {ldelim} |
|---|
| 14 | data = mess_error; |
|---|
| 15 | } |
|---|
| 16 | jQuery('#autoupdate').html(data); |
|---|
| 17 | }, |
|---|
| 18 | error: function() {ldelim} |
|---|
| 19 | jQuery('#autoupdate').html(mess_error); |
|---|
| 20 | } |
|---|
| 21 | }); |
|---|
| 22 | } |
|---|
| 23 | </script> |
|---|
| 24 | {/html_head} |
|---|
| 25 | <p id="autoupdate"><img src="plugins/autoupdate/template/ajax-loader.gif"> {'Checking upgrades for gallery and plugins...'|@translate}</p> |
|---|