Commit e27e0f48 authored by Pascal Hartig's avatar Pascal Hartig

Dojo: Whitespace and README update

Fixed one rendering bug and replaced spaces with tabs consistently.
parent 87d90ac8
<!doctype html>
<!--
This is a Dojo version of TodoMVC using uncompressed Dojo source.
To use this, place todomvc directory at the directory containing dojo/dijit/dojox.
-->
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Dojo • TodoMVC</title>
<link rel="stylesheet" href="../../assets/base.css">
<!-- CSS overrides - remove if you don't need it -->
<link rel="stylesheet" href="css/app.css">
<!--[if IE]>
<script>
nativeDate = Date;
</script>
<script src="../../assets/ie.js"></script>
<script>
(function(nativeDate){
// It appears that the modification to Date constructor done by ie.js negatively affects new Date("X"), ending up a JS error.
// Using the native Date constructor for that case.
var origDate = Date;
Date = function(){
return (arguments.length == 1 && typeof arguments[0] == "string" ? nativeDate : origDate).apply(this, [].slice.call(arguments, 0));
};
Date.prototype = new origDate();
})(nativeDate);
</script>
<![endif]-->
</head>
<body>
<section id="todoapp" data-dojo-type="todo/app18"></section>
<footer id="info">
<p>Double-click to edit a todo</p>
<p>Created by <a href="http://jamesthom.as/">James Thomas</a> and <a href="https://github.com/edchat">Ed Chatelain</a></p>
<p>Part of <a href="http://todomvc.com">TodoMVC</a></p>
</footer>
<script src="../../assets/base.js"></script>
<script>
require = {
async: true,
parseOnLoad: true,
locale: "en",
paths: {
"todo": "../todomvc/architecture-examples/dojo/js/todo"
},
deps: ["dojo/parser", "dojo/domReady!"],
mvc: {debugBindings: true}
};
</script>
<script src="../../../dojo/dojo.js"></script>
</body>
</html>
<section> <section>
<header id="header"> <header id="header">
<h1>todos</h1> <h1>todos</h1>
<input id="new-todo" data-dojo-attach-event="onkeypress:onKeyPress" placeholder="What needs to be done?" type="text" autofocus> <input id="new-todo" data-dojo-attach-event="onkeypress:onKeyPress" placeholder="What needs to be done?" type="text" autofocus>
<span class="ui-tooltip-top" style="display:none;">Press Enter to save this task</span> <span class="ui-tooltip-top" style="display:none;">Press Enter to save this task</span>
</header> </header>
<section id="main"> <section id="main">
<input id="toggle-all" data-dojo-attach-point="mark_all" data-dojo-attach-event="onclick:onMarkAll" type="checkbox"> <input id="toggle-all" data-dojo-attach-point="mark_all" data-dojo-attach-event="onclick:onMarkAll" type="checkbox">
<label for="toggle-all">Mark all as complete</label> <label for="toggle-all">Mark all as complete</label>
<ul id="todo-list" data-dojo-attach-point="todo_list" data-dojo-type="dojox.mvc.Repeat" data-dojo-props="ref: this.model.todos, exprchar: '#'"> <ul id="todo-list" data-dojo-attach-point="todo_list" data-dojo-type="dojox.mvc.Repeat" data-dojo-props="ref: this.model.todos, exprchar: '#'">
<li data-dojo-type="dojox.mvc.Group" data-dojo-props="ref: '#{this.index}'"> <li data-dojo-type="dojox.mvc.Group" data-dojo-props="ref: '#{this.index}'">
<div class="view"> <div class="view">
<label class="dijitInline inline_edit" data-dojo-type="todo.form.InlineEditBox" <label class="dijitInline inline_edit" data-dojo-type="todo.form.InlineEditBox"
data-dojo-props='ref: "title", editor:"dijit.form.TextBox", autosave:true'></label> data-dojo-props='ref: "title", editor:"dijit.form.TextBox", autosave:true'></label>
<input class="toggle" type="checkbox" data-dojo-type="todo.form.CheckBox" data-dojo-props='ref: "completed"'> <input class="toggle" type="checkbox" data-dojo-type="todo.form.CheckBox" data-dojo-props='ref: "completed"'>
<button class="destroy" data-model-id="#{this.index}"> <button class="destroy" data-model-id="#{this.index}">
</button> </button>
</div> </div>
</li> </li>
</ul> </ul>
</section> </section>
<footer id="footer" data-dojo-attach-point="todo_stats"> <footer id="footer" data-dojo-attach-point="todo_stats">
<span id="todo-count"> <span id="todo-count">
<strong> <strong>
<span data-dojo-type="dojox.mvc.Output" data-dojo-props="ref: this.model.incomplete" class="number"></span> <span data-dojo-type="dojox.mvc.Output" data-dojo-props="ref: this.model.incomplete" class="number"></span>
</strong> </strong>
<span class="word">item<span class="plural">s</span></span> left <span class="word">item<span class="plural">s</span></span> left
</span> </span>
<!-- Remove this if you don't implement routing --> <ul id="filters">
<ul id="filters"> <li>
<li> <a class="selected" href="#/">All</a>
<a class="selected" href="#/">All</a> </li>
</li> <li>
<li> <a href="#/active">Active</a>
<a href="#/active">Active</a> </li>
</li> <li>
<li> <a href="#/completed">Completed</a>
<a href="#/completed">Completed</a> </li>
</li> </ul>
</ul> <button id="clear-completed" data-dojo-attach-event="onclick:removeCompletedItems">
<button id="clear-completed" data-dojo-attach-event="onclick:removeCompletedItems"> Clear completed (<span class="number-done" data-dojo-type="dojox.mvc.Output" data-dojo-props="ref: this.model.complete"></span>)
Clear completed ( </button>
<span class="number-done" data-dojo-type="dojox.mvc.Output" data-dojo-props="ref: this.model.complete" ></span> </footer>
)
</button>
</footer>
</section> </section>
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<input id="toggle-all" type="checkbox" <input id="toggle-all" type="checkbox"
data-dojo-type="dijit/form/CheckBox" data-dojo-type="dijit/form/CheckBox"
data-dojo-props="checked: at(${id}_ctrl, 'incomplete').transform(LessThanOrEqualToConverter), data-dojo-props="checked: at(${id}_ctrl, 'incomplete').transform(LessThanOrEqualToConverter),
onClick: function(e){ ${id}_listCtrl.markAll(e.target.checked); }"> onClick: function(e){ ${id}_listCtrl.markAll(e.target.checked); }">
<label for="toggle-all">Mark all as complete</label> <label for="toggle-all">Mark all as complete</label>
<ul id="todo-list" <ul id="todo-list"
data-dojo-type="todo/TodoList" data-dojo-type="todo/TodoList"
...@@ -56,37 +56,36 @@ ...@@ -56,37 +56,36 @@
<span class="word">item<!-- <span class="word">item<!--
--><span data-dojo-type="todo/CssToggleWidget" --><span data-dojo-type="todo/CssToggleWidget"
data-dojo-props="_setSingleAttr: {type: 'classExists', className: 'plural'}, data-dojo-props="_setSingleAttr: {type: 'classExists', className: 'plural'},
constraints: {lessThanOrEqualTo: 1}, constraints: {lessThanOrEqualTo: 1},
single: at(${id}_ctrl, 'incomplete').transform(LessThanOrEqualToConverter)">s</span></span> single: at(${id}_ctrl, 'incomplete').transform(LessThanOrEqualToConverter)">s</span></span>
left left
</span> </span>
<!-- Remove this if you don't implement routing -->
<ul id="filters"> <ul id="filters">
<li> <li>
<a href="#/" <a href="#/"
data-dojo-type="todo/CssToggleWidget" data-dojo-type="todo/CssToggleWidget"
data-dojo-props="_setSelectedAttr: {type: 'classExists', className: 'selected'}, data-dojo-props="_setSelectedAttr: {type: 'classExists', className: 'selected'},
selected: at(${id}_routeCtl, 'hash').transform(HashSelectedConverter)">All</a> selected: at(${id}_routeCtl, 'hash').transform(HashSelectedConverter)">All</a>
</li> </li>
<li> <li>
<a href="#/active" <a href="#/active"
data-dojo-type="todo/CssToggleWidget" data-dojo-type="todo/CssToggleWidget"
data-dojo-props="_setSelectedAttr: {type: 'classExists', className: 'selected'}, data-dojo-props="_setSelectedAttr: {type: 'classExists', className: 'selected'},
selected: at(${id}_routeCtl, 'hash').transform(HashSelectedConverter)">Active</a> selected: at(${id}_routeCtl, 'hash').transform(HashSelectedConverter)">Active</a>
</li> </li>
<li> <li>
<a href="#/completed" <a href="#/completed"
data-dojo-type="todo/CssToggleWidget" data-dojo-type="todo/CssToggleWidget"
data-dojo-props="_setSelectedAttr: {type: 'classExists', className: 'selected'}, data-dojo-props="_setSelectedAttr: {type: 'classExists', className: 'selected'},
selected: at(${id}_routeCtl, 'hash').transform(HashSelectedConverter)">Completed</a> selected: at(${id}_routeCtl, 'hash').transform(HashSelectedConverter)">Completed</a>
</li> </li>
</ul> </ul>
<button id="clear-completed" onclick="${id}_listCtrl.removeCompletedItems();"> <button id="clear-completed" onclick="${id}_listCtrl.removeCompletedItems();">
Clear completed ( Clear completed (<!--
<span class="number-done" --><span class="number-done"
data-dojo-type="dijit/_WidgetBase" data-dojo-type="dijit/_WidgetBase"
data-dojo-props="_setValueAttr: {type: 'innerText', node: 'domNode'}, value: at(${id}_ctrl, 'complete')"></span> data-dojo-props="_setValueAttr: {type: 'innerText', node:
) 'domNode'}, value: at(${id}_ctrl, 'complete')"></span><!--
</button> -->)</button>
</footer> </footer>
</section> </section>
// This is a build profile for Dojo version of TodoMVC. // This is a build profile for Dojo version of TodoMVC.
// To use this, place todomvc directory at the directory containing dojo/dijit/dojox/util (and follow the procedure of building Dojo).
// Refer to todomvc/architecture-examples/dojo/js/lib/dojo-1.8 and todomvc/architecture-examples/dojo/js/lib/dijit-1.8 to see what built files need to be copied.
dependencies = { dependencies = {
stripConsole: "normal", stripConsole: "normal",
......
# Dojo TodoMVC app # Dojo TodoMVC app
## Notes ## Building
Developers often ask what the difference is between Dojo 1.7+ and Require.js, which also supports the use of [AMD](https://github.com/amdjs/amdjs-api/wiki/AMD) modules. To build the Dojo app, you first need to download and extract the [Dojo SDK](https://dojotoolkit.org/download/#sdk).
At the root folder of the extracted SDK, copy or symlink the complete `todomvc`
folder, so your directory structure looks like this:
Require.js is a loader which implements AMD and may be used with various toolkits.There are some other AMD implementations like curl.js. dojo-release/
├── dijit
├── dojo
├── dojox
├── todomvc
└── util
Dojo is a toolkit which has been converted to use AMD and ships with an implementation of an AMD loader and optimization tools. As such, you do not need to use Require.js in order to write AMD modules using Dojo. Enter the `dojo-release/util` folder and run these commands to build the
`dojo.js` file including all required resources and copy it back into the
todomvc folder. You need either java or node on your system to run these:
buildscripts/build.sh --profile ../todomvc/architecture-examples/dojo/profiles/todomvc.profile.js -r
cp ../release/dojo/dojo/dojo.js ../todomvc/architecture-examples/dojo/js/lib/dojo-1.8/dojo.js
After a new release of Dojo, you may need to copy more files for this to work.
Check out the `js/lib/` folder for other files that are required from the
build.
You can now open the app in your browser.
## AMD Notes
Developers often ask what the difference is between Dojo 1.7+ and Require.js, which also supports the use of [AMD](https://github.com/amdjs/amdjs-api/wiki/AMD) modules.
Require.js is a loader which implements AMD and may be used with various toolkits. There are some other AMD implementations like curl.js.
Dojo is a toolkit which has been converted to use AMD and ships with an implementation of an AMD loader and optimization tools. As such, you do not need to use Require.js in order to write AMD modules using Dojo.
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