Commit 9edecadd authored by TasteBot's avatar TasteBot

update the build files for gh-pages [ci skip]

parent f7677595
node_modules/
node_modules/.bin/
node_modules/depot/
!node_modules/depot/depot.js
node_modules/es5-shim/
!node_modules/es5-shim/es5-shim.js
!node_modules/es5-shim/es5-sham.js
node_modules/jquery/
!node_modules/jquery/dist
node_modules/jquery/dist/
!node_modules/jquery/dist/jquery.js
node_modules/flight/
!node_modules/flight/lib
node_modules/requirejs/
!node_modules/requirejs/require.js
node_modules/requirejs-text/
!node_modules/requirejs-text/text.js
node_modules/todomvc-app-css/
!node_modules/todomvc-app-css/index.css
node_modules/todomvc-common/
!node_modules/todomvc-common/base.css
!node_modules/todomvc-common/base.js
node_modules/karma/
node_modules/karma-chrome-launcher/
node_modules/karma-firefox-launcher/
node_modules/karma-ie-launcher/
node_modules/karma-jasmine/
node_modules/karma-phantomjs-launcher/
node_modules/jasmine-jquery/
node_modules/jasmine-flight/
node_modules/karma-safari-launcher/
node_modules/karma-requirejs/
......@@ -4,12 +4,12 @@
require.config({
baseUrl: './',
paths: {
jquery: 'bower_components/jquery/dist/jquery',
es5shim: 'bower_components/es5-shim/es5-shim',
es5sham: 'bower_components/es5-shim/es5-sham',
text: 'bower_components/requirejs-text/text',
flight: 'bower_components/flight',
depot: 'bower_components/depot/depot',
jquery: 'node_modules/jquery/dist/jquery',
es5shim: 'node_modules/es5-shim/es5-shim',
es5sham: 'node_modules/es5-shim/es5-sham',
text: 'node_modules/requirejs-text/text',
flight: 'node_modules/flight',
depot: 'node_modules/depot/depot',
app: 'app/js',
templates: 'app/templates',
ui: 'app/js/ui',
......
{
"name": "flight-todomvc",
"version": "0.0.0",
"dependencies": {
"depot": "~0.1.6",
"flight": "~1.3.0",
"jquery": "2.1.0",
"requirejs": "~2.1.15",
"todomvc-common": "~0.3.0",
"requirejs-text": "~2.0.13"
},
"devDependencies": {
"jasmine-flight": "~4.0.0",
"jasmine-jquery": "~2.0.5"
}
}
......@@ -3,7 +3,8 @@
<head>
<meta charset="utf-8">
<title>Flight • Todo</title>
<link rel="stylesheet" href="bower_components/todomvc-common/base.css">
<link rel="stylesheet" href="node_modules/todomvc-common/base.css">
<link rel="stylesheet" href="node_modules/todomvc-app-css/index.css">
</head>
<body>
<section id="todoapp">
......@@ -23,7 +24,7 @@
<p>Created by <a href="http://github.com/mkuklis">Michal Kuklis</a></p>
<p>Part of <a href="http://todomvc.com">TodoMVC</a></p>
</footer>
<script src="bower_components/todomvc-common/base.js"></script>
<script data-main="app/js/main" src="bower_components/requirejs/require.js"></script>
<script src="node_modules/todomvc-common/base.js"></script>
<script data-main="app/js/main" src="node_modules/requirejs/require.js"></script>
</body>
</html>
......@@ -15,21 +15,22 @@ module.exports = function (config) {
// list of files / patterns to load in the browser
files: [
// loaded without require
'bower_components/es5-shim/es5-shim.js',
'bower_components/es5-shim/es5-sham.js',
'node_modules/es5-shim/es5-shim.js',
'node_modules/es5-shim/es5-sham.js',
'bower_components/jquery/dist/jquery.js',
'bower_components/jasmine-jquery/lib/jasmine-jquery.js',
'bower_components/jasmine-flight/lib/jasmine-flight.js',
'node_modules/jquery/dist/jquery.js',
'node_modules/jasmine-jquery/lib/jasmine-jquery.js',
'node_modules/jasmine-flight/lib/jasmine-flight.js',
// hack to load RequireJS after the shim libs
'node_modules/requirejs/require.js',
'node_modules/karma-requirejs/lib/adapter.js',
// loaded with require
{ pattern: 'bower_components/flight/**/*.js', included: false },
{ pattern: 'bower_components/depot/**/*.js', included: false },
{ pattern: 'bower_components/requirejs-text/text.js', included: false },
{ pattern: 'node_modules/flight/lib/*.js', included: false },
{ pattern: 'node_modules/flight/index.js', included: false },
{ pattern: 'node_modules/depot/depot.js', included: false },
{ pattern: 'node_modules/requirejs-text/text.js', included: false },
{ pattern: 'app/**/*.js', included: false },
{ pattern: 'app/**/*.html', included: false },
{ pattern: 'test/spec/**/*_spec.js', included: false },
......
......@@ -21,7 +21,9 @@
var api = {
save: function (record) {
var id;
var id, ids;
this.refresh();
if (!record[this.idAttribute]) {
record[this.idAttribute] = guid();
......@@ -31,7 +33,9 @@
if (this.ids.indexOf(id) < 0) {
this.ids.push(id);
this.storageAdaptor.setItem(this.name, this.ids.join(","));
ids = this.ids.join(",");
this.storageAdaptor.setItem(this.name, ids);
this.store = ids;
}
this.storageAdaptor.setItem(getKey(this.name, id), JSON.stringify(record));
......@@ -73,6 +77,8 @@
if (!criteria) return this.all();
this.refresh();
return this.ids.reduce(function (memo, id) {
record = jsonData(self.storageAdaptor.getItem(getKey(name, id)));
match = findMatch(criteria, record);
......@@ -92,6 +98,8 @@
all: function () {
var record, self = this, name = this.name;
this.refresh();
return this.ids.reduce(function (memo, id) {
record = self.storageAdaptor.getItem(getKey(name, id));
......@@ -121,6 +129,8 @@
destroyAll: function (criteria) {
var attr, id, match, record, key;
this.refresh();
for (var i = this.ids.length - 1; i >= 0; i--) {
id = this.ids[i];
key = getKey(this.name, id);
......@@ -151,7 +161,20 @@
},
size: function () {
this.refresh();
return this.ids.length;
},
refresh: function () {
var store = this.storageAdaptor.getItem(this.name);
if (this.store && this.store === store) {
return;
}
this.ids = (store && store.split(",")) || [];
this.store = store;
}
};
......@@ -202,7 +225,7 @@
}
function depot(name, options) {
var store, ids;
var instance;
options = extend({
idAttribute: '_id',
......@@ -211,16 +234,15 @@
if (!options.storageAdaptor) throw new Error("No storage adaptor was found");
store = options.storageAdaptor.getItem(name);
ids = (store && store.split(",")) || [];
return Object.create(api, {
instance = Object.create(api, {
name: { value: name },
store: { value: store },
ids: { value: ids, writable: true },
idAttribute: { value: options.idAttribute },
storageAdaptor: { value: options.storageAdaptor }
});
instance.refresh();
return instance;
}
return depot;
......
// Copyright 2009-2012 by contributors, MIT License
// vim: ts=4 sts=4 sw=4 expandtab
//Add semicolon to prevent IIFE from being passed as argument to concated code.
;
// Module systems magic dance
(function (definition) {
// RequireJS
......@@ -15,10 +17,28 @@
}
})(function () {
var call = Function.prototype.call;
var prototypeOfObject = Object.prototype;
var owns = call.bind(prototypeOfObject.hasOwnProperty);
// If JS engine supports accessors creating shortcuts.
var defineGetter;
var defineSetter;
var lookupGetter;
var lookupSetter;
var supportsAccessors;
if ((supportsAccessors = owns(prototypeOfObject, "__defineGetter__"))) {
defineGetter = call.bind(prototypeOfObject.__defineGetter__);
defineSetter = call.bind(prototypeOfObject.__defineSetter__);
lookupGetter = call.bind(prototypeOfObject.__lookupGetter__);
lookupSetter = call.bind(prototypeOfObject.__lookupSetter__);
}
// ES5 15.2.3.2
// http://es5.github.com/#x15.2.3.2
if (!Object.getPrototypeOf) {
// https://github.com/kriskowal/es5-shim/issues#issue/2
// https://github.com/es-shims/es5-shim/issues#issue/2
// http://ejohn.org/blog/objectgetprototypeof/
// recommended by fschaefer on github
Object.getPrototypeOf = function getPrototypeOf(object) {
......@@ -30,15 +50,53 @@ if (!Object.getPrototypeOf) {
};
}
// ES5 15.2.3.3
// http://es5.github.com/#x15.2.3.3
if (!Object.getOwnPropertyDescriptor) {
//ES5 15.2.3.3
//http://es5.github.com/#x15.2.3.3
function doesGetOwnPropertyDescriptorWork(object) {
try {
object.sentinel = 0;
return Object.getOwnPropertyDescriptor(
object,
"sentinel"
).value === 0;
} catch (exception) {
// returns falsy
}
}
//check whether getOwnPropertyDescriptor works if it's given. Otherwise,
//shim partially.
if (Object.defineProperty) {
var getOwnPropertyDescriptorWorksOnObject =
doesGetOwnPropertyDescriptorWork({});
var getOwnPropertyDescriptorWorksOnDom = typeof document == "undefined" ||
doesGetOwnPropertyDescriptorWork(document.createElement("div"));
if (!getOwnPropertyDescriptorWorksOnDom ||
!getOwnPropertyDescriptorWorksOnObject
) {
var getOwnPropertyDescriptorFallback = Object.getOwnPropertyDescriptor;
}
}
if (!Object.getOwnPropertyDescriptor || getOwnPropertyDescriptorFallback) {
var ERR_NON_OBJECT = "Object.getOwnPropertyDescriptor called on a non-object: ";
Object.getOwnPropertyDescriptor = function getOwnPropertyDescriptor(object, property) {
if ((typeof object != "object" && typeof object != "function") || object === null) {
throw new TypeError(ERR_NON_OBJECT + object);
}
// make a valiant attempt to use the real getOwnPropertyDescriptor
// for I8's DOM elements.
if (getOwnPropertyDescriptorFallback) {
try {
return getOwnPropertyDescriptorFallback.call(Object, object, property);
} catch (exception) {
// try the shim if the real one doesn't work
}
}
// If object does not owns property return undefined immediately.
if (!owns(object, property)) {
return;
......@@ -81,6 +139,7 @@ if (!Object.getOwnPropertyDescriptor) {
// If we got this far we know that object has an own property that is
// not an accessor so we set it as a value and return descriptor.
descriptor.value = object[property];
descriptor.writable = true;
return descriptor;
};
}
......@@ -96,15 +155,64 @@ if (!Object.getOwnPropertyNames) {
// ES5 15.2.3.5
// http://es5.github.com/#x15.2.3.5
if (!Object.create) {
// Contributed by Brandon Benvie, October, 2012
var createEmpty;
var supportsProto = Object.prototype.__proto__ === null;
if (supportsProto || typeof document == 'undefined') {
createEmpty = function () {
return { "__proto__": null };
};
} else {
// In old IE __proto__ can't be used to manually set `null`, nor does
// any other method exist to make an object that inherits from nothing,
// aside from Object.prototype itself. Instead, create a new global
// object and *steal* its Object.prototype and strip it bare. This is
// used as the prototype to create nullary objects.
createEmpty = function () {
var iframe = document.createElement('iframe');
var parent = document.body || document.documentElement;
iframe.style.display = 'none';
parent.appendChild(iframe);
iframe.src = 'javascript:';
var empty = iframe.contentWindow.Object.prototype;
parent.removeChild(iframe);
iframe = null;
delete empty.constructor;
delete empty.hasOwnProperty;
delete empty.propertyIsEnumerable;
delete empty.isPrototypeOf;
delete empty.toLocaleString;
delete empty.toString;
delete empty.valueOf;
empty.__proto__ = null;
function Empty() {}
Empty.prototype = empty;
// short-circuit future calls
createEmpty = function () {
return new Empty();
};
return new Empty();
};
}
Object.create = function create(prototype, properties) {
var object;
function Type() {} // An empty constructor.
if (prototype === null) {
object = { "__proto__": null };
object = createEmpty();
} else {
if (typeof prototype != "object") {
throw new TypeError("typeof prototype["+(typeof prototype)+"] != 'object'");
if (typeof prototype !== "object" && typeof prototype !== "function") {
// In the native implementation `parent` can be `null`
// OR *any* `instanceof Object` (Object|Function|Array|RegExp|etc)
// Use `typeof` tho, b/c in old IE, DOM elements are not `instanceof Object`
// like they are in modern browsers. Using `Object.create` on DOM elements
// is...err...probably inappropriate, but the native version allows for it.
throw new TypeError("Object prototype may only be an Object or null"); // same msg as Chrome
}
var Type = function () {};
Type.prototype = prototype;
object = new Type();
// IE has no built-in implementation of `Object.getPrototypeOf`
......@@ -113,9 +221,11 @@ if (!Object.create) {
// objects created using `Object.create`
object.__proto__ = prototype;
}
if (properties !== void 0) {
Object.defineProperties(object, properties);
}
return object;
};
}
......@@ -125,7 +235,7 @@ if (!Object.create) {
// Patch for WebKit and IE8 standard mode
// Designed by hax <hax.github.com>
// related issue: https://github.com/kriskowal/es5-shim/issues#issue/5
// related issue: https://github.com/es-shims/es5-shim/issues#issue/5
// IE8 Reference:
// http://msdn.microsoft.com/en-us/library/dd282900.aspx
// http://msdn.microsoft.com/en-us/library/dd229916.aspx
......@@ -148,7 +258,8 @@ if (Object.defineProperty) {
var definePropertyWorksOnDom = typeof document == "undefined" ||
doesDefinePropertyWork(document.createElement("div"));
if (!definePropertyWorksOnObject || !definePropertyWorksOnDom) {
var definePropertyFallback = Object.defineProperty;
var definePropertyFallback = Object.defineProperty,
definePropertiesFallback = Object.defineProperties;
}
}
......@@ -228,8 +339,17 @@ if (!Object.defineProperty || definePropertyFallback) {
// ES5 15.2.3.7
// http://es5.github.com/#x15.2.3.7
if (!Object.defineProperties) {
if (!Object.defineProperties || definePropertiesFallback) {
Object.defineProperties = function defineProperties(object, properties) {
// make a valiant attempt to use the real defineProperties
if (definePropertiesFallback) {
try {
return definePropertiesFallback.call(Object, object, properties);
} catch (exception) {
// try the shim if the real one doesn't work
}
}
for (var property in properties) {
if (owns(properties, property) && property != "__proto__") {
Object.defineProperty(object, property, properties[property]);
......
/**
* @license RequireJS text 2.0.13 Copyright (c) 2010-2014, The Dojo Foundation All Rights Reserved.
* @license RequireJS text 2.0.12 Copyright (c) 2010-2014, The Dojo Foundation All Rights Reserved.
* Available via the MIT or new BSD license.
* see: http://github.com/requirejs/text for details
*/
......@@ -23,7 +23,7 @@ define(['module'], function (module) {
masterConfig = (module.config && module.config()) || {};
text = {
version: '2.0.13',
version: '2.0.12',
strip: function (content) {
//Strips <?xml ...?> declarations so that external SVG and XML
......@@ -85,13 +85,13 @@ define(['module'], function (module) {
parseName: function (name) {
var modName, ext, temp,
strip = false,
index = name.lastIndexOf("."),
index = name.indexOf("."),
isRelative = name.indexOf('./') === 0 ||
name.indexOf('../') === 0;
if (index !== -1 && (!isRelative || index > 1)) {
modName = name.substring(0, index);
ext = name.substring(index + 1);
ext = name.substring(index + 1, name.length);
} else {
modName = name;
}
......@@ -252,7 +252,7 @@ define(['module'], function (module) {
try {
var file = fs.readFileSync(url, 'utf8');
//Remove BOM (Byte Mark Order) from utf8 files if it is there.
if (file[0] === '\uFEFF') {
if (file.indexOf('\uFEFF') === 0) {
file = file.substring(1);
}
callback(file);
......
hr {
margin: 20px 0;
border: 0;
border-top: 1px dashed #c5c5c5;
border-bottom: 1px dashed #f7f7f7;
}
.learn a {
font-weight: normal;
text-decoration: none;
color: #b83f45;
}
.learn a:hover {
text-decoration: underline;
color: #787e7e;
}
.learn h3,
.learn h4,
.learn h5 {
margin: 10px 0;
font-weight: 500;
line-height: 1.2;
color: #000;
}
.learn h3 {
font-size: 24px;
}
.learn h4 {
font-size: 18px;
}
.learn h5 {
margin-bottom: 0;
font-size: 14px;
}
.learn ul {
padding: 0;
margin: 0 0 30px 25px;
}
.learn li {
line-height: 20px;
}
.learn p {
font-size: 15px;
font-weight: 300;
line-height: 1.3;
margin-top: 0;
margin-bottom: 0;
}
#issue-count {
display: none;
}
.quote {
border: none;
margin: 20px 0 60px 0;
}
.quote p {
font-style: italic;
}
.quote p:before {
content: '“';
font-size: 50px;
opacity: .15;
position: absolute;
top: -20px;
left: 3px;
}
.quote p:after {
content: '”';
font-size: 50px;
opacity: .15;
position: absolute;
bottom: -42px;
right: 3px;
}
.quote footer {
position: absolute;
bottom: -40px;
right: 0;
}
.quote footer img {
border-radius: 3px;
}
.quote footer a {
margin-left: 5px;
vertical-align: middle;
}
.speech-bubble {
position: relative;
padding: 10px;
background: rgba(0, 0, 0, .04);
border-radius: 5px;
}
.speech-bubble:after {
content: '';
position: absolute;
top: 100%;
right: 30px;
border: 13px solid transparent;
border-top-color: rgba(0, 0, 0, .04);
}
.learn-bar > .learn {
position: absolute;
width: 272px;
top: 8px;
left: -300px;
padding: 10px;
border-radius: 5px;
background-color: rgba(255, 255, 255, .6);
transition-property: left;
transition-duration: 500ms;
}
@media (min-width: 899px) {
.learn-bar {
width: auto;
padding-left: 300px;
}
.learn-bar > .learn {
left: 8px;
}
}
/* global _ */
(function () {
'use strict';
/* jshint ignore:start */
// Underscore's Template Module
// Courtesy of underscorejs.org
var _ = (function (_) {
......@@ -114,6 +116,7 @@
if (location.hostname === 'todomvc.com') {
window._gaq = [['_setAccount','UA-31081062-1'],['_trackPageview']];(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];g.src='//www.google-analytics.com/ga.js';s.parentNode.insertBefore(g,s)}(document,'script'));
}
/* jshint ignore:end */
function redirect() {
if (location.hostname === 'tastejs.github.io') {
......@@ -175,13 +178,17 @@
if (learnJSON.backend) {
this.frameworkJSON = learnJSON.backend;
this.frameworkJSON.issueLabel = framework;
this.append({
backend: true
});
} else if (learnJSON[framework]) {
this.frameworkJSON = learnJSON[framework];
this.frameworkJSON.issueLabel = framework;
this.append();
}
this.fetchIssueCount();
}
Learn.prototype.append = function (opts) {
......@@ -212,6 +219,26 @@
document.body.insertAdjacentHTML('afterBegin', aside.outerHTML);
};
Learn.prototype.fetchIssueCount = function () {
var issueLink = document.getElementById('issue-count-link');
if (issueLink) {
var url = issueLink.href.replace('https://github.com', 'https://api.github.com/repos');
var xhr = new XMLHttpRequest();
xhr.open('GET', url, true);
xhr.onload = function (e) {
var parsedResponse = JSON.parse(e.target.responseText);
if (parsedResponse instanceof Array) {
var count = parsedResponse.length
if (count !== 0) {
issueLink.innerHTML = 'This app has ' + count + ' open issues';
document.getElementById('issue-count').style.display = 'inline';
}
}
};
xhr.send();
}
};
redirect();
getFile('learn.json', Learn);
})();
{
"name": "flight-todomvc",
"version": "0.0.0",
"devDependencies": {
"karma": "~0.12.6",
"karma-jasmine": "~0.2.0",
"karma-requirejs": "~0.2.2",
"karma-chrome-launcher": "~0.1.0",
"karma-ie-launcher": "~0.1.1",
"karma-firefox-launcher": "~0.1.0",
"karma-phantomjs-launcher": "~0.1.0",
"karma-safari-launcher": "~0.1.1"
},
"scripts": {
"test": "karma start --browsers Firefox --single-run"
}
"private": true,
"dependencies": {
"depot": "^0.1.6",
"es5-shim": "^2.0.0",
"flightjs": "flightjs/flight#v1.3.0",
"jasmine-flight": "flightjs/jasmine-flight#4.0.0",
"jquery": "^2.1.0",
"requirejs": "^2.1.15",
"requirejs-text": "^2.0.12",
"todomvc-app-css": "^1.0.0",
"todomvc-common": "^1.0.1"
},
"devDependencies": {
"karma": "^0.12.6",
"karma-jasmine": "^0.2.0",
"karma-requirejs": "^0.2.2",
"karma-chrome-launcher": "^0.1.0",
"karma-ie-launcher": "^0.1.1",
"karma-firefox-launcher": "^0.1.0",
"karma-phantomjs-launcher": "^0.1.0",
"karma-safari-launcher": "^0.1.1",
"jasmine-jquery": "^2.0.5"
},
"scripts": {
"test": "karma start --browsers Firefox --single-run"
}
}
......@@ -13,9 +13,9 @@ requirejs.config({
baseUrl: '/base',
paths: {
flight: 'bower_components/flight',
depot: 'bower_components/depot/depot',
text: 'bower_components/requirejs-text/text',
flight: 'node_modules/flight',
depot: 'node_modules/depot/depot',
text: 'node_modules/requirejs-text/text',
ui: 'app/js/ui',
data: 'app/js/data',
app: 'app/js',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment