Skip to content

Commit

Permalink
Fix adding templates not working after restructure
Browse files Browse the repository at this point in the history
  • Loading branch information
austinwbest committed Oct 25, 2024
1 parent 878af2a commit 5960702
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 35 deletions.
35 changes: 0 additions & 35 deletions root/app/www/public/js/starr.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,41 +129,6 @@ function deleteAppStarrAccess(app, id)
}
}
// -------------------------------------------------------------------------------------------
function openTemplateStarrAccess(app, id)
{
$.ajax({
type: 'POST',
url: 'ajax/starr.php',
data: '&m=openTemplateStarrAccess&app=' + app + '&id=' + id,
success: function (resultData) {
dialogOpen({
id: 'openTemplateStarrAccess',
title: 'Create new template for ' + app,
size: 'lg',
body: resultData
});
}
});
}
// -------------------------------------------------------------------------------------------
function saveTemplateStarrAccess(app, id)
{
if (!$('#new-template-name').val()) {
toast('Templates', 'Template name is required', 'error');
return;
}

$.ajax({
type: 'POST',
url: 'ajax/starr.php',
data: '&m=saveTemplateStarrAccess&app=' + app + '&id=' + id + '&name=' + encodeURIComponent($('#new-template-name').val()),
success: function () {
dialogClose('openTemplateStarrAccess');
toast('Templates', 'The template has been added', 'info');
}
});
}
// -------------------------------------------------------------------------------------------
function resetUsage(app, id)
{
if (confirm('Are you sure you want to reset the usage counter?')) {
Expand Down
35 changes: 35 additions & 0 deletions root/app/www/public/js/templates.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,38 @@ function deleteCustomTemplate(app, starr)
}
}
// ---------------------------------------------------------------------------------------------
function openTemplateStarrAccess(app, id)
{
$.ajax({
type: 'POST',
url: 'ajax/templates.php',
data: '&m=openTemplateStarrAccess&app=' + app + '&id=' + id,
success: function (resultData) {
dialogOpen({
id: 'openTemplateStarrAccess',
title: 'Create new template for ' + app,
size: 'lg',
body: resultData
});
}
});
}
// -------------------------------------------------------------------------------------------
function saveTemplateStarrAccess(app, id)
{
if (!$('#new-template-name').val()) {
toast('Templates', 'Template name is required', 'error');
return;
}

$.ajax({
type: 'POST',
url: 'ajax/templates.php',
data: '&m=saveTemplateStarrAccess&app=' + app + '&id=' + id + '&name=' + encodeURIComponent($('#new-template-name').val()),
success: function () {
dialogClose('openTemplateStarrAccess');
toast('Templates', 'The template has been added', 'info');
}
});
}
// -------------------------------------------------------------------------------------------

0 comments on commit 5960702

Please sign in to comment.