Confirm before deleting assignment

SPR-538
This commit is contained in:
Michael Grosse
2016-07-13 14:57:49 +02:00
parent 4fea3d0a86
commit e4e173875a
2 changed files with 10 additions and 1 deletions

View File

@ -116,7 +116,7 @@ class admin_plugin_struct_assignments extends DokuWiki_Admin_Plugin {
echo '<tr>';
echo '<td>' . hsc($assignee) . '</td>';
echo '<td>' . hsc($schema) . '</td>';
echo '<td><a href="' . $link . '">'.$this->getLang('assign_del').'</a></td>';
echo '<td><a class="deleteSchema" href="' . $link . '">'.$this->getLang('assign_del').'</a></td>';
echo '</tr>';
}

View File

@ -194,4 +194,13 @@ jQuery(function () {
});
});
jQuery('a.deleteSchema').click(function (event) {
var schema = jQuery(this).closest('tr').find('td:nth-child(2)').text();
var page = jQuery(this).closest('tr').find('td:nth-child(1)').text();
if(!window.confirm('Do you really want to delete the assignment of schema "' + schema + '" to page/namespace "' + page + '"?')) {
event.preventDefault();
event.stopPropagation();
};
})
});