mirror of
https://github.com/wavelog/wavelog.git
synced 2026-03-22 10:24:14 +00:00
Make CAT-URL Editable JS-Part
This commit is contained in:
@@ -14,6 +14,66 @@ $(document).ready(function () {
|
||||
|
||||
});
|
||||
|
||||
$(document).on('click', '.editCatUrl', async function (e) { // Dynamic binding, since element doesn't exists when loading this JS
|
||||
editCatUrlDialog(e);
|
||||
});
|
||||
|
||||
function editCatUrlDialog(e) {
|
||||
$.ajax({
|
||||
url: base_url + 'index.php/radio/editCatUrl',
|
||||
type: 'post',
|
||||
data: {
|
||||
id: e.currentTarget.id,
|
||||
},
|
||||
success: function (data) {
|
||||
BootstrapDialog.show({
|
||||
title: 'Edit Callback-URL for CAT',
|
||||
size: BootstrapDialog.SIZE_NORMAL,
|
||||
cssClass: 'options',
|
||||
id: "CatUrlModal",
|
||||
nl2br: false,
|
||||
message: data,
|
||||
onshown: function(dialog) {
|
||||
},
|
||||
buttons: [{
|
||||
label: 'Save',
|
||||
cssClass: 'btn-primary btn-sm saveContainerName',
|
||||
action: function (dialogItself) {
|
||||
saveCatUrl();
|
||||
dialogItself.close();
|
||||
}
|
||||
},
|
||||
{
|
||||
label: lang_admin_close,
|
||||
cssClass: 'btn-sm',
|
||||
id: 'closeButton',
|
||||
action: function (dialogItself) {
|
||||
dialogItself.close();
|
||||
}
|
||||
}],
|
||||
});
|
||||
},
|
||||
error: function (data) {
|
||||
|
||||
},
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
function saveCatUrl() {
|
||||
$.ajax({
|
||||
url: base_url + 'index.php/radio/saveCatUrl',
|
||||
type: 'post',
|
||||
data: {
|
||||
id: $('#catid').val(),
|
||||
caturl: $('#CatUrlInput').val()
|
||||
},
|
||||
error: function (data) {
|
||||
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
function set_default_radio(radio_id) {
|
||||
$('#default_radio_btn_' + radio_id).addClass('running').prop('disable', true);
|
||||
$('#default_radio_btn_' + radio_id).removeClass('btn-outline-primary').addClass('btn-primary');
|
||||
@@ -35,4 +95,4 @@ function release_default_radio(radio_id) {
|
||||
radio_id: radio_id
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user