1
0
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:
Marco Dickert
2017-07-24 15:01:11 +02:00
parent e73067f223
commit 191faa4678
3 changed files with 6 additions and 6 deletions

View File

@@ -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 } );
};

View File

@@ -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 } );
};

View File

@@ -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 } );
};