Sha256: f0a88f34f11d89c6f7847130672b1ea7514a22264c6537218e347f5ea9210f95
Contents?: true
Size: 1.9 KB
Versions: 18
Compression:
Stored size: 1.9 KB
Contents
function debug(msg) { if ("debug" in window) { if (window.debug === true) { console.log(msg); } } } function to_datetime(value) { return value; } function to_boolean(value) { if (value) { return true; } return false; } /* * This function convert snake_type to CamelCase */ function camelCase(input) { return input.toLowerCase().replace(/(^(.)|_(.))/g, function(match, group1) { return group1.toUpperCase(); }).replace("_", ""); } /* * This function returns the currect path to a template */ function template(path){ //console.log(templates_path + path + ".html"); return templates_path + path + ".html"; } /* * Check for page direction */ function is_ltr(){ return $("html").attr("dir") == "ltr" ? true : false; } /* * Show subnav */ function show_subnav(){ $("#subnav").fadeIn(400); } /* * hide subnav */ function hide_subnav(){ } function show_flash_message(msg, klass) { var flash = $("#flash"); $(flash).find("div").html(msg); $(flash).removeClass().addClass("row").addClass(klass).fadeIn(700).delay(5000).fadeOut(500); } function hide_flash() { $("#flash").hide(); } function success_message(msg){ show_flash_message(msg, "success"); } function warning_message(msg){ show_flash_message(msg, "warning"); } function error_message(msg){ show_flash_message(msg, "error"); } 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
18 entries across 18 versions & 1 rubygems