mirror of
https://github.com/indentlabs/notebook.git
synced 2025-10-26 11:19:22 +00:00
This commit is the result of just running https://decaffeinate-project.org/ and making no additional changes.
47 lines
1.2 KiB
JavaScript
47 lines
1.2 KiB
JavaScript
/*
|
|
* decaffeinate suggestions:
|
|
* DS102: Remove unnecessary code created because of implicit returns
|
|
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
|
|
*/
|
|
$(document).ready(function() {
|
|
|
|
// Character name generator
|
|
$('.character_name_generator').click(function() {
|
|
const target = $(this).closest('.row').find('input[type=text]');
|
|
$.ajax({
|
|
dataType: 'text',
|
|
url: '/generate/character/name',
|
|
success(data) {
|
|
return target.val(data);
|
|
}
|
|
});
|
|
return 0;
|
|
});
|
|
|
|
// Character age generator
|
|
$('.character_age_generator').click(function() {
|
|
const target = $(this).closest('.row').find('input[type=text]');
|
|
$.ajax({
|
|
dataType: 'text',
|
|
url: '/generate/character/age',
|
|
success(data) {
|
|
return target.val(data);
|
|
}
|
|
});
|
|
return 0;
|
|
});
|
|
|
|
// Location name generator
|
|
return $('.location_name_generator').click(function() {
|
|
const target = $(this).closest('.row').find('input[type=text]');
|
|
$.ajax({
|
|
dataType: 'text',
|
|
url: '/generate/location/name',
|
|
success(data) {
|
|
return target.val(data);
|
|
}
|
|
});
|
|
return 0;
|
|
});
|
|
});
|