diff --git a/bower.json b/bower.json
index 6f0eee8fbff..8d14ace8610 100644
--- a/bower.json
+++ b/bower.json
@@ -13,12 +13,12 @@
"tests"
],
"dependencies": {
- "jquery": "~3.1.0",
- "angular": "~1.5.9",
- "angular-route": "~1.5.9",
- "angular-mocks": "~1.5.9",
- "angular-sanitize": "~1.5.9",
- "angular-native-dragdrop": "~1.2.2",
- "angular-bindonce": "~0.3.3"
+ "jquery": "3.1.0",
+ "angular": "1.5.3",
+ "angular-route": "1.5.3",
+ "angular-mocks": "1.5.3",
+ "angular-sanitize": "1.5.3",
+ "angular-native-dragdrop": "1.2.2",
+ "angular-bindonce": "0.3.3"
}
}
diff --git a/public/vendor/angular-bindonce/.bower.json b/public/vendor/angular-bindonce/.bower.json
index 313c654cc14..9eef82db403 100644
--- a/public/vendor/angular-bindonce/.bower.json
+++ b/public/vendor/angular-bindonce/.bower.json
@@ -30,8 +30,7 @@
"tag": "0.3.3",
"commit": "0fcf71e6effc88179893c9c06baf6c6bf9037632"
},
- "_source": "git://github.com/Pasvaz/bindonce.git",
- "_target": "~0.3.3",
- "_originalSource": "angular-bindonce",
- "_direct": true
+ "_source": "https://github.com/Pasvaz/bindonce.git",
+ "_target": "0.3.3",
+ "_originalSource": "angular-bindonce"
}
\ No newline at end of file
diff --git a/public/vendor/angular-mocks/.bower.json b/public/vendor/angular-mocks/.bower.json
index 9c007005ad9..563c2635a8a 100644
--- a/public/vendor/angular-mocks/.bower.json
+++ b/public/vendor/angular-mocks/.bower.json
@@ -1,20 +1,20 @@
{
"name": "angular-mocks",
- "version": "1.5.9-build.5020+sha.0784977",
+ "version": "1.5.3",
"license": "MIT",
"main": "./angular-mocks.js",
"ignore": [],
"dependencies": {
- "angular": "1.5.9-build.5020+sha.0784977"
+ "angular": "1.5.3"
},
"homepage": "https://github.com/angular/bower-angular-mocks",
- "_release": "1.5.9-build.5020+sha.0784977",
+ "_release": "1.5.3",
"_resolution": {
"type": "version",
- "tag": "v1.5.9-build.5020+sha.0784977",
- "commit": "f390789bb409cabbcaec5e3d316e467c9df5863f"
+ "tag": "v1.5.3",
+ "commit": "319557fe710cecc11e12c772cc1abb8098d29ccb"
},
"_source": "https://github.com/angular/bower-angular-mocks.git",
- "_target": "~1.5.9",
+ "_target": "1.5.3",
"_originalSource": "angular-mocks"
}
\ No newline at end of file
diff --git a/public/vendor/angular-mocks/LICENSE.md b/public/vendor/angular-mocks/LICENSE.md
deleted file mode 100644
index 2c395eef1ba..00000000000
--- a/public/vendor/angular-mocks/LICENSE.md
+++ /dev/null
@@ -1,21 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) 2016 Angular
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
diff --git a/public/vendor/angular-mocks/README.md b/public/vendor/angular-mocks/README.md
index 61b9d8c0831..440cce9b78a 100644
--- a/public/vendor/angular-mocks/README.md
+++ b/public/vendor/angular-mocks/README.md
@@ -20,7 +20,7 @@ You can `require` ngMock modules:
var angular = require('angular');
angular.module('myMod', [
require('angular-animate'),
- require('angular-mocks/ngMock'),
+ require('angular-mocks/ngMock')
require('angular-mocks/ngAnimateMock')
]);
```
diff --git a/public/vendor/angular-mocks/angular-mocks.js b/public/vendor/angular-mocks/angular-mocks.js
index 1917193cff6..a1fc2fcf7ae 100644
--- a/public/vendor/angular-mocks/angular-mocks.js
+++ b/public/vendor/angular-mocks/angular-mocks.js
@@ -1,9 +1,9 @@
/**
- * @license AngularJS v1.5.9-build.5020+sha.0784977
+ * @license AngularJS v1.5.3
* (c) 2010-2016 Google, Inc. http://angularjs.org
* License: MIT
*/
-(function(window, angular) {
+(function(window, angular, undefined) {
'use strict';
@@ -13,7 +13,6 @@
* @description
*
* Namespace from 'angular-mocks.js' which contains testing related code.
- *
*/
angular.mock = {};
@@ -25,7 +24,7 @@ angular.mock = {};
* @description
* This service is a mock implementation of {@link ng.$browser}. It provides fake
* implementation for commonly used browser apis that are hard to test, e.g. setTimeout, xhr,
- * cookies, etc.
+ * cookies, etc...
*
* The api of this service is the same as that of the real {@link ng.$browser $browser}, except
* that there are several helper methods available which can be used in tests.
@@ -40,7 +39,7 @@ angular.mock.$Browser = function() {
var self = this;
this.isMock = true;
- self.$$url = 'http://server/';
+ self.$$url = "http://server/";
self.$$lastUrl = self.$$url; // used by url polling fn
self.pollFns = [];
@@ -113,29 +112,19 @@ angular.mock.$Browser = function() {
* @param {number=} number of milliseconds to flush. See {@link #defer.now}
*/
self.defer.flush = function(delay) {
- var nextTime;
-
if (angular.isDefined(delay)) {
- // A delay was passed so compute the next time
- nextTime = self.defer.now + delay;
+ self.defer.now += delay;
} else {
if (self.deferredFns.length) {
- // No delay was passed so set the next time so that it clears the deferred queue
- nextTime = self.deferredFns[self.deferredFns.length - 1].time;
+ self.defer.now = self.deferredFns[self.deferredFns.length - 1].time;
} else {
- // No delay passed, but there are no deferred tasks so flush - indicates an error!
throw new Error('No deferred tasks to be flushed');
}
}
- while (self.deferredFns.length && self.deferredFns[0].time <= nextTime) {
- // Increment the time and call the next deferred function
- self.defer.now = self.deferredFns[0].time;
+ while (self.deferredFns.length && self.deferredFns[0].time <= self.defer.now) {
self.deferredFns.shift().fn();
}
-
- // Ensure that the current time is correct
- self.defer.now = nextTime;
};
self.$$baseHref = '/';
@@ -237,13 +226,13 @@ angular.mock.$ExceptionHandlerProvider = function() {
* @param {string} mode Mode of operation, defaults to `rethrow`.
*
* - `log`: Sometimes it is desirable to test that an error is thrown, for this case the `log`
- * mode stores an array of errors in `$exceptionHandler.errors`, to allow later assertion of
- * them. See {@link ngMock.$log#assertEmpty assertEmpty()} and
- * {@link ngMock.$log#reset reset()}.
+ * mode stores an array of errors in `$exceptionHandler.errors`, to allow later
+ * assertion of them. See {@link ngMock.$log#assertEmpty assertEmpty()} and
+ * {@link ngMock.$log#reset reset()}
* - `rethrow`: If any errors are passed to the handler in tests, it typically means that there
- * is a bug in the application or test, so this mock will make these tests fail. For any
- * implementations that expect exceptions to be thrown, the `rethrow` mode will also maintain
- * a log of thrown errors in `$exceptionHandler.errors`.
+ * is a bug in the application or test, so this mock will make these tests fail.
+ * For any implementations that expect exceptions to be thrown, the `rethrow` mode
+ * will also maintain a log of thrown errors.
*/
this.mode = function(mode) {
@@ -252,19 +241,19 @@ angular.mock.$ExceptionHandlerProvider = function() {
case 'rethrow':
var errors = [];
handler = function(e) {
- if (arguments.length === 1) {
+ if (arguments.length == 1) {
errors.push(e);
} else {
errors.push([].slice.call(arguments, 0));
}
- if (mode === 'rethrow') {
+ if (mode === "rethrow") {
throw e;
}
};
handler.errors = errors;
break;
default:
- throw new Error('Unknown mode \'' + mode + '\', only \'log\'/\'rethrow\' modes are allowed!');
+ throw new Error("Unknown mode '" + mode + "', only 'log'/'rethrow' modes are allowed!");
}
};
@@ -414,8 +403,8 @@ angular.mock.$LogProvider = function() {
});
});
if (errors.length) {
- errors.unshift('Expected $log to be empty! Either a message was logged unexpectedly, or ' +
- 'an expected log message was not checked and removed:');
+ errors.unshift("Expected $log to be empty! Either a message was logged unexpectedly, or " +
+ "an expected log message was not checked and removed:");
errors.push('');
throw new Error(errors.join('\n---------\n'));
}
@@ -463,7 +452,7 @@ angular.mock.$IntervalProvider = function() {
promise = deferred.promise;
count = (angular.isDefined(count)) ? count : 0;
- promise.then(null, function() {}, (!hasParams) ? fn : function() {
+ promise.then(null, null, (!hasParams) ? fn : function() {
fn.apply(null, args);
});
@@ -523,7 +512,6 @@ angular.mock.$IntervalProvider = function() {
});
if (angular.isDefined(fnIndex)) {
- repeatFns[fnIndex].deferred.promise.then(undefined, function() {});
repeatFns[fnIndex].deferred.reject('canceled');
repeatFns.splice(fnIndex, 1);
return true;
@@ -559,13 +547,16 @@ angular.mock.$IntervalProvider = function() {
};
-function jsonStringToDate(string) {
- // The R_ISO8061_STR regex is never going to fit into the 100 char limit!
- // eslit-disable-next-line max-len
- var R_ISO8061_STR = /^(-?\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d{3}))?)?)?(Z|([+-])(\d\d):?(\d\d)))?$/;
+/* jshint -W101 */
+/* The R_ISO8061_STR regex is never going to fit into the 100 char limit!
+ * This directive should go inside the anonymous function but a bug in JSHint means that it would
+ * not be enacted early enough to prevent the warning.
+ */
+var R_ISO8061_STR = /^(-?\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?:\:?(\d\d)(?:\:?(\d\d)(?:\.(\d{3}))?)?)?(Z|([+-])(\d\d):?(\d\d)))?$/;
+function jsonStringToDate(string) {
var match;
- if ((match = string.match(R_ISO8061_STR))) {
+ if (match = string.match(R_ISO8061_STR)) {
var date = new Date(0),
tzHour = 0,
tzMin = 0;
@@ -648,10 +639,9 @@ angular.mock.TzDate = function(offset, timestamp) {
timestamp = self.origDate.getTime();
if (isNaN(timestamp)) {
- // eslint-disable-next-line no-throw-literal
throw {
- name: 'Illegal Argument',
- message: 'Arg \'' + tsStr + '\' passed into TzDate constructor is not a valid date string'
+ name: "Illegal Argument",
+ message: "Arg '" + tsStr + "' passed into TzDate constructor is not a valid date string"
};
}
} else {
@@ -757,7 +747,7 @@ angular.mock.TzDate = function(offset, timestamp) {
angular.forEach(unimplementedMethods, function(methodName) {
self[methodName] = function() {
- throw new Error('Method \'' + methodName + '\' is not implemented in the TzDate mock');
+ throw new Error("Method '" + methodName + "' is not implemented in the TzDate mock");
};
});
@@ -766,6 +756,7 @@ angular.mock.TzDate = function(offset, timestamp) {
//make "tzDateInstance instanceof Date" return true
angular.mock.TzDate.prototype = Date.prototype;
+/* jshint +W101 */
/**
@@ -775,8 +766,6 @@ angular.mock.TzDate.prototype = Date.prototype;
* @description
* Mock implementation of the {@link ng.$animate `$animate`} service. Exposes two additional methods
* for testing animations.
- *
- * You need to require the `ngAnimateMock` module in your test suite for instance `beforeEach(module('ngAnimateMock'))`
*/
angular.mock.animate = angular.module('ngAnimateMock', ['ng'])
@@ -942,10 +931,13 @@ angular.mock.animate = angular.module('ngAnimateMock', ['ng'])
* @name angular.mock.dump
* @description
*
- * *NOTE*: This is not an injectable instance, just a globally available function.
+ * *NOTE*: this is not an injectable instance, just a globally available function.
*
- * Method for serializing common angular objects (scope, elements, etc..) into strings.
- * It is useful for logging objects to the console when debugging.
+ * Method for serializing common angular objects (scope, elements, etc..) into strings, useful for
+ * debugging.
+ *
+ * This method is also available on window, where it can be used to display objects on debug
+ * console.
*
* @param {*} object - any object to turn into string.
* @return {string} a serialized string of the argument
@@ -1011,10 +1003,8 @@ angular.mock.dump = function(object) {
* Fake HTTP backend implementation suitable for unit testing applications that use the
* {@link ng.$http $http service}.
*
- *
- * **Note**: For fake HTTP backend implementation suitable for end-to-end testing or backend-less
+ * *Note*: For fake HTTP backend implementation suitable for end-to-end testing or backend-less
* development please see {@link ngMockE2E.$httpBackend e2e $httpBackend mock}.
- *
*
* During unit testing, we want our unit tests to run quickly and have no external dependencies so
* we don’t want to send [XHR](https://developer.mozilla.org/en/xmlhttprequest) or
@@ -1213,7 +1203,7 @@ angular.mock.dump = function(object) {
$httpBackend.expectPOST('/add-msg.py', undefined, function(headers) {
// check if the header was sent, if it wasn't the expectation won't
// match the request and the test will fail
- return headers['Authorization'] === 'xxx';
+ return headers['Authorization'] == 'xxx';
}).respond(201, '');
$rootScope.saveMessage('whatever');
@@ -1338,15 +1328,12 @@ function createHttpBackendMock($rootScope, $timeout, $delegate, $browser) {
}
// TODO(vojta): change params to: method, url, data, headers, callback
- function $httpBackend(method, url, data, callback, headers, timeout, withCredentials, responseType, eventHandlers, uploadEventHandlers) {
+ function $httpBackend(method, url, data, callback, headers, timeout, withCredentials, responseType) {
var xhr = new MockXhr(),
expectation = expectations[0],
wasExpected = false;
- xhr.$$events = eventHandlers;
- xhr.upload.$$events = uploadEventHandlers;
-
function prettyPrint(data) {
return (angular.isString(data) || angular.isFunction(data) || data instanceof RegExp)
? data
@@ -1355,11 +1342,7 @@ function createHttpBackendMock($rootScope, $timeout, $delegate, $browser) {
function wrapResponse(wrapped) {
if (!$browser && timeout) {
- if (timeout.then) {
- timeout.then(handleTimeout);
- } else {
- $timeout(handleTimeout, timeout);
- }
+ timeout.then ? timeout.then(handleTimeout) : $timeout(handleTimeout, timeout);
}
return handleResponse;
@@ -1410,7 +1393,7 @@ function createHttpBackendMock($rootScope, $timeout, $delegate, $browser) {
// if $browser specified, we do auto flush all requests
($browser ? $browser.defer : responsesPush)(wrapResponse(definition));
} else if (definition.passThrough) {
- $delegate(method, url, data, callback, headers, timeout, withCredentials, responseType, eventHandlers, uploadEventHandlers);
+ $delegate(method, url, data, callback, headers, timeout, withCredentials, responseType);
} else throw new Error('No response defined !');
return;
}
@@ -1428,7 +1411,7 @@ function createHttpBackendMock($rootScope, $timeout, $delegate, $browser) {
* Creates a new backend definition.
*
* @param {string} method HTTP method.
- * @param {string|RegExp|function(string)=} url HTTP url or function that receives a url
+ * @param {string|RegExp|function(string)} url HTTP url or function that receives a url
* and returns true if the url matches the current definition.
* @param {(string|RegExp|function(string))=} data HTTP request body or function that receives
* data string and returns true if the data is as expected.
@@ -1440,19 +1423,14 @@ function createHttpBackendMock($rootScope, $timeout, $delegate, $browser) {
* order to change how a matched request is handled.
*
* - respond –
- * ```js
- * {function([status,] data[, headers, statusText])
- * | function(function(method, url, data, headers, params)}
- * ```
+ * `{function([status,] data[, headers, statusText])
+ * | function(function(method, url, data, headers, params)}`
* – The respond method takes a set of static data to be returned or a function that can
- * return an array containing response status (number), response data (Array|Object|string),
- * response headers (Object), and the text for the status (string). The respond method returns
- * the `requestHandler` object for possible overrides.
+ * return an array containing response status (number), response data (string), response
+ * headers (Object), and the text for the status (string). The respond method returns the
+ * `requestHandler` object for possible overrides.
*/
$httpBackend.when = function(method, url, data, headers, keys) {
-
- assertArgDefined(arguments, 1, 'url');
-
var definition = new MockHttpExpectation(method, url, data, headers, keys),
chain = {
respond: function(status, data, headers, statusText) {
@@ -1480,7 +1458,7 @@ function createHttpBackendMock($rootScope, $timeout, $delegate, $browser) {
* @description
* Creates a new backend definition for GET requests. For more info see `when()`.
*
- * @param {string|RegExp|function(string)=} url HTTP url or function that receives a url
+ * @param {string|RegExp|function(string)} url HTTP url or function that receives a url
* and returns true if the url matches the current definition.
* @param {(Object|function(Object))=} headers HTTP headers.
* @param {(Array)=} keys Array of keys to assign to regex matches in request url described above.
@@ -1495,7 +1473,7 @@ function createHttpBackendMock($rootScope, $timeout, $delegate, $browser) {
* @description
* Creates a new backend definition for HEAD requests. For more info see `when()`.
*
- * @param {string|RegExp|function(string)=} url HTTP url or function that receives a url
+ * @param {string|RegExp|function(string)} url HTTP url or function that receives a url
* and returns true if the url matches the current definition.
* @param {(Object|function(Object))=} headers HTTP headers.
* @param {(Array)=} keys Array of keys to assign to regex matches in request url described above.
@@ -1510,7 +1488,7 @@ function createHttpBackendMock($rootScope, $timeout, $delegate, $browser) {
* @description
* Creates a new backend definition for DELETE requests. For more info see `when()`.
*
- * @param {string|RegExp|function(string)=} url HTTP url or function that receives a url
+ * @param {string|RegExp|function(string)} url HTTP url or function that receives a url
* and returns true if the url matches the current definition.
* @param {(Object|function(Object))=} headers HTTP headers.
* @param {(Array)=} keys Array of keys to assign to regex matches in request url described above.
@@ -1525,7 +1503,7 @@ function createHttpBackendMock($rootScope, $timeout, $delegate, $browser) {
* @description
* Creates a new backend definition for POST requests. For more info see `when()`.
*
- * @param {string|RegExp|function(string)=} url HTTP url or function that receives a url
+ * @param {string|RegExp|function(string)} url HTTP url or function that receives a url
* and returns true if the url matches the current definition.
* @param {(string|RegExp|function(string))=} data HTTP request body or function that receives
* data string and returns true if the data is as expected.
@@ -1542,7 +1520,7 @@ function createHttpBackendMock($rootScope, $timeout, $delegate, $browser) {
* @description
* Creates a new backend definition for PUT requests. For more info see `when()`.
*
- * @param {string|RegExp|function(string)=} url HTTP url or function that receives a url
+ * @param {string|RegExp|function(string)} url HTTP url or function that receives a url
* and returns true if the url matches the current definition.
* @param {(string|RegExp|function(string))=} data HTTP request body or function that receives
* data string and returns true if the data is as expected.
@@ -1559,7 +1537,7 @@ function createHttpBackendMock($rootScope, $timeout, $delegate, $browser) {
* @description
* Creates a new backend definition for JSONP requests. For more info see `when()`.
*
- * @param {string|RegExp|function(string)=} url HTTP url or function that receives a url
+ * @param {string|RegExp|function(string)} url HTTP url or function that receives a url
* and returns true if the url matches the current definition.
* @param {(Array)=} keys Array of keys to assign to regex matches in request url described above.
* @returns {requestHandler} Returns an object with `respond` method that controls how a matched
@@ -1622,7 +1600,7 @@ function createHttpBackendMock($rootScope, $timeout, $delegate, $browser) {
* Creates a new request expectation.
*
* @param {string} method HTTP method.
- * @param {string|RegExp|function(string)=} url HTTP url or function that receives a url
+ * @param {string|RegExp|function(string)} url HTTP url or function that receives a url
* and returns true if the url matches the current definition.
* @param {(string|RegExp|function(string)|Object)=} data HTTP request body or function that
* receives data string and returns true if the data is as expected, or Object if request body
@@ -1635,19 +1613,14 @@ function createHttpBackendMock($rootScope, $timeout, $delegate, $browser) {
* order to change how a matched request is handled.
*
* - respond –
- * ```
- * { function([status,] data[, headers, statusText])
- * | function(function(method, url, data, headers, params)}
- * ```
+ * `{function([status,] data[, headers, statusText])
+ * | function(function(method, url, data, headers, params)}`
* – The respond method takes a set of static data to be returned or a function that can
- * return an array containing response status (number), response data (Array|Object|string),
- * response headers (Object), and the text for the status (string). The respond method returns
- * the `requestHandler` object for possible overrides.
+ * return an array containing response status (number), response data (string), response
+ * headers (Object), and the text for the status (string). The respond method returns the
+ * `requestHandler` object for possible overrides.
*/
$httpBackend.expect = function(method, url, data, headers, keys) {
-
- assertArgDefined(arguments, 1, 'url');
-
var expectation = new MockHttpExpectation(method, url, data, headers, keys),
chain = {
respond: function(status, data, headers, statusText) {
@@ -1666,7 +1639,7 @@ function createHttpBackendMock($rootScope, $timeout, $delegate, $browser) {
* @description
* Creates a new request expectation for GET requests. For more info see `expect()`.
*
- * @param {string|RegExp|function(string)=} url HTTP url or function that receives a url
+ * @param {string|RegExp|function(string)} url HTTP url or function that receives a url
* and returns true if the url matches the current definition.
* @param {Object=} headers HTTP headers.
* @param {(Array)=} keys Array of keys to assign to regex matches in request url described above.
@@ -1681,7 +1654,7 @@ function createHttpBackendMock($rootScope, $timeout, $delegate, $browser) {
* @description
* Creates a new request expectation for HEAD requests. For more info see `expect()`.
*
- * @param {string|RegExp|function(string)=} url HTTP url or function that receives a url
+ * @param {string|RegExp|function(string)} url HTTP url or function that receives a url
* and returns true if the url matches the current definition.
* @param {Object=} headers HTTP headers.
* @param {(Array)=} keys Array of keys to assign to regex matches in request url described above.
@@ -1696,7 +1669,7 @@ function createHttpBackendMock($rootScope, $timeout, $delegate, $browser) {
* @description
* Creates a new request expectation for DELETE requests. For more info see `expect()`.
*
- * @param {string|RegExp|function(string)=} url HTTP url or function that receives a url
+ * @param {string|RegExp|function(string)} url HTTP url or function that receives a url
* and returns true if the url matches the current definition.
* @param {Object=} headers HTTP headers.
* @param {(Array)=} keys Array of keys to assign to regex matches in request url described above.
@@ -1711,7 +1684,7 @@ function createHttpBackendMock($rootScope, $timeout, $delegate, $browser) {
* @description
* Creates a new request expectation for POST requests. For more info see `expect()`.
*
- * @param {string|RegExp|function(string)=} url HTTP url or function that receives a url
+ * @param {string|RegExp|function(string)} url HTTP url or function that receives a url
* and returns true if the url matches the current definition.
* @param {(string|RegExp|function(string)|Object)=} data HTTP request body or function that
* receives data string and returns true if the data is as expected, or Object if request body
@@ -1729,7 +1702,7 @@ function createHttpBackendMock($rootScope, $timeout, $delegate, $browser) {
* @description
* Creates a new request expectation for PUT requests. For more info see `expect()`.
*
- * @param {string|RegExp|function(string)=} url HTTP url or function that receives a url
+ * @param {string|RegExp|function(string)} url HTTP url or function that receives a url
* and returns true if the url matches the current definition.
* @param {(string|RegExp|function(string)|Object)=} data HTTP request body or function that
* receives data string and returns true if the data is as expected, or Object if request body
@@ -1747,7 +1720,7 @@ function createHttpBackendMock($rootScope, $timeout, $delegate, $browser) {
* @description
* Creates a new request expectation for PATCH requests. For more info see `expect()`.
*
- * @param {string|RegExp|function(string)=} url HTTP url or function that receives a url
+ * @param {string|RegExp|function(string)} url HTTP url or function that receives a url
* and returns true if the url matches the current definition.
* @param {(string|RegExp|function(string)|Object)=} data HTTP request body or function that
* receives data string and returns true if the data is as expected, or Object if request body
@@ -1765,7 +1738,7 @@ function createHttpBackendMock($rootScope, $timeout, $delegate, $browser) {
* @description
* Creates a new request expectation for JSONP requests. For more info see `expect()`.
*
- * @param {string|RegExp|function(string)=} url HTTP url or function that receives an url
+ * @param {string|RegExp|function(string)} url HTTP url or function that receives an url
* and returns true if the url matches the current definition.
* @param {(Array)=} keys Array of keys to assign to regex matches in request url described above.
* @returns {requestHandler} Returns an object with `respond` method that controls how a matched
@@ -1796,34 +1769,24 @@ function createHttpBackendMock($rootScope, $timeout, $delegate, $browser) {
* @ngdoc method
* @name $httpBackend#flush
* @description
- * Flushes pending requests using the trained responses. Requests are flushed in the order they
- * were made, but it is also possible to skip one or more requests (for example to have them
- * flushed later). This is useful for simulating scenarios where responses arrive from the server
- * in any order.
+ * Flushes all pending requests using the trained responses.
*
- * If there are no pending requests to flush when the method is called, an exception is thrown (as
- * this is typically a sign of programming error).
- *
- * @param {number=} count - Number of responses to flush. If undefined/null, all pending requests
- * (starting after `skip`) will be flushed.
- * @param {number=} [skip=0] - Number of pending requests to skip. For example, a value of `5`
- * would skip the first 5 pending requests and start flushing from the 6th onwards.
+ * @param {number=} count Number of responses to flush (in the order they arrived). If undefined,
+ * all pending requests will be flushed. If there are no pending requests when the flush method
+ * is called an exception is thrown (as this typically a sign of programming error).
*/
- $httpBackend.flush = function(count, skip, digest) {
+ $httpBackend.flush = function(count, digest) {
if (digest !== false) $rootScope.$digest();
-
- skip = skip || 0;
- if (skip >= responses.length) throw new Error('No pending request to flush !');
+ if (!responses.length) throw new Error('No pending request to flush !');
if (angular.isDefined(count) && count !== null) {
while (count--) {
- var part = responses.splice(skip, 1);
- if (!part.length) throw new Error('No more pending request to flush !');
- part[0]();
+ if (!responses.length) throw new Error('No more pending request to flush !');
+ responses.shift()();
}
} else {
- while (responses.length > skip) {
- responses.splice(skip, 1)[0]();
+ while (responses.length) {
+ responses.shift()();
}
}
$httpBackend.verifyNoOutstandingExpectation(digest);
@@ -1865,8 +1828,7 @@ function createHttpBackendMock($rootScope, $timeout, $delegate, $browser) {
* afterEach($httpBackend.verifyNoOutstandingRequest);
* ```
*/
- $httpBackend.verifyNoOutstandingRequest = function(digest) {
- if (digest !== false) $rootScope.$digest();
+ $httpBackend.verifyNoOutstandingRequest = function() {
if (responses.length) {
throw new Error('Unflushed requests: ' + responses.length);
}
@@ -1892,52 +1854,25 @@ function createHttpBackendMock($rootScope, $timeout, $delegate, $browser) {
function createShortMethods(prefix) {
angular.forEach(['GET', 'DELETE', 'JSONP', 'HEAD'], function(method) {
$httpBackend[prefix + method] = function(url, headers, keys) {
- assertArgDefined(arguments, 0, 'url');
-
- // Change url to `null` if `undefined` to stop it throwing an exception further down
- if (angular.isUndefined(url)) url = null;
-
return $httpBackend[prefix](method, url, undefined, headers, keys);
};
});
angular.forEach(['PUT', 'POST', 'PATCH'], function(method) {
$httpBackend[prefix + method] = function(url, data, headers, keys) {
- assertArgDefined(arguments, 0, 'url');
-
- // Change url to `null` if `undefined` to stop it throwing an exception further down
- if (angular.isUndefined(url)) url = null;
-
return $httpBackend[prefix](method, url, data, headers, keys);
};
});
}
}
-function assertArgDefined(args, index, name) {
- if (args.length > index && angular.isUndefined(args[index])) {
- throw new Error('Undefined argument `' + name + '`; the argument is provided but not defined');
- }
-}
-
-
function MockHttpExpectation(method, url, data, headers, keys) {
- function getUrlParams(u) {
- var params = u.slice(u.indexOf('?') + 1).split('&');
- return params.sort();
- }
-
- function compareUrl(u) {
- return (url.slice(0, url.indexOf('?')) === u.slice(0, u.indexOf('?')) &&
- getUrlParams(url).join() === getUrlParams(u).join());
- }
-
this.data = data;
this.headers = headers;
this.match = function(m, u, d, h) {
- if (method !== m) return false;
+ if (method != m) return false;
if (!this.matchUrl(u)) return false;
if (angular.isDefined(d) && !this.matchData(d)) return false;
if (angular.isDefined(h) && !this.matchHeaders(h)) return false;
@@ -1948,7 +1883,7 @@ function MockHttpExpectation(method, url, data, headers, keys) {
if (!url) return true;
if (angular.isFunction(url.test)) return url.test(u);
if (angular.isFunction(url)) return url(u);
- return (url === u || compareUrl(u));
+ return url == u;
};
this.matchHeaders = function(h) {
@@ -1964,7 +1899,6 @@ function MockHttpExpectation(method, url, data, headers, keys) {
if (data && !angular.isString(data)) {
return angular.equals(angular.fromJson(angular.toJson(data)), angular.fromJson(d));
}
- // eslint-disable-next-line eqeqeq
return data == d;
};
@@ -1996,7 +1930,7 @@ function MockHttpExpectation(method, url, data, headers, keys) {
var obj = {}, key_value, key,
queryStr = u.indexOf('?') > -1
? u.substring(u.indexOf('?') + 1)
- : '';
+ : "";
angular.forEach(queryStr.split('&'), function(keyValue) {
if (keyValue) {
@@ -2063,7 +1997,7 @@ function MockXhr() {
header = undefined;
angular.forEach(this.$$respHeaders, function(headerVal, headerName) {
- if (!header && angular.lowercase(headerName) === name) header = headerVal;
+ if (!header && angular.lowercase(headerName) == name) header = headerVal;
});
return header;
};
@@ -2078,20 +2012,6 @@ function MockXhr() {
};
this.abort = angular.noop;
-
- // This section simulates the events on a real XHR object (and the upload object)
- // When we are testing $httpBackend (inside the angular project) we make partial use of this
- // but store the events directly ourselves on `$$events`, instead of going through the `addEventListener`
- this.$$events = {};
- this.addEventListener = function(name, listener) {
- if (angular.isUndefined(this.$$events[name])) this.$$events[name] = [];
- this.$$events[name].push(listener);
- };
-
- this.upload = {
- $$events: {},
- addEventListener: this.addEventListener
- };
}
@@ -2136,7 +2056,7 @@ angular.mock.$TimeoutDecorator = ['$delegate', '$browser', function($delegate, $
function formatPendingTasksAsString(tasks) {
var result = [];
angular.forEach(tasks, function(task) {
- result.push('{id: ' + task.id + ', time: ' + task.time + '}');
+ result.push('{id: ' + task.id + ', ' + 'time: ' + task.time + '}');
});
return result.join(', ');
@@ -2246,15 +2166,9 @@ angular.mock.$RootElementProvider = function() {
angular.mock.$ControllerDecorator = ['$delegate', function($delegate) {
return function(expression, locals, later, ident) {
if (later && typeof later === 'object') {
- var instantiate = $delegate(expression, locals, true, ident);
- angular.extend(instantiate.instance, later);
-
- var instance = instantiate();
- if (instance !== instantiate.instance) {
- angular.extend(instance, later);
- }
-
- return instance;
+ var create = $delegate(expression, locals, true, ident);
+ angular.extend(create.instance, later);
+ return create();
}
return $delegate(expression, locals, later, ident);
};
@@ -2264,21 +2178,12 @@ angular.mock.$ControllerDecorator = ['$delegate', function($delegate) {
* @ngdoc service
* @name $componentController
* @description
- * A service that can be used to create instances of component controllers. Useful for unit-testing.
- *
+ * A service that can be used to create instances of component controllers.
+ *
* Be aware that the controller will be instantiated and attached to the scope as specified in
- * the component definition object. If you do not provide a `$scope` object in the `locals` param
- * then the helper will create a new isolated scope as a child of `$rootScope`.
- *
- * If you are using `$element` or `$attrs` in the controller, make sure to provide them as `locals`.
- * The `$element` must be a jqLite-wrapped DOM element, and `$attrs` should be an object that
- * has all properties / functions that you are using in the controller. If this is getting too complex,
- * you should compile the component instead and access the component's controller via the
- * {@link angular.element#methods `controller`} function.
- *
- * See also the section on {@link guide/component#unit-testing-component-controllers unit-testing component controllers}
- * in the guide.
- *
+ * the component definition object. That means that you must always provide a `$scope` object
+ * in the `locals` param.
+ *
* @param {string} componentName the name of the component whose controller we want to instantiate
* @param {Object} locals Injection locals for Controller.
* @param {Object=} bindings Properties to add to the controller before invoking the constructor. This is used
@@ -2286,9 +2191,8 @@ angular.mock.$ControllerDecorator = ['$delegate', function($delegate) {
* @param {string=} ident Override the property name to use when attaching the controller to the scope.
* @return {Object} Instance of requested controller.
*/
-angular.mock.$ComponentControllerProvider = ['$compileProvider',
- function ComponentControllerProvider($compileProvider) {
- this.$get = ['$controller','$injector', '$rootScope', function($controller, $injector, $rootScope) {
+angular.mock.$ComponentControllerProvider = ['$compileProvider', function($compileProvider) {
+ this.$get = ['$controller','$injector', function($controller,$injector) {
return function $componentController(componentName, locals, bindings, ident) {
// get all directives associated to the component name
var directives = $injector.get(componentName + 'Directive');
@@ -2306,9 +2210,6 @@ angular.mock.$ComponentControllerProvider = ['$compileProvider',
}
// get the info of the component
var directiveInfo = candidateDirectives[0];
- // create a scope if needed
- locals = locals || {};
- locals.$scope = locals.$scope || $rootScope.$new(true);
return $controller(directiveInfo.controller, locals, bindings, ident || directiveInfo.controllerAs);
};
}];
@@ -2330,34 +2231,6 @@ angular.mock.$ComponentControllerProvider = ['$compileProvider',
*
*
*
- * @installation
- *
- * First, download the file:
- * * [Google CDN](https://developers.google.com/speed/libraries/devguide#angularjs) e.g.
- * `"//ajax.googleapis.com/ajax/libs/angularjs/X.Y.Z/angular-mocks.js"`
- * * [NPM](https://www.npmjs.com/) e.g. `npm install angular-mocks@X.Y.Z`
- * * [Bower](http://bower.io) e.g. `bower install angular-mocks#X.Y.Z`
- * * [code.angularjs.org](https://code.angularjs.org/) (discouraged for production use) e.g.
- * `"//code.angularjs.org/X.Y.Z/angular-mocks.js"`
- *
- * where X.Y.Z is the AngularJS version you are running.
- *
- * Then, configure your test runner to load `angular-mocks.js` after `angular.js`.
- * This example uses Karma:
- *
- * ```
- * config.set({
- * files: [
- * 'build/angular.js', // and other module files you need
- * 'build/angular-mocks.js',
- * '',
- * ''
- * ]
- * });
- * ```
- *
- * Including the `angular-mocks.js` file automatically adds the `ngMock` module, so your tests
- * are ready to go!
*/
angular.module('ngMock', ['ng']).provider({
$browser: angular.mock.$BrowserProvider,
@@ -2386,7 +2259,6 @@ angular.module('ngMock', ['ng']).provider({
* the {@link ngMockE2E.$httpBackend e2e $httpBackend} mock.
*/
angular.module('ngMockE2E', ['ng']).config(['$provide', function($provide) {
- $provide.value('$httpBackend', angular.injector(['ng']).get('$httpBackend'));
$provide.decorator('$httpBackend', angular.mock.e2e.$httpBackendDecorator);
}]);
@@ -2398,10 +2270,8 @@ angular.module('ngMockE2E', ['ng']).config(['$provide', function($provide) {
* Fake HTTP backend implementation suitable for end-to-end testing or backend-less development of
* applications that use the {@link ng.$http $http service}.
*
- *
- * **Note**: For fake http backend implementation suitable for unit testing please see
+ * *Note*: For fake http backend implementation suitable for unit testing please see
* {@link ngMock.$httpBackend unit-testing $httpBackend mock}.
- *
*
* This implementation can be used to respond with static or dynamic responses via the `when` api
* and its shortcuts (`whenGET`, `whenPOST`, etc) and optionally pass through requests to the
@@ -2422,9 +2292,9 @@ angular.module('ngMockE2E', ['ng']).config(['$provide', function($provide) {
* on the `ngMockE2E` and your application modules and defines the fake backend:
*
* ```js
- * var myAppDev = angular.module('myAppDev', ['myApp', 'ngMockE2E']);
+ * myAppDev = angular.module('myAppDev', ['myApp', 'ngMockE2E']);
* myAppDev.run(function($httpBackend) {
- * var phones = [{name: 'phone1'}, {name: 'phone2'}];
+ * phones = [{name: 'phone1'}, {name: 'phone2'}];
*
* // returns the current list of phones
* $httpBackend.whenGET('/phones').respond(phones);
@@ -2435,74 +2305,12 @@ angular.module('ngMockE2E', ['ng']).config(['$provide', function($provide) {
* phones.push(phone);
* return [200, phone, {}];
* });
- * $httpBackend.whenGET(/^\/templates\//).passThrough(); // Requests for templates are handled by the real server
+ * $httpBackend.whenGET(/^\/templates\//).passThrough();
* //...
* });
* ```
*
* Afterwards, bootstrap your app with this new module.
- *
- * ## Example
- *
- *
- * var myApp = angular.module('myApp', []);
- *
- * myApp.controller('MainCtrl', function MainCtrl($http) {
- * var ctrl = this;
- *
- * ctrl.phones = [];
- * ctrl.newPhone = {
- * name: ''
- * };
- *
- * ctrl.getPhones = function() {
- * $http.get('/phones').then(function(response) {
- * ctrl.phones = response.data;
- * });
- * };
- *
- * ctrl.addPhone = function(phone) {
- * $http.post('/phones', phone).then(function() {
- * ctrl.newPhone = {name: ''};
- * return ctrl.getPhones();
- * });
- * };
- *
- * ctrl.getPhones();
- * });
- *
- *
- * var myAppDev = angular.module('myAppE2E', ['myApp', 'ngMockE2E']);
- *
- * myAppDev.run(function($httpBackend) {
- * var phones = [{name: 'phone1'}, {name: 'phone2'}];
- *
- * // returns the current list of phones
- * $httpBackend.whenGET('/phones').respond(phones);
- *
- * // adds a new phone to the phones array
- * $httpBackend.whenPOST('/phones').respond(function(method, url, data) {
- * var phone = angular.fromJson(data);
- * phones.push(phone);
- * return [200, phone, {}];
- * });
- * });
- *
- *
- *
- *
- *
Phones
- *
- *
{{phone.name}}
- *
- *
- *
- *
- *
- *
*/
/**
@@ -2513,7 +2321,7 @@ angular.module('ngMockE2E', ['ng']).config(['$provide', function($provide) {
* Creates a new backend definition.
*
* @param {string} method HTTP method.
- * @param {string|RegExp|function(string)=} url HTTP url or function that receives a url
+ * @param {string|RegExp|function(string)} url HTTP url or function that receives a url
* and returns true if the url matches the current definition.
* @param {(string|RegExp)=} data HTTP request body.
* @param {(Object|function(Object))=} headers HTTP headers or function that receives http header
@@ -2525,13 +2333,11 @@ angular.module('ngMockE2E', ['ng']).config(['$provide', function($provide) {
* `respond` or `passThrough` again in order to change how a matched request is handled.
*
* - respond –
- * ```
- * { function([status,] data[, headers, statusText])
- * | function(function(method, url, data, headers, params)}
- * ```
+ * `{function([status,] data[, headers, statusText])
+ * | function(function(method, url, data, headers, params)}`
* – The respond method takes a set of static data to be returned or a function that can return
- * an array containing response status (number), response data (Array|Object|string), response
- * headers (Object), and the text for the status (string).
+ * an array containing response status (number), response data (string), response headers
+ * (Object), and the text for the status (string).
* - passThrough – `{function()}` – Any request matching a backend definition with
* `passThrough` handler will be passed through to the real backend (an XHR request will be made
* to the server.)
@@ -2545,7 +2351,7 @@ angular.module('ngMockE2E', ['ng']).config(['$provide', function($provide) {
* @description
* Creates a new backend definition for GET requests. For more info see `when()`.
*
- * @param {string|RegExp|function(string)=} url HTTP url or function that receives a url
+ * @param {string|RegExp|function(string)} url HTTP url or function that receives a url
* and returns true if the url matches the current definition.
* @param {(Object|function(Object))=} headers HTTP headers.
* @param {(Array)=} keys Array of keys to assign to regex matches in request url described on
@@ -2562,7 +2368,7 @@ angular.module('ngMockE2E', ['ng']).config(['$provide', function($provide) {
* @description
* Creates a new backend definition for HEAD requests. For more info see `when()`.
*
- * @param {string|RegExp|function(string)=} url HTTP url or function that receives a url
+ * @param {string|RegExp|function(string)} url HTTP url or function that receives a url
* and returns true if the url matches the current definition.
* @param {(Object|function(Object))=} headers HTTP headers.
* @param {(Array)=} keys Array of keys to assign to regex matches in request url described on
@@ -2579,7 +2385,7 @@ angular.module('ngMockE2E', ['ng']).config(['$provide', function($provide) {
* @description
* Creates a new backend definition for DELETE requests. For more info see `when()`.
*
- * @param {string|RegExp|function(string)=} url HTTP url or function that receives a url
+ * @param {string|RegExp|function(string)} url HTTP url or function that receives a url
* and returns true if the url matches the current definition.
* @param {(Object|function(Object))=} headers HTTP headers.
* @param {(Array)=} keys Array of keys to assign to regex matches in request url described on
@@ -2596,7 +2402,7 @@ angular.module('ngMockE2E', ['ng']).config(['$provide', function($provide) {
* @description
* Creates a new backend definition for POST requests. For more info see `when()`.
*
- * @param {string|RegExp|function(string)=} url HTTP url or function that receives a url
+ * @param {string|RegExp|function(string)} url HTTP url or function that receives a url
* and returns true if the url matches the current definition.
* @param {(string|RegExp)=} data HTTP request body.
* @param {(Object|function(Object))=} headers HTTP headers.
@@ -2614,7 +2420,7 @@ angular.module('ngMockE2E', ['ng']).config(['$provide', function($provide) {
* @description
* Creates a new backend definition for PUT requests. For more info see `when()`.
*
- * @param {string|RegExp|function(string)=} url HTTP url or function that receives a url
+ * @param {string|RegExp|function(string)} url HTTP url or function that receives a url
* and returns true if the url matches the current definition.
* @param {(string|RegExp)=} data HTTP request body.
* @param {(Object|function(Object))=} headers HTTP headers.
@@ -2632,7 +2438,7 @@ angular.module('ngMockE2E', ['ng']).config(['$provide', function($provide) {
* @description
* Creates a new backend definition for PATCH requests. For more info see `when()`.
*
- * @param {string|RegExp|function(string)=} url HTTP url or function that receives a url
+ * @param {string|RegExp|function(string)} url HTTP url or function that receives a url
* and returns true if the url matches the current definition.
* @param {(string|RegExp)=} data HTTP request body.
* @param {(Object|function(Object))=} headers HTTP headers.
@@ -2650,7 +2456,7 @@ angular.module('ngMockE2E', ['ng']).config(['$provide', function($provide) {
* @description
* Creates a new backend definition for JSONP requests. For more info see `when()`.
*
- * @param {string|RegExp|function(string)=} url HTTP url or function that receives a url
+ * @param {string|RegExp|function(string)} url HTTP url or function that receives a url
* and returns true if the url matches the current definition.
* @param {(Array)=} keys Array of keys to assign to regex matches in request url described on
* {@link ngMock.$httpBackend $httpBackend mock}.
@@ -2702,7 +2508,6 @@ angular.mock.$RootScopeDecorator = ['$delegate', function($delegate) {
* @ngdoc method
* @name $rootScope.Scope#$countChildScopes
* @module ngMock
- * @this $rootScope.Scope
* @description
* Counts all the direct and indirect child scopes of the current scope.
*
@@ -2711,6 +2516,7 @@ angular.mock.$RootScopeDecorator = ['$delegate', function($delegate) {
* @returns {number} Total number of child scopes.
*/
function countChildScopes() {
+ // jshint validthis: true
var count = 0; // exclude the current scope
var pendingChildHeads = [this.$$childHead];
var currentScope;
@@ -2732,7 +2538,6 @@ angular.mock.$RootScopeDecorator = ['$delegate', function($delegate) {
/**
* @ngdoc method
* @name $rootScope.Scope#$countWatchers
- * @this $rootScope.Scope
* @module ngMock
* @description
* Counts all the watchers of direct and indirect child scopes of the current scope.
@@ -2743,6 +2548,7 @@ angular.mock.$RootScopeDecorator = ['$delegate', function($delegate) {
* @returns {number} Total number of watchers.
*/
function countWatchers() {
+ // jshint validthis: true
var count = this.$$watchers ? this.$$watchers.length : 0; // include the current scope
var pendingChildHeads = [this.$$childHead];
var currentScope;
@@ -2762,7 +2568,7 @@ angular.mock.$RootScopeDecorator = ['$delegate', function($delegate) {
}];
-(function(jasmineOrMocha) {
+!(function(jasmineOrMocha) {
if (!jasmineOrMocha) {
return;
@@ -2857,7 +2663,7 @@ angular.mock.$RootScopeDecorator = ['$delegate', function($delegate) {
*
* You cannot call `sharedInjector()` from within a context already using `sharedInjector()`.
*
- * ## Example
+ * ## Example
*
* Typically beforeAll is used to make many assertions about a single operation. This can
* cut down test run-time as the test setup doesn't need to be re-run, and enabling focussed
@@ -2895,14 +2701,14 @@ angular.mock.$RootScopeDecorator = ['$delegate', function($delegate) {
*/
module.sharedInjector = function() {
if (!(module.$$beforeAllHook && module.$$afterAllHook)) {
- throw Error('sharedInjector() cannot be used unless your test runner defines beforeAll/afterAll');
+ throw Error("sharedInjector() cannot be used unless your test runner defines beforeAll/afterAll");
}
var initialized = false;
- module.$$beforeAllHook(/** @this */ function() {
+ module.$$beforeAllHook(function() {
if (injectorState.shared) {
- injectorState.sharedError = Error('sharedInjector() cannot be called inside a context that has already called sharedInjector()');
+ injectorState.sharedError = Error("sharedInjector() cannot be called inside a context that has already called sharedInjector()");
throw injectorState.sharedError;
}
initialized = true;
@@ -2921,10 +2727,10 @@ angular.mock.$RootScopeDecorator = ['$delegate', function($delegate) {
};
module.$$beforeEach = function() {
- if (injectorState.shared && currentSpec && currentSpec !== this) {
+ if (injectorState.shared && currentSpec && currentSpec != this) {
var state = currentSpec;
currentSpec = this;
- angular.forEach(['$injector','$modules','$providerInjector', '$injectorStrict'], function(k) {
+ angular.forEach(["$injector","$modules","$providerInjector", "$injectorStrict"], function(k) {
currentSpec[k] = state[k];
state[k] = null;
});
@@ -2985,7 +2791,7 @@ angular.mock.$RootScopeDecorator = ['$delegate', function($delegate) {
angular.forEach(angular.callbacks, function(val, key) {
delete angular.callbacks[key];
});
- angular.callbacks.$$counter = 0;
+ angular.callbacks.counter = 0;
};
(window.beforeEach || window.setup)(module.$$beforeEach);
@@ -3079,7 +2885,7 @@ angular.mock.$RootScopeDecorator = ['$delegate', function($delegate) {
- var ErrorAddingDeclarationLocationStack = function ErrorAddingDeclarationLocationStack(e, errorForStack) {
+ var ErrorAddingDeclarationLocationStack = function(e, errorForStack) {
this.message = e.message;
this.name = e.name;
if (e.line) this.line = e.line;
@@ -3088,20 +2894,14 @@ angular.mock.$RootScopeDecorator = ['$delegate', function($delegate) {
this.stack = e.stack + '\n' + errorForStack.stack;
if (e.stackArray) this.stackArray = e.stackArray;
};
- ErrorAddingDeclarationLocationStack.prototype = Error.prototype;
+ ErrorAddingDeclarationLocationStack.prototype.toString = Error.prototype.toString;
window.inject = angular.mock.inject = function() {
var blockFns = Array.prototype.slice.call(arguments, 0);
var errorForStack = new Error('Declaration Location');
- // IE10+ and PhanthomJS do not set stack trace information, until the error is thrown
- if (!errorForStack.stack) {
- try {
- throw errorForStack;
- } catch (e) { /* empty */ }
- }
- return wasInjectorCreated() ? WorkFn.call(currentSpec) : WorkFn;
+ return wasInjectorCreated() ? workFn.call(currentSpec) : workFn;
/////////////////////
- function WorkFn() {
+ function workFn() {
var modules = currentSpec.$modules || [];
var strictDi = !!currentSpec.$injectorStrict;
modules.unshift(['$injector', function($injector) {
@@ -3114,7 +2914,7 @@ angular.mock.$RootScopeDecorator = ['$delegate', function($delegate) {
if (strictDi) {
// If strictDi is enabled, annotate the providerInjector blocks
angular.forEach(modules, function(moduleFn) {
- if (typeof moduleFn === 'function') {
+ if (typeof moduleFn === "function") {
angular.injector.$$annotate(moduleFn);
}
});
@@ -3129,7 +2929,9 @@ angular.mock.$RootScopeDecorator = ['$delegate', function($delegate) {
injector.annotate(blockFns[i]);
}
try {
+ /* jshint -W040 *//* Jasmine explicitly provides a `this` object when calling functions */
injector.invoke(blockFns[i] || angular.noop, this);
+ /* jshint +W040 */
} catch (e) {
if (e.stack && errorForStack) {
throw new ErrorAddingDeclarationLocationStack(e, errorForStack);
@@ -3168,218 +2970,5 @@ angular.mock.$RootScopeDecorator = ['$delegate', function($delegate) {
}
})(window.jasmine || window.mocha);
-'use strict';
-
-(function() {
- /**
- * Triggers a browser event. Attempts to choose the right event if one is
- * not specified.
- *
- * @param {Object} element Either a wrapped jQuery/jqLite node or a DOMElement
- * @param {string} eventType Optional event type
- * @param {Object=} eventData An optional object which contains additional event data (such as x,y
- * coordinates, keys, etc...) that are passed into the event when triggered
- */
- window.browserTrigger = function browserTrigger(element, eventType, eventData) {
- if (element && !element.nodeName) element = element[0];
- if (!element) return;
-
- eventData = eventData || {};
- var relatedTarget = eventData.relatedTarget || element;
- var keys = eventData.keys;
- var x = eventData.x;
- var y = eventData.y;
-
- var inputType = (element.type) ? element.type.toLowerCase() : null,
- nodeName = element.nodeName.toLowerCase();
- if (!eventType) {
- eventType = {
- 'text': 'change',
- 'textarea': 'change',
- 'hidden': 'change',
- 'password': 'change',
- 'button': 'click',
- 'submit': 'click',
- 'reset': 'click',
- 'image': 'click',
- 'checkbox': 'click',
- 'radio': 'click',
- 'select-one': 'change',
- 'select-multiple': 'change',
- '_default_': 'click'
- }[inputType || '_default_'];
- }
-
- if (nodeName === 'option') {
- element.parentNode.value = element.value;
- element = element.parentNode;
- eventType = 'change';
- }
-
- keys = keys || [];
- function pressed(key) {
- return keys.indexOf(key) !== -1;
- }
-
- var evnt;
- if (/transitionend/.test(eventType)) {
- if (window.WebKitTransitionEvent) {
- evnt = new window.WebKitTransitionEvent(eventType, eventData);
- evnt.initEvent(eventType, false, true);
- } else {
- try {
- evnt = new window.TransitionEvent(eventType, eventData);
- } catch (e) {
- evnt = window.document.createEvent('TransitionEvent');
- evnt.initTransitionEvent(eventType, null, null, null, eventData.elapsedTime || 0);
- }
- }
- } else if (/animationend/.test(eventType)) {
- if (window.WebKitAnimationEvent) {
- evnt = new window.WebKitAnimationEvent(eventType, eventData);
- evnt.initEvent(eventType, false, true);
- } else {
- try {
- evnt = new window.AnimationEvent(eventType, eventData);
- } catch (e) {
- evnt = window.document.createEvent('AnimationEvent');
- evnt.initAnimationEvent(eventType, null, null, null, eventData.elapsedTime || 0);
- }
- }
- } else if (/touch/.test(eventType) && supportsTouchEvents()) {
- evnt = createTouchEvent(element, eventType, x, y);
- } else if (/key/.test(eventType)) {
- evnt = window.document.createEvent('Events');
- evnt.initEvent(eventType, eventData.bubbles, eventData.cancelable);
- evnt.view = window;
- evnt.ctrlKey = pressed('ctrl');
- evnt.altKey = pressed('alt');
- evnt.shiftKey = pressed('shift');
- evnt.metaKey = pressed('meta');
- evnt.keyCode = eventData.keyCode;
- evnt.charCode = eventData.charCode;
- evnt.which = eventData.which;
- } else {
- evnt = window.document.createEvent('MouseEvents');
- x = x || 0;
- y = y || 0;
- evnt.initMouseEvent(eventType, true, true, window, 0, x, y, x, y, pressed('ctrl'),
- pressed('alt'), pressed('shift'), pressed('meta'), 0, relatedTarget);
- }
-
- /* we're unable to change the timeStamp value directly so this
- * is only here to allow for testing where the timeStamp value is
- * read */
- evnt.$manualTimeStamp = eventData.timeStamp;
-
- if (!evnt) return;
-
- var originalPreventDefault = evnt.preventDefault,
- appWindow = element.ownerDocument.defaultView,
- fakeProcessDefault = true,
- finalProcessDefault,
- angular = appWindow.angular || {};
-
- // igor: temporary fix for https://bugzilla.mozilla.org/show_bug.cgi?id=684208
- angular['ff-684208-preventDefault'] = false;
- evnt.preventDefault = function() {
- fakeProcessDefault = false;
- return originalPreventDefault.apply(evnt, arguments);
- };
-
- if (!eventData.bubbles || supportsEventBubblingInDetachedTree() || isAttachedToDocument(element)) {
- element.dispatchEvent(evnt);
- } else {
- triggerForPath(element, evnt);
- }
-
- finalProcessDefault = !(angular['ff-684208-preventDefault'] || !fakeProcessDefault);
-
- delete angular['ff-684208-preventDefault'];
-
- return finalProcessDefault;
- };
-
- function supportsTouchEvents() {
- if ('_cached' in supportsTouchEvents) {
- return supportsTouchEvents._cached;
- }
- if (!window.document.createTouch || !window.document.createTouchList) {
- supportsTouchEvents._cached = false;
- return false;
- }
- try {
- window.document.createEvent('TouchEvent');
- } catch (e) {
- supportsTouchEvents._cached = false;
- return false;
- }
- supportsTouchEvents._cached = true;
- return true;
- }
-
- function createTouchEvent(element, eventType, x, y) {
- var evnt = new window.Event(eventType);
- x = x || 0;
- y = y || 0;
-
- var touch = window.document.createTouch(window, element, Date.now(), x, y, x, y);
- var touches = window.document.createTouchList(touch);
-
- evnt.touches = touches;
-
- return evnt;
- }
-
- function supportsEventBubblingInDetachedTree() {
- if ('_cached' in supportsEventBubblingInDetachedTree) {
- return supportsEventBubblingInDetachedTree._cached;
- }
- supportsEventBubblingInDetachedTree._cached = false;
- var doc = window.document;
- if (doc) {
- var parent = doc.createElement('div'),
- child = parent.cloneNode();
- parent.appendChild(child);
- parent.addEventListener('e', function() {
- supportsEventBubblingInDetachedTree._cached = true;
- });
- var evnt = window.document.createEvent('Events');
- evnt.initEvent('e', true, true);
- child.dispatchEvent(evnt);
- }
- return supportsEventBubblingInDetachedTree._cached;
- }
-
- function triggerForPath(element, evnt) {
- var stop = false;
-
- var _stopPropagation = evnt.stopPropagation;
- evnt.stopPropagation = function() {
- stop = true;
- _stopPropagation.apply(evnt, arguments);
- };
- patchEventTargetForBubbling(evnt, element);
- do {
- element.dispatchEvent(evnt);
- // eslint-disable-next-line no-unmodified-loop-condition
- } while (!stop && (element = element.parentNode));
- }
-
- function patchEventTargetForBubbling(event, target) {
- event._target = target;
- Object.defineProperty(event, 'target', {get: function() { return this._target;}});
- }
-
- function isAttachedToDocument(element) {
- while ((element = element.parentNode)) {
- if (element === window) {
- return true;
- }
- }
- return false;
- }
-})();
-
})(window, window.angular);
diff --git a/public/vendor/angular-mocks/bower.json b/public/vendor/angular-mocks/bower.json
index a510d3e75f2..4ce65bbc809 100644
--- a/public/vendor/angular-mocks/bower.json
+++ b/public/vendor/angular-mocks/bower.json
@@ -1,10 +1,10 @@
{
"name": "angular-mocks",
- "version": "1.5.9-build.5020+sha.0784977",
+ "version": "1.5.3",
"license": "MIT",
"main": "./angular-mocks.js",
"ignore": [],
"dependencies": {
- "angular": "1.5.9-build.5020+sha.0784977"
+ "angular": "1.5.3"
}
}
diff --git a/public/vendor/angular-mocks/package.json b/public/vendor/angular-mocks/package.json
index c23f1279087..42d78038650 100644
--- a/public/vendor/angular-mocks/package.json
+++ b/public/vendor/angular-mocks/package.json
@@ -1,6 +1,6 @@
{
"name": "angular-mocks",
- "version": "1.5.9-build.5020+sha.0784977",
+ "version": "1.5.3",
"description": "AngularJS mocks for testing",
"main": "angular-mocks.js",
"scripts": {
@@ -23,12 +23,5 @@
"bugs": {
"url": "https://github.com/angular/angular.js/issues"
},
- "homepage": "http://angularjs.org",
- "jspm": {
- "shim": {
- "angular-mocks": {
- "deps": ["angular"]
- }
- }
- }
+ "homepage": "http://angularjs.org"
}
diff --git a/public/vendor/angular-native-dragdrop/.bower.json b/public/vendor/angular-native-dragdrop/.bower.json
index 337c894a30e..722289aa9db 100644
--- a/public/vendor/angular-native-dragdrop/.bower.json
+++ b/public/vendor/angular-native-dragdrop/.bower.json
@@ -31,6 +31,6 @@
"commit": "e630636fdc39fef815c1c534340aa16caf76a04c"
},
"_source": "https://github.com/angular-dragdrop/angular-dragdrop.git",
- "_target": "~1.2.2",
+ "_target": "1.2.2",
"_originalSource": "angular-native-dragdrop"
}
\ No newline at end of file
diff --git a/public/vendor/angular-native-dragdrop/draganddrop.js b/public/vendor/angular-native-dragdrop/draganddrop.js
index f1866c8374b..af8acac934b 100755
--- a/public/vendor/angular-native-dragdrop/draganddrop.js
+++ b/public/vendor/angular-native-dragdrop/draganddrop.js
@@ -290,12 +290,12 @@
sendData = angular.fromJson(sendData);
var dropOffset = calculateDropOffset(e);
-
+
var position = dropOffset ? {
x: dropOffset.x - sendData.offset.x,
y: dropOffset.y - sendData.offset.y
} : null;
-
+
determineEffectAllowed(e);
var uiOnDropFn = $parse(attr.uiOnDrop);
@@ -305,7 +305,7 @@
element.removeClass(dragEnterClass);
dragging = 0;
}
-
+
function isDragChannelAccepted(dragChannel, dropChannel) {
if (dropChannel === '*') {
return true;
diff --git a/public/vendor/angular-route/.bower.json b/public/vendor/angular-route/.bower.json
index 8f1e6a8c9a0..e059146ff2d 100644
--- a/public/vendor/angular-route/.bower.json
+++ b/public/vendor/angular-route/.bower.json
@@ -1,20 +1,20 @@
{
"name": "angular-route",
- "version": "1.5.9-build.5020+sha.0784977",
+ "version": "1.5.3",
"license": "MIT",
"main": "./angular-route.js",
"ignore": [],
"dependencies": {
- "angular": "1.5.9-build.5020+sha.0784977"
+ "angular": "1.5.3"
},
"homepage": "https://github.com/angular/bower-angular-route",
- "_release": "1.5.9-build.5020+sha.0784977",
+ "_release": "1.5.3",
"_resolution": {
"type": "version",
- "tag": "v1.5.9-build.5020+sha.0784977",
- "commit": "59b887d9b94bc1088f3efed333ae2366fafdad7c"
+ "tag": "v1.5.3",
+ "commit": "750e4833612071d30993c8e4a547a6982eba3b84"
},
"_source": "https://github.com/angular/bower-angular-route.git",
- "_target": "~1.5.9",
+ "_target": "1.5.3",
"_originalSource": "angular-route"
}
\ No newline at end of file
diff --git a/public/vendor/angular-route/LICENSE.md b/public/vendor/angular-route/LICENSE.md
deleted file mode 100644
index 2c395eef1ba..00000000000
--- a/public/vendor/angular-route/LICENSE.md
+++ /dev/null
@@ -1,21 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) 2016 Angular
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
diff --git a/public/vendor/angular-route/angular-route.js b/public/vendor/angular-route/angular-route.js
index 93ded6fc305..3c9a4e8595e 100644
--- a/public/vendor/angular-route/angular-route.js
+++ b/public/vendor/angular-route/angular-route.js
@@ -1,44 +1,9 @@
/**
- * @license AngularJS v1.5.9-build.5020+sha.0784977
+ * @license AngularJS v1.5.3
* (c) 2010-2016 Google, Inc. http://angularjs.org
* License: MIT
*/
-(function(window, angular) {'use strict';
-
-/* global shallowCopy: true */
-
-/**
- * Creates a shallow copy of an object, an array or a primitive.
- *
- * Assumes that there are no proto properties for objects.
- */
-function shallowCopy(src, dst) {
- if (isArray(src)) {
- dst = dst || [];
-
- for (var i = 0, ii = src.length; i < ii; i++) {
- dst[i] = src[i];
- }
- } else if (isObject(src)) {
- dst = dst || {};
-
- for (var key in src) {
- if (!(key.charAt(0) === '$' && key.charAt(1) === '$')) {
- dst[key] = src[key];
- }
- }
- }
-
- return dst || src;
-}
-
-/* global shallowCopy: false */
-
-// `isArray` and `isObject` are necessary for `shallowCopy()` (included via `src/shallowCopy.js`).
-// They are initialized inside the `$RouteProvider`, to ensure `window.angular` is available.
-var isArray;
-var isObject;
-var isDefined;
+(function(window, angular, undefined) {'use strict';
/**
* @ngdoc module
@@ -55,22 +20,18 @@ var isDefined;
*
*
*/
-/* global -ngRouteModule */
-var ngRouteModule = angular.
- module('ngRoute', []).
- provider('$route', $RouteProvider).
- // Ensure `$route` will be instantiated in time to capture the initial `$locationChangeSuccess`
- // event (unless explicitly disabled). This is necessary in case `ngView` is included in an
- // asynchronously loaded template.
- run(instantiateRoute);
-var $routeMinErr = angular.$$minErr('ngRoute');
-var isEagerInstantiationEnabled;
-
+ /* global -ngRouteModule */
+var ngRouteModule = angular.module('ngRoute', ['ng']).
+ provider('$route', $RouteProvider).
+ // Ensure `$route` will be instantiated in time to capture the initial
+ // `$locationChangeSuccess` event. This is necessary in case `ngView` is
+ // included in an asynchronously loaded template.
+ run(['$route', angular.noop]),
+ $routeMinErr = angular.$$minErr('ngRoute');
/**
* @ngdoc provider
* @name $routeProvider
- * @this
*
* @description
*
@@ -83,10 +44,6 @@ var isEagerInstantiationEnabled;
* Requires the {@link ngRoute `ngRoute`} module to be installed.
*/
function $RouteProvider() {
- isArray = angular.isArray;
- isObject = angular.isObject;
- isDefined = angular.isDefined;
-
function inherit(parent, extra) {
return angular.extend(Object.create(parent), extra);
}
@@ -122,12 +79,12 @@ function $RouteProvider() {
*
* Object properties:
*
- * - `controller` – `{(string|Function)=}` – Controller fn that should be associated with
+ * - `controller` – `{(string|function()=}` – Controller fn that should be associated with
* newly created scope or the name of a {@link angular.Module#controller registered
* controller} if passed as a string.
* - `controllerAs` – `{string=}` – An identifier name for a reference to the controller.
* If present, the controller will be published to scope under the `controllerAs` name.
- * - `template` – `{(string|Function)=}` – html template as a string or a function that
+ * - `template` – `{string=|function()=}` – html template as a string or a function that
* returns an html template as a string which should be used by {@link
* ngRoute.directive:ngView ngView} or {@link ng.directive:ngInclude ngInclude} directives.
* This property takes precedence over `templateUrl`.
@@ -137,7 +94,7 @@ function $RouteProvider() {
* - `{Array.