Skip to content

Commit 3e6e853

Browse files
add more helpful readmes and learn.json.
1 parent 868271f commit 3e6e853

File tree

489 files changed

+235152
-74636
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

489 files changed

+235152
-74636
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
.DS_Store
2+
tasks/node_modules

CNAME

-1
This file was deleted.

architecture-examples/agilityjs/bower_components/todomvc-common/base.css

+141
Original file line numberDiff line numberDiff line change
@@ -412,3 +412,144 @@ label[for='toggle-all'] {
412412
.hidden{
413413
display:none;
414414
}
415+
416+
hr {
417+
margin: 20px 0;
418+
border: 0;
419+
border-top: 1px dashed #C5C5C5;
420+
border-bottom: 1px dashed #F7F7F7;
421+
}
422+
423+
.learn a {
424+
font-weight: normal;
425+
text-decoration: none;
426+
color: #b83f45;
427+
}
428+
429+
.learn a:hover {
430+
text-decoration: underline;
431+
color: #787e7e;
432+
}
433+
434+
.learn h3,
435+
.learn h4,
436+
.learn h5 {
437+
margin: 10px 0;
438+
font-weight: 500;
439+
line-height: 1.2;
440+
color: #000;
441+
}
442+
443+
.learn h3 {
444+
font-size: 24px;
445+
}
446+
447+
.learn h4 {
448+
font-size: 18px;
449+
}
450+
451+
.learn h5 {
452+
margin-bottom: 0;
453+
font-size: 14px;
454+
}
455+
456+
.learn ul {
457+
padding: 0;
458+
margin: 0 0 30px 25px;
459+
}
460+
461+
.learn li {
462+
line-height: 20px;
463+
}
464+
465+
.learn p {
466+
font-size: 15px;
467+
font-weight: 300;
468+
line-height: 1.3;
469+
margin-top: 0;
470+
margin-bottom: 0;
471+
}
472+
473+
.quote {
474+
border: none;
475+
margin: 20px 0 60px 0;
476+
}
477+
478+
.quote p {
479+
font-style: italic;
480+
}
481+
482+
.quote p:before {
483+
content: '“';
484+
font-size: 50px;
485+
opacity: .15;
486+
position: absolute;
487+
top: -20px;
488+
left: 3px;
489+
}
490+
491+
.quote p:after {
492+
content: '”';
493+
font-size: 50px;
494+
opacity: .15;
495+
position: absolute;
496+
bottom: -42px;
497+
right: 3px;
498+
}
499+
500+
.quote footer {
501+
position: absolute;
502+
bottom: -40px;
503+
right: 0;
504+
}
505+
506+
.quote footer img {
507+
border-radius: 3px;
508+
}
509+
510+
.quote footer a {
511+
margin-left: 5px;
512+
vertical-align: middle;
513+
}
514+
515+
.speech-bubble {
516+
position: relative;
517+
padding: 10px;
518+
background: rgba(0, 0, 0, .04);
519+
border-radius: 5px;
520+
}
521+
522+
.speech-bubble:after {
523+
content: '';
524+
position: absolute;
525+
top: 100%;
526+
right: 30px;
527+
border: 13px solid transparent;
528+
border-top-color: rgba(0, 0, 0, .04);
529+
}
530+
531+
/**body*/.learn-bar > .learn {
532+
position: absolute;
533+
width: 272px;
534+
top: 8px;
535+
left: -300px;
536+
padding: 10px;
537+
border-radius: 5px;
538+
background-color: rgba(255, 255, 255, .6);
539+
transition-property: left;
540+
transition-duration: 500ms;
541+
}
542+
543+
@media (min-width: 899px) {
544+
/**body*/.learn-bar {
545+
width: auto;
546+
margin: 0 0 0 300px;
547+
}
548+
/**body*/.learn-bar > .learn {
549+
left: 8px;
550+
}
551+
/**body*/.learn-bar #todoapp {
552+
width: 550px;
553+
margin: 130px auto 40px auto;
554+
}
555+
}

architecture-examples/agilityjs/bower_components/todomvc-common/base.js

+144
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,150 @@
3333
}
3434
}
3535

36+
function findRoot() {
37+
var base;
38+
39+
[/labs/, /\w*-examples/].forEach(function (href) {
40+
var match = location.href.match(href);
41+
42+
if (!base && match) {
43+
base = location.href.indexOf(match);
44+
}
45+
});
46+
47+
return location.href.substr(0, base);
48+
}
49+
50+
function getFile(file, callback) {
51+
var xhr = new XMLHttpRequest();
52+
53+
xhr.open('GET', findRoot() + file, true);
54+
xhr.send();
55+
56+
xhr.onload = function () {
57+
if (xhr.status === 200 && callback) {
58+
callback(xhr.responseText);
59+
}
60+
};
61+
}
62+
63+
function Learn(learnJSON, config) {
64+
if (!(this instanceof Learn)) {
65+
return new Learn(learnJSON, config);
66+
}
67+
68+
var template, framework;
69+
70+
if (typeof learnJSON !== 'object') {
71+
try {
72+
learnJSON = JSON.parse(learnJSON);
73+
} catch (e) {
74+
return;
75+
}
76+
}
77+
78+
if (config) {
79+
template = config.template;
80+
framework = config.framework;
81+
}
82+
83+
if (!template && learnJSON.templates) {
84+
template = learnJSON.templates.todomvc;
85+
}
86+
87+
if (!framework && document.querySelector('[data-framework]')) {
88+
framework = document.querySelector('[data-framework]').getAttribute('data-framework');
89+
}
90+
91+
if (template && learnJSON[framework]) {
92+
this.frameworkJSON = learnJSON[framework];
93+
this.template = template;
94+
95+
this.append();
96+
}
97+
}
98+
99+
Learn.prototype._prepareTemplate = function () {
100+
var aside = document.createElement('aside');
101+
aside.innerHTML = this.template;
102+
103+
var header = aside.cloneNode(true);
104+
header.removeChild(header.querySelector('ul'));
105+
header.removeChild(header.querySelectorAll('footer')[1]);
106+
107+
return {
108+
header: header,
109+
links: aside.cloneNode(true).querySelector('ul a'),
110+
footer: aside.cloneNode(true).querySelectorAll('footer')[1]
111+
};
112+
};
113+
114+
Learn.prototype._parseTemplate = function () {
115+
if (!this.template) {
116+
return;
117+
}
118+
119+
var frameworkJSON = this.frameworkJSON;
120+
var template = this._prepareTemplate();
121+
122+
var aside = document.createElement('aside');
123+
var linksTemplate = template.links.outerHTML;
124+
var parser = /\{\{([^}]*)\}\}/g;
125+
126+
var header, examples, links;
127+
128+
header = template.header.innerHTML.replace(parser, function (match, key) {
129+
return frameworkJSON[key];
130+
});
131+
132+
aside.innerHTML = header;
133+
134+
if (frameworkJSON.examples) {
135+
examples = frameworkJSON.examples.map(function (example) {
136+
return ''
137+
+ '<h5>' + example.name + '</h5>'
138+
+ '<p>'
139+
+ (location.href.match(example.url + '/') ? '' : ' <a href="' + findRoot() + example.url + '">Demo</a>, ')
140+
+ ' <a href="https://github.com/tastejs/todomvc/tree/gh-pages/' + (example.source_url || example.url) + '">Source</a>'
141+
+ '</p>';
142+
}).join('');
143+
144+
aside.querySelector('.source-links').innerHTML = examples;
145+
}
146+
147+
if (frameworkJSON.link_groups) {
148+
links = frameworkJSON.link_groups.map(function (linkGroup) {
149+
return ''
150+
+ '<h4>' + linkGroup.heading + '</h4>'
151+
+ '<ul>'
152+
+ linkGroup.links.map(function (link) {
153+
return ''
154+
+ '<li>'
155+
+ linksTemplate.replace(parser, function (match, key) {
156+
return link[key];
157+
})
158+
+ '</li>';
159+
}).join('')
160+
+ '</ul>';
161+
}).join('');
162+
163+
aside.innerHTML += links;
164+
aside.innerHTML += template.footer.outerHTML;
165+
}
166+
167+
return aside;
168+
};
169+
170+
Learn.prototype.append = function () {
171+
var aside = this._parseTemplate();
172+
173+
aside.className = 'learn';
174+
175+
document.body.className = (document.body.className + ' learn-bar').trim();
176+
document.body.insertAdjacentElement('afterBegin', aside);
177+
};
178+
36179
appendSourceLink();
37180
redirect();
181+
getFile('learn.json', Learn);
38182
})();

architecture-examples/agilityjs/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!doctype html>
2-
<html lang="en">
2+
<html lang="en" data-framework="agilityjs">
33
<head>
44
<meta charset="utf-8">
55
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Agility.js TodoMVC Example
2+
3+
> [Agility.js](http://agilityjs.com) is an MVC library for Javascript that lets you write maintainable and reusable browser code without the verbose or infrastructural overhead found in other MVC libraries. The goal is to enable developers to write web apps at least as quickly as with jQuery, while simplifying long-term maintainability through MVC objects.
4+
5+
> _[Agility.js - agilityjs.com](http://agilityjs.com)_
6+
7+
8+
## Learning Agility.js
9+
10+
The [Agility.js website](http://agilityjs.com) is a great resource for getting started.
11+
12+
Here are some links you may find helpful:
13+
14+
* [Official Documentation](http://agilityjs.com/docs/docs.html)
15+
* [Try it out on JSBin](http://jsbin.com/agility/224/edit)
16+
* [Applications built with Agility.js](http://agilityjs.com/docs/gallery.html)
17+
18+
Articles and guides from the community:
19+
20+
* [Step by step from jQuery to Agility.js](https://gist.github.com/pindia/3166678)
21+
22+
Get help from other Agility.js users:
23+
24+
* [Google Groups mailing list](http://groups.google.com/group/agilityjs)
25+
* [agility.js on Stack Overflow](http://stackoverflow.com/questions/tagged/agility.js)
26+
* [Agility.js on Twitter](https://twitter.com/agilityjs)
27+
* [Agility.js on Google +](https://plus.google.com/116251025970928820842/posts)
28+
29+
_If you have other helpful links to share, or find any of the links above no longer work, please [let us know](https://github.com/tastejs/todomvc/issues)._
30+
31+
32+
## Credit
33+
This TodoMVC application was created by [tshm](https://github.com/tshm).

0 commit comments

Comments
 (0)