Fixed duplication of open files when reloading, Added goto function, Started new Market functions, Fixed file Icons

This commit is contained in:
xevidos 2019-10-19 16:32:23 -04:00
parent 5af37cbce3
commit c8c971b509
7 changed files with 69 additions and 12 deletions

View file

@ -115,6 +115,16 @@ class Active extends Common {
public function Add() {
global $sql;
<<<<<<< HEAD
$query = "SELECT focused FROM active WHERE path=? AND user=? LIMIT 1;";
$bind_variables = array( $this->path, $_SESSION["user_id"] );
$result = $sql->query( $query, $bind_variables, array() );
if( count( $result ) == 0 ) {
=======
$query = "UPDATE active SET focused=false WHERE user=? AND path=?;";
$bind_variables = array( $_SESSION["user_id"], $this->path );
$result = $sql->query( $query, $bind_variables, 0, "rowCount" );
@ -122,6 +132,7 @@ class Active extends Common {
if( $result == 0 ) {
global $sql;
>>>>>>> 5af37cbce3326f97b4d3ff7eb50e88feb1fc8063
$query = "INSERT INTO active( user, path, focused ) VALUES ( ?, ?, ? );";
$bind_variables = array( $_SESSION["user_id"], $this->path, false );
$result = $sql->query( $query, $bind_variables, 0, "rowCount" );
@ -175,8 +186,8 @@ class Active extends Common {
public function MarkFileAsFocused() {
global $sql;
$query = "UPDATE active SET focused=? WHERE user=?;UPDATE active SET focused=? WHERE path=? AND user=?;";
$bind_variables = array( false, $_SESSION["user_id"], true, $this->path, $_SESSION["user_id"] );
$query = "UPDATE active SET focused=? WHERE path=? AND user=?;";
$bind_variables = array( true, $this->path, $_SESSION["user_id"] );
$return = $sql->query( $query, $bind_variables, 0, "rowCount" );
if( $return > 0 ) {

View file

@ -362,6 +362,9 @@
session.listThumb = listThumb;
$( '#list-active-files' ).append( listThumb );
/* If the tab list would overflow with the new tab. Move the
* first tab to dropdown, then add a new tab. */
if( this.isTabListOverflowed( true ) ) {
@ -375,7 +378,10 @@
this.updateTabDropdownVisibility();
$.get( this.controller + '?action=add&path=' + encodeURIComponent( path ) );
$.get( this.controller + '?action=add&path=' + encodeURIComponent( path ), function( data ) {
//console.log( data );
});
if( focus ) {
this.focus( path );

View file

@ -23,7 +23,11 @@ checkSession();
?>
<label><?php i18n("Goto Line:"); ?></label>
<<<<<<< HEAD
<input name="goto_line" type="number" autofocus="autofocus" autocomplete="off">
=======
<input name="goto_line" autofocus="autofocus" autocomplete="off">
>>>>>>> 5af37cbce3326f97b4d3ff7eb50e88feb1fc8063
<button class="btn-left" onclick="codiad.editor.goto_line();return false;"><?php i18n("Goto"); ?></button>
<button class="btn-right" onclick="codiad.modal.unload(); return false;"><?php i18n("Cancel"); ?></button>
<?php

View file

@ -1329,6 +1329,28 @@
i.commands.addCommand( m );
});
<<<<<<< HEAD
},
open_goto: function() {
if( this.getActive() ) {
codiad.modal.load( 400, 'components/editor/dialog.php?action=line' );
codiad.modal.hideOverlay();
} else {
codiad.message.error( 'No Open Files' );
}
},
goto_line: function() {
let line = $( '#modal input[name="goto_line"]' ).val();
this.gotoLine( line );
codiad.modal.unload();
=======
>>>>>>> 5af37cbce3326f97b4d3ff7eb50e88feb1fc8063
},
//////////////////////////////////////////////////////////////////

View file

@ -520,7 +520,7 @@
if( files[index].type == 'file' ) {
let ext = ' ext-' + name.split( '.' ).pop();
ext = 'ext-' + name.split( '.' ).pop();
} else {
link.droppable({
@ -544,7 +544,8 @@
span.addClass( nodeClass );
link.addClass( files[index].type + ext );
link.addClass( files[index].type );
link.addClass( ext );
link.attr( "data-type", files[index].type );
link.attr( "data-path", files[index].name );
link.text( name );
@ -569,8 +570,6 @@
node.removeClass( 'loading' );
console.log( "rescanChildren", _this.rescanChildren )
if( rescan && _this.rescanChildren.length > _this.rescanCounter ) {
_this.rescan( _this.rescanChildren[_this.rescanCounter++] );
@ -691,7 +690,6 @@
let path = drag_path;
let newPath = `${drop_path}/` + path.split( "/" ).pop();
console.log( path, newPath );
_this.rename( path, newPath );
},
@ -968,11 +966,9 @@
parent.pop();
newParent.pop();
console.log( parent.join( '/' ) );
console.log( newParent.join( '/' ) );
codiad.filemanager.rescan( parent.join( '/' ) );
codiad.filemanager.rescan( newParent.join( '/' ) );
/* Notify listeners. */
amplify.publish( 'filemanager.onRename', {
path: path,
@ -1071,7 +1067,6 @@
};
$.post( this.controller + '?action=modify&path=' + encodeURIComponent( path ), post, function( resp ) {
console.log( resp );
resp = $.parseJSON( resp );
if( resp.status == 'success' ) {
if( messages === true ) {

View file

@ -52,6 +52,20 @@
}
},
{
<<<<<<< HEAD
name: 'Goto Line',
bindKey: {
win: 'Ctrl-L',
mac: 'Command-L'
},
exec: function( e ) {
codiad.editor.open_goto();
}
},
{
=======
>>>>>>> 5af37cbce3326f97b4d3ff7eb50e88feb1fc8063
name: 'Move Down',
bindKey: {
win: 'Ctrl-down',

View file

@ -18,8 +18,13 @@
controller: 'components/market/controller.php',
dialog: 'components/market/dialog.php',
plugins: [],
themes: [],
init: function() {},
get_all: function() {},
get_installed_plugins: function() {},
get_installed_themes: function() {},