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
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" contents="IE=edge,chrome=1"> | |
<meta name="viewport" content="width=device-width,initial-scale=1"> | |
<title></title> | |
<!-- Application styles --> |
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
matchesSelector = (function (doc) { | |
return doc.matchesSelector || | |
doc.webkitMatchesSelector || | |
doc.mozMatchesSelector || | |
doc.oMatchesSelector || | |
doc.msMatchesSelector | |
}(document.documentElement)) |
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
// Uses AMD or browser globals to create a jQuery plugin. | |
// It does not try to register in a CommonJS environment since | |
// jQuery is not likely to run in those environments. | |
// See jqueryPluginCommonJs.js for that version. | |
(function (factory) { | |
if (typeof define === 'function' && define.amd) { | |
// AMD. Register as an anonymous module. | |
define(['jquery'], factory); |
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 ($) { | |
var o = $({}) | |
$.each({ | |
on: 'subscribe' | |
, trigger: 'publish' | |
, off: 'unsubscribe' | |
}, function (key, api) { | |
$[api] = 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
// Works in modern browsers + IE9, but Modernizr has a polyfill baked in for function.bind | |
var o = $( {} ) | |
$.subscribe = o.on.bind(o) | |
$.unsubscribe = o.off.bind(o) | |
$.publish = o.trigger.bind(o) |
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
/* Javascript utility funcs */ | |
function valueInArray (val,arr) { | |
for (var i = 0; i < arr.length; i++) { | |
if (val==arr[i]) { | |
return true; | |
} | |
} | |
return false; |