main.js 643 B

123456789101112131415161718192021222324252627282930313233343536
  1. //Ajout / Modification
  2. function plugin_ipcam_save(element){
  3. var form = $(element).closest('fieldset');
  4. var data = form.toData();
  5. data.action = 'ipcam_save_camera'
  6. $.action(data,
  7. function(response){
  8. alert(response.message);
  9. form.find('input').val('');
  10. location.reload();
  11. }
  12. );
  13. }
  14. //Supression
  15. function plugin_ipcam_delete(id,element){
  16. if(!confirm('Êtes vous sûr de vouloir faire ça ?')) return;
  17. $.action(
  18. {
  19. action : 'ipcam_delete_camera',
  20. id: id
  21. },
  22. function(response){
  23. $(element).closest('tr').fadeOut();
  24. }
  25. );
  26. }
  27. function plugin_ipcam_brand(element){
  28. $('#patternCamera').val($(element).val());
  29. }