diff --git a/web/pgadmin/misc/file_manager/static/css/file_manager.css b/web/pgadmin/misc/file_manager/static/css/file_manager.css index 0f188d824..ea502ac9c 100755 --- a/web/pgadmin/misc/file_manager/static/css/file_manager.css +++ b/web/pgadmin/misc/file_manager/static/css/file_manager.css @@ -24,11 +24,15 @@ float: left; text-align: left; line-height:1.9em; - text-shadow:1px 1px 0px #ffffff; + max-width: 367px; + text-overflow: ellipsis; + overflow: hidden; + color: #999; } #uploader h1 b { font-weight: normal; + color: #999; } .uploadresponse { @@ -346,6 +350,7 @@ button.list span { -moz-border-radius: 5px; float: left; margin-right: 10px; + background: #EEE; } .file_manager #uploader .btn-group .btn[disabled] { @@ -528,7 +533,9 @@ button.list span { -moz-border-radius: 3px; height: 22px; font-size: 13px; + font-weight: normal; display: inline; + width: 150px; } .allowed_file_types .change_file_types { diff --git a/web/pgadmin/misc/file_manager/templates/file_manager/js/file_manager.js b/web/pgadmin/misc/file_manager/templates/file_manager/js/file_manager.js index 7d6eb3b7f..9e8a0804c 100644 --- a/web/pgadmin/misc/file_manager/templates/file_manager/js/file_manager.js +++ b/web/pgadmin/misc/file_manager/templates/file_manager/js/file_manager.js @@ -94,6 +94,7 @@ define([ $container.find('.storage_content').remove(); $container.append("
"); renderStoragePanel(params); + this.elements.dialog.style.minWidth = '630px'; this.show(); }, settings: { @@ -203,6 +204,7 @@ define([ $container.find('.storage_content').remove(); $container.append(""); renderStoragePanel(params); + this.elements.dialog.style.minWidth = '630px'; this.show(); }, settings: { @@ -314,6 +316,7 @@ define([ $container.find('.storage_content').remove(); $container.append(""); renderStoragePanel(params); + this.elements.dialog.style.minWidth = '630px'; this.show(); }, settings: { @@ -425,6 +428,7 @@ define([ $container.find('.storage_content').remove(); $container.append(""); renderStoragePanel(params); + this.elements.dialog.style.minWidth = '630px'; this.show(); }, settings: { diff --git a/web/pgadmin/misc/file_manager/templates/file_manager/js/utility.js b/web/pgadmin/misc/file_manager/templates/file_manager/js/utility.js index 8e9c42e8d..baa71b1ff 100755 --- a/web/pgadmin/misc/file_manager/templates/file_manager/js/utility.js +++ b/web/pgadmin/misc/file_manager/templates/file_manager/js/utility.js @@ -195,7 +195,7 @@ var setUploader = function(path) { path = decodeURI(path); var display_string = path, - mypath = ''; + file_path = ''; // split path var split_path = display_string.split('/'); @@ -203,29 +203,17 @@ var setUploader = function(path) { // set empty path if it is windows if (config.options.platform_type === "win32" && config.options.show_volumes) { - mypath = ""; + file_path = ""; } else if (split_path.length === 0) { - mypath = $('/'); + file_path = '/'; } else { - mypath = $('/'); + file_path = '/'; } - $(mypath).appendTo($('.storage_dialog #uploader h1')); Object.keys(split_path).forEach(function (i) { - if (i < split_path.length - 1) { - mypath = $( - '' + split_path[i] + '/' - ); - $(mypath).appendTo($('.storage_dialog #uploader h1')); - } else { - mypath = $('' + split_path[i] + '/'); - $(mypath).appendTo( - $('.storage_dialog #uploader h1') - ); - } + file_path += split_path[i] + '/'; }); + $('.storage_dialog #uploader h1').html(file_path); $('.currentpath').val(path); if ($('.storage_dialog #uploader h1 span').length === 0) { @@ -908,28 +896,6 @@ var getFolderInfo = function(path, file_type) { } }); - $('.fileinfo #contents li p').on('dblclick',function(e) { - e.stopPropagation(); - var $this = $(this); - var orig_value = decodeURI($this.find('span').attr('title')), - newvalue = orig_value.substring(0, orig_value.indexOf('.')); - - if (newvalue === '') { - newvalue = orig_value; - } - - $this.find('input').toggle().val(newvalue).focus(); - $this.find('span').toggle(); - - // Rename folder/file on pressing enter key - $('.file_manager').unbind().on('keyup', function(e) { - if (e.keyCode == 13) { - e.stopPropagation(); - $this.find('input').trigger('blur'); - } - }); - }); - // Rename UI handling $('.fileinfo #contents li p').on('blur dblclick','input', function(e) { e.stopPropagation(); @@ -1008,30 +974,6 @@ var getFolderInfo = function(path, file_type) { } }); - $('.fileinfo table#contents tr td p').on('dblclick', function(e) { - e.stopPropagation(); - var $this = $(this), - orig_value = decodeURI( - $this.find('span').attr('title') - ); - - var newvalue = orig_value.substring(0, orig_value.lastIndexOf('.')); - if (orig_value.lastIndexOf('/') == orig_value.length - 1 || newvalue === '') { - newvalue = orig_value; - } - - $this.find('input').toggle().val(newvalue).focus(); - $this.find('span').toggle(); - - // Rename folder/file on pressing enter key - $('.file_manager').unbind().on('keyup', function(e) { - if (e.keyCode == 13) { - e.stopPropagation(); - $this.find('input').trigger('blur'); - } - }); - }); - $('.fileinfo table#contents tr td p').on( 'blur dblclick', 'input', function(e) { var old_name = decodeURI($(this).siblings('span').attr('title')), @@ -1148,11 +1090,7 @@ var getFolderInfo = function(path, file_type) { 'disabled' ); // set selected folder name in breadcrums - $('.file_manager #uploader h1').hide(); $('.file_manager #uploader .show_selected_file').remove(); - $(''+path+'').appendTo( - '.file_manager #uploader .filemanager-path-group' - ); } if ( @@ -1200,11 +1138,7 @@ var getFolderInfo = function(path, file_type) { 'disabled' ); // set selected folder name in breadcrums - $('.file_manager #uploader h1').hide(); $('.file_manager #uploader .show_selected_file').remove(); - $('' + path + '').appendTo( - '.file_manager #uploader .filemanager-path-group' - ); } if ( config.options.dialog_type == 'create_file' && diff --git a/web/pgadmin/tools/sqleditor/__init__.py b/web/pgadmin/tools/sqleditor/__init__.py index c713fb5d8..92e4b17b3 100644 --- a/web/pgadmin/tools/sqleditor/__init__.py +++ b/web/pgadmin/tools/sqleditor/__init__.py @@ -1121,16 +1121,13 @@ def load_file(): if request.data: file_data = json.loads(request.data.decode()) + file_path = unquote(file_data['file_name']) # retrieve storage directory path storage_manager_path = get_storage_directory() - if storage_manager_path is None: - storage_manager_path = "" + if storage_manager_path: + # generate full path of file + file_path = os.path.join(storage_manager_path, file_path.lstrip('/')) - # generate full path of file - file_path = os.path.join( - storage_manager_path, - unquote(file_data['file_name'].lstrip('/')) - ) file_data = None # check if file type is text or binary