Skip to content

Commit

Permalink
Polish and present P-plots
Browse files Browse the repository at this point in the history
  • Loading branch information
blokhin committed Dec 13, 2024
1 parent ce4b635 commit bbfe39a
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 6 deletions.
9 changes: 6 additions & 3 deletions src_js/main_logic.js
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,7 @@ function build_cells(json, header, footer){
$.each(json, function(k, row){
row[7] = parseInt(row[7]);
var dtype = row[0].substr(0, 1),
preview = (row[3] == 4 || row[3] == 5 || row[3] == 6 || row[3] == 9 || row[3] == 10 || row[3] == 12) ? '<span class=launch_v>Show</span>' : ' ',
preview = (row[3] == 4 || row[3] == 5 || row[3] == 6 || row[3] == 9 || row[3] == 10 || row[3] == 12) ? '<span class=launch_v>Show</span>' : ' ', // FIXME? w.r.t. open_context
biblio_html = (row[7] == 999999) ? '<td class=cj>&mdash;</td><td class=c4>' + wmgui.mockyear + '</td><td class=c5>&mdash;</td>' :
'<td class=cj>' + row[5] + '</td><td class=c4>' + row[6] + '</td><td class=c5>[<a class="resolve_ref' + ((wmgui.bid_history.indexOf(row[7]) > -1) ? ' visited' : '') + '" href="' + wmgui.refs_endpoint + '?ref_id=' + row[7] + '&sid=' + wmgui.sid + '&ed=' + wmgui.edition + '" rel="' + row[7] + '" target="_blank" rel="noopener noreferrer">' + row[7] + '</a>]</td>'; // special *ref_id*, only handled in GUI

Expand Down Expand Up @@ -777,7 +777,7 @@ function open_context(el, launch_ext){
$('#download_bib').show();

} else if (rank == 1){
$('#download_bib, #download_pdf').show();
$('#download_bib, #download_pdf, #visualize, #download_png').show();

} else if (rank == 2){
$('#download_bib, #download_pdf, #download_json').show();
Expand Down Expand Up @@ -960,7 +960,10 @@ function launch_db_iframed(rank){
iframe_src = wmgui.engines_addrs['cifplayer'] + wmgui.path_s_entry + entry, iframe_height = 650;

} else if (entype == 'P'){
if (rank == 4)
if (rank == 1)
iframe_src = wmgui.engines_addrs['visavis'] + wmgui.path_pp_plot + entry, iframe_height = 550;

else if (rank == 4)
iframe_src = wmgui.engines_addrs['visavis'] + wmgui.path_sd_plot + entry, iframe_height = 550;

else if (rank == 9)
Expand Down
2 changes: 1 addition & 1 deletion src_js/ptable.js
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ function select_ptable_el(selected_el, dom_el){
//console.log('Selected element is ' + selected_el);

if (!dom_el){
var dom_el = document.querySelector('#ptable_area > ul > li[data-pos="' + wmgui.ptable.elements.indexOf(selected_el) + '"]');
const dom_el = document.querySelector('#ptable_area > ul > li[data-pos="' + wmgui.ptable.elements.indexOf(selected_el) + '"]');
if (!dom_el) return wmgui.notify('Sorry, wrong element: ' + selected_el);
}

Expand Down
3 changes: 3 additions & 0 deletions src_js/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,9 @@ function url__junction(arg){
$('div.menu_tabs').hide();
$('#usr_tab_perms').show();
$('#perms_view').html(describe_perms(data));
setTimeout(function(){
wmgui.notify('Please, check your data access.');
}, 1500);

}).fail(function(xhr, textStatus, errorThrown){
if (textStatus != 'abort')
Expand Down
1 change: 1 addition & 0 deletions src_js/wmsettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ wmgui.path_c_entry = '#' + wmgui.api_host + '/download/c?fmt=json&q='
wmgui.path_s_entry = '#' + wmgui.api_host + '/download/s?fmt=cif&q=';
wmgui.path_s_xrpd = '#' + wmgui.api_host + '/download/s?fmt=xrpd&q=';
wmgui.path_sd_plot = '#' + wmgui.api_host + '/download/p?fmt=json&q=';
wmgui.path_pp_plot = '#https://data.mpds.io/export?fmt=json&q='; // TODO

wmgui.engines_addrs = {
'cifplayer': '/webassets/iframe_cifplayer.html',
Expand Down
2 changes: 1 addition & 1 deletion webassets/iframe_visavis.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<body>

<div id="main"></div>
<div id="switcher" title="Show interactive plot (experimental feature)"></div>
<div id="switcher" title="Switch static and dynamic view"></div>

<script type="text/javascript" src="/webassets/visavis.js"></script>
<script type="text/javascript">
Expand Down
2 changes: 1 addition & 1 deletion webassets/pd_stub.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<body>

<div id="cross" title="Close"></div>
<div id="switcher" title="Switch between static and dynamic view"></div>
<div id="switcher" title="Switch static and dynamic view"></div>

<script type="text/javascript">
if (document.location.hash.length){
Expand Down

0 comments on commit bbfe39a

Please sign in to comment.