createlib.ui.js 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. window.loadExecution = function()
  2. {
  3. const projectID = $('input[name=project]').val();
  4. $.get($.createLink('doc', 'ajaxGetExecution', 'projectID=' + projectID), function(data)
  5. {
  6. data = JSON.parse(data);
  7. if(data.items)
  8. {
  9. const $executionsPicker = $('input[name=execution]').zui('picker');
  10. $executionsPicker.render({items: data.items, disabled: !data.project.multiple});
  11. $executionsPicker.$.setValue('');
  12. }
  13. });
  14. }
  15. window.changeDoclibAcl = function(e)
  16. {
  17. const libType = $(e.target).val();
  18. if(libType == 'api')
  19. {
  20. $('.apilib').removeClass('hidden');
  21. $('#orderBox').addClass('hidden');
  22. $('#orderBox #orderByid_asc').trigger('click');
  23. $('#aclBox .check-list').html($('#aclAPIBox .check-list').html());
  24. $("#aclBox input[id='aclopen']").prop('checked', true);
  25. $('.executionBox').addClass('hidden');
  26. }
  27. else
  28. {
  29. $('.apilib').addClass('hidden');
  30. $('#orderBox').removeClass('hidden');
  31. $('#aclBox .check-list').html($('#aclOtherBox .check-list').html());
  32. $("#aclBox input[id='acldefault']").prop('checked', true);
  33. $('.executionBox').removeClass('hidden');
  34. }
  35. $('#whiteListBox').addClass('hidden');
  36. $('#whiteListBox').find('[name^=users]').zui('picker').$.setValue('');
  37. $('#whiteListBox .notice').remove();
  38. }
  39. window.toggleNewSpace = function()
  40. {
  41. const isChecked = $("[name='newSpace']").prop('checked');
  42. if(isChecked)
  43. {
  44. $('#spaceName').removeClass('hidden');
  45. $('#spaceName').prev('div').addClass('hidden');
  46. }
  47. else
  48. {
  49. $('#spaceName').addClass('hidden');
  50. $('#spaceName').prev('div').removeClass('hidden');
  51. }
  52. }