From 57be1b67dbe8960ae9013d9e1358d3c90d656333 Mon Sep 17 00:00:00 2001 From: John Campbell Date: Thu, 12 Apr 2018 17:04:02 -0400 Subject: [PATCH] fix for folder with spaces, and changing .bind to .on in jQuery --- index.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/index.php b/index.php index 1f6a4a1..57324a1 100644 --- a/index.php +++ b/index.php @@ -274,7 +274,7 @@ $(function(){ var XSRF = (document.cookie.match('(^|; )_sfm_xsrf=([^;]*)')||0)[2]; var MAX_UPLOAD_SIZE = ; var $tbody = $('#list'); - $(window).bind('hashchange',list).trigger('hashchange'); + $(window).on('hashchange',list).trigger('hashchange'); $('#table').tablesorter(); $('#table').on('click','.delete',function(data) { @@ -296,13 +296,13 @@ $(function(){ }); // file upload stuff - $('#file_drop_target').bind('dragover',function(){ + $('#file_drop_target').on('dragover',function(){ $(this).addClass('drag_over'); return false; - }).bind('dragend',function(){ + }).on('dragend',function(){ $(this).removeClass('drag_over'); return false; - }).bind('drop',function(e){ + }).on('drop',function(e){ e.preventDefault(); var files = e.originalEvent.dataTransfer.files; $.each(files,function(k,file) { @@ -363,7 +363,8 @@ $(function(){ function list() { var hashval = window.location.hash.substr(1); - $.get('?',{'do':'list','file':hashval},function(data) { + console.log(hashval); + $.get('?do=list&file='+ hashval,function(data) { $tbody.empty(); $('#breadcrumb').empty().html(renderBreadcrumbs(hashval)); if(data.success) { @@ -406,8 +407,9 @@ $(function(){ $html = $('
').append( $('Home
') ); $.each(path.split('/'),function(k,v){ if(v) { + var v_as_text = decodeURIComponent(v); $html.append( $('').text(' ▸ ') ) - .append( $('').attr('href','#'+base+v).text(v) ); + .append( $('').attr('href','#'+base+v).text(v_as_text) ); base += v + '/'; } });