Commit 63611db5 authored by Tianxiang Chen's avatar Tianxiang Chen

update riotjs website urls

parent 0117e01d
/*global riot, todoStorage */ /*global riot, todoStorage */
<todo> <todo>
<section id="todoapp"> <section class="todoapp">
<header id="header"> <header class="header">
<h1>todos</h1> <h1>todos</h1>
<input id="new-todo" autofocus autocomplete="off" placeholder="What needs to be done?" onkeyup={ addTodo }> <input class="new-todo" autofocus autocomplete="off" placeholder="What needs to be done?" onkeyup={ addTodo }>
</header> </header>
<section id="main" show={ todos.length }> <section class="main" show={ todos.length }>
<input id="toggle-all" type="checkbox" checked={ allDone } onclick={ toggleAll }> <input class="toggle-all" type="checkbox" checked={ allDone } onclick={ toggleAll }>
<ul id="todo-list"> <ul class="todo-list">
<li riot-tag="todoitem" class="todo { completed: t.completed, editing: t.editing }" <li riot-tag="todoitem" class="todo { completed: t.completed, editing: t.editing }"
each={ t, i in filteredTodos() } data={ t } parentview={ parent }></li> each={ t, i in filteredTodos() } todo={ t } parentview={ parent }></li>
</ul> </ul>
</section> </section>
<footer id="footer" show={ todos.length }> <footer class="footer" show={ todos.length }>
<span id="todo-count"> <span class="todo-count">
<strong>{ remaining }</strong> { remaining === 1 ? 'item' : 'items' } left <strong>{ remaining }</strong> { remaining === 1 ? 'item' : 'items' } left
</span> </span>
<ul id="filters"> <ul class="filters">
<li><a class={ selected: activeFilter=='all' } href="#/all">All</a></li> <li><a class={ selected: activeFilter=='all' } href="#/all">All</a></li>
<li><a class={ selected: activeFilter=='active' } href="#/active">Active</a></li> <li><a class={ selected: activeFilter=='active' } href="#/active">Active</a></li>
<li><a class={ selected: activeFilter=='completed' } href="#/completed">Completed</a></li> <li><a class={ selected: activeFilter=='completed' } href="#/completed">Completed</a></li>
</ul> </ul>
<button id="clear-completed" onclick={ removeCompleted } show={ todos.length > remaining }> <button class="clear-completed" onclick={ removeCompleted } show={ todos.length > remaining }>
Clear completed</button> Clear completed</button>
</footer> </footer>
</section> </section>
<footer id="info"> <footer class="info">
<p>Double-click to edit a todo</p> <p>Double-click to edit a todo</p>
<p>Written by <a href="http://github.com/txchen">Tianxiang Chen</a></p> <p>Written by <a href="http://github.com/txchen">Tianxiang Chen</a></p>
<p>Part of <a href="http://todomvc.com">TodoMVC</a></p> <p>Part of <a href="http://todomvc.com">TodoMVC</a></p>
...@@ -110,8 +110,8 @@ ...@@ -110,8 +110,8 @@
<todoitem> <todoitem>
<div class="view"> <div class="view">
<input class="toggle" type="checkbox" checked={ todo.completed } onclick={ toggleTodo }> <input class="toggle" type="checkbox" checked={ opts.todo.completed } onclick={ toggleTodo }>
<label ondblclick={ editTodo }>{ todo.title }</label> <label ondblclick={ editTodo }>{ opts.todo.title }</label>
<button class="destroy" onclick={ removeTodo }></button> <button class="destroy" onclick={ removeTodo }></button>
</div> </div>
<input name="todoeditbox" class="edit" type="text" onblur={ doneEdit } onkeyup={ editKeyUp }> <input name="todoeditbox" class="edit" type="text" onblur={ doneEdit } onkeyup={ editKeyUp }>
...@@ -121,31 +121,32 @@ ...@@ -121,31 +121,32 @@
var ENTER_KEY = 13; var ENTER_KEY = 13;
var ESC_KEY = 27; var ESC_KEY = 27;
var self = this; var self = this;
self.todo = opts.data; opts.todo.editing = false;
self.parentview = opts.parentview;
self.todo.editing = false;
toggleTodo() { toggleTodo() {
self.todo.completed = !self.todo.completed; opts.todo.completed = !opts.todo.completed;
self.parentview.saveTodos(); opts.parentview.saveTodos();
return true; return true;
}; };
editTodo() { editTodo() {
self.todo.editing = true; opts.todo.editing = true;
self.todoeditbox.value = self.todo.title; self.todoeditbox.value = opts.todo.title;
}; };
removeTodo() { removeTodo() {
self.parentview.removeTodo(self.todo); opts.parentview.removeTodo(opts.todo);
}; };
doneEdit() { doneEdit() {
self.todo.editing = false; if (!opts.todo.editing) {
return;
}
opts.todo.editing = false;
var enteredText = self.todoeditbox.value && self.todoeditbox.value.trim(); var enteredText = self.todoeditbox.value && self.todoeditbox.value.trim();
if (enteredText) { if (enteredText) {
self.todo.title = enteredText; opts.todo.title = enteredText;
self.parentview.saveTodos(); opts.parentview.saveTodos();
} else { } else {
self.removeTodo(); self.removeTodo();
} }
...@@ -155,14 +156,14 @@ ...@@ -155,14 +156,14 @@
if (e.which === ENTER_KEY) { if (e.which === ENTER_KEY) {
self.doneEdit(); self.doneEdit();
} else if (e.which === ESC_KEY) { } else if (e.which === ESC_KEY) {
self.todoeditbox.value = self.todo.title; self.todoeditbox.value = opts.todo.title;
self.doneEdit(); self.doneEdit();
} }
}; };
self.on('update', function() { self.on('update', function() {
if (self.todo.editing) { if (opts.todo.editing) {
self.parentview.update(); opts.parentview.update();
self.todoeditbox.focus(); self.todoeditbox.focus();
} }
}); });
......
...@@ -44,7 +44,7 @@ input[type="checkbox"] { ...@@ -44,7 +44,7 @@ input[type="checkbox"] {
display: none; display: none;
} }
#todoapp { .todoapp {
background: #fff; background: #fff;
margin: 130px 0 40px 0; margin: 130px 0 40px 0;
position: relative; position: relative;
...@@ -52,25 +52,25 @@ input[type="checkbox"] { ...@@ -52,25 +52,25 @@ input[type="checkbox"] {
0 25px 50px 0 rgba(0, 0, 0, 0.1); 0 25px 50px 0 rgba(0, 0, 0, 0.1);
} }
#todoapp input::-webkit-input-placeholder { .todoapp input::-webkit-input-placeholder {
font-style: italic; font-style: italic;
font-weight: 300; font-weight: 300;
color: #e6e6e6; color: #e6e6e6;
} }
#todoapp input::-moz-placeholder { .todoapp input::-moz-placeholder {
font-style: italic; font-style: italic;
font-weight: 300; font-weight: 300;
color: #e6e6e6; color: #e6e6e6;
} }
#todoapp input::input-placeholder { .todoapp input::input-placeholder {
font-style: italic; font-style: italic;
font-weight: 300; font-weight: 300;
color: #e6e6e6; color: #e6e6e6;
} }
#todoapp h1 { .todoapp h1 {
position: absolute; position: absolute;
top: -155px; top: -155px;
width: 100%; width: 100%;
...@@ -83,7 +83,7 @@ input[type="checkbox"] { ...@@ -83,7 +83,7 @@ input[type="checkbox"] {
text-rendering: optimizeLegibility; text-rendering: optimizeLegibility;
} }
#new-todo, .new-todo,
.edit { .edit {
position: relative; position: relative;
margin: 0; margin: 0;
...@@ -104,14 +104,14 @@ input[type="checkbox"] { ...@@ -104,14 +104,14 @@ input[type="checkbox"] {
font-smoothing: antialiased; font-smoothing: antialiased;
} }
#new-todo { .new-todo {
padding: 16px 16px 16px 60px; padding: 16px 16px 16px 60px;
border: none; border: none;
background: rgba(0, 0, 0, 0.003); background: rgba(0, 0, 0, 0.003);
box-shadow: inset 0 -2px 1px rgba(0,0,0,0.03); box-shadow: inset 0 -2px 1px rgba(0,0,0,0.03);
} }
#main { .main {
position: relative; position: relative;
z-index: 2; z-index: 2;
border-top: 1px solid #e6e6e6; border-top: 1px solid #e6e6e6;
...@@ -121,7 +121,7 @@ label[for='toggle-all'] { ...@@ -121,7 +121,7 @@ label[for='toggle-all'] {
display: none; display: none;
} }
#toggle-all { .toggle-all {
position: absolute; position: absolute;
top: -55px; top: -55px;
left: -12px; left: -12px;
...@@ -131,50 +131,50 @@ label[for='toggle-all'] { ...@@ -131,50 +131,50 @@ label[for='toggle-all'] {
border: none; /* Mobile Safari */ border: none; /* Mobile Safari */
} }
#toggle-all:before { .toggle-all:before {
content: '❯'; content: '❯';
font-size: 22px; font-size: 22px;
color: #e6e6e6; color: #e6e6e6;
padding: 10px 27px 10px 27px; padding: 10px 27px 10px 27px;
} }
#toggle-all:checked:before { .toggle-all:checked:before {
color: #737373; color: #737373;
} }
#todo-list { .todo-list {
margin: 0; margin: 0;
padding: 0; padding: 0;
list-style: none; list-style: none;
} }
#todo-list li { .todo-list li {
position: relative; position: relative;
font-size: 24px; font-size: 24px;
border-bottom: 1px solid #ededed; border-bottom: 1px solid #ededed;
} }
#todo-list li:last-child { .todo-list li:last-child {
border-bottom: none; border-bottom: none;
} }
#todo-list li.editing { .todo-list li.editing {
border-bottom: none; border-bottom: none;
padding: 0; padding: 0;
} }
#todo-list li.editing .edit { .todo-list li.editing .edit {
display: block; display: block;
width: 506px; width: 506px;
padding: 13px 17px 12px 17px; padding: 13px 17px 12px 17px;
margin: 0 0 0 43px; margin: 0 0 0 43px;
} }
#todo-list li.editing .view { .todo-list li.editing .view {
display: none; display: none;
} }
#todo-list li .toggle { .todo-list li .toggle {
text-align: center; text-align: center;
width: 40px; width: 40px;
/* auto, since non-WebKit browsers doesn't support input styling */ /* auto, since non-WebKit browsers doesn't support input styling */
...@@ -188,15 +188,15 @@ label[for='toggle-all'] { ...@@ -188,15 +188,15 @@ label[for='toggle-all'] {
appearance: none; appearance: none;
} }
#todo-list li .toggle:after { .todo-list li .toggle:after {
content: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="-10 -18 100 135"><circle cx="50" cy="50" r="50" fill="none" stroke="#ededed" stroke-width="3"/></svg>'); content: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="-10 -18 100 135"><circle cx="50" cy="50" r="50" fill="none" stroke="#ededed" stroke-width="3"/></svg>');
} }
#todo-list li .toggle:checked:after { .todo-list li .toggle:checked:after {
content: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="-10 -18 100 135"><circle cx="50" cy="50" r="50" fill="none" stroke="#bddad5" stroke-width="3"/><path fill="#5dc2af" d="M72 25L42 71 27 56l-4 4 20 20 34-52z"/></svg>'); content: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="-10 -18 100 135"><circle cx="50" cy="50" r="50" fill="none" stroke="#bddad5" stroke-width="3"/><path fill="#5dc2af" d="M72 25L42 71 27 56l-4 4 20 20 34-52z"/></svg>');
} }
#todo-list li label { .todo-list li label {
white-space: pre; white-space: pre;
word-break: break-word; word-break: break-word;
padding: 15px 60px 15px 15px; padding: 15px 60px 15px 15px;
...@@ -206,12 +206,12 @@ label[for='toggle-all'] { ...@@ -206,12 +206,12 @@ label[for='toggle-all'] {
transition: color 0.4s; transition: color 0.4s;
} }
#todo-list li.completed label { .todo-list li.completed label {
color: #d9d9d9; color: #d9d9d9;
text-decoration: line-through; text-decoration: line-through;
} }
#todo-list li .destroy { .todo-list li .destroy {
display: none; display: none;
position: absolute; position: absolute;
top: 0; top: 0;
...@@ -226,27 +226,27 @@ label[for='toggle-all'] { ...@@ -226,27 +226,27 @@ label[for='toggle-all'] {
transition: color 0.2s ease-out; transition: color 0.2s ease-out;
} }
#todo-list li .destroy:hover { .todo-list li .destroy:hover {
color: #af5b5e; color: #af5b5e;
} }
#todo-list li .destroy:after { .todo-list li .destroy:after {
content: '×'; content: '×';
} }
#todo-list li:hover .destroy { .todo-list li:hover .destroy {
display: block; display: block;
} }
#todo-list li .edit { .todo-list li .edit {
display: none; display: none;
} }
#todo-list li.editing:last-child { .todo-list li.editing:last-child {
margin-bottom: -1px; margin-bottom: -1px;
} }
#footer { .footer {
color: #777; color: #777;
padding: 10px 15px; padding: 10px 15px;
height: 20px; height: 20px;
...@@ -254,7 +254,7 @@ label[for='toggle-all'] { ...@@ -254,7 +254,7 @@ label[for='toggle-all'] {
border-top: 1px solid #e6e6e6; border-top: 1px solid #e6e6e6;
} }
#footer:before { .footer:before {
content: ''; content: '';
position: absolute; position: absolute;
right: 0; right: 0;
...@@ -269,16 +269,16 @@ label[for='toggle-all'] { ...@@ -269,16 +269,16 @@ label[for='toggle-all'] {
0 17px 2px -6px rgba(0, 0, 0, 0.2); 0 17px 2px -6px rgba(0, 0, 0, 0.2);
} }
#todo-count { .todo-count {
float: left; float: left;
text-align: left; text-align: left;
} }
#todo-count strong { .todo-count strong {
font-weight: 300; font-weight: 300;
} }
#filters { .filters {
margin: 0; margin: 0;
padding: 0; padding: 0;
list-style: none; list-style: none;
...@@ -287,11 +287,11 @@ label[for='toggle-all'] { ...@@ -287,11 +287,11 @@ label[for='toggle-all'] {
left: 0; left: 0;
} }
#filters li { .filters li {
display: inline; display: inline;
} }
#filters li a { .filters li a {
color: inherit; color: inherit;
margin: 3px; margin: 3px;
padding: 3px 7px; padding: 3px 7px;
...@@ -300,17 +300,17 @@ label[for='toggle-all'] { ...@@ -300,17 +300,17 @@ label[for='toggle-all'] {
border-radius: 3px; border-radius: 3px;
} }
#filters li a.selected, .filters li a.selected,
#filters li a:hover { .filters li a:hover {
border-color: rgba(175, 47, 47, 0.1); border-color: rgba(175, 47, 47, 0.1);
} }
#filters li a.selected { .filters li a.selected {
border-color: rgba(175, 47, 47, 0.2); border-color: rgba(175, 47, 47, 0.2);
} }
#clear-completed, .clear-completed,
html #clear-completed:active { html .clear-completed:active {
float: right; float: right;
position: relative; position: relative;
line-height: 20px; line-height: 20px;
...@@ -319,11 +319,11 @@ html #clear-completed:active { ...@@ -319,11 +319,11 @@ html #clear-completed:active {
position: relative; position: relative;
} }
#clear-completed:hover { .clear-completed:hover {
text-decoration: underline; text-decoration: underline;
} }
#info { .info {
margin: 65px auto 0; margin: 65px auto 0;
color: #bfbfbf; color: #bfbfbf;
font-size: 10px; font-size: 10px;
...@@ -331,17 +331,17 @@ html #clear-completed:active { ...@@ -331,17 +331,17 @@ html #clear-completed:active {
text-align: center; text-align: center;
} }
#info p { .info p {
line-height: 1; line-height: 1;
} }
#info a { .info a {
color: inherit; color: inherit;
text-decoration: none; text-decoration: none;
font-weight: 400; font-weight: 400;
} }
#info a:hover { .info a:hover {
text-decoration: underline; text-decoration: underline;
} }
...@@ -350,16 +350,16 @@ html #clear-completed:active { ...@@ -350,16 +350,16 @@ html #clear-completed:active {
Can't use it globally since it destroys checkboxes in Firefox Can't use it globally since it destroys checkboxes in Firefox
*/ */
@media screen and (-webkit-min-device-pixel-ratio:0) { @media screen and (-webkit-min-device-pixel-ratio:0) {
#toggle-all, .toggle-all,
#todo-list li .toggle { .todo-list li .toggle {
background: none; background: none;
} }
#todo-list li .toggle { .todo-list li .toggle {
height: 40px; height: 40px;
} }
#toggle-all { .toggle-all {
-webkit-transform: rotate(90deg); -webkit-transform: rotate(90deg);
transform: rotate(90deg); transform: rotate(90deg);
-webkit-appearance: none; -webkit-appearance: none;
...@@ -368,11 +368,11 @@ html #clear-completed:active { ...@@ -368,11 +368,11 @@ html #clear-completed:active {
} }
@media (max-width: 430px) { @media (max-width: 430px) {
#footer { .footer {
height: 50px; height: 50px;
} }
#filters { .filters {
bottom: 10px; bottom: 10px;
} }
} }
{ {
"private": true, "private": true,
"dependencies": { "dependencies": {
"todomvc-app-css": "^1.0.1", "todomvc-app-css": "^2.0.0",
"todomvc-common": "^1.0.1", "todomvc-common": "^1.0.1",
"riot": "^2.1.0" "riot": "^2.2.4"
} }
} }
# Riot.js TodoMVC Example # Riot.js TodoMVC Example
> Riot.js is a React-like, 3.5KB user interface library. > Riot.js is a React-like user interface micro-library.
> Riot is against the current trend of boilerplate and unneeded complexity. The team think that a small, powerful API and concise syntax are extremely important things on a client-side library. > Riot is against the current trend of boilerplate and unneeded complexity. The team think that a small, powerful API and concise syntax are extremely important things on a client-side library.
> _[Riot.js - muut.com/riotjs](https://muut.com/riotjs/)_ > _[Riot.js - riotjs.com](http://riotjs.com/)_
## Resources ## Resources
- [Website](https://muut.com/riotjs/) - [Website](http://riotjs.com/)
- [Documentation](https://muut.com/riotjs/guide/) - [Documentation](http://riotjs.com/guide/)
- [FAQ](https://muut.com/riotjs/faq.html) - [FAQ](http://riotjs.com/faq/)
### Articles ### Articles
- [Compare Riot with React and Polymer](https://muut.com/riotjs/compare.html) - [Compare Riot with React and Polymer](http://riotjs.com/compare/)
- [The react tutorial for riot](https://juriansluiman.nl/article/154/the-react-tutorial-for-riot) - [The react tutorial for riot](https://juriansluiman.nl/article/154/the-react-tutorial-for-riot)
### Support ### Support
- [Forum](https://muut.com/riotjs/forum/) - [Gitter chat room](https://gitter.im/riot/riot)
*Let us [know](https://github.com/tastejs/todomvc/issues) if you discover anything worth sharing.* *Let us [know](https://github.com/tastejs/todomvc/issues) if you discover anything worth sharing.*
...@@ -29,7 +29,7 @@ Riot is tiny and super flexible, there are many different ways to use riot. For ...@@ -29,7 +29,7 @@ Riot is tiny and super flexible, there are many different ways to use riot. For
This example is using compiler on the page to compile the tag file(js/todo.html). This example is using compiler on the page to compile the tag file(js/todo.html).
This example is following TodoMvc's [coding style](https://github.com/tastejs/todomvc/blob/master/codestyle.md), however officially Riot recommend [different coding style](https://github.com/muut/riotjs/blob/master/CONTRIBUTING.md), FYI. This example is following TodoMvc's [coding style](https://github.com/tastejs/todomvc/blob/master/codestyle.md), however officially Riot recommend [different coding style](https://github.com/riot/riot/blob/master/CONTRIBUTING.md), FYI.
## Credit ## Credit
......
...@@ -279,7 +279,7 @@ ...@@ -279,7 +279,7 @@
<a href="examples/angular2/" data-source="http://angular.io" data-content="Angular is a development platform for building mobile and desktop web applications">Angular 2.0</a> <a href="examples/angular2/" data-source="http://angular.io" data-content="Angular is a development platform for building mobile and desktop web applications">Angular 2.0</a>
</li> </li>
<li class="routing"> <li class="routing">
<a href="examples/riotjs/" data-source="https://muut.com/riotjs/" data-content="Riot.js is a React-like, 3.5KB user interface library.">Riot</a> <a href="examples/riotjs/" data-source="http://riotjs.com/" data-content="Riot.js is a React-like user interface micro-library.">Riot</a>
</li> </li>
</ul> </ul>
</div> </div>
......
...@@ -1855,8 +1855,8 @@ ...@@ -1855,8 +1855,8 @@
}, },
"riotjs": { "riotjs": {
"name": "Riot.js", "name": "Riot.js",
"description": "Riot.js is a React-like, 3.5KB user interface library.", "description": "Riot.js is a React-like user interface micro-library.",
"homepage": "muut.com/riotjs", "homepage": "http://riotjs.com/",
"examples": [{ "examples": [{
"name": "Example", "name": "Example",
"url": "examples/riotjs" "url": "examples/riotjs"
...@@ -1865,22 +1865,22 @@ ...@@ -1865,22 +1865,22 @@
"heading": "Official Resources", "heading": "Official Resources",
"links": [{ "links": [{
"name": "Documentation", "name": "Documentation",
"url": "https://muut.com/riotjs/guide/" "url": "http://riotjs.com/guide/"
}, { }, {
"name": "API Reference", "name": "API Reference",
"url": "https://muut.com/riotjs/api/" "url": "http://riotjs.com/api/"
}, { }, {
"name": "Examples", "name": "Examples",
"url": "https://github.com/muut/riotjs#demos" "url": "https://github.com/riot/riot#demos"
}, { }, {
"name": "Riot.js on GitHub", "name": "Riot.js on GitHub",
"url": "https://github.com/muut/riotjs" "url": "https://github.com/riot/riot"
}] }]
}, { }, {
"heading": "Community", "heading": "Community",
"links": [{ "links": [{
"name": "Forum", "name": "Gitter chat room",
"url": "https://muut.com/riotjs/forum/" "url": "https://gitter.im/riot/riot"
}] }]
}] }]
}, },
......
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