Commit 65ef22f5 authored by Stephen Sawchuk's avatar Stephen Sawchuk

update todomvc-common to 0.3.0

parent b785628e
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
"name": "agilityjs", "name": "agilityjs",
"version": "0.0.0", "version": "0.0.0",
"dependencies": { "dependencies": {
"todomvc-common": "~0.1.4", "todomvc-common": "~0.3.0",
"agility": "~0.1.3", "agility": "~0.1.3",
"jquery": "~1.9.1" "jquery": "~1.9.1"
} }
......
...@@ -171,25 +171,42 @@ ...@@ -171,25 +171,42 @@
framework = document.querySelector('[data-framework]').dataset.framework; framework = document.querySelector('[data-framework]').dataset.framework;
} }
this.template = template;
if (template && learnJSON[framework]) { if (learnJSON.backend) {
this.frameworkJSON = learnJSON.backend;
this.append({
backend: true
});
} else if (learnJSON[framework]) {
this.frameworkJSON = learnJSON[framework]; this.frameworkJSON = learnJSON[framework];
this.template = template;
this.append(); this.append();
} }
} }
Learn.prototype.append = function () { Learn.prototype.append = function (opts) {
var aside = document.createElement('aside'); var aside = document.createElement('aside');
aside.innerHTML = _.template(this.template, this.frameworkJSON); aside.innerHTML = _.template(this.template, this.frameworkJSON);
aside.className = 'learn'; aside.className = 'learn';
// Localize demo links if (opts && opts.backend) {
var demoLinks = aside.querySelectorAll('.demo-link'); // Remove demo link
Array.prototype.forEach.call(demoLinks, function (demoLink) { var sourceLinks = aside.querySelector('.source-links');
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href')); var heading = sourceLinks.firstElementChild;
}); var sourceLink = sourceLinks.lastElementChild;
// Correct link path
var href = sourceLink.getAttribute('href');
sourceLink.setAttribute('href', href.substr(href.lastIndexOf('http')));
sourceLinks.innerHTML = heading.outerHTML + sourceLink.outerHTML;
} else {
// Localize demo links
var demoLinks = aside.querySelectorAll('.demo-link');
Array.prototype.forEach.call(demoLinks, function (demoLink) {
if (demoLink.getAttribute('href').substr(0, 4) !== 'http') {
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href'));
}
});
}
document.body.className = (document.body.className + ' learn-bar').trim(); document.body.className = (document.body.className + ' learn-bar').trim();
document.body.insertAdjacentHTML('afterBegin', aside.outerHTML); document.body.insertAdjacentHTML('afterBegin', aside.outerHTML);
......
{
"name": "todomvc-common",
"description": "Common TodoMVC utilities used by our apps",
"license": "MIT",
"authors": [
"TasteJS team"
],
"main": [
"base.js",
"base.css"
],
"keywords": [
"todomvc",
"tastejs",
"util",
"utilities"
],
"ignore": [
"package.json",
"readme.md"
]
}
...@@ -171,25 +171,42 @@ ...@@ -171,25 +171,42 @@
framework = document.querySelector('[data-framework]').dataset.framework; framework = document.querySelector('[data-framework]').dataset.framework;
} }
this.template = template;
if (template && learnJSON[framework]) { if (learnJSON.backend) {
this.frameworkJSON = learnJSON.backend;
this.append({
backend: true
});
} else if (learnJSON[framework]) {
this.frameworkJSON = learnJSON[framework]; this.frameworkJSON = learnJSON[framework];
this.template = template;
this.append(); this.append();
} }
} }
Learn.prototype.append = function () { Learn.prototype.append = function (opts) {
var aside = document.createElement('aside'); var aside = document.createElement('aside');
aside.innerHTML = _.template(this.template, this.frameworkJSON); aside.innerHTML = _.template(this.template, this.frameworkJSON);
aside.className = 'learn'; aside.className = 'learn';
// Localize demo links if (opts && opts.backend) {
var demoLinks = aside.querySelectorAll('.demo-link'); // Remove demo link
Array.prototype.forEach.call(demoLinks, function (demoLink) { var sourceLinks = aside.querySelector('.source-links');
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href')); var heading = sourceLinks.firstElementChild;
}); var sourceLink = sourceLinks.lastElementChild;
// Correct link path
var href = sourceLink.getAttribute('href');
sourceLink.setAttribute('href', href.substr(href.lastIndexOf('http')));
sourceLinks.innerHTML = heading.outerHTML + sourceLink.outerHTML;
} else {
// Localize demo links
var demoLinks = aside.querySelectorAll('.demo-link');
Array.prototype.forEach.call(demoLinks, function (demoLink) {
if (demoLink.getAttribute('href').substr(0, 4) !== 'http') {
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href'));
}
});
}
document.body.className = (document.body.className + ' learn-bar').trim(); document.body.className = (document.body.className + ' learn-bar').trim();
document.body.insertAdjacentHTML('afterBegin', aside.outerHTML); document.body.insertAdjacentHTML('afterBegin', aside.outerHTML);
......
...@@ -15,6 +15,6 @@ ...@@ -15,6 +15,6 @@
"tests" "tests"
], ],
"dependencies": { "dependencies": {
"todomvc-common": "~0.1.9" "todomvc-common": "~0.3.0"
} }
} }
...@@ -171,25 +171,42 @@ ...@@ -171,25 +171,42 @@
framework = document.querySelector('[data-framework]').dataset.framework; framework = document.querySelector('[data-framework]').dataset.framework;
} }
this.template = template;
if (template && learnJSON[framework]) { if (learnJSON.backend) {
this.frameworkJSON = learnJSON.backend;
this.append({
backend: true
});
} else if (learnJSON[framework]) {
this.frameworkJSON = learnJSON[framework]; this.frameworkJSON = learnJSON[framework];
this.template = template;
this.append(); this.append();
} }
} }
Learn.prototype.append = function () { Learn.prototype.append = function (opts) {
var aside = document.createElement('aside'); var aside = document.createElement('aside');
aside.innerHTML = _.template(this.template, this.frameworkJSON); aside.innerHTML = _.template(this.template, this.frameworkJSON);
aside.className = 'learn'; aside.className = 'learn';
// Localize demo links if (opts && opts.backend) {
var demoLinks = aside.querySelectorAll('.demo-link'); // Remove demo link
Array.prototype.forEach.call(demoLinks, function (demoLink) { var sourceLinks = aside.querySelector('.source-links');
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href')); var heading = sourceLinks.firstElementChild;
}); var sourceLink = sourceLinks.lastElementChild;
// Correct link path
var href = sourceLink.getAttribute('href');
sourceLink.setAttribute('href', href.substr(href.lastIndexOf('http')));
sourceLinks.innerHTML = heading.outerHTML + sourceLink.outerHTML;
} else {
// Localize demo links
var demoLinks = aside.querySelectorAll('.demo-link');
Array.prototype.forEach.call(demoLinks, function (demoLink) {
if (demoLink.getAttribute('href').substr(0, 4) !== 'http') {
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href'));
}
});
}
document.body.className = (document.body.className + ' learn-bar').trim(); document.body.className = (document.body.className + ' learn-bar').trim();
document.body.insertAdjacentHTML('afterBegin', aside.outerHTML); document.body.insertAdjacentHTML('afterBegin', aside.outerHTML);
......
{
"name": "todomvc-common",
"description": "Common TodoMVC utilities used by our apps",
"license": "MIT",
"authors": [
"TasteJS team"
],
"main": [
"base.js",
"base.css"
],
"keywords": [
"todomvc",
"tastejs",
"util",
"utilities"
],
"ignore": [
"package.json",
"readme.md"
]
}
...@@ -3,6 +3,6 @@ ...@@ -3,6 +3,6 @@
"version": "0.0.0", "version": "0.0.0",
"dependencies": { "dependencies": {
"angular": "1.2.9", "angular": "1.2.9",
"todomvc-common": "~0.1.9" "todomvc-common": "~0.3.0"
} }
} }
{
"name": "todomvc-common",
"description": "Common TodoMVC utilities used by our apps",
"license": "MIT",
"authors": [
"TasteJS team"
],
"main": [
"base.js",
"base.css"
],
"keywords": [
"todomvc",
"tastejs",
"util",
"utilities"
],
"ignore": [
"package.json",
"readme.md"
]
}
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
"version": "0.0.0", "version": "0.0.0",
"dependencies": { "dependencies": {
"angular": "1.2.8", "angular": "1.2.8",
"todomvc-common": "~0.1.9", "todomvc-common": "~0.3.0",
"requirejs": "~2.1.9" "requirejs": "~2.1.9"
} }
} }
...@@ -2,6 +2,6 @@ ...@@ -2,6 +2,6 @@
"name": "todomvc-ariatemplates", "name": "todomvc-ariatemplates",
"version": "0.0.0", "version": "0.0.0",
"dependencies": { "dependencies": {
"todomvc-common": "~0.1.6" "todomvc-common": "~0.3.0"
} }
} }
...@@ -171,25 +171,42 @@ ...@@ -171,25 +171,42 @@
framework = document.querySelector('[data-framework]').dataset.framework; framework = document.querySelector('[data-framework]').dataset.framework;
} }
this.template = template;
if (template && learnJSON[framework]) { if (learnJSON.backend) {
this.frameworkJSON = learnJSON.backend;
this.append({
backend: true
});
} else if (learnJSON[framework]) {
this.frameworkJSON = learnJSON[framework]; this.frameworkJSON = learnJSON[framework];
this.template = template;
this.append(); this.append();
} }
} }
Learn.prototype.append = function () { Learn.prototype.append = function (opts) {
var aside = document.createElement('aside'); var aside = document.createElement('aside');
aside.innerHTML = _.template(this.template, this.frameworkJSON); aside.innerHTML = _.template(this.template, this.frameworkJSON);
aside.className = 'learn'; aside.className = 'learn';
// Localize demo links if (opts && opts.backend) {
var demoLinks = aside.querySelectorAll('.demo-link'); // Remove demo link
Array.prototype.forEach.call(demoLinks, function (demoLink) { var sourceLinks = aside.querySelector('.source-links');
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href')); var heading = sourceLinks.firstElementChild;
}); var sourceLink = sourceLinks.lastElementChild;
// Correct link path
var href = sourceLink.getAttribute('href');
sourceLink.setAttribute('href', href.substr(href.lastIndexOf('http')));
sourceLinks.innerHTML = heading.outerHTML + sourceLink.outerHTML;
} else {
// Localize demo links
var demoLinks = aside.querySelectorAll('.demo-link');
Array.prototype.forEach.call(demoLinks, function (demoLink) {
if (demoLink.getAttribute('href').substr(0, 4) !== 'http') {
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href'));
}
});
}
document.body.className = (document.body.className + ' learn-bar').trim(); document.body.className = (document.body.className + ' learn-bar').trim();
document.body.insertAdjacentHTML('afterBegin', aside.outerHTML); document.body.insertAdjacentHTML('afterBegin', aside.outerHTML);
......
{
"name": "todomvc-common",
"description": "Common TodoMVC utilities used by our apps",
"license": "MIT",
"authors": [
"TasteJS team"
],
"main": [
"base.js",
"base.css"
],
"keywords": [
"todomvc",
"tastejs",
"util",
"utilities"
],
"ignore": [
"package.json",
"readme.md"
]
}
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
"name": "todomvc-atmajs", "name": "todomvc-atmajs",
"version": "0.1.0", "version": "0.1.0",
"dependencies": { "dependencies": {
"todomvc-common": "~0.1.4", "todomvc-common": "~0.3.0",
"jquery": "~2.0.2", "jquery": "~2.0.2",
"maskjs": "~0.10.1", "maskjs": "~0.10.1",
"includejs": "~0.9.10", "includejs": "~0.9.10",
......
...@@ -171,25 +171,42 @@ ...@@ -171,25 +171,42 @@
framework = document.querySelector('[data-framework]').dataset.framework; framework = document.querySelector('[data-framework]').dataset.framework;
} }
this.template = template;
if (template && learnJSON[framework]) { if (learnJSON.backend) {
this.frameworkJSON = learnJSON.backend;
this.append({
backend: true
});
} else if (learnJSON[framework]) {
this.frameworkJSON = learnJSON[framework]; this.frameworkJSON = learnJSON[framework];
this.template = template;
this.append(); this.append();
} }
} }
Learn.prototype.append = function () { Learn.prototype.append = function (opts) {
var aside = document.createElement('aside'); var aside = document.createElement('aside');
aside.innerHTML = _.template(this.template, this.frameworkJSON); aside.innerHTML = _.template(this.template, this.frameworkJSON);
aside.className = 'learn'; aside.className = 'learn';
// Localize demo links if (opts && opts.backend) {
var demoLinks = aside.querySelectorAll('.demo-link'); // Remove demo link
Array.prototype.forEach.call(demoLinks, function (demoLink) { var sourceLinks = aside.querySelector('.source-links');
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href')); var heading = sourceLinks.firstElementChild;
}); var sourceLink = sourceLinks.lastElementChild;
// Correct link path
var href = sourceLink.getAttribute('href');
sourceLink.setAttribute('href', href.substr(href.lastIndexOf('http')));
sourceLinks.innerHTML = heading.outerHTML + sourceLink.outerHTML;
} else {
// Localize demo links
var demoLinks = aside.querySelectorAll('.demo-link');
Array.prototype.forEach.call(demoLinks, function (demoLink) {
if (demoLink.getAttribute('href').substr(0, 4) !== 'http') {
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href'));
}
});
}
document.body.className = (document.body.className + ' learn-bar').trim(); document.body.className = (document.body.className + ' learn-bar').trim();
document.body.insertAdjacentHTML('afterBegin', aside.outerHTML); document.body.insertAdjacentHTML('afterBegin', aside.outerHTML);
......
{
"name": "todomvc-common",
"description": "Common TodoMVC utilities used by our apps",
"license": "MIT",
"authors": [
"TasteJS team"
],
"main": [
"base.js",
"base.css"
],
"keywords": [
"todomvc",
"tastejs",
"util",
"utilities"
],
"ignore": [
"package.json",
"readme.md"
]
}
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
"backbone": "~1.1.1", "backbone": "~1.1.1",
"underscore": "~1.6.0", "underscore": "~1.6.0",
"jquery": "~2.0.0", "jquery": "~2.0.0",
"todomvc-common": "~0.1.4", "todomvc-common": "~0.3.0",
"backbone.localStorage": "~1.1.0" "backbone.localStorage": "~1.1.0"
} }
} }
...@@ -171,25 +171,42 @@ ...@@ -171,25 +171,42 @@
framework = document.querySelector('[data-framework]').dataset.framework; framework = document.querySelector('[data-framework]').dataset.framework;
} }
this.template = template;
if (template && learnJSON[framework]) { if (learnJSON.backend) {
this.frameworkJSON = learnJSON.backend;
this.append({
backend: true
});
} else if (learnJSON[framework]) {
this.frameworkJSON = learnJSON[framework]; this.frameworkJSON = learnJSON[framework];
this.template = template;
this.append(); this.append();
} }
} }
Learn.prototype.append = function () { Learn.prototype.append = function (opts) {
var aside = document.createElement('aside'); var aside = document.createElement('aside');
aside.innerHTML = _.template(this.template, this.frameworkJSON); aside.innerHTML = _.template(this.template, this.frameworkJSON);
aside.className = 'learn'; aside.className = 'learn';
// Localize demo links if (opts && opts.backend) {
var demoLinks = aside.querySelectorAll('.demo-link'); // Remove demo link
Array.prototype.forEach.call(demoLinks, function (demoLink) { var sourceLinks = aside.querySelector('.source-links');
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href')); var heading = sourceLinks.firstElementChild;
}); var sourceLink = sourceLinks.lastElementChild;
// Correct link path
var href = sourceLink.getAttribute('href');
sourceLink.setAttribute('href', href.substr(href.lastIndexOf('http')));
sourceLinks.innerHTML = heading.outerHTML + sourceLink.outerHTML;
} else {
// Localize demo links
var demoLinks = aside.querySelectorAll('.demo-link');
Array.prototype.forEach.call(demoLinks, function (demoLink) {
if (demoLink.getAttribute('href').substr(0, 4) !== 'http') {
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href'));
}
});
}
document.body.className = (document.body.className + ' learn-bar').trim(); document.body.className = (document.body.className + ' learn-bar').trim();
document.body.insertAdjacentHTML('afterBegin', aside.outerHTML); document.body.insertAdjacentHTML('afterBegin', aside.outerHTML);
......
{
"name": "todomvc-common",
"description": "Common TodoMVC utilities used by our apps",
"license": "MIT",
"authors": [
"TasteJS team"
],
"main": [
"base.js",
"base.css"
],
"keywords": [
"todomvc",
"tastejs",
"util",
"utilities"
],
"ignore": [
"package.json",
"readme.md"
]
}
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
"version": "0.0.0", "version": "0.0.0",
"dependencies": { "dependencies": {
"jquery": "~1.10.2", "jquery": "~1.10.2",
"todomvc-common": "~0.1.7", "todomvc-common": "~0.3.0",
"underscore": "~1.4.4", "underscore": "~1.4.4",
"backbone.localStorage": "~1.1.6", "backbone.localStorage": "~1.1.6",
"backbone.marionette": "~2.1.0" "backbone.marionette": "~2.1.0"
......
...@@ -171,25 +171,42 @@ ...@@ -171,25 +171,42 @@
framework = document.querySelector('[data-framework]').dataset.framework; framework = document.querySelector('[data-framework]').dataset.framework;
} }
this.template = template;
if (template && learnJSON[framework]) { if (learnJSON.backend) {
this.frameworkJSON = learnJSON.backend;
this.append({
backend: true
});
} else if (learnJSON[framework]) {
this.frameworkJSON = learnJSON[framework]; this.frameworkJSON = learnJSON[framework];
this.template = template;
this.append(); this.append();
} }
} }
Learn.prototype.append = function () { Learn.prototype.append = function (opts) {
var aside = document.createElement('aside'); var aside = document.createElement('aside');
aside.innerHTML = _.template(this.template, this.frameworkJSON); aside.innerHTML = _.template(this.template, this.frameworkJSON);
aside.className = 'learn'; aside.className = 'learn';
// Localize demo links if (opts && opts.backend) {
var demoLinks = aside.querySelectorAll('.demo-link'); // Remove demo link
Array.prototype.forEach.call(demoLinks, function (demoLink) { var sourceLinks = aside.querySelector('.source-links');
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href')); var heading = sourceLinks.firstElementChild;
}); var sourceLink = sourceLinks.lastElementChild;
// Correct link path
var href = sourceLink.getAttribute('href');
sourceLink.setAttribute('href', href.substr(href.lastIndexOf('http')));
sourceLinks.innerHTML = heading.outerHTML + sourceLink.outerHTML;
} else {
// Localize demo links
var demoLinks = aside.querySelectorAll('.demo-link');
Array.prototype.forEach.call(demoLinks, function (demoLink) {
if (demoLink.getAttribute('href').substr(0, 4) !== 'http') {
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href'));
}
});
}
document.body.className = (document.body.className + ' learn-bar').trim(); document.body.className = (document.body.className + ' learn-bar').trim();
document.body.insertAdjacentHTML('afterBegin', aside.outerHTML); document.body.insertAdjacentHTML('afterBegin', aside.outerHTML);
......
{
"name": "todomvc-common",
"description": "Common TodoMVC utilities used by our apps",
"license": "MIT",
"authors": [
"TasteJS team"
],
"main": [
"base.js",
"base.css"
],
"keywords": [
"todomvc",
"tastejs",
"util",
"utilities"
],
"ignore": [
"package.json",
"readme.md"
]
}
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
"name": "todomvc-backbone_marionette_require", "name": "todomvc-backbone_marionette_require",
"version": "0.0.0", "version": "0.0.0",
"dependencies": { "dependencies": {
"todomvc-common": "~0.1.6", "todomvc-common": "~0.3.0",
"requirejs": "~2.1.6", "requirejs": "~2.1.6",
"underscore": "~1.4.4", "underscore": "~1.4.4",
"backbone.marionette": "~1.0.3", "backbone.marionette": "~1.0.3",
......
...@@ -171,25 +171,42 @@ ...@@ -171,25 +171,42 @@
framework = document.querySelector('[data-framework]').dataset.framework; framework = document.querySelector('[data-framework]').dataset.framework;
} }
this.template = template;
if (template && learnJSON[framework]) { if (learnJSON.backend) {
this.frameworkJSON = learnJSON.backend;
this.append({
backend: true
});
} else if (learnJSON[framework]) {
this.frameworkJSON = learnJSON[framework]; this.frameworkJSON = learnJSON[framework];
this.template = template;
this.append(); this.append();
} }
} }
Learn.prototype.append = function () { Learn.prototype.append = function (opts) {
var aside = document.createElement('aside'); var aside = document.createElement('aside');
aside.innerHTML = _.template(this.template, this.frameworkJSON); aside.innerHTML = _.template(this.template, this.frameworkJSON);
aside.className = 'learn'; aside.className = 'learn';
// Localize demo links if (opts && opts.backend) {
var demoLinks = aside.querySelectorAll('.demo-link'); // Remove demo link
Array.prototype.forEach.call(demoLinks, function (demoLink) { var sourceLinks = aside.querySelector('.source-links');
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href')); var heading = sourceLinks.firstElementChild;
}); var sourceLink = sourceLinks.lastElementChild;
// Correct link path
var href = sourceLink.getAttribute('href');
sourceLink.setAttribute('href', href.substr(href.lastIndexOf('http')));
sourceLinks.innerHTML = heading.outerHTML + sourceLink.outerHTML;
} else {
// Localize demo links
var demoLinks = aside.querySelectorAll('.demo-link');
Array.prototype.forEach.call(demoLinks, function (demoLink) {
if (demoLink.getAttribute('href').substr(0, 4) !== 'http') {
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href'));
}
});
}
document.body.className = (document.body.className + ' learn-bar').trim(); document.body.className = (document.body.className + ' learn-bar').trim();
document.body.insertAdjacentHTML('afterBegin', aside.outerHTML); document.body.insertAdjacentHTML('afterBegin', aside.outerHTML);
......
{
"name": "todomvc-common",
"description": "Common TodoMVC utilities used by our apps",
"license": "MIT",
"authors": [
"TasteJS team"
],
"main": [
"base.js",
"base.css"
],
"keywords": [
"todomvc",
"tastejs",
"util",
"utilities"
],
"ignore": [
"package.json",
"readme.md"
]
}
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
"backbone": "~1.1.0", "backbone": "~1.1.0",
"underscore": "~1.5.0", "underscore": "~1.5.0",
"jquery": "~2.0.0", "jquery": "~2.0.0",
"todomvc-common": "~0.1.4", "todomvc-common": "~0.3.0",
"backbone.localStorage": "~1.1.0", "backbone.localStorage": "~1.1.0",
"requirejs": "~2.1.5", "requirejs": "~2.1.5",
"requirejs-text": "~2.0.5" "requirejs-text": "~2.0.5"
......
...@@ -171,25 +171,42 @@ ...@@ -171,25 +171,42 @@
framework = document.querySelector('[data-framework]').dataset.framework; framework = document.querySelector('[data-framework]').dataset.framework;
} }
this.template = template;
if (template && learnJSON[framework]) { if (learnJSON.backend) {
this.frameworkJSON = learnJSON.backend;
this.append({
backend: true
});
} else if (learnJSON[framework]) {
this.frameworkJSON = learnJSON[framework]; this.frameworkJSON = learnJSON[framework];
this.template = template;
this.append(); this.append();
} }
} }
Learn.prototype.append = function () { Learn.prototype.append = function (opts) {
var aside = document.createElement('aside'); var aside = document.createElement('aside');
aside.innerHTML = _.template(this.template, this.frameworkJSON); aside.innerHTML = _.template(this.template, this.frameworkJSON);
aside.className = 'learn'; aside.className = 'learn';
// Localize demo links if (opts && opts.backend) {
var demoLinks = aside.querySelectorAll('.demo-link'); // Remove demo link
Array.prototype.forEach.call(demoLinks, function (demoLink) { var sourceLinks = aside.querySelector('.source-links');
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href')); var heading = sourceLinks.firstElementChild;
}); var sourceLink = sourceLinks.lastElementChild;
// Correct link path
var href = sourceLink.getAttribute('href');
sourceLink.setAttribute('href', href.substr(href.lastIndexOf('http')));
sourceLinks.innerHTML = heading.outerHTML + sourceLink.outerHTML;
} else {
// Localize demo links
var demoLinks = aside.querySelectorAll('.demo-link');
Array.prototype.forEach.call(demoLinks, function (demoLink) {
if (demoLink.getAttribute('href').substr(0, 4) !== 'http') {
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href'));
}
});
}
document.body.className = (document.body.className + ' learn-bar').trim(); document.body.className = (document.body.className + ' learn-bar').trim();
document.body.insertAdjacentHTML('afterBegin', aside.outerHTML); document.body.insertAdjacentHTML('afterBegin', aside.outerHTML);
......
{
"name": "todomvc-common",
"description": "Common TodoMVC utilities used by our apps",
"license": "MIT",
"authors": [
"TasteJS team"
],
"main": [
"base.js",
"base.css"
],
"keywords": [
"todomvc",
"tastejs",
"util",
"utilities"
],
"ignore": [
"package.json",
"readme.md"
]
}
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
"name": "todomvc-batman", "name": "todomvc-batman",
"version": "0.0.0", "version": "0.0.0",
"dependencies": { "dependencies": {
"todomvc-common": "~0.1.4", "todomvc-common": "~0.3.0",
"batman": "~0.14.1" "batman": "~0.14.1"
} }
} }
...@@ -171,25 +171,42 @@ ...@@ -171,25 +171,42 @@
framework = document.querySelector('[data-framework]').dataset.framework; framework = document.querySelector('[data-framework]').dataset.framework;
} }
this.template = template;
if (template && learnJSON[framework]) { if (learnJSON.backend) {
this.frameworkJSON = learnJSON.backend;
this.append({
backend: true
});
} else if (learnJSON[framework]) {
this.frameworkJSON = learnJSON[framework]; this.frameworkJSON = learnJSON[framework];
this.template = template;
this.append(); this.append();
} }
} }
Learn.prototype.append = function () { Learn.prototype.append = function (opts) {
var aside = document.createElement('aside'); var aside = document.createElement('aside');
aside.innerHTML = _.template(this.template, this.frameworkJSON); aside.innerHTML = _.template(this.template, this.frameworkJSON);
aside.className = 'learn'; aside.className = 'learn';
// Localize demo links if (opts && opts.backend) {
var demoLinks = aside.querySelectorAll('.demo-link'); // Remove demo link
Array.prototype.forEach.call(demoLinks, function (demoLink) { var sourceLinks = aside.querySelector('.source-links');
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href')); var heading = sourceLinks.firstElementChild;
}); var sourceLink = sourceLinks.lastElementChild;
// Correct link path
var href = sourceLink.getAttribute('href');
sourceLink.setAttribute('href', href.substr(href.lastIndexOf('http')));
sourceLinks.innerHTML = heading.outerHTML + sourceLink.outerHTML;
} else {
// Localize demo links
var demoLinks = aside.querySelectorAll('.demo-link');
Array.prototype.forEach.call(demoLinks, function (demoLink) {
if (demoLink.getAttribute('href').substr(0, 4) !== 'http') {
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href'));
}
});
}
document.body.className = (document.body.className + ' learn-bar').trim(); document.body.className = (document.body.className + ' learn-bar').trim();
document.body.insertAdjacentHTML('afterBegin', aside.outerHTML); document.body.insertAdjacentHTML('afterBegin', aside.outerHTML);
......
{
"name": "todomvc-common",
"description": "Common TodoMVC utilities used by our apps",
"license": "MIT",
"authors": [
"TasteJS team"
],
"main": [
"base.js",
"base.css"
],
"keywords": [
"todomvc",
"tastejs",
"util",
"utilities"
],
"ignore": [
"package.json",
"readme.md"
]
}
...@@ -5,6 +5,6 @@ ...@@ -5,6 +5,6 @@
"jquery": "~2.0.0", "jquery": "~2.0.0",
"canjs": "~2.0.0", "canjs": "~2.0.0",
"canjs-localstorage": "~0.2.0", "canjs-localstorage": "~0.2.0",
"todomvc-common": "~0.1.6" "todomvc-common": "~0.3.0"
} }
} }
...@@ -171,25 +171,42 @@ ...@@ -171,25 +171,42 @@
framework = document.querySelector('[data-framework]').dataset.framework; framework = document.querySelector('[data-framework]').dataset.framework;
} }
this.template = template;
if (template && learnJSON[framework]) { if (learnJSON.backend) {
this.frameworkJSON = learnJSON.backend;
this.append({
backend: true
});
} else if (learnJSON[framework]) {
this.frameworkJSON = learnJSON[framework]; this.frameworkJSON = learnJSON[framework];
this.template = template;
this.append(); this.append();
} }
} }
Learn.prototype.append = function () { Learn.prototype.append = function (opts) {
var aside = document.createElement('aside'); var aside = document.createElement('aside');
aside.innerHTML = _.template(this.template, this.frameworkJSON); aside.innerHTML = _.template(this.template, this.frameworkJSON);
aside.className = 'learn'; aside.className = 'learn';
// Localize demo links if (opts && opts.backend) {
var demoLinks = aside.querySelectorAll('.demo-link'); // Remove demo link
Array.prototype.forEach.call(demoLinks, function (demoLink) { var sourceLinks = aside.querySelector('.source-links');
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href')); var heading = sourceLinks.firstElementChild;
}); var sourceLink = sourceLinks.lastElementChild;
// Correct link path
var href = sourceLink.getAttribute('href');
sourceLink.setAttribute('href', href.substr(href.lastIndexOf('http')));
sourceLinks.innerHTML = heading.outerHTML + sourceLink.outerHTML;
} else {
// Localize demo links
var demoLinks = aside.querySelectorAll('.demo-link');
Array.prototype.forEach.call(demoLinks, function (demoLink) {
if (demoLink.getAttribute('href').substr(0, 4) !== 'http') {
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href'));
}
});
}
document.body.className = (document.body.className + ' learn-bar').trim(); document.body.className = (document.body.className + ' learn-bar').trim();
document.body.insertAdjacentHTML('afterBegin', aside.outerHTML); document.body.insertAdjacentHTML('afterBegin', aside.outerHTML);
......
{
"name": "todomvc-common",
"description": "Common TodoMVC utilities used by our apps",
"license": "MIT",
"authors": [
"TasteJS team"
],
"main": [
"base.js",
"base.css"
],
"keywords": [
"todomvc",
"tastejs",
"util",
"utilities"
],
"ignore": [
"package.json",
"readme.md"
]
}
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
"name": "todomvc-canjs-require", "name": "todomvc-canjs-require",
"version": "0.0.0", "version": "0.0.0",
"dependencies": { "dependencies": {
"todomvc-common": "~0.1.6", "todomvc-common": "~0.3.0",
"requirejs": "~2.1.6", "requirejs": "~2.1.6",
"canjs": "~2.0.0", "canjs": "~2.0.0",
"canjs-localstorage": "~0.2.0", "canjs-localstorage": "~0.2.0",
......
...@@ -171,25 +171,42 @@ ...@@ -171,25 +171,42 @@
framework = document.querySelector('[data-framework]').dataset.framework; framework = document.querySelector('[data-framework]').dataset.framework;
} }
this.template = template;
if (template && learnJSON[framework]) { if (learnJSON.backend) {
this.frameworkJSON = learnJSON.backend;
this.append({
backend: true
});
} else if (learnJSON[framework]) {
this.frameworkJSON = learnJSON[framework]; this.frameworkJSON = learnJSON[framework];
this.template = template;
this.append(); this.append();
} }
} }
Learn.prototype.append = function () { Learn.prototype.append = function (opts) {
var aside = document.createElement('aside'); var aside = document.createElement('aside');
aside.innerHTML = _.template(this.template, this.frameworkJSON); aside.innerHTML = _.template(this.template, this.frameworkJSON);
aside.className = 'learn'; aside.className = 'learn';
// Localize demo links if (opts && opts.backend) {
var demoLinks = aside.querySelectorAll('.demo-link'); // Remove demo link
Array.prototype.forEach.call(demoLinks, function (demoLink) { var sourceLinks = aside.querySelector('.source-links');
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href')); var heading = sourceLinks.firstElementChild;
}); var sourceLink = sourceLinks.lastElementChild;
// Correct link path
var href = sourceLink.getAttribute('href');
sourceLink.setAttribute('href', href.substr(href.lastIndexOf('http')));
sourceLinks.innerHTML = heading.outerHTML + sourceLink.outerHTML;
} else {
// Localize demo links
var demoLinks = aside.querySelectorAll('.demo-link');
Array.prototype.forEach.call(demoLinks, function (demoLink) {
if (demoLink.getAttribute('href').substr(0, 4) !== 'http') {
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href'));
}
});
}
document.body.className = (document.body.className + ' learn-bar').trim(); document.body.className = (document.body.className + ' learn-bar').trim();
document.body.insertAdjacentHTML('afterBegin', aside.outerHTML); document.body.insertAdjacentHTML('afterBegin', aside.outerHTML);
......
{
"name": "todomvc-common",
"description": "Common TodoMVC utilities used by our apps",
"license": "MIT",
"authors": [
"TasteJS team"
],
"main": [
"base.js",
"base.css"
],
"keywords": [
"todomvc",
"tastejs",
"util",
"utilities"
],
"ignore": [
"package.json",
"readme.md"
]
}
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
"name": "todomvc-chaplin-brunch", "name": "todomvc-chaplin-brunch",
"version": "0.0.0", "version": "0.0.0",
"dependencies": { "dependencies": {
"todomvc-common": "~0.1.11", "todomvc-common": "~0.3.0",
"chaplin": "~1.0.0", "chaplin": "~1.0.0",
"exoskeleton": "~0.6.3", "exoskeleton": "~0.6.3",
"backbone.localStorage": "git://github.com/paulmillr/Backbone.localStorage.git#9c225b37bdea4ac21d4b2445fa8962fe74e3175b" "backbone.localStorage": "git://github.com/paulmillr/Backbone.localStorage.git#9c225b37bdea4ac21d4b2445fa8962fe74e3175b"
......
...@@ -171,25 +171,42 @@ ...@@ -171,25 +171,42 @@
framework = document.querySelector('[data-framework]').dataset.framework; framework = document.querySelector('[data-framework]').dataset.framework;
} }
this.template = template;
if (template && learnJSON[framework]) { if (learnJSON.backend) {
this.frameworkJSON = learnJSON.backend;
this.append({
backend: true
});
} else if (learnJSON[framework]) {
this.frameworkJSON = learnJSON[framework]; this.frameworkJSON = learnJSON[framework];
this.template = template;
this.append(); this.append();
} }
} }
Learn.prototype.append = function () { Learn.prototype.append = function (opts) {
var aside = document.createElement('aside'); var aside = document.createElement('aside');
aside.innerHTML = _.template(this.template, this.frameworkJSON); aside.innerHTML = _.template(this.template, this.frameworkJSON);
aside.className = 'learn'; aside.className = 'learn';
// Localize demo links if (opts && opts.backend) {
var demoLinks = aside.querySelectorAll('.demo-link'); // Remove demo link
Array.prototype.forEach.call(demoLinks, function (demoLink) { var sourceLinks = aside.querySelector('.source-links');
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href')); var heading = sourceLinks.firstElementChild;
}); var sourceLink = sourceLinks.lastElementChild;
// Correct link path
var href = sourceLink.getAttribute('href');
sourceLink.setAttribute('href', href.substr(href.lastIndexOf('http')));
sourceLinks.innerHTML = heading.outerHTML + sourceLink.outerHTML;
} else {
// Localize demo links
var demoLinks = aside.querySelectorAll('.demo-link');
Array.prototype.forEach.call(demoLinks, function (demoLink) {
if (demoLink.getAttribute('href').substr(0, 4) !== 'http') {
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href'));
}
});
}
document.body.className = (document.body.className + ' learn-bar').trim(); document.body.className = (document.body.className + ' learn-bar').trim();
document.body.insertAdjacentHTML('afterBegin', aside.outerHTML); document.body.insertAdjacentHTML('afterBegin', aside.outerHTML);
......
...@@ -2,6 +2,6 @@ ...@@ -2,6 +2,6 @@
"name": "todomvc-closure", "name": "todomvc-closure",
"version": "0.0.0", "version": "0.0.0",
"dependencies": { "dependencies": {
"todomvc-common": "~0.1.4" "todomvc-common": "~0.3.0"
} }
} }
...@@ -171,25 +171,42 @@ ...@@ -171,25 +171,42 @@
framework = document.querySelector('[data-framework]').dataset.framework; framework = document.querySelector('[data-framework]').dataset.framework;
} }
this.template = template;
if (template && learnJSON[framework]) { if (learnJSON.backend) {
this.frameworkJSON = learnJSON.backend;
this.append({
backend: true
});
} else if (learnJSON[framework]) {
this.frameworkJSON = learnJSON[framework]; this.frameworkJSON = learnJSON[framework];
this.template = template;
this.append(); this.append();
} }
} }
Learn.prototype.append = function () { Learn.prototype.append = function (opts) {
var aside = document.createElement('aside'); var aside = document.createElement('aside');
aside.innerHTML = _.template(this.template, this.frameworkJSON); aside.innerHTML = _.template(this.template, this.frameworkJSON);
aside.className = 'learn'; aside.className = 'learn';
// Localize demo links if (opts && opts.backend) {
var demoLinks = aside.querySelectorAll('.demo-link'); // Remove demo link
Array.prototype.forEach.call(demoLinks, function (demoLink) { var sourceLinks = aside.querySelector('.source-links');
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href')); var heading = sourceLinks.firstElementChild;
}); var sourceLink = sourceLinks.lastElementChild;
// Correct link path
var href = sourceLink.getAttribute('href');
sourceLink.setAttribute('href', href.substr(href.lastIndexOf('http')));
sourceLinks.innerHTML = heading.outerHTML + sourceLink.outerHTML;
} else {
// Localize demo links
var demoLinks = aside.querySelectorAll('.demo-link');
Array.prototype.forEach.call(demoLinks, function (demoLink) {
if (demoLink.getAttribute('href').substr(0, 4) !== 'http') {
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href'));
}
});
}
document.body.className = (document.body.className + ' learn-bar').trim(); document.body.className = (document.body.className + ' learn-bar').trim();
document.body.insertAdjacentHTML('afterBegin', aside.outerHTML); document.body.insertAdjacentHTML('afterBegin', aside.outerHTML);
......
{
"name": "todomvc-common",
"description": "Common TodoMVC utilities used by our apps",
"license": "MIT",
"authors": [
"TasteJS team"
],
"main": [
"base.js",
"base.css"
],
"keywords": [
"todomvc",
"tastejs",
"util",
"utilities"
],
"ignore": [
"package.json",
"readme.md"
]
}
...@@ -171,25 +171,42 @@ ...@@ -171,25 +171,42 @@
framework = document.querySelector('[data-framework]').dataset.framework; framework = document.querySelector('[data-framework]').dataset.framework;
} }
this.template = template;
if (template && learnJSON[framework]) { if (learnJSON.backend) {
this.frameworkJSON = learnJSON.backend;
this.append({
backend: true
});
} else if (learnJSON[framework]) {
this.frameworkJSON = learnJSON[framework]; this.frameworkJSON = learnJSON[framework];
this.template = template;
this.append(); this.append();
} }
} }
Learn.prototype.append = function () { Learn.prototype.append = function (opts) {
var aside = document.createElement('aside'); var aside = document.createElement('aside');
aside.innerHTML = _.template(this.template, this.frameworkJSON); aside.innerHTML = _.template(this.template, this.frameworkJSON);
aside.className = 'learn'; aside.className = 'learn';
// Localize demo links if (opts && opts.backend) {
var demoLinks = aside.querySelectorAll('.demo-link'); // Remove demo link
Array.prototype.forEach.call(demoLinks, function (demoLink) { var sourceLinks = aside.querySelector('.source-links');
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href')); var heading = sourceLinks.firstElementChild;
}); var sourceLink = sourceLinks.lastElementChild;
// Correct link path
var href = sourceLink.getAttribute('href');
sourceLink.setAttribute('href', href.substr(href.lastIndexOf('http')));
sourceLinks.innerHTML = heading.outerHTML + sourceLink.outerHTML;
} else {
// Localize demo links
var demoLinks = aside.querySelectorAll('.demo-link');
Array.prototype.forEach.call(demoLinks, function (demoLink) {
if (demoLink.getAttribute('href').substr(0, 4) !== 'http') {
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href'));
}
});
}
document.body.className = (document.body.className + ' learn-bar').trim(); document.body.className = (document.body.className + ' learn-bar').trim();
document.body.insertAdjacentHTML('afterBegin', aside.outerHTML); document.body.insertAdjacentHTML('afterBegin', aside.outerHTML);
......
{
"name": "todomvc-common",
"description": "Common TodoMVC utilities used by our apps",
"license": "MIT",
"authors": [
"TasteJS team"
],
"main": [
"base.js",
"base.css"
],
"keywords": [
"todomvc",
"tastejs",
"util",
"utilities"
],
"ignore": [
"package.json",
"readme.md"
]
}
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
"name": "todomvc-cujoJS", "name": "todomvc-cujoJS",
"version": "0.0.0", "version": "0.0.0",
"dependencies": { "dependencies": {
"todomvc-common": "~0.1.7", "todomvc-common": "~0.3.0",
"curl": "~0.7.4", "curl": "~0.7.4",
"cola": "latest", "cola": "latest",
"poly": "~0.5.1", "poly": "~0.5.1",
......
...@@ -171,25 +171,42 @@ ...@@ -171,25 +171,42 @@
framework = document.querySelector('[data-framework]').dataset.framework; framework = document.querySelector('[data-framework]').dataset.framework;
} }
this.template = template;
if (template && learnJSON[framework]) { if (learnJSON.backend) {
this.frameworkJSON = learnJSON.backend;
this.append({
backend: true
});
} else if (learnJSON[framework]) {
this.frameworkJSON = learnJSON[framework]; this.frameworkJSON = learnJSON[framework];
this.template = template;
this.append(); this.append();
} }
} }
Learn.prototype.append = function () { Learn.prototype.append = function (opts) {
var aside = document.createElement('aside'); var aside = document.createElement('aside');
aside.innerHTML = _.template(this.template, this.frameworkJSON); aside.innerHTML = _.template(this.template, this.frameworkJSON);
aside.className = 'learn'; aside.className = 'learn';
// Localize demo links if (opts && opts.backend) {
var demoLinks = aside.querySelectorAll('.demo-link'); // Remove demo link
Array.prototype.forEach.call(demoLinks, function (demoLink) { var sourceLinks = aside.querySelector('.source-links');
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href')); var heading = sourceLinks.firstElementChild;
}); var sourceLink = sourceLinks.lastElementChild;
// Correct link path
var href = sourceLink.getAttribute('href');
sourceLink.setAttribute('href', href.substr(href.lastIndexOf('http')));
sourceLinks.innerHTML = heading.outerHTML + sourceLink.outerHTML;
} else {
// Localize demo links
var demoLinks = aside.querySelectorAll('.demo-link');
Array.prototype.forEach.call(demoLinks, function (demoLink) {
if (demoLink.getAttribute('href').substr(0, 4) !== 'http') {
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href'));
}
});
}
document.body.className = (document.body.className + ' learn-bar').trim(); document.body.className = (document.body.className + ' learn-bar').trim();
document.body.insertAdjacentHTML('afterBegin', aside.outerHTML); document.body.insertAdjacentHTML('afterBegin', aside.outerHTML);
......
{
"name": "todomvc-common",
"description": "Common TodoMVC utilities used by our apps",
"license": "MIT",
"authors": [
"TasteJS team"
],
"main": [
"base.js",
"base.css"
],
"keywords": [
"todomvc",
"tastejs",
"util",
"utilities"
],
"ignore": [
"package.json",
"readme.md"
]
}
...@@ -2,6 +2,6 @@ ...@@ -2,6 +2,6 @@
"name": "todomvc-derby", "name": "todomvc-derby",
"version": "0.0.0", "version": "0.0.0",
"dependencies": { "dependencies": {
"todomvc-common": "~0.1.3" "todomvc-common": "~0.3.0"
} }
} }
...@@ -171,25 +171,42 @@ ...@@ -171,25 +171,42 @@
framework = document.querySelector('[data-framework]').dataset.framework; framework = document.querySelector('[data-framework]').dataset.framework;
} }
this.template = template;
if (template && learnJSON[framework]) { if (learnJSON.backend) {
this.frameworkJSON = learnJSON.backend;
this.append({
backend: true
});
} else if (learnJSON[framework]) {
this.frameworkJSON = learnJSON[framework]; this.frameworkJSON = learnJSON[framework];
this.template = template;
this.append(); this.append();
} }
} }
Learn.prototype.append = function () { Learn.prototype.append = function (opts) {
var aside = document.createElement('aside'); var aside = document.createElement('aside');
aside.innerHTML = _.template(this.template, this.frameworkJSON); aside.innerHTML = _.template(this.template, this.frameworkJSON);
aside.className = 'learn'; aside.className = 'learn';
// Localize demo links if (opts && opts.backend) {
var demoLinks = aside.querySelectorAll('.demo-link'); // Remove demo link
Array.prototype.forEach.call(demoLinks, function (demoLink) { var sourceLinks = aside.querySelector('.source-links');
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href')); var heading = sourceLinks.firstElementChild;
}); var sourceLink = sourceLinks.lastElementChild;
// Correct link path
var href = sourceLink.getAttribute('href');
sourceLink.setAttribute('href', href.substr(href.lastIndexOf('http')));
sourceLinks.innerHTML = heading.outerHTML + sourceLink.outerHTML;
} else {
// Localize demo links
var demoLinks = aside.querySelectorAll('.demo-link');
Array.prototype.forEach.call(demoLinks, function (demoLink) {
if (demoLink.getAttribute('href').substr(0, 4) !== 'http') {
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href'));
}
});
}
document.body.className = (document.body.className + ' learn-bar').trim(); document.body.className = (document.body.className + ' learn-bar').trim();
document.body.insertAdjacentHTML('afterBegin', aside.outerHTML); document.body.insertAdjacentHTML('afterBegin', aside.outerHTML);
......
...@@ -4,6 +4,6 @@ ...@@ -4,6 +4,6 @@
"dependencies": { "dependencies": {
"jquery": "~2.0.0", "jquery": "~2.0.0",
"handlebars.js": "~1.0.0-rc.3", "handlebars.js": "~1.0.0-rc.3",
"todomvc-common": "~0.1.6" "todomvc-common": "~0.3.0"
} }
} }
...@@ -171,25 +171,42 @@ ...@@ -171,25 +171,42 @@
framework = document.querySelector('[data-framework]').dataset.framework; framework = document.querySelector('[data-framework]').dataset.framework;
} }
this.template = template;
if (template && learnJSON[framework]) { if (learnJSON.backend) {
this.frameworkJSON = learnJSON.backend;
this.append({
backend: true
});
} else if (learnJSON[framework]) {
this.frameworkJSON = learnJSON[framework]; this.frameworkJSON = learnJSON[framework];
this.template = template;
this.append(); this.append();
} }
} }
Learn.prototype.append = function () { Learn.prototype.append = function (opts) {
var aside = document.createElement('aside'); var aside = document.createElement('aside');
aside.innerHTML = _.template(this.template, this.frameworkJSON); aside.innerHTML = _.template(this.template, this.frameworkJSON);
aside.className = 'learn'; aside.className = 'learn';
// Localize demo links if (opts && opts.backend) {
var demoLinks = aside.querySelectorAll('.demo-link'); // Remove demo link
Array.prototype.forEach.call(demoLinks, function (demoLink) { var sourceLinks = aside.querySelector('.source-links');
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href')); var heading = sourceLinks.firstElementChild;
}); var sourceLink = sourceLinks.lastElementChild;
// Correct link path
var href = sourceLink.getAttribute('href');
sourceLink.setAttribute('href', href.substr(href.lastIndexOf('http')));
sourceLinks.innerHTML = heading.outerHTML + sourceLink.outerHTML;
} else {
// Localize demo links
var demoLinks = aside.querySelectorAll('.demo-link');
Array.prototype.forEach.call(demoLinks, function (demoLink) {
if (demoLink.getAttribute('href').substr(0, 4) !== 'http') {
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href'));
}
});
}
document.body.className = (document.body.className + ' learn-bar').trim(); document.body.className = (document.body.className + ' learn-bar').trim();
document.body.insertAdjacentHTML('afterBegin', aside.outerHTML); document.body.insertAdjacentHTML('afterBegin', aside.outerHTML);
......
{
"name": "todomvc-common",
"description": "Common TodoMVC utilities used by our apps",
"license": "MIT",
"authors": [
"TasteJS team"
],
"main": [
"base.js",
"base.css"
],
"keywords": [
"todomvc",
"tastejs",
"util",
"utilities"
],
"ignore": [
"package.json",
"readme.md"
]
}
...@@ -2,6 +2,6 @@ ...@@ -2,6 +2,6 @@
"name": "todmvc-dojo", "name": "todmvc-dojo",
"version": "0.0.0", "version": "0.0.0",
"dependencies": { "dependencies": {
"todomvc-common": "~0.1.6" "todomvc-common": "~0.3.0"
} }
} }
...@@ -171,25 +171,42 @@ ...@@ -171,25 +171,42 @@
framework = document.querySelector('[data-framework]').dataset.framework; framework = document.querySelector('[data-framework]').dataset.framework;
} }
this.template = template;
if (template && learnJSON[framework]) { if (learnJSON.backend) {
this.frameworkJSON = learnJSON.backend;
this.append({
backend: true
});
} else if (learnJSON[framework]) {
this.frameworkJSON = learnJSON[framework]; this.frameworkJSON = learnJSON[framework];
this.template = template;
this.append(); this.append();
} }
} }
Learn.prototype.append = function () { Learn.prototype.append = function (opts) {
var aside = document.createElement('aside'); var aside = document.createElement('aside');
aside.innerHTML = _.template(this.template, this.frameworkJSON); aside.innerHTML = _.template(this.template, this.frameworkJSON);
aside.className = 'learn'; aside.className = 'learn';
// Localize demo links if (opts && opts.backend) {
var demoLinks = aside.querySelectorAll('.demo-link'); // Remove demo link
Array.prototype.forEach.call(demoLinks, function (demoLink) { var sourceLinks = aside.querySelector('.source-links');
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href')); var heading = sourceLinks.firstElementChild;
}); var sourceLink = sourceLinks.lastElementChild;
// Correct link path
var href = sourceLink.getAttribute('href');
sourceLink.setAttribute('href', href.substr(href.lastIndexOf('http')));
sourceLinks.innerHTML = heading.outerHTML + sourceLink.outerHTML;
} else {
// Localize demo links
var demoLinks = aside.querySelectorAll('.demo-link');
Array.prototype.forEach.call(demoLinks, function (demoLink) {
if (demoLink.getAttribute('href').substr(0, 4) !== 'http') {
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href'));
}
});
}
document.body.className = (document.body.className + ' learn-bar').trim(); document.body.className = (document.body.className + ' learn-bar').trim();
document.body.insertAdjacentHTML('afterBegin', aside.outerHTML); document.body.insertAdjacentHTML('afterBegin', aside.outerHTML);
......
{
"name": "todomvc-common",
"description": "Common TodoMVC utilities used by our apps",
"license": "MIT",
"authors": [
"TasteJS team"
],
"main": [
"base.js",
"base.css"
],
"keywords": [
"todomvc",
"tastejs",
"util",
"utilities"
],
"ignore": [
"package.json",
"readme.md"
]
}
...@@ -2,6 +2,6 @@ ...@@ -2,6 +2,6 @@
"name": "todomvc-duel", "name": "todomvc-duel",
"version": "0.0.0", "version": "0.0.0",
"dependencies": { "dependencies": {
"todomvc-common": "~0.1.6" "todomvc-common": "~0.3.0"
} }
} }
...@@ -171,25 +171,42 @@ ...@@ -171,25 +171,42 @@
framework = document.querySelector('[data-framework]').dataset.framework; framework = document.querySelector('[data-framework]').dataset.framework;
} }
this.template = template;
if (template && learnJSON[framework]) { if (learnJSON.backend) {
this.frameworkJSON = learnJSON.backend;
this.append({
backend: true
});
} else if (learnJSON[framework]) {
this.frameworkJSON = learnJSON[framework]; this.frameworkJSON = learnJSON[framework];
this.template = template;
this.append(); this.append();
} }
} }
Learn.prototype.append = function () { Learn.prototype.append = function (opts) {
var aside = document.createElement('aside'); var aside = document.createElement('aside');
aside.innerHTML = _.template(this.template, this.frameworkJSON); aside.innerHTML = _.template(this.template, this.frameworkJSON);
aside.className = 'learn'; aside.className = 'learn';
// Localize demo links if (opts && opts.backend) {
var demoLinks = aside.querySelectorAll('.demo-link'); // Remove demo link
Array.prototype.forEach.call(demoLinks, function (demoLink) { var sourceLinks = aside.querySelector('.source-links');
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href')); var heading = sourceLinks.firstElementChild;
}); var sourceLink = sourceLinks.lastElementChild;
// Correct link path
var href = sourceLink.getAttribute('href');
sourceLink.setAttribute('href', href.substr(href.lastIndexOf('http')));
sourceLinks.innerHTML = heading.outerHTML + sourceLink.outerHTML;
} else {
// Localize demo links
var demoLinks = aside.querySelectorAll('.demo-link');
Array.prototype.forEach.call(demoLinks, function (demoLink) {
if (demoLink.getAttribute('href').substr(0, 4) !== 'http') {
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href'));
}
});
}
document.body.className = (document.body.className + ' learn-bar').trim(); document.body.className = (document.body.className + ' learn-bar').trim();
document.body.insertAdjacentHTML('afterBegin', aside.outerHTML); document.body.insertAdjacentHTML('afterBegin', aside.outerHTML);
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
"sammy": "~0.7.4", "sammy": "~0.7.4",
"jquery": "~1.9.1", "jquery": "~1.9.1",
"knockout": "~2.2.1", "knockout": "~2.2.1",
"todomvc-common": "~0.1.4", "todomvc-common": "~0.3.0",
"requirejs": "~2.1.6" "requirejs": "~2.1.6"
} }
} }
...@@ -171,25 +171,42 @@ ...@@ -171,25 +171,42 @@
framework = document.querySelector('[data-framework]').dataset.framework; framework = document.querySelector('[data-framework]').dataset.framework;
} }
this.template = template;
if (template && learnJSON[framework]) { if (learnJSON.backend) {
this.frameworkJSON = learnJSON.backend;
this.append({
backend: true
});
} else if (learnJSON[framework]) {
this.frameworkJSON = learnJSON[framework]; this.frameworkJSON = learnJSON[framework];
this.template = template;
this.append(); this.append();
} }
} }
Learn.prototype.append = function () { Learn.prototype.append = function (opts) {
var aside = document.createElement('aside'); var aside = document.createElement('aside');
aside.innerHTML = _.template(this.template, this.frameworkJSON); aside.innerHTML = _.template(this.template, this.frameworkJSON);
aside.className = 'learn'; aside.className = 'learn';
// Localize demo links if (opts && opts.backend) {
var demoLinks = aside.querySelectorAll('.demo-link'); // Remove demo link
Array.prototype.forEach.call(demoLinks, function (demoLink) { var sourceLinks = aside.querySelector('.source-links');
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href')); var heading = sourceLinks.firstElementChild;
}); var sourceLink = sourceLinks.lastElementChild;
// Correct link path
var href = sourceLink.getAttribute('href');
sourceLink.setAttribute('href', href.substr(href.lastIndexOf('http')));
sourceLinks.innerHTML = heading.outerHTML + sourceLink.outerHTML;
} else {
// Localize demo links
var demoLinks = aside.querySelectorAll('.demo-link');
Array.prototype.forEach.call(demoLinks, function (demoLink) {
if (demoLink.getAttribute('href').substr(0, 4) !== 'http') {
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href'));
}
});
}
document.body.className = (document.body.className + ' learn-bar').trim(); document.body.className = (document.body.className + ' learn-bar').trim();
document.body.insertAdjacentHTML('afterBegin', aside.outerHTML); document.body.insertAdjacentHTML('afterBegin', aside.outerHTML);
......
{
"name": "todomvc-common",
"description": "Common TodoMVC utilities used by our apps",
"license": "MIT",
"authors": [
"TasteJS team"
],
"main": [
"base.js",
"base.css"
],
"keywords": [
"todomvc",
"tastejs",
"util",
"utilities"
],
"ignore": [
"package.json",
"readme.md"
]
}
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
"name": "todomvc-emberjs", "name": "todomvc-emberjs",
"version": "0.0.0", "version": "0.0.0",
"dependencies": { "dependencies": {
"todomvc-common": "~0.1.4", "todomvc-common": "~0.3.0",
"jquery": "~2.1.0", "jquery": "~2.1.0",
"handlebars": "~1.3.0", "handlebars": "~1.3.0",
"ember": "~1.6.0", "ember": "~1.6.0",
......
...@@ -171,25 +171,42 @@ ...@@ -171,25 +171,42 @@
framework = document.querySelector('[data-framework]').dataset.framework; framework = document.querySelector('[data-framework]').dataset.framework;
} }
this.template = template;
if (template && learnJSON[framework]) { if (learnJSON.backend) {
this.frameworkJSON = learnJSON.backend;
this.append({
backend: true
});
} else if (learnJSON[framework]) {
this.frameworkJSON = learnJSON[framework]; this.frameworkJSON = learnJSON[framework];
this.template = template;
this.append(); this.append();
} }
} }
Learn.prototype.append = function () { Learn.prototype.append = function (opts) {
var aside = document.createElement('aside'); var aside = document.createElement('aside');
aside.innerHTML = _.template(this.template, this.frameworkJSON); aside.innerHTML = _.template(this.template, this.frameworkJSON);
aside.className = 'learn'; aside.className = 'learn';
// Localize demo links if (opts && opts.backend) {
var demoLinks = aside.querySelectorAll('.demo-link'); // Remove demo link
Array.prototype.forEach.call(demoLinks, function (demoLink) { var sourceLinks = aside.querySelector('.source-links');
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href')); var heading = sourceLinks.firstElementChild;
}); var sourceLink = sourceLinks.lastElementChild;
// Correct link path
var href = sourceLink.getAttribute('href');
sourceLink.setAttribute('href', href.substr(href.lastIndexOf('http')));
sourceLinks.innerHTML = heading.outerHTML + sourceLink.outerHTML;
} else {
// Localize demo links
var demoLinks = aside.querySelectorAll('.demo-link');
Array.prototype.forEach.call(demoLinks, function (demoLink) {
if (demoLink.getAttribute('href').substr(0, 4) !== 'http') {
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href'));
}
});
}
document.body.className = (document.body.className + ' learn-bar').trim(); document.body.className = (document.body.className + ' learn-bar').trim();
document.body.insertAdjacentHTML('afterBegin', aside.outerHTML); document.body.insertAdjacentHTML('afterBegin', aside.outerHTML);
......
{
"name": "todomvc-common",
"description": "Common TodoMVC utilities used by our apps",
"license": "MIT",
"authors": [
"TasteJS team"
],
"main": [
"base.js",
"base.css"
],
"keywords": [
"todomvc",
"tastejs",
"util",
"utilities"
],
"ignore": [
"package.json",
"readme.md"
]
}
...@@ -2,6 +2,6 @@ ...@@ -2,6 +2,6 @@
"name": "todomvc-enyo-backbone", "name": "todomvc-enyo-backbone",
"version": "0.0.0", "version": "0.0.0",
"dependencies": { "dependencies": {
"todomvc-common": "~0.1.4" "todomvc-common": "~0.3.0"
} }
} }
\ No newline at end of file
...@@ -171,25 +171,42 @@ ...@@ -171,25 +171,42 @@
framework = document.querySelector('[data-framework]').dataset.framework; framework = document.querySelector('[data-framework]').dataset.framework;
} }
this.template = template;
if (template && learnJSON[framework]) { if (learnJSON.backend) {
this.frameworkJSON = learnJSON.backend;
this.append({
backend: true
});
} else if (learnJSON[framework]) {
this.frameworkJSON = learnJSON[framework]; this.frameworkJSON = learnJSON[framework];
this.template = template;
this.append(); this.append();
} }
} }
Learn.prototype.append = function () { Learn.prototype.append = function (opts) {
var aside = document.createElement('aside'); var aside = document.createElement('aside');
aside.innerHTML = _.template(this.template, this.frameworkJSON); aside.innerHTML = _.template(this.template, this.frameworkJSON);
aside.className = 'learn'; aside.className = 'learn';
// Localize demo links if (opts && opts.backend) {
var demoLinks = aside.querySelectorAll('.demo-link'); // Remove demo link
Array.prototype.forEach.call(demoLinks, function (demoLink) { var sourceLinks = aside.querySelector('.source-links');
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href')); var heading = sourceLinks.firstElementChild;
}); var sourceLink = sourceLinks.lastElementChild;
// Correct link path
var href = sourceLink.getAttribute('href');
sourceLink.setAttribute('href', href.substr(href.lastIndexOf('http')));
sourceLinks.innerHTML = heading.outerHTML + sourceLink.outerHTML;
} else {
// Localize demo links
var demoLinks = aside.querySelectorAll('.demo-link');
Array.prototype.forEach.call(demoLinks, function (demoLink) {
if (demoLink.getAttribute('href').substr(0, 4) !== 'http') {
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href'));
}
});
}
document.body.className = (document.body.className + ' learn-bar').trim(); document.body.className = (document.body.className + ' learn-bar').trim();
document.body.insertAdjacentHTML('afterBegin', aside.outerHTML); document.body.insertAdjacentHTML('afterBegin', aside.outerHTML);
......
{
"name": "todomvc-common",
"description": "Common TodoMVC utilities used by our apps",
"license": "MIT",
"authors": [
"TasteJS team"
],
"main": [
"base.js",
"base.css"
],
"keywords": [
"todomvc",
"tastejs",
"util",
"utilities"
],
"ignore": [
"package.json",
"readme.md"
]
}
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
"name": "todomvc-epitome", "name": "todomvc-epitome",
"version": "0.0.0", "version": "0.0.0",
"dependencies": { "dependencies": {
"todomvc-common": "~0.1.6", "todomvc-common": "~0.3.0",
"Epitome": "~0.3.1" "Epitome": "~0.3.1"
} }
} }
...@@ -171,25 +171,42 @@ ...@@ -171,25 +171,42 @@
framework = document.querySelector('[data-framework]').dataset.framework; framework = document.querySelector('[data-framework]').dataset.framework;
} }
this.template = template;
if (template && learnJSON[framework]) { if (learnJSON.backend) {
this.frameworkJSON = learnJSON.backend;
this.append({
backend: true
});
} else if (learnJSON[framework]) {
this.frameworkJSON = learnJSON[framework]; this.frameworkJSON = learnJSON[framework];
this.template = template;
this.append(); this.append();
} }
} }
Learn.prototype.append = function () { Learn.prototype.append = function (opts) {
var aside = document.createElement('aside'); var aside = document.createElement('aside');
aside.innerHTML = _.template(this.template, this.frameworkJSON); aside.innerHTML = _.template(this.template, this.frameworkJSON);
aside.className = 'learn'; aside.className = 'learn';
// Localize demo links if (opts && opts.backend) {
var demoLinks = aside.querySelectorAll('.demo-link'); // Remove demo link
Array.prototype.forEach.call(demoLinks, function (demoLink) { var sourceLinks = aside.querySelector('.source-links');
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href')); var heading = sourceLinks.firstElementChild;
}); var sourceLink = sourceLinks.lastElementChild;
// Correct link path
var href = sourceLink.getAttribute('href');
sourceLink.setAttribute('href', href.substr(href.lastIndexOf('http')));
sourceLinks.innerHTML = heading.outerHTML + sourceLink.outerHTML;
} else {
// Localize demo links
var demoLinks = aside.querySelectorAll('.demo-link');
Array.prototype.forEach.call(demoLinks, function (demoLink) {
if (demoLink.getAttribute('href').substr(0, 4) !== 'http') {
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href'));
}
});
}
document.body.className = (document.body.className + ' learn-bar').trim(); document.body.className = (document.body.className + ' learn-bar').trim();
document.body.insertAdjacentHTML('afterBegin', aside.outerHTML); document.body.insertAdjacentHTML('afterBegin', aside.outerHTML);
......
{
"name": "todomvc-common",
"description": "Common TodoMVC utilities used by our apps",
"license": "MIT",
"authors": [
"TasteJS team"
],
"main": [
"base.js",
"base.css"
],
"keywords": [
"todomvc",
"tastejs",
"util",
"utilities"
],
"ignore": [
"package.json",
"readme.md"
]
}
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
"dependencies": { "dependencies": {
"exoskeleton": "~0.3.0", "exoskeleton": "~0.3.0",
"microtemplates": "~0.1.0", "microtemplates": "~0.1.0",
"todomvc-common": "~0.1.4", "todomvc-common": "~0.3.0",
"backbone.localStorage": "git://github.com/paulmillr/Backbone.localStorage.git#9c225b37bdea4ac21d4b2445fa8962fe74e3175b" "backbone.localStorage": "git://github.com/paulmillr/Backbone.localStorage.git#9c225b37bdea4ac21d4b2445fa8962fe74e3175b"
} }
} }
...@@ -171,25 +171,42 @@ ...@@ -171,25 +171,42 @@
framework = document.querySelector('[data-framework]').dataset.framework; framework = document.querySelector('[data-framework]').dataset.framework;
} }
this.template = template;
if (template && learnJSON[framework]) { if (learnJSON.backend) {
this.frameworkJSON = learnJSON.backend;
this.append({
backend: true
});
} else if (learnJSON[framework]) {
this.frameworkJSON = learnJSON[framework]; this.frameworkJSON = learnJSON[framework];
this.template = template;
this.append(); this.append();
} }
} }
Learn.prototype.append = function () { Learn.prototype.append = function (opts) {
var aside = document.createElement('aside'); var aside = document.createElement('aside');
aside.innerHTML = _.template(this.template, this.frameworkJSON); aside.innerHTML = _.template(this.template, this.frameworkJSON);
aside.className = 'learn'; aside.className = 'learn';
// Localize demo links if (opts && opts.backend) {
var demoLinks = aside.querySelectorAll('.demo-link'); // Remove demo link
Array.prototype.forEach.call(demoLinks, function (demoLink) { var sourceLinks = aside.querySelector('.source-links');
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href')); var heading = sourceLinks.firstElementChild;
}); var sourceLink = sourceLinks.lastElementChild;
// Correct link path
var href = sourceLink.getAttribute('href');
sourceLink.setAttribute('href', href.substr(href.lastIndexOf('http')));
sourceLinks.innerHTML = heading.outerHTML + sourceLink.outerHTML;
} else {
// Localize demo links
var demoLinks = aside.querySelectorAll('.demo-link');
Array.prototype.forEach.call(demoLinks, function (demoLink) {
if (demoLink.getAttribute('href').substr(0, 4) !== 'http') {
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href'));
}
});
}
document.body.className = (document.body.className + ' learn-bar').trim(); document.body.className = (document.body.className + ' learn-bar').trim();
document.body.insertAdjacentHTML('afterBegin', aside.outerHTML); document.body.insertAdjacentHTML('afterBegin', aside.outerHTML);
......
{
"name": "todomvc-common",
"description": "Common TodoMVC utilities used by our apps",
"license": "MIT",
"authors": [
"TasteJS team"
],
"main": [
"base.js",
"base.css"
],
"keywords": [
"todomvc",
"tastejs",
"util",
"utilities"
],
"ignore": [
"package.json",
"readme.md"
]
}
...@@ -2,6 +2,6 @@ ...@@ -2,6 +2,6 @@
"name": "todomvc-extjs_deftjs", "name": "todomvc-extjs_deftjs",
"version": "0.0.0", "version": "0.0.0",
"dependencies": { "dependencies": {
"todomvc-common": "~0.1.6" "todomvc-common": "~0.3.0"
} }
} }
...@@ -171,25 +171,42 @@ ...@@ -171,25 +171,42 @@
framework = document.querySelector('[data-framework]').dataset.framework; framework = document.querySelector('[data-framework]').dataset.framework;
} }
this.template = template;
if (template && learnJSON[framework]) { if (learnJSON.backend) {
this.frameworkJSON = learnJSON.backend;
this.append({
backend: true
});
} else if (learnJSON[framework]) {
this.frameworkJSON = learnJSON[framework]; this.frameworkJSON = learnJSON[framework];
this.template = template;
this.append(); this.append();
} }
} }
Learn.prototype.append = function () { Learn.prototype.append = function (opts) {
var aside = document.createElement('aside'); var aside = document.createElement('aside');
aside.innerHTML = _.template(this.template, this.frameworkJSON); aside.innerHTML = _.template(this.template, this.frameworkJSON);
aside.className = 'learn'; aside.className = 'learn';
// Localize demo links if (opts && opts.backend) {
var demoLinks = aside.querySelectorAll('.demo-link'); // Remove demo link
Array.prototype.forEach.call(demoLinks, function (demoLink) { var sourceLinks = aside.querySelector('.source-links');
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href')); var heading = sourceLinks.firstElementChild;
}); var sourceLink = sourceLinks.lastElementChild;
// Correct link path
var href = sourceLink.getAttribute('href');
sourceLink.setAttribute('href', href.substr(href.lastIndexOf('http')));
sourceLinks.innerHTML = heading.outerHTML + sourceLink.outerHTML;
} else {
// Localize demo links
var demoLinks = aside.querySelectorAll('.demo-link');
Array.prototype.forEach.call(demoLinks, function (demoLink) {
if (demoLink.getAttribute('href').substr(0, 4) !== 'http') {
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href'));
}
});
}
document.body.className = (document.body.className + ' learn-bar').trim(); document.body.className = (document.body.className + ' learn-bar').trim();
document.body.insertAdjacentHTML('afterBegin', aside.outerHTML); document.body.insertAdjacentHTML('afterBegin', aside.outerHTML);
......
{
"name": "todomvc-common",
"description": "Common TodoMVC utilities used by our apps",
"license": "MIT",
"authors": [
"TasteJS team"
],
"main": [
"base.js",
"base.css"
],
"keywords": [
"todomvc",
"tastejs",
"util",
"utilities"
],
"ignore": [
"package.json",
"readme.md"
]
}
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
"dependencies": { "dependencies": {
"angular": "1.2.8", "angular": "1.2.8",
"angularfire": "~0.5.0", "angularfire": "~0.5.0",
"todomvc-common": "~0.1.4" "todomvc-common": "~0.3.0"
}, },
"devDependencies": { "devDependencies": {
"angular-mocks": "1.2.8" "angular-mocks": "1.2.8"
......
...@@ -171,25 +171,42 @@ ...@@ -171,25 +171,42 @@
framework = document.querySelector('[data-framework]').dataset.framework; framework = document.querySelector('[data-framework]').dataset.framework;
} }
this.template = template;
if (template && learnJSON[framework]) { if (learnJSON.backend) {
this.frameworkJSON = learnJSON.backend;
this.append({
backend: true
});
} else if (learnJSON[framework]) {
this.frameworkJSON = learnJSON[framework]; this.frameworkJSON = learnJSON[framework];
this.template = template;
this.append(); this.append();
} }
} }
Learn.prototype.append = function () { Learn.prototype.append = function (opts) {
var aside = document.createElement('aside'); var aside = document.createElement('aside');
aside.innerHTML = _.template(this.template, this.frameworkJSON); aside.innerHTML = _.template(this.template, this.frameworkJSON);
aside.className = 'learn'; aside.className = 'learn';
// Localize demo links if (opts && opts.backend) {
var demoLinks = aside.querySelectorAll('.demo-link'); // Remove demo link
Array.prototype.forEach.call(demoLinks, function (demoLink) { var sourceLinks = aside.querySelector('.source-links');
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href')); var heading = sourceLinks.firstElementChild;
}); var sourceLink = sourceLinks.lastElementChild;
// Correct link path
var href = sourceLink.getAttribute('href');
sourceLink.setAttribute('href', href.substr(href.lastIndexOf('http')));
sourceLinks.innerHTML = heading.outerHTML + sourceLink.outerHTML;
} else {
// Localize demo links
var demoLinks = aside.querySelectorAll('.demo-link');
Array.prototype.forEach.call(demoLinks, function (demoLink) {
if (demoLink.getAttribute('href').substr(0, 4) !== 'http') {
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href'));
}
});
}
document.body.className = (document.body.className + ' learn-bar').trim(); document.body.className = (document.body.className + ' learn-bar').trim();
document.body.insertAdjacentHTML('afterBegin', aside.outerHTML); document.body.insertAdjacentHTML('afterBegin', aside.outerHTML);
......
{
"name": "todomvc-common",
"description": "Common TodoMVC utilities used by our apps",
"license": "MIT",
"authors": [
"TasteJS team"
],
"main": [
"base.js",
"base.css"
],
"keywords": [
"todomvc",
"tastejs",
"util",
"utilities"
],
"ignore": [
"package.json",
"readme.md"
]
}
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
"flight": "~1.1.0", "flight": "~1.1.0",
"jquery": "1.8.3", "jquery": "1.8.3",
"requirejs": "~2.1.5", "requirejs": "~2.1.5",
"todomvc-common": "~0.1.4", "todomvc-common": "~0.3.0",
"requirejs-text": "~2.0.10" "requirejs-text": "~2.0.10"
}, },
"devDependencies": { "devDependencies": {
......
...@@ -171,25 +171,42 @@ ...@@ -171,25 +171,42 @@
framework = document.querySelector('[data-framework]').dataset.framework; framework = document.querySelector('[data-framework]').dataset.framework;
} }
this.template = template;
if (template && learnJSON[framework]) { if (learnJSON.backend) {
this.frameworkJSON = learnJSON.backend;
this.append({
backend: true
});
} else if (learnJSON[framework]) {
this.frameworkJSON = learnJSON[framework]; this.frameworkJSON = learnJSON[framework];
this.template = template;
this.append(); this.append();
} }
} }
Learn.prototype.append = function () { Learn.prototype.append = function (opts) {
var aside = document.createElement('aside'); var aside = document.createElement('aside');
aside.innerHTML = _.template(this.template, this.frameworkJSON); aside.innerHTML = _.template(this.template, this.frameworkJSON);
aside.className = 'learn'; aside.className = 'learn';
// Localize demo links if (opts && opts.backend) {
var demoLinks = aside.querySelectorAll('.demo-link'); // Remove demo link
Array.prototype.forEach.call(demoLinks, function (demoLink) { var sourceLinks = aside.querySelector('.source-links');
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href')); var heading = sourceLinks.firstElementChild;
}); var sourceLink = sourceLinks.lastElementChild;
// Correct link path
var href = sourceLink.getAttribute('href');
sourceLink.setAttribute('href', href.substr(href.lastIndexOf('http')));
sourceLinks.innerHTML = heading.outerHTML + sourceLink.outerHTML;
} else {
// Localize demo links
var demoLinks = aside.querySelectorAll('.demo-link');
Array.prototype.forEach.call(demoLinks, function (demoLink) {
if (demoLink.getAttribute('href').substr(0, 4) !== 'http') {
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href'));
}
});
}
document.body.className = (document.body.className + ' learn-bar').trim(); document.body.className = (document.body.className + ' learn-bar').trim();
document.body.insertAdjacentHTML('afterBegin', aside.outerHTML); document.body.insertAdjacentHTML('afterBegin', aside.outerHTML);
......
{
"name": "todomvc-common",
"description": "Common TodoMVC utilities used by our apps",
"license": "MIT",
"authors": [
"TasteJS team"
],
"main": [
"base.js",
"base.css"
],
"keywords": [
"todomvc",
"tastejs",
"util",
"utilities"
],
"ignore": [
"package.json",
"readme.md"
]
}
...@@ -2,6 +2,6 @@ ...@@ -2,6 +2,6 @@
"name": "gwt", "name": "gwt",
"version": "0.0.0", "version": "0.0.0",
"dependencies": { "dependencies": {
"todomvc-common": "~0.1.6" "todomvc-common": "~0.3.0"
} }
} }
\ No newline at end of file
...@@ -171,25 +171,42 @@ ...@@ -171,25 +171,42 @@
framework = document.querySelector('[data-framework]').dataset.framework; framework = document.querySelector('[data-framework]').dataset.framework;
} }
this.template = template;
if (template && learnJSON[framework]) { if (learnJSON.backend) {
this.frameworkJSON = learnJSON.backend;
this.append({
backend: true
});
} else if (learnJSON[framework]) {
this.frameworkJSON = learnJSON[framework]; this.frameworkJSON = learnJSON[framework];
this.template = template;
this.append(); this.append();
} }
} }
Learn.prototype.append = function () { Learn.prototype.append = function (opts) {
var aside = document.createElement('aside'); var aside = document.createElement('aside');
aside.innerHTML = _.template(this.template, this.frameworkJSON); aside.innerHTML = _.template(this.template, this.frameworkJSON);
aside.className = 'learn'; aside.className = 'learn';
// Localize demo links if (opts && opts.backend) {
var demoLinks = aside.querySelectorAll('.demo-link'); // Remove demo link
Array.prototype.forEach.call(demoLinks, function (demoLink) { var sourceLinks = aside.querySelector('.source-links');
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href')); var heading = sourceLinks.firstElementChild;
}); var sourceLink = sourceLinks.lastElementChild;
// Correct link path
var href = sourceLink.getAttribute('href');
sourceLink.setAttribute('href', href.substr(href.lastIndexOf('http')));
sourceLinks.innerHTML = heading.outerHTML + sourceLink.outerHTML;
} else {
// Localize demo links
var demoLinks = aside.querySelectorAll('.demo-link');
Array.prototype.forEach.call(demoLinks, function (demoLink) {
if (demoLink.getAttribute('href').substr(0, 4) !== 'http') {
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href'));
}
});
}
document.body.className = (document.body.className + ' learn-bar').trim(); document.body.className = (document.body.className + ' learn-bar').trim();
document.body.insertAdjacentHTML('afterBegin', aside.outerHTML); document.body.insertAdjacentHTML('afterBegin', aside.outerHTML);
......
{
"name": "todomvc-common",
"description": "Common TodoMVC utilities used by our apps",
"license": "MIT",
"authors": [
"TasteJS team"
],
"main": [
"base.js",
"base.css"
],
"keywords": [
"todomvc",
"tastejs",
"util",
"utilities"
],
"ignore": [
"package.json",
"readme.md"
]
}
{ {
"name": "todomvc-jquery", "name": "todomvc-jquery",
"dependencies": { "dependencies": {
"todomvc-common": "~0.1.11", "todomvc-common": "~0.3.0",
"jquery": "~2.1.1", "jquery": "~2.1.1",
"handlebars": "~2.0.0", "handlebars": "~2.0.0",
"director": "~1.2.2" "director": "~1.2.2"
......
...@@ -171,25 +171,42 @@ ...@@ -171,25 +171,42 @@
framework = document.querySelector('[data-framework]').dataset.framework; framework = document.querySelector('[data-framework]').dataset.framework;
} }
this.template = template;
if (template && learnJSON[framework]) { if (learnJSON.backend) {
this.frameworkJSON = learnJSON.backend;
this.append({
backend: true
});
} else if (learnJSON[framework]) {
this.frameworkJSON = learnJSON[framework]; this.frameworkJSON = learnJSON[framework];
this.template = template;
this.append(); this.append();
} }
} }
Learn.prototype.append = function () { Learn.prototype.append = function (opts) {
var aside = document.createElement('aside'); var aside = document.createElement('aside');
aside.innerHTML = _.template(this.template, this.frameworkJSON); aside.innerHTML = _.template(this.template, this.frameworkJSON);
aside.className = 'learn'; aside.className = 'learn';
// Localize demo links if (opts && opts.backend) {
var demoLinks = aside.querySelectorAll('.demo-link'); // Remove demo link
Array.prototype.forEach.call(demoLinks, function (demoLink) { var sourceLinks = aside.querySelector('.source-links');
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href')); var heading = sourceLinks.firstElementChild;
}); var sourceLink = sourceLinks.lastElementChild;
// Correct link path
var href = sourceLink.getAttribute('href');
sourceLink.setAttribute('href', href.substr(href.lastIndexOf('http')));
sourceLinks.innerHTML = heading.outerHTML + sourceLink.outerHTML;
} else {
// Localize demo links
var demoLinks = aside.querySelectorAll('.demo-link');
Array.prototype.forEach.call(demoLinks, function (demoLink) {
if (demoLink.getAttribute('href').substr(0, 4) !== 'http') {
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href'));
}
});
}
document.body.className = (document.body.className + ' learn-bar').trim(); document.body.className = (document.body.className + ' learn-bar').trim();
document.body.insertAdjacentHTML('afterBegin', aside.outerHTML); document.body.insertAdjacentHTML('afterBegin', aside.outerHTML);
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
"name": "todomvc-kendo", "name": "todomvc-kendo",
"version": "0.0.0", "version": "0.0.0",
"dependencies": { "dependencies": {
"todomvc-common": "~0.1.6", "todomvc-common": "~0.3.0",
"jquery": "~2.1.0", "jquery": "~2.1.0",
"kendo-ui": "~2013.3.1119" "kendo-ui": "~2013.3.1119"
} }
......
...@@ -171,25 +171,42 @@ ...@@ -171,25 +171,42 @@
framework = document.querySelector('[data-framework]').dataset.framework; framework = document.querySelector('[data-framework]').dataset.framework;
} }
this.template = template;
if (template && learnJSON[framework]) { if (learnJSON.backend) {
this.frameworkJSON = learnJSON.backend;
this.append({
backend: true
});
} else if (learnJSON[framework]) {
this.frameworkJSON = learnJSON[framework]; this.frameworkJSON = learnJSON[framework];
this.template = template;
this.append(); this.append();
} }
} }
Learn.prototype.append = function () { Learn.prototype.append = function (opts) {
var aside = document.createElement('aside'); var aside = document.createElement('aside');
aside.innerHTML = _.template(this.template, this.frameworkJSON); aside.innerHTML = _.template(this.template, this.frameworkJSON);
aside.className = 'learn'; aside.className = 'learn';
// Localize demo links if (opts && opts.backend) {
var demoLinks = aside.querySelectorAll('.demo-link'); // Remove demo link
Array.prototype.forEach.call(demoLinks, function (demoLink) { var sourceLinks = aside.querySelector('.source-links');
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href')); var heading = sourceLinks.firstElementChild;
}); var sourceLink = sourceLinks.lastElementChild;
// Correct link path
var href = sourceLink.getAttribute('href');
sourceLink.setAttribute('href', href.substr(href.lastIndexOf('http')));
sourceLinks.innerHTML = heading.outerHTML + sourceLink.outerHTML;
} else {
// Localize demo links
var demoLinks = aside.querySelectorAll('.demo-link');
Array.prototype.forEach.call(demoLinks, function (demoLink) {
if (demoLink.getAttribute('href').substr(0, 4) !== 'http') {
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href'));
}
});
}
document.body.className = (document.body.className + ' learn-bar').trim(); document.body.className = (document.body.className + ' learn-bar').trim();
document.body.insertAdjacentHTML('afterBegin', aside.outerHTML); document.body.insertAdjacentHTML('afterBegin', aside.outerHTML);
......
{
"name": "todomvc-common",
"description": "Common TodoMVC utilities used by our apps",
"license": "MIT",
"authors": [
"TasteJS team"
],
"main": [
"base.js",
"base.css"
],
"keywords": [
"todomvc",
"tastejs",
"util",
"utilities"
],
"ignore": [
"package.json",
"readme.md"
]
}
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
"version": "0.0.0", "version": "0.0.0",
"dependencies": { "dependencies": {
"jquery": "~2.0.0", "jquery": "~2.0.0",
"todomvc-common": "~0.1.6", "todomvc-common": "~0.3.0",
"Backbone.localStorage": "~1.1.3" "Backbone.localStorage": "~1.1.3"
} }
} }
...@@ -171,25 +171,42 @@ ...@@ -171,25 +171,42 @@
framework = document.querySelector('[data-framework]').dataset.framework; framework = document.querySelector('[data-framework]').dataset.framework;
} }
this.template = template;
if (template && learnJSON[framework]) { if (learnJSON.backend) {
this.frameworkJSON = learnJSON.backend;
this.append({
backend: true
});
} else if (learnJSON[framework]) {
this.frameworkJSON = learnJSON[framework]; this.frameworkJSON = learnJSON[framework];
this.template = template;
this.append(); this.append();
} }
} }
Learn.prototype.append = function () { Learn.prototype.append = function (opts) {
var aside = document.createElement('aside'); var aside = document.createElement('aside');
aside.innerHTML = _.template(this.template, this.frameworkJSON); aside.innerHTML = _.template(this.template, this.frameworkJSON);
aside.className = 'learn'; aside.className = 'learn';
// Localize demo links if (opts && opts.backend) {
var demoLinks = aside.querySelectorAll('.demo-link'); // Remove demo link
Array.prototype.forEach.call(demoLinks, function (demoLink) { var sourceLinks = aside.querySelector('.source-links');
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href')); var heading = sourceLinks.firstElementChild;
}); var sourceLink = sourceLinks.lastElementChild;
// Correct link path
var href = sourceLink.getAttribute('href');
sourceLink.setAttribute('href', href.substr(href.lastIndexOf('http')));
sourceLinks.innerHTML = heading.outerHTML + sourceLink.outerHTML;
} else {
// Localize demo links
var demoLinks = aside.querySelectorAll('.demo-link');
Array.prototype.forEach.call(demoLinks, function (demoLink) {
if (demoLink.getAttribute('href').substr(0, 4) !== 'http') {
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href'));
}
});
}
document.body.className = (document.body.className + ' learn-bar').trim(); document.body.className = (document.body.className + ' learn-bar').trim();
document.body.insertAdjacentHTML('afterBegin', aside.outerHTML); document.body.insertAdjacentHTML('afterBegin', aside.outerHTML);
......
{
"name": "todomvc-common",
"description": "Common TodoMVC utilities used by our apps",
"license": "MIT",
"authors": [
"TasteJS team"
],
"main": [
"base.js",
"base.css"
],
"keywords": [
"todomvc",
"tastejs",
"util",
"utilities"
],
"ignore": [
"package.json",
"readme.md"
]
}
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
"name": "todomvc-knockoutjs", "name": "todomvc-knockoutjs",
"version": "0.0.0", "version": "0.0.0",
"dependencies": { "dependencies": {
"todomvc-common": "~0.1.4", "todomvc-common": "~0.3.0",
"component-knockout-passy": "~3.1.0", "component-knockout-passy": "~3.1.0",
"director": "~1.2.0" "director": "~1.2.0"
} }
......
...@@ -171,25 +171,42 @@ ...@@ -171,25 +171,42 @@
framework = document.querySelector('[data-framework]').dataset.framework; framework = document.querySelector('[data-framework]').dataset.framework;
} }
this.template = template;
if (template && learnJSON[framework]) { if (learnJSON.backend) {
this.frameworkJSON = learnJSON.backend;
this.append({
backend: true
});
} else if (learnJSON[framework]) {
this.frameworkJSON = learnJSON[framework]; this.frameworkJSON = learnJSON[framework];
this.template = template;
this.append(); this.append();
} }
} }
Learn.prototype.append = function () { Learn.prototype.append = function (opts) {
var aside = document.createElement('aside'); var aside = document.createElement('aside');
aside.innerHTML = _.template(this.template, this.frameworkJSON); aside.innerHTML = _.template(this.template, this.frameworkJSON);
aside.className = 'learn'; aside.className = 'learn';
// Localize demo links if (opts && opts.backend) {
var demoLinks = aside.querySelectorAll('.demo-link'); // Remove demo link
Array.prototype.forEach.call(demoLinks, function (demoLink) { var sourceLinks = aside.querySelector('.source-links');
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href')); var heading = sourceLinks.firstElementChild;
}); var sourceLink = sourceLinks.lastElementChild;
// Correct link path
var href = sourceLink.getAttribute('href');
sourceLink.setAttribute('href', href.substr(href.lastIndexOf('http')));
sourceLinks.innerHTML = heading.outerHTML + sourceLink.outerHTML;
} else {
// Localize demo links
var demoLinks = aside.querySelectorAll('.demo-link');
Array.prototype.forEach.call(demoLinks, function (demoLink) {
if (demoLink.getAttribute('href').substr(0, 4) !== 'http') {
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href'));
}
});
}
document.body.className = (document.body.className + ' learn-bar').trim(); document.body.className = (document.body.className + ' learn-bar').trim();
document.body.insertAdjacentHTML('afterBegin', aside.outerHTML); document.body.insertAdjacentHTML('afterBegin', aside.outerHTML);
......
{
"name": "todomvc-common",
"description": "Common TodoMVC utilities used by our apps",
"license": "MIT",
"authors": [
"TasteJS team"
],
"main": [
"base.js",
"base.css"
],
"keywords": [
"todomvc",
"tastejs",
"util",
"utilities"
],
"ignore": [
"package.json",
"readme.md"
]
}
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
"name": "todomvc-knockoutjs_require", "name": "todomvc-knockoutjs_require",
"version": "0.0.0", "version": "0.0.0",
"dependencies": { "dependencies": {
"todomvc-common": "~0.1.6", "todomvc-common": "~0.3.0",
"knockout.js": "~3.0.0", "knockout.js": "~3.0.0",
"requirejs": "~2.1.6" "requirejs": "~2.1.6"
} }
......
...@@ -171,25 +171,42 @@ ...@@ -171,25 +171,42 @@
framework = document.querySelector('[data-framework]').dataset.framework; framework = document.querySelector('[data-framework]').dataset.framework;
} }
this.template = template;
if (template && learnJSON[framework]) { if (learnJSON.backend) {
this.frameworkJSON = learnJSON.backend;
this.append({
backend: true
});
} else if (learnJSON[framework]) {
this.frameworkJSON = learnJSON[framework]; this.frameworkJSON = learnJSON[framework];
this.template = template;
this.append(); this.append();
} }
} }
Learn.prototype.append = function () { Learn.prototype.append = function (opts) {
var aside = document.createElement('aside'); var aside = document.createElement('aside');
aside.innerHTML = _.template(this.template, this.frameworkJSON); aside.innerHTML = _.template(this.template, this.frameworkJSON);
aside.className = 'learn'; aside.className = 'learn';
// Localize demo links if (opts && opts.backend) {
var demoLinks = aside.querySelectorAll('.demo-link'); // Remove demo link
Array.prototype.forEach.call(demoLinks, function (demoLink) { var sourceLinks = aside.querySelector('.source-links');
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href')); var heading = sourceLinks.firstElementChild;
}); var sourceLink = sourceLinks.lastElementChild;
// Correct link path
var href = sourceLink.getAttribute('href');
sourceLink.setAttribute('href', href.substr(href.lastIndexOf('http')));
sourceLinks.innerHTML = heading.outerHTML + sourceLink.outerHTML;
} else {
// Localize demo links
var demoLinks = aside.querySelectorAll('.demo-link');
Array.prototype.forEach.call(demoLinks, function (demoLink) {
if (demoLink.getAttribute('href').substr(0, 4) !== 'http') {
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href'));
}
});
}
document.body.className = (document.body.className + ' learn-bar').trim(); document.body.className = (document.body.className + ' learn-bar').trim();
document.body.insertAdjacentHTML('afterBegin', aside.outerHTML); document.body.insertAdjacentHTML('afterBegin', aside.outerHTML);
......
{
"name": "todomvc-common",
"description": "Common TodoMVC utilities used by our apps",
"license": "MIT",
"authors": [
"TasteJS team"
],
"main": [
"base.js",
"base.css"
],
"keywords": [
"todomvc",
"tastejs",
"util",
"utilities"
],
"ignore": [
"package.json",
"readme.md"
]
}
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
"name": "todomvc-lavaca_require", "name": "todomvc-lavaca_require",
"version": "0.0.0", "version": "0.0.0",
"dependencies": { "dependencies": {
"todomvc-common": "~0.1.6", "todomvc-common": "~0.3.0",
"requirejs": "~2.1.6", "requirejs": "~2.1.6",
"dustjs-linkedin": "~1.1.1", "dustjs-linkedin": "~1.1.1",
"dustjs-linkedin-helpers": "~1.1.1", "dustjs-linkedin-helpers": "~1.1.1",
......
...@@ -171,25 +171,42 @@ ...@@ -171,25 +171,42 @@
framework = document.querySelector('[data-framework]').dataset.framework; framework = document.querySelector('[data-framework]').dataset.framework;
} }
this.template = template;
if (template && learnJSON[framework]) { if (learnJSON.backend) {
this.frameworkJSON = learnJSON.backend;
this.append({
backend: true
});
} else if (learnJSON[framework]) {
this.frameworkJSON = learnJSON[framework]; this.frameworkJSON = learnJSON[framework];
this.template = template;
this.append(); this.append();
} }
} }
Learn.prototype.append = function () { Learn.prototype.append = function (opts) {
var aside = document.createElement('aside'); var aside = document.createElement('aside');
aside.innerHTML = _.template(this.template, this.frameworkJSON); aside.innerHTML = _.template(this.template, this.frameworkJSON);
aside.className = 'learn'; aside.className = 'learn';
// Localize demo links if (opts && opts.backend) {
var demoLinks = aside.querySelectorAll('.demo-link'); // Remove demo link
Array.prototype.forEach.call(demoLinks, function (demoLink) { var sourceLinks = aside.querySelector('.source-links');
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href')); var heading = sourceLinks.firstElementChild;
}); var sourceLink = sourceLinks.lastElementChild;
// Correct link path
var href = sourceLink.getAttribute('href');
sourceLink.setAttribute('href', href.substr(href.lastIndexOf('http')));
sourceLinks.innerHTML = heading.outerHTML + sourceLink.outerHTML;
} else {
// Localize demo links
var demoLinks = aside.querySelectorAll('.demo-link');
Array.prototype.forEach.call(demoLinks, function (demoLink) {
if (demoLink.getAttribute('href').substr(0, 4) !== 'http') {
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href'));
}
});
}
document.body.className = (document.body.className + ' learn-bar').trim(); document.body.className = (document.body.className + ' learn-bar').trim();
document.body.insertAdjacentHTML('afterBegin', aside.outerHTML); document.body.insertAdjacentHTML('afterBegin', aside.outerHTML);
......
{
"name": "todomvc-common",
"description": "Common TodoMVC utilities used by our apps",
"license": "MIT",
"authors": [
"TasteJS team"
],
"main": [
"base.js",
"base.css"
],
"keywords": [
"todomvc",
"tastejs",
"util",
"utilities"
],
"ignore": [
"package.json",
"readme.md"
]
}
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
"name": "todomvc-maria", "name": "todomvc-maria",
"version": "0.0.0", "version": "0.0.0",
"dependencies": { "dependencies": {
"todomvc-common": "~0.1.4", "todomvc-common": "~0.3.0",
"director": "~1.2.0", "director": "~1.2.0",
"maria-bower": "~1.0.0", "maria-bower": "~1.0.0",
"aristocrat-bower": "~1.0.1" "aristocrat-bower": "~1.0.1"
......
...@@ -171,25 +171,42 @@ ...@@ -171,25 +171,42 @@
framework = document.querySelector('[data-framework]').dataset.framework; framework = document.querySelector('[data-framework]').dataset.framework;
} }
this.template = template;
if (template && learnJSON[framework]) { if (learnJSON.backend) {
this.frameworkJSON = learnJSON.backend;
this.append({
backend: true
});
} else if (learnJSON[framework]) {
this.frameworkJSON = learnJSON[framework]; this.frameworkJSON = learnJSON[framework];
this.template = template;
this.append(); this.append();
} }
} }
Learn.prototype.append = function () { Learn.prototype.append = function (opts) {
var aside = document.createElement('aside'); var aside = document.createElement('aside');
aside.innerHTML = _.template(this.template, this.frameworkJSON); aside.innerHTML = _.template(this.template, this.frameworkJSON);
aside.className = 'learn'; aside.className = 'learn';
// Localize demo links if (opts && opts.backend) {
var demoLinks = aside.querySelectorAll('.demo-link'); // Remove demo link
Array.prototype.forEach.call(demoLinks, function (demoLink) { var sourceLinks = aside.querySelector('.source-links');
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href')); var heading = sourceLinks.firstElementChild;
}); var sourceLink = sourceLinks.lastElementChild;
// Correct link path
var href = sourceLink.getAttribute('href');
sourceLink.setAttribute('href', href.substr(href.lastIndexOf('http')));
sourceLinks.innerHTML = heading.outerHTML + sourceLink.outerHTML;
} else {
// Localize demo links
var demoLinks = aside.querySelectorAll('.demo-link');
Array.prototype.forEach.call(demoLinks, function (demoLink) {
if (demoLink.getAttribute('href').substr(0, 4) !== 'http') {
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href'));
}
});
}
document.body.className = (document.body.className + ' learn-bar').trim(); document.body.className = (document.body.className + ' learn-bar').trim();
document.body.insertAdjacentHTML('afterBegin', aside.outerHTML); document.body.insertAdjacentHTML('afterBegin', aside.outerHTML);
......
{
"name": "todomvc-common",
"description": "Common TodoMVC utilities used by our apps",
"license": "MIT",
"authors": [
"TasteJS team"
],
"main": [
"base.js",
"base.css"
],
"keywords": [
"todomvc",
"tastejs",
"util",
"utilities"
],
"ignore": [
"package.json",
"readme.md"
]
}
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
"name": "todomvc-meteor", "name": "todomvc-meteor",
"version": "0.0.0", "version": "0.0.0",
"dependencies": { "dependencies": {
"todomvc-common": "~0.1.6", "todomvc-common": "~0.3.0",
"director": "~1.2.0" "director": "~1.2.0"
} }
} }
...@@ -171,25 +171,42 @@ ...@@ -171,25 +171,42 @@
framework = document.querySelector('[data-framework]').dataset.framework; framework = document.querySelector('[data-framework]').dataset.framework;
} }
this.template = template;
if (template && learnJSON[framework]) { if (learnJSON.backend) {
this.frameworkJSON = learnJSON.backend;
this.append({
backend: true
});
} else if (learnJSON[framework]) {
this.frameworkJSON = learnJSON[framework]; this.frameworkJSON = learnJSON[framework];
this.template = template;
this.append(); this.append();
} }
} }
Learn.prototype.append = function () { Learn.prototype.append = function (opts) {
var aside = document.createElement('aside'); var aside = document.createElement('aside');
aside.innerHTML = _.template(this.template, this.frameworkJSON); aside.innerHTML = _.template(this.template, this.frameworkJSON);
aside.className = 'learn'; aside.className = 'learn';
// Localize demo links if (opts && opts.backend) {
var demoLinks = aside.querySelectorAll('.demo-link'); // Remove demo link
Array.prototype.forEach.call(demoLinks, function (demoLink) { var sourceLinks = aside.querySelector('.source-links');
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href')); var heading = sourceLinks.firstElementChild;
}); var sourceLink = sourceLinks.lastElementChild;
// Correct link path
var href = sourceLink.getAttribute('href');
sourceLink.setAttribute('href', href.substr(href.lastIndexOf('http')));
sourceLinks.innerHTML = heading.outerHTML + sourceLink.outerHTML;
} else {
// Localize demo links
var demoLinks = aside.querySelectorAll('.demo-link');
Array.prototype.forEach.call(demoLinks, function (demoLink) {
if (demoLink.getAttribute('href').substr(0, 4) !== 'http') {
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href'));
}
});
}
document.body.className = (document.body.className + ' learn-bar').trim(); document.body.className = (document.body.className + ' learn-bar').trim();
document.body.insertAdjacentHTML('afterBegin', aside.outerHTML); document.body.insertAdjacentHTML('afterBegin', aside.outerHTML);
......
...@@ -3,6 +3,6 @@ ...@@ -3,6 +3,6 @@
"version": "0.0.0", "version": "0.0.0",
"dependencies": { "dependencies": {
"mithril": "0.1.20", "mithril": "0.1.20",
"todomvc-common": "~0.1.4" "todomvc-common": "~0.3.0"
} }
} }
...@@ -171,25 +171,42 @@ ...@@ -171,25 +171,42 @@
framework = document.querySelector('[data-framework]').dataset.framework; framework = document.querySelector('[data-framework]').dataset.framework;
} }
this.template = template;
if (template && learnJSON[framework]) { if (learnJSON.backend) {
this.frameworkJSON = learnJSON.backend;
this.append({
backend: true
});
} else if (learnJSON[framework]) {
this.frameworkJSON = learnJSON[framework]; this.frameworkJSON = learnJSON[framework];
this.template = template;
this.append(); this.append();
} }
} }
Learn.prototype.append = function () { Learn.prototype.append = function (opts) {
var aside = document.createElement('aside'); var aside = document.createElement('aside');
aside.innerHTML = _.template(this.template, this.frameworkJSON); aside.innerHTML = _.template(this.template, this.frameworkJSON);
aside.className = 'learn'; aside.className = 'learn';
// Localize demo links if (opts && opts.backend) {
var demoLinks = aside.querySelectorAll('.demo-link'); // Remove demo link
Array.prototype.forEach.call(demoLinks, function (demoLink) { var sourceLinks = aside.querySelector('.source-links');
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href')); var heading = sourceLinks.firstElementChild;
}); var sourceLink = sourceLinks.lastElementChild;
// Correct link path
var href = sourceLink.getAttribute('href');
sourceLink.setAttribute('href', href.substr(href.lastIndexOf('http')));
sourceLinks.innerHTML = heading.outerHTML + sourceLink.outerHTML;
} else {
// Localize demo links
var demoLinks = aside.querySelectorAll('.demo-link');
Array.prototype.forEach.call(demoLinks, function (demoLink) {
if (demoLink.getAttribute('href').substr(0, 4) !== 'http') {
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href'));
}
});
}
document.body.className = (document.body.className + ' learn-bar').trim(); document.body.className = (document.body.className + ' learn-bar').trim();
document.body.insertAdjacentHTML('afterBegin', aside.outerHTML); document.body.insertAdjacentHTML('afterBegin', aside.outerHTML);
......
{
"name": "todomvc-common",
"description": "Common TodoMVC utilities used by our apps",
"license": "MIT",
"authors": [
"TasteJS team"
],
"main": [
"base.js",
"base.css"
],
"keywords": [
"todomvc",
"tastejs",
"util",
"utilities"
],
"ignore": [
"package.json",
"readme.md"
]
}
...@@ -2,6 +2,6 @@ ...@@ -2,6 +2,6 @@
"name": "todomvc-montage", "name": "todomvc-montage",
"version": "0.0.0", "version": "0.0.0",
"dependencies": { "dependencies": {
"todomvc-common": "~0.1.6" "todomvc-common": "~0.3.0"
} }
} }
...@@ -171,25 +171,42 @@ ...@@ -171,25 +171,42 @@
framework = document.querySelector('[data-framework]').dataset.framework; framework = document.querySelector('[data-framework]').dataset.framework;
} }
this.template = template;
if (template && learnJSON[framework]) { if (learnJSON.backend) {
this.frameworkJSON = learnJSON.backend;
this.append({
backend: true
});
} else if (learnJSON[framework]) {
this.frameworkJSON = learnJSON[framework]; this.frameworkJSON = learnJSON[framework];
this.template = template;
this.append(); this.append();
} }
} }
Learn.prototype.append = function () { Learn.prototype.append = function (opts) {
var aside = document.createElement('aside'); var aside = document.createElement('aside');
aside.innerHTML = _.template(this.template, this.frameworkJSON); aside.innerHTML = _.template(this.template, this.frameworkJSON);
aside.className = 'learn'; aside.className = 'learn';
// Localize demo links if (opts && opts.backend) {
var demoLinks = aside.querySelectorAll('.demo-link'); // Remove demo link
Array.prototype.forEach.call(demoLinks, function (demoLink) { var sourceLinks = aside.querySelector('.source-links');
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href')); var heading = sourceLinks.firstElementChild;
}); var sourceLink = sourceLinks.lastElementChild;
// Correct link path
var href = sourceLink.getAttribute('href');
sourceLink.setAttribute('href', href.substr(href.lastIndexOf('http')));
sourceLinks.innerHTML = heading.outerHTML + sourceLink.outerHTML;
} else {
// Localize demo links
var demoLinks = aside.querySelectorAll('.demo-link');
Array.prototype.forEach.call(demoLinks, function (demoLink) {
if (demoLink.getAttribute('href').substr(0, 4) !== 'http') {
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href'));
}
});
}
document.body.className = (document.body.className + ' learn-bar').trim(); document.body.className = (document.body.className + ' learn-bar').trim();
document.body.insertAdjacentHTML('afterBegin', aside.outerHTML); document.body.insertAdjacentHTML('afterBegin', aside.outerHTML);
......
{
"name": "todomvc-common",
"description": "Common TodoMVC utilities used by our apps",
"license": "MIT",
"authors": [
"TasteJS team"
],
"main": [
"base.js",
"base.css"
],
"keywords": [
"todomvc",
"tastejs",
"util",
"utilities"
],
"ignore": [
"package.json",
"readme.md"
]
}
...@@ -5,6 +5,6 @@ ...@@ -5,6 +5,6 @@
"olives": "~1.4.0", "olives": "~1.4.0",
"emily": "~1.3.5", "emily": "~1.3.5",
"requirejs": "~2.1.5", "requirejs": "~2.1.5",
"todomvc-common": "~0.1.4" "todomvc-common": "~0.3.0"
} }
} }
...@@ -171,25 +171,42 @@ ...@@ -171,25 +171,42 @@
framework = document.querySelector('[data-framework]').dataset.framework; framework = document.querySelector('[data-framework]').dataset.framework;
} }
this.template = template;
if (template && learnJSON[framework]) { if (learnJSON.backend) {
this.frameworkJSON = learnJSON.backend;
this.append({
backend: true
});
} else if (learnJSON[framework]) {
this.frameworkJSON = learnJSON[framework]; this.frameworkJSON = learnJSON[framework];
this.template = template;
this.append(); this.append();
} }
} }
Learn.prototype.append = function () { Learn.prototype.append = function (opts) {
var aside = document.createElement('aside'); var aside = document.createElement('aside');
aside.innerHTML = _.template(this.template, this.frameworkJSON); aside.innerHTML = _.template(this.template, this.frameworkJSON);
aside.className = 'learn'; aside.className = 'learn';
// Localize demo links if (opts && opts.backend) {
var demoLinks = aside.querySelectorAll('.demo-link'); // Remove demo link
Array.prototype.forEach.call(demoLinks, function (demoLink) { var sourceLinks = aside.querySelector('.source-links');
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href')); var heading = sourceLinks.firstElementChild;
}); var sourceLink = sourceLinks.lastElementChild;
// Correct link path
var href = sourceLink.getAttribute('href');
sourceLink.setAttribute('href', href.substr(href.lastIndexOf('http')));
sourceLinks.innerHTML = heading.outerHTML + sourceLink.outerHTML;
} else {
// Localize demo links
var demoLinks = aside.querySelectorAll('.demo-link');
Array.prototype.forEach.call(demoLinks, function (demoLink) {
if (demoLink.getAttribute('href').substr(0, 4) !== 'http') {
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href'));
}
});
}
document.body.className = (document.body.className + ' learn-bar').trim(); document.body.className = (document.body.className + ' learn-bar').trim();
document.body.insertAdjacentHTML('afterBegin', aside.outerHTML); document.body.insertAdjacentHTML('afterBegin', aside.outerHTML);
......
{
"name": "todomvc-common",
"description": "Common TodoMVC utilities used by our apps",
"license": "MIT",
"authors": [
"TasteJS team"
],
"main": [
"base.js",
"base.css"
],
"keywords": [
"todomvc",
"tastejs",
"util",
"utilities"
],
"ignore": [
"package.json",
"readme.md"
]
}
...@@ -2,6 +2,6 @@ ...@@ -2,6 +2,6 @@
"name": "todomvc-plastronjs", "name": "todomvc-plastronjs",
"version": "0.0.0", "version": "0.0.0",
"dependencies": { "dependencies": {
"todomvc-common": "~0.1.6" "todomvc-common": "~0.3.0"
} }
} }
...@@ -171,25 +171,42 @@ ...@@ -171,25 +171,42 @@
framework = document.querySelector('[data-framework]').dataset.framework; framework = document.querySelector('[data-framework]').dataset.framework;
} }
this.template = template;
if (template && learnJSON[framework]) { if (learnJSON.backend) {
this.frameworkJSON = learnJSON.backend;
this.append({
backend: true
});
} else if (learnJSON[framework]) {
this.frameworkJSON = learnJSON[framework]; this.frameworkJSON = learnJSON[framework];
this.template = template;
this.append(); this.append();
} }
} }
Learn.prototype.append = function () { Learn.prototype.append = function (opts) {
var aside = document.createElement('aside'); var aside = document.createElement('aside');
aside.innerHTML = _.template(this.template, this.frameworkJSON); aside.innerHTML = _.template(this.template, this.frameworkJSON);
aside.className = 'learn'; aside.className = 'learn';
// Localize demo links if (opts && opts.backend) {
var demoLinks = aside.querySelectorAll('.demo-link'); // Remove demo link
Array.prototype.forEach.call(demoLinks, function (demoLink) { var sourceLinks = aside.querySelector('.source-links');
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href')); var heading = sourceLinks.firstElementChild;
}); var sourceLink = sourceLinks.lastElementChild;
// Correct link path
var href = sourceLink.getAttribute('href');
sourceLink.setAttribute('href', href.substr(href.lastIndexOf('http')));
sourceLinks.innerHTML = heading.outerHTML + sourceLink.outerHTML;
} else {
// Localize demo links
var demoLinks = aside.querySelectorAll('.demo-link');
Array.prototype.forEach.call(demoLinks, function (demoLink) {
if (demoLink.getAttribute('href').substr(0, 4) !== 'http') {
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href'));
}
});
}
document.body.className = (document.body.className + ' learn-bar').trim(); document.body.className = (document.body.className + ' learn-bar').trim();
document.body.insertAdjacentHTML('afterBegin', aside.outerHTML); document.body.insertAdjacentHTML('afterBegin', aside.outerHTML);
......
{
"name": "todomvc-common",
"description": "Common TodoMVC utilities used by our apps",
"license": "MIT",
"authors": [
"TasteJS team"
],
"main": [
"base.js",
"base.css"
],
"keywords": [
"todomvc",
"tastejs",
"util",
"utilities"
],
"ignore": [
"package.json",
"readme.md"
]
}
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
"name": "todomvc-polymer", "name": "todomvc-polymer",
"version": "0.0.1", "version": "0.0.1",
"dependencies": { "dependencies": {
"todomvc-common": "~0.1.4", "todomvc-common": "~0.3.0",
"core-selector": "Polymer/core-selector", "core-selector": "Polymer/core-selector",
"flatiron-director": "Polymer/flatiron-director", "flatiron-director": "Polymer/flatiron-director",
"core-localstorage": "Polymer/core-localstorage" "core-localstorage": "Polymer/core-localstorage"
......
...@@ -171,25 +171,42 @@ ...@@ -171,25 +171,42 @@
framework = document.querySelector('[data-framework]').dataset.framework; framework = document.querySelector('[data-framework]').dataset.framework;
} }
this.template = template;
if (template && learnJSON[framework]) { if (learnJSON.backend) {
this.frameworkJSON = learnJSON.backend;
this.append({
backend: true
});
} else if (learnJSON[framework]) {
this.frameworkJSON = learnJSON[framework]; this.frameworkJSON = learnJSON[framework];
this.template = template;
this.append(); this.append();
} }
} }
Learn.prototype.append = function () { Learn.prototype.append = function (opts) {
var aside = document.createElement('aside'); var aside = document.createElement('aside');
aside.innerHTML = _.template(this.template, this.frameworkJSON); aside.innerHTML = _.template(this.template, this.frameworkJSON);
aside.className = 'learn'; aside.className = 'learn';
// Localize demo links if (opts && opts.backend) {
var demoLinks = aside.querySelectorAll('.demo-link'); // Remove demo link
Array.prototype.forEach.call(demoLinks, function (demoLink) { var sourceLinks = aside.querySelector('.source-links');
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href')); var heading = sourceLinks.firstElementChild;
}); var sourceLink = sourceLinks.lastElementChild;
// Correct link path
var href = sourceLink.getAttribute('href');
sourceLink.setAttribute('href', href.substr(href.lastIndexOf('http')));
sourceLinks.innerHTML = heading.outerHTML + sourceLink.outerHTML;
} else {
// Localize demo links
var demoLinks = aside.querySelectorAll('.demo-link');
Array.prototype.forEach.call(demoLinks, function (demoLink) {
if (demoLink.getAttribute('href').substr(0, 4) !== 'http') {
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href'));
}
});
}
document.body.className = (document.body.className + ' learn-bar').trim(); document.body.className = (document.body.className + ' learn-bar').trim();
document.body.insertAdjacentHTML('afterBegin', aside.outerHTML); document.body.insertAdjacentHTML('afterBegin', aside.outerHTML);
......
{
"name": "todomvc-common",
"description": "Common TodoMVC utilities used by our apps",
"license": "MIT",
"authors": [
"TasteJS team"
],
"main": [
"base.js",
"base.css"
],
"keywords": [
"todomvc",
"tastejs",
"util",
"utilities"
],
"ignore": [
"package.json",
"readme.md"
]
}
...@@ -4,6 +4,6 @@ ...@@ -4,6 +4,6 @@
"dependencies": { "dependencies": {
"puremvc": "~1.0.1", "puremvc": "~1.0.1",
"director": "~1.2.0", "director": "~1.2.0",
"todomvc-common": "~0.1.4" "todomvc-common": "~0.3.0"
} }
} }
...@@ -171,25 +171,42 @@ ...@@ -171,25 +171,42 @@
framework = document.querySelector('[data-framework]').dataset.framework; framework = document.querySelector('[data-framework]').dataset.framework;
} }
this.template = template;
if (template && learnJSON[framework]) { if (learnJSON.backend) {
this.frameworkJSON = learnJSON.backend;
this.append({
backend: true
});
} else if (learnJSON[framework]) {
this.frameworkJSON = learnJSON[framework]; this.frameworkJSON = learnJSON[framework];
this.template = template;
this.append(); this.append();
} }
} }
Learn.prototype.append = function () { Learn.prototype.append = function (opts) {
var aside = document.createElement('aside'); var aside = document.createElement('aside');
aside.innerHTML = _.template(this.template, this.frameworkJSON); aside.innerHTML = _.template(this.template, this.frameworkJSON);
aside.className = 'learn'; aside.className = 'learn';
// Localize demo links if (opts && opts.backend) {
var demoLinks = aside.querySelectorAll('.demo-link'); // Remove demo link
Array.prototype.forEach.call(demoLinks, function (demoLink) { var sourceLinks = aside.querySelector('.source-links');
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href')); var heading = sourceLinks.firstElementChild;
}); var sourceLink = sourceLinks.lastElementChild;
// Correct link path
var href = sourceLink.getAttribute('href');
sourceLink.setAttribute('href', href.substr(href.lastIndexOf('http')));
sourceLinks.innerHTML = heading.outerHTML + sourceLink.outerHTML;
} else {
// Localize demo links
var demoLinks = aside.querySelectorAll('.demo-link');
Array.prototype.forEach.call(demoLinks, function (demoLink) {
if (demoLink.getAttribute('href').substr(0, 4) !== 'http') {
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href'));
}
});
}
document.body.className = (document.body.className + ' learn-bar').trim(); document.body.className = (document.body.className + ' learn-bar').trim();
document.body.insertAdjacentHTML('afterBegin', aside.outerHTML); document.body.insertAdjacentHTML('afterBegin', aside.outerHTML);
......
{
"name": "todomvc-common",
"description": "Common TodoMVC utilities used by our apps",
"license": "MIT",
"authors": [
"TasteJS team"
],
"main": [
"base.js",
"base.css"
],
"keywords": [
"todomvc",
"tastejs",
"util",
"utilities"
],
"ignore": [
"package.json",
"readme.md"
]
}
{ {
"name": "todomvc-ractive", "name": "todomvc-ractive",
"dependencies": { "dependencies": {
"todomvc-common": "~0.1.4", "todomvc-common": "~0.3.0",
"ractive": "~0.3.5", "ractive": "~0.3.5",
"director": "~1.2.0" "director": "~1.2.0"
} }
......
...@@ -171,25 +171,42 @@ ...@@ -171,25 +171,42 @@
framework = document.querySelector('[data-framework]').dataset.framework; framework = document.querySelector('[data-framework]').dataset.framework;
} }
this.template = template;
if (template && learnJSON[framework]) { if (learnJSON.backend) {
this.frameworkJSON = learnJSON.backend;
this.append({
backend: true
});
} else if (learnJSON[framework]) {
this.frameworkJSON = learnJSON[framework]; this.frameworkJSON = learnJSON[framework];
this.template = template;
this.append(); this.append();
} }
} }
Learn.prototype.append = function () { Learn.prototype.append = function (opts) {
var aside = document.createElement('aside'); var aside = document.createElement('aside');
aside.innerHTML = _.template(this.template, this.frameworkJSON); aside.innerHTML = _.template(this.template, this.frameworkJSON);
aside.className = 'learn'; aside.className = 'learn';
// Localize demo links if (opts && opts.backend) {
var demoLinks = aside.querySelectorAll('.demo-link'); // Remove demo link
Array.prototype.forEach.call(demoLinks, function (demoLink) { var sourceLinks = aside.querySelector('.source-links');
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href')); var heading = sourceLinks.firstElementChild;
}); var sourceLink = sourceLinks.lastElementChild;
// Correct link path
var href = sourceLink.getAttribute('href');
sourceLink.setAttribute('href', href.substr(href.lastIndexOf('http')));
sourceLinks.innerHTML = heading.outerHTML + sourceLink.outerHTML;
} else {
// Localize demo links
var demoLinks = aside.querySelectorAll('.demo-link');
Array.prototype.forEach.call(demoLinks, function (demoLink) {
if (demoLink.getAttribute('href').substr(0, 4) !== 'http') {
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href'));
}
});
}
document.body.className = (document.body.className + ' learn-bar').trim(); document.body.className = (document.body.className + ' learn-bar').trim();
document.body.insertAdjacentHTML('afterBegin', aside.outerHTML); document.body.insertAdjacentHTML('afterBegin', aside.outerHTML);
......
{
"name": "todomvc-common",
"description": "Common TodoMVC utilities used by our apps",
"license": "MIT",
"authors": [
"TasteJS team"
],
"main": [
"base.js",
"base.css"
],
"keywords": [
"todomvc",
"tastejs",
"util",
"utilities"
],
"ignore": [
"package.json",
"readme.md"
]
}
...@@ -2,6 +2,6 @@ ...@@ -2,6 +2,6 @@
"name": "todomvc-rappidjs", "name": "todomvc-rappidjs",
"version": "0.0.0", "version": "0.0.0",
"dependencies": { "dependencies": {
"todomvc-common": "~0.1.6" "todomvc-common": "~0.3.0"
} }
} }
...@@ -171,25 +171,42 @@ ...@@ -171,25 +171,42 @@
framework = document.querySelector('[data-framework]').dataset.framework; framework = document.querySelector('[data-framework]').dataset.framework;
} }
this.template = template;
if (template && learnJSON[framework]) { if (learnJSON.backend) {
this.frameworkJSON = learnJSON.backend;
this.append({
backend: true
});
} else if (learnJSON[framework]) {
this.frameworkJSON = learnJSON[framework]; this.frameworkJSON = learnJSON[framework];
this.template = template;
this.append(); this.append();
} }
} }
Learn.prototype.append = function () { Learn.prototype.append = function (opts) {
var aside = document.createElement('aside'); var aside = document.createElement('aside');
aside.innerHTML = _.template(this.template, this.frameworkJSON); aside.innerHTML = _.template(this.template, this.frameworkJSON);
aside.className = 'learn'; aside.className = 'learn';
// Localize demo links if (opts && opts.backend) {
var demoLinks = aside.querySelectorAll('.demo-link'); // Remove demo link
Array.prototype.forEach.call(demoLinks, function (demoLink) { var sourceLinks = aside.querySelector('.source-links');
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href')); var heading = sourceLinks.firstElementChild;
}); var sourceLink = sourceLinks.lastElementChild;
// Correct link path
var href = sourceLink.getAttribute('href');
sourceLink.setAttribute('href', href.substr(href.lastIndexOf('http')));
sourceLinks.innerHTML = heading.outerHTML + sourceLink.outerHTML;
} else {
// Localize demo links
var demoLinks = aside.querySelectorAll('.demo-link');
Array.prototype.forEach.call(demoLinks, function (demoLink) {
if (demoLink.getAttribute('href').substr(0, 4) !== 'http') {
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href'));
}
});
}
document.body.className = (document.body.className + ' learn-bar').trim(); document.body.className = (document.body.className + ' learn-bar').trim();
document.body.insertAdjacentHTML('afterBegin', aside.outerHTML); document.body.insertAdjacentHTML('afterBegin', aside.outerHTML);
......
{
"name": "todomvc-common",
"description": "Common TodoMVC utilities used by our apps",
"license": "MIT",
"authors": [
"TasteJS team"
],
"main": [
"base.js",
"base.css"
],
"keywords": [
"todomvc",
"tastejs",
"util",
"utilities"
],
"ignore": [
"package.json",
"readme.md"
]
}
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
"backbone": "~1.1.2", "backbone": "~1.1.2",
"backbone.localstorage": "~1.1.7", "backbone.localstorage": "~1.1.7",
"jquery": "~2.1.0", "jquery": "~2.1.0",
"todomvc-common": "~0.1.9", "todomvc-common": "~0.3.0",
"underscore": "~1.6.0" "underscore": "~1.6.0"
} }
} }
...@@ -171,25 +171,42 @@ ...@@ -171,25 +171,42 @@
framework = document.querySelector('[data-framework]').dataset.framework; framework = document.querySelector('[data-framework]').dataset.framework;
} }
this.template = template;
if (template && learnJSON[framework]) { if (learnJSON.backend) {
this.frameworkJSON = learnJSON.backend;
this.append({
backend: true
});
} else if (learnJSON[framework]) {
this.frameworkJSON = learnJSON[framework]; this.frameworkJSON = learnJSON[framework];
this.template = template;
this.append(); this.append();
} }
} }
Learn.prototype.append = function () { Learn.prototype.append = function (opts) {
var aside = document.createElement('aside'); var aside = document.createElement('aside');
aside.innerHTML = _.template(this.template, this.frameworkJSON); aside.innerHTML = _.template(this.template, this.frameworkJSON);
aside.className = 'learn'; aside.className = 'learn';
// Localize demo links if (opts && opts.backend) {
var demoLinks = aside.querySelectorAll('.demo-link'); // Remove demo link
Array.prototype.forEach.call(demoLinks, function (demoLink) { var sourceLinks = aside.querySelector('.source-links');
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href')); var heading = sourceLinks.firstElementChild;
}); var sourceLink = sourceLinks.lastElementChild;
// Correct link path
var href = sourceLink.getAttribute('href');
sourceLink.setAttribute('href', href.substr(href.lastIndexOf('http')));
sourceLinks.innerHTML = heading.outerHTML + sourceLink.outerHTML;
} else {
// Localize demo links
var demoLinks = aside.querySelectorAll('.demo-link');
Array.prototype.forEach.call(demoLinks, function (demoLink) {
if (demoLink.getAttribute('href').substr(0, 4) !== 'http') {
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href'));
}
});
}
document.body.className = (document.body.className + ' learn-bar').trim(); document.body.className = (document.body.className + ' learn-bar').trim();
document.body.insertAdjacentHTML('afterBegin', aside.outerHTML); document.body.insertAdjacentHTML('afterBegin', aside.outerHTML);
......
{
"name": "todomvc-common",
"description": "Common TodoMVC utilities used by our apps",
"license": "MIT",
"authors": [
"TasteJS team"
],
"main": [
"base.js",
"base.css"
],
"keywords": [
"todomvc",
"tastejs",
"util",
"utilities"
],
"ignore": [
"package.json",
"readme.md"
]
}
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
"name": "todomvc-react", "name": "todomvc-react",
"version": "0.0.0", "version": "0.0.0",
"dependencies": { "dependencies": {
"todomvc-common": "~0.1.7", "todomvc-common": "~0.3.0",
"director": "~1.2.0", "director": "~1.2.0",
"react": "~0.11.0" "react": "~0.11.0"
} }
......
...@@ -171,25 +171,42 @@ ...@@ -171,25 +171,42 @@
framework = document.querySelector('[data-framework]').dataset.framework; framework = document.querySelector('[data-framework]').dataset.framework;
} }
this.template = template;
if (template && learnJSON[framework]) { if (learnJSON.backend) {
this.frameworkJSON = learnJSON.backend;
this.append({
backend: true
});
} else if (learnJSON[framework]) {
this.frameworkJSON = learnJSON[framework]; this.frameworkJSON = learnJSON[framework];
this.template = template;
this.append(); this.append();
} }
} }
Learn.prototype.append = function () { Learn.prototype.append = function (opts) {
var aside = document.createElement('aside'); var aside = document.createElement('aside');
aside.innerHTML = _.template(this.template, this.frameworkJSON); aside.innerHTML = _.template(this.template, this.frameworkJSON);
aside.className = 'learn'; aside.className = 'learn';
// Localize demo links if (opts && opts.backend) {
var demoLinks = aside.querySelectorAll('.demo-link'); // Remove demo link
Array.prototype.forEach.call(demoLinks, function (demoLink) { var sourceLinks = aside.querySelector('.source-links');
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href')); var heading = sourceLinks.firstElementChild;
}); var sourceLink = sourceLinks.lastElementChild;
// Correct link path
var href = sourceLink.getAttribute('href');
sourceLink.setAttribute('href', href.substr(href.lastIndexOf('http')));
sourceLinks.innerHTML = heading.outerHTML + sourceLink.outerHTML;
} else {
// Localize demo links
var demoLinks = aside.querySelectorAll('.demo-link');
Array.prototype.forEach.call(demoLinks, function (demoLink) {
if (demoLink.getAttribute('href').substr(0, 4) !== 'http') {
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href'));
}
});
}
document.body.className = (document.body.className + ' learn-bar').trim(); document.body.className = (document.body.className + ' learn-bar').trim();
document.body.insertAdjacentHTML('afterBegin', aside.outerHTML); document.body.insertAdjacentHTML('afterBegin', aside.outerHTML);
......
{
"name": "todomvc-common",
"description": "Common TodoMVC utilities used by our apps",
"license": "MIT",
"authors": [
"TasteJS team"
],
"main": [
"base.js",
"base.css"
],
"keywords": [
"todomvc",
"tastejs",
"util",
"utilities"
],
"ignore": [
"package.json",
"readme.md"
]
}
...@@ -4,6 +4,6 @@ ...@@ -4,6 +4,6 @@
"dependencies": { "dependencies": {
"sammy": "~0.7.4", "sammy": "~0.7.4",
"jquery": "~1.9.1", "jquery": "~1.9.1",
"todomvc-common": "~0.1.4" "todomvc-common": "~0.3.0"
} }
} }
...@@ -171,25 +171,42 @@ ...@@ -171,25 +171,42 @@
framework = document.querySelector('[data-framework]').dataset.framework; framework = document.querySelector('[data-framework]').dataset.framework;
} }
this.template = template;
if (template && learnJSON[framework]) { if (learnJSON.backend) {
this.frameworkJSON = learnJSON.backend;
this.append({
backend: true
});
} else if (learnJSON[framework]) {
this.frameworkJSON = learnJSON[framework]; this.frameworkJSON = learnJSON[framework];
this.template = template;
this.append(); this.append();
} }
} }
Learn.prototype.append = function () { Learn.prototype.append = function (opts) {
var aside = document.createElement('aside'); var aside = document.createElement('aside');
aside.innerHTML = _.template(this.template, this.frameworkJSON); aside.innerHTML = _.template(this.template, this.frameworkJSON);
aside.className = 'learn'; aside.className = 'learn';
// Localize demo links if (opts && opts.backend) {
var demoLinks = aside.querySelectorAll('.demo-link'); // Remove demo link
Array.prototype.forEach.call(demoLinks, function (demoLink) { var sourceLinks = aside.querySelector('.source-links');
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href')); var heading = sourceLinks.firstElementChild;
}); var sourceLink = sourceLinks.lastElementChild;
// Correct link path
var href = sourceLink.getAttribute('href');
sourceLink.setAttribute('href', href.substr(href.lastIndexOf('http')));
sourceLinks.innerHTML = heading.outerHTML + sourceLink.outerHTML;
} else {
// Localize demo links
var demoLinks = aside.querySelectorAll('.demo-link');
Array.prototype.forEach.call(demoLinks, function (demoLink) {
if (demoLink.getAttribute('href').substr(0, 4) !== 'http') {
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href'));
}
});
}
document.body.className = (document.body.className + ' learn-bar').trim(); document.body.className = (document.body.className + ' learn-bar').trim();
document.body.insertAdjacentHTML('afterBegin', aside.outerHTML); document.body.insertAdjacentHTML('afterBegin', aside.outerHTML);
......
{
"name": "todomvc-common",
"description": "Common TodoMVC utilities used by our apps",
"license": "MIT",
"authors": [
"TasteJS team"
],
"main": [
"base.js",
"base.css"
],
"keywords": [
"todomvc",
"tastejs",
"util",
"utilities"
],
"ignore": [
"package.json",
"readme.md"
]
}
...@@ -2,6 +2,6 @@ ...@@ -2,6 +2,6 @@
"name": "todomvc-sapui5", "name": "todomvc-sapui5",
"version": "0.0.0", "version": "0.0.0",
"dependencies": { "dependencies": {
"todomvc-common": "~0.1.7" "todomvc-common": "~0.3.0"
} }
} }
...@@ -171,25 +171,42 @@ ...@@ -171,25 +171,42 @@
framework = document.querySelector('[data-framework]').dataset.framework; framework = document.querySelector('[data-framework]').dataset.framework;
} }
this.template = template;
if (template && learnJSON[framework]) { if (learnJSON.backend) {
this.frameworkJSON = learnJSON.backend;
this.append({
backend: true
});
} else if (learnJSON[framework]) {
this.frameworkJSON = learnJSON[framework]; this.frameworkJSON = learnJSON[framework];
this.template = template;
this.append(); this.append();
} }
} }
Learn.prototype.append = function () { Learn.prototype.append = function (opts) {
var aside = document.createElement('aside'); var aside = document.createElement('aside');
aside.innerHTML = _.template(this.template, this.frameworkJSON); aside.innerHTML = _.template(this.template, this.frameworkJSON);
aside.className = 'learn'; aside.className = 'learn';
// Localize demo links if (opts && opts.backend) {
var demoLinks = aside.querySelectorAll('.demo-link'); // Remove demo link
Array.prototype.forEach.call(demoLinks, function (demoLink) { var sourceLinks = aside.querySelector('.source-links');
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href')); var heading = sourceLinks.firstElementChild;
}); var sourceLink = sourceLinks.lastElementChild;
// Correct link path
var href = sourceLink.getAttribute('href');
sourceLink.setAttribute('href', href.substr(href.lastIndexOf('http')));
sourceLinks.innerHTML = heading.outerHTML + sourceLink.outerHTML;
} else {
// Localize demo links
var demoLinks = aside.querySelectorAll('.demo-link');
Array.prototype.forEach.call(demoLinks, function (demoLink) {
if (demoLink.getAttribute('href').substr(0, 4) !== 'http') {
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href'));
}
});
}
document.body.className = (document.body.className + ' learn-bar').trim(); document.body.className = (document.body.className + ' learn-bar').trim();
document.body.insertAdjacentHTML('afterBegin', aside.outerHTML); document.body.insertAdjacentHTML('afterBegin', aside.outerHTML);
......
{
"name": "todomvc-common",
"description": "Common TodoMVC utilities used by our apps",
"license": "MIT",
"authors": [
"TasteJS team"
],
"main": [
"base.js",
"base.css"
],
"keywords": [
"todomvc",
"tastejs",
"util",
"utilities"
],
"ignore": [
"package.json",
"readme.md"
]
}
...@@ -3,6 +3,6 @@ ...@@ -3,6 +3,6 @@
"version": "0.0.0", "version": "0.0.0",
"dependencies": { "dependencies": {
"director": "~1.2.0", "director": "~1.2.0",
"todomvc-common": "~0.1.4" "todomvc-common": "~0.3.0"
} }
} }
...@@ -171,25 +171,42 @@ ...@@ -171,25 +171,42 @@
framework = document.querySelector('[data-framework]').dataset.framework; framework = document.querySelector('[data-framework]').dataset.framework;
} }
this.template = template;
if (template && learnJSON[framework]) { if (learnJSON.backend) {
this.frameworkJSON = learnJSON.backend;
this.append({
backend: true
});
} else if (learnJSON[framework]) {
this.frameworkJSON = learnJSON[framework]; this.frameworkJSON = learnJSON[framework];
this.template = template;
this.append(); this.append();
} }
} }
Learn.prototype.append = function () { Learn.prototype.append = function (opts) {
var aside = document.createElement('aside'); var aside = document.createElement('aside');
aside.innerHTML = _.template(this.template, this.frameworkJSON); aside.innerHTML = _.template(this.template, this.frameworkJSON);
aside.className = 'learn'; aside.className = 'learn';
// Localize demo links if (opts && opts.backend) {
var demoLinks = aside.querySelectorAll('.demo-link'); // Remove demo link
Array.prototype.forEach.call(demoLinks, function (demoLink) { var sourceLinks = aside.querySelector('.source-links');
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href')); var heading = sourceLinks.firstElementChild;
}); var sourceLink = sourceLinks.lastElementChild;
// Correct link path
var href = sourceLink.getAttribute('href');
sourceLink.setAttribute('href', href.substr(href.lastIndexOf('http')));
sourceLinks.innerHTML = heading.outerHTML + sourceLink.outerHTML;
} else {
// Localize demo links
var demoLinks = aside.querySelectorAll('.demo-link');
Array.prototype.forEach.call(demoLinks, function (demoLink) {
if (demoLink.getAttribute('href').substr(0, 4) !== 'http') {
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href'));
}
});
}
document.body.className = (document.body.className + ' learn-bar').trim(); document.body.className = (document.body.className + ' learn-bar').trim();
document.body.insertAdjacentHTML('afterBegin', aside.outerHTML); document.body.insertAdjacentHTML('afterBegin', aside.outerHTML);
......
{
"name": "todomvc-common",
"description": "Common TodoMVC utilities used by our apps",
"license": "MIT",
"authors": [
"TasteJS team"
],
"main": [
"base.js",
"base.css"
],
"keywords": [
"todomvc",
"tastejs",
"util",
"utilities"
],
"ignore": [
"package.json",
"readme.md"
]
}
{ {
"name": "todomvc-socketstream", "name": "todomvc-socketstream",
"dependencies": { "dependencies": {
"todomvc-common": "~0.1.9", "todomvc-common": "~0.3.0",
"jquery": "~2.1.0", "jquery": "~2.1.0",
"director": "~1.2.2" "director": "~1.2.2"
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
"name": "todomvc-somajs", "name": "todomvc-somajs",
"version": "0.0.0", "version": "0.0.0",
"dependencies": { "dependencies": {
"todomvc-common": "~0.1.6", "todomvc-common": "~0.3.0",
"director": "~1.2.0", "director": "~1.2.0",
"soma.js": "~2.1.0", "soma.js": "~2.1.0",
"soma-template": "~0.2.8" "soma-template": "~0.2.8"
......
...@@ -171,25 +171,42 @@ ...@@ -171,25 +171,42 @@
framework = document.querySelector('[data-framework]').dataset.framework; framework = document.querySelector('[data-framework]').dataset.framework;
} }
this.template = template;
if (template && learnJSON[framework]) { if (learnJSON.backend) {
this.frameworkJSON = learnJSON.backend;
this.append({
backend: true
});
} else if (learnJSON[framework]) {
this.frameworkJSON = learnJSON[framework]; this.frameworkJSON = learnJSON[framework];
this.template = template;
this.append(); this.append();
} }
} }
Learn.prototype.append = function () { Learn.prototype.append = function (opts) {
var aside = document.createElement('aside'); var aside = document.createElement('aside');
aside.innerHTML = _.template(this.template, this.frameworkJSON); aside.innerHTML = _.template(this.template, this.frameworkJSON);
aside.className = 'learn'; aside.className = 'learn';
// Localize demo links if (opts && opts.backend) {
var demoLinks = aside.querySelectorAll('.demo-link'); // Remove demo link
Array.prototype.forEach.call(demoLinks, function (demoLink) { var sourceLinks = aside.querySelector('.source-links');
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href')); var heading = sourceLinks.firstElementChild;
}); var sourceLink = sourceLinks.lastElementChild;
// Correct link path
var href = sourceLink.getAttribute('href');
sourceLink.setAttribute('href', href.substr(href.lastIndexOf('http')));
sourceLinks.innerHTML = heading.outerHTML + sourceLink.outerHTML;
} else {
// Localize demo links
var demoLinks = aside.querySelectorAll('.demo-link');
Array.prototype.forEach.call(demoLinks, function (demoLink) {
if (demoLink.getAttribute('href').substr(0, 4) !== 'http') {
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href'));
}
});
}
document.body.className = (document.body.className + ' learn-bar').trim(); document.body.className = (document.body.className + ' learn-bar').trim();
document.body.insertAdjacentHTML('afterBegin', aside.outerHTML); document.body.insertAdjacentHTML('afterBegin', aside.outerHTML);
......
{
"name": "todomvc-common",
"description": "Common TodoMVC utilities used by our apps",
"license": "MIT",
"authors": [
"TasteJS team"
],
"main": [
"base.js",
"base.css"
],
"keywords": [
"todomvc",
"tastejs",
"util",
"utilities"
],
"ignore": [
"package.json",
"readme.md"
]
}
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
"name": "todomvc-somajs", "name": "todomvc-somajs",
"version": "0.0.0", "version": "0.0.0",
"dependencies": { "dependencies": {
"todomvc-common": "~0.1.6", "todomvc-common": "~0.3.0",
"director": "~1.2.0", "director": "~1.2.0",
"requirejs": "~2.1.5", "requirejs": "~2.1.5",
"soma.js": "~2.1.0", "soma.js": "~2.1.0",
......
...@@ -171,25 +171,42 @@ ...@@ -171,25 +171,42 @@
framework = document.querySelector('[data-framework]').dataset.framework; framework = document.querySelector('[data-framework]').dataset.framework;
} }
this.template = template;
if (template && learnJSON[framework]) { if (learnJSON.backend) {
this.frameworkJSON = learnJSON.backend;
this.append({
backend: true
});
} else if (learnJSON[framework]) {
this.frameworkJSON = learnJSON[framework]; this.frameworkJSON = learnJSON[framework];
this.template = template;
this.append(); this.append();
} }
} }
Learn.prototype.append = function () { Learn.prototype.append = function (opts) {
var aside = document.createElement('aside'); var aside = document.createElement('aside');
aside.innerHTML = _.template(this.template, this.frameworkJSON); aside.innerHTML = _.template(this.template, this.frameworkJSON);
aside.className = 'learn'; aside.className = 'learn';
// Localize demo links if (opts && opts.backend) {
var demoLinks = aside.querySelectorAll('.demo-link'); // Remove demo link
Array.prototype.forEach.call(demoLinks, function (demoLink) { var sourceLinks = aside.querySelector('.source-links');
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href')); var heading = sourceLinks.firstElementChild;
}); var sourceLink = sourceLinks.lastElementChild;
// Correct link path
var href = sourceLink.getAttribute('href');
sourceLink.setAttribute('href', href.substr(href.lastIndexOf('http')));
sourceLinks.innerHTML = heading.outerHTML + sourceLink.outerHTML;
} else {
// Localize demo links
var demoLinks = aside.querySelectorAll('.demo-link');
Array.prototype.forEach.call(demoLinks, function (demoLink) {
if (demoLink.getAttribute('href').substr(0, 4) !== 'http') {
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href'));
}
});
}
document.body.className = (document.body.className + ' learn-bar').trim(); document.body.className = (document.body.className + ' learn-bar').trim();
document.body.insertAdjacentHTML('afterBegin', aside.outerHTML); document.body.insertAdjacentHTML('afterBegin', aside.outerHTML);
......
{
"name": "todomvc-common",
"description": "Common TodoMVC utilities used by our apps",
"license": "MIT",
"authors": [
"TasteJS team"
],
"main": [
"base.js",
"base.css"
],
"keywords": [
"todomvc",
"tastejs",
"util",
"utilities"
],
"ignore": [
"package.json",
"readme.md"
]
}
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
"version": "0.0.0", "version": "0.0.0",
"dependencies": { "dependencies": {
"spine": "~1.0.9", "spine": "~1.0.9",
"todomvc-common": "~0.1.4", "todomvc-common": "~0.3.0",
"handlebars": "~1.0.0-rc.3", "handlebars": "~1.0.0-rc.3",
"jquery": "~1.8.3" "jquery": "~1.8.3"
} }
......
...@@ -171,25 +171,42 @@ ...@@ -171,25 +171,42 @@
framework = document.querySelector('[data-framework]').dataset.framework; framework = document.querySelector('[data-framework]').dataset.framework;
} }
this.template = template;
if (template && learnJSON[framework]) { if (learnJSON.backend) {
this.frameworkJSON = learnJSON.backend;
this.append({
backend: true
});
} else if (learnJSON[framework]) {
this.frameworkJSON = learnJSON[framework]; this.frameworkJSON = learnJSON[framework];
this.template = template;
this.append(); this.append();
} }
} }
Learn.prototype.append = function () { Learn.prototype.append = function (opts) {
var aside = document.createElement('aside'); var aside = document.createElement('aside');
aside.innerHTML = _.template(this.template, this.frameworkJSON); aside.innerHTML = _.template(this.template, this.frameworkJSON);
aside.className = 'learn'; aside.className = 'learn';
// Localize demo links if (opts && opts.backend) {
var demoLinks = aside.querySelectorAll('.demo-link'); // Remove demo link
Array.prototype.forEach.call(demoLinks, function (demoLink) { var sourceLinks = aside.querySelector('.source-links');
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href')); var heading = sourceLinks.firstElementChild;
}); var sourceLink = sourceLinks.lastElementChild;
// Correct link path
var href = sourceLink.getAttribute('href');
sourceLink.setAttribute('href', href.substr(href.lastIndexOf('http')));
sourceLinks.innerHTML = heading.outerHTML + sourceLink.outerHTML;
} else {
// Localize demo links
var demoLinks = aside.querySelectorAll('.demo-link');
Array.prototype.forEach.call(demoLinks, function (demoLink) {
if (demoLink.getAttribute('href').substr(0, 4) !== 'http') {
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href'));
}
});
}
document.body.className = (document.body.className + ' learn-bar').trim(); document.body.className = (document.body.className + ' learn-bar').trim();
document.body.insertAdjacentHTML('afterBegin', aside.outerHTML); document.body.insertAdjacentHTML('afterBegin', aside.outerHTML);
......
{
"name": "todomvc-common",
"description": "Common TodoMVC utilities used by our apps",
"license": "MIT",
"authors": [
"TasteJS team"
],
"main": [
"base.js",
"base.css"
],
"keywords": [
"todomvc",
"tastejs",
"util",
"utilities"
],
"ignore": [
"package.json",
"readme.md"
]
}
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
"name": "todomvc-stapes", "name": "todomvc-stapes",
"version": "0.0.0", "version": "0.0.0",
"dependencies": { "dependencies": {
"todomvc-common": "~0.1.6", "todomvc-common": "~0.3.0",
"jquery": "~2.0.0", "jquery": "~2.0.0",
"handlebars.js": "~1.0.0-rc.3", "handlebars.js": "~1.0.0-rc.3",
"stapes": "0.2.1" "stapes": "0.2.1"
......
...@@ -171,25 +171,42 @@ ...@@ -171,25 +171,42 @@
framework = document.querySelector('[data-framework]').dataset.framework; framework = document.querySelector('[data-framework]').dataset.framework;
} }
this.template = template;
if (template && learnJSON[framework]) { if (learnJSON.backend) {
this.frameworkJSON = learnJSON.backend;
this.append({
backend: true
});
} else if (learnJSON[framework]) {
this.frameworkJSON = learnJSON[framework]; this.frameworkJSON = learnJSON[framework];
this.template = template;
this.append(); this.append();
} }
} }
Learn.prototype.append = function () { Learn.prototype.append = function (opts) {
var aside = document.createElement('aside'); var aside = document.createElement('aside');
aside.innerHTML = _.template(this.template, this.frameworkJSON); aside.innerHTML = _.template(this.template, this.frameworkJSON);
aside.className = 'learn'; aside.className = 'learn';
// Localize demo links if (opts && opts.backend) {
var demoLinks = aside.querySelectorAll('.demo-link'); // Remove demo link
Array.prototype.forEach.call(demoLinks, function (demoLink) { var sourceLinks = aside.querySelector('.source-links');
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href')); var heading = sourceLinks.firstElementChild;
}); var sourceLink = sourceLinks.lastElementChild;
// Correct link path
var href = sourceLink.getAttribute('href');
sourceLink.setAttribute('href', href.substr(href.lastIndexOf('http')));
sourceLinks.innerHTML = heading.outerHTML + sourceLink.outerHTML;
} else {
// Localize demo links
var demoLinks = aside.querySelectorAll('.demo-link');
Array.prototype.forEach.call(demoLinks, function (demoLink) {
if (demoLink.getAttribute('href').substr(0, 4) !== 'http') {
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href'));
}
});
}
document.body.className = (document.body.className + ' learn-bar').trim(); document.body.className = (document.body.className + ' learn-bar').trim();
document.body.insertAdjacentHTML('afterBegin', aside.outerHTML); document.body.insertAdjacentHTML('afterBegin', aside.outerHTML);
......
{
"name": "todomvc-common",
"description": "Common TodoMVC utilities used by our apps",
"license": "MIT",
"authors": [
"TasteJS team"
],
"main": [
"base.js",
"base.css"
],
"keywords": [
"todomvc",
"tastejs",
"util",
"utilities"
],
"ignore": [
"package.json",
"readme.md"
]
}
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
"name": "todomvc-stapes_require", "name": "todomvc-stapes_require",
"version": "0.0.0", "version": "0.0.0",
"dependencies": { "dependencies": {
"todomvc-common": "~0.1.6", "todomvc-common": "~0.3.0",
"stapes": "0.2.1", "stapes": "0.2.1",
"handlebars.js": "~1.0.0-rc.3", "handlebars.js": "~1.0.0-rc.3",
"zepto": "~1.0.0", "zepto": "~1.0.0",
......
...@@ -171,25 +171,42 @@ ...@@ -171,25 +171,42 @@
framework = document.querySelector('[data-framework]').dataset.framework; framework = document.querySelector('[data-framework]').dataset.framework;
} }
this.template = template;
if (template && learnJSON[framework]) { if (learnJSON.backend) {
this.frameworkJSON = learnJSON.backend;
this.append({
backend: true
});
} else if (learnJSON[framework]) {
this.frameworkJSON = learnJSON[framework]; this.frameworkJSON = learnJSON[framework];
this.template = template;
this.append(); this.append();
} }
} }
Learn.prototype.append = function () { Learn.prototype.append = function (opts) {
var aside = document.createElement('aside'); var aside = document.createElement('aside');
aside.innerHTML = _.template(this.template, this.frameworkJSON); aside.innerHTML = _.template(this.template, this.frameworkJSON);
aside.className = 'learn'; aside.className = 'learn';
// Localize demo links if (opts && opts.backend) {
var demoLinks = aside.querySelectorAll('.demo-link'); // Remove demo link
Array.prototype.forEach.call(demoLinks, function (demoLink) { var sourceLinks = aside.querySelector('.source-links');
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href')); var heading = sourceLinks.firstElementChild;
}); var sourceLink = sourceLinks.lastElementChild;
// Correct link path
var href = sourceLink.getAttribute('href');
sourceLink.setAttribute('href', href.substr(href.lastIndexOf('http')));
sourceLinks.innerHTML = heading.outerHTML + sourceLink.outerHTML;
} else {
// Localize demo links
var demoLinks = aside.querySelectorAll('.demo-link');
Array.prototype.forEach.call(demoLinks, function (demoLink) {
if (demoLink.getAttribute('href').substr(0, 4) !== 'http') {
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href'));
}
});
}
document.body.className = (document.body.className + ' learn-bar').trim(); document.body.className = (document.body.className + ' learn-bar').trim();
document.body.insertAdjacentHTML('afterBegin', aside.outerHTML); document.body.insertAdjacentHTML('afterBegin', aside.outerHTML);
......
{
"name": "todomvc-common",
"description": "Common TodoMVC utilities used by our apps",
"license": "MIT",
"authors": [
"TasteJS team"
],
"main": [
"base.js",
"base.css"
],
"keywords": [
"todomvc",
"tastejs",
"util",
"utilities"
],
"ignore": [
"package.json",
"readme.md"
]
}
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
"name": "todomvc-thorax", "name": "todomvc-thorax",
"version": "0.0.0", "version": "0.0.0",
"dependencies": { "dependencies": {
"todomvc-common": "~0.1.6", "todomvc-common": "~0.3.0",
"thorax": "~2.0.0" "thorax": "~2.0.0"
} }
} }
...@@ -171,25 +171,42 @@ ...@@ -171,25 +171,42 @@
framework = document.querySelector('[data-framework]').dataset.framework; framework = document.querySelector('[data-framework]').dataset.framework;
} }
this.template = template;
if (template && learnJSON[framework]) { if (learnJSON.backend) {
this.frameworkJSON = learnJSON.backend;
this.append({
backend: true
});
} else if (learnJSON[framework]) {
this.frameworkJSON = learnJSON[framework]; this.frameworkJSON = learnJSON[framework];
this.template = template;
this.append(); this.append();
} }
} }
Learn.prototype.append = function () { Learn.prototype.append = function (opts) {
var aside = document.createElement('aside'); var aside = document.createElement('aside');
aside.innerHTML = _.template(this.template, this.frameworkJSON); aside.innerHTML = _.template(this.template, this.frameworkJSON);
aside.className = 'learn'; aside.className = 'learn';
// Localize demo links if (opts && opts.backend) {
var demoLinks = aside.querySelectorAll('.demo-link'); // Remove demo link
Array.prototype.forEach.call(demoLinks, function (demoLink) { var sourceLinks = aside.querySelector('.source-links');
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href')); var heading = sourceLinks.firstElementChild;
}); var sourceLink = sourceLinks.lastElementChild;
// Correct link path
var href = sourceLink.getAttribute('href');
sourceLink.setAttribute('href', href.substr(href.lastIndexOf('http')));
sourceLinks.innerHTML = heading.outerHTML + sourceLink.outerHTML;
} else {
// Localize demo links
var demoLinks = aside.querySelectorAll('.demo-link');
Array.prototype.forEach.call(demoLinks, function (demoLink) {
if (demoLink.getAttribute('href').substr(0, 4) !== 'http') {
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href'));
}
});
}
document.body.className = (document.body.className + ' learn-bar').trim(); document.body.className = (document.body.className + ' learn-bar').trim();
document.body.insertAdjacentHTML('afterBegin', aside.outerHTML); document.body.insertAdjacentHTML('afterBegin', aside.outerHTML);
......
{
"name": "todomvc-common",
"description": "Common TodoMVC utilities used by our apps",
"license": "MIT",
"authors": [
"TasteJS team"
],
"main": [
"base.js",
"base.css"
],
"keywords": [
"todomvc",
"tastejs",
"util",
"utilities"
],
"ignore": [
"package.json",
"readme.md"
]
}
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
"name": "thorax_lumbar", "name": "thorax_lumbar",
"version": "0.0.0", "version": "0.0.0",
"dependencies": { "dependencies": {
"todomvc-common": "~0.1.6", "todomvc-common": "~0.3.0",
"lumbar-loader": "~1.1.0", "lumbar-loader": "~1.1.0",
"script.js": "latest", "script.js": "latest",
"thorax": "~2.0.0" "thorax": "~2.0.0"
......
...@@ -171,25 +171,42 @@ ...@@ -171,25 +171,42 @@
framework = document.querySelector('[data-framework]').dataset.framework; framework = document.querySelector('[data-framework]').dataset.framework;
} }
this.template = template;
if (template && learnJSON[framework]) { if (learnJSON.backend) {
this.frameworkJSON = learnJSON.backend;
this.append({
backend: true
});
} else if (learnJSON[framework]) {
this.frameworkJSON = learnJSON[framework]; this.frameworkJSON = learnJSON[framework];
this.template = template;
this.append(); this.append();
} }
} }
Learn.prototype.append = function () { Learn.prototype.append = function (opts) {
var aside = document.createElement('aside'); var aside = document.createElement('aside');
aside.innerHTML = _.template(this.template, this.frameworkJSON); aside.innerHTML = _.template(this.template, this.frameworkJSON);
aside.className = 'learn'; aside.className = 'learn';
// Localize demo links if (opts && opts.backend) {
var demoLinks = aside.querySelectorAll('.demo-link'); // Remove demo link
Array.prototype.forEach.call(demoLinks, function (demoLink) { var sourceLinks = aside.querySelector('.source-links');
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href')); var heading = sourceLinks.firstElementChild;
}); var sourceLink = sourceLinks.lastElementChild;
// Correct link path
var href = sourceLink.getAttribute('href');
sourceLink.setAttribute('href', href.substr(href.lastIndexOf('http')));
sourceLinks.innerHTML = heading.outerHTML + sourceLink.outerHTML;
} else {
// Localize demo links
var demoLinks = aside.querySelectorAll('.demo-link');
Array.prototype.forEach.call(demoLinks, function (demoLink) {
if (demoLink.getAttribute('href').substr(0, 4) !== 'http') {
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href'));
}
});
}
document.body.className = (document.body.className + ' learn-bar').trim(); document.body.className = (document.body.className + ' learn-bar').trim();
document.body.insertAdjacentHTML('afterBegin', aside.outerHTML); document.body.insertAdjacentHTML('afterBegin', aside.outerHTML);
......
{
"name": "todomvc-common",
"description": "Common TodoMVC utilities used by our apps",
"license": "MIT",
"authors": [
"TasteJS team"
],
"main": [
"base.js",
"base.css"
],
"keywords": [
"todomvc",
"tastejs",
"util",
"utilities"
],
"ignore": [
"package.json",
"readme.md"
]
}
...@@ -171,25 +171,42 @@ ...@@ -171,25 +171,42 @@
framework = document.querySelector('[data-framework]').dataset.framework; framework = document.querySelector('[data-framework]').dataset.framework;
} }
this.template = template;
if (template && learnJSON[framework]) { if (learnJSON.backend) {
this.frameworkJSON = learnJSON.backend;
this.append({
backend: true
});
} else if (learnJSON[framework]) {
this.frameworkJSON = learnJSON[framework]; this.frameworkJSON = learnJSON[framework];
this.template = template;
this.append(); this.append();
} }
} }
Learn.prototype.append = function () { Learn.prototype.append = function (opts) {
var aside = document.createElement('aside'); var aside = document.createElement('aside');
aside.innerHTML = _.template(this.template, this.frameworkJSON); aside.innerHTML = _.template(this.template, this.frameworkJSON);
aside.className = 'learn'; aside.className = 'learn';
// Localize demo links if (opts && opts.backend) {
var demoLinks = aside.querySelectorAll('.demo-link'); // Remove demo link
Array.prototype.forEach.call(demoLinks, function (demoLink) { var sourceLinks = aside.querySelector('.source-links');
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href')); var heading = sourceLinks.firstElementChild;
}); var sourceLink = sourceLinks.lastElementChild;
// Correct link path
var href = sourceLink.getAttribute('href');
sourceLink.setAttribute('href', href.substr(href.lastIndexOf('http')));
sourceLinks.innerHTML = heading.outerHTML + sourceLink.outerHTML;
} else {
// Localize demo links
var demoLinks = aside.querySelectorAll('.demo-link');
Array.prototype.forEach.call(demoLinks, function (demoLink) {
if (demoLink.getAttribute('href').substr(0, 4) !== 'http') {
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href'));
}
});
}
document.body.className = (document.body.className + ' learn-bar').trim(); document.body.className = (document.body.className + ' learn-bar').trim();
document.body.insertAdjacentHTML('afterBegin', aside.outerHTML); document.body.insertAdjacentHTML('afterBegin', aside.outerHTML);
......
{
"name": "todomvc-common",
"description": "Common TodoMVC utilities used by our apps",
"license": "MIT",
"authors": [
"TasteJS team"
],
"main": [
"base.js",
"base.css"
],
"keywords": [
"todomvc",
"tastejs",
"util",
"utilities"
],
"ignore": [
"package.json",
"readme.md"
]
}
...@@ -3,6 +3,6 @@ ...@@ -3,6 +3,6 @@
"version": "0.0.0", "version": "0.0.0",
"dependencies": { "dependencies": {
"angular": "1.2.8", "angular": "1.2.8",
"todomvc-common": "~0.1.6" "todomvc-common": "~0.3.0"
} }
} }
...@@ -171,25 +171,42 @@ ...@@ -171,25 +171,42 @@
framework = document.querySelector('[data-framework]').dataset.framework; framework = document.querySelector('[data-framework]').dataset.framework;
} }
this.template = template;
if (template && learnJSON[framework]) { if (learnJSON.backend) {
this.frameworkJSON = learnJSON.backend;
this.append({
backend: true
});
} else if (learnJSON[framework]) {
this.frameworkJSON = learnJSON[framework]; this.frameworkJSON = learnJSON[framework];
this.template = template;
this.append(); this.append();
} }
} }
Learn.prototype.append = function () { Learn.prototype.append = function (opts) {
var aside = document.createElement('aside'); var aside = document.createElement('aside');
aside.innerHTML = _.template(this.template, this.frameworkJSON); aside.innerHTML = _.template(this.template, this.frameworkJSON);
aside.className = 'learn'; aside.className = 'learn';
// Localize demo links if (opts && opts.backend) {
var demoLinks = aside.querySelectorAll('.demo-link'); // Remove demo link
Array.prototype.forEach.call(demoLinks, function (demoLink) { var sourceLinks = aside.querySelector('.source-links');
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href')); var heading = sourceLinks.firstElementChild;
}); var sourceLink = sourceLinks.lastElementChild;
// Correct link path
var href = sourceLink.getAttribute('href');
sourceLink.setAttribute('href', href.substr(href.lastIndexOf('http')));
sourceLinks.innerHTML = heading.outerHTML + sourceLink.outerHTML;
} else {
// Localize demo links
var demoLinks = aside.querySelectorAll('.demo-link');
Array.prototype.forEach.call(demoLinks, function (demoLink) {
if (demoLink.getAttribute('href').substr(0, 4) !== 'http') {
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href'));
}
});
}
document.body.className = (document.body.className + ' learn-bar').trim(); document.body.className = (document.body.className + ' learn-bar').trim();
document.body.insertAdjacentHTML('afterBegin', aside.outerHTML); document.body.insertAdjacentHTML('afterBegin', aside.outerHTML);
......
{
"name": "todomvc-common",
"description": "Common TodoMVC utilities used by our apps",
"license": "MIT",
"authors": [
"TasteJS team"
],
"main": [
"base.js",
"base.css"
],
"keywords": [
"todomvc",
"tastejs",
"util",
"utilities"
],
"ignore": [
"package.json",
"readme.md"
]
}
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
"name": "todomvc-typescript-backbone", "name": "todomvc-typescript-backbone",
"version": "0.0.0", "version": "0.0.0",
"dependencies": { "dependencies": {
"todomvc-common": "~0.1.6", "todomvc-common": "~0.3.0",
"jquery": "~2.0.0", "jquery": "~2.0.0",
"lodash": "~1.2.1" "lodash": "~1.2.1"
} }
......
...@@ -171,25 +171,42 @@ ...@@ -171,25 +171,42 @@
framework = document.querySelector('[data-framework]').dataset.framework; framework = document.querySelector('[data-framework]').dataset.framework;
} }
this.template = template;
if (template && learnJSON[framework]) { if (learnJSON.backend) {
this.frameworkJSON = learnJSON.backend;
this.append({
backend: true
});
} else if (learnJSON[framework]) {
this.frameworkJSON = learnJSON[framework]; this.frameworkJSON = learnJSON[framework];
this.template = template;
this.append(); this.append();
} }
} }
Learn.prototype.append = function () { Learn.prototype.append = function (opts) {
var aside = document.createElement('aside'); var aside = document.createElement('aside');
aside.innerHTML = _.template(this.template, this.frameworkJSON); aside.innerHTML = _.template(this.template, this.frameworkJSON);
aside.className = 'learn'; aside.className = 'learn';
// Localize demo links if (opts && opts.backend) {
var demoLinks = aside.querySelectorAll('.demo-link'); // Remove demo link
Array.prototype.forEach.call(demoLinks, function (demoLink) { var sourceLinks = aside.querySelector('.source-links');
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href')); var heading = sourceLinks.firstElementChild;
}); var sourceLink = sourceLinks.lastElementChild;
// Correct link path
var href = sourceLink.getAttribute('href');
sourceLink.setAttribute('href', href.substr(href.lastIndexOf('http')));
sourceLinks.innerHTML = heading.outerHTML + sourceLink.outerHTML;
} else {
// Localize demo links
var demoLinks = aside.querySelectorAll('.demo-link');
Array.prototype.forEach.call(demoLinks, function (demoLink) {
if (demoLink.getAttribute('href').substr(0, 4) !== 'http') {
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href'));
}
});
}
document.body.className = (document.body.className + ' learn-bar').trim(); document.body.className = (document.body.className + ' learn-bar').trim();
document.body.insertAdjacentHTML('afterBegin', aside.outerHTML); document.body.insertAdjacentHTML('afterBegin', aside.outerHTML);
......
{
"name": "todomvc-common",
"description": "Common TodoMVC utilities used by our apps",
"license": "MIT",
"authors": [
"TasteJS team"
],
"main": [
"base.js",
"base.css"
],
"keywords": [
"todomvc",
"tastejs",
"util",
"utilities"
],
"ignore": [
"package.json",
"readme.md"
]
}
...@@ -2,6 +2,6 @@ ...@@ -2,6 +2,6 @@
"name": "dart", "name": "dart",
"version": "0.0.0", "version": "0.0.0",
"dependencies": { "dependencies": {
"todomvc-common": "~0.1.6" "todomvc-common": "~0.3.0"
} }
} }
\ No newline at end of file
...@@ -171,25 +171,42 @@ ...@@ -171,25 +171,42 @@
framework = document.querySelector('[data-framework]').dataset.framework; framework = document.querySelector('[data-framework]').dataset.framework;
} }
this.template = template;
if (template && learnJSON[framework]) { if (learnJSON.backend) {
this.frameworkJSON = learnJSON.backend;
this.append({
backend: true
});
} else if (learnJSON[framework]) {
this.frameworkJSON = learnJSON[framework]; this.frameworkJSON = learnJSON[framework];
this.template = template;
this.append(); this.append();
} }
} }
Learn.prototype.append = function () { Learn.prototype.append = function (opts) {
var aside = document.createElement('aside'); var aside = document.createElement('aside');
aside.innerHTML = _.template(this.template, this.frameworkJSON); aside.innerHTML = _.template(this.template, this.frameworkJSON);
aside.className = 'learn'; aside.className = 'learn';
// Localize demo links if (opts && opts.backend) {
var demoLinks = aside.querySelectorAll('.demo-link'); // Remove demo link
Array.prototype.forEach.call(demoLinks, function (demoLink) { var sourceLinks = aside.querySelector('.source-links');
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href')); var heading = sourceLinks.firstElementChild;
}); var sourceLink = sourceLinks.lastElementChild;
// Correct link path
var href = sourceLink.getAttribute('href');
sourceLink.setAttribute('href', href.substr(href.lastIndexOf('http')));
sourceLinks.innerHTML = heading.outerHTML + sourceLink.outerHTML;
} else {
// Localize demo links
var demoLinks = aside.querySelectorAll('.demo-link');
Array.prototype.forEach.call(demoLinks, function (demoLink) {
if (demoLink.getAttribute('href').substr(0, 4) !== 'http') {
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href'));
}
});
}
document.body.className = (document.body.className + ' learn-bar').trim(); document.body.className = (document.body.className + ' learn-bar').trim();
document.body.insertAdjacentHTML('afterBegin', aside.outerHTML); document.body.insertAdjacentHTML('afterBegin', aside.outerHTML);
......
...@@ -171,25 +171,42 @@ ...@@ -171,25 +171,42 @@
framework = document.querySelector('[data-framework]').dataset.framework; framework = document.querySelector('[data-framework]').dataset.framework;
} }
this.template = template;
if (template && learnJSON[framework]) { if (learnJSON.backend) {
this.frameworkJSON = learnJSON.backend;
this.append({
backend: true
});
} else if (learnJSON[framework]) {
this.frameworkJSON = learnJSON[framework]; this.frameworkJSON = learnJSON[framework];
this.template = template;
this.append(); this.append();
} }
} }
Learn.prototype.append = function () { Learn.prototype.append = function (opts) {
var aside = document.createElement('aside'); var aside = document.createElement('aside');
aside.innerHTML = _.template(this.template, this.frameworkJSON); aside.innerHTML = _.template(this.template, this.frameworkJSON);
aside.className = 'learn'; aside.className = 'learn';
// Localize demo links if (opts && opts.backend) {
var demoLinks = aside.querySelectorAll('.demo-link'); // Remove demo link
Array.prototype.forEach.call(demoLinks, function (demoLink) { var sourceLinks = aside.querySelector('.source-links');
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href')); var heading = sourceLinks.firstElementChild;
}); var sourceLink = sourceLinks.lastElementChild;
// Correct link path
var href = sourceLink.getAttribute('href');
sourceLink.setAttribute('href', href.substr(href.lastIndexOf('http')));
sourceLinks.innerHTML = heading.outerHTML + sourceLink.outerHTML;
} else {
// Localize demo links
var demoLinks = aside.querySelectorAll('.demo-link');
Array.prototype.forEach.call(demoLinks, function (demoLink) {
if (demoLink.getAttribute('href').substr(0, 4) !== 'http') {
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href'));
}
});
}
document.body.className = (document.body.className + ' learn-bar').trim(); document.body.className = (document.body.className + ' learn-bar').trim();
document.body.insertAdjacentHTML('afterBegin', aside.outerHTML); document.body.insertAdjacentHTML('afterBegin', aside.outerHTML);
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
"name": "todomvc-vanillajs", "name": "todomvc-vanillajs",
"version": "0.0.0", "version": "0.0.0",
"dependencies": { "dependencies": {
"todomvc-common": "~0.1.4" "todomvc-common": "~0.3.0"
}, },
"devDependencies": { "devDependencies": {
"jasmine": "~1.3.1" "jasmine": "~1.3.1"
......
...@@ -171,25 +171,42 @@ ...@@ -171,25 +171,42 @@
framework = document.querySelector('[data-framework]').dataset.framework; framework = document.querySelector('[data-framework]').dataset.framework;
} }
this.template = template;
if (template && learnJSON[framework]) { if (learnJSON.backend) {
this.frameworkJSON = learnJSON.backend;
this.append({
backend: true
});
} else if (learnJSON[framework]) {
this.frameworkJSON = learnJSON[framework]; this.frameworkJSON = learnJSON[framework];
this.template = template;
this.append(); this.append();
} }
} }
Learn.prototype.append = function () { Learn.prototype.append = function (opts) {
var aside = document.createElement('aside'); var aside = document.createElement('aside');
aside.innerHTML = _.template(this.template, this.frameworkJSON); aside.innerHTML = _.template(this.template, this.frameworkJSON);
aside.className = 'learn'; aside.className = 'learn';
// Localize demo links if (opts && opts.backend) {
var demoLinks = aside.querySelectorAll('.demo-link'); // Remove demo link
Array.prototype.forEach.call(demoLinks, function (demoLink) { var sourceLinks = aside.querySelector('.source-links');
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href')); var heading = sourceLinks.firstElementChild;
}); var sourceLink = sourceLinks.lastElementChild;
// Correct link path
var href = sourceLink.getAttribute('href');
sourceLink.setAttribute('href', href.substr(href.lastIndexOf('http')));
sourceLinks.innerHTML = heading.outerHTML + sourceLink.outerHTML;
} else {
// Localize demo links
var demoLinks = aside.querySelectorAll('.demo-link');
Array.prototype.forEach.call(demoLinks, function (demoLink) {
if (demoLink.getAttribute('href').substr(0, 4) !== 'http') {
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href'));
}
});
}
document.body.className = (document.body.className + ' learn-bar').trim(); document.body.className = (document.body.className + ' learn-bar').trim();
document.body.insertAdjacentHTML('afterBegin', aside.outerHTML); document.body.insertAdjacentHTML('afterBegin', aside.outerHTML);
......
...@@ -2,6 +2,6 @@ ...@@ -2,6 +2,6 @@
"name": "todomvc-vue", "name": "todomvc-vue",
"dependencies": { "dependencies": {
"vue": "~0.10.0", "vue": "~0.10.0",
"todomvc-common": "~0.1.9" "todomvc-common": "~0.3.0"
} }
} }
\ No newline at end of file
...@@ -171,25 +171,42 @@ ...@@ -171,25 +171,42 @@
framework = document.querySelector('[data-framework]').dataset.framework; framework = document.querySelector('[data-framework]').dataset.framework;
} }
this.template = template;
if (template && learnJSON[framework]) { if (learnJSON.backend) {
this.frameworkJSON = learnJSON.backend;
this.append({
backend: true
});
} else if (learnJSON[framework]) {
this.frameworkJSON = learnJSON[framework]; this.frameworkJSON = learnJSON[framework];
this.template = template;
this.append(); this.append();
} }
} }
Learn.prototype.append = function () { Learn.prototype.append = function (opts) {
var aside = document.createElement('aside'); var aside = document.createElement('aside');
aside.innerHTML = _.template(this.template, this.frameworkJSON); aside.innerHTML = _.template(this.template, this.frameworkJSON);
aside.className = 'learn'; aside.className = 'learn';
// Localize demo links if (opts && opts.backend) {
var demoLinks = aside.querySelectorAll('.demo-link'); // Remove demo link
Array.prototype.forEach.call(demoLinks, function (demoLink) { var sourceLinks = aside.querySelector('.source-links');
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href')); var heading = sourceLinks.firstElementChild;
}); var sourceLink = sourceLinks.lastElementChild;
// Correct link path
var href = sourceLink.getAttribute('href');
sourceLink.setAttribute('href', href.substr(href.lastIndexOf('http')));
sourceLinks.innerHTML = heading.outerHTML + sourceLink.outerHTML;
} else {
// Localize demo links
var demoLinks = aside.querySelectorAll('.demo-link');
Array.prototype.forEach.call(demoLinks, function (demoLink) {
if (demoLink.getAttribute('href').substr(0, 4) !== 'http') {
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href'));
}
});
}
document.body.className = (document.body.className + ' learn-bar').trim(); document.body.className = (document.body.className + ' learn-bar').trim();
document.body.insertAdjacentHTML('afterBegin', aside.outerHTML); document.body.insertAdjacentHTML('afterBegin', aside.outerHTML);
......
{
"name": "todomvc-common",
"description": "Common TodoMVC utilities used by our apps",
"license": "MIT",
"authors": [
"TasteJS team"
],
"main": [
"base.js",
"base.css"
],
"keywords": [
"todomvc",
"tastejs",
"util",
"utilities"
],
"ignore": [
"package.json",
"readme.md"
]
}
{ {
"name": "todomvc-yui", "name": "todomvc-yui",
"dependencies": { "dependencies": {
"todomvc-common": "~0.1.6" "todomvc-common": "~0.3.0"
} }
} }
...@@ -171,25 +171,42 @@ ...@@ -171,25 +171,42 @@
framework = document.querySelector('[data-framework]').dataset.framework; framework = document.querySelector('[data-framework]').dataset.framework;
} }
this.template = template;
if (template && learnJSON[framework]) { if (learnJSON.backend) {
this.frameworkJSON = learnJSON.backend;
this.append({
backend: true
});
} else if (learnJSON[framework]) {
this.frameworkJSON = learnJSON[framework]; this.frameworkJSON = learnJSON[framework];
this.template = template;
this.append(); this.append();
} }
} }
Learn.prototype.append = function () { Learn.prototype.append = function (opts) {
var aside = document.createElement('aside'); var aside = document.createElement('aside');
aside.innerHTML = _.template(this.template, this.frameworkJSON); aside.innerHTML = _.template(this.template, this.frameworkJSON);
aside.className = 'learn'; aside.className = 'learn';
// Localize demo links if (opts && opts.backend) {
var demoLinks = aside.querySelectorAll('.demo-link'); // Remove demo link
Array.prototype.forEach.call(demoLinks, function (demoLink) { var sourceLinks = aside.querySelector('.source-links');
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href')); var heading = sourceLinks.firstElementChild;
}); var sourceLink = sourceLinks.lastElementChild;
// Correct link path
var href = sourceLink.getAttribute('href');
sourceLink.setAttribute('href', href.substr(href.lastIndexOf('http')));
sourceLinks.innerHTML = heading.outerHTML + sourceLink.outerHTML;
} else {
// Localize demo links
var demoLinks = aside.querySelectorAll('.demo-link');
Array.prototype.forEach.call(demoLinks, function (demoLink) {
if (demoLink.getAttribute('href').substr(0, 4) !== 'http') {
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href'));
}
});
}
document.body.className = (document.body.className + ' learn-bar').trim(); document.body.className = (document.body.className + ' learn-bar').trim();
document.body.insertAdjacentHTML('afterBegin', aside.outerHTML); document.body.insertAdjacentHTML('afterBegin', aside.outerHTML);
......
{
"name": "todomvc-common",
"description": "Common TodoMVC utilities used by our apps",
"license": "MIT",
"authors": [
"TasteJS team"
],
"main": [
"base.js",
"base.css"
],
"keywords": [
"todomvc",
"tastejs",
"util",
"utilities"
],
"ignore": [
"package.json",
"readme.md"
]
}
...@@ -15,8 +15,8 @@ module.exports = function (grunt) { ...@@ -15,8 +15,8 @@ module.exports = function (grunt) {
// I also added Bower up top for in the future, as that might come in handy // I also added Bower up top for in the future, as that might come in handy
// to correctly fetch and install the latest todomvc-common, without relying // to correctly fetch and install the latest todomvc-common, without relying
// on this weird Batman system. // on this weird Batman system.
var sourceTodoMvcCommon = 'examples/batman/bower_components/todomvc-common'; var sourceTodoMvcCommon = 'examples/angularjs/bower_components/todomvc-common';
var sourceIdentifierRegex = /batman/; var sourceIdentifierRegex = /angularjs/;
grunt.file.setBase('../'); grunt.file.setBase('../');
......
...@@ -274,7 +274,6 @@ label[for='toggle-all'] { ...@@ -274,7 +274,6 @@ label[for='toggle-all'] {
text-shadow: 0 0 1px #000, text-shadow: 0 0 1px #000,
0 0 10px rgba(199, 107, 107, 0.8); 0 0 10px rgba(199, 107, 107, 0.8);
-webkit-transform: scale(1.3); -webkit-transform: scale(1.3);
-ms-transform: scale(1.3);
transform: scale(1.3); transform: scale(1.3);
} }
...@@ -399,7 +398,6 @@ label[for='toggle-all'] { ...@@ -399,7 +398,6 @@ label[for='toggle-all'] {
width: 65px; width: 65px;
height: 41px; height: 41px;
-webkit-transform: rotate(90deg); -webkit-transform: rotate(90deg);
-ms-transform: rotate(90deg);
transform: rotate(90deg); transform: rotate(90deg);
-webkit-appearance: none; -webkit-appearance: none;
appearance: none; appearance: none;
......
...@@ -122,16 +122,7 @@ ...@@ -122,16 +122,7 @@
} }
function findRoot() { function findRoot() {
var base; var base = location.href.indexOf('examples/');
[/labs/, /\w*-examples/].forEach(function (href) {
var match = location.href.match(href);
if (!base && match) {
base = location.href.indexOf(match);
}
});
return location.href.substr(0, base); return location.href.substr(0, base);
} }
...@@ -177,28 +168,45 @@ ...@@ -177,28 +168,45 @@
} }
if (!framework && document.querySelector('[data-framework]')) { if (!framework && document.querySelector('[data-framework]')) {
framework = document.querySelector('[data-framework]').getAttribute('data-framework'); framework = document.querySelector('[data-framework]').dataset.framework;
} }
this.template = template;
if (template && learnJSON[framework]) { if (learnJSON.backend) {
this.frameworkJSON = learnJSON.backend;
this.append({
backend: true
});
} else if (learnJSON[framework]) {
this.frameworkJSON = learnJSON[framework]; this.frameworkJSON = learnJSON[framework];
this.template = template;
this.append(); this.append();
} }
} }
Learn.prototype.append = function () { Learn.prototype.append = function (opts) {
var aside = document.createElement('aside'); var aside = document.createElement('aside');
aside.innerHTML = _.template(this.template, this.frameworkJSON); aside.innerHTML = _.template(this.template, this.frameworkJSON);
aside.className = 'learn'; aside.className = 'learn';
// Localize demo links if (opts && opts.backend) {
var demoLinks = aside.querySelectorAll('.demo-link'); // Remove demo link
Array.prototype.forEach.call(demoLinks, function (demoLink) { var sourceLinks = aside.querySelector('.source-links');
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href')); var heading = sourceLinks.firstElementChild;
}); var sourceLink = sourceLinks.lastElementChild;
// Correct link path
var href = sourceLink.getAttribute('href');
sourceLink.setAttribute('href', href.substr(href.lastIndexOf('http')));
sourceLinks.innerHTML = heading.outerHTML + sourceLink.outerHTML;
} else {
// Localize demo links
var demoLinks = aside.querySelectorAll('.demo-link');
Array.prototype.forEach.call(demoLinks, function (demoLink) {
if (demoLink.getAttribute('href').substr(0, 4) !== 'http') {
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href'));
}
});
}
document.body.className = (document.body.className + ' learn-bar').trim(); document.body.className = (document.body.className + ' learn-bar').trim();
document.body.insertAdjacentHTML('afterBegin', aside.outerHTML); document.body.insertAdjacentHTML('afterBegin', aside.outerHTML);
......
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