Skip to content

Instantly share code, notes, and snippets.

View laustdeleuran's full-sized avatar

Laust Deleuran laustdeleuran

View GitHub Profile
@laustdeleuran
laustdeleuran / jq-event-listener-anon-func-context.js
Created February 6, 2012 15:32
jQuery Event Listener - Anonymous functions and contect
$(document).ready(function(){
var $links = $('a');
$links.click(function(e){
e.preventDefault();
var a = "Wow, you clicked a link!";
alert(a);
});
});
@laustdeleuran
laustdeleuran / vertic-log-class-extend-error.js
Created February 6, 2012 12:29
Vertic Lib Error Class Extends Log
var _Error = function(){};
_Error.prototype = new _Log();
_Error.prototype.parent = _Log.prototype;
_Error.prototype.write = function(arg,status,msg,die){
var orgArg = arg;
// Set optional parameters
if (typeof status === 'undefined') status = 'unknown';
if (typeof msg === 'undefined') msg = '';
if (typeof die !== 'boolean') die = false;
@laustdeleuran
laustdeleuran / vertic-log-class-use.js
Created February 6, 2012 12:00
Vertic Lib Logger Class Use Example
var l = new _Log();
l.write("Log entry #1! Yay!");
@laustdeleuran
laustdeleuran / vertic-log-class-methods.js
Created February 6, 2012 11:49
Vertic Lib Logger Class Methods
_Log.prototype.write = function(arg,forceDebug){
var orgArg = arg;
// Add metadata
arg = this.addMeta(arg);
// Push object to internal log
this.history.push(arg);
// Try native console, but fail silently
@laustdeleuran
laustdeleuran / vertic-log-class-constructor.js
Created February 6, 2012 11:24
Vertic Lib Logger Class Constructor
var _Log = function(obj){
// Set defaults
this.history = [];
this.debug = false;
this.domConsole = false;
this.meta = true;
this.name = 'Vertic Log';
// Update settings
if (typeof obj === 'object') {
@laustdeleuran
laustdeleuran / vertic-log.js
Created February 6, 2012 10:44
Vertic Lib Logger
/*
* Vertic JS Logger
* http://labs.vertic.com
*
* Copyright 2012, Vertic A/S
* Dual licensed under the MIT or GPL Version 2 licenses.
*
* For full version see https://github.com/laustdeleuran/htmlplate/blob/master/js/vertic-0.1-core-dev.js
*/
/**
* Long description.
*
* Short description.
*
* @section 2.1.3 Form Buttons
* @pseudo :hover Highlights when hovering.
* @pseudo :disabled Dims the button when disabled.
* @modifier .primary Indicates the button is the primary action.
* @modifier .smaller A smaller version of the button.
<!--
************************************
Design and programming by Vertic.com
e-mail: [email protected]
phone: +45 70209085
************************************
-->
<link type="image/x-icon" rel="shortcut icon" href="../favicon.ico" />
<link rel="stylesheet" href="../css/style.css" media="all" />
<link rel="stylesheet" href="../css/print.css" media="print" />
<!--[if IE]>
<link rel="stylesheet" type="text/css" href="../css/ie.css" media="screen, projection" />
<![endif]-->
<!DOCTYPE html>
<!--[if lt IE 7]><html lang="da" class="no-js ie6"><![endif]-->
<!--[if IE 7]><html lang="da" class="no-js ie7"><![endif]-->
<!--[if IE 8]><html lang="da" class="no-js ie8"><![endif]-->
<!--[if gt IE 8]><!--><html lang="da" class="no-js"><!--<![endif]-->