From 4f5bd906ad5038a84bc3fcfd525cdce3e992b30b Mon Sep 17 00:00:00 2001 From: Nate Abele Date: Wed, 4 Dec 2013 21:16:25 -0500 Subject: [PATCH] release 0.2.5 --- README.md | 2 +- bower.json | 2 +- component.json | 2 +- package.json | 2 +- release/angular-ui-router.js | 285 ++++++++++++++++++++++++---- release/angular-ui-router.min.js | 4 +- release/doc/$resolve.html | 4 +- release/doc/$templateFactory.html | 4 +- release/doc/$urlMatcherFactory.html | 4 +- release/doc/UrlMatcher.html | 4 +- release/doc/global.html | 164 +++++++++++++++- release/doc/index.html | 4 +- 12 files changed, 423 insertions(+), 58 deletions(-) diff --git a/README.md b/README.md index 886ea3594..fa9841bf0 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ #### The de-facto solution to flexible routing with nested views --- -**[Download 0.2.0](http://angular-ui.github.io/ui-router/release/angular-ui-router.js)** (or **[Minified](http://angular-ui.github.io/ui-router/release/angular-ui-router.min.js)**) **|** +**[Download 0.2.5](http://angular-ui.github.io/ui-router/release/angular-ui-router.js)** (or **[Minified](http://angular-ui.github.io/ui-router/release/angular-ui-router.min.js)**) **|** **[Learn](#resources) |** **[Discuss](https://groups.google.com/forum/#!categories/angular-ui/router) |** **[Get Help](http://stackoverflow.com/questions/ask?tags=angularjs,angular-ui-router) |** diff --git a/bower.json b/bower.json index dfe3850d1..1f58fd51b 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "angular-ui-router", - "version": "0.2.0", + "version": "0.2.5", "main": "./release/angular-ui-router.js", "dependencies": { "angular": ">= 1.0.6" diff --git a/component.json b/component.json index 4f23115ba..1ecd5307d 100644 --- a/component.json +++ b/component.json @@ -1,6 +1,6 @@ { "name": "angular-ui-router", - "version": "0.2.0", + "version": "0.2.5", "description": "State-based routing for AngularJS", "keywords": [ "angular", diff --git a/package.json b/package.json index a7adbeb06..ead99ed8a 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "angular-ui-router", "description": "State-based routing for AngularJS", - "version": "0.2.0", + "version": "0.2.5", "homepage": "http://angular-ui.github.com/", "contributors": [ { diff --git a/release/angular-ui-router.js b/release/angular-ui-router.js index feb17c7ce..716a7e3bc 100644 --- a/release/angular-ui-router.js +++ b/release/angular-ui-router.js @@ -1,9 +1,15 @@ /** * State-based routing for AngularJS - * @version v0.2.0 + * @version v0.2.5 * @link http://angular-ui.github.com/ * @license MIT License, http://www.opensource.org/licenses/MIT */ + +/* commonjs package manager support (eg componentjs) */ +if (typeof module !== "undefined" && typeof exports !== "undefined" && module.exports === exports){ + module.exports = 'ui.router'; +} + (function (window, angular, undefined) { /*jshint globalstrict:true*/ /*global angular:false*/ @@ -51,6 +57,28 @@ function ancestors(first, second) { return path; } +/** + * IE8-safe wrapper for `Array.prototype.indexOf()`. + * + * @param {Array} array A JavaScript array. + * @param {*} value A value to search the array for. + * @return {Number} Returns the array index value of `value`, or `-1` if not present. + */ +function arraySearch(array, value) { + if (Array.prototype.indexOf) { + return array.indexOf(value, Number(arguments[2]) || 0); + } + var len = array.length >>> 0, from = Number(arguments[2]) || 0; + from = (from < 0) ? Math.ceil(from) : Math.floor(from); + + if (from < 0) from += len; + + for (; from < len; from++) { + if (from in array && array[from] === value) return from; + } + return -1; +} + /** * Merges a set of parameters with all parameters inherited between the common parents of the * current state and a given destination state. @@ -68,7 +96,7 @@ function inheritParams(currentParams, newParams, $current, $to) { parentParams = parents[i].params; for (var j in parentParams) { - if (inheritList.indexOf(parentParams[j]) >= 0) continue; + if (arraySearch(inheritList, parentParams[j]) >= 0) continue; inheritList.push(parentParams[j]); inherited[parentParams[j]] = currentParams[parentParams[j]]; } @@ -127,7 +155,7 @@ function $Resolve( $q, $injector) { visited[key] = VISIT_IN_PROGRESS; if (isString(value)) { - plan.push(key, [ function() { return $injector.get(key); }], NO_DEPENDENCIES); + plan.push(key, [ function() { return $injector.get(value); }], NO_DEPENDENCIES); } else { var params = $injector.annotate(value); forEach(params, function (param) { @@ -214,7 +242,7 @@ function $Resolve( $q, $injector) { } // Wait for any parameter that we have a promise for (either from parent or from this // resolve; in that case study() will have made sure it's ordered before us in the plan). - params.forEach(function (dep) { + forEach(params, function (dep) { if (promises.hasOwnProperty(dep) && !locals.hasOwnProperty(dep)) { waitParams++; promises[dep].then(function (result) { @@ -738,7 +766,8 @@ function $UrlRouterProvider( $urlMatcherFactory) { [ '$location', '$rootScope', '$injector', function ($location, $rootScope, $injector) { // TODO: Optimize groups of rules with non-empty prefix into some sort of decision tree - function update() { + function update(evt) { + if (evt && evt.defaultPrevented) return; function check(rule) { var handled = rule($injector, $location); if (handled) { @@ -756,7 +785,12 @@ function $UrlRouterProvider( $urlMatcherFactory) { } $rootScope.$on('$locationChangeSuccess', update); - return {}; + + return { + sync: function () { + update(); + } + }; }]; } @@ -765,7 +799,7 @@ angular.module('ui.router.router').provider('$urlRouter', $UrlRouterProvider); $StateProvider.$inject = ['$urlRouterProvider', '$urlMatcherFactoryProvider', '$locationProvider']; function $StateProvider( $urlRouterProvider, $urlMatcherFactory, $locationProvider) { - var root, states = {}, $state; + var root, states = {}, $state, queue = {}; // Builds state properties from definition passed to registerState() var stateBuilder = { @@ -784,7 +818,7 @@ function $StateProvider( $urlRouterProvider, $urlMatcherFactory, $ // inherit 'data' from parent and override by own values (if any) data: function(state) { if (state.parent && state.parent.data) { - state.data = state.self.data = angular.extend({}, state.parent.data, state.data); + state.data = state.self.data = extend({}, state.parent.data, state.data); } return state.data; }, @@ -866,14 +900,19 @@ function $StateProvider( $urlRouterProvider, $urlMatcherFactory, $ var includes = state.parent ? extend({}, state.parent.includes) : {}; includes[state.name] = true; return includes; - } + }, + + $delegates: {} }; + function isRelative(stateName) { + return stateName.indexOf(".") === 0 || stateName.indexOf("^") === 0; + } function findState(stateOrName, base) { var isStr = isString(stateOrName), name = isStr ? stateOrName : stateOrName.name, - path = name.indexOf(".") === 0 || name.indexOf("^") === 0; + path = isRelative(name); if (path) { if (!base) throw new Error("No reference point given for path '" + name + "'"); @@ -902,6 +941,12 @@ function $StateProvider( $urlRouterProvider, $urlMatcherFactory, $ return undefined; } + function queueState(parentName, state) { + if (!queue[parentName]) { + queue[parentName] = []; + } + queue[parentName].push(state); + } function registerState(state) { // Wrap a new object around the state so we can store our private details easily. @@ -913,10 +958,20 @@ function $StateProvider( $urlRouterProvider, $urlMatcherFactory, $ var name = state.name; if (!isString(name) || name.indexOf('@') >= 0) throw new Error("State must have a valid name"); - if (states[name]) throw new Error("State '" + name + "'' is already defined"); + if (states.hasOwnProperty(name)) throw new Error("State '" + name + "'' is already defined"); + + // Get parent name + var parentName = (name.indexOf('.') !== -1) ? name.substring(0, name.lastIndexOf('.')) + : (isString(state.parent)) ? state.parent + : ''; + + // If parent is not registered yet, add state to queue and register later + if (parentName && !states[parentName]) { + return queueState(parentName, state.self); + } for (var key in stateBuilder) { - state[key] = stateBuilder[key](state); + if (isFunction(stateBuilder[key])) state[key] = stateBuilder[key](state, stateBuilder.$delegates[key]); } states[name] = state; @@ -928,6 +983,14 @@ function $StateProvider( $urlRouterProvider, $urlMatcherFactory, $ } }]); } + + // Register any queued children + if (queue[name]) { + for (var i = 0; i < queue[name].length; i++) { + registerState(queue[name][i]); + } + } + return state; } @@ -942,6 +1005,25 @@ function $StateProvider( $urlRouterProvider, $urlMatcherFactory, $ root.navigable = null; + // .decorator() + // .decorator(name) + // .decorator(name, function) + this.decorator = decorator; + function decorator(name, func) { + /*jshint validthis: true */ + if (isString(name) && !isDefined(func)) { + return stateBuilder[name]; + } + if (!isFunction(func) || !isString(name)) { + return this; + } + if (stateBuilder[name] && !stateBuilder.$delegates[name]) { + stateBuilder.$delegates[name] = stateBuilder[name]; + } + stateBuilder[name] = func; + return this; + } + // .state(state) // .state(name, state) this.state = state; @@ -960,6 +1042,16 @@ function $StateProvider( $urlRouterProvider, $urlMatcherFactory, $ var TransitionSuperseded = $q.reject(new Error('transition superseded')); var TransitionPrevented = $q.reject(new Error('transition prevented')); + var TransitionAborted = $q.reject(new Error('transition aborted')); + var TransitionFailed = $q.reject(new Error('transition failed')); + var currentLocation = $location.url(); + + function syncUrl() { + if ($location.url() !== currentLocation) { + $location.url(currentLocation); + $location.replace(); + } + } root.locals = { resolve: null, globals: { $stateParams: {} } }; $state = { @@ -969,28 +1061,71 @@ function $StateProvider( $urlRouterProvider, $urlMatcherFactory, $ transition: null }; + $state.reload = function reload() { + $state.transitionTo($state.current, $stateParams, { reload: true, inherit: false, notify: false }); + }; + $state.go = function go(to, params, options) { return this.transitionTo(to, params, extend({ inherit: true, relative: $state.$current }, options)); }; $state.transitionTo = function transitionTo(to, toParams, options) { - if (!isDefined(options)) options = (options === true || options === false) ? { location: options } : {}; toParams = toParams || {}; - options = extend({ location: true, inherit: false, relative: null }, options); + options = extend({ + location: true, inherit: false, relative: null, notify: true, reload: false, $retry: false + }, options || {}); + + var from = $state.$current, fromParams = $state.params, fromPath = from.path; + var evt, toState = findState(to, options.relative); + + if (!isDefined(toState)) { + // Broadcast not found event and abort the transition if prevented + var redirect = { to: to, toParams: toParams, options: options }; + evt = $rootScope.$broadcast('$stateNotFound', redirect, from.self, fromParams); + if (evt.defaultPrevented) { + syncUrl(); + return TransitionAborted; + } + + // Allow the handler to return a promise to defer state lookup retry + if (evt.retry) { + if (options.$retry) { + syncUrl(); + return TransitionFailed; + } + var retryTransition = $state.transition = $q.when(evt.retry); + retryTransition.then(function() { + if (retryTransition !== $state.transition) return TransitionSuperseded; + redirect.options.$retry = true; + return $state.transitionTo(redirect.to, redirect.toParams, redirect.options); + }, function() { + return TransitionAborted; + }); + syncUrl(); + return retryTransition; + } - var toState = findState(to, options.relative); - if (!isDefined(toState)) throw new Error("No such state " + toState); + // Always retry once if the $stateNotFound was not prevented + // (handles either redirect changed or state lazy-definition) + to = redirect.to; + toParams = redirect.toParams; + options = redirect.options; + toState = findState(to, options.relative); + if (!isDefined(toState)) { + if (options.relative) throw new Error("Could not resolve '" + to + "' from state '" + options.relative + "'"); + throw new Error("No such state '" + to + "'"); + } + } if (toState['abstract']) throw new Error("Cannot transition to abstract state '" + to + "'"); if (options.inherit) toParams = inheritParams($stateParams, toParams || {}, $state.$current, toState); to = toState; - var toPath = to.path, - from = $state.$current, fromParams = $state.params, fromPath = from.path; + var toPath = to.path; // Starting from the root of the path, keep all levels that haven't changed var keep, state, locals = root.locals, toLocals = []; for (keep = 0, state = toPath[keep]; - state && state === fromPath[keep] && equalForKeys(toParams, fromParams, state.ownParams); + state && state === fromPath[keep] && equalForKeys(toParams, fromParams, state.ownParams) && !options.reload; keep++, state = toPath[keep]) { locals = toLocals[keep] = state.locals; } @@ -999,7 +1134,9 @@ function $StateProvider( $urlRouterProvider, $urlMatcherFactory, $ // But clear 'transition', as we still want to cancel any other pending transitions. // TODO: We may not want to bump 'transition' if we're called from a location change that we've initiated ourselves, // because we might accidentally abort a legitimate transition initiated from code? - if (to === from && locals === from.locals) { + if (shouldTriggerReload(to, from, locals, options) ) { + if ( to.self.reloadOnSearch !== false ) + syncUrl(); $state.transition = null; return $q.when($state.current); } @@ -1008,8 +1145,13 @@ function $StateProvider( $urlRouterProvider, $urlMatcherFactory, $ toParams = normalize(to.params, toParams || {}); // Broadcast start event and cancel the transition if requested - var evt = $rootScope.$broadcast('$stateChangeStart', to.self, toParams, from.self, fromParams); - if (evt.defaultPrevented) return TransitionPrevented; + if (options.notify) { + evt = $rootScope.$broadcast('$stateChangeStart', to.self, toParams, from.self, fromParams); + if (evt.defaultPrevented) { + syncUrl(); + return TransitionPrevented; + } + } // Resolve locals for the remaining states, but don't update any global state just // yet -- if anything fails to resolve the current state needs to remain untouched. @@ -1024,7 +1166,7 @@ function $StateProvider( $urlRouterProvider, $urlMatcherFactory, $ resolved = resolveState(state, toParams, state===to, resolved, locals); } - // Once everything is resolved, wer are ready to perform the actual transition + // Once everything is resolved, we are ready to perform the actual transition // and return a promise for the new state. We also keep track of what the // current promise is, so that we can detect overlapping transitions and // keep only the outcome of the last transition. @@ -1051,6 +1193,9 @@ function $StateProvider( $urlRouterProvider, $urlMatcherFactory, $ } } + // Run it again, to catch any transitions in callbacks + if ($state.transition !== transition) return TransitionSuperseded; + // Update globals in $state $state.$current = to; $state.current = to.self; @@ -1062,9 +1207,16 @@ function $StateProvider( $urlRouterProvider, $urlMatcherFactory, $ var toNav = to.navigable; if (options.location && toNav) { $location.url(toNav.url.format(toNav.locals.globals.$stateParams)); + + if (options.location === 'replace') { + $location.replace(); + } } - $rootScope.$broadcast('$stateChangeSuccess', to.self, toParams, from.self, fromParams); + if (options.notify) { + $rootScope.$broadcast('$stateChangeSuccess', to.self, toParams, from.self, fromParams); + } + currentLocation = $location.url(); return $state.current; }, function (error) { @@ -1072,6 +1224,7 @@ function $StateProvider( $urlRouterProvider, $urlMatcherFactory, $ $state.transition = null; $rootScope.$broadcast('$stateChangeError', to.self, toParams, from.self, fromParams, error); + syncUrl(); return $q.reject(error); }); @@ -1079,28 +1232,66 @@ function $StateProvider( $urlRouterProvider, $urlMatcherFactory, $ return transition; }; - $state.is = function is(stateOrName) { + $state.is = function is(stateOrName, params) { var state = findState(stateOrName); - return (isDefined(state)) ? $state.$current === state : undefined; + + if (!isDefined(state)) { + return undefined; + } + + if ($state.$current !== state) { + return false; + } + + return isDefined(params) ? angular.equals($stateParams, params) : true; }; - $state.includes = function includes(stateOrName) { + $state.includes = function includes(stateOrName, params) { var state = findState(stateOrName); - return (isDefined(state)) ? isDefined($state.$current.includes[state.name]) : undefined; + if (!isDefined(state)) { + return undefined; + } + + if (!isDefined($state.$current.includes[state.name])) { + return false; + } + + var validParams = true; + angular.forEach(params, function(value, key) { + if (!isDefined($stateParams[key]) || $stateParams[key] !== value) { + validParams = false; + } + }); + return validParams; }; $state.href = function href(stateOrName, params, options) { - options = extend({ lossy: true, inherit: false, relative: $state.$current }, options || {}); + options = extend({ lossy: true, inherit: false, absolute: false, relative: $state.$current }, options || {}); var state = findState(stateOrName, options.relative); if (!isDefined(state)) return null; params = inheritParams($stateParams, params || {}, $state.$current, state); var nav = (state && options.lossy) ? state.navigable : state; var url = (nav && nav.url) ? nav.url.format(normalize(state.params, params || {})) : null; - return !$locationProvider.html5Mode() && url ? "#" + url : url; + if (!$locationProvider.html5Mode() && url) { + url = "#" + $locationProvider.hashPrefix() + url; + } + if (options.absolute && url) { + url = $location.protocol() + '://' + + $location.host() + + ($location.port() == 80 || $location.port() == 443 ? '' : ':' + $location.port()) + + (!$locationProvider.html5Mode() && url ? '/' : '') + + url; + } + return url; }; $state.get = function (stateOrName) { + if (!isDefined(stateOrName)) { + var list = []; + forEach(states, function(state) { list.push(state.self); }); + return list; + } var state = findState(stateOrName); return (state && state.self) ? state.self : null; }; @@ -1132,7 +1323,12 @@ function $StateProvider( $urlRouterProvider, $urlMatcherFactory, $ promises.push($resolve.resolve(injectables, locals, dst.resolve, state).then(function (result) { // References to the controller (only instantiated at link time) - result.$$controller = view.controller; + if (isFunction(view.controllerProvider) || isArray(view.controllerProvider)) { + var injectLocals = angular.extend({}, injectables, locals); + result.$$controller = $injector.invoke(view.controllerProvider, null, injectLocals); + } else { + result.$$controller = view.controller; + } // Provide access to the state itself for internal use result.$$state = state; dst[name] = result; @@ -1180,6 +1376,12 @@ function $StateProvider( $urlRouterProvider, $urlMatcherFactory, $ }); return filtered; } + + function shouldTriggerReload(to, from, locals, options) { + if ( to === from && ((locals === from.locals && !options.reload) || (to.self.reloadOnSearch === false)) ) { + return true; + } + } } angular.module('ui.router.state') @@ -1226,13 +1428,15 @@ function $ViewDirective( $state, $compile, $controller, $injector, $an var directive = { restrict: 'ECA', terminal: true, + priority: 1000, transclude: true, compile: function (element, attr, transclude) { return function(scope, element, attr) { var viewScope, viewLocals, name = attr[directive.name] || attr.name || '', onloadExp = attr.onload || '', - animate = isDefined($animator) && $animator(scope, attr); + animate = isDefined($animator) && $animator(scope, attr), + initialView = transclude(scope); // Returns a set of DOM manipulation functions based on whether animation // should be performed @@ -1259,7 +1463,7 @@ function $ViewDirective( $state, $compile, $controller, $injector, $an }; // Put back the compiled initial view - element.append(transclude(scope)); + element.append(initialView); // Find the details of the parent view directive (if any) and use it // to derive our own qualified view name, then hang our own details @@ -1303,7 +1507,7 @@ function $ViewDirective( $state, $compile, $controller, $injector, $an view.state = null; // Restore the initial view - return render.restore(transclude(scope), element); + return render.restore(initialView, element); } viewLocals = locals; @@ -1334,7 +1538,7 @@ function $ViewDirective( $state, $compile, $controller, $injector, $an angular.module('ui.router.state').directive('uiView', $ViewDirective); function parseStateRef(ref) { - var parsed = ref.match(/^([^(]+?)\s*(\((.*)\))?$/); + var parsed = ref.replace(/\n/g, " ").match(/^([^(]+?)\s*(\((.*)\))?$/); if (!parsed || parsed.length !== 4) throw new Error("Invalid state ref '" + ref + "'"); return { state: parsed[1], paramExpr: parsed[3] || null }; } @@ -1370,7 +1574,7 @@ function $StateRefDirective($state) { if (ref.paramExpr) { scope.$watch(ref.paramExpr, function(newVal, oldVal) { - if (newVal !== oldVal) update(newVal); + if (newVal !== params) update(newVal); }, true); params = scope.$eval(ref.paramExpr); } @@ -1379,9 +1583,12 @@ function $StateRefDirective($state) { if (isForm) return; element.bind("click", function(e) { - if ((e.which == 1) && !e.ctrlKey && !e.metaKey && !e.shiftKey) { - $state.go(ref.state, params, { relative: base }); - scope.$apply(); + var button = e.which || e.button; + + if ((button === 0 || button == 1) && !e.ctrlKey && !e.metaKey && !e.shiftKey) { + scope.$evalAsync(function() { + $state.go(ref.state, params, { relative: base }); + }); e.preventDefault(); } }); diff --git a/release/angular-ui-router.min.js b/release/angular-ui-router.min.js index 263dffc40..683e027de 100644 --- a/release/angular-ui-router.min.js +++ b/release/angular-ui-router.min.js @@ -1,7 +1,7 @@ /** * State-based routing for AngularJS - * @version v0.2.0 + * @version v0.2.5 * @link http://angular-ui.github.com/ * @license MIT License, http://www.opensource.org/licenses/MIT */ -(function(r,t,e){"use strict";function n(r,t){return P(new(P(function(){},{prototype:r})),t)}function a(r){return y(arguments,function(t){t!==r&&y(t,function(t,e){r.hasOwnProperty(e)||(r[e]=t)})}),r}function o(r,t){var e=[];for(var n in r.path)if(""!==r.path[n]){if(!t.path[n])break;e.push(r.path[n])}return e}function i(r,t,e,n){var a,i=o(e,n),u={},s=[];for(var l in i)if(i[l].params&&i[l].params.length){a=i[l].params;for(var c in a)s.indexOf(a[c])>=0||(s.push(a[c]),u[a[c]]=r[a[c]])}return P({},u,t)}function u(r,t){var n=1,o=2,i={},u=[],s=i,l=P(r.when(i),{$$promises:i,$$values:i});this.study=function(i){function c(r,e){if(v[e]!==o){if(p.push(e),v[e]===n)throw p.splice(0,p.indexOf(e)),Error("Cyclic dependency: "+p.join(" -> "));if(v[e]=n,b(r))h.push(e,[function(){return t.get(e)}],u);else{var a=t.annotate(r);y(a,function(r){r!==e&&i.hasOwnProperty(r)&&c(i[r],r)}),h.push(e,r,a)}p.pop(),v[e]=o}}function f(r){return E(r)&&r.then&&r.$$promises}if(!E(i))throw Error("'invocables' must be an object");var h=[],p=[],v={};return y(i,c),i=p=v=null,function(n,o,i){function u(){--w||(b||a(d,o.$$values),$.$$values=d,$.$$promises=!0,v.resolve(d))}function c(r){$.$$failure=r,v.reject(r)}function p(e,a,o){function s(r){f.reject(r),c(r)}function l(){if(!g($.$$failure))try{f.resolve(t.invoke(a,i,d)),f.promise.then(function(r){d[e]=r,u()},s)}catch(r){s(r)}}var f=r.defer(),h=0;o.forEach(function(r){m.hasOwnProperty(r)&&!n.hasOwnProperty(r)&&(h++,m[r].then(function(t){d[r]=t,--h||l()},s))}),h||l(),m[e]=f.promise}if(f(n)&&i===e&&(i=o,o=n,n=null),n){if(!E(n))throw Error("'locals' must be an object")}else n=s;if(o){if(!f(o))throw Error("'parent' must be a promise returned by $resolve.resolve()")}else o=l;var v=r.defer(),$=v.promise,m=$.$$promises={},d=P({},n),w=1+h.length/3,b=!1;if(g(o.$$failure))return c(o.$$failure),$;o.$$values?(b=a(d,o.$$values),u()):(P(m,o.$$promises),o.then(u,c));for(var x=0,y=h.length;y>x;x+=3)n.hasOwnProperty(h[x])?u():p(h[x],h[x+1],h[x+2]);return $}},this.resolve=function(r,t,e,n){return this.study(r)(t,e,n)}}function s(r,t,e){this.fromConfig=function(r,t,e){return g(r.template)?this.fromString(r.template,t):g(r.templateUrl)?this.fromUrl(r.templateUrl,t):g(r.templateProvider)?this.fromProvider(r.templateProvider,t,e):null},this.fromString=function(r,t){return w(r)?r(t):r},this.fromUrl=function(e,n){return w(e)&&(e=e(n)),null==e?null:r.get(e,{cache:t}).then(function(r){return r.data})},this.fromProvider=function(r,t,n){return e.invoke(r,null,n||{params:t})}}function l(r){function t(t){if(!/^\w+(-+\w+)*$/.test(t))throw Error("Invalid parameter name '"+t+"' in pattern '"+r+"'");if(o[t])throw Error("Duplicate parameter name '"+t+"' in pattern '"+r+"'");o[t]=!0,l.push(t)}function e(r){return r.replace(/[\\\[\]\^$*+?.()|{}]/g,"\\$&")}var n,a=/([:*])(\w+)|\{(\w+)(?:\:((?:[^{}\\]+|\\.|\{(?:[^{}\\]+|\\.)*\})+))?\}/g,o={},i="^",u=0,s=this.segments=[],l=this.params=[];this.source=r;for(var c,f,h;(n=a.exec(r))&&(c=n[2]||n[3],f=n[4]||("*"==n[1]?".*":"[^/]*"),h=r.substring(u,n.index),!(h.indexOf("?")>=0));)i+=e(h)+"("+f+")",t(c),s.push(h),u=a.lastIndex;h=r.substring(u);var p=h.indexOf("?");if(p>=0){var v=this.sourceSearch=h.substring(p);h=h.substring(0,p),this.sourcePath=r.substring(0,u+p),y(v.substring(1).split(/[&?]/),t)}else this.sourcePath=r,this.sourceSearch="";i+=e(h)+"$",s.push(h),this.regexp=RegExp(i),this.prefix=s[0]}function c(){this.compile=function(r){return new l(r)},this.isMatcher=function(r){return E(r)&&w(r.exec)&&w(r.format)&&w(r.concat)},this.$get=function(){return this}}function f(r){function t(r){var t=/^\^((?:\\[^a-zA-Z0-9]|[^\\\[\]\^$*+?.()|{}]+)*)/.exec(r.source);return null!=t?t[1].replace(/\\(.)/g,"$1"):""}function e(r,t){return r.replace(/\$(\$|\d{1,2})/,function(r,e){return t["$"===e?0:Number(e)]})}function n(r,t,e){if(!e)return!1;var n=r.invoke(t,t,{$match:e});return g(n)?n:!0}var a=[],o=null;this.rule=function(r){if(!w(r))throw Error("'rule' must be a function");return a.push(r),this},this.otherwise=function(r){if(b(r)){var t=r;r=function(){return t}}else if(!w(r))throw Error("'rule' must be a function");return o=r,this},this.when=function(a,o){var i,u=b(o);if(b(a)&&(a=r.compile(a)),!u&&!w(o)&&!x(o))throw Error("invalid 'handler' in when()");var s={matcher:function(t,e){return u&&(i=r.compile(e),e=["$match",function(r){return i.format(r)}]),P(function(r,a){return n(r,e,t.exec(a.path(),a.search()))},{prefix:b(t.prefix)?t.prefix:""})},regex:function(r,a){if(r.global||r.sticky)throw Error("when() RegExp must not be global or sticky");return u&&(i=a,a=["$match",function(r){return e(i,r)}]),P(function(t,e){return n(t,a,r.exec(e.path()))},{prefix:t(r)})}},l={matcher:r.isMatcher(a),regex:a instanceof RegExp};for(var c in l)if(l[c])return this.rule(s[c](a,o));throw Error("invalid 'what' in when()")},this.$get=["$location","$rootScope","$injector",function(r,t,e){function n(){function t(t){var n=t(e,r);return n?(b(n)&&r.replace().url(n),!0):!1}var n,i=a.length;for(n=0;i>n;n++)if(t(a[n]))return;o&&t(o)}return t.$on("$locationChangeSuccess",n),{}}]}function h(r,a,o){function u(r,t){var n=b(r),a=n?r:r.name,o=0===a.indexOf(".")||0===a.indexOf("^");if(o){if(!t)throw Error("No reference point given for path '"+a+"'");for(var i=a.split("."),u=0,s=i.length,l=t;s>u;u++)if(""!==i[u]||0!==u){if("^"!==i[u])break;if(!l.parent)throw Error("Path '"+a+"' not valid for state '"+t.name+"'");l=l.parent}else l=t;i=i.slice(u).join("."),a=l.name+(l.name&&i?".":"")+i}var c=m[a];return!c||!n&&(n||c!==r&&c.self!==r)?e:c}function s(t){t=n(t,{self:t,resolve:t.resolve||{},toString:function(){return this.name}});var e=t.name;if(!b(e)||e.indexOf("@")>=0)throw Error("State must have a valid name");if(m[e])throw Error("State '"+e+"'' is already defined");for(var a in d)t[a]=d[a](t);return m[e]=t,!t["abstract"]&&t.url&&r.when(t.url,["$match","$stateParams",function(r,e){$.$current.navigable==t&&h(r,e)||$.transitionTo(t,r,!1)}]),t}function l(r,t){return E(r)?t=r:t.name=r,s(t),this}function c(r,t,a,s,l,c,m){function d(r,e,n,o,i){var u=n?e:p(r.params,e),s={$stateParams:u};i.resolve=l.resolve(r.resolve,s,i.resolve,r);var c=[i.resolve.then(function(r){i.globals=r})];return o&&c.push(o),y(r.views,function(t,e){var n=t.resolve&&t.resolve!==r.resolve?t.resolve:{};n.$template=[function(){return a.load(e,{view:t,locals:s,params:u,notify:!1})||""}],c.push(l.resolve(n,s,i.resolve,r).then(function(n){n.$$controller=t.controller,n.$$state=r,i[e]=n}))}),t.all(c).then(function(){return i})}var w=t.reject(Error("transition superseded")),b=t.reject(Error("transition prevented"));return v.locals={resolve:null,globals:{$stateParams:{}}},$={params:{},current:v.self,$current:v,transition:null},$.go=function(r,t,e){return this.transitionTo(r,t,P({inherit:!0,relative:$.$current},e))},$.transitionTo=function(e,a,o){g(o)||(o=o===!0||o===!1?{location:o}:{}),a=a||{},o=P({location:!0,inherit:!1,relative:null},o);var l=u(e,o.relative);if(!g(l))throw Error("No such state "+l);if(l["abstract"])throw Error("Cannot transition to abstract state '"+e+"'");o.inherit&&(a=i(c,a||{},$.$current,l)),e=l;var p,E,x=e.path,y=$.$current,C=$.params,S=y.path,O=v.locals,k=[];for(p=0,E=x[p];E&&E===S[p]&&h(a,C,E.ownParams);p++,E=x[p])O=k[p]=E.locals;if(e===y&&O===y.locals)return $.transition=null,t.when($.current);a=f(e.params,a||{});var R=r.$broadcast("$stateChangeStart",e.self,a,y.self,C);if(R.defaultPrevented)return b;for(var I=t.when(O),M=p;x.length>M;M++,E=x[M])O=k[M]=n(O),I=d(E,a,E===e,I,O);var U=$.transition=I.then(function(){var t,n,i;if($.transition!==U)return w;for(t=S.length-1;t>=p;t--)i=S[t],i.self.onExit&&s.invoke(i.self.onExit,i.self,i.locals.globals),i.locals=null;for(t=p;x.length>t;t++)n=x[t],n.locals=k[t],n.self.onEnter&&s.invoke(n.self.onEnter,n.self,n.locals.globals);$.$current=e,$.current=e.self,$.params=a,j($.params,c),$.transition=null;var u=e.navigable;return o.location&&u&&m.url(u.url.format(u.locals.globals.$stateParams)),r.$broadcast("$stateChangeSuccess",e.self,a,y.self,C),$.current},function(n){return $.transition!==U?w:($.transition=null,r.$broadcast("$stateChangeError",e.self,a,y.self,C,n),t.reject(n))});return U},$.is=function(r){var t=u(r);return g(t)?$.$current===t:e},$.includes=function(r){var t=u(r);return g(t)?g($.$current.includes[t.name]):e},$.href=function(r,t,e){e=P({lossy:!0,inherit:!1,relative:$.$current},e||{});var n=u(r,e.relative);if(!g(n))return null;t=i(c,t||{},$.$current,n);var a=n&&e.lossy?n.navigable:n,s=a&&a.url?a.url.format(f(n.params,t||{})):null;return!o.html5Mode()&&s?"#"+s:s},$.get=function(r){var t=u(r);return t&&t.self?t.self:null},$}function f(r,t){var e={};return y(r,function(r){var n=t[r];e[r]=null!=n?n+"":null}),e}function h(r,t,e){if(!e){e=[];for(var n in r)e.push(n)}for(var a=0;e.length>a;a++){var o=e[a];if(r[o]!=t[o])return!1}return!0}function p(r,t){var e={};return y(r,function(r){e[r]=t[r]}),e}var v,$,m={},d={parent:function(r){if(g(r.parent)&&r.parent)return u(r.parent);var t=/^(.+)\.[^.]+$/.exec(r.name);return t?u(t[1]):v},data:function(r){return r.parent&&r.parent.data&&(r.data=r.self.data=t.extend({},r.parent.data,r.data)),r.data},url:function(r){var t=r.url;if(b(t))return"^"==t.charAt(0)?a.compile(t.substring(1)):(r.parent.navigable||v).url.concat(t);if(a.isMatcher(t)||null==t)return t;throw Error("Invalid url '"+t+"' in state '"+r+"'")},navigable:function(r){return r.url?r:r.parent?r.parent.navigable:null},params:function(r){if(!r.params)return r.url?r.url.parameters():r.parent.params;if(!x(r.params))throw Error("Invalid params in state '"+r+"'");if(r.url)throw Error("Both params and url specicified in state '"+r+"'");return r.params},views:function(r){var t={};return y(g(r.views)?r.views:{"":r},function(e,n){0>n.indexOf("@")&&(n+="@"+r.parent.name),t[n]=e}),t},ownParams:function(r){if(!r.parent)return r.params;var t={};y(r.params,function(r){t[r]=!0}),y(r.parent.params,function(e){if(!t[e])throw Error("Missing required parameter '"+e+"' in state '"+r.name+"'");t[e]=!1});var e=[];return y(t,function(r,t){r&&e.push(t)}),e},path:function(r){return r.parent?r.parent.path.concat(r):[]},includes:function(r){var t=r.parent?P({},r.parent.includes):{};return t[r.name]=!0,t}};v=s({name:"",url:"^",views:null,"abstract":!0}),v.navigable=null,this.state=l,this.$get=c,c.$inject=["$rootScope","$q","$view","$injector","$resolve","$stateParams","$location","$urlRouter"]}function p(){function r(r,t){return{load:function(e,n){var a,o={template:null,controller:null,view:null,locals:null,notify:!0,async:!0,params:{}};return n=P(o,n),n.view&&(a=t.fromConfig(n.view,n.params,n.locals)),a&&n.notify&&r.$broadcast("$viewContentLoading",n),a}}}this.$get=r,r.$inject=["$rootScope","$templateFactory"]}function v(r,e,n,a,o){var i;try{i=a.get("$animator")}catch(u){}var s=!1,l={restrict:"ECA",terminal:!0,transclude:!0,compile:function(a,u,c){return function(a,u,f){function h(t){var i=r.$current&&r.$current.locals[$];if(i!==v){var s=w(d&&t);if(s.remove(u),p&&(p.$destroy(),p=null),!i)return v=null,E.state=null,s.restore(c(a),u);v=i,E.state=i.$$state;var l=e(s.populate(i.$template,u));if(p=a.$new(),i.$$controller){i.$scope=p;var f=n(i.$$controller,i);u.children().data("$ngControllerController",f)}l(p),p.$emit("$viewContentLoaded"),m&&p.$eval(m),o()}}var p,v,$=f[l.name]||f.name||"",m=f.onload||"",d=g(i)&&i(a,f),w=function(r){return{"true":{remove:function(r){d.leave(r.contents(),r)},restore:function(r,t){d.enter(r,t)},populate:function(r,e){var n=t.element("
").html(r).contents();return d.enter(n,e),n}},"false":{remove:function(r){r.html("")},restore:function(r,t){t.append(r)},populate:function(r,t){return t.html(r),t.contents()}}}[""+r]};u.append(c(a));var b=u.parent().inheritedData("$uiView");0>$.indexOf("@")&&($=$+"@"+(b?b.state.name:""));var E={name:$,state:null};u.data("$uiView",E);var x=function(){if(!s){s=!0;try{h(!0)}catch(r){throw s=!1,r}s=!1}};a.$on("$stateChangeSuccess",x),a.$on("$viewContentLoading",x),h(!1)}}};return l}function $(r){var t=r.match(/^([^(]+?)\s*(\((.*)\))?$/);if(!t||4!==t.length)throw Error("Invalid state ref '"+r+"'");return{state:t[1],paramExpr:t[3]||null}}function m(r){return{restrict:"A",link:function(t,n,a){var o=$(a.uiSref),i=null,u=r.$current,s="FORM"===n[0].nodeName,l=s?"action":"href",c=!0,f=n.parent().inheritedData("$uiView");f&&f.state&&f.state.name&&(u=f.state);var h=function(t){if(t&&(i=t),c){var a=r.href(o.state,i,{relative:u});return a?(n[0][l]=a,e):(c=!1,!1)}};o.paramExpr&&(t.$watch(o.paramExpr,function(r,t){r!==t&&h(r)},!0),i=t.$eval(o.paramExpr)),h(),s||n.bind("click",function(e){1!=e.which||e.ctrlKey||e.metaKey||e.shiftKey||(r.go(o.state,i,{relative:u}),t.$apply(),e.preventDefault())})}}}function d(r,t){function a(r){this.locals=r.locals.globals,this.params=this.locals.$stateParams}function o(){this.locals=null,this.params=null}function i(e,i){if(null!=i.redirectTo){var u,l=i.redirectTo;if(b(l))u=l;else{if(!w(l))throw Error("Invalid 'redirectTo' in when()");u=function(r,t){return l(r,t.path(),t.search())}}t.when(e,u)}else r.state(n(i,{parent:null,name:"route:"+encodeURIComponent(e),url:e,onEnter:a,onExit:o}));return s.push(i),this}function u(r,t,n){function a(r){return""!==r.name?r:e}var o={routes:s,params:n,current:e};return t.$on("$stateChangeStart",function(r,e,n,o){t.$broadcast("$routeChangeStart",a(e),a(o))}),t.$on("$stateChangeSuccess",function(r,e,n,i){o.current=a(e),t.$broadcast("$routeChangeSuccess",a(e),a(i)),j(n,o.params)}),t.$on("$stateChangeError",function(r,e,n,o,i,u){t.$broadcast("$routeChangeError",a(e),a(o),u)}),o}var s=[];a.$inject=["$$state"],this.when=i,this.$get=u,u.$inject=["$state","$rootScope","$routeParams"]}var g=t.isDefined,w=t.isFunction,b=t.isString,E=t.isObject,x=t.isArray,y=t.forEach,P=t.extend,j=t.copy;t.module("ui.router.util",["ng"]),t.module("ui.router.router",["ui.router.util"]),t.module("ui.router.state",["ui.router.router","ui.router.util"]),t.module("ui.router",["ui.router.state"]),t.module("ui.router.compat",["ui.router"]),u.$inject=["$q","$injector"],t.module("ui.router.util").service("$resolve",u),s.$inject=["$http","$templateCache","$injector"],t.module("ui.router.util").service("$templateFactory",s),l.prototype.concat=function(r){return new l(this.sourcePath+r+this.sourceSearch)},l.prototype.toString=function(){return this.source},l.prototype.exec=function(r,t){var e=this.regexp.exec(r);if(!e)return null;var n,a=this.params,o=a.length,i=this.segments.length-1,u={};if(i!==e.length-1)throw Error("Unbalanced capture group in route '"+this.source+"'");for(n=0;i>n;n++)u[a[n]]=e[n+1];for(;o>n;n++)u[a[n]]=t[a[n]];return u},l.prototype.parameters=function(){return this.params},l.prototype.format=function(r){var t=this.segments,e=this.params;if(!r)return t.join("");var n,a,o,i=t.length-1,u=e.length,s=t[0];for(n=0;i>n;n++)o=r[e[n]],null!=o&&(s+=encodeURIComponent(o)),s+=t[n+1];for(;u>n;n++)o=r[e[n]],null!=o&&(s+=(a?"&":"?")+e[n]+"="+encodeURIComponent(o),a=!0);return s},t.module("ui.router.util").provider("$urlMatcherFactory",c),f.$inject=["$urlMatcherFactoryProvider"],t.module("ui.router.router").provider("$urlRouter",f),h.$inject=["$urlRouterProvider","$urlMatcherFactoryProvider","$locationProvider"],t.module("ui.router.state").value("$stateParams",{}).provider("$state",h),p.$inject=[],t.module("ui.router.state").provider("$view",p),v.$inject=["$state","$compile","$controller","$injector","$anchorScroll"],t.module("ui.router.state").directive("uiView",v),m.$inject=["$state"],t.module("ui.router.state").directive("uiSref",m),d.$inject=["$stateProvider","$urlRouterProvider"],t.module("ui.router.compat").provider("$route",d).directive("ngView",v)})(window,window.angular); \ No newline at end of file +"undefined"!=typeof module&&"undefined"!=typeof exports&&module.exports===exports&&(module.exports="ui.router"),function(a,b,c){"use strict";function d(a,b){return z(new(z(function(){},{prototype:a})),b)}function e(a){return y(arguments,function(b){b!==a&&y(b,function(b,c){a.hasOwnProperty(c)||(a[c]=b)})}),a}function f(a,b){var c=[];for(var d in a.path)if(""!==a.path[d]){if(!b.path[d])break;c.push(a.path[d])}return c}function g(a,b){if(Array.prototype.indexOf)return a.indexOf(b,Number(arguments[2])||0);var c=a.length>>>0,d=Number(arguments[2])||0;for(d=0>d?Math.ceil(d):Math.floor(d),0>d&&(d+=c);c>d;d++)if(d in a&&a[d]===b)return d;return-1}function h(a,b,c,d){var e,h=f(c,d),i={},j=[];for(var k in h)if(h[k].params&&h[k].params.length){e=h[k].params;for(var l in e)g(j,e[l])>=0||(j.push(e[l]),i[e[l]]=a[e[l]])}return z({},i,b)}function i(a,b){var d=1,f=2,g={},h=[],i=g,j=z(a.when(g),{$$promises:g,$$values:g});this.study=function(g){function k(a,c){if(o[c]!==f){if(n.push(c),o[c]===d)throw n.splice(0,n.indexOf(c)),new Error("Cyclic dependency: "+n.join(" -> "));if(o[c]=d,v(a))m.push(c,[function(){return b.get(a)}],h);else{var e=b.annotate(a);y(e,function(a){a!==c&&g.hasOwnProperty(a)&&k(g[a],a)}),m.push(c,a,e)}n.pop(),o[c]=f}}function l(a){return w(a)&&a.then&&a.$$promises}if(!w(g))throw new Error("'invocables' must be an object");var m=[],n=[],o={};return y(g,k),g=n=o=null,function(d,f,g){function h(){--s||(u||e(r,f.$$values),p.$$values=r,p.$$promises=!0,o.resolve(r))}function k(a){p.$$failure=a,o.reject(a)}function n(c,e,f){function i(a){l.reject(a),k(a)}function j(){if(!t(p.$$failure))try{l.resolve(b.invoke(e,g,r)),l.promise.then(function(a){r[c]=a,h()},i)}catch(a){i(a)}}var l=a.defer(),m=0;y(f,function(a){q.hasOwnProperty(a)&&!d.hasOwnProperty(a)&&(m++,q[a].then(function(b){r[a]=b,--m||j()},i))}),m||j(),q[c]=l.promise}if(l(d)&&g===c&&(g=f,f=d,d=null),d){if(!w(d))throw new Error("'locals' must be an object")}else d=i;if(f){if(!l(f))throw new Error("'parent' must be a promise returned by $resolve.resolve()")}else f=j;var o=a.defer(),p=o.promise,q=p.$$promises={},r=z({},d),s=1+m.length/3,u=!1;if(t(f.$$failure))return k(f.$$failure),p;f.$$values?(u=e(r,f.$$values),h()):(z(q,f.$$promises),f.then(h,k));for(var v=0,x=m.length;x>v;v+=3)d.hasOwnProperty(m[v])?h():n(m[v],m[v+1],m[v+2]);return p}},this.resolve=function(a,b,c,d){return this.study(a)(b,c,d)}}function j(a,b,c){this.fromConfig=function(a,b,c){return t(a.template)?this.fromString(a.template,b):t(a.templateUrl)?this.fromUrl(a.templateUrl,b):t(a.templateProvider)?this.fromProvider(a.templateProvider,b,c):null},this.fromString=function(a,b){return u(a)?a(b):a},this.fromUrl=function(c,d){return u(c)&&(c=c(d)),null==c?null:a.get(c,{cache:b}).then(function(a){return a.data})},this.fromProvider=function(a,b,d){return c.invoke(a,null,d||{params:b})}}function k(a){function b(b){if(!/^\w+(-+\w+)*$/.test(b))throw new Error("Invalid parameter name '"+b+"' in pattern '"+a+"'");if(f[b])throw new Error("Duplicate parameter name '"+b+"' in pattern '"+a+"'");f[b]=!0,j.push(b)}function c(a){return a.replace(/[\\\[\]\^$*+?.()|{}]/g,"\\$&")}var d,e=/([:*])(\w+)|\{(\w+)(?:\:((?:[^{}\\]+|\\.|\{(?:[^{}\\]+|\\.)*\})+))?\}/g,f={},g="^",h=0,i=this.segments=[],j=this.params=[];this.source=a;for(var k,l,m;(d=e.exec(a))&&(k=d[2]||d[3],l=d[4]||("*"==d[1]?".*":"[^/]*"),m=a.substring(h,d.index),!(m.indexOf("?")>=0));)g+=c(m)+"("+l+")",b(k),i.push(m),h=e.lastIndex;m=a.substring(h);var n=m.indexOf("?");if(n>=0){var o=this.sourceSearch=m.substring(n);m=m.substring(0,n),this.sourcePath=a.substring(0,h+n),y(o.substring(1).split(/[&?]/),b)}else this.sourcePath=a,this.sourceSearch="";g+=c(m)+"$",i.push(m),this.regexp=new RegExp(g),this.prefix=i[0]}function l(){this.compile=function(a){return new k(a)},this.isMatcher=function(a){return w(a)&&u(a.exec)&&u(a.format)&&u(a.concat)},this.$get=function(){return this}}function m(a){function b(a){var b=/^\^((?:\\[^a-zA-Z0-9]|[^\\\[\]\^$*+?.()|{}]+)*)/.exec(a.source);return null!=b?b[1].replace(/\\(.)/g,"$1"):""}function c(a,b){return a.replace(/\$(\$|\d{1,2})/,function(a,c){return b["$"===c?0:Number(c)]})}function d(a,b,c){if(!c)return!1;var d=a.invoke(b,b,{$match:c});return t(d)?d:!0}var e=[],f=null;this.rule=function(a){if(!u(a))throw new Error("'rule' must be a function");return e.push(a),this},this.otherwise=function(a){if(v(a)){var b=a;a=function(){return b}}else if(!u(a))throw new Error("'rule' must be a function");return f=a,this},this.when=function(e,f){var g,h=v(f);if(v(e)&&(e=a.compile(e)),!h&&!u(f)&&!x(f))throw new Error("invalid 'handler' in when()");var i={matcher:function(b,c){return h&&(g=a.compile(c),c=["$match",function(a){return g.format(a)}]),z(function(a,e){return d(a,c,b.exec(e.path(),e.search()))},{prefix:v(b.prefix)?b.prefix:""})},regex:function(a,e){if(a.global||a.sticky)throw new Error("when() RegExp must not be global or sticky");return h&&(g=e,e=["$match",function(a){return c(g,a)}]),z(function(b,c){return d(b,e,a.exec(c.path()))},{prefix:b(a)})}},j={matcher:a.isMatcher(e),regex:e instanceof RegExp};for(var k in j)if(j[k])return this.rule(i[k](e,f));throw new Error("invalid 'what' in when()")},this.$get=["$location","$rootScope","$injector",function(a,b,c){function d(b){function d(b){var d=b(c,a);return d?(v(d)&&a.replace().url(d),!0):!1}if(!b||!b.defaultPrevented){var g,h=e.length;for(g=0;h>g;g++)if(d(e[g]))return;f&&d(f)}}return b.$on("$locationChangeSuccess",d),{sync:function(){d()}}}]}function n(a,e,f){function g(a){return 0===a.indexOf(".")||0===a.indexOf("^")}function i(a,b){var d=v(a),e=d?a:a.name,f=g(e);if(f){if(!b)throw new Error("No reference point given for path '"+e+"'");for(var h=e.split("."),i=0,j=h.length,k=b;j>i;i++)if(""!==h[i]||0!==i){if("^"!==h[i])break;if(!k.parent)throw new Error("Path '"+e+"' not valid for state '"+b.name+"'");k=k.parent}else k=b;h=h.slice(i).join("."),e=k.name+(k.name&&h?".":"")+h}var l=C[e];return!l||!d&&(d||l!==a&&l.self!==a)?c:l}function j(a,b){D[a]||(D[a]=[]),D[a].push(b)}function k(b){b=d(b,{self:b,resolve:b.resolve||{},toString:function(){return this.name}});var c=b.name;if(!v(c)||c.indexOf("@")>=0)throw new Error("State must have a valid name");if(C.hasOwnProperty(c))throw new Error("State '"+c+"'' is already defined");var e=-1!==c.indexOf(".")?c.substring(0,c.lastIndexOf(".")):v(b.parent)?b.parent:"";if(e&&!C[e])return j(e,b.self);for(var f in E)u(E[f])&&(b[f]=E[f](b,E.$delegates[f]));if(C[c]=b,!b["abstract"]&&b.url&&a.when(b.url,["$match","$stateParams",function(a,c){B.$current.navigable==b&&p(a,c)||B.transitionTo(b,a,!1)}]),D[c])for(var g=0;g=H;d--)g=u[d],g.self.onExit&&j.invoke(g.self.onExit,g.self,g.locals.globals),g.locals=null;for(d=H;d").html(a).contents();return r.enter(d,c),d}},"false":{remove:function(a){a.html("")},restore:function(a,b){b.append(a)},populate:function(a,b){return b.html(a),b.contents()}}}[a.toString()]};h.append(s);var v=h.parent().inheritedData("$uiView");p.indexOf("@")<0&&(p=p+"@"+(v?v.state.name:""));var w={name:p,state:null};h.data("$uiView",w);var x=function(){if(!i){i=!0;try{m(!0)}catch(a){throw i=!1,a}i=!1}};e.$on("$stateChangeSuccess",x),e.$on("$viewContentLoading",x),m(!1)}}};return j}function q(a){var b=a.replace(/\n/g," ").match(/^([^(]+?)\s*(\((.*)\))?$/);if(!b||4!==b.length)throw new Error("Invalid state ref '"+a+"'");return{state:b[1],paramExpr:b[3]||null}}function r(a){return{restrict:"A",link:function(b,c,d){var e=q(d.uiSref),f=null,g=a.$current,h="FORM"===c[0].nodeName,i=h?"action":"href",j=!0,k=c.parent().inheritedData("$uiView");k&&k.state&&k.state.name&&(g=k.state);var l=function(b){if(b&&(f=b),j){var d=a.href(e.state,f,{relative:g});return d?(c[0][i]=d,void 0):(j=!1,!1)}};e.paramExpr&&(b.$watch(e.paramExpr,function(a){a!==f&&l(a)},!0),f=b.$eval(e.paramExpr)),l(),h||c.bind("click",function(c){var d=c.which||c.button;0!==d&&1!=d||c.ctrlKey||c.metaKey||c.shiftKey||(b.$evalAsync(function(){a.go(e.state,f,{relative:g})}),c.preventDefault())})}}}function s(a,b){function e(a){this.locals=a.locals.globals,this.params=this.locals.$stateParams}function f(){this.locals=null,this.params=null}function g(c,g){if(null!=g.redirectTo){var h,j=g.redirectTo;if(v(j))h=j;else{if(!u(j))throw new Error("Invalid 'redirectTo' in when()");h=function(a,b){return j(a,b.path(),b.search())}}b.when(c,h)}else a.state(d(g,{parent:null,name:"route:"+encodeURIComponent(c),url:c,onEnter:e,onExit:f}));return i.push(g),this}function h(a,b,d){function e(a){return""!==a.name?a:c}var f={routes:i,params:d,current:c};return b.$on("$stateChangeStart",function(a,c,d,f){b.$broadcast("$routeChangeStart",e(c),e(f))}),b.$on("$stateChangeSuccess",function(a,c,d,g){f.current=e(c),b.$broadcast("$routeChangeSuccess",e(c),e(g)),A(d,f.params)}),b.$on("$stateChangeError",function(a,c,d,f,g,h){b.$broadcast("$routeChangeError",e(c),e(f),h)}),f}var i=[];e.$inject=["$$state"],this.when=g,this.$get=h,h.$inject=["$state","$rootScope","$routeParams"]}var t=b.isDefined,u=b.isFunction,v=b.isString,w=b.isObject,x=b.isArray,y=b.forEach,z=b.extend,A=b.copy;b.module("ui.router.util",["ng"]),b.module("ui.router.router",["ui.router.util"]),b.module("ui.router.state",["ui.router.router","ui.router.util"]),b.module("ui.router",["ui.router.state"]),b.module("ui.router.compat",["ui.router"]),i.$inject=["$q","$injector"],b.module("ui.router.util").service("$resolve",i),j.$inject=["$http","$templateCache","$injector"],b.module("ui.router.util").service("$templateFactory",j),k.prototype.concat=function(a){return new k(this.sourcePath+a+this.sourceSearch)},k.prototype.toString=function(){return this.source},k.prototype.exec=function(a,b){var c=this.regexp.exec(a);if(!c)return null;var d,e=this.params,f=e.length,g=this.segments.length-1,h={};if(g!==c.length-1)throw new Error("Unbalanced capture group in route '"+this.source+"'");for(d=0;g>d;d++)h[e[d]]=c[d+1];for(;f>d;d++)h[e[d]]=b[e[d]];return h},k.prototype.parameters=function(){return this.params},k.prototype.format=function(a){var b=this.segments,c=this.params;if(!a)return b.join("");var d,e,f,g=b.length-1,h=c.length,i=b[0];for(d=0;g>d;d++)f=a[c[d]],null!=f&&(i+=encodeURIComponent(f)),i+=b[d+1];for(;h>d;d++)f=a[c[d]],null!=f&&(i+=(e?"&":"?")+c[d]+"="+encodeURIComponent(f),e=!0);return i},b.module("ui.router.util").provider("$urlMatcherFactory",l),m.$inject=["$urlMatcherFactoryProvider"],b.module("ui.router.router").provider("$urlRouter",m),n.$inject=["$urlRouterProvider","$urlMatcherFactoryProvider","$locationProvider"],b.module("ui.router.state").value("$stateParams",{}).provider("$state",n),o.$inject=[],b.module("ui.router.state").provider("$view",o),p.$inject=["$state","$compile","$controller","$injector","$anchorScroll"],b.module("ui.router.state").directive("uiView",p),r.$inject=["$state"],b.module("ui.router.state").directive("uiSref",r),s.$inject=["$stateProvider","$urlRouterProvider"],b.module("ui.router.compat").provider("$route",s).directive("ngView",p)}(window,window.angular); \ No newline at end of file diff --git a/release/doc/$resolve.html b/release/doc/$resolve.html index 224845b81..d5d9f80ba 100644 --- a/release/doc/$resolve.html +++ b/release/doc/$resolve.html @@ -535,13 +535,13 @@
Returns:

- Documentation generated by JSDoc 3.1.0 on Mon Sep 02 2013 22:12:05 GMT-0400 (EDT) + Documentation generated by JSDoc 3.1.1 on Wed Dec 04 2013 21:16:33 GMT-0500 (EST)
diff --git a/release/doc/$templateFactory.html b/release/doc/$templateFactory.html index f45308105..1e5b5ff0f 100644 --- a/release/doc/$templateFactory.html +++ b/release/doc/$templateFactory.html @@ -993,13 +993,13 @@
Returns:

- Documentation generated by JSDoc 3.1.0 on Mon Sep 02 2013 22:12:05 GMT-0400 (EDT) + Documentation generated by JSDoc 3.1.1 on Wed Dec 04 2013 21:16:33 GMT-0500 (EST)
diff --git a/release/doc/$urlMatcherFactory.html b/release/doc/$urlMatcherFactory.html index f4fcf4cf5..e508010a8 100644 --- a/release/doc/$urlMatcherFactory.html +++ b/release/doc/$urlMatcherFactory.html @@ -402,13 +402,13 @@
Returns:

- Documentation generated by JSDoc 3.1.0 on Mon Sep 02 2013 22:12:05 GMT-0400 (EDT) + Documentation generated by JSDoc 3.1.1 on Wed Dec 04 2013 21:16:33 GMT-0500 (EST)
diff --git a/release/doc/UrlMatcher.html b/release/doc/UrlMatcher.html index 3c2faf125..c4aa2b9c9 100644 --- a/release/doc/UrlMatcher.html +++ b/release/doc/UrlMatcher.html @@ -818,13 +818,13 @@
Returns:

- Documentation generated by JSDoc 3.1.0 on Mon Sep 02 2013 22:12:05 GMT-0400 (EDT) + Documentation generated by JSDoc 3.1.1 on Wed Dec 04 2013 21:16:33 GMT-0500 (EST)
diff --git a/release/doc/global.html b/release/doc/global.html index 2dd9004bd..25f7a7cea 100644 --- a/release/doc/global.html +++ b/release/doc/global.html @@ -244,6 +244,164 @@
Returns:
+ + + + +
+

arraySearch(array, value) → {Number}

+ + +
+
+ + +
+

IE8-safe wrapper for Array.prototype.indexOf().

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
array + + +Array + + + +

A JavaScript array.

value + + +* + + + +

A value to search the array for.

+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
  • + common.js, line 54 +
+ + + + + + + +
+ + + + + + + +
Returns:
+ + +
+

Returns the array index value of value, or -1 if not present.

+
+ + + +
+
+ Type +
+
+ +Number + + +
+
+ + + +
@@ -408,7 +566,7 @@
Parameters:
Source:
  • - common.js, line 56 + common.js, line 78
@@ -445,13 +603,13 @@
Parameters:

- Documentation generated by JSDoc 3.1.0 on Mon Sep 02 2013 22:12:05 GMT-0400 (EDT) + Documentation generated by JSDoc 3.1.1 on Wed Dec 04 2013 21:16:33 GMT-0500 (EST)
diff --git a/release/doc/index.html b/release/doc/index.html index 351a274a5..18b459358 100644 --- a/release/doc/index.html +++ b/release/doc/index.html @@ -48,13 +48,13 @@


- Documentation generated by JSDoc 3.1.0 on Mon Sep 02 2013 22:12:05 GMT-0400 (EDT) + Documentation generated by JSDoc 3.1.1 on Wed Dec 04 2013 21:16:33 GMT-0500 (EST)