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
/* | |
jQuery plugin for dynamically loading pages | |
$("#pageHolder").loadPage({ | |
file: 'index.html', | |
effect: 'slide|fade', | |
duration: 1000 | |
}).then(function() { | |
// done loading, this = $(html) | |
}, function(error) { |
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
/* | |
In favor of casper.js (regressive UI testing): a very tiny and hacky fix | |
to get around the flexbox issues... Idea is to have this class put on the body | |
when we're running phantomjs. | |
@NOTE: There is only a class on the body 'body.casper-env' that is allowed to | |
make changes to minimize complexity. | |
@NOTE: Only apply the casper-env fix when it's needed in the test env. ofcourse | |
we still need (AND SHOULD) test without making any modifcations. This fix |
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
/* | |
SVGLoader 0.1 | |
* dependencies: jQuery | |
- finds all occurences of any HTML element containing `[data-svg-src]` | |
- tries to load that svg | |
- if sucessfull, injects that svg code after the placeholder | |
- if unsuccessfull, handles that with caution and allows a custom callback | |
for when it's very wishable to handle that error on the frontend (such as |
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
/* | |
Note: handy class to extend when you want a dead simple hook cycle system for anything you'll want to make | |
triggerable. | |
usage: | |
const Hookable = require('./path/to/Hookable...'); | |
class SomeClass extends Hookable { | |
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
/* | |
Description: | |
A utility class that shims the default native Fullscreen API implementations | |
in JavaScript (for the browser). Does nothing if FullScreen is not available | |
due to browser support / client browser configuration. | |
Usage: | |
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
/* | |
.flexify should help me make flexbox grids without writing constantly | |
the same stuff over and over again. This integrates flexbox properties directly | |
in html, so you can write it like this: | |
<div class="flexify" data-space-between data-align-center> | |
<div>A</div> | |
<div>B</div> | |
<div C</div> | |
</div> |
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
/* | |
usage: | |
--- | |
a.link { | |
@include underline(red, 1px, 5px, true) | |
} | |
--- | |
above renders a red 'underline' with a 1px width, offsetted 5px from the bottom of |
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
import $ from 'jquery'; | |
import EventEmitter from './event-emitter'; | |
export default class Paginator extends EventEmitter { | |
constructor(props={}) { | |
super(); | |
this.props = { |
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
/* | |
An event mocking class | |
- EventEmitter.events = { event: [], event2: [] ...etc } | |
- EventEmitter.on('event', d => console.log('adds callbacks with data as d (d=whatever)')) | |
! You can use EventEmitter.on('event event') to subscribe 1 callback to multiple events. note space separator | |
- EventEmitter.emit('event', (whatever)); // => runs callbacks from event[evt] added through ~.on(..^) | |
- Special: EventEmitter.on('*') will be emitted on any 'emit'. | |
*/ | |
export default class EventEmitter { | |
constructor() { |