This file contains hidden or 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($){ | |
"use strict"; | |
$.fn.fixPlaceholders = function(){}; | |
if( $.support.placeholders ) | |
return; | |
var selector = 'input[placeholder], textarea[placeholder]', | |
originalType; |
This file contains hidden or 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
// check if PROGRESSIVE image was loaded | |
var duration = 60, | |
interval = setInterval(checkImageLoaded, duration), | |
maxTime = 3000; | |
function checkImageLoaded(){ | |
maxTime -= duration; | |
// image was loaded (or should have been) | |
if( photo.naturalWidth ){ | |
clearInterval(interval); |
This file contains hidden or 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
$.fn.addTempClass = function(tempClass, duration){ | |
if( !tempClass ) | |
return this; | |
return this.each(function(){ | |
var $elm = $(this); | |
$elm.addClass(tempClass); | |
setTimeout(function(){ | |
$elm.removeClass(tempClass); |
This file contains hidden or 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
// Triangle helper mixin (by Yair Even-Or) | |
// @param {Direction} $direction - Triangle direction, either `top`, `right`, `bottom` or `left` | |
// @param {Color} $color [currentcolor] - Triangle color | |
// @param {Length} $size [1em] - Triangle size | |
@mixin triangle($direction, $color: currentcolor, $size: 1em) { | |
$size: $size/2; | |
$transparent: rgba($color, 0); | |
$opposite: (top:bottom, right:left, left:right, bottom:top); | |
content: ''; |
This file contains hidden or 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
// ---- | |
// Sass (v3.4.14) | |
// Compass (v1.0.3) | |
// ---- | |
$icons-map: (add-user: '\e63e', remove-user: '\e63f', user: '\e628', search: '\e62e'); | |
@each $key, $value in $icons-map { | |
.icon-#{$key}:before { content: #{$value}; } | |
} |
This file contains hidden or 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 abbreviateNumber(value){ | |
var newValue = value, | |
suffixes, suffixNum, shortValue, precision, dotLessShortValue; | |
if (value >= 1000) { | |
suffixes = ["", "k", "m", "b","t"]; | |
suffixNum = Math.floor( (""+Math.round(value)).length/3 ); | |
shortValue = ''; | |
for (precision = 2; precision >= 1; precision--) { | |
shortValue = parseFloat( (suffixNum != 0 ? (value / Math.pow(1000,suffixNum) ) : value).toPrecision(precision)); | |
dotLessShortValue = (shortValue + '').replace(/[^a-zA-Z 0-9]+/g,''); |
This file contains hidden or 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
io.sockets.on('connection', function (socket){ | |
try{ | |
var profileCookie = cookie.parse(socket.handshake.headers['cookie']), | |
profile; | |
if( profileCookie && profileCookie['connect.sess'] ){ | |
profile = profileCookie['connect.sess']; | |
profile = JSON.parse(profile.slice(profile.indexOf('{'), profile.indexOf('}.') + 1)); | |
} | |
} | |
catch(err){} |
This file contains hidden or 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
//////////////////////////////////////// | |
// Scroll To / jQuery plugin | |
// | |
// @author Yair Even Or | |
// @version 1.0.0 (April 3, 2013) | |
// | |
(function($){ | |
"use strict"; | |
var currentPos = 0, |
This file contains hidden or 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
// mouse move animations | |
$('.container').on('mousemove', moveSquares); | |
function moveSquares(e){ | |
var mousex = (e.pageX - (e.currentTarget.clientWidth/2)) / e.currentTarget.clientWidth; | |
for( i in squares ){ | |
if( i < 6) | |
squares[i].style.cssText = transform + ': translateX('+ Math.ceil(mousex*55) +'px)'; | |
if( i >= 6 && i < 10) |
This file contains hidden or 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 chai = require('chai'), | |
expect = chai.expect, | |
should = chai.should(), | |
jsdom = require('jsdom'), | |
window = jsdom.jsdom().defaultView; | |
describe('a basic test', () => { | |
it('should pass when all is ok', (done) => { | |
jsdom.jQueryify(window, "../js/vendor/jquery.min.js", () => { |
OlderNewer