{combine_script id='jquery.ajaxmanager' load='footer' require='jquery' path='themes/default/js/plugins/jquery.ajaxmanager.js' } {footer_script require='jquery.ajaxmanager'} /* incompatible message */ var incompatible_msg = '{'WARNING! This plugin does not seem to be compatible with this version of Piwigo.'|@translate|@escape:'javascript'}'; incompatible_msg += '\n'; incompatible_msg += '{'Do you want to activate anyway?'|@translate|@escape:'javascript'}'; /* group action */ var pwg_token = '{$PWG_TOKEN}'; var confirmMsg = '{'Are you sure?'|@translate|@escape:'javascript'}'; {literal} var queuedManager = jQuery.manageAjax.create('queued', { queue: true, maxRequests: 1, complete: function() { location.reload(); } }); jQuery(document).ready(function() { /* group action */ jQuery('div.deactivate_all a').click(function() { if (confirm(confirmMsg)) { jQuery('div.active').each(function() { performPluginDeactivate(jQuery(this).attr('id')); }); } }); function performPluginDeactivate(id) { queuedManager.add({ type: 'GET', dataType: 'json', url: 'ws.php', data: { method: 'pwg.plugins.performAction', action: 'deactivate', plugin: id, pwg_token: pwg_token, format: 'json' }, success: function(data) { if (data['stat'] == 'ok') { jQuery("#"+id).removeClass('active').addClass('inactive'); } } }); }; /* incompatible message */ jQuery('.incompatible a.incompatible').click(function() { return confirm(incompatible_msg); }); /* TipTips */ jQuery('.warning').tipTip({ 'delay' : 0, 'fadeIn' : 200, 'fadeOut' : 200, 'maxWidth':'250px' }); jQuery('.plugin-restore').tipTip({ 'delay' : 0, 'fadeIn' : 200, 'fadeOut' : 200 }); jQuery('.showInfo').tipTip({ 'delay' : 0, 'fadeIn' : 200, 'fadeOut' : 200, 'maxWidth':'300px', /* not effective, TipTip bug */ 'keepAlive':true, 'activation':'click' }); }); {/literal} {/footer_script}