src_js/router.js
/**
 * The different types of modal windows
 */
The different types of modal windows
The different types of modal windows
function url__modal(arg){
    if (arg == "login"){
        if (wmgui.sid) return window.location.replace('#modal/menu');
        if (wmgui.edition == 1){
            return window.location.href = 'oauth/asm.html';
        }
        if ($("#restore_by_email").val()) $("#login_email").val($("#restore_by_email").val());
        else $("#login_email").val('');
        $("#login_password").val('');
        $('#loginbox').show();
        $("#login_email").focus();
        var u_email = window.localStorage.getItem('wm_u_email') || false;
        if (u_email){
            $("#login_email").val(u_email);
            window.localStorage.removeItem('wm_u_email');
        }
    } else if (arg == "restore"){
        if (wmgui.sid) return window.location.replace('#modal/menu');
        if ($("#login_email").val()) $("#restore_by_email").val($("#login_email").val());
        else $("#restore_by_email").val('');
        $('#restorebox').show();
        $("#restore_by_email").focus();
    } else if (arg == "menu"){
        if (!wmgui.sid) return window.location.replace('#modal/login');
        $("#new_password_1, #new_password_2").val('');
        arrange_menu_collateral();
        $('#menubox, div.menu_collateral').show();
    } else return wmgui.notify("Unknown modal dialogue!");
    $('#overlay').show();
}
function url__modal ( arg ) { if ( arg == "login" ) { if ( wmgui . sid ) return window . location . replace ( '#modal/menu' ) ; if ( wmgui . edition == 1 ) { return window . location . href = 'oauth/asm.html' ; } if ( $ ( "#restore_by_email" ) . val ( ) ) $ ( "#login_email" ) . val ( $ ( "#restore_by_email" ) . val ( ) ) ; else $ ( "#login_email" ) . val ( '' ) ; $ ( "#login_password" ) . val ( '' ) ; $ ( '#loginbox' ) . show ( ) ; $ ( "#login_email" ) . focus ( ) ; var u_email = window . localStorage . getItem ( 'wm_u_email' ) || false ; if ( u_email ) { $ ( "#login_email" ) . val ( u_email ) ; window . localStorage . removeItem ( 'wm_u_email' ) ; } } else if ( arg == "restore" ) { if ( wmgui . sid ) return window . location . replace ( '#modal/menu' ) ; if ( $ ( "#login_email" ) . val ( ) ) $ ( "#restore_by_email" ) . val ( $ ( "#login_email" ) . val ( ) ) ; else $ ( "#restore_by_email" ) . val ( '' ) ; $ ( '#restorebox' ) . show ( ) ; $ ( "#restore_by_email" ) . focus ( ) ; } else if ( arg == "menu" ) { if ( ! wmgui . sid ) return window . location . replace ( '#modal/login' ) ; $ ( "#new_password_1, #new_password_2" ) . val ( '' ) ; arrange_menu_collateral ( ) ; $ ( '#menubox, div.menu_collateral' ) . show ( ) ; } else return wmgui . notify ( "Unknown modal dialogue!" ) ; $ ( '#overlay' ) . show ( ) ; }
The different types of modal windows
The different types of modal windows
// edition-based OAuth login // for OAuth linking redirect only // see *wm_u_email* in email_chain.html