mirror of
https://github.com/misterunknown/ifm.git
synced 2025-08-10 01:56:30 +02:00
1
.gitattributes
vendored
1
.gitattributes
vendored
@@ -1,2 +1,3 @@
|
||||
ifm.php -diff
|
||||
ifm.min.php -diff
|
||||
build/* -diff
|
||||
|
@@ -333,7 +333,8 @@ function IFM( params ) {
|
||||
* @param string content - content of the modal
|
||||
* @param object options - options for the modal
|
||||
*/
|
||||
this.showModal = function( content, options = {} ) {
|
||||
this.showModal = function( content, options ) {
|
||||
options = options || {};
|
||||
var modal = $( document.createElement( 'div' ) )
|
||||
.addClass( "modal fade" )
|
||||
.attr( 'id', 'ifmmodal' )
|
||||
@@ -522,7 +523,8 @@ function IFM( params ) {
|
||||
* @param string newdir - target directory
|
||||
* @param object options - options for changing the directory
|
||||
*/
|
||||
this.changeDirectory = function( newdir, options={} ) {
|
||||
this.changeDirectory = function( newdir, options ) {
|
||||
options = options || {};
|
||||
config = { absolute: false, pushState: true };
|
||||
jQuery.extend( config, options );
|
||||
if( ! config.absolute ) newdir = self.pathCombine( self.currentDir, newdir );
|
||||
@@ -1405,6 +1407,7 @@ function IFM( params ) {
|
||||
break;
|
||||
case 'h':
|
||||
case 'ArrowLeft':
|
||||
case 'Backspace':
|
||||
e.preventDefault();
|
||||
self.changeDirectory( '..' );
|
||||
break;
|
||||
@@ -2542,45 +2545,6 @@ f00bar;
|
||||
{{/items}}
|
||||
</tbody>
|
||||
|
||||
f00bar;
|
||||
$templates['file'] = <<<'f00bar'
|
||||
<form id="formFile">
|
||||
<div class="modal-body">
|
||||
<fieldset>
|
||||
<label>Filename:</label>
|
||||
<input type="text" class="form-control" name="filename" value="{{filename}}"><br>
|
||||
<div id="content" name="content"></div><br>
|
||||
<button type="button" class="btn btn-default" id="editoroptions">editor options</button>
|
||||
<div class="hide" id="editoroptions-head">options</div>
|
||||
<div class="hide" id="editoroptions-content">
|
||||
<input type="checkbox" id="editor-wordwrap"> word wrap</input><br>
|
||||
<input type="checkbox" id="editor-softtabs"> use soft tabs</input>
|
||||
<div class="input-group"><span class="input-group-addon">tabsize</span><input class="form-control" type="text" size="2" id="editor-tabsize"title="tabsize"></div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" id="buttonSave" class="btn btn-default">Save</button>
|
||||
<button type="button" id="buttonSaveNotClose" class="btn btn-default">Save without closing</button>
|
||||
<button type="button" id="buttonClose" class="btn btn-default">Close</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
f00bar;
|
||||
$templates['createdir'] = <<<'f00bar'
|
||||
<form id="formCreateDir">
|
||||
<div class="modal-body">
|
||||
<fieldset>
|
||||
<label>Directoy name:</label>
|
||||
<input class="form-control" type="text" name="dirname" value="" />
|
||||
</fieldset>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" id="buttonSave">Save</button>
|
||||
<button type="button" class="btn btn-default" id="buttonCancel">Cancel</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
f00bar;
|
||||
$templates['ajaxrequest'] = <<<'f00bar'
|
||||
<form id="formAjaxRequest">
|
23
compiler.php
23
compiler.php
@@ -13,7 +13,8 @@ $IFM_SRC_PHPFILES = array( "src/ifmzip.php" );
|
||||
$IFM_SRC_JS = "src/ifm.js";
|
||||
|
||||
$IFM_BUILD_STANDALONE = "ifm.php";
|
||||
$IFM_BUILD_LIB_PHP = "build/ifmlib.php";
|
||||
$IFM_BUILD_STANDALONE_COMPRESSED = "ifm.min.php";
|
||||
$IFM_BUILD_LIB_PHP = "build/libifm.php";
|
||||
|
||||
/**
|
||||
* Prepare main script
|
||||
@@ -40,14 +41,18 @@ foreach( $IFM_SRC_PHPFILES as $file ) {
|
||||
*/
|
||||
file_put_contents( $IFM_BUILD_STANDALONE, $main );
|
||||
file_put_contents( $IFM_BUILD_STANDALONE, $phpincludes, FILE_APPEND );
|
||||
file_put_contents( $IFM_BUILD_STANDALONE, array(
|
||||
'',
|
||||
'/**',
|
||||
' * start IFM',
|
||||
' */',
|
||||
'$ifm = new IFM();',
|
||||
'$ifm->run();'
|
||||
), FILE_APPEND );
|
||||
file_put_contents( $IFM_BUILD_STANDALONE, '
|
||||
/**
|
||||
* start IFM
|
||||
*/
|
||||
$ifm = new IFM();
|
||||
$ifm->run();
|
||||
', FILE_APPEND );
|
||||
|
||||
/**
|
||||
* Build compressed standalone script
|
||||
*/
|
||||
file_put_contents( $IFM_BUILD_STANDALONE_COMPRESSED, '<?php eval( gzdecode( file_get_contents( __FILE__, false, null, 85 ) ) ); exit(0); ?>' . gzencode( file_get_contents( "ifm.php", false, null, 5 ) ) );
|
||||
|
||||
/**
|
||||
* Build library
|
||||
|
53
ifm.php
53
ifm.php
@@ -333,7 +333,8 @@ function IFM( params ) {
|
||||
* @param string content - content of the modal
|
||||
* @param object options - options for the modal
|
||||
*/
|
||||
this.showModal = function( content, options = {} ) {
|
||||
this.showModal = function( content, options ) {
|
||||
options = options || {};
|
||||
var modal = $( document.createElement( 'div' ) )
|
||||
.addClass( "modal fade" )
|
||||
.attr( 'id', 'ifmmodal' )
|
||||
@@ -522,7 +523,8 @@ function IFM( params ) {
|
||||
* @param string newdir - target directory
|
||||
* @param object options - options for changing the directory
|
||||
*/
|
||||
this.changeDirectory = function( newdir, options={} ) {
|
||||
this.changeDirectory = function( newdir, options ) {
|
||||
options = options || {};
|
||||
config = { absolute: false, pushState: true };
|
||||
jQuery.extend( config, options );
|
||||
if( ! config.absolute ) newdir = self.pathCombine( self.currentDir, newdir );
|
||||
@@ -1405,6 +1407,7 @@ function IFM( params ) {
|
||||
break;
|
||||
case 'h':
|
||||
case 'ArrowLeft':
|
||||
case 'Backspace':
|
||||
e.preventDefault();
|
||||
self.changeDirectory( '..' );
|
||||
break;
|
||||
@@ -2542,45 +2545,6 @@ f00bar;
|
||||
{{/items}}
|
||||
</tbody>
|
||||
|
||||
f00bar;
|
||||
$templates['file'] = <<<'f00bar'
|
||||
<form id="formFile">
|
||||
<div class="modal-body">
|
||||
<fieldset>
|
||||
<label>Filename:</label>
|
||||
<input type="text" class="form-control" name="filename" value="{{filename}}"><br>
|
||||
<div id="content" name="content"></div><br>
|
||||
<button type="button" class="btn btn-default" id="editoroptions">editor options</button>
|
||||
<div class="hide" id="editoroptions-head">options</div>
|
||||
<div class="hide" id="editoroptions-content">
|
||||
<input type="checkbox" id="editor-wordwrap"> word wrap</input><br>
|
||||
<input type="checkbox" id="editor-softtabs"> use soft tabs</input>
|
||||
<div class="input-group"><span class="input-group-addon">tabsize</span><input class="form-control" type="text" size="2" id="editor-tabsize"title="tabsize"></div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" id="buttonSave" class="btn btn-default">Save</button>
|
||||
<button type="button" id="buttonSaveNotClose" class="btn btn-default">Save without closing</button>
|
||||
<button type="button" id="buttonClose" class="btn btn-default">Close</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
f00bar;
|
||||
$templates['createdir'] = <<<'f00bar'
|
||||
<form id="formCreateDir">
|
||||
<div class="modal-body">
|
||||
<fieldset>
|
||||
<label>Directoy name:</label>
|
||||
<input class="form-control" type="text" name="dirname" value="" />
|
||||
</fieldset>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" id="buttonSave">Save</button>
|
||||
<button type="button" class="btn btn-default" id="buttonCancel">Cancel</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
f00bar;
|
||||
$templates['ajaxrequest'] = <<<'f00bar'
|
||||
<form id="formAjaxRequest">
|
||||
@@ -2834,4 +2798,9 @@ class IFMZip {
|
||||
}
|
||||
}
|
||||
}
|
||||
/** * start IFM */$ifm = new IFM();$ifm->run();
|
||||
|
||||
/**
|
||||
* start IFM
|
||||
*/
|
||||
$ifm = new IFM();
|
||||
$ifm->run();
|
||||
|
@@ -21,7 +21,8 @@ function IFM( params ) {
|
||||
* @param string content - content of the modal
|
||||
* @param object options - options for the modal
|
||||
*/
|
||||
this.showModal = function( content, options = {} ) {
|
||||
this.showModal = function( content, options ) {
|
||||
options = options || {};
|
||||
var modal = $( document.createElement( 'div' ) )
|
||||
.addClass( "modal fade" )
|
||||
.attr( 'id', 'ifmmodal' )
|
||||
@@ -210,7 +211,8 @@ function IFM( params ) {
|
||||
* @param string newdir - target directory
|
||||
* @param object options - options for changing the directory
|
||||
*/
|
||||
this.changeDirectory = function( newdir, options={} ) {
|
||||
this.changeDirectory = function( newdir, options ) {
|
||||
options = options || {};
|
||||
config = { absolute: false, pushState: true };
|
||||
jQuery.extend( config, options );
|
||||
if( ! config.absolute ) newdir = self.pathCombine( self.currentDir, newdir );
|
||||
@@ -1093,6 +1095,7 @@ function IFM( params ) {
|
||||
break;
|
||||
case 'h':
|
||||
case 'ArrowLeft':
|
||||
case 'Backspace':
|
||||
e.preventDefault();
|
||||
self.changeDirectory( '..' );
|
||||
break;
|
||||
|
@@ -964,12 +964,6 @@ class IFM {
|
||||
f00bar;
|
||||
$templates['filetable'] = <<<'f00bar'
|
||||
@@@src/templates/filetable.html@@@
|
||||
f00bar;
|
||||
$templates['file'] = <<<'f00bar'
|
||||
@@@src/templates/modal.file.html@@@
|
||||
f00bar;
|
||||
$templates['createdir'] = <<<'f00bar'
|
||||
@@@src/templates/modal.createdir.html@@@
|
||||
f00bar;
|
||||
$templates['ajaxrequest'] = <<<'f00bar'
|
||||
@@@src/templates/modal.ajaxrequest.html@@@
|
||||
|
Reference in New Issue
Block a user