mirror of
https://github.com/misterunknown/ifm.git
synced 2025-08-10 18:14:00 +02:00
fix correct encoding/decoding of folder urls in the browser history
This commit is contained in:
@@ -966,7 +966,7 @@ function IFM( params ) {
|
||||
self.currentDir = data.realpath;
|
||||
self.refreshFileTable();
|
||||
$( "#currentDir" ).val( self.currentDir );
|
||||
if( config.pushState ) history.pushState( { dir: self.currentDir }, self.currentDir, "#"+self.currentDir );
|
||||
if( config.pushState ) history.pushState( { dir: self.currentDir }, self.currentDir, "#"+encodeURIComponent( self.currentDir ) );
|
||||
},
|
||||
error: function() { self.showMessage( "General error occured: No or broken response", "e" ); }
|
||||
});
|
||||
@@ -1772,7 +1772,7 @@ function IFM( params ) {
|
||||
*/
|
||||
this.historyPopstateHandler = function(event) {
|
||||
var dir = "";
|
||||
if( event.state && event.state.dir ) dir = event.state.dir;
|
||||
if( event.state && event.state.dir ) dir = decodeURIComponent( event.state.dir );
|
||||
self.changeDirectory( dir, { pushState: false, absolute: true } );
|
||||
};
|
||||
|
||||
|
4
ifm.php
4
ifm.php
@@ -966,7 +966,7 @@ function IFM( params ) {
|
||||
self.currentDir = data.realpath;
|
||||
self.refreshFileTable();
|
||||
$( "#currentDir" ).val( self.currentDir );
|
||||
if( config.pushState ) history.pushState( { dir: self.currentDir }, self.currentDir, "#"+self.currentDir );
|
||||
if( config.pushState ) history.pushState( { dir: self.currentDir }, self.currentDir, "#"+encodeURIComponent( self.currentDir ) );
|
||||
},
|
||||
error: function() { self.showMessage( "General error occured: No or broken response", "e" ); }
|
||||
});
|
||||
@@ -1772,7 +1772,7 @@ function IFM( params ) {
|
||||
*/
|
||||
this.historyPopstateHandler = function(event) {
|
||||
var dir = "";
|
||||
if( event.state && event.state.dir ) dir = event.state.dir;
|
||||
if( event.state && event.state.dir ) dir = decodeURIComponent( event.state.dir );
|
||||
self.changeDirectory( dir, { pushState: false, absolute: true } );
|
||||
};
|
||||
|
||||
|
@@ -228,7 +228,7 @@ function IFM( params ) {
|
||||
self.currentDir = data.realpath;
|
||||
self.refreshFileTable();
|
||||
$( "#currentDir" ).val( self.currentDir );
|
||||
if( config.pushState ) history.pushState( { dir: self.currentDir }, self.currentDir, "#"+self.currentDir );
|
||||
if( config.pushState ) history.pushState( { dir: self.currentDir }, self.currentDir, "#"+encodeURIComponent( self.currentDir ) );
|
||||
},
|
||||
error: function() { self.showMessage( "General error occured: No or broken response", "e" ); }
|
||||
});
|
||||
@@ -1034,7 +1034,7 @@ function IFM( params ) {
|
||||
*/
|
||||
this.historyPopstateHandler = function(event) {
|
||||
var dir = "";
|
||||
if( event.state && event.state.dir ) dir = event.state.dir;
|
||||
if( event.state && event.state.dir ) dir = decodeURIComponent( event.state.dir );
|
||||
self.changeDirectory( dir, { pushState: false, absolute: true } );
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user