Skip to content

Commit

Permalink
converted indentation to tabs across js and html
Browse files Browse the repository at this point in the history
  • Loading branch information
abhinavgujjar committed Aug 9, 2013
1 parent 50fe848 commit c32cd03
Show file tree
Hide file tree
Showing 10 changed files with 277 additions and 277 deletions.
20 changes: 10 additions & 10 deletions labs/dependency-examples/durandal/bower.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "todomvc-durandal",
"version": "0.0.0",
"dependencies": {
"durandal": "~1.2.0",
"sammy": "~0.7.4",
"jquery": "~1.9.1",
"knockout": "~2.2.1",
"todomvc-common": "~0.1.4",
"requirejs": "~2.1.6"
}
"name": "todomvc-durandal",
"version": "0.0.0",
"dependencies": {
"durandal": "~1.2.0",
"sammy": "~0.7.4",
"jquery": "~1.9.1",
"knockout": "~2.2.1",
"todomvc-common": "~0.1.4",
"requirejs": "~2.1.6"
}
}
22 changes: 11 additions & 11 deletions labs/dependency-examples/durandal/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,22 @@
<meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible">
<title>Durandal • TodoMVC</title>
<link rel="stylesheet" href="bower_components/todomvc-common/base.css">
<link rel="stylesheet" href="css/durandal.css" />
<link rel="stylesheet" href="css/app.css" />
<link rel="stylesheet" href="css/durandal.css">
<link rel="stylesheet" href="css/app.css">
</head>
<body>
<div id="applicationHost">
<div class="splash">
<div class="message">
Durandal ToDo MVC loading...
</div>
</div>
</div>
<div class="splash">
<div class="message">
Durandal ToDo MVC loading...
</div>
</div>
</div>

<script src="bower_components/todomvc-common/base.js"></script>
<script src="bower_components/jquery/jquery.js"></script>
<script src="bower_components/knockout/knockout.js"></script>
<script src="bower_components/sammy/sammy.js"></script>
<script src="bower_components/requirejs/require.js" data-main="../durandal/js/main.js"></script>
<script src="bower_components/knockout/knockout.js"></script>
<script src="bower_components/sammy/sammy.js"></script>
<script src="bower_components/requirejs/require.js" data-main="../durandal/js/main.js"></script>
</body>
</html>
110 changes: 55 additions & 55 deletions labs/dependency-examples/durandal/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,81 +2,81 @@
'use strict';

requirejs.config({
paths: {
'text': 'bower_components/durandal/amd/text'
},
baseUrl: './'
paths: {
'text': 'bower_components/durandal/amd/text'
},
baseUrl: './'
});

var ENTER_KEY = 13;

// a custom binding to handle the enter key (could go in a separate library)
ko.bindingHandlers.enterKey = {
init: function (element, valueAccessor, allBindingsAccessor, data) {
var wrappedHandler, newValueAccessor;
init: function (element, valueAccessor, allBindingsAccessor, data) {
var wrappedHandler, newValueAccessor;

// wrap the handler with a check for the enter key
wrappedHandler = function (data, event) {
if (event.keyCode === ENTER_KEY) {
valueAccessor().call(this, data, event);
}
};
// wrap the handler with a check for the enter key
wrappedHandler = function (data, event) {
if (event.keyCode === ENTER_KEY) {
valueAccessor().call(this, data, event);
}
};

// create a valueAccessor with the options that we would want to pass to the event binding
newValueAccessor = function () {
return {
keyup: wrappedHandler
};
};
// create a valueAccessor with the options that we would want to pass to the event binding
newValueAccessor = function () {
return {
keyup: wrappedHandler
};
};

// call the real event binding's init function
ko.bindingHandlers.event.init(element, newValueAccessor, allBindingsAccessor, data);
}
// call the real event binding's init function
ko.bindingHandlers.event.init(element, newValueAccessor, allBindingsAccessor, data);
}
};

// wrapper to hasfocus that also selects text and applies focus async
ko.bindingHandlers.selectAndFocus = {
init: function (element, valueAccessor, allBindingsAccessor) {
ko.bindingHandlers.hasfocus.init(element, valueAccessor, allBindingsAccessor);
ko.utils.registerEventHandler(element, 'focus', function () {
element.focus();
});
},
update: function (element, valueAccessor) {
ko.utils.unwrapObservable(valueAccessor()); // for dependency
// ensure that element is visible before trying to focus
setTimeout(function () {
ko.bindingHandlers.hasfocus.update(element, valueAccessor);
}, 0);
}
init: function (element, valueAccessor, allBindingsAccessor) {
ko.bindingHandlers.hasfocus.init(element, valueAccessor, allBindingsAccessor);
ko.utils.registerEventHandler(element, 'focus', function () {
element.focus();
});
},
update: function (element, valueAccessor) {
ko.utils.unwrapObservable(valueAccessor()); // for dependency
// ensure that element is visible before trying to focus
setTimeout(function () {
ko.bindingHandlers.hasfocus.update(element, valueAccessor);
}, 0);
}
};



define(['bower_components/durandal/app',
'bower_components/durandal/viewLocator',
'bower_components/durandal/system',
'bower_components/durandal/plugins/router'],
function (app, viewLocator, system, router) {
'bower_components/durandal/viewLocator',
'bower_components/durandal/system',
'bower_components/durandal/plugins/router'],
function (app, viewLocator, system, router) {

//>>excludeStart("build", true);
system.debug(true);
//>>excludeEnd("build");
//>>excludeStart("build", true);
system.debug(true);
//>>excludeEnd("build");

app.title = 'Durandal Starter Kit';
app.start().then(function () {
//Replace 'viewmodels' in the moduleId with 'views' to locate the view.
//Look for partial views in a 'views' folder in the root.
viewLocator.useConvention();
app.title = 'Durandal Starter Kit';
app.start().then(function () {
//Replace 'viewmodels' in the moduleId with 'views' to locate the view.
//Look for partial views in a 'views' folder in the root.
viewLocator.useConvention();

//configure routing
router.useConvention('js/viewmodels');
router.mapNav('todoapp');
// router.mapNav('flickr');
//configure routing
router.useConvention('js/viewmodels');
router.mapNav('todoapp');
// router.mapNav('flickr');

app.adaptToDevice();
app.adaptToDevice();

//Show the app by setting the root view model for our application with a transition.
app.setRoot('js/viewmodels/shell');
});
});
//Show the app by setting the root view model for our application with a transition.
app.setRoot('js/viewmodels/shell');
});
});
30 changes: 15 additions & 15 deletions labs/dependency-examples/durandal/js/viewmodels/entry.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,22 @@ define([
'bower_components/durandal/app'
], function (app) {

'use strict';
'use strict';

var ViewModel = function () {
var self = this;
// store the new todo value being entered
self.current = ko.observable();
var ViewModel = function () {
var self = this;
// store the new todo value being entered
self.current = ko.observable();

// add a new todo, when enter key is pressed
self.add = function () {
var current = self.current().trim();
if (current) {
app.trigger('todoitem', current);
self.current('');
}
};
};
// add a new todo, when enter key is pressed
self.add = function () {
var current = self.current().trim();
if (current) {
app.trigger('todoitem', current);
self.current('');
}
};
};

return ViewModel;
return ViewModel;
});
Loading

0 comments on commit c32cd03

Please sign in to comment.