From 5958f62f8f8a3c14a071b142754fd5f397852421 Mon Sep 17 00:00:00 2001 From: xevidos Date: Fri, 7 Feb 2020 13:01:04 -0500 Subject: [PATCH] Added initial uploads gui, Fixed folders not being visually marked as open when reindexing, Added click root action to close all folders --- components/editor/init.js | 21 ++++++++++++---- components/filemanager/init.js | 44 +++++++++++++++++++++++++++++++++- index.php | 13 +++++++++- themes/default/screen.css | 28 ++++++++++++++++++++++ 4 files changed, 99 insertions(+), 7 deletions(-) diff --git a/components/editor/init.js b/components/editor/init.js index 5f8f86d..1d9fa10 100755 --- a/components/editor/init.js +++ b/components/editor/init.js @@ -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 { diff --git a/components/filemanager/init.js b/components/filemanager/init.js index b6f7cea..7b4c808 100755 --- a/components/filemanager/init.js +++ b/components/filemanager/init.js @@ -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; diff --git a/index.php b/index.php index 1b5ac03..12820f1 100755 --- a/index.php +++ b/index.php @@ -335,7 +335,18 @@ if( defined( "SITE_NAME" ) && ! ( SITE_NAME === "" || SITE_NAME === null ) ) { || -
: 0 · : 0
+
+
+
+

+ +
+
+
+
+
+ : 0 · : 0 +
    diff --git a/themes/default/screen.css b/themes/default/screen.css index 54660ae..cea075a 100755 --- a/themes/default/screen.css +++ b/themes/default/screen.css @@ -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;