Skip to content

Commit

Permalink
Introduce XRPD patterns support
Browse files Browse the repository at this point in the history
  • Loading branch information
blokhin committed Jun 29, 2023
1 parent f8ffa87 commit ec7ea86
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src_js/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ function register_events(){
return true;
});

$('#visualize').click(function(){
$('#visualize, #xrpdize').click(function(){
if (!close_vibox()) launch_iframed_app(this.getAttribute('data-rank'));
});

Expand Down
19 changes: 12 additions & 7 deletions src_js/main_logic.js
Original file line number Diff line number Diff line change
Expand Up @@ -764,7 +764,8 @@ function open_context(el, launch_ext){

$('#ctx_col').show();
$('#visualize').attr('data-rank', rank);
$('#visualize, #absolidize, div.spinoff_pane, li.d_icon').hide();
$('#xrpdize').attr('data-rank', 99);
$('#visualize, #xrpdize, #absolidize, div.spinoff_pane, li.d_icon').hide();

open_sim_col(entry, entype, rank);

Expand All @@ -784,7 +785,7 @@ function open_context(el, launch_ext){
$('#download_bib, #download_json, #visualize').show();

} else if (rank == 5){
$('#download_bib, #download_pdf, #visualize, #absolidize, #download_cif, #download_inp, #download_json').show();
$('#download_bib, #download_pdf, #visualize, #xrpdize, #absolidize, #download_cif, #download_inp, #download_json').show();

} else if (rank == 6){
$('#download_bib, #download_pdf, #visualize, #download_png, #download_cdr, #download_json').show();
Expand Down Expand Up @@ -944,17 +945,21 @@ function launch_iframed_app(rank){
iframe_src,
iframe_height;

if (entype == 'S')
iframe_src = wmgui.v_player_addr + entry, iframe_height = 650;
if (entype == 'S'){
if (rank == 99) {
iframe_src = wmgui.v_xrpd_addr + entry, iframe_height = 600;

else if (entype == 'P'){
} else
iframe_src = wmgui.v_player_addr + entry, iframe_height = 650;

} else if (entype == 'P'){
if (rank == 10)
iframe_src = wmgui.v_ab_vis_addr + entry, iframe_height = 600;
else
iframe_src = wmgui.v_sd_addr + entry, iframe_height = 550;

} else {
if (rank == 12) {
if (rank == 12){
var triple = wmgui.thumbed_display ? $('div.busy_entry > div.gallery_img > p').text() : $('tr.busy_entry > td.c1').text().split(' ')[0];
iframe_src = wmgui.v_pd_3d_addr + triple, iframe_height = 550;

Expand Down Expand Up @@ -1437,7 +1442,7 @@ function show_dunit_info(phid, entry){
if (data.error) return wmgui.notify(data.error);

var html = '<h4>' + data.out.formula_html.split(' ')[0] + ' ' + (data.out.spg || '?') + ' ' + (data.out.pearson || '&mdash;') + '</h4><p>This phase was reported in ' + data.out.articles_count + ' article' + (data.out.articles_count > 1 ? 's' : '') + '.';
if (data.out.sim_count > 1) html += ' There are <a href="#interlinkage/' + phid + '">' + data.out.sim_count + ' structurally similar phases</a> reported elsewhere.';
if (data.out.sim_count > 1) html += ' There are <a href="#interlinkage/' + phid + '">' + data.out.sim_count + ' structurally similar phases</a> from other articles.';
html += '</p>'
$('#phase_info').html(html);

Expand Down
1 change: 1 addition & 0 deletions src_js/markup.js
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,7 @@ function register_html(){
<ul>
<li id="visualize" class="wmbutton">Visualize</li>
<li id="xrpdize" class="wmbutton">Get XRPD</li>
<li id="absolidize" class="wmbutton"><span class="active">Simulate</span><span class="disabled"><i>&#x2714;</i> in <span class="href">my data</span></span></li>
<li id="download_pdf" class="d_icon"><a rel="pdf" href="#" target="_blank" title="Get HTML / PDF document" rel="nofollow"></a></li>
<li id="download_json" class="d_icon"><a rel="json" href="#" target="_blank" title="Get machine-readable JSON file" rel="nofollow"></a></li>
Expand Down
7 changes: 4 additions & 3 deletions src_js/wmsettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,10 @@ wmgui.mydata_addr = wmgui.prod ? 'https://absolidix.com' : 'http://localho
wmgui.v_player_addr_tpl = '/crystvis/player.html';
wmgui.v_player_addr = wmgui.v_player_addr_tpl + '#' + wmgui.api_host + '/download/s?fmt=cif&q=';
wmgui.v_pd_addr = wmgui.static_host + '/pd_stub.html#' + wmgui.api_host + '/download/c?fmt=png&q=';
wmgui.v_pd_addr_anon = wmgui.static_host + '/visavis/?241022#' + wmgui.api_host + '/download/c?fmt=json&q=';
wmgui.v_sd_addr = wmgui.static_host + '/visavis/?241022#' + wmgui.api_host + '/download/p?fmt=json&q=';
wmgui.v_vis_addr = wmgui.static_host + '/visavis/?nobanner&241022';
wmgui.v_pd_addr_anon = wmgui.static_host + '/visavis/?290623#' + wmgui.api_host + '/download/c?fmt=json&q=';
wmgui.v_sd_addr = wmgui.static_host + '/visavis/?290623#' + wmgui.api_host + '/download/p?fmt=json&q=';
wmgui.v_xrpd_addr = wmgui.static_host + '/visavis/?290623#' + wmgui.api_host + '/download/s?fmt=xrpd&q=';
wmgui.v_vis_addr = wmgui.static_host + '/visavis/?nobanner&290623';
wmgui.v_ab_vis_addr = wmgui.static_host + '/labs/view-phonons/#' + wmgui.api_host + '/download/p?fmt=json&q=';
wmgui.v_pd_3d_addr = wmgui.static_host + '/labs/pd3d/?';

Expand Down
6 changes: 4 additions & 2 deletions webassets/ermac.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ec7ea86

Please sign in to comment.