main.js 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. //CHARGEMENT DE LA PAGE
  2. function init_plugin_git(){
  3. switch($.urlParam('page')){
  4. default:
  5. break;
  6. }
  7. git_git_repository_search();
  8. }
  9. function hackpoint_resource_git_save(){
  10. if($('.hackpoint').hasClass('readonly')) return;
  11. var data = {};
  12. data.action = 'hackpoint_resource_git_save';
  13. data.id = $('#sketch-editor').attr('data-id');
  14. data.repository = $('#repository-form').attr("data-repository");
  15. data.url = $('#url').val();
  16. data.synchronise = $('#synchronise').prop('checked');
  17. $('.sketch-preloader').show();
  18. $.action(data,function(r){
  19. $('#repository-form').attr("data-repository",r.repository);
  20. setTimeout(function(){
  21. $('.sketch-preloader').fadeOut(200);
  22. },300);
  23. hackpoint_resource_git_explore();
  24. });
  25. }
  26. function hackpoint_resource_git_init(){
  27. hackpoint_resource_git_explore();
  28. }
  29. function hackpoint_resource_git_explore(){
  30. var data = {};
  31. data.action = 'hackpoint_resource_git_explore';
  32. data.id = $('#sketch-editor').attr('data-id');
  33. $('#git-browser').html('<div style="width:100%;padding:15px;text-align:center"><i class="fas fa-circle-notch fa-spin"></i> Mise à jour du dépôt, veuillez patienter...</div>');
  34. $.action(data,function(r){
  35. setTimeout(function(){
  36. $('.sketch-preloader').fadeOut(200);
  37. },300);
  38. $('#git-browser').html('<div id="file-browser"></div>');
  39. var documentApi = new DocumentApi('#file-browser',{
  40. root : r.root
  41. });
  42. documentApi.hidePanel('detail');
  43. documentApi.rightEdit = false;
  44. documentApi.rightDelete = false;
  45. documentApi.rightPermission = false;
  46. documentApi.load();
  47. init_components();
  48. });
  49. }