blob: 0e77ad124ba9b069bbdc8e74362105e7cff27d93 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
<?php
?>
<span id="add-new-character-btn" class="floating-action-btn" data-toggle="modal" data-target="#newCharacterModal">
+
</span>
<!-- Modal -->
<div class="modal fade" id="newCharacterModal" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 id="modal-title" class="modal-title">Neuen Charakter anlegen</h4>
</div>
<div class="modal-body">
<form action="" method="post" enctype="multipart/form-data" id="create-char-form">
<input type="hidden" name="story-name" id="story-name" value="<?=$currentStory;?>">
<div class="form-group">
<label for="name">Name des Charakters:</label>
<input type="text" class="form-control" id="char-name" name="char-name">
</div>
<div class="form-group">
<label for="story-description">Beschreibung des Charakters:</label>
<textarea class="form-control" rows="5" id="char-description" name="char-description"></textarea>
</div>
<div class="form-group">
<label for="story-logo">Foto des Charakters:</label>
<input type="file" name="char-passphoto" id="char-passphoto">
</div>
<input type="hidden" value="create" id="char-action" name="char-action">
<button type="submit" id="create-char-btn" class="btn btn-info btn-sm">Anlegen</button>
</form>
</div>
</div>
</div>
</div>
<script>
$('#create-char-form').submit(function(event) {
createNewCharacter();
event.preventDefault();
});
$('#newCharacterModal').on('hide.bs.modal', function(evt) {
formReset();
});
function formReset() {
$('#create-char-form')[0].reset();
$('#char-action').val('create');
$('#modal-title').text('Neuen Charakter anlegen');
$('#create-char-btn').text('Anlegen');
}
</script>
|