Skip to content

Commit

Permalink
Add minor tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
blokhin committed May 29, 2024
1 parent f159dee commit 2b0e1c1
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 18 deletions.
2 changes: 2 additions & 0 deletions src_js/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -809,6 +809,7 @@ function register_events(){
}).fail(function(xhr, textStatus, errorThrown){
if (textStatus != 'abort')
wmgui.notify('Your session ended: please, <span class="href relogin">log in again</span>');
$('#usr_api_key').html('authentication error');
});

} else if (desttab == 'usr_tab_perms'){
Expand All @@ -830,6 +831,7 @@ function register_events(){
}).fail(function(xhr, textStatus, errorThrown){
if (textStatus != 'abort')
wmgui.notify('Your session ended: please, <span class="href relogin">log in again</span>');
$('#perms_view').html('authentication error');
});

} else if (desttab == 'usr_tab_ctrl'){ // redirect to an external app
Expand Down
20 changes: 13 additions & 7 deletions src_js/main_logic.js
Original file line number Diff line number Diff line change
Expand Up @@ -293,13 +293,13 @@ function request_search(search, caption, without_history){
} else {
if (data.estimated_count > wmgui.quick_page_size + wmgui.fetch_page_size){
$('#toomuch span').html('nearly ' + (data.estimated_count - wmgui.quick_page_size)).parent().show();
show_hints(search.entry);
show_hints(search.entry, data.estimated_count);

} else if (data.estimated_count > wmgui.quick_page_size){
$('#loadscroll').show();
wmgui.unfinished_page = true;

} else show_hints(search.entry);
} else show_hints(search.entry, data.estimated_count);
}

// switchers
Expand Down Expand Up @@ -414,6 +414,9 @@ function show_examples(box, more_examples, fix_rfn_header){
wmgui.cliff_counter += 1;
if (wmgui.cliff_counter > wmgui.cliffhangers.length-1) wmgui.cliff_counter = 0;
html += '<li><a href="#search/' + wmutils.termify_formulae(wmgui.cliffhangers[wmgui.cliff_counter]) + '">' + wmgui.cliffhangers[wmgui.cliff_counter].charAt(0).toUpperCase() + wmgui.cliffhangers[wmgui.cliff_counter].slice(1) + '</a></li>';

var legend = wmgui.get_interesting()['text'];
html += '<li><a href="#search/' + escape(legend) + '">' + legend.charAt(0).toUpperCase() + legend.slice(1).replace(/\d/g, "&#x208$&;") + '</a></li>';
}
$(box + ' > ul').empty().append(html);
$(box).show();
Expand Down Expand Up @@ -908,13 +911,16 @@ function open_sim_col(entry, entype, rank){
$('#sim_legend').addClass('apparent').html('<br /><a href="#entry/' + entry.split('-')[0] + '"><img alt="C-entry" src="' + wmgui.static_host + '/pd_thumbs/' + entry.split('-')[0] + '.png" /><br /><span>Full phase diagram</span></a>' + html_3d);

} else if (entype == 'C' && rank == 5)
$('#sim_legend').addClass('apparent').text('No links to other phases found');
$('#sim_legend').addClass('apparent').text('No links to other phases found.');

else if (entype == 'C' && rank == 12)
$('#sim_legend').addClass('apparent').text('Hover the binary or ternary diagrams for more data.');

else if (entype == 'S')
$('#sim_legend').addClass('apparent').text('No other structures for this prototype found');
$('#sim_legend').addClass('apparent').text('No other structures for this prototype found.');

else
$('#sim_legend').addClass('apparent').text('No similar values found');
$('#sim_legend').addClass('apparent').text('No similar values found.');
}

if (data.out.own.length && !wmgui.search.phid)
Expand Down Expand Up @@ -1210,7 +1216,7 @@ function show_advsbox(){
}
}

function show_hints(disabled){
function show_hints(disabled, res_count){

//$('#fdwidget').html('Were you satisfied with the data quality? Did everything work as expected? <span id="fdwidget_yes">Yes</span><span id="fdwidget_no">No</span>').show();

Expand All @@ -1225,7 +1231,7 @@ function show_hints(disabled){
var hint = JSON.stringify(cur_obj).replaceAll(' ', '+').replace('\{', '\\{').replace('\}', '\\}');
$('#apihint span').html(hint).parent().show();

if (wmgui.search.search_type === 0){
if (wmgui.search.search_type === 0 && (res_count > 3 || res_count === undefined)){
$('a.plthint_links').each(function(){
var that = $(this),
plot_type = that.attr('rev');
Expand Down
9 changes: 6 additions & 3 deletions src_js/markup.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,9 @@ function register_html(){
<div id="results"><table id="databrowser"></table></div>
<div id="loadscroll" class="context_msg">Getting the rest of data...</div>
<div id="toomuch" class="context_msg">There are <span></span> results not shown &mdash; please, refine the search or use the MPDS API.</div>
<div id="toomuch" class="context_msg">There are <span></span> results not shown &mdash; please, refine the search &mdash; or use the API.</div>
<div id="plthint" class="context_msg">
<span>Try to visualize these entire results as:</span>
<div id="plt_pie"><a class="plthint_links" title="Plot pie charts (overview)" rel="nofollow" href="/" rev="pie"></a></div>
<div id="plt_lit"><a class="plthint_links" title="Plot bar charts (literature)" rel="nofollow" href="/" rev="lit"></a></div>
<div id="plt_discovery"><a class="plthint_links" title="Search for patterns (PCA)" rel="nofollow" href="/" rev="discovery"></a></div>
Expand Down Expand Up @@ -341,7 +342,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="absolidize" class="wmbutton"><span class="active">Simulate</span><span class="disabled">Added to <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>
<li id="download_png" class="d_icon"><a rel="png" href="#" target="_blank" title="Get PNG raster image" rel="nofollow"></a></li>
Expand All @@ -351,6 +352,8 @@ function register_html(){
<li id="download_bib" class="d_icon"><a rel="bib" href="#" target="_blank" title="Get original citation" rel="nofollow"></a></li>
<li id="download_raw" class="d_icon"><a rel="raw" href="#" target="_blank" title="Get raw calculation data" rel="nofollow"></a></li>
</ul>
<br /><br />
</div>
<!-- LEFT INDIVIDUAL ID COLUMN -->
Expand Down Expand Up @@ -529,7 +532,7 @@ function register_html(){
<div class="advs advs_classes" style="margin-bottom:3vmin;">
<div class="advs_capt">Materials class</div>
<select id="advs_fct_classes" autocomplete="false"></select><!-- multiselect autocomplete -->
<div class="advs_legend" data-multiselects="classes"><i>e.g.</i> <a href="#" tabindex="-1">hydride, nonmetal</a> or <a href="#" tabindex="-1">machine learning</a></div>
<div class="advs_legend" data-multiselects="classes"><i>e.g.</i> <a href="#" tabindex="-1">hydride, nonmetal</a> or <a href="#" tabindex="-1">olivine, ternary</a></div>
</div>
</div>
Expand Down
8 changes: 4 additions & 4 deletions src_js/wmsettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ wmgui.notify_counter = null;
wmgui.cliff_counter = null;
wmgui.sid = null;
wmgui.oauths = null;
wmgui.prod = true; // (window.location.host.indexOf('localhost') == -1);
wmgui.prod = (window.location.host.indexOf('localhost') === -1);
wmgui.darkmode = null;

wmgui.cliffhangers = [
Expand Down Expand Up @@ -153,8 +153,8 @@ wmgui.engines_addrs = {
'visavis': '/visavis/?nobanner'
},
'b': {
'cifplayer': 'webassets/iframe_cifplayer.html',
'visavis': 'webassets/iframe_visavis.html'
'cifplayer': '/ermac/webassets/iframe_cifplayer.html',
'visavis': '/ermac/webassets/iframe_visavis.html'
}
}

Expand Down Expand Up @@ -390,7 +390,7 @@ 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>'},
//'hierarchy': {el: 'advsearch_init_trigger', oleft: -50, otop: 60, view_mode: 1, text: 'Use the <i>&mu;</i> button to select physical properties from the curated hierarchy.<br /><span rel="userbox">Next</span>'},
'userbox': {el: 'userbox', oleft: -105, otop: 60, view_mode: 1, text: 'Enjoy full data access<br />with your account here.<br /><span rel="close_tooltip">OK</span>'},
'userbox': {el: 'userbox', oleft: -105, otop: 60, view_mode: 1, text: 'Check your full access<br />with your account here.<br /><span rel="close_tooltip">OK</span>'},
'interpretation': {el: 'right_col', oleft: -70, otop: 99, view_mode: 2, text: 'The entries are grouped in the phases.<br /><span rel="databrowser">Next</span>'},
'databrowser': {el: 'databrowser', oleft: 0, otop: 200, view_mode: 2, text: 'Click the particular entry to get more info. Opened lock means open access.<br /><span rel="close_tooltip">OK</span>'},
//'plots': {el: 'databrowser', oleft: 0, otop: 500, view_mode: 2, text: 'Use the graph chart buttons in the footer (at the very bottom of the page).<br /><span rel="close_tooltip">OK</span>'},
Expand Down
9 changes: 5 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 2b0e1c1

Please sign in to comment.