angry-doodles-blog
angry-doodles-blog
Angry Doodles
17 posts
A blog of a multipotential compulsive.
Don't wanna be here? Send us removal request.
angry-doodles-blog 8 years ago
Text
KeyCode in JQuery
$("body").keydown(function(key){ alert(key.keyCode); });
0 notes
angry-doodles-blog 8 years ago
Text
Draw Rectangle in Canvas
function drawRectangle(color, x, y, width, height){ CONTEXT.fillStyle = color; CONTEXT.rect(x, y, width, height); CONTEXT.fill(); CONTEXT.beginPath(); }
0 notes
angry-doodles-blog 8 years ago
Text
Draw Circle in Canvas
function drawCircle(color, x, y, r, initialAngle, endAngle){ CONTEXT.fillStyle = color; CONTEXT.beginPath(); CONTEXT.arc(x, y, r, initialAngle, endAngle); CONTEXT.fill(); CONTEXT.beginPath(); }
0 notes
angry-doodles-blog 8 years ago
Text
Add Stroke in Canvas
function addStroke(color){ CONTEXT.strokeStyle = color; CONTEXT.stroke(); }
0 notes
angry-doodles-blog 8 years ago
Text
Main Colors
BLACK = "#000"; WHITE = "#fff"; GRAY = "#777"; RED = "#ff0000"; GREEN = "#00ff00"; BLUE = "#0000ff"; YELLOW = "#ffff00"; ORANGE = "#ff6600"; PURPLE = "#bf00ff"; PINK = "#ff00ff"; MARRON = "#993300";
0 notes
angry-doodles-blog 8 years ago
Text
Draw Triangle in Canvas
function drawTriangle(color, x1, y1, x2, y2, x3, y3){ context.fillStyle = color; context.beginPath(); context.moveTo(x1, y1); context.lineTo(x2, y2); context.lineTo(x3, y3); context.fill(); }
0 notes
angry-doodles-blog 8 years ago
Text
Snap Text in JQuery
$("input").keyup(function (){ $("body").text($("input").val()); })
0 notes
angry-doodles-blog 8 years ago
Text
Draw GUI in GML
draw_set_color(c_white); draw_set_font(fnt_yourFont); draw_set_halign(fa_center); draw_text(200, 20, string("Your Text");
0 notes
angry-doodles-blog 8 years ago
Text
POM Error Page
<error-page> <error-code>404</error-code> <location>/pages/error/404.xhtml</location> </error-page>
0 notes
angry-doodles-blog 8 years ago
Text
Hide Comments in JSF
<context-param> <param-name>javax.faces.FACELETS_SKIP_COMMENTS</param-name> <param-value>true</param-value> </context-param>
0 notes
angry-doodles-blog 8 years ago
Text
POM Welcome Page
<welcome-file-list> <welcome-file>index.html</welcome-file> </welcome-file-list>
0 notes
angry-doodles-blog 8 years ago
Text
Redirection in JS
location.href = "index.html";
0 notes
angry-doodles-blog 8 years ago
Text
Log Message in JS
var INFO_MESSAGE = "[INFO] "; var ERROR_MESSAGE = "[ERROR] "; var WARNING_MESSAGE = "[WARN] "; var SUCCESS_MESSAGE = "[SUCCESS] "; var UNDEFINED_MESSAGE = "[???] "; function getInfoMessage(type, message){ console.log(checkTypeMessage(type) + message); } function checkTypeMessage(type){ switch(type){ case "error" :return ERROR_MESSAGE; case "info" :return INFO_MESSAGE; case "warn" :return WARNING_MESSAGE; case "success" :return SUCCESS_MESSAGE; default :return UNDEFINED_MESSAGE; } }
0 notes
angry-doodles-blog 8 years ago
Text
Page Back in JS
$("#bnt-back").click(function(){ window.history.back(); });
0 notes
angry-doodles-blog 8 years ago
Text
Date Format dd/MM/yyyy in JS
//This "value" is a Date type. function getMaskDateddMMyyyy(value){ const SEPARATOR = "/"; var day = value.getDate(); var month = ("0" + (value.getMonth() + 1)).slice(-2); var year = value.getFullYear(); return day + SEPARATOR + month + SEPARATOR + year; }
0 notes
angry-doodles-blog 8 years ago
Text
Format Decimal in JavaScript
function formatDecimal(value, amount){ return parseFloat(value.toFixed(amount)); }
0 notes
angry-doodles-blog 8 years ago
Text
This Validation at Hand in Jquery
function validateField(field){ if(field.length < 1){ $("#field").addClass("error"); getErrorMessage(ERROR[0]); $("#button").attr("title", ERROR[0]); return false; }else{ $("#field").removeClass("error"); $("#button").attr("title", ""); $(".message").addClass("hidden"); return true; } }
0 notes