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
// extend prototype to check email address on string | |
String.prototype.checkEmail = function(){ | |
var e=/^([a-zA-Z0-9_\.\-\+])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/; | |
return e.test(this); | |
}; | |
// usage | |
// "[email protected]".checkEmail(); (returns true/false); |
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
var video = function() { | |
if( $('#video').length > 0 ){ | |
videojs("video", {}, function(){ | |
playvideo(this); | |
}); |
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
/* REQUIRES http://modernizr.com/download/#-addtest-json-script_defer-load */ | |
(function(window, document, Modernizr, undefined) { | |
'use strict'; | |
Modernizr.addTest('jQueryVersion', function() { | |
return ( | |
Modernizr.json && | |
Modernizr.scriptdefer && |
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
document.addEventListener('keyup', function (e) { | |
var keyCode = e.keyCode || e.which, | |
arrow = { left: 37, up: 38, right: 39, down: 40 }; | |
switch (keyCode) { | |
case arrow.left: | |
console.log(keyCode); | |
break; | |
case arrow.up: |
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
// Requires ACF & JSON-API | |
add_filter('json_api_encode', 'json_api_encode_acf'); | |
function json_api_encode_acf($response) | |
{ | |
if (isset($response['posts'])) { | |
foreach ($response['posts'] as $post) { | |
json_api_add_acf($post); // Add specs to each post | |
} | |
} |
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
var listItems = $('.project_list > li') | |
$(window).bind('resize',function() { | |
var ww = $(window).width(); | |
listItems.each(function() { | |
$(this).width(ww); | |
}); | |
}); |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
var textPreview = function (el) { | |
var self = this, | |
input, | |
output, | |
initialise = function() { | |
input = el.querySelector('input') || el.querySelector('textarea'), | |
target = el.getAttribute('data-textPreview-output-element'), |
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
/* | |
requires : | |
underscore js | |
event subscriber | |
*/ | |
inView = function (element) { | |
var self = this, | |
type, |
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
/* | |
* Requires : underscore.js | |
uploader = file[type=text] | |
output = output element | |
E.G | |
uploader = document.getElementById("file_url"), | |
output = document.getElementById('preview_image'), | |
valid : |