mirror of
https://github.com/kemko/nomad.git
synced 2026-01-06 10:25:42 +03:00
website
This commit is contained in:
82
website/source/assets/javascripts/app/CubeDraw.js
Normal file
82
website/source/assets/javascripts/app/CubeDraw.js
Normal file
@@ -0,0 +1,82 @@
|
||||
(function(){
|
||||
|
||||
CubeDraw = Base.extend({
|
||||
|
||||
$cube: null,
|
||||
ROWS: 4,
|
||||
PADDING: 64, // 44 pixel base square + 20 padding
|
||||
previousRowTop: null,
|
||||
previousRowLeft: null,
|
||||
lastCube: null,
|
||||
|
||||
constructor: function(){
|
||||
this.$cube = $('.cube');
|
||||
this.$cubes = $('#cubes');
|
||||
|
||||
this.lastCube = this.$cube;
|
||||
this.previousRowLeft = parseInt(this.lastCube.css('left'), 10)
|
||||
this.previousRowTop = parseInt(this.lastCube.css('top'), 10);
|
||||
|
||||
this.addEventListeners();
|
||||
},
|
||||
|
||||
addEventListeners: function(){
|
||||
var angle = this.getRadiansForAngle(30);
|
||||
var sin = Math.sin(angle) * this.PADDING;
|
||||
var cos = Math.cos(angle) * this.PADDING;
|
||||
|
||||
//sett up our parent columns
|
||||
for(var i = 0; i < this.ROWS; i++){
|
||||
var cube = this.lastCube.clone();
|
||||
|
||||
cube.css({ top: this.previousRowTop - sin, left: this.previousRowLeft - cos});
|
||||
this.$cubes.prepend(cube);
|
||||
this.lastCube = cube;
|
||||
this.previousRowLeft = parseInt(this.lastCube.css('left'), 10)
|
||||
this.previousRowTop = parseInt(this.lastCube.css('top'), 10)
|
||||
}
|
||||
|
||||
//use the parent cubes as starting point for rows
|
||||
var $allParentCubes = $('.cube');
|
||||
var angle = this.getRadiansForAngle(150);
|
||||
var sin = Math.sin(angle) * this.PADDING;
|
||||
var cos = Math.cos(angle) * this.PADDING;
|
||||
|
||||
for(var j = this.ROWS; j > -1 ; j--){
|
||||
var baseCube = $($allParentCubes[j]);
|
||||
|
||||
this.previousRowLeft = parseInt(baseCube.css('left'), 10)
|
||||
this.previousRowTop = parseInt(baseCube.css('top'), 10)
|
||||
|
||||
for(var n = 0; n < this.ROWS; n++){
|
||||
var cube = baseCube.clone();
|
||||
cube.css({ top: this.previousRowTop - sin, left: this.previousRowLeft - cos});
|
||||
|
||||
this.$cubes.prepend(cube);
|
||||
|
||||
this.lastCube = cube;
|
||||
this.previousRowLeft = parseInt(this.lastCube.css('left'), 10)
|
||||
this.previousRowTop = parseInt(this.lastCube.css('top'), 10)
|
||||
}
|
||||
}
|
||||
|
||||
var $all = $('.cube');
|
||||
for(var c = 0; c < $all.length; c++){
|
||||
(function(index){
|
||||
setTimeout(function(){
|
||||
var $theCube = $($all[index]);
|
||||
$theCube.addClass('in')
|
||||
}, 100*c)
|
||||
})(c)
|
||||
}
|
||||
},
|
||||
|
||||
getRadiansForAngle: function(angle) {
|
||||
return angle * (Math.PI/180);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
window.CubeDraw = CubeDraw;
|
||||
|
||||
})();
|
||||
130
website/source/assets/javascripts/app/DotLockup.js
Normal file
130
website/source/assets/javascripts/app/DotLockup.js
Normal file
@@ -0,0 +1,130 @@
|
||||
(function(){
|
||||
|
||||
DotLockup = Base.extend({
|
||||
|
||||
$keyWrap: null,
|
||||
$keys: null,
|
||||
|
||||
constructor: function(){
|
||||
var _this = this;
|
||||
|
||||
_this.$keyWrap = $('.keys');
|
||||
_this.$keys = $('.keys span');
|
||||
|
||||
//(3000)
|
||||
|
||||
_this.addEventListeners();
|
||||
_this.animateFull()
|
||||
.then(_this.animateOff.bind(this))
|
||||
.then(_this.animateFull.bind(this))
|
||||
.then(_this.animatePress.bind(this))
|
||||
.then(_this.resetKeys.bind(this));
|
||||
},
|
||||
|
||||
addEventListeners: function(){
|
||||
var _this = this;
|
||||
},
|
||||
|
||||
animateFull: function(uberDelay){
|
||||
var _this = this,
|
||||
uberDelay = uberDelay || 0,
|
||||
deferred = $.Deferred();
|
||||
|
||||
setTimeout( function(){
|
||||
_this.updateEachKeyClass('full', 'off', 1000, 150, deferred.resolve);
|
||||
}, uberDelay)
|
||||
|
||||
return deferred;
|
||||
},
|
||||
|
||||
animateOff: function(){
|
||||
var deferred = $.Deferred();
|
||||
|
||||
this.updateEachKeyClass('full off', '', 1000, 150, deferred.resolve, true);
|
||||
|
||||
return deferred;
|
||||
},
|
||||
|
||||
animatePress: function(){
|
||||
var _this = this,
|
||||
deferred = $.Deferred(),
|
||||
len = _this.$keys.length,
|
||||
presses = _this.randomNumbersIn(len),
|
||||
delay = 250,
|
||||
interval = 600;
|
||||
|
||||
for(var i=0; i < len; i++){
|
||||
(function(index){
|
||||
setTimeout(function(){
|
||||
_this.$keys.eq(presses[index]).addClass('press');
|
||||
if(index == len -1 ){
|
||||
deferred.resolve();
|
||||
}
|
||||
}, delay)
|
||||
|
||||
delay += interval;
|
||||
}(i))
|
||||
}
|
||||
|
||||
return deferred;
|
||||
},
|
||||
|
||||
resetKeys: function(){
|
||||
var _this = this,
|
||||
len = _this.$keys.length,
|
||||
delay = 2500,
|
||||
interval = 250;
|
||||
|
||||
setTimeout(function(){
|
||||
_this.$keys.removeClass('full press');
|
||||
}, delay)
|
||||
/*for(var i=0; i < len; i++){
|
||||
(function(index){
|
||||
setTimeout(function(){
|
||||
_this.$keys.eq(index).removeClass('full press');
|
||||
}, delay)
|
||||
|
||||
delay += interval;
|
||||
}(i))
|
||||
}*/
|
||||
},
|
||||
|
||||
updateEachKeyClass: function(clsAdd, clsRemove, delay, interval, resolve, reverse){
|
||||
var delay = delay;
|
||||
this.$keys.each(function(index){
|
||||
var span = this;
|
||||
var finishIndex = (reverse) ? 0 : 9; // final timeout at 0 or 9 depending on if class removal is reversed on the span list
|
||||
setTimeout( function(){
|
||||
$(span).removeClass(clsRemove).addClass(clsAdd);
|
||||
if(index == finishIndex ){
|
||||
resolve();
|
||||
}
|
||||
}, delay);
|
||||
|
||||
if(reverse){
|
||||
delay -= interval;
|
||||
}else{
|
||||
delay += interval;
|
||||
}
|
||||
})
|
||||
|
||||
},
|
||||
|
||||
randomNumbersIn: function(len){
|
||||
var arr = [];
|
||||
while(arr.length < len){
|
||||
var randomnumber=Math.floor(Math.random()*len)
|
||||
var found=false;
|
||||
for(var i=0;i<arr.length;i++){
|
||||
if(arr[i]==randomnumber){found=true;break}
|
||||
}
|
||||
if(!found)arr[arr.length]=randomnumber;
|
||||
}
|
||||
return arr;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
window.DotLockup = DotLockup;
|
||||
|
||||
})();
|
||||
45
website/source/assets/javascripts/app/Init.js
Normal file
45
website/source/assets/javascripts/app/Init.js
Normal file
@@ -0,0 +1,45 @@
|
||||
(function(Sidebar, CubeDraw){
|
||||
|
||||
// Quick and dirty IE detection
|
||||
var isIE = (function(){
|
||||
if (window.navigator.userAgent.match('Trident')) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
})();
|
||||
|
||||
// isIE = true;
|
||||
|
||||
var Init = {
|
||||
|
||||
start: function(){
|
||||
var id = document.body.id.toLowerCase();
|
||||
|
||||
if (this.Pages[id]) {
|
||||
this.Pages[id]();
|
||||
}
|
||||
|
||||
//always init sidebar
|
||||
Init.initializeSidebar();
|
||||
},
|
||||
|
||||
initializeSidebar: function(){
|
||||
new Sidebar();
|
||||
},
|
||||
|
||||
initializeHomepage: function(){
|
||||
new CubeDraw();
|
||||
},
|
||||
|
||||
Pages: {
|
||||
'page-home': function(){
|
||||
Init.initializeHomepage();
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
Init.start();
|
||||
|
||||
})(window.Sidebar, window.CubeDraw);
|
||||
51
website/source/assets/javascripts/app/Sidebar.js
Normal file
51
website/source/assets/javascripts/app/Sidebar.js
Normal file
@@ -0,0 +1,51 @@
|
||||
(function(){
|
||||
|
||||
Sidebar = Base.extend({
|
||||
|
||||
$body: null,
|
||||
$overlay: null,
|
||||
$sidebar: null,
|
||||
$sidebarHeader: null,
|
||||
$sidebarImg: null,
|
||||
$toggleButton: null,
|
||||
|
||||
constructor: function(){
|
||||
this.$body = $('body');
|
||||
this.$overlay = $('.sidebar-overlay');
|
||||
this.$sidebar = $('#sidebar');
|
||||
this.$sidebarHeader = $('#sidebar .sidebar-header');
|
||||
this.$toggleButton = $('.navbar-toggle');
|
||||
|
||||
this.sidebarImg = this.$sidebarHeader.css('background-image');
|
||||
|
||||
this.addEventListeners();
|
||||
},
|
||||
|
||||
addEventListeners: function(){
|
||||
var _this = this;
|
||||
|
||||
_this.$toggleButton.on('click', function() {
|
||||
_this.$sidebar.toggleClass('open');
|
||||
if ((_this.$sidebar.hasClass('sidebar-fixed-left') || _this.$sidebar.hasClass('sidebar-fixed-right')) && _this.$sidebar.hasClass('open')) {
|
||||
_this.$overlay.addClass('active');
|
||||
_this.$body.css('overflow', 'hidden');
|
||||
} else {
|
||||
_this.$overlay.removeClass('active');
|
||||
_this.$body.css('overflow', 'auto');
|
||||
}
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
_this.$overlay.on('click', function() {
|
||||
$(this).removeClass('active');
|
||||
_this.$body.css('overflow', 'auto');
|
||||
_this.$sidebar.removeClass('open');
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
window.Sidebar = Sidebar;
|
||||
|
||||
})();
|
||||
11
website/source/assets/javascripts/application.js
Normal file
11
website/source/assets/javascripts/application.js
Normal file
@@ -0,0 +1,11 @@
|
||||
//= require jquery
|
||||
//= require bootstrap
|
||||
//= require jquery.waypoints.min
|
||||
|
||||
//= require lib/String.substitute
|
||||
//= require lib/Function.prototype.bind
|
||||
//= require lib/Base
|
||||
|
||||
//= require app/Sidebar
|
||||
//= require app/CubeDraw
|
||||
//= require app/Init
|
||||
9
website/source/assets/javascripts/demo.js
Normal file
9
website/source/assets/javascripts/demo.js
Normal file
@@ -0,0 +1,9 @@
|
||||
window.Demo = Ember.Application.create({
|
||||
rootElement: '#demo-app',
|
||||
});
|
||||
|
||||
Demo.deferReadiness();
|
||||
|
||||
if (document.getElementById('demo-app')) {
|
||||
Demo.advanceReadiness();
|
||||
}
|
||||
8
website/source/assets/javascripts/html5shiv.js
vendored
Executable file
8
website/source/assets/javascripts/html5shiv.js
vendored
Executable file
@@ -0,0 +1,8 @@
|
||||
/*
|
||||
HTML5 Shiv v3.6.2pre | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed
|
||||
*/
|
||||
(function(l,f){function m(){var a=e.elements;return"string"==typeof a?a.split(" "):a}function i(a){var b=n[a[o]];b||(b={},h++,a[o]=h,n[h]=b);return b}function p(a,b,c){b||(b=f);if(g)return b.createElement(a);c||(c=i(b));b=c.cache[a]?c.cache[a].cloneNode():r.test(a)?(c.cache[a]=c.createElem(a)).cloneNode():c.createElem(a);return b.canHaveChildren&&!s.test(a)?c.frag.appendChild(b):b}function t(a,b){if(!b.cache)b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag();
|
||||
a.createElement=function(c){return!e.shivMethods?b.createElem(c):p(c,a,b)};a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+m().join().replace(/\w+/g,function(a){b.createElem(a);b.frag.createElement(a);return'c("'+a+'")'})+");return n}")(e,b.frag)}function q(a){a||(a=f);var b=i(a);if(e.shivCSS&&!j&&!b.hasCSS){var c,d=a;c=d.createElement("p");d=d.getElementsByTagName("head")[0]||d.documentElement;c.innerHTML="x<style>article,aside,figcaption,figure,footer,header,hgroup,nav,section{display:block}mark{background:#FF0;color:#000}</style>";
|
||||
c=d.insertBefore(c.lastChild,d.firstChild);b.hasCSS=!!c}g||t(a,b);return a}var k=l.html5||{},s=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,r=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,j,o="_html5shiv",h=0,n={},g;(function(){try{var a=f.createElement("a");a.innerHTML="<xyz></xyz>";j="hidden"in a;var b;if(!(b=1==a.childNodes.length)){f.createElement("a");var c=f.createDocumentFragment();b="undefined"==typeof c.cloneNode||
|
||||
"undefined"==typeof c.createDocumentFragment||"undefined"==typeof c.createElement}g=b}catch(d){g=j=!0}})();var e={elements:k.elements||"abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video",version:"3.6.2pre",shivCSS:!1!==k.shivCSS,supportsUnknownElements:g,shivMethods:!1!==k.shivMethods,type:"default",shivDocument:q,createElement:p,createDocumentFragment:function(a,b){a||(a=f);if(g)return a.createDocumentFragment();
|
||||
for(var b=b||i(a),c=b.frag.cloneNode(),d=0,e=m(),h=e.length;d<h;d++)c.createElement(e[d]);return c}};l.html5=e;q(f)})(this,document);
|
||||
7
website/source/assets/javascripts/jquery.waypoints.min.js
vendored
Executable file
7
website/source/assets/javascripts/jquery.waypoints.min.js
vendored
Executable file
File diff suppressed because one or more lines are too long
145
website/source/assets/javascripts/lib/Base.js
Normal file
145
website/source/assets/javascripts/lib/Base.js
Normal file
@@ -0,0 +1,145 @@
|
||||
/*
|
||||
Based on Base.js 1.1a (c) 2006-2010, Dean Edwards
|
||||
Updated to pass JSHint and converted into a module by Kenneth Powers
|
||||
License: http://www.opensource.org/licenses/mit-license.php
|
||||
*/
|
||||
/*global define:true module:true*/
|
||||
/*jshint eqeqeq:true*/
|
||||
(function (name, global, definition) {
|
||||
if (typeof module !== 'undefined') {
|
||||
module.exports = definition();
|
||||
} else if (typeof define !== 'undefined' && typeof define.amd === 'object') {
|
||||
define(definition);
|
||||
} else {
|
||||
global[name] = definition();
|
||||
}
|
||||
})('Base', this, function () {
|
||||
// Base Object
|
||||
var Base = function () {};
|
||||
|
||||
// Implementation
|
||||
Base.extend = function (_instance, _static) { // subclass
|
||||
var extend = Base.prototype.extend;
|
||||
// build the prototype
|
||||
Base._prototyping = true;
|
||||
var proto = new this();
|
||||
extend.call(proto, _instance);
|
||||
proto.base = function () {
|
||||
// call this method from any other method to invoke that method's ancestor
|
||||
};
|
||||
delete Base._prototyping;
|
||||
// create the wrapper for the constructor function
|
||||
//var constructor = proto.constructor.valueOf(); //-dean
|
||||
var constructor = proto.constructor;
|
||||
var klass = proto.constructor = function () {
|
||||
if (!Base._prototyping) {
|
||||
if (this._constructing || this.constructor === klass) { // instantiation
|
||||
this._constructing = true;
|
||||
constructor.apply(this, arguments);
|
||||
delete this._constructing;
|
||||
} else if (arguments[0] !== null) { // casting
|
||||
return (arguments[0].extend || extend).call(arguments[0], proto);
|
||||
}
|
||||
}
|
||||
};
|
||||
// build the class interface
|
||||
klass.ancestor = this;
|
||||
klass.extend = this.extend;
|
||||
klass.forEach = this.forEach;
|
||||
klass.implement = this.implement;
|
||||
klass.prototype = proto;
|
||||
klass.toString = this.toString;
|
||||
klass.valueOf = function (type) {
|
||||
return (type === 'object') ? klass : constructor.valueOf();
|
||||
};
|
||||
extend.call(klass, _static);
|
||||
// class initialization
|
||||
if (typeof klass.init === 'function') klass.init();
|
||||
return klass;
|
||||
};
|
||||
|
||||
Base.prototype = {
|
||||
extend: function (source, value) {
|
||||
if (arguments.length > 1) { // extending with a name/value pair
|
||||
var ancestor = this[source];
|
||||
if (ancestor && (typeof value === 'function') && // overriding a method?
|
||||
// the valueOf() comparison is to avoid circular references
|
||||
(!ancestor.valueOf || ancestor.valueOf() !== value.valueOf()) && /\bbase\b/.test(value)) {
|
||||
// get the underlying method
|
||||
var method = value.valueOf();
|
||||
// override
|
||||
value = function () {
|
||||
var previous = this.base || Base.prototype.base;
|
||||
this.base = ancestor;
|
||||
var returnValue = method.apply(this, arguments);
|
||||
this.base = previous;
|
||||
return returnValue;
|
||||
};
|
||||
// point to the underlying method
|
||||
value.valueOf = function (type) {
|
||||
return (type === 'object') ? value : method;
|
||||
};
|
||||
value.toString = Base.toString;
|
||||
}
|
||||
this[source] = value;
|
||||
} else if (source) { // extending with an object literal
|
||||
var extend = Base.prototype.extend;
|
||||
// if this object has a customized extend method then use it
|
||||
if (!Base._prototyping && typeof this !== 'function') {
|
||||
extend = this.extend || extend;
|
||||
}
|
||||
var proto = {
|
||||
toSource: null
|
||||
};
|
||||
// do the "toString" and other methods manually
|
||||
var hidden = ['constructor', 'toString', 'valueOf'];
|
||||
// if we are prototyping then include the constructor
|
||||
for (var i = Base._prototyping ? 0 : 1; i < hidden.length; i++) {
|
||||
var h = hidden[i];
|
||||
if (source[h] !== proto[h])
|
||||
extend.call(this, h, source[h]);
|
||||
}
|
||||
// copy each of the source object's properties to this object
|
||||
for (var key in source) {
|
||||
if (!proto[key]) extend.call(this, key, source[key]);
|
||||
}
|
||||
}
|
||||
return this;
|
||||
}
|
||||
};
|
||||
|
||||
// initialize
|
||||
Base = Base.extend({
|
||||
constructor: function () {
|
||||
this.extend(arguments[0]);
|
||||
}
|
||||
}, {
|
||||
ancestor: Object,
|
||||
version: '1.1',
|
||||
forEach: function (object, block, context) {
|
||||
for (var key in object) {
|
||||
if (this.prototype[key] === undefined) {
|
||||
block.call(context, object[key], key, object);
|
||||
}
|
||||
}
|
||||
},
|
||||
implement: function () {
|
||||
for (var i = 0; i < arguments.length; i++) {
|
||||
if (typeof arguments[i] === 'function') {
|
||||
// if it's a function, call it
|
||||
arguments[i](this.prototype);
|
||||
} else {
|
||||
// add the interface using the extend method
|
||||
this.prototype.extend(arguments[i]);
|
||||
}
|
||||
}
|
||||
return this;
|
||||
},
|
||||
toString: function () {
|
||||
return String(this.valueOf());
|
||||
}
|
||||
});
|
||||
|
||||
// Return Base implementation
|
||||
return Base;
|
||||
});
|
||||
92
website/source/assets/javascripts/lib/Chainable.js
Normal file
92
website/source/assets/javascripts/lib/Chainable.js
Normal file
@@ -0,0 +1,92 @@
|
||||
(function(){
|
||||
|
||||
var Chainable = function(engine){
|
||||
this.engine = engine;
|
||||
this._chain = [];
|
||||
this._updateTimer = this._updateTimer.bind(this);
|
||||
this._cycle = this._cycle.bind(this);
|
||||
};
|
||||
|
||||
Chainable.prototype._running = false;
|
||||
|
||||
Chainable.prototype._updateTimer = function(tick){
|
||||
this._timer += tick;
|
||||
if (this._timer >= this._timerMax) {
|
||||
this.resetTimer();
|
||||
this._cycle();
|
||||
}
|
||||
};
|
||||
|
||||
Chainable.prototype.resetTimer = function(){
|
||||
this.engine.updateChainTimer = undefined;
|
||||
this._timer = 0;
|
||||
this._timerMax = 0;
|
||||
return this;
|
||||
};
|
||||
|
||||
Chainable.prototype.start = function(){
|
||||
if (this._running || !this._chain.length) {
|
||||
return this;
|
||||
}
|
||||
this._running = true;
|
||||
return this._cycle();
|
||||
};
|
||||
|
||||
Chainable.prototype.reset = function(){
|
||||
if (!this._running) {
|
||||
return this;
|
||||
}
|
||||
this.resetTimer();
|
||||
this._timer = 0;
|
||||
this._running = false;
|
||||
return this;
|
||||
};
|
||||
|
||||
Chainable.prototype._cycle = function(){
|
||||
var current;
|
||||
if (!this._chain.length) {
|
||||
return this.reset();
|
||||
}
|
||||
|
||||
current = this._chain.shift();
|
||||
|
||||
if (current.type === 'function') {
|
||||
current.func.apply(current.scope, current.args);
|
||||
current = null;
|
||||
return this._cycle();
|
||||
}
|
||||
if (current.type === 'wait') {
|
||||
this.resetTimer();
|
||||
// Convert timer to seconds
|
||||
this._timerMax = current.time / 1000;
|
||||
this.engine.updateChainTimer = this._updateTimer;
|
||||
current = null;
|
||||
}
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
Chainable.prototype.then = Chainable.prototype.exec = function(func, scope, args){
|
||||
this._chain.push({
|
||||
type : 'function',
|
||||
|
||||
func : func,
|
||||
scope : scope || window,
|
||||
args : args || []
|
||||
});
|
||||
|
||||
return this.start();
|
||||
};
|
||||
|
||||
Chainable.prototype.wait = function(time){
|
||||
this._chain.push({
|
||||
type : 'wait',
|
||||
time : time
|
||||
});
|
||||
|
||||
return this.start();
|
||||
};
|
||||
|
||||
window.Chainable = Chainable;
|
||||
|
||||
})();
|
||||
@@ -0,0 +1,21 @@
|
||||
if (!Function.prototype.bind) {
|
||||
Function.prototype.bind = function (oThis) {
|
||||
if (typeof this !== "function") {
|
||||
throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");
|
||||
}
|
||||
|
||||
var aArgs = Array.prototype.slice.call(arguments, 1),
|
||||
fToBind = this,
|
||||
fNOP = function () {},
|
||||
fBound = function () {
|
||||
return fToBind.apply(this instanceof fNOP && oThis ?
|
||||
this : oThis,
|
||||
aArgs.concat(Array.prototype.slice.call(arguments)));
|
||||
};
|
||||
|
||||
fNOP.prototype = this.prototype;
|
||||
fBound.prototype = new fNOP();
|
||||
|
||||
return fBound;
|
||||
};
|
||||
}
|
||||
14
website/source/assets/javascripts/lib/String.substitute.js
Normal file
14
website/source/assets/javascripts/lib/String.substitute.js
Normal file
@@ -0,0 +1,14 @@
|
||||
(function(String){
|
||||
|
||||
if (String.prototype.substitute) {
|
||||
return;
|
||||
}
|
||||
|
||||
String.prototype.substitute = function(object, regexp){
|
||||
return String(this).replace(regexp || (/\\?\{([^{}]+)\}/g), function(match, name){
|
||||
if (match.charAt(0) == '\\') return match.slice(1);
|
||||
return (object[name] !== null) ? object[name] : '';
|
||||
});
|
||||
};
|
||||
|
||||
})(String);
|
||||
60
website/source/assets/javascripts/lib/dbg.js
Normal file
60
website/source/assets/javascripts/lib/dbg.js
Normal file
@@ -0,0 +1,60 @@
|
||||
/*
|
||||
*
|
||||
* name: dbg
|
||||
*
|
||||
* description: A bad ass little console utility, check the README for deets
|
||||
*
|
||||
* license: MIT-style license
|
||||
*
|
||||
* author: Amadeus Demarzi
|
||||
*
|
||||
* provides: window.dbg
|
||||
*
|
||||
*/
|
||||
|
||||
(function(){
|
||||
|
||||
var global = this,
|
||||
|
||||
// Get the real console or set to null for easy boolean checks
|
||||
realConsole = global.console || null,
|
||||
|
||||
// Backup / Disabled Lambda
|
||||
fn = function(){},
|
||||
|
||||
// Supported console methods
|
||||
methodNames = ['log', 'error', 'warn', 'info', 'count', 'debug', 'profileEnd', 'trace', 'dir', 'dirxml', 'assert', 'time', 'profile', 'timeEnd', 'group', 'groupEnd'],
|
||||
|
||||
// Disabled Console
|
||||
disabledConsole = {
|
||||
|
||||
// Enables dbg, if it exists, otherwise it just provides disabled
|
||||
enable: function(quiet){
|
||||
global.dbg = realConsole ? realConsole : disabledConsole;
|
||||
},
|
||||
|
||||
// Disable dbg
|
||||
disable: function(){
|
||||
global.dbg = disabledConsole;
|
||||
}
|
||||
|
||||
}, name, i;
|
||||
|
||||
// Setup disabled console and provide fallbacks on the real console
|
||||
for (i = 0; i < methodNames.length;i++){
|
||||
name = methodNames[i];
|
||||
disabledConsole[name] = fn;
|
||||
if (realConsole && !realConsole[name])
|
||||
realConsole[name] = fn;
|
||||
}
|
||||
|
||||
// Add enable/disable methods
|
||||
if (realConsole) {
|
||||
realConsole.disable = disabledConsole.disable;
|
||||
realConsole.enable = disabledConsole.enable;
|
||||
}
|
||||
|
||||
// Enable dbg
|
||||
disabledConsole.enable();
|
||||
|
||||
}).call(this);
|
||||
6
website/source/assets/javascripts/respond.min.js
vendored
Executable file
6
website/source/assets/javascripts/respond.min.js
vendored
Executable file
@@ -0,0 +1,6 @@
|
||||
/*! matchMedia() polyfill - Test a CSS media type/query in JS. Authors & copyright (c) 2012: Scott Jehl, Paul Irish, Nicholas Zakas. Dual MIT/BSD license */
|
||||
/*! NOTE: If you're already including a window.matchMedia polyfill via Modernizr or otherwise, you don't need this part */
|
||||
window.matchMedia=window.matchMedia||function(a){"use strict";var c,d=a.documentElement,e=d.firstElementChild||d.firstChild,f=a.createElement("body"),g=a.createElement("div");return g.id="mq-test-1",g.style.cssText="position:absolute;top:-100em",f.style.background="none",f.appendChild(g),function(a){return g.innerHTML='­<style media="'+a+'"> #mq-test-1 { width: 42px; }</style>',d.insertBefore(f,e),c=42===g.offsetWidth,d.removeChild(f),{matches:c,media:a}}}(document);
|
||||
|
||||
/*! Respond.js v1.1.0: min/max-width media query polyfill. (c) Scott Jehl. MIT/GPLv2 Lic. j.mp/respondjs */
|
||||
(function(a){"use strict";function x(){u(!0)}var b={};a.respond=b,b.update=function(){},b.mediaQueriesSupported=a.matchMedia&&a.matchMedia("only all").matches,b.mediaQueriesSupported;var q,r,t,c=a.document,d=c.documentElement,e=[],f=[],g=[],h={},i=30,j=c.getElementsByTagName("head")[0]||d,k=c.getElementsByTagName("base")[0],l=j.getElementsByTagName("link"),m=[],n=function(){for(var b=0;l.length>b;b++){var c=l[b],d=c.href,e=c.media,f=c.rel&&"stylesheet"===c.rel.toLowerCase();d&&f&&!h[d]&&(c.styleSheet&&c.styleSheet.rawCssText?(p(c.styleSheet.rawCssText,d,e),h[d]=!0):(!/^([a-zA-Z:]*\/\/)/.test(d)&&!k||d.replace(RegExp.$1,"").split("/")[0]===a.location.host)&&m.push({href:d,media:e}))}o()},o=function(){if(m.length){var a=m.shift();v(a.href,function(b){p(b,a.href,a.media),h[a.href]=!0,setTimeout(function(){o()},0)})}},p=function(a,b,c){var d=a.match(/@media[^\{]+\{([^\{\}]*\{[^\}\{]*\})+/gi),g=d&&d.length||0;b=b.substring(0,b.lastIndexOf("/"));var h=function(a){return a.replace(/(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g,"$1"+b+"$2$3")},i=!g&&c;b.length&&(b+="/"),i&&(g=1);for(var j=0;g>j;j++){var k,l,m,n;i?(k=c,f.push(h(a))):(k=d[j].match(/@media *([^\{]+)\{([\S\s]+?)$/)&&RegExp.$1,f.push(RegExp.$2&&h(RegExp.$2))),m=k.split(","),n=m.length;for(var o=0;n>o;o++)l=m[o],e.push({media:l.split("(")[0].match(/(only\s+)?([a-zA-Z]+)\s?/)&&RegExp.$2||"all",rules:f.length-1,hasquery:l.indexOf("(")>-1,minw:l.match(/\(min\-width:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/)&&parseFloat(RegExp.$1)+(RegExp.$2||""),maxw:l.match(/\(max\-width:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/)&&parseFloat(RegExp.$1)+(RegExp.$2||"")})}u()},s=function(){var a,b=c.createElement("div"),e=c.body,f=!1;return b.style.cssText="position:absolute;font-size:1em;width:1em",e||(e=f=c.createElement("body"),e.style.background="none"),e.appendChild(b),d.insertBefore(e,d.firstChild),a=b.offsetWidth,f?d.removeChild(e):e.removeChild(b),a=t=parseFloat(a)},u=function(a){var b="clientWidth",h=d[b],k="CSS1Compat"===c.compatMode&&h||c.body[b]||h,m={},n=l[l.length-1],o=(new Date).getTime();if(a&&q&&i>o-q)return clearTimeout(r),r=setTimeout(u,i),void 0;q=o;for(var p in e)if(e.hasOwnProperty(p)){var v=e[p],w=v.minw,x=v.maxw,y=null===w,z=null===x,A="em";w&&(w=parseFloat(w)*(w.indexOf(A)>-1?t||s():1)),x&&(x=parseFloat(x)*(x.indexOf(A)>-1?t||s():1)),v.hasquery&&(y&&z||!(y||k>=w)||!(z||x>=k))||(m[v.media]||(m[v.media]=[]),m[v.media].push(f[v.rules]))}for(var B in g)g.hasOwnProperty(B)&&g[B]&&g[B].parentNode===j&&j.removeChild(g[B]);for(var C in m)if(m.hasOwnProperty(C)){var D=c.createElement("style"),E=m[C].join("\n");D.type="text/css",D.media=C,j.insertBefore(D,n.nextSibling),D.styleSheet?D.styleSheet.cssText=E:D.appendChild(c.createTextNode(E)),g.push(D)}},v=function(a,b){var c=w();c&&(c.open("GET",a,!0),c.onreadystatechange=function(){4!==c.readyState||200!==c.status&&304!==c.status||b(c.responseText)},4!==c.readyState&&c.send(null))},w=function(){var b=!1;try{b=new a.XMLHttpRequest}catch(c){b=new a.ActiveXObject("Microsoft.XMLHTTP")}return function(){return b}}();n(),b.update=n,a.addEventListener?a.addEventListener("resize",x,!1):a.attachEvent&&a.attachEvent("onresize",x)})(this);
|
||||
Reference in New Issue
Block a user