Files
pgadmin4/web/pgadmin/misc/file_manager/static/js/file_manager.js
T

50 lines
1.3 KiB
JavaScript

/////////////////////////////////////////////////////////////
//
// pgAdmin 4 - PostgreSQL Tools
//
// Copyright (C) 2013 - 2019, The pgAdmin Development Team
// This software is released under the PostgreSQL Licence
//
//////////////////////////////////////////////////////////////
import './select_dialogue';
import './create_dialogue';
define('misc.file_manager', [
'sources/gettext', 'sources/url_for', 'jquery', 'underscore',
'sources/pgadmin', 'pgadmin.alertifyjs',
], function(gettext, url_for, $, _, pgAdmin, Alertify) {
pgAdmin = pgAdmin || window.pgAdmin || {};
/*
*
*
* Hmm... this module is already been initialized, we can refer to the old
* object from here.
*/
if (pgAdmin.FileManager) {
return pgAdmin.FileManager;
}
pgAdmin.FileManager = {
init: function() {
if (this.initialized) {
return;
}
this.initialized = true;
},
// Call dialogs subject to dialog_type param
show_dialog: function(params) {
if (params.dialog_type == 'create_file') {
Alertify.createModeDlg(params).resizeTo(pgAdmin.Browser.stdW.md,pgAdmin.Browser.stdH.lg);
} else {
Alertify.fileSelectionDlg(params).resizeTo(pgAdmin.Browser.stdW.md,pgAdmin.Browser.stdH.lg);
}
},
};
return pgAdmin.FileManager;
});