1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- $(document).delegate( '.js-bartend', 'click', function () {
-
- $.ajax({
- url: '/ajax/bartender.php',
- data: {
- action: 'shake',
- dossier: $(this).data('dossier'),
- projetId: $(this).data('projet-id'),
- projetPadPrincipal: $(this).data('projet-pad-principal'),
- projetPadGarde: $(this).data('projet-pad-garde')
- },
- success: function (data) {
- if (data.status === 'error')
- alert('Bartender says: '+data.errors.join(' '));
- else
- setTimeout(status,1000);
- },
- error: function () {
- alert("Je n'ai pas pu contacter le barman pour presser le projet...");
- }
- });
-
- return false;
- });
- function status () {
- $('.js-status').each( function () {
- var statusdiv = $(this);
-
- $.ajax({
- url: '/ajax/bartender.php',
- data: {
- action: 'status',
- dossier: statusdiv.data('dossier'),
- projetId: statusdiv.data('projet-id')
- },
- success: function (data) {
- if (data.status === 'error') {
- alert('Bartender says: '+data.errors.join(' '));
- }
-
- statusdiv.find('.js-status-placeholder').text(data.status);
- statusdiv.find('.js-time-placeholder').text(data.time);
-
- if (data.status === 'IN_PROGRESS') // on relance la vérif de statut dans 3s pour voir si la compil est terminée
- setTimeout(status,3000);
- },
- error: function () {
- alert("Je n'ai pas pu contacter le barman pour le statut de compilation...");
- }
- });
- });
- }
- $(document).ready( function () {
- status();
- });
|