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
$.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 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 findMiddleElement = (function(docElm){ | |
var viewportHeight = docElm.clientHeight, | |
elements = $('div'); | |
return function(e){ | |
var middleElement; | |
if( e && e.type == 'resize' ) | |
viewportHeight = docElm.clientHeight; | |
elements.each(function(){ |
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
// 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 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 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 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", () => { |
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
/* | |
* Tooltips using Tether | |
* Yair Even-Or | |
*/ | |
var ttip = (function(){ | |
var Tooltip = function(target, settings){ | |
var defaults = { | |
closeBtn : 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
Element.prototype.hasClass = Element.prototype.hasClass || | |
function(classArr){ | |
var hasClass = 0, | |
className = this.getAttribute('class'); | |
if( this == null || !classArr || !className ) return false; | |
if( !(classArr instanceof Array) ) | |
classArr = classArr.split(' '); |
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
// ---- | |
// libsass (v3.2.5) | |
// ---- | |
/*! ======================================================================== | |
PRECISE CONTROL OVER RESPONSIVE TYPOGRAPHY FOR SASS | |
--------------------------------------------------- | |
Indrek Paas @indrekpaas |
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
// ---- | |
// Sass (v3.4.20) | |
// Compass (v1.0.3) | |
// ---- | |
.foo { | |
bar: index((width: 10px, height: 20px), (height 20px)); | |
} |