App.html
- components/Footer.html
- components/Header.html
- components/Search.html
var wait = function(ms) { | |
ms = ms || 500; | |
return new Promise(function(resolve, reject){ | |
window.setTimeout(function() { | |
resolve(); | |
}, ms); | |
}); | |
}; | |
// USAGE |
var getYoutubeIdByUrl = function( url ){ | |
var regExp = /^.*((youtu.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(watch\?))\??v?=?([^#\&\?]*).*/; | |
var match = url.match(regExp); | |
if(match&&match[7].length==11){ | |
return match[7]; | |
} | |
return false; | |
}; |
use constant { | |
PREFIX_DIVIDER => ':', | |
PREFIX_ALIASES => { | |
'foo' => 'foo/barz/location/', | |
} | |
}; | |
sub find_and_replace_prefix { | |
my ($filename) = @_; | |
var target = document.querySelector('.modal-content'); | |
// Cross-browser listeners: `mousewheel DOMMouseScroll` | |
window.addEventListener('mousewheel', function(event) { | |
var elHeight = target.clientHeight; | |
var scrollTop = target.scrollTop; | |
var scrollHeight = target.scrollHeight; | |
if ((event.deltaY < 0 && scrollTop == 0 ) || | |
(event.deltaY > 0 && scrollTop + elHeight >= scrollHeight)) { |
.js-scrollbar-measure { | |
width: 100px; | |
height: 100px; | |
overflow: scroll; | |
position: absolute; | |
top: -9999px; | |
} |
/* | |
* `Cat` module sample. | |
*/ | |
function Cat(bar) { | |
this.bar = bar; | |
} | |
Cat.prototype.foo = 'hello'; | |
/* |
(function() { | |
// 'use strict'; | |
// ^ would throw error because of `arguments.callee.caller`. | |
var ModuleCore = function() {}; | |
ModuleCore.prototype.html = function() { | |
console.log(':: html'); | |
}; | |
ModuleCore.extend = function (settings, Parent) { |
var store = require('./store'); | |
var gridView = require('./grid-view'); | |
TicTacToe.prototype.eventListeners = function() { | |
store.subscribe(this.render.bind(this)); | |
}; | |
TicTacToe.prototype.render = function(prevState, state) { | |
// You can even check whether new state is different |