const gitHelperAjax = async (options) => {
const { modal, action, inputs, value } = options
modal.modal('hide')
const url = `${window.gitlist.basepath}/${window.gitlist.repo}/git-helper/${window.gitlist.branch}/${action}`
const response = await $.ajax({
url: url,
type: 'POST',
data: {
value: value,
email: inputs.email.val(),
name: inputs.name.val(),
comment: inputs.comment.val(),
filename: filename
}
})
const json = JSON.parse(response)
if (json.hasOwnProperty('output') && json.output !== '') {
$.snackbar({
htmlAllowed: true,
content: json.output,
})
}
if (json.error === true) {
errorHandler(json);
}
return json;
}
const $modalDelete = $('#p3x-gitlist-modal-delete')
const $buttonDelete = $('#p3x-gitlist-file-delete')
const $buttonDeleteSure = $('#p3x-gitlist-modal-delete-confirm')
const $formDeleteForm = $('#p3x-gitlist-modal-delete-form')
const $deleteInputName = $('#p3x-gitlist-modal-delete-name');
const $deleteInputEmail = $('#p3x-gitlist-modal-delete-email');
const $deleteInputComment = $('#p3x-gitlist-modal-delete-comment');
const inputs = {
name: $deleteInputName,
email: $deleteInputEmail,
comment: $deleteInputComment,
}