diff --git a/ermac.min.js b/ermac.min.js index 305166a..0822881 100644 --- a/ermac.min.js +++ b/ermac.min.js @@ -321,7 +321,7 @@ wmgui.multiselects[c].clear(),a={},a[c]=b,wmgui.multiselects[c].write(a)):a.pare "graph",window.innerHeight-50));$("div.gallery_item.active").removeClass("active");a.parent().addClass("active")}else b=a.attr("data-path")||"phase_id",window.location.hash="#"+b+"/"+a.attr("rel")});$("#databrowser").on("mousedown","a.resolve_ref",function(a){a=$(this).attr("rel");$("a.resolve_ref[rel="+a+"]").addClass("visited");wmgui.bid_history.push(parseInt(a));window.localStorage.setItem(wmgui.store_bids_key,JSON.stringify(wmgui.bid_history));return!0});$("#databrowser").on("click","tr.tcell, div.gallery_item", function(){open_context($(this),!1)});$("#databrowser").on("click","span.launch_v",function(a){wmgui.cancel_event(a);a=$(this).parent().parent();a.removeClass("busy_entry");open_context(a,!0)});$("#databrowser").on("click","a.launch_id",function(a){wmgui.cancel_event(a);a=$(this).attr("href");window.location.hash==a&&(a+=".");window.location.hash=a;return!1});$("#all_polyhedra_content").on("click","div.gallery_item",function(){$("#advstab_options li").removeClass("working");$("#advstab_options li[rev=advstab_cry]").addClass("working"); $("div.advstab").hide();$("#advstab_cry").show();$("div.modal").hide();$("#advsbox, #overlay").show();var a=$(this).attr("rel");-1==(wmgui.multiselects.aetypes.read().aetypes||"").split(", ").indexOf(a)&&wmgui.multiselects.aetypes.write({aetypes:a});show_aetmap(a)});$("#aet_limit").click(function(a){var b=(wmgui.multiselects.classes.read().classes||"").split(", ");if(this.checked){var c=(wmgui.multiselects.aetypes.read().aetypes||"").split(", ").filter(function(f){return f});c=wmgui.poly_limits[c.length]; -if(!c)return wmgui.cancel_event(a),wmgui.notify("Sorry, only up to 3 supported"),!1;-1==b.indexOf(c)&&wmgui.multiselects.classes.write({classes:c})}else{var d=Object.values(wmgui.poly_limits);wmgui.multiselects.classes.clear();wmgui.multiselects.classes.write({classes:b.filter(function(f){return-1==d.indexOf(f)}).join(", ")})}return!0});$("#visualize, #xrpdize").click(function(){close_vibox()||launch_iframed_app(this.getAttribute("data-rank"))});$("#absolidize").click(function(){if(!$(this).hasClass("wmbutton"))return!1; +if(!c)return wmgui.cancel_event(a),wmgui.notify("Sorry, only up to 3 supported"),!1;-1==b.indexOf(c)&&wmgui.multiselects.classes.write({classes:c})}else{var d=Object.values(wmgui.poly_limits);wmgui.multiselects.classes.clear();wmgui.multiselects.classes.write({classes:b.filter(function(f){return-1==d.indexOf(f)}).join(", ")})}return!0});$("#visualize, #xrpdize").click(function(){close_vibox();launch_iframed_app(this.getAttribute("data-rank"))});$("#absolidize").click(function(){if(!$(this).hasClass("wmbutton"))return!1; if(!wmgui.sid)return window.localStorage.setItem(window.store_redir_key,"/"+window.location.hash),window.location.replace("#modal/login");var a=$("#entryno > a").text();try{wmgui.active_ajax.abort()}catch(b){}$.ajax({type:"GET",url:wmgui.mydata_endpoint,data:{q:a,sid:wmgui.sid},beforeSend:wmgui.show_preloader}).always(wmgui.hide_preloader).done(function(b){if(b.error)return wmgui.notify(b.error);wmgui.mydata_history.push(a);window.localStorage.setItem(wmgui.store_mydata_key,JSON.stringify(wmgui.mydata_history)); $("#absolidize").removeClass("wmbutton")}).fail(function(b,c,d){"abort"!=c&&wmgui.notify('Please, make sure your access works
and try again')})});$("#refine_col").on("click","a.extd_refine",function(){var a=$(this).attr("rel");if($("#refine_col > ul > li.extd_rfns.fct_"+a).length)return $("#refine_col > ul > li:not(.fct_"+a+")").addClass("hidden_rfns").slideUp(),$("#refine_col > ul > li.extd_rfns.fct_"+a).show(),$("a.extd_refine[rel="+a+"]").parent().hide(),!1;var b= {extd_refine:a};$.extend(b,wmgui.search);try{wmgui.active_ajax.abort()}catch(c){}wmgui.active_ajax=$.ajax({type:"GET",url:wmgui.rfn_endpoint,data:{q:JSON.stringify(b)}}).done(function(c){if(c.error)return wmgui.notify(c.error);var d="";delete b.numeric;delete b.extd_refine;var f=!1;$.each(wmgui.inquiries,function(e,h){if(b[h])return f=!0,!1});$.each(c.payload,function(e,h){var r="",k={};$.each(b,function(l,g){if("search_type"==l||"elements"==a&&("elements"==l||"formulae"==l)||"props"==a&&"props"== @@ -449,7 +449,7 @@ b="ALL"==f.refs?b+"
  • full access to reference details
  • ":"MENTIONED"==f.ref !1;$.each(wmgui.facets,function(g,c){if(f[c])try{e+='
  • '+wmgui.facet_names[c]+": "+f[c].map(function(h){return h.replace(", "," & ")}).join(", ")+"
  • "}catch(h){return!1}});e+='

  • '})):e+="
  • only open data
  • ";return b+'
    '+e+""} function show_advsbox(){$("div.modal").hide();$("#advsbox, #overlay").show();$.isEmptyObject(wmgui.search)||($.each(wmgui.simple_facets,function(a,b){wmgui.search[b]?(a=wmgui.search[b],"codens"==b?a=wmgui.journal_converter.c2j(a):"doi"==b&&(a=a.replaceAll("%2F","/")),$("#advs_fct_"+b).val(unescape(a.replace(/\+/g,"%20")))):$("#advs_fct_"+b).val("")}),$.each(wmgui.multi_facets,function(a,b){$("#advs_fct_"+b+"-selectized").val("");wmgui.multiselects[b].clear();wmgui.search[b]&&(a={},a[b]=wmgui.search[b], wmgui.multiselects[b].write(a),"aetypes"==b&&show_aetmap(wmgui.search[b].split(",").pop().trim()))}));show_advsbox.cached_aetmap||(show_advsbox.cached_aetmap=new Image,show_advsbox.cached_aetmap.src=wmgui.aetmap_addr)} -function show_hints(a){a||wmgui.search.numeric||wmgui.search.doi||wmgui.search.phid||wmgui.fuzzyout||2==wmgui.search_type||(a={},$.extend(a,wmgui.search),delete a.ignored,delete a.search_type,a=JSON.stringify(a).replaceAll(" ","+").replace("{","\\{").replace("}","\\}"),$("#apihint span").html(a).parent().show(),wmgui.search.search_type||($("a.plthint_links").each(function(){var b=$(this),e=b.attr("rev");b.attr("href",wmgui.gui_host+window.location.pathname+"#plot/"+e+"/"+window.location.hash.substr(1))}), +function show_hints(a){a||wmgui.search.numeric||wmgui.search.doi||wmgui.search.phid||wmgui.search.bid||wmgui.fuzzyout||2==wmgui.search_type||(a={},$.extend(a,wmgui.search),delete a.ignored,delete a.search_type,a=JSON.stringify(a).replaceAll(" ","+").replace("{","\\{").replace("}","\\}"),$("#apihint span").html(a).parent().show(),0===wmgui.search.search_type&&($("a.plthint_links").each(function(){var b=$(this),e=b.attr("rev");b.attr("href",wmgui.gui_host+window.location.pathname+"#plot/"+e+"/"+window.location.hash.substr(1))}), $("#plthint").show()))}function show_tooltip(a,b){if(!(a.view_mode!=wmgui.view_mode||wmgui.visavis_working&&!b||$("div.modal").is(":visible"))){b=$("#"+a.el).position();var e=document.getElementById("tooltip");e.style.left=b.left+a.oleft+"px";e.style.top=b.top+a.otop+"px";e.firstChild.innerHTML=a.text;document.getElementById("tooltip").style.display="block"}} function show_modal(a){if("login"==a){if($("#factor_by_email").val()?$("#login_email").val($("#factor_by_email").val()):$("#login_email").val(""),$("#login_password").val(""),$("#loginbox").show(),$("#login_email").focus(),a=window.localStorage.getItem(wmgui.store_oauth_email_key)||!1)$("#login_email").val(a),window.localStorage.removeItem(wmgui.store_oauth_email_key)}else"factor"==a?($("#login_email").val()?$("#factor_by_email").val($("#login_email").val()):$("#factor_by_email").val(""),$("#factorbox").show(), $("#factor_by_email").focus()):"restore"==a&&($("#login_email").val()?$("#restore_by_email").val($("#login_email").val()):$("#restore_by_email").val(""),$("#restorebox").show(),$("#restore_by_email").focus())}function init_user_login(){var a=JSON.parse(window.localStorage.getItem(wmgui.store_user_key)||"{}");a.sid!==wmgui.sid&&a.sid&&a.name&&a.acclogin&&user_login(a.sid,a.name,a.acclogin,a.admin,a.oauths,a.ipbased)} @@ -468,8 +468,8 @@ function render_all_polyhedra(){if($("#all_polyhedra_content").is(":empty")){var function show_dunit_info(a,b,e){a?($("#ind_title").html("Phase "+a),$("#ind_link").attr("href","https://mpds.io/phase_id/"+a).html("www.mpds.io/phase_id/"+a)):b?($("#ind_title").html("Publication B"+b),$("#ind_link").attr("href","https://mpds.io/article/"+b).html("www.mpds.io/article/"+b)):e&&($("#ind_title").html("Entry "+e),$("#ind_link").attr("href","https://mpds.io/entry/"+e).html("www.mpds.io/entry/"+e));$("#refine_col, #ctx_col").hide();$("#phase_info, #ind_col > span").empty();a?($("#ind_col > span").html(''),wmgui.active_ajax=$.ajax({type:"GET",url:wmgui.phase_endpoint,data:{phid:a}}).done(function(d){if(d.error)return wmgui.notify(d.error);var f="

    "+d.out.formula_html.split(" ")[0]+" "+(d.out.spg||"?")+" "+(d.out.pearson||"—")+"

    This phase was reported in "+d.out.articles_count+" article"+(1'+d.out.sim_count+" structurally similar phases from other articles."); f+="

    ";$("#phase_info").html(f)}).fail(function(d,f,g){"abort"!=f&&wmgui.notify("Sorry, a network error occured. Please, try again")})):b?($("#ind_col > span").html("📖"),$("#phase_info").html("

    Ref. "+b+'

    Please make sure you are
    logged in to see all the details.

    '),wmgui.active_ajax=$.ajax({type:"GET",url:wmgui.refs_endpoint+"?noredir=1&fmt=bib&ref_id="+b+"&sid="+wmgui.sid}).done(function(d){var f=wmgui.parse_bib(d), -g=d="",c="";f[0].length&&(f[0].split(",").forEach(function(h,l){h=h.trim().split(".")[0];h=h.substr(0,h.length-2).replace("'","");0===l&&(g=h);c+=''+h+" or "}),c=c.substr(0,c.length-4),-1!==f[0].indexOf(",")&&(g+=" et al."),d+=''+g+", "+f[1]+". "+f[2]+" ("+f[3]+")");999999==b?$("#phase_info").html("

    In-house data

    These data were generated automatically on the MPDS platform based on the original peer-reviewed Pauling File data. Please cite as "+ -d+".

    "):(f=wmgui.thumbed_display?$("div.gallery_item").length:$("tr.tcell").length,$("#phase_info").html("

    Ref. "+b+"

    We have "+(1==f?"one entry":f+" entries")+" from this reference "+d+".

    In addition, search all data co-authored by "+c+".

    "))}).fail(function(d,f,g){})):$("#ind_col > span").html("🔬");$("#ind_col").show();$("#dtypes").hide()} +g=d="",c="";f[0].length&&(f[0].split(",").forEach(function(h,l){h=h.trim().split(".")[0];h=h.substr(0,h.length-2).replace("'","");0===l&&(g=h);c+=''+h+" or "}),c=c.substr(0,c.length-4),-1!==f[0].indexOf(",")&&(g+=" et al."),d+=' '+g+", "+f[1]+". "+f[2]+" ("+f[3]+")");999999==b?$("#phase_info").html("

    In-house data

    These data were generated automatically on the MPDS platform based on the original peer-reviewed Pauling File data. Please cite as "+ +d+".

    "):(f=wmgui.thumbed_display?$("div.gallery_item").length:$("tr.tcell").length,1E3==f&&(f="more than "+f),$("#phase_info").html("

    Ref. "+b+"

    We have "+(1==f?"one entry":f+" entries")+" from this reference"+d+".

    "+(c.length?"

    In addition, search all data co-authored by "+c+".

    ":"")))}).fail(function(d,f,g){})):$("#ind_col > span").html("🔬");$("#ind_col").show();$("#dtypes").hide()} function assign_edition(){function a(b){b=parseInt(b);wmgui.editions[b]||(b=0);wmgui.edition=b;wmgui.editions[b].css&&wmgui.loadCSS(wmgui.editions[b].css);wmgui.editions[b].actions&&wmgui.editions[b].actions()}$.each(wmgui.editions,function(b,e){if(wmgui.gui_host==e.prod_url||wmgui.gui_host==e.dev_url)return a(b),!1});wmgui.edition||a(0)}; var wmgui=window.wmgui||{}; function satisfy_requirements(){$("#notifybox, #preloader").hide();$("#absolidize > span.disabled > span.href").attr("rel",wmgui.mydata_addr);wmgui.ptable.els_data=read_ptable_html();init_user_login();var t="";$.each(JSON.parse(window.localStorage.getItem(wmgui.store_history_key)||"[]"),function(a,h){wmgui.tooltip_counter++;if(7