Commit 7bad15e6 authored by Ed Chatelain's avatar Ed Chatelain Committed by Sindre Sorhus

Close #1149 PR: Update the dojo example to use the new UI and npm..

parent 75fced04
bower_components
html-report
node_modules
out
js/lib/*
!js/lib/dojo
js/lib/dojo/*
!js/lib/dojo/dojo.js
node_modules/dijit/*
node_modules/dojo/*
node_modules/dojo-util/*
node_modules/util/*
node_modules/dojox/*
node_modules/intern/*
node_modules/.bin/*
node_modules/todomvc-app-css/*
!node_modules/todomvc-app-css/index.css
node_modules/todomvc-common/*
!node_modules/todomvc-common/base.css
!node_modules/todomvc-common/base.js
{
"name": "todomvc-dojo",
"dependencies": {
"todomvc-common": "~0.3.0"
},
"devDependencies": {
"dojo": "~1.10.0",
"dijit": "~1.10.0",
"dojox": "~1.10.0",
"util": "dojo/util#~1.10.0"
},
"private": true
}
......@@ -8,7 +8,8 @@
display: none;
}
</style>
<link rel="stylesheet" href="bower_components/todomvc-common/base.css">
<link rel="stylesheet" href="node_modules/todomvc-common/base.css">
<link rel="stylesheet" href="node_modules/todomvc-app-css/index.css">
</head>
<body>
<script type="dojo/require">
......@@ -74,10 +75,10 @@
</p>
<p>Part of <a href="http://todomvc.com">TodoMVC</a></p>
</footer>
<script src="bower_components/todomvc-common/base.js"></script>
<script src="node_modules/todomvc-common/base.js"></script>
<script src="js/main.js"></script>
<script src="js/lib/dojo/dojo.js"></script>
<!-- Use below instead of above line to use non-built version of Dojo components. -->
<!-- <script src="bower_components/dojo/dojo.js"></script> -->
<!-- <script src="node_modules/dojo/dojo.js"></script> -->
</body>
</html>
......@@ -11,15 +11,15 @@
packages: [
{
name: 'dojo',
location: './bower_components/dojo'
location: './node_modules/dojo'
},
{
name: 'dijit',
location: './bower_components/dijit'
location: './node_modules/dijit'
},
{
name: 'dojox',
location: './bower_components/dojox'
location: './node_modules/dojox'
},
{
name: 'todo',
......
hr {
margin: 20px 0;
border: 0;
border-top: 1px dashed #c5c5c5;
border-bottom: 1px dashed #f7f7f7;
}
.learn a {
font-weight: normal;
text-decoration: none;
color: #b83f45;
}
.learn a:hover {
text-decoration: underline;
color: #787e7e;
}
.learn h3,
.learn h4,
.learn h5 {
margin: 10px 0;
font-weight: 500;
line-height: 1.2;
color: #000;
}
.learn h3 {
font-size: 24px;
}
.learn h4 {
font-size: 18px;
}
.learn h5 {
margin-bottom: 0;
font-size: 14px;
}
.learn ul {
padding: 0;
margin: 0 0 30px 25px;
}
.learn li {
line-height: 20px;
}
.learn p {
font-size: 15px;
font-weight: 300;
line-height: 1.3;
margin-top: 0;
margin-bottom: 0;
}
#issue-count {
display: none;
}
.quote {
border: none;
margin: 20px 0 60px 0;
}
.quote p {
font-style: italic;
}
.quote p:before {
content: '“';
font-size: 50px;
opacity: .15;
position: absolute;
top: -20px;
left: 3px;
}
.quote p:after {
content: '”';
font-size: 50px;
opacity: .15;
position: absolute;
bottom: -42px;
right: 3px;
}
.quote footer {
position: absolute;
bottom: -40px;
right: 0;
}
.quote footer img {
border-radius: 3px;
}
.quote footer a {
margin-left: 5px;
vertical-align: middle;
}
.speech-bubble {
position: relative;
padding: 10px;
background: rgba(0, 0, 0, .04);
border-radius: 5px;
}
.speech-bubble:after {
content: '';
position: absolute;
top: 100%;
right: 30px;
border: 13px solid transparent;
border-top-color: rgba(0, 0, 0, .04);
}
.learn-bar > .learn {
position: absolute;
width: 272px;
top: 8px;
left: -300px;
padding: 10px;
border-radius: 5px;
background-color: rgba(255, 255, 255, .6);
transition-property: left;
transition-duration: 500ms;
}
@media (min-width: 899px) {
.learn-bar {
width: auto;
padding-left: 300px;
}
.learn-bar > .learn {
left: 8px;
}
}
/* global _ */
(function () {
'use strict';
/* jshint ignore:start */
// Underscore's Template Module
// Courtesy of underscorejs.org
var _ = (function (_) {
......@@ -114,6 +116,7 @@
if (location.hostname === 'todomvc.com') {
window._gaq = [['_setAccount','UA-31081062-1'],['_trackPageview']];(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];g.src='//www.google-analytics.com/ga.js';s.parentNode.insertBefore(g,s)}(document,'script'));
}
/* jshint ignore:end */
function redirect() {
if (location.hostname === 'tastejs.github.io') {
......@@ -175,13 +178,17 @@
if (learnJSON.backend) {
this.frameworkJSON = learnJSON.backend;
this.frameworkJSON.issueLabel = framework;
this.append({
backend: true
});
} else if (learnJSON[framework]) {
this.frameworkJSON = learnJSON[framework];
this.frameworkJSON.issueLabel = framework;
this.append();
}
this.fetchIssueCount();
}
Learn.prototype.append = function (opts) {
......@@ -212,6 +219,26 @@
document.body.insertAdjacentHTML('afterBegin', aside.outerHTML);
};
Learn.prototype.fetchIssueCount = function () {
var issueLink = document.getElementById('issue-count-link');
if (issueLink) {
var url = issueLink.href.replace('https://github.com', 'https://api.github.com/repos');
var xhr = new XMLHttpRequest();
xhr.open('GET', url, true);
xhr.onload = function (e) {
var parsedResponse = JSON.parse(e.target.responseText);
if (parsedResponse instanceof Array) {
var count = parsedResponse.length
if (count !== 0) {
issueLink.innerHTML = 'This app has ' + count + ' open issues';
document.getElementById('issue-count').style.display = 'inline';
}
}
};
xhr.send();
}
};
redirect();
getFile('learn.json', Learn);
})();
{
"private": true,
"dependencies": {
"todomvc-app-css": "^1.0.0",
"todomvc-common": "^1.0.1",
"dojo": "1.10.2",
"dijit": "git://github.com/dojo/dijit.git#1.10.2",
"dojox": "git://github.com/dojo/dojox.git#1.10.2",
"util": "git://github.com/dojo/util.git#1.10.2"
},
"devDependencies": {
"intern": "^2.2.2"
},
......
// Dojo build profile for TodoMVC.
// Usage:
// > cd /path/to/todomvc/examples/dojo
// > bower install
// > ./bower_components/util/buildscripts/build.sh --profile ./profiles/todomvc.profile.js --release
// > npm install
// > ./node_modules/dojo-util/buildscripts/build.sh --profile ./profiles/todomvc.profile.js --release
/*jshint unused:false*/
var profile = {
......@@ -20,15 +20,15 @@ var profile = {
packages: [
{
name: 'dojo',
location: '../bower_components/dojo'
location: '../node_modules/dojo'
},
{
name: 'dijit',
location: '../bower_components/dijit'
location: '../node_modules/dijit'
},
{
name: 'dojox',
location: '../bower_components/dojox'
location: '../node_modules/dojox'
}
],
......@@ -64,7 +64,7 @@ var profile = {
},
staticHasFeatures: {
'dojo-sync-loader': false,
'dojo-sync-loader': false
},
selectorEngine: 'lite',
......
......@@ -32,8 +32,9 @@ To do so, do the following. You need either java or node on your system to run t
```
cd /path/to/todomvc/examples/dojo
bower install
./bower_components/util/buildscripts/build.sh --profile ./profiles/todomvc.profile.js --release
npm install
mv ./node_modules/dojo-util ./node_modules/util
./node_modules/util/buildscripts/build.sh --profile ./profiles/todomvc.profile.js --release
```
......
......@@ -23,15 +23,15 @@ define((function (global) {
packages: [
{
name: 'dojo',
location: './bower_components/dojo'
location: './node_modules/dojo'
},
{
name: 'dijit',
location: './bower_components/dijit'
location: './node_modules/dijit'
},
{
name: 'dojox',
location: './bower_components/dojox'
location: './node_modules/dojox'
},
{
name: 'todo',
......@@ -54,7 +54,7 @@ define((function (global) {
useLoader: {
'host-node': 'dojo/dojo',
'host-browser': '../../bower_components/dojo/dojo.js'
'host-browser': '../../node_modules/dojo/dojo.js'
},
proxyPort: 9000,
......@@ -84,6 +84,6 @@ define((function (global) {
suites: ['test/all'],
excludeInstrumentation: /^(bower_components|node_modules|test)/
excludeInstrumentation: /^(node_modules|test)/
};
})(this));
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