Added initial uploads gui, Fixed folders not being visually marked as open when reindexing, Added click root action to close all folders

This commit is contained in:
xevidos 2020-02-07 13:01:04 -05:00
parent a4fa4261d6
commit 5958f62f8f
4 changed files with 99 additions and 7 deletions

View File

@ -1296,7 +1296,12 @@
' · ' + i18n( 'Col' ) + ': ' +
i.getCursorPosition().column
);
amplify.publish( 'editor.changeCursor', {
i: i,
row: i.getCursorPosition().row,
column: i.getCursorPosition().column,
});
//Register the changecursor function so updates continue
i.selection.on( "changeCursor", function( e ) {
@ -1307,6 +1312,12 @@
' · ' + i18n( 'Col' ) + ': ' +
i.getCursorPosition().column
);
amplify.publish( 'editor.changeCursor', {
i: i,
row: i.getCursorPosition().row,
column: i.getCursorPosition().column,
});
});
},
@ -1574,16 +1585,16 @@
codiad.modal.load(
400,
'components/editor/dialog.php?action=sort',
{},
function( c ) {
{}
)
.then( function( c ) {
let textarea = c.find( 'textarea:first' );
textarea.val( selected )
textarea.focus();
codiad.modal.hideOverlay();
}
);
});
codiad.modal.hideOverlay();
} else {

View File

@ -236,6 +236,17 @@
});
$( '.drop-overlay' ).on( 'click', _this.upload_overlay_off );
$( "#uploads-button" ).on( 'click' , _this.toggle_uploads );
$( "#uploads-close" ).on( 'click', function() {
$( ".uploads-container" ).slideUp();
});
amplify.subscribe( 'editor.changeCursor', function() {
$( "#uploads-button" ).css( "right", ( $( "#cursor-position" ).width() + 36 ) + 'px' );
});
},
archive: function( path ) {
@ -707,6 +718,7 @@
if( node.attr( 'data-type' ) == "root" ) {
node.addClass( "open" );
node.droppable({
accept: _this.node.accept,
drop: _this.node.drop,
@ -861,6 +873,7 @@
node_class = "minus";
console.log( "loading children", v.path, link, v.children, filters, callbacks, link.parent() );
link.addClass( "open" );
_this.index_nodes( v.path, link, v.children, filters, callbacks );
} else {
@ -1681,6 +1694,7 @@
node.addClass( "loading" );
let path = node.attr( "data-path" );
let type = node.attr( "data-type" );
let i = await _this.get_index( path, _this.files );
let span = node.parent().children( 'span' );
let link = node.parent().children( 'a' );
@ -1695,7 +1709,21 @@
}
}
if( i.open || open ) {
if( type == "root" ) {
console.log( node.parent().children( 'ul' ).find( ".open" ) );
node.parent().children( 'ul' ).find( ".open" ).each( function( id, n ) {
console.log( id, n );
let i = $( n );
_this.toggle_directory( i, [], [], true );
});
node.removeClass( "loading" );
return;
} else if( i.open || open ) {
node.parent().children( 'ul' )
.slideUp( 300, function() {
@ -1772,6 +1800,20 @@
console.log( path, _this.selected );
},
toggle_uploads: function() {
let b = $( "#uploads-button" );
let c = $( ".uploads-container" );
if( c.css( "display" ) == "none" ) {
c.slideDown();
} else {
c.slideUp();
}
},
unarchive: function( path ) {
let _this = this;

View File

@ -335,7 +335,18 @@ if( defined( "SITE_NAME" ) && ! ( SITE_NAME === "" || SITE_NAME === null ) ) {
<span>||</span>
</div>
</div>
<div id="cursor-position"><?php i18n("Ln"); ?>: 0 &middot; <?php i18n("Col"); ?>: 0</div>
<div>
<div class="uploads-container">
<div class="project-list-title" style="">
<h2><?php i18n( "Uploads" );?></h2>
<a id="uploads-close" class="icon-down-dir icon" alt="Collapse"></a>
</div>
</div>
</div>
<div id="uploads-button"><?php i18n("Uploads");?></div>
<div id="cursor-position">
<?php i18n("Ln"); ?>: 0 &middot; <?php i18n("Col"); ?>: 0
</div>
<div id="editor-region">
<div id="editor-top-bar">
<ul id="tab-list-active-files"></ul>

View File

@ -467,6 +467,34 @@ table [class^="icon-"], [class*=" icon-"] {
background-image: -webkit-gradient(linear,left top,left bottom,color-stop(0.29, rgb(120,120,120)),color-stop(0.77, rgb(77,77,77)));
cursor: row-resize;
}
#uploads-button {
bottom: 4px;
color: #999;
font-size: 12px;
position: absolute;
right: 100px;
z-index: 2;
}
.uploads-container {
background: #1a1a1a;
bottom: 25px;
cursor: pointer;
display: none;
height: 50%;
position: absolute;
right: 100px;
width: 250px;
z-index: 2;
}
.upload-container {}
.upload-progress {}
#cursor-position {
position: absolute;
right: 30px;