Skip to content

Commit

Permalink
Remove old engines, polish styles and fmt vis
Browse files Browse the repository at this point in the history
  • Loading branch information
blokhin committed Jul 30, 2024
1 parent 225f22a commit ddc857d
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 53 deletions.
17 changes: 1 addition & 16 deletions src_js/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -484,14 +484,6 @@ function register_events(){
$('#inquirybox').hide();
});

$('#close_tr_dialogue').click(function(){
var value = $("input[name=engines]:checked").val();
wmgui.engines = (value == 'a') ? value : 'b';
window.localStorage.setItem(wmgui.store_engines_key, wmgui.engines);
if (wmgui.visavis_working) start_visavis(wmgui.visavis_curtype);
$('#engines_box, #overlay').hide();
});

$('#close_ss_dialogue').click(function(){
var x_sort = $('#ss_x > ul > li.ss_x').attr('rel').split('_')[1],
y_sort = $('#ss_y > ul > li.ss_y').attr('rel').split('_')[1],
Expand Down Expand Up @@ -1253,10 +1245,6 @@ function register_events(){
document.getElementById('visavis_iframe').contentWindow.cmp_discard(wmgui.visavis_curtype);
return;
}
else if (value == 'Z'){
window.location.href = '/labs/multi-cmp';
return;
}

if (['matrix', 'cube', 'discovery'].indexOf(wmgui.visavis_curtype) == -1)
return;
Expand Down Expand Up @@ -1300,9 +1288,6 @@ function register_events(){
}
that.remove();
});
$('#toggle_engines').click(function(){
$('#engines_box, #overlay').show();
});
$('#ss_gear_matrix, #ss_gear_cube').click(function(){
var domain = $(this).attr('id').substr(8); // ss_gear_
if (domain == 'matrix'){
Expand Down Expand Up @@ -1516,7 +1501,7 @@ function register_events(){
// cross-site comms
window.addEventListener('message', function(message){
//if (message.origin === 'https://trusted.com') {
var received;
var received = {};
try {
received = JSON.parse(message.data);
} catch (ignore){}
Expand Down
18 changes: 10 additions & 8 deletions src_js/main_logic.js
Original file line number Diff line number Diff line change
Expand Up @@ -954,14 +954,17 @@ function launch_db_iframed(rank){

if (entype == 'S'){
if (rank == 99){
iframe_src = wmgui.engines_addrs[wmgui.engines]['visavis'] + wmgui.path_s_xrpd + entry, iframe_height = 550;
iframe_src = wmgui.engines_addrs['visavis'] + wmgui.path_s_xrpd + entry, iframe_height = 550;

} else
iframe_src = wmgui.engines_addrs[wmgui.engines]['cifplayer'] + wmgui.path_s_entry + entry, iframe_height = 650;
iframe_src = wmgui.engines_addrs['cifplayer'] + wmgui.path_s_entry + entry, iframe_height = 650;

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

else if (rank == 9)
iframe_src = wmgui.v_pd_user_addr + wmgui.api_host + '/download/p?fmt=png&q=' + entry, iframe_height = 600;

else if (rank == 10)
iframe_src = wmgui.v_ab_vis_addr + entry, iframe_height = 600;
Expand All @@ -974,7 +977,7 @@ function launch_db_iframed(rank){
iframe_src = wmgui.v_pd_3d_addr + triple, iframe_height = 550;

} else if (rank == 6)
iframe_src = (wmgui.sid ? wmgui.v_pd_user_addr : wmgui.engines_addrs[wmgui.engines]['visavis'] + wmgui.path_c_entry) + entry, iframe_height = 600;
iframe_src = (wmgui.sid ? wmgui.v_pd_user_addr + wmgui.api_host + '/download/c?fmt=png&q=' : wmgui.engines_addrs['visavis'] + wmgui.path_c_entry) + entry, iframe_height = 600;

else return;

Expand Down Expand Up @@ -1117,11 +1120,11 @@ function stop_visavis(){

function get_visavis_url(request, type, height){
if (wmgui.visavis_curtype == 'pie' && !type)
return wmgui.engines_addrs[wmgui.engines]['visavis'] + '#' + wmgui.rfn_endpoint + '?q=' + escape(JSON.stringify(request));
return wmgui.engines_addrs['visavis'] + '#' + wmgui.rfn_endpoint + '?q=' + escape(JSON.stringify(request));

var height_str = height ? ('&visavis_height=' + height) : '';

return wmgui.engines_addrs[wmgui.engines]['visavis'] + '#' + wmgui.vis_endpoint + '/' + (type || wmgui.visavis_curtype) + '?q=' + escape(JSON.stringify(request)) + height_str;
return wmgui.engines_addrs['visavis'] + '#' + wmgui.vis_endpoint + '/' + (type || wmgui.visavis_curtype) + '?q=' + escape(JSON.stringify(request)) + height_str;
}

function describe_perms(perms){
Expand Down Expand Up @@ -1471,7 +1474,6 @@ function update_dc(){
count++;
});
cmp_html += '<option value="Y">No comparison</option>';
if (wmgui.engines == 'a') cmp_html += '<option value="Z">Multiple comparison</option>';
$('#select_cmp_trigger').empty().append(cmp_html);
}

Expand Down
11 changes: 1 addition & 10 deletions src_js/markup.js
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ function register_html(){
<!-- RIGHT MAIN COLUMN -->
<div id="right_col" class="side_cols">
<div class="col_title">View <div id="toggle_engines" class="gear"></div></div>
<div class="col_title">View</div>
<div class="controlswitch">
<div id="control_a">entries</div><div id="control_b">phases</div><div id="control_f">articles</div>
Expand Down Expand Up @@ -817,15 +817,6 @@ function register_html(){
<div id="sops_z" class="sops_col"><ul><li>none</li><li>sum</li><li>diff</li><li>product</li><li>ratio</li><li>max</li><li>min</li></ul></div>
</div>
<!-- RENDERING SETTINGS MODAL -->
<div id="engines_box" class="modal user_dialogue">
<div id="close_tr_dialogue" class="cross"></div>
<div style="clear:both;width:100%;"></div>
<h3>Plotting and visualization engines</h3>
<input type="radio" name="engines" id="engines_a" value="a" style="height:16px;width:16px;" checked /><label for="engines_a"> use old</label>&nbsp;
<input type="radio" name="engines" id="engines_b" value="b" style="height:16px;width:16px;" /><label for="engines_b"> use new experimental</label>
</div>
<!-- HELP BOXES -->
<div id="tooltip" class="modal"><div></div></div>
Expand Down
4 changes: 0 additions & 4 deletions src_js/startup.js
Original file line number Diff line number Diff line change
Expand Up @@ -378,10 +378,6 @@ function satisfy_requirements(){
wmgui._selectize_display(wmgui.multiselects['main'], facet, term);
}

wmgui.engines = window.localStorage.getItem(wmgui.store_engines_key) || 'a';
$('#engines_a').prop('checked', wmgui.engines == 'a');
$('#engines_b').prop('checked', wmgui.engines == 'b');

wmgui.darkmode = new Darkmode({saveInCookies: false});
document.getElementById('darkmode_trigger').innerHTML = wmgui.darkmode.isActivated() ? 'enabled' : 'disabled';

Expand Down
16 changes: 5 additions & 11 deletions src_js/wmsettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,19 +146,14 @@ 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.engines = 'a'; // a or b
wmgui.engines_addrs = {
'a': {
'cifplayer': '/crystvis/player.html',
'visavis': '/visavis/?nobanner'
},
'b': {
'cifplayer': '/ermac/webassets/iframe_cifplayer.html',
'visavis': '/ermac/webassets/iframe_visavis.html'
}
//'cifplayer': '/ermac/webassets/iframe_cifplayer.html',
'cifplayer': '/ermac/webassets/iframe_cifplayer.html',
//'visavis': '/ermac/webassets/iframe_visavis.html'
'visavis': '/ermac/webassets/iframe_visavis.html'
}

wmgui.v_pd_user_addr = wmgui.static_host + '/pd_stub.html#' + wmgui.api_host + '/download/c?fmt=png&q=';
wmgui.v_pd_user_addr = wmgui.static_host + '/pd_stub.html#';
wmgui.v_ab_vis_addr = wmgui.static_host + '/labs/view-phonons/#' + wmgui.api_host + '/download/p?fmt=json&q=';
wmgui.v_pd_3d_addr = 'labs/pd3d/?';

Expand Down Expand Up @@ -385,7 +380,6 @@ wmgui.store_mydata_key = 'absolidix_v1';
wmgui.store_oauth_email_key = 'wm_u_email';
wmgui.store_comm_exec_key = 'wm_reload_v1';
wmgui.store_redir_key = 'wm_redir_v1';
wmgui.store_engines_key = 'wm_engines_v0';

wmgui.tooltips = {
//'advsearch': {el: 'advsearch_init_trigger', oleft: -90, otop: 60, view_mode: 1, text: 'Use the &#9776; button for the detailed search by 15+ categories.<br /><span rel="userbox">Next</span>'},
Expand Down
7 changes: 3 additions & 4 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 ddc857d

Please sign in to comment.