Skip to content

Commit

Permalink
Refactor symlinks and paths, fix two bugs, get rid of unsupported IE …
Browse files Browse the repository at this point in the history
…messages
  • Loading branch information
blokhin committed Nov 24, 2024
1 parent bdf8e5d commit f8001da
Show file tree
Hide file tree
Showing 10 changed files with 46 additions and 54 deletions.
2 changes: 0 additions & 2 deletions deploy/build_js.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ ROOT=$(dirname $0)/../
JSCOMP=$ROOT/third_party/jscomp/compiler.jar
JSTARGET=$ROOT/ermac.min.js

java -jar $JSCOMP --jscomp_off checkTypes --language_in ECMASCRIPT5_STRICT --js $ROOT/src_js/browser_chk.js > $JSTARGET

cat $ROOT/src_js/third_party/jquery.min.js >> $JSTARGET

java -jar $JSCOMP --jscomp_off checkTypes --language_in ECMASCRIPT5_STRICT --js $ROOT/src_js/third_party/jquery.tablesorter.js --compilation_level WHITESPACE_ONLY >> $JSTARGET
Expand Down
1 change: 0 additions & 1 deletion ermac

This file was deleted.

1 change: 0 additions & 1 deletion example_dev.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
<script type="text/javascript">
// a very simple env loader
var to_load = [
'src_js/browser_chk.js',
'src_js/third_party/jquery.min.js',
'src_js/third_party/jquery.tablesorter.js',
'src_js/third_party/wNumb.js',
Expand Down
36 changes: 0 additions & 36 deletions src_js/browser_chk.js

This file was deleted.

6 changes: 4 additions & 2 deletions src_js/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,10 @@ function register_events(){
});

$('#close_ss_dialogue').click(function(){

$('#ss_custom_box, #overlay').hide();
$('div.ss_col > ul').empty();

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],
x_op = $('#sops_x > ul > li.sops_x').text(),
Expand Down Expand Up @@ -528,8 +532,6 @@ function register_events(){

document.getElementById('visavis_iframe').contentWindow.matrix_order(x_sort, y_sort, x_op, y_op);
}
$('#ss_custom_box, #overlay').hide();
$('div.ss_col > ul').empty();
});

$('#close_dc_dialogue').click(function(){
Expand Down
2 changes: 1 addition & 1 deletion src_js/markup.js
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ function register_html(){
<ul>
<li id="visualize" class="wmbutton">Visualize</li>
<li id="xrpdize" class="wmbutton">Get XRPD</li>
<li id="xrpdize" class="wmbutton">Show XRPD</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>
Expand Down
10 changes: 5 additions & 5 deletions src_js/wmsettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,13 +147,13 @@ 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_addrs = {
'cifplayer': '/ermac/webassets/iframe_cifplayer.html', // FIXME
'visavis': '/ermac/webassets/iframe_visavis.html' // FIXME
'cifplayer': '/webassets/iframe_cifplayer.html',
'visavis': '/webassets/iframe_visavis.html'
}

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

// remote files commonly used
wmgui.client_data_addr = wmgui.static_host + '/wmdata.json?220923';
Expand Down
9 changes: 4 additions & 5 deletions webassets/ermac.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ sup, sub{font-size:12px;}
.sky{background:#fff;}
#overlay{position:fixed;left:0;top:0;width:100%;height:100%;text-align:center;z-index:100;overflow:hidden;background:#fff;opacity:0.9;}
#visavis{display:none;z-index:50;position:fixed;top:56px;left:50%;margin-left:-36%;width:72%;height:99%;background:#fff;}
.wmbutton{cursor:pointer;user-select:none;font-size:1.3em;text-align:center;border:1px solid #999;background:#999;color:#fff;line-height:1.4em;border-radius:2px;text-decoration:none;box-shadow:inset 0 2px 2px rgba(255,255,255,0.3), inset 0 -2px 2px rgba(0,0,0,0.3), inset 0 20px 10px rgba(255,255,255,0.3), 0 0 2px 1px rgba(0,0,0,0.2), 0 2px 2px rgba(0,0,0,0.3);}
.wmbutton{cursor:pointer;user-select:none;font-size:1.25em;text-align:center;border:1px solid #999;background:#999;color:#fff;line-height:1.4em;border-radius:2px;text-decoration:none;box-shadow:inset 0 2px 2px rgba(255,255,255,0.3), inset 0 -2px 2px rgba(0,0,0,0.3), inset 0 20px 10px rgba(255,255,255,0.3), 0 0 2px 1px rgba(0,0,0,0.2), 0 2px 2px rgba(0,0,0,0.3);}
.wmbutton:hover{box-shadow:inset 0 2px 2px rgba(255,255,255,0.2), inset 0 -2px 2px rgba(0,0,0,0.2), inset 0 20px 10px rgba(255,255,255,0.2), 0 0 2px 1px rgba(0,0,0,0.2), 0 2px 2px rgba(0,0,0,0.2);}
.wmbutton:active{transform:translateY(1px);}
.wmbutton.disabled{cursor:not-allowed;box-shadow:none;background:#eee !important;border-color:#eee !important;}
Expand Down Expand Up @@ -232,13 +232,12 @@ div.col_title a{text-decoration:none;color:#000;border-bottom:1px solid #000;}
#ctx_col > ul{margin:0;padding:0;}
#ctx_col > ul > li{list-style:none;width:80px;height:96px;margin:0 auto;display:block;}
#ctx_col > ul > li > a{display:block;width:100%;height:100%;}
#visualize{width:110px !important;height:30px !important;text-align:center;line-height:30px;margin:14px auto !important;}
#xrpdize{width:110px !important;height:30px !important;text-align:center;line-height:30px;margin:14px auto !important;border:1px solid #acc2b3;background:#acc2b3;}
#absolidize{width:140px !important;height:30px !important;text-align:center;line-height:30px;margin:14px auto !important;}
#visualize{width:138px !important;height:30px !important;text-align:center;line-height:30px;margin:14px auto !important;}
#xrpdize{width:138px !important;height:30px !important;text-align:center;line-height:30px;margin:14px auto !important;border:1px solid #acc2b3;background:#acc2b3;}
#absolidize{width:138px !important;height:30px !important;text-align:center;line-height:30px;margin:14px auto !important;}
#absolidize > span.active{display:none;}
#absolidize > span.disabled{display:block;}
#absolidize > span.disabled > i{color:green;font-size:30px;}
#absolidize.wmbutton{color:#fff;border:1px solid #555;background:#555;}
#absolidize.wmbutton > span.active{display:block;}
#absolidize.wmbutton > span.disabled{display:none;}
#download_cif{background:url(icons.png) 0 5px no-repeat;}
Expand Down
2 changes: 1 addition & 1 deletion webassets/iframe_visavis.html
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@

document.getElementById('switcher').onclick = function(){
/* FIXME: REFACTOR */
window.location = '/pd_stub.html#' + window.location.hash.substr(1).replace('fmt=json', 'fmt=png');
window.location = '/webassets/pd_stub.html#' + window.location.hash.substr(1).replace('fmt=json', 'fmt=png');
}
})();
</script>
Expand Down
31 changes: 31 additions & 0 deletions webassets/pd_stub.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
<style>
*{margin:0;padding:0;}
html, body{height:100%;user-select:none;}
body{background-size:contain;background-repeat:no-repeat;background-position:center center;}

#switcher{position:fixed;top:10px;left:10px;width:40px;height:40px;z-index:10;cursor:pointer;background:url(data:image/gif;base64,R0lGODlhHgAXAIABAAAAAP///yH5BAEKAAEALAAAAAAeABcAAAJVjA0Jx63bzkuRTegorXapjHHiJ23iaAbkya1qyFamG0ckXXcQniNb2su8do/TxHdJhpTMpvMJhbaS06LsByxZbViYdvtFeovgssv61DG/F67SzWOHCgA7) center center no-repeat;border:2px solid #ff8400;border-radius:25px;}
#switcher:hover{transform:rotate(180deg);}
</style>
</head>
<body>

<div id="cross" title="Close"></div>
<div id="switcher" title="Show interactive plot (experimental feature)"></div>

<script type="text/javascript">
if (document.location.hash.length){
var pic_url = document.location.hash.substr(1);
document.body.style.backgroundImage = "url('" + pic_url + "')";

document.getElementById('switcher').onclick = function(){
window.location = '/webassets/iframe_visavis.html#' + pic_url.replace('fmt=png', 'fmt=json');
}
}
</script>
</body>
</html>

0 comments on commit f8001da

Please sign in to comment.