src_js/router.js
/**
 * The individual phase display /#phase/ID
 */
The individual phase display /#phase/ID
The individual phase display / #phase / ID
function url__phase(arg){
    var phase_data = arg.split('/'),
        formula = phase_data[0],
        spg = phase_data[1],
        pearson = phase_data[2];
    if (formula && spg && pearson){
        wmgui.active_ajax = $.ajax({type: 'GET', url: wmgui.phph_endpoint, data: {phase: [formula, spg, pearson].join('/')}, beforeSend: wmgui.show_preloader}).always(wmgui.hide_preloader).done(function(data){
            if (data.error) return wmgui.notify(data.error);
            window.location.replace('#phase_id/' + data.phid);
        }).fail(function(xhr, textStatus, errorThrown){
            if (textStatus != 'abort') wmgui.notify('A network error occured. Please, try again');
        });
    } else return wmgui.notify('Wrong phase given!');
}
function url__phase ( arg ) { var phase_data = arg . split ( '/' ) , formula = phase_data [ 0 ] , spg = phase_data [ 1 ] , pearson = phase_data [ 2 ] ; if ( formula && spg && pearson ) { wmgui . active_ajax = $ . ajax ( { type : 'GET' , url : wmgui . phph_endpoint , data : { phase : [ formula , spg , pearson ] . join ( '/' ) } , beforeSend : wmgui . show_preloader } ) . always ( wmgui . hide_preloader ) . done ( function ( data ) { if ( data . error ) return wmgui . notify ( data . error ) ; window . location . replace ( '#phase_id/' + data . phid ) ; } ) . fail ( function ( xhr , textStatus , errorThrown ) { if ( textStatus != 'abort' ) wmgui . notify ( 'A network error occured. Please, try again' ) ; } ) ; } else return wmgui . notify ( 'Wrong phase given!' ) ; }
The individual phase display /#phase/ID
The individual phase display / #phase / ID