Skip to content

Commit 9a5101f

Browse files
committed
Fix several UX/design bugs and comment out Absolidix/XRPD buttons
1 parent 3059b01 commit 9a5101f

5 files changed

Lines changed: 46 additions & 20 deletions

File tree

src_js/main_logic.js

Lines changed: 32 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ function re_view_request(search_type){
203203

204204
wmgui.search_type = search_type;
205205
wmgui.search.search_type = search_type;
206-
request_search(wmgui.search, pseudo_input.join(" "), true);
206+
request_search(wmgui.search, pseudo_input.join(" ").replaceAll(",", " "), true);
207207
}
208208

209209
function request_search(search, caption, without_history){
@@ -529,15 +529,24 @@ function switch_control_mode(mode, next_mode, active_abf, active_cde){ // NB (0,
529529
function build_cells(json, header, footer){
530530
var cls_map = {7: 'ml_data', 8: 'ab_data', 9: 'ab_data', 10: 'ab_data', 11: 'ab_data', 13: 'deactivated'},
531531
result_html = '';
532+
532533
if (header) result_html += header;
533534

534535
if (wmgui.search_type == 2){
535536
if (json[0].length != 6){ wmgui.notify('Rendering error, please try to <a href=javascript:location.reload()>reload</a>'); return ''; }
536537

538+
var act_link = '';
539+
537540
$.each(json, function(k, row){
541+
542+
act_link = '<a class="launch_id" href="#article/' + row[0] + '">Show</a>';
543+
538544
row[0] = parseInt(row[0]);
539-
if (row[0] == 999999) row[4] = wmgui.mockyear; // special *ref_id*, only handled in GUI
540-
result_html += '<tr id="e__B' + row[0] + '" class="tcell" data-type="B"><td class=c55>[<a class="resolve_ref' + ((wmgui.bid_history.indexOf(row[0]) > -1) ? ' visited' : '') + '" href="' + wmgui.refs_endpoint + '?ref_id=' + row[0] + '&sid=' + wmgui.sid + '&ed=' + wmgui.edition + '" rel="' + row[0] + '" target="_blank" rel="noopener noreferrer">' + row[0] + '</a>]</td><td class=a1>' + row[1] + '</td><td class=a2 title="' + row[2] + '">' + row[2] + '</td><td class=a5>' + row[5] + '</td><td class=c4>' + row[4] + '</td><td class=a6><a class="launch_id" href="#article/' + row[0] + '">Show</a></td></tr>';
545+
if (row[0] == 999999){
546+
row[4] = wmgui.mockyear; // special *ref_id*, only handled in GUI
547+
act_link = '&nbsp;';
548+
}
549+
result_html += '<tr id="e__B' + row[0] + '" class="tcell" data-type="B"><td class=c55>[<a class="resolve_ref' + ((wmgui.bid_history.indexOf(row[0]) > -1) ? ' visited' : '') + '" href="' + wmgui.refs_endpoint + '?ref_id=' + row[0] + '&sid=' + wmgui.sid + '&ed=' + wmgui.edition + '" rel="' + row[0] + '" target="_blank" rel="noopener noreferrer">' + row[0] + '</a>]</td><td class=a1>' + row[1] + '</td><td class=a2 title="' + row[2] + '">' + row[2] + '</td><td class=a5>' + row[5] + '</td><td class=c4>' + row[4] + '</td><td class=a6>' + act_link + '</td></tr>';
541550
});
542551
} else if (wmgui.search_type == 1){
543552
if (json[0].length != 5){ wmgui.notify('Rendering error, please try to <a href=javascript:location.reload()>reload</a>'); return ''; }
@@ -572,14 +581,24 @@ function build_thumbs(json){
572581
json.sort(function(a, b){
573582
return a[4] > b[4] ? 1 : a[4] < b[4] ? -1 : 0; // pubyear
574583
});
584+
575585
var title_html = '',
576-
full_display = !!wmgui.sid;
586+
full_display = !!wmgui.sid,
587+
act_link = '';
588+
577589
$.each(json, function(k, row){
590+
591+
act_link = '<a class="launch_id" href="#article/' + row[0] + '">Show entries</a>';
592+
578593
row[0] = parseInt(row[0]);
579-
if (row[0] == 999999) row[4] = wmgui.mockyear; // special *ref_id*, only handled in GUI
594+
if (row[0] == 999999){
595+
row[4] = wmgui.mockyear; // special *ref_id*, only handled in GUI
596+
act_link = 'Too many to show...';
597+
}
580598
if (full_display) title_html = (row[1].length > 60 ? row[1].substr(0, 60) + '&hellip;' : row[1]) + ', <span>' + (row[2].length > 80 ? row[2].substr(0, 80) + '&hellip;' : row[2]) + '</span>';
581599
else title_html = '<br /><br />&#x1f4d6;'; // book icon
582-
result_html += '<div class="gallery_item" id="e__B' + row[0] + '" data-type="B"><div class="gallery_img"><div class="articled">' + title_html + '</div></div><div class="gallery_label"><a class="launch_id" href="#article/' + row[0] + '">Show entries</a><br />[<a class="resolve_ref' + ((wmgui.bid_history.indexOf(row[0]) > -1) ? ' visited' : '') + '" href="' + wmgui.refs_endpoint + '?ref_id=' + row[0] + '&sid=' + wmgui.sid + '&ed=' + wmgui.edition + '" rel="' + row[0] + '" target="_blank" rel="noopener noreferrer">' + row[3] + '&rsquo;' + row[4].toString().substr(2, 2) + '</a>]</div></div>';
600+
601+
result_html += '<div class="gallery_item" id="e__B' + row[0] + '" data-type="B"><div class="gallery_img"><div class="articled">' + title_html + '</div></div><div class="gallery_label">' + act_link + '<br />[<a class="resolve_ref' + ((wmgui.bid_history.indexOf(row[0]) > -1) ? ' visited' : '') + '" href="' + wmgui.refs_endpoint + '?ref_id=' + row[0] + '&sid=' + wmgui.sid + '&ed=' + wmgui.edition + '" rel="' + row[0] + '" target="_blank" rel="noopener noreferrer">' + row[3] + '&rsquo;' + row[4].toString().substr(2, 2) + '</a>]</div></div>';
583602
});
584603
} else if (wmgui.search_type == 1){
585604
if (json[0].length != 5){ wmgui.notify('Rendering error, please try to <a href=javascript:location.reload()>reload</a>'); return ''; }
@@ -1557,12 +1576,15 @@ function show_dunit_info(phid, bid, entry){
15571576
}).done(function(data){
15581577
if (data.error) return wmgui.notify(data.error);
15591578

1560-
var mp_data = '';
1561-
if (data.out.mpid) mp_data = '<h4 style="background:#ddd;margin-top:-7px;">Materials Project <a target="_blank" href="https://materialsproject.org/materials/mp-' + data.out.mpid + '">mp-' + data.out.mpid + '</a></h4>';
1579+
var html = '<h4>' + data.out.formula_html.split(' ')[0] + ' ' + (data.out.spg || '?') + ' ' + (data.out.pearson || '&mdash;') + '</h4>';
1580+
1581+
if (data.out.mpid) html += '<h4 style="background:#ddd;margin-top:-7px;">Materials Project <a target="_blank" href="https://materialsproject.org/materials/mp-' + data.out.mpid + '">mp-' + data.out.mpid + '</a></h4>';
15621582

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

15681590
}).fail(function(xhr, textStatus, errorThrown){
@@ -1593,7 +1615,7 @@ function show_dunit_info(phid, bid, entry){
15931615
});
15941616
links_html = links_html.substr(0, links_html.length - 4); // " or "
15951617
if (citation[0].indexOf(',') !== -1) main_author += ' et al.';
1596-
citation_html += ' <a href="' + wmgui.refs_endpoint + '?fmt=bib&ref_id=' + bid + '&sid=' + wmgui.sid + '">' + main_author + ', ' + citation[1] + '. <i>' + citation[2] + '</i> <b>(' + citation[3] + ')</b></a>';
1618+
citation_html += ' <a href="' + wmgui.refs_endpoint + '?fmt=bib&ref_id=' + bid + '&sid=' + wmgui.sid + '">' + main_author + ', ' + citation[1] + '. ' + citation[2] + ' <i>(' + citation[3] + ')</i></a>';
15971619
}
15981620

15991621
if (bid == 999999){

src_js/markup.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ function register_html(){
5555
<thead><tr>
5656
<th class="p1">Phase</th>
5757
<th class="p2">Space group num.</th>
58-
<th class="p3">Exp. entries</th>
58+
<th class="p3">Entries</th>
5959
<th class="p4">Publications</th>
6060
<th class="p5"></th>
6161
</tr></thead>
@@ -310,7 +310,7 @@ function register_html(){
310310
<div id="phases_ctx">
311311
<div class="col_title">Distinct phases</div>
312312
<br />
313-
&nbsp;<input type="checkbox" id="ctx_strict_phases_trigger" checked />&nbsp;<label for="ctx_strict_phases_trigger">other elements and impurities</label>
313+
<div style="text-align:center;"><input type="checkbox" id="ctx_strict_phases_trigger" checked />&nbsp;<label for="ctx_strict_phases_trigger">include admixed phases</label></div>
314314
<!-- br />
315315
&nbsp;<input type="checkbox" id="ctx_subphases_trigger" />&nbsp;<label for="ctx_subphases_trigger">constituent phases</label -->
316316
<span>See the <a target="_blank" href="https://github.com/mpds-io/mpds-distinct-phases">public dumps</a> of the distinct phases appeared at least once in the literature.</span>
@@ -345,7 +345,7 @@ function register_html(){
345345
<ul>
346346
<li id="visualize" class="wmbutton">Visualize</li>
347347
<li id="xrpdize" class="wmbutton">Show XRPD</li>
348-
<li id="absolidize" class="wmbutton"><span class="active">Simulate</span><span class="disabled">Added to <span class="href">my data</span>.</span></li>
348+
<!-- li id="absolidize" class="wmbutton"><span class="active">Simulate</span><span class="disabled">Added to <span class="href">my data</span>.</span></li -->
349349
<li id="download_pdf" class="d_icon"><a rel="pdf" href="#" target="_blank" title="Get HTML / PDF document" rel="nofollow"></a></li>
350350
<li id="download_json" class="d_icon"><a rel="json" href="#" target="_blank" title="Get machine-readable JSON file" rel="nofollow"></a></li>
351351
<li id="download_png" class="d_icon"><a rel="png" href="#" target="_blank" title="Get PNG raster image" rel="nofollow"></a></li>
@@ -684,7 +684,7 @@ function register_html(){
684684
<li rev="usr_tab_perms">data access</li>
685685
<li rev="usr_tab_api_key" class="only_regular">API key</li>
686686
<!-- li rev="usr_tab_clmns">entries table</li -->
687-
<li rev="usr_tab_absolidix" class="only_regular only_mpds">my data</li>
687+
<!-- li rev="usr_tab_absolidix" class="only_regular only_mpds">my data</li -->
688688
<li rev="usr_tab_ctrl" style="display:none;" class="admin">management</li>
689689
</ul>
690690

src_js/router.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,8 @@ function url__entry(arg){
124124
request_search({'entry': arg}, 'entry ' + arg, true);
125125
wmgui.search = {}; // mockup to reset previous properties
126126
wmgui.passive_sim_col = true;
127-
//$('#search_field-selectized').val('');
128-
//wmgui.multiselects['main'].clear();
127+
$('#search_field-selectized').val('');
128+
wmgui.multiselects['main'].clear();
129129
show_interpretation();
130130
}
131131

@@ -134,8 +134,10 @@ function url__entry(arg){
134134
*/
135135
function url__phase_id(arg){
136136
wmgui.search_type = 0;
137-
//$('#search_field-selectized').val('');
138-
//wmgui.multiselects['main'].clear();
137+
if (!wmgui.ptable.visible){
138+
$('#search_field-selectized').val('');
139+
wmgui.multiselects['main'].clear();
140+
}
139141
show_interpretation();
140142
var phid = parseInt(arg);
141143
wmgui.search = {'phid': phid};
@@ -176,6 +178,8 @@ function url__phase(arg){
176178
*/
177179
function url__article(arg){
178180
wmgui.search_type = 0;
181+
$('#search_field-selectized').val('');
182+
wmgui.multiselects['main'].clear();
179183
show_interpretation();
180184
var bentry = parseInt(arg);
181185
wmgui.search = {'bid': bentry};

src_js/wmsettings.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ wmgui.editions = {
201201
}
202202
},
203203
15: {
204-
'name': 'Ermac on Ab Solidix',
204+
'name': 'Ermac on Absolidix',
205205
'prod_url': 'https://ermac.absolidix.com',
206206
'dev_url': 'http://localhost:5560',
207207
'actions': function(){

webassets/ermac.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ th.a5.header, th.a5.headerSortUp, th.a5.headerSortDown{background-position:80% c
182182
td.a5{font-size:0.9em;letter-spacing:-1px;font-style:italic;}
183183

184184
div.context_msg{display:none;width:70%;margin:0 auto;padding-top:10px;color:#555;font-size:1.25em;text-align:center;}
185-
#toomuch{margin-bottom:40px;}
185+
#toomuch{margin-bottom:50px;}
186186
#loadscroll{margin-bottom:100px;}
187187
#plthint{margin:0 auto 120px;}
188188
#plthint > span{display:block;width:100%;margin-bottom:45px;font-size:1.15em;}

0 commit comments

Comments
 (0)