This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// possible useful functions found on the web | |
//https://github.com/padolsey/string.prototype/blob/master/string.js | |
// left trim | |
String.prototype.ltrim = function () { | |
return this.replace(/^\s+/, ''); | |
}; | |
// right trim |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function ($) { | |
$.fn.ckTooltip = function (options) { | |
var timeout = null, | |
counter = null, | |
started = false, | |
counterInterval = null, | |
margin = 5; | |
// Defaults | |
var defaults = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// GOOGLE MAPS JS API V3 | |
//creates a google map in #mapCanvas DOM element | |
var coordinates = { | |
lat: 15.1564541, | |
lng: 9.456456 | |
} | |
function createMap(coordinates) { | |
//google map | |
var mapOptions = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// REGEXP TRICKS | |
//test string against array of strings | |
var string = "string"; | |
var tests = ["test1", "test2", "test3"]; | |
(new RegExp('\\b' + tests.join('\\b|\\b') + '\\b')).test(string) // -> false | |
tests.push("string"); | |
(new RegExp('\\b' + tests.join('\\b|\\b') + '\\b')).test(string) // -> true | |
//test for valid email address |