1
0
mirror of https://github.com/misterunknown/ifm.git synced 2025-08-10 10:04:01 +02:00

[=] Fix modal classes

This commit is contained in:
Anton Baranov
2020-03-09 18:11:44 +02:00
parent 358ed6397d
commit 7d9ef6390d
15 changed files with 80 additions and 51 deletions

View File

@@ -11,9 +11,10 @@ chdir( realpath( dirname( __FILE__ ) ) );
// output files and common attrs
define( "IFM_CDN", true );
define( "IFM_VERSION", "<a href='https://github.com/cryol/ifm/tree/2.6.0' target=_blank>v2.6.0</a>" );
define( "IFM_STANDALONE", "dist/ifm.php" );
define( "IFM_STANDALONE_GZ", "dist/ifm.min.php" );
define( "IFM_LIB", "dist/libifm.php" );
define( "IFM_RELEASE_DIR", "dist/");
define( "IFM_STANDALONE", "ifm.php" );
define( "IFM_STANDALONE_GZ", "ifm.min.php" );
define( "IFM_LIB", "libifm.php" );
if( IFM_CDN ){
$IFM_ASSETS = "src/assets.cdn.part";
@@ -56,6 +57,7 @@ foreach( $IFM_SRC_PHP as $phpfile ) {
$compiled = array_merge( $compiled, $lines );
}
$compiled = join( $compiled );
$compiled = str_replace( "IFM_ASSETS", file_get_contents( $IFM_ASSETS ), $compiled );
/**
* Process file includes
@@ -92,13 +94,13 @@ foreach( $includes as $var )
$compiled = str_replace( 'IFM_VERSION', IFM_VERSION, $compiled );
if (!is_dir('dist/')){
mkdir('dist');
if (!is_dir(IFM_RELEASE_DIR)){
mkdir(IFM_RELEASE_DIR);
}
// build standalone ifm
file_put_contents( IFM_STANDALONE, $compiled );
file_put_contents( IFM_STANDALONE, '
file_put_contents( IFM_RELEASE_DIR . (IFM_CDN ? 'cdn.' : 'simple.') . IFM_STANDALONE, $compiled );
file_put_contents( IFM_RELEASE_DIR . (IFM_CDN ? 'cdn.' : 'simple.') . IFM_STANDALONE, '
/**
* start IFM
*/
@@ -108,9 +110,9 @@ $ifm->run();
// build compressed ifm
file_put_contents(
IFM_STANDALONE_GZ,
IFM_RELEASE_DIR . (IFM_CDN ? 'cdn.' : 'simple.') . IFM_STANDALONE_GZ,
'<?php eval( gzdecode( file_get_contents( __FILE__, false, null, 85 ) ) ); exit(0); ?>'
. gzencode( file_get_contents( "./dist/ifm.php", false, null, 5 ) )
. gzencode( file_get_contents( IFM_RELEASE_DIR . (IFM_CDN ? 'cdn.' : 'simple.') .IFM_STANDALONE, false, null, 5 ) )
);
// build lib
file_put_contents( IFM_LIB, $compiled );
file_put_contents( IFM_RELEASE_DIR . (IFM_CDN ? 'cdn.' : 'simple.') . IFM_LIB, $compiled );

View File

@@ -33,7 +33,7 @@ function IFM(params) {
this.showModal = function( content, options ) {
options = options || {};
var modal = document.createElement( 'div' );
modal.classList.add( 'modal' );
modal.classList.add( 'modal', 'fade' );
modal.id = 'ifmmodal';
modal.attributes.role = 'dialog';
var modalDialog = document.createElement( 'div' );
@@ -45,7 +45,6 @@ function IFM(params) {
modalContent.innerHTML = content;
modalDialog.appendChild( modalContent );
modal.appendChild( modalDialog );
console.log(modal);
document.body.appendChild( modal );
// For this we have to use jquery, because bootstrap modals depend on them. Also the bs.modal
@@ -481,8 +480,8 @@ function IFM(params) {
title: self.i18n.options,
content: function() {
// see https://github.com/twbs/bootstrap/issues/12571
var ihatethisfuckingpopoverworkaround = $('#editoroptions').data('bs.popover');
ihatethisfuckingpopoverworkaround.$tip.find( '.popover-content' ).empty();
// var ihatethisfuckingpopoverworkaround = $('#editoroptions').data('bs.popover');
// $(ihatethisfuckingpopoverworkaround.tip).find( '.popover-body' ).empty();
var aceSession = self.editor.getSession();
var content = self.getNodesFromString(
@@ -521,7 +520,8 @@ function IFM(params) {
self.editor.getSession().setMode( e.target.value );
});
});
return content;
return $(content);
}
});

File diff suppressed because one or more lines are too long

View File

@@ -125,3 +125,22 @@ table.dataTable thead th.sorting_desc:after {
max-height: 80vh;
overflow: auto;
}
@media (min-width: 576px) {
.modal-dialog {
max-width: 600px;
margin: 1.75rem auto;
}
}
@media (min-width: 992px) {
.modal-lg, .modal-xl {
max-width: 800px;
}
}
label {
display: inline-block;
margin-bottom: .5rem;
font-weight: 700;
}

View File

@@ -8,7 +8,7 @@
<label>{{i18n.method}}</label><br>
<input type="radio" name="arMethod" value="GET">GET</input><input type="radio" name="arMethod" value="POST" checked="checked">POST</input><br>
<button type="button" class="btn btn-success" id="buttonRequest">{{i18n.request}}</button>
<button type="button" class="btn btn-default" id="buttonClose">{{i18n.cancel}}</button><br>
<button type="button" class="btn btn-secondary" id="buttonClose">{{i18n.cancel}}</button><br>
<label>{{i18n.response}}</label><br>
<textarea class="form-control" id="ajaxresponse"></textarea>
</fieldset>

View File

@@ -5,9 +5,9 @@
<div id="copyMoveTree"><div class="text-center"><span class="icon icon-spin5 animate-spin"></span></div></div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" id="copyButton">{{i18n.copy}}</button>
<button type="button" class="btn btn-default" id="moveButton">{{i18n.move}}</button>
<button type="button" class="btn btn-default" id="cancelButton">{{i18n.cancel}}</button>
<button type="button" class="btn btn-secondary" id="copyButton">{{i18n.copy}}</button>
<button type="button" class="btn btn-secondary" id="moveButton">{{i18n.move}}</button>
<button type="button" class="btn btn-secondary" id="cancelButton">{{i18n.cancel}}</button>
</div>
</fieldset>
</form>

View File

@@ -6,7 +6,7 @@
</fieldset>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" id="buttonSave">{{i18n.save}}</button>
<button type="button" class="btn btn-default" id="buttonCancel">{{i18n.cancel}}</button>
<button type="button" class="btn btn-secondary" id="buttonSave">{{i18n.save}}</button>
<button type="button" class="btn btn-secondary" id="buttonCancel">{{i18n.cancel}}</button>
</div>
</form>

View File

@@ -6,7 +6,7 @@
</fieldset>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" id="buttonSave">{{i18n.save}}</button>
<button type="button" class="btn btn-default" id="buttonCancel">{{i18n.cancel}}</button>
<button type="button" class="btn btn-secondary" id="buttonSave">{{i18n.save}}</button>
<button type="button" class="btn btn-secondary" id="buttonCancel">{{i18n.cancel}}</button>
</div>
</form>

View File

@@ -9,6 +9,6 @@
</div>
<div class="modal-footer">
<button type="button" class="btn btn-danger" id="buttonYes">{{i18n.delete}}</button>
<button type="button" class="btn btn-default" id="buttonNo">{{i18n.cancel}}</button>
<button type="button" class="btn btn-secondary" id="buttonNo">{{i18n.cancel}}</button>
</div>
</form>

View File

@@ -17,7 +17,7 @@
</fieldset>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" id="buttonExtract">{{i18n.extract}}</button>
<button type="button" class="btn btn-default" id="buttonCancel">{{i18n.cancel}}</button>
<button type="button" class="btn btn-secondary" id="buttonExtract">{{i18n.extract}}</button>
<button type="button" class="btn btn-secondary" id="buttonCancel">{{i18n.cancel}}</button>
</div>
</form>

View File

@@ -4,12 +4,12 @@
<label>{{i18n.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">{{i18n.editor_options}}</button>
<button type="button" class="btn btn-secondary" id="editoroptions">{{i18n.editor_options}}</button>
</fieldset>
</div>
<div class="modal-footer">
<button type="button" id="buttonSave" class="btn btn-default">{{i18n.save}}</button>
<button type="button" id="buttonSaveNotClose" class="btn btn-default">{{i18n.save_wo_close}}</button>
<button type="button" id="buttonClose" class="btn btn-default">{{i18n.close}}</button>
<button type="button" id="buttonSave" class="btn btn-secondary">{{i18n.save}}</button>
<button type="button" id="buttonSaveNotClose" class="btn btn-secondary">{{i18n.save_wo_close}}</button>
<button type="button" id="buttonClose" class="btn btn-secondary">{{i18n.close}}</button>
</div>
</form>

View File

@@ -1,14 +1,21 @@
<input type="checkbox" id="editor-wordwrap"
{{#wordwrap}}
checked="checked"
{{/wordwrap}}
> {{i18n.word_wrap}}</input><br>
<input type="checkbox" id="editor-softtabs"
{{#softtabs}}
checked="checked"
{{/softtabs}}
> {{i18n.soft_tabs}}</input>
<div class="input-group"><span class="input-group-addon">{{i18n.tab_size}}</span><input class="form-control" type="text" size="2" id="editor-tabsize" title="{{i18n.tab_size}}" value="{{tabsize}}"></div>
<div class="form-check p-0">
<input type="checkbox" id="editor-wordwrap"
{{#wordwrap}}
checked="checked"
{{/wordwrap}}
>
<label class="form-check-label" for="editor-wordwrap">{{i18n.word_wrap}}</label>
</div>
<div class="form-check">
<input class="form-check-input" type="checkbox" id="editor-softtabs"
{{#softtabs}}
checked="checked"
{{/softtabs}}
>
<label class="form-check-label" for="editor-softtabs">{{i18n.soft_tabs}}</label>
</div>
<div class="input-group">
<div class="input-group-prepend"><span class="input-group-text">{{i18n.tab_size}}</span></div><input class="form-control" type="text" size="2" id="editor-tabsize" title="{{i18n.tab_size}}" value="{{tabsize}}"></div>
{{#ace_includes}}
<select class="form-control selectpicker" data-toggle="dropdown" data-live-search="true" data-size="15" id="editor-syntax">
{{#modes}}

View File

@@ -10,7 +10,7 @@
</fieldset>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" id="buttonUpload">{{i18n.upload}}</button>
<button type="button" class="btn btn-default" id="buttonCancel">{{i18n.cancel}}</button>
<button type="button" class="btn btn-secondary" id="buttonUpload">{{i18n.upload}}</button>
<button type="button" class="btn btn-secondary" id="buttonCancel">{{i18n.cancel}}</button>
</div>
</form>

View File

@@ -6,7 +6,7 @@
</fieldset>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" id="buttonRename">{{i18n.file_rename}}</button>
<button type="button" class="btn btn-default" id="buttonCancel">{{i18n.cancel}} </button>
<button type="button" class="btn btn-secondary" id="buttonRename">{{i18n.file_rename}}</button>
<button type="button" class="btn btn-secondary" id="buttonCancel">{{i18n.cancel}} </button>
</div>
</form>

View File

@@ -2,13 +2,13 @@
<div class="modal-body">
<fieldset>
<label>{{i18n.upload_file}}</label><br>
<input class="file" type="file" name="files" multiple><br>
<input class="form-control-file" type="file" name="files" multiple><br>
<label>{{i18n.filename_new}}</label>
<input class="form-control" type="text" name="newfilename"><br>
</fieldset>
</div>
<div class="modal-footer">
<button class="btn btn-default" id="buttonUpload">{{i18n.upload}}</button>
<button class="btn btn-default" id="buttonCancel">{{i18n.cancel}}</button>
<button class="btn btn-secondary" id="buttonUpload">{{i18n.upload}}</button>
<button class="btn btn-secondary" id="buttonCancel">{{i18n.cancel}}</button>
</div>
</form>