diff --git a/jupyter-openbis-extension/static/dialog.js b/jupyter-openbis-extension/static/dialog.js index 7429cd811b2b704aaeaec324b49132587fa30dd7..8c999c89682dff741940e0bba896a84448ff209f 100644 --- a/jupyter-openbis-extension/static/dialog.js +++ b/jupyter-openbis-extension/static/dialog.js @@ -598,7 +598,7 @@ define([ var uploadDatasetsToOpenBis = { help: 'upload Notebook and Data to openBIS', - icon: 'fa-cloud-upload', + icon: 'fa-upload', help_index: '', handler: function (env) { conn_table = document.createElement("DIV") @@ -752,10 +752,63 @@ define([ } } + var configureOpenBisConnections = { + help: 'configure openBIS connections', + icon: 'fa-sliders', + help_index: '', + handler: function (env) { + conn_table = document.createElement("DIV") + var dst_title = document.createElement("STRONG") + dst_title.textContent = "DataSet type" + var dataset_types = document.createElement("SELECT") + dataset_types.id = "dataset_type" + dataset_types.className = "form-control select-xs" + + var input_fields = document.createElement("DIV") + conn_table.id = "openbis_connections" + + var onclick_cbf = function() { + currentConnection = this.value + getDatasetTypes(env, this.value, dataset_types, input_fields) + } + + getOpenBisConnections(env) + .done(function (data) { + show_available_connections(env, data, conn_table, onclick_cbf) + }) + .fail(function (data) { + alert(data.status) + }) + + var uploadDialogBox = $('<div/>').append(conn_table) + + // get the canvas for user feedback + var container = $('#notebook-container') + + function onOk () { + + } + + dialog.modal({ + body: uploadDialogBox, + title: 'Choose openBIS connection', + buttons: { + 'Cancel': {}, + 'Choose connection': { + class: 'btn-primary btn-large', + click: onOk + } + }, + notebook: env.notebook, + keyboard_manager: env.notebook.keyboard_manager + }) + } + } + function _onLoad () { // show connections - var download_datasets = IPython.keyboard_manager.actions.register( - OpenBisConnections, 'openbis-connections', 'jupyter-openBIS') + var configure_openbis_connections = IPython.keyboard_manager.actions.register( + configureOpenBisConnections, 'openbis-connections', 'jupyter-openBIS') // dnownload var download_datasets = IPython.keyboard_manager.actions.register( @@ -766,7 +819,7 @@ define([ uploadDatasetsToOpenBis, 'openbis-dataset-upload', 'jupyter-openBIS') // add button for new action - IPython.toolbar.add_buttons_group([download_datasets, upload_datasets]) + IPython.toolbar.add_buttons_group([configure_openbis_connections, download_datasets, upload_datasets]) } return {load_ipython_extension: _onLoad}