Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
todomvc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Sven Franck
todomvc
Commits
e99e248a
Commit
e99e248a
authored
Oct 29, 2014
by
TasteBot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update the build files for gh-pages [ci skip]
parent
1256e490
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6940 additions
and
3225 deletions
+6940
-3225
examples/angularjs/bower.json
examples/angularjs/bower.json
+3
-3
examples/angularjs/bower_components/angular-route/angular-route.js
...angularjs/bower_components/angular-route/angular-route.js
+111
-58
examples/angularjs/bower_components/angular/angular.js
examples/angularjs/bower_components/angular/angular.js
+6824
-3162
examples/backbone_marionette/js/TodoMVC.Todos.js
examples/backbone_marionette/js/TodoMVC.Todos.js
+2
-2
No files found.
examples/angularjs/bower.json
View file @
e99e248a
...
...
@@ -2,11 +2,11 @@
"name"
:
"todomvc-angular"
,
"version"
:
"0.0.0"
,
"dependencies"
:
{
"angular"
:
"1.
2.22
"
,
"angular"
:
"1.
3.0
"
,
"todomvc-common"
:
"~0.1.4"
},
"devDependencies"
:
{
"angular-mocks"
:
"1.
2.22
"
,
"angular-route"
:
"1.
2.22
"
"angular-mocks"
:
"1.
3.0
"
,
"angular-route"
:
"1.
3.0
"
}
}
examples/angularjs/bower_components/angular-route/angular-route.js
View file @
e99e248a
/**
* @license AngularJS v1.
2.22
* @license AngularJS v1.
3.0
* (c) 2010-2014 Google, Inc. http://angularjs.org
* License: MIT
*/
...
...
@@ -22,12 +22,12 @@
*/
/* global -ngRouteModule */
var
ngRouteModule
=
angular
.
module
(
'
ngRoute
'
,
[
'
ng
'
]).
provider
(
'
$route
'
,
$RouteProvider
);
provider
(
'
$route
'
,
$RouteProvider
),
$routeMinErr
=
angular
.
$$minErr
(
'
ngRoute
'
);
/**
* @ngdoc provider
* @name $routeProvider
* @kind function
*
* @description
*
...
...
@@ -216,10 +216,14 @@ function $RouteProvider(){
* Sets route definition that will be used on route change when no other route definition
* is matched.
*
* @param {Object} params Mapping information to be assigned to `$route.current`.
* @param {Object|string} params Mapping information to be assigned to `$route.current`.
* If called with a string, the value maps to `redirectTo`.
* @returns {Object} self
*/
this
.
otherwise
=
function
(
params
)
{
if
(
typeof
params
===
'
string
'
)
{
params
=
{
redirectTo
:
params
};
}
this
.
when
(
null
,
params
);
return
this
;
};
...
...
@@ -230,10 +234,9 @@ function $RouteProvider(){
'
$routeParams
'
,
'
$q
'
,
'
$injector
'
,
'
$http
'
,
'
$templateCache
'
,
'
$templateRequest
'
,
'
$sce
'
,
function
(
$rootScope
,
$location
,
$routeParams
,
$q
,
$injector
,
$
http
,
$templateCache
,
$sce
)
{
function
(
$rootScope
,
$location
,
$routeParams
,
$q
,
$injector
,
$
templateRequest
,
$sce
)
{
/**
* @ngdoc service
...
...
@@ -270,9 +273,6 @@ function $RouteProvider(){
* This example shows how changing the URL hash causes the `$route` to match a route against the
* URL, and the `ngView` pulls in the partial.
*
* Note that this example is using {@link ng.directive:script inlined templates}
* to get it working on jsfiddle as well.
*
* <example name="$route-service" module="ngRouteExample"
* deps="angular-route.js" fixBase="true">
* <file name="index.html">
...
...
@@ -380,6 +380,10 @@ function $RouteProvider(){
* defined in `resolve` route property. Once all of the dependencies are resolved
* `$routeChangeSuccess` is fired.
*
* The route change (and the `$location` change that triggered it) can be prevented
* by calling `preventDefault` method of the event. See {@link ng.$rootScope.Scope#$on}
* for more details about event object.
*
* @param {Object} angularEvent Synthetic event object.
* @param {Route} next Future route information.
* @param {Route} current Current route information.
...
...
@@ -424,6 +428,8 @@ function $RouteProvider(){
*/
var
forceReload
=
false
,
preparedRoute
,
preparedRouteIsUpdateOnly
,
$route
=
{
routes
:
routes
,
...
...
@@ -440,11 +446,46 @@ function $RouteProvider(){
*/
reload
:
function
()
{
forceReload
=
true
;
$rootScope
.
$evalAsync
(
updateRoute
);
$rootScope
.
$evalAsync
(
function
()
{
// Don't support cancellation of a reload for now...
prepareRoute
();
commitRoute
();
});
},
/**
* @ngdoc method
* @name $route#updateParams
*
* @description
* Causes `$route` service to update the current URL, replacing
* current route parameters with those specified in `newParams`.
* Provided property names that match the route's path segment
* definitions will be interpolated into the location's path, while
* remaining properties will be treated as query params.
*
* @param {Object} newParams mapping of URL parameter names to values
*/
updateParams
:
function
(
newParams
)
{
if
(
this
.
current
&&
this
.
current
.
$$route
)
{
var
searchParams
=
{},
self
=
this
;
angular
.
forEach
(
Object
.
keys
(
newParams
),
function
(
key
)
{
if
(
!
self
.
current
.
pathParams
[
key
])
searchParams
[
key
]
=
newParams
[
key
];
});
newParams
=
angular
.
extend
({},
this
.
current
.
params
,
newParams
);
$location
.
path
(
interpolate
(
this
.
current
.
$$route
.
originalPath
,
newParams
));
$location
.
search
(
angular
.
extend
({},
$location
.
search
(),
searchParams
));
}
else
{
throw
$routeMinErr
(
'
norout
'
,
'
Tried updating route when with no current route
'
);
}
}
};
$rootScope
.
$on
(
'
$locationChangeSuccess
'
,
updateRoute
);
$rootScope
.
$on
(
'
$locationChangeStart
'
,
prepareRoute
);
$rootScope
.
$on
(
'
$locationChangeSuccess
'
,
commitRoute
);
return
$route
;
...
...
@@ -482,56 +523,69 @@ function $RouteProvider(){
return
params
;
}
function
updateRoute
()
{
var
next
=
parseRoute
(),
last
=
$route
.
current
;
if
(
next
&&
last
&&
next
.
$$route
===
last
.
$$route
&&
angular
.
equals
(
next
.
pathParams
,
last
.
pathParams
)
&&
!
next
.
reloadOnSearch
&&
!
forceReload
)
{
last
.
params
=
next
.
params
;
angular
.
copy
(
last
.
params
,
$routeParams
);
$rootScope
.
$broadcast
(
'
$routeUpdate
'
,
last
);
}
else
if
(
next
||
last
)
{
function
prepareRoute
(
$locationEvent
)
{
var
lastRoute
=
$route
.
current
;
preparedRoute
=
parseRoute
();
preparedRouteIsUpdateOnly
=
preparedRoute
&&
lastRoute
&&
preparedRoute
.
$$route
===
lastRoute
.
$$route
&&
angular
.
equals
(
preparedRoute
.
pathParams
,
lastRoute
.
pathParams
)
&&
!
preparedRoute
.
reloadOnSearch
&&
!
forceReload
;
if
(
!
preparedRouteIsUpdateOnly
&&
(
lastRoute
||
preparedRoute
))
{
if
(
$rootScope
.
$broadcast
(
'
$routeChangeStart
'
,
preparedRoute
,
lastRoute
).
defaultPrevented
)
{
if
(
$locationEvent
)
{
$locationEvent
.
preventDefault
();
}
}
}
}
function
commitRoute
()
{
var
lastRoute
=
$route
.
current
;
var
nextRoute
=
preparedRoute
;
if
(
preparedRouteIsUpdateOnly
)
{
lastRoute
.
params
=
nextRoute
.
params
;
angular
.
copy
(
lastRoute
.
params
,
$routeParams
);
$rootScope
.
$broadcast
(
'
$routeUpdate
'
,
lastRoute
);
}
else
if
(
nextRoute
||
lastRoute
)
{
forceReload
=
false
;
$rootScope
.
$broadcast
(
'
$routeChangeStart
'
,
next
,
last
);
$route
.
current
=
next
;
if
(
next
)
{
if
(
next
.
redirectTo
)
{
if
(
angular
.
isString
(
next
.
redirectTo
))
{
$location
.
path
(
interpolate
(
next
.
redirectTo
,
next
.
params
)).
search
(
next
.
params
)
$route
.
current
=
nextRoute
;
if
(
nextRoute
)
{
if
(
nextRoute
.
redirectTo
)
{
if
(
angular
.
isString
(
nextRoute
.
redirectTo
))
{
$location
.
path
(
interpolate
(
nextRoute
.
redirectTo
,
nextRoute
.
params
)).
search
(
nextRoute
.
params
)
.
replace
();
}
else
{
$location
.
url
(
next
.
redirectTo
(
next
.
pathParams
,
$location
.
path
(),
$location
.
search
()))
$location
.
url
(
next
Route
.
redirectTo
(
nextRoute
.
pathParams
,
$location
.
path
(),
$location
.
search
()))
.
replace
();
}
}
}
$q
.
when
(
next
).
$q
.
when
(
next
Route
).
then
(
function
()
{
if
(
next
)
{
var
locals
=
angular
.
extend
({},
next
.
resolve
),
if
(
next
Route
)
{
var
locals
=
angular
.
extend
({},
next
Route
.
resolve
),
template
,
templateUrl
;
angular
.
forEach
(
locals
,
function
(
value
,
key
)
{
locals
[
key
]
=
angular
.
isString
(
value
)
?
$injector
.
get
(
value
)
:
$injector
.
invoke
(
value
);
$injector
.
get
(
value
)
:
$injector
.
invoke
(
value
,
null
,
null
,
key
);
});
if
(
angular
.
isDefined
(
template
=
next
.
template
))
{
if
(
angular
.
isDefined
(
template
=
next
Route
.
template
))
{
if
(
angular
.
isFunction
(
template
))
{
template
=
template
(
next
.
params
);
template
=
template
(
next
Route
.
params
);
}
}
else
if
(
angular
.
isDefined
(
templateUrl
=
next
.
templateUrl
))
{
}
else
if
(
angular
.
isDefined
(
templateUrl
=
next
Route
.
templateUrl
))
{
if
(
angular
.
isFunction
(
templateUrl
))
{
templateUrl
=
templateUrl
(
next
.
params
);
templateUrl
=
templateUrl
(
next
Route
.
params
);
}
templateUrl
=
$sce
.
getTrustedResourceUrl
(
templateUrl
);
if
(
angular
.
isDefined
(
templateUrl
))
{
next
.
loadedTemplateUrl
=
templateUrl
;
template
=
$http
.
get
(
templateUrl
,
{
cache
:
$templateCache
}).
then
(
function
(
response
)
{
return
response
.
data
;
});
nextRoute
.
loadedTemplateUrl
=
templateUrl
;
template
=
$templateRequest
(
templateUrl
);
}
}
if
(
angular
.
isDefined
(
template
))
{
...
...
@@ -542,16 +596,16 @@ function $RouteProvider(){
}).
// after route change
then
(
function
(
locals
)
{
if
(
next
==
$route
.
current
)
{
if
(
next
)
{
next
.
locals
=
locals
;
angular
.
copy
(
next
.
params
,
$routeParams
);
if
(
next
Route
==
$route
.
current
)
{
if
(
next
Route
)
{
next
Route
.
locals
=
locals
;
angular
.
copy
(
next
Route
.
params
,
$routeParams
);
}
$rootScope
.
$broadcast
(
'
$routeChangeSuccess
'
,
next
,
last
);
$rootScope
.
$broadcast
(
'
$routeChangeSuccess
'
,
next
Route
,
lastRoute
);
}
},
function
(
error
)
{
if
(
next
==
$route
.
current
)
{
$rootScope
.
$broadcast
(
'
$routeChangeError
'
,
next
,
last
,
error
);
if
(
next
Route
==
$route
.
current
)
{
$rootScope
.
$broadcast
(
'
$routeChangeError
'
,
next
Route
,
lastRoute
,
error
);
}
});
}
...
...
@@ -693,7 +747,6 @@ ngRouteModule.directive('ngView', ngViewFillContentFactory);
<pre>$location.path() = {{main.$location.path()}}</pre>
<pre>$route.current.templateUrl = {{main.$route.current.templateUrl}}</pre>
<pre>$route.current.params = {{main.$route.current.params}}</pre>
<pre>$route.current.scope.name = {{main.$route.current.scope.name}}</pre>
<pre>$routeParams = {{main.$routeParams}}</pre>
</div>
</file>
...
...
@@ -771,7 +824,6 @@ ngRouteModule.directive('ngView', ngViewFillContentFactory);
controllerAs: 'chapter'
});
// configure html5 to get links working on jsfiddle
$locationProvider.html5Mode(true);
}])
.controller('MainCtrl', ['$route', '$routeParams', '$location',
...
...
@@ -827,7 +879,7 @@ function ngViewFactory( $route, $anchorScroll, $animate) {
link
:
function
(
scope
,
$element
,
attr
,
ctrl
,
$transclude
)
{
var
currentScope
,
currentElement
,
previous
Element
,
previous
LeaveAnimation
,
autoScrollExp
=
attr
.
autoscroll
,
onloadExp
=
attr
.
onload
||
''
;
...
...
@@ -835,19 +887,20 @@ function ngViewFactory( $route, $anchorScroll, $animate) {
update
();
function
cleanupLastView
()
{
if
(
previous
Element
)
{
previousElement
.
remove
(
);
previous
Element
=
null
;
if
(
previous
LeaveAnimation
)
{
$animate
.
cancel
(
previousLeaveAnimation
);
previous
LeaveAnimation
=
null
;
}
if
(
currentScope
)
{
currentScope
.
$destroy
();
currentScope
=
null
;
}
if
(
currentElement
)
{
$animate
.
leave
(
currentElement
,
function
()
{
previousElement
=
null
;
previousLeaveAnimation
=
$animate
.
leave
(
currentElement
);
previousLeaveAnimation
.
then
(
function
()
{
previousLeaveAnimation
=
null
;
});
previousElement
=
currentElement
;
currentElement
=
null
;
}
}
...
...
@@ -867,7 +920,7 @@ function ngViewFactory( $route, $anchorScroll, $animate) {
// function is called before linking the content, which would apply child
// directives to non existing elements.
var
clone
=
$transclude
(
newScope
,
function
(
clone
)
{
$animate
.
enter
(
clone
,
null
,
currentElement
||
$element
,
function
onNgViewEnter
()
{
$animate
.
enter
(
clone
,
null
,
currentElement
||
$element
).
then
(
function
onNgViewEnter
()
{
if
(
angular
.
isDefined
(
autoScrollExp
)
&&
(
!
autoScrollExp
||
scope
.
$eval
(
autoScrollExp
)))
{
$anchorScroll
();
...
...
examples/angularjs/bower_components/angular/angular.js
View file @
e99e248a
This source diff could not be displayed because it is too large. You can
view the blob
instead.
examples/backbone_marionette/js/TodoMVC.Todos.js
View file @
e99e248a
...
...
@@ -45,6 +45,8 @@ TodoMVC.module('Todos', function (Todos, App, Backbone) {
localStorage
:
new
Backbone
.
LocalStorage
(
'
todos-backbone-marionette
'
),
comparator
:
'
created
'
,
getCompleted
:
function
()
{
return
this
.
filter
(
this
.
_isCompleted
);
},
...
...
@@ -53,8 +55,6 @@ TodoMVC.module('Todos', function (Todos, App, Backbone) {
return
this
.
reject
(
this
.
_isCompleted
);
},
comparator
:
'
created
'
,
_isCompleted
:
function
(
todo
)
{
return
todo
.
isCompleted
();
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment