Changeset 9935 for extensions/autoupdate/trunk/template/head.tpl
- Timestamp:
- Mar 30, 2011, 12:14:02 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/autoupdate/trunk/template/head.tpl
r9710 r9935 5 5 var up_to_date = '{"Gallery and extensions are up to date"|@translate|@escape:"javascript"}'; 6 6 7 window.onload = function () {ldelim} 8 jQuery.ajax({ldelim} 7 {literal} 8 window.onload = function () { 9 jQuery.ajax({ 9 10 type: 'GET', 10 url: 'plugins/autoupdate/ajax/check_updates.php', 11 dataType: 'text', 11 url: 'ws.php', 12 dataType: 'json', 13 data: { method: 'pwg.extensions.checkUpdates', format: 'json' }, 12 14 timeout: 10000, // 10 sec timeout 13 success: function (data) {ldelim} 14 var reg = new RegExp("^(error|piwigo_upgrade|ext_upgrade|up_to_date)$","i"); 15 if (!data.match(reg)) 15 success: function (data) { 16 if (data['stat'] == 'ok') 17 jQuery('#autoupdate').html(eval(data['result'])); 18 else 16 19 jQuery('#autoupdate').html(error); 17 else18 jQuery('#autoupdate').html(eval(data));19 20 }, 20 error: function() { ldelim}21 error: function() { 21 22 jQuery('#autoupdate').html(error); 22 23 } 23 24 }); 24 25 } 25 {/ footer_script}26 {/literal}{/footer_script} 26 27 <p id="autoupdate"><img src="plugins/autoupdate/template/ajax-loader.gif"> {'Checking upgrades for gallery and plugins...'|@translate}</p>
Note: See TracChangeset
for help on using the changeset viewer.