Sha256: e16cadaf0b23423c3f2ea18525aa5f2fe3fd6ac2b9368861b5da3c71b2032816

Contents?: true

Size: 1.07 KB

Versions: 1

Compression:

Stored size: 1.07 KB

Contents

function redirect_to(target) {
  var dashboard_namespace = "<%= Underworld::Engine.dashboard_namespace.to_s %>";
  var uri = target.replace("/"+ dashboard_namespace + "/",
                           "/" + dashboard_namespace + "#/");

  console.log("Redirecting to: %s", uri);
  Turbolinks.visit(target, { keep: ['sidebar', 'topnav']});
}

function big_random() {
  return Math.random(0,10)*100000000000000000;
}


function debug(msg) {
    if ("debug" in window) {
        if (window.debug === true) {
            console.log(msg);
        }
    }
}





function show_error_queue(){
    if (ErrorQueue.length > 0) {
        error_message(window.ErrorQueue.join("<br/>"));
    }
}

/*
 * Catch the remote api error
 */
function catch_error1(error){
    if (error.data.error) {
        console.log(error.data.error);
        error_message(error.data.error);
    }
    else {
        console.log("Translate catch_error");
        error_message("Unkown error: please try again or contact to administrator.");
    }
};

$(function(){
    $("#flash").on("click", hide_flash);
    show_error_queue();
});

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
underworld-1.0.0 app/assets/javascripts/underworld/dashboard/functions.js.erb