mirror of
https://github.com/swisspol/GCDWebServer.git
synced 2026-04-24 00:00:04 +08:00
Use modal panel instead of prompt() when creating folders
This commit is contained in:
@@ -64,6 +64,11 @@
|
|||||||
float: right;
|
float: right;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#create-input {
|
||||||
|
width: 250px;
|
||||||
|
height: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
/* Bootstrap overrides */
|
/* Bootstrap overrides */
|
||||||
|
|
||||||
.btn:focus {
|
.btn:focus {
|
||||||
|
|||||||
@@ -95,6 +95,27 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="modal fade" id="create-modal" tabindex="-1">
|
||||||
|
<div class="modal-dialog">
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header">
|
||||||
|
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||||
|
<h4 class="modal-title">Create Folder</h4>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
<p>Please enter the name of the folder to be created:</p>
|
||||||
|
<form onsubmit="return false">
|
||||||
|
<input type="text" autocomplete="off" id="create-input">
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
|
||||||
|
<button type="button" class="btn btn-primary" id="create-confirm">Create</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<script type="text/x-tmpl" id="template-listing">
|
<script type="text/x-tmpl" id="template-listing">
|
||||||
<tr class="row-file" data-path="{%=o.path%}" data-name="{%=o.name%}">
|
<tr class="row-file" data-path="{%=o.path%}" data-name="{%=o.name%}">
|
||||||
<td class="column-icon">
|
<td class="column-icon">
|
||||||
|
|||||||
@@ -203,8 +203,18 @@ $(document).ready(function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
$("#create-folder").click(function(event) {
|
$("#create-folder").click(function(event) {
|
||||||
var name = prompt("Please enter folder name:", "Untitled folder");
|
$("#create-input").val("Untitled folder");
|
||||||
if ((name != null) && (name != "")) {
|
$("#create-modal").modal("show");
|
||||||
|
$("#create-modal").on("shown.bs.modal", function(event) {
|
||||||
|
$("#create-input").focus();
|
||||||
|
$("#create-input").select();
|
||||||
|
})
|
||||||
|
});
|
||||||
|
|
||||||
|
$("#create-confirm").click(function(event) {
|
||||||
|
$("#create-modal").modal("hide");
|
||||||
|
var name = $("#create-input").val();
|
||||||
|
if (name != "") {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: 'create',
|
url: 'create',
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
|
|||||||
Reference in New Issue
Block a user