mirror of
https://github.com/misterunknown/ifm.git
synced 2025-08-30 10:59:49 +02:00
moved includes to src/includes, added modal input focus
This commit is contained in:
14
ifm.php
14
ifm.php
@@ -454,8 +454,14 @@ function IFM() {
|
|||||||
modalDialog.append( modalContent );
|
modalDialog.append( modalContent );
|
||||||
modal.append( modalDialog );
|
modal.append( modalDialog );
|
||||||
$( document.body ).append( modal );
|
$( document.body ).append( modal );
|
||||||
modal.modal();
|
|
||||||
modal.on('hide.bs.modal', function () { $(this).remove(); });
|
modal.on('hide.bs.modal', function () { $(this).remove(); });
|
||||||
|
modal.on('shown.bs.modal', function () {
|
||||||
|
var formElements = $(this).find('input, button');
|
||||||
|
if( formElements.length > 0 ) {
|
||||||
|
formElements.first().focus();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
modal.modal('show');
|
||||||
};
|
};
|
||||||
|
|
||||||
this.hideModal = function() {
|
this.hideModal = function() {
|
||||||
@@ -1079,6 +1085,12 @@ function IFM() {
|
|||||||
$("#upload").click(function(){
|
$("#upload").click(function(){
|
||||||
self.uploadFileDialog();
|
self.uploadFileDialog();
|
||||||
});
|
});
|
||||||
|
$('#currentDir').on( 'keypress', function (event) {
|
||||||
|
if( event.keyCode == 13 ) {
|
||||||
|
event.preventDefault();
|
||||||
|
self.changeDirectory( $(this).val(), { absolute: true } );
|
||||||
|
}
|
||||||
|
});
|
||||||
$(document).on( 'keypress', self.handleKeystrokes );
|
$(document).on( 'keypress', self.handleKeystrokes );
|
||||||
|
|
||||||
// handle history manipulation
|
// handle history manipulation
|
||||||
|
14
src/ifm.js
14
src/ifm.js
@@ -26,8 +26,14 @@ function IFM() {
|
|||||||
modalDialog.append( modalContent );
|
modalDialog.append( modalContent );
|
||||||
modal.append( modalDialog );
|
modal.append( modalDialog );
|
||||||
$( document.body ).append( modal );
|
$( document.body ).append( modal );
|
||||||
modal.modal();
|
|
||||||
modal.on('hide.bs.modal', function () { $(this).remove(); });
|
modal.on('hide.bs.modal', function () { $(this).remove(); });
|
||||||
|
modal.on('shown.bs.modal', function () {
|
||||||
|
var formElements = $(this).find('input, button');
|
||||||
|
if( formElements.length > 0 ) {
|
||||||
|
formElements.first().focus();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
modal.modal('show');
|
||||||
};
|
};
|
||||||
|
|
||||||
this.hideModal = function() {
|
this.hideModal = function() {
|
||||||
@@ -651,6 +657,12 @@ function IFM() {
|
|||||||
$("#upload").click(function(){
|
$("#upload").click(function(){
|
||||||
self.uploadFileDialog();
|
self.uploadFileDialog();
|
||||||
});
|
});
|
||||||
|
$('#currentDir').on( 'keypress', function (event) {
|
||||||
|
if( event.keyCode == 13 ) {
|
||||||
|
event.preventDefault();
|
||||||
|
self.changeDirectory( $(this).val(), { absolute: true } );
|
||||||
|
}
|
||||||
|
});
|
||||||
$(document).on( 'keypress', self.handleKeystrokes );
|
$(document).on( 'keypress', self.handleKeystrokes );
|
||||||
|
|
||||||
// handle history manipulation
|
// handle history manipulation
|
||||||
|
16
src/main.php
16
src/main.php
@@ -29,9 +29,9 @@ class IFM {
|
|||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<style type="text/css">';?> @@@src/bootstrap.min.css@@@ <?php print '</style>
|
<style type="text/css">';?> @@@src/includes/bootstrap.min.css@@@ <?php print '</style>
|
||||||
<style type="text/css">';?> @@@src/ekko-lightbox.min.css@@@ <?php print '</style>
|
<style type="text/css">';?> @@@src/includes/ekko-lightbox.min.css@@@ <?php print '</style>
|
||||||
<style type="text/css">';?> @@@src/fontello-embedded.css@@@ <?php print '</style>
|
<style type="text/css">';?> @@@src/includes/fontello-embedded.css@@@ <?php print '</style>
|
||||||
<style type="text/css">';?> @@@src/style.css@@@ <?php print '</style>
|
<style type="text/css">';?> @@@src/style.css@@@ <?php print '</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
@@ -105,11 +105,11 @@ class IFM {
|
|||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="panel panel-default footer"><div class="panel-body">IFM - improved file manager | ifm.php hidden | <a href="http://github.com/misterunknown/ifm">Visit the project on GitHub</a></div></div>
|
<div class="panel panel-default footer"><div class="panel-body">IFM - improved file manager | ifm.php hidden | <a href="http://github.com/misterunknown/ifm">Visit the project on GitHub</a></div></div>
|
||||||
</div>
|
</div>
|
||||||
<script>';?> @@@src/ace/ace.js@@@ <?php print '</script>
|
<script>';?> @@@src/includes/ace.js@@@ <?php print '</script>
|
||||||
<script>';?> @@@src/jquery.min.js@@@ <?php print '</script>
|
<script>';?> @@@src/includes/jquery.min.js@@@ <?php print '</script>
|
||||||
<script>';?> @@@src/bootstrap.min.js@@@ <?php print '</script>
|
<script>';?> @@@src/includes/bootstrap.min.js@@@ <?php print '</script>
|
||||||
<script>';?> @@@src/bootstrap-notify.min.js@@@ <?php print '</script>
|
<script>';?> @@@src/includes/bootstrap-notify.min.js@@@ <?php print '</script>
|
||||||
<script>';?> @@@src/ekko-lightbox.min.js@@@ <?php print '</script>
|
<script>';?> @@@src/includes/ekko-lightbox.min.js@@@ <?php print '</script>
|
||||||
<script>';?> @@@src/ifm.js@@@ <?php print '</script>
|
<script>';?> @@@src/ifm.js@@@ <?php print '</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
Reference in New Issue
Block a user