Git Product home page Git Product logo

ermac's People

Contributors

blokhin avatar vladlenacravcenco avatar

Stargazers

 avatar  avatar

Watchers

 avatar

ermac's Issues

Show entries button to open a new tab

originally posted by LA:

It would be great if the Show entries button in the Phase view opened a new tab. Now it is very cumbersome to get back to the search results in a Phase view if any type of sorting was applied.

Visavis integration

Currently, it's done as simple as accessing the iframe contentWindow:

ermac/src_js/markup.js

Lines 748 to 749 in a14cde6

<!-- PLOTS EMBED -->
<div id="visavis"><iframe id="visavis_iframe" frameborder=0 scrolling="no" width="100%" height="100%" src="/visavis/"></iframe></div><!-- NB relative URL -->

with these functions:

ermac/src_js/main_logic.js

Lines 962 to 1081 in 58033d5

function start_visavis(plot_type){
destroy_numericbox();
delete wmgui.search.numeric;
if (plot_type) wmgui.visavis_curtype = plot_type;
$('div.ctxpanel').hide();
var toshow = $('#ctxpanel_' + wmgui.visavis_curtype);
if (toshow.length) toshow.show();
if (['matrix', 'cube', 'discovery'].indexOf(wmgui.visavis_curtype) > -1) $('#cmppanel_plots').show();
if (wmgui.visavis_working)
return manage_visavis();
rebuild_visavis();
// visavis_col preparation
$('#visavis_col').show();
$('#visavis').show();
switch_control_mode(0, 11, 'a', 'e');
$('body').addClass('noscroll');
wmgui.search_type = 0;
wmgui.visavis_working = true;
wmgui.visavis_starting = false;
var cur_obj = {total_count: 1};
$.extend(cur_obj, wmgui.search);
try {
document.getElementById('visavis_iframe').contentWindow.location.replace(get_visavis_url(cur_obj));
} catch (e){
console.error('No iframe access');
}
}
function manage_visavis(callback_fn, param_a, param_b){
if (wmgui.visavis_terminating || !wmgui.visavis_working){
return false;
}
if (wmgui.search.numeric){ // not supported for plotting yet!
wmgui.visavis_terminating = true;
return false;
}
try { wmgui.active_ajax.abort() } catch(e){}
try { wmgui.quick_ajax.abort() } catch(e){}
rebuild_visavis();
var cur_obj = {total_count: 1};
$.extend(cur_obj, wmgui.search);
try {
document.getElementById('visavis_iframe').contentWindow.location.replace(get_visavis_url(cur_obj));
} catch (e){
console.error('No iframe access');
}
if (callback_fn) callback_fn(param_a, param_b);
return true;
}
function rebuild_visavis(){
var extr = window.location.hash.indexOf('search/');
if (extr == -1){
var extr = window.location.hash.indexOf('inquiry/');
if (extr == -1) return;
}
var query = window.location.hash.substr(extr);
$('a.pltcol_links').each(function(){
var that = $(this),
plot_type = that.attr('rev');
that.attr('href', wmgui.gui_host + window.location.pathname + '#plot/' + plot_type + '/' + query);
});
$('#visavis_col > ul > li').removeClass('embodied');
$('#pltchoice_' + wmgui.visavis_curtype).addClass('embodied');
// ctx reset
if (['matrix', 'cube', 'discovery'].indexOf(wmgui.visavis_curtype) > -1)
update_dc();
if (wmgui.visavis_curtype == 'matrix'){
$('#ctxpanel_matrix > ul > li.embodied').removeClass('embodied');
var y_id = $('#ctxpanel_matrix > ul > li.ss_y');
if (y_id.length) y_id.removeClass('ss_y');
$('#vismatrix_nump').addClass('embodied'); // set the default sort order (also in Visavis: TODO)
$('span.sops').remove();
} else if (wmgui.visavis_curtype == 'cube'){
$('#ctxpanel_cube > ul > li.embodied').removeClass('embodied');
var y_id = $('#ctxpanel_cube > ul > li.ss_y'),
z_id = $('#ctxpanel_cube > ul > li.ss_z');
if (y_id.length) y_id.removeClass('ss_y');
if (z_id.length) z_id.removeClass('ss_z');
$('#viscube_nump').addClass('embodied');
$('span.sops').remove();
} else if (wmgui.visavis_curtype == 'graph'){
$('#ctxpanel_graph > ul > li.embodied').removeClass('embodied');
$('#visgraph_props').addClass('embodied');
}
try {
document.getElementById('visavis_iframe').contentWindow.fixel_manage(wmgui.visavis_curtype == 'cube' && wmgui.search.elements);
} catch (e){
console.error('No iframe access');
}
}
function stop_visavis(){
$('#visavis, #visavis_col').hide();
wmgui.visavis_working = false;
wmgui.visavis_terminating = false;
}

This causes problems if Ermac and Visavis are loaded from the different domains.

@nin-jin @PavelZubkov please could you recommend how this should be done via postMessage interface?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.