summaryrefslogtreecommitdiff
path: root/www/crm/wp-content/plugins/civicrm/civicrm/bower_components/angular-file-upload
diff options
context:
space:
mode:
Diffstat (limited to 'www/crm/wp-content/plugins/civicrm/civicrm/bower_components/angular-file-upload')
-rw-r--r--www/crm/wp-content/plugins/civicrm/civicrm/bower_components/angular-file-upload/.bower.json30
-rw-r--r--www/crm/wp-content/plugins/civicrm/civicrm/bower_components/angular-file-upload/.gitignore5
-rw-r--r--www/crm/wp-content/plugins/civicrm/civicrm/bower_components/angular-file-upload/.jshintrc22
-rw-r--r--www/crm/wp-content/plugins/civicrm/civicrm/bower_components/angular-file-upload/Gruntfile.coffee58
-rw-r--r--www/crm/wp-content/plugins/civicrm/civicrm/bower_components/angular-file-upload/README.md24
-rw-r--r--www/crm/wp-content/plugins/civicrm/civicrm/bower_components/angular-file-upload/angular-file-upload.js1341
-rw-r--r--www/crm/wp-content/plugins/civicrm/civicrm/bower_components/angular-file-upload/angular-file-upload.min.js7
-rw-r--r--www/crm/wp-content/plugins/civicrm/civicrm/bower_components/angular-file-upload/angular-file-upload.min.map1
-rw-r--r--www/crm/wp-content/plugins/civicrm/civicrm/bower_components/angular-file-upload/bower.json18
-rw-r--r--www/crm/wp-content/plugins/civicrm/civicrm/bower_components/angular-file-upload/license.txt21
-rw-r--r--www/crm/wp-content/plugins/civicrm/civicrm/bower_components/angular-file-upload/package.json19
-rw-r--r--www/crm/wp-content/plugins/civicrm/civicrm/bower_components/angular-file-upload/src/intro.js11
-rw-r--r--www/crm/wp-content/plugins/civicrm/civicrm/bower_components/angular-file-upload/src/module.js1322
-rw-r--r--www/crm/wp-content/plugins/civicrm/civicrm/bower_components/angular-file-upload/src/outro.js2
14 files changed, 2881 insertions, 0 deletions
diff --git a/www/crm/wp-content/plugins/civicrm/civicrm/bower_components/angular-file-upload/.bower.json b/www/crm/wp-content/plugins/civicrm/civicrm/bower_components/angular-file-upload/.bower.json
new file mode 100644
index 00000000..aea5806e
--- /dev/null
+++ b/www/crm/wp-content/plugins/civicrm/civicrm/bower_components/angular-file-upload/.bower.json
@@ -0,0 +1,30 @@
+{
+ "name": "angular-file-upload",
+ "main": "angular-file-upload.min.js",
+ "homepage": "https://github.com/nervgh/angular-file-upload",
+ "ignore": [
+ "examples"
+ ],
+ "dependencies": {
+ "angular": "~1.2.11"
+ },
+ "devDependencies": {
+ "es5-shim": ">=3.4.0"
+ },
+ "keywords": [
+ "angular",
+ "file",
+ "upload",
+ "module"
+ ],
+ "version": "1.1.6",
+ "_release": "1.1.6",
+ "_resolution": {
+ "type": "version",
+ "tag": "v1.1.6",
+ "commit": "1bf43e92ecb1bd46ffe34bbcd10d6173012b1b1d"
+ },
+ "_source": "https://github.com/nervgh/angular-file-upload.git",
+ "_target": ">=1.1.5 <=1.1.6",
+ "_originalSource": "angular-file-upload"
+} \ No newline at end of file
diff --git a/www/crm/wp-content/plugins/civicrm/civicrm/bower_components/angular-file-upload/.gitignore b/www/crm/wp-content/plugins/civicrm/civicrm/bower_components/angular-file-upload/.gitignore
new file mode 100644
index 00000000..54f92bf4
--- /dev/null
+++ b/www/crm/wp-content/plugins/civicrm/civicrm/bower_components/angular-file-upload/.gitignore
@@ -0,0 +1,5 @@
+.temp
+.idea
+*.iml
+node_modules
+bower_components
diff --git a/www/crm/wp-content/plugins/civicrm/civicrm/bower_components/angular-file-upload/.jshintrc b/www/crm/wp-content/plugins/civicrm/civicrm/bower_components/angular-file-upload/.jshintrc
new file mode 100644
index 00000000..348b2395
--- /dev/null
+++ b/www/crm/wp-content/plugins/civicrm/civicrm/bower_components/angular-file-upload/.jshintrc
@@ -0,0 +1,22 @@
+{
+ "camelcase" : true,
+ "indent": 4,
+ "strict": true,
+ "undef": true,
+ "unused": true,
+ "quotmark": "single",
+ "maxlen": 120,
+ "trailing": true,
+ "curly": true,
+
+ "devel": true,
+
+ "browser":true,
+ "jquery":true,
+ "predef": [
+ "angular",
+ "define",
+ "require",
+ "app"
+ ]
+} \ No newline at end of file
diff --git a/www/crm/wp-content/plugins/civicrm/civicrm/bower_components/angular-file-upload/Gruntfile.coffee b/www/crm/wp-content/plugins/civicrm/civicrm/bower_components/angular-file-upload/Gruntfile.coffee
new file mode 100644
index 00000000..a3a34ed0
--- /dev/null
+++ b/www/crm/wp-content/plugins/civicrm/civicrm/bower_components/angular-file-upload/Gruntfile.coffee
@@ -0,0 +1,58 @@
+path = require 'path'
+
+# Build configurations.
+module.exports = (grunt) ->
+ grunt.initConfig
+
+ # Metadata
+ pkg: grunt.file.readJSON('package.json'),
+
+ banner: '/*\n' +
+ ' <%= pkg.name %> v<%= pkg.version %>\n' +
+ ' <%= pkg.homepage %>\n' +
+ '*/\n'
+
+ # Deletes built file and temp directories.
+ clean:
+ working:
+ src: [
+ 'angular-file-upload.*'
+ ]
+
+ uglify:
+
+ # concat js files before minification
+ js:
+ src: ['angular-file-upload.js']
+ dest: 'angular-file-upload.min.js'
+ options:
+ banner: '<%= banner %>'
+ sourceMap: (fileName) ->
+ fileName.replace /\.js$/, '.map'
+ concat:
+
+ # concat js files before minification
+ js:
+ options:
+ banner: '<%= banner %>'
+ stripBanners: true
+ src: [
+ 'src/intro.js',
+ 'src/module.js',
+ 'src/outro.js'
+ ]
+ dest: 'angular-file-upload.js'
+
+ # Register grunt tasks supplied by grunt-contrib-*.
+ # Referenced in package.json.
+ # https://github.com/gruntjs/grunt-contrib
+ grunt.loadNpmTasks 'grunt-contrib-clean'
+ grunt.loadNpmTasks 'grunt-contrib-copy'
+ grunt.loadNpmTasks 'grunt-contrib-uglify'
+ grunt.loadNpmTasks 'grunt-contrib-concat'
+
+ grunt.registerTask 'default', [
+ 'clean'
+ 'concat'
+ 'uglify'
+ ]
diff --git a/www/crm/wp-content/plugins/civicrm/civicrm/bower_components/angular-file-upload/README.md b/www/crm/wp-content/plugins/civicrm/civicrm/bower_components/angular-file-upload/README.md
new file mode 100644
index 00000000..c84dcf7a
--- /dev/null
+++ b/www/crm/wp-content/plugins/civicrm/civicrm/bower_components/angular-file-upload/README.md
@@ -0,0 +1,24 @@
+# Angular File Upload
+
+---
+
+## About
+
+**Angular File Upload** is a module for the [AngularJS](http://angularjs.org/) framework. Supports drag-n-drop upload, upload progress, validation filters and a file upload queue. It supports native HTML5 uploads, but degrades to a legacy iframe upload method for older browsers. Works with any server side platform which supports standard HTML form uploads.
+
+When files are selected or dropped into the component, one or more filters are applied. Files which pass all filters are added to the queue. When file is added to the queue, for him is created instance of `{FileItem}` and uploader options are copied into this object. After, items in the queue (FileItems) are ready for uploading.
+
+You could find this module in bower like [_angular file upload_](http://bower.io/search/?q=angular%20file%20upload).
+
+## Demos
+1. [Simple example](http://nervgh.github.io/pages/angular-file-upload/examples/simple)
+2. [Uploads only images (with canvas preview)](http://nervgh.github.io/pages/angular-file-upload/examples/image-preview)
+3. [Without bootstrap example](http://nervgh.github.io/pages/angular-file-upload/examples/without-bootstrap)
+
+## More Info
+
+1. [Introduction](https://github.com/nervgh/angular-file-upload/wiki/Introduction)
+2. [Module API](https://github.com/nervgh/angular-file-upload/wiki/Module-API)
+3. [FAQ](https://github.com/nervgh/angular-file-upload/wiki/FAQ)
+4. [Migrate from 0.x.x to 1.x.x](https://github.com/nervgh/angular-file-upload/wiki/Migrate-from-0.x.x-to-1.x.x)
+5. [RubyGem](https://github.com/marthyn/angularjs-file-upload-rails)
diff --git a/www/crm/wp-content/plugins/civicrm/civicrm/bower_components/angular-file-upload/angular-file-upload.js b/www/crm/wp-content/plugins/civicrm/civicrm/bower_components/angular-file-upload/angular-file-upload.js
new file mode 100644
index 00000000..0842b74c
--- /dev/null
+++ b/www/crm/wp-content/plugins/civicrm/civicrm/bower_components/angular-file-upload/angular-file-upload.js
@@ -0,0 +1,1341 @@
+/*
+ angular-file-upload v1.1.6
+ https://github.com/nervgh/angular-file-upload
+*/
+(function(angular, factory) {
+ if (typeof define === 'function' && define.amd) {
+ define('angular-file-upload', ['angular'], function(angular) {
+ return factory(angular);
+ });
+ } else {
+ return factory(angular);
+ }
+}(typeof angular === 'undefined' ? null : angular, function(angular) {
+
+var module = angular.module('angularFileUpload', []);
+
+'use strict';
+
+/**
+ * Classes
+ *
+ * FileUploader
+ * FileUploader.FileLikeObject
+ * FileUploader.FileItem
+ * FileUploader.FileDirective
+ * FileUploader.FileSelect
+ * FileUploader.FileDrop
+ * FileUploader.FileOver
+ */
+
+module
+
+
+ .value('fileUploaderOptions', {
+ url: '/',
+ alias: 'file',
+ headers: {},
+ queue: [],
+ progress: 0,
+ autoUpload: false,
+ removeAfterUpload: false,
+ method: 'POST',
+ filters: [],
+ formData: [],
+ queueLimit: Number.MAX_VALUE,
+ withCredentials: false
+ })
+
+
+ .factory('FileUploader', ['fileUploaderOptions', '$rootScope', '$http', '$window', '$compile',
+ function(fileUploaderOptions, $rootScope, $http, $window, $compile) {
+ /**
+ * Creates an instance of FileUploader
+ * @param {Object} [options]
+ * @constructor
+ */
+ function FileUploader(options) {
+ var settings = angular.copy(fileUploaderOptions);
+ angular.extend(this, settings, options, {
+ isUploading: false,
+ _nextIndex: 0,
+ _failFilterIndex: -1,
+ _directives: {select: [], drop: [], over: []}
+ });
+
+ // add default filters
+ this.filters.unshift({name: 'queueLimit', fn: this._queueLimitFilter});
+ this.filters.unshift({name: 'folder', fn: this._folderFilter});
+ }
+ /**********************
+ * PUBLIC
+ **********************/
+ /**
+ * Checks a support the html5 uploader
+ * @returns {Boolean}
+ * @readonly
+ */
+ FileUploader.prototype.isHTML5 = !!($window.File && $window.FormData);
+ /**
+ * Adds items to the queue
+ * @param {File|HTMLInputElement|Object|FileList|Array<Object>} files
+ * @param {Object} [options]
+ * @param {Array<Function>|String} filters
+ */
+ FileUploader.prototype.addToQueue = function(files, options, filters) {
+ var list = this.isArrayLikeObject(files) ? files: [files];
+ var arrayOfFilters = this._getFilters(filters);
+ var count = this.queue.length;
+ var addedFileItems = [];
+
+ angular.forEach(list, function(some /*{File|HTMLInputElement|Object}*/) {
+ var temp = new FileUploader.FileLikeObject(some);
+
+ if (this._isValidFile(temp, arrayOfFilters, options)) {
+ var fileItem = new FileUploader.FileItem(this, some, options);
+ addedFileItems.push(fileItem);
+ this.queue.push(fileItem);
+ this._onAfterAddingFile(fileItem);
+ } else {
+ var filter = arrayOfFilters[this._failFilterIndex];
+ this._onWhenAddingFileFailed(temp, filter, options);
+ }
+ }, this);
+
+ if(this.queue.length !== count) {
+ this._onAfterAddingAll(addedFileItems);
+ this.progress = this._getTotalProgress();
+ }
+
+ this._render();
+ if (this.autoUpload) this.uploadAll();
+ };
+ /**
+ * Remove items from the queue. Remove last: index = -1
+ * @param {FileItem|Number} value
+ */
+ FileUploader.prototype.removeFromQueue = function(value) {
+ var index = this.getIndexOfItem(value);
+ var item = this.queue[index];
+ if (item.isUploading) item.cancel();
+ this.queue.splice(index, 1);
+ item._destroy();
+ this.progress = this._getTotalProgress();
+ };
+ /**
+ * Clears the queue
+ */
+ FileUploader.prototype.clearQueue = function() {
+ while(this.queue.length) {
+ this.queue[0].remove();
+ }
+ this.progress = 0;
+ };
+ /**
+ * Uploads a item from the queue
+ * @param {FileItem|Number} value
+ */
+ FileUploader.prototype.uploadItem = function(value) {
+ var index = this.getIndexOfItem(value);
+ var item = this.queue[index];
+ var transport = this.isHTML5 ? '_xhrTransport' : '_iframeTransport';
+
+ item._prepareToUploading();
+ if(this.isUploading) return;
+
+ this.isUploading = true;
+ this[transport](item);
+ };
+ /**
+ * Cancels uploading of item from the queue
+ * @param {FileItem|Number} value
+ */
+ FileUploader.prototype.cancelItem = function(value) {
+ var index = this.getIndexOfItem(value);
+ var item = this.queue[index];
+ var prop = this.isHTML5 ? '_xhr' : '_form';
+ if (item && item.isUploading) item[prop].abort();
+ };
+ /**
+ * Uploads all not uploaded items of queue
+ */
+ FileUploader.prototype.uploadAll = function() {
+ var items = this.getNotUploadedItems().filter(function(item) {
+ return !item.isUploading;
+ });
+ if (!items.length) return;
+
+ angular.forEach(items, function(item) {
+ item._prepareToUploading();
+ });
+ items[0].upload();
+ };
+ /**
+ * Cancels all uploads
+ */
+ FileUploader.prototype.cancelAll = function() {
+ var items = this.getNotUploadedItems();
+ angular.forEach(items, function(item) {
+ item.cancel();
+ });
+ };
+ /**
+ * Returns "true" if value an instance of File
+ * @param {*} value
+ * @returns {Boolean}
+ * @private
+ */
+ FileUploader.prototype.isFile = function(value) {
+ var fn = $window.File;
+ return (fn && value instanceof fn);
+ };
+ /**
+ * Returns "true" if value an instance of FileLikeObject
+ * @param {*} value
+ * @returns {Boolean}
+ * @private
+ */
+ FileUploader.prototype.isFileLikeObject = function(value) {
+ return value instanceof FileUploader.FileLikeObject;
+ };
+ /**
+ * Returns "true" if value is array like object
+ * @param {*} value
+ * @returns {Boolean}
+ */
+ FileUploader.prototype.isArrayLikeObject = function(value) {
+ return (angular.isObject(value) && 'length' in value);
+ };
+ /**
+ * Returns a index of item from the queue
+ * @param {Item|Number} value
+ * @returns {Number}
+ */
+ FileUploader.prototype.getIndexOfItem = function(value) {
+ return angular.isNumber(value) ? value : this.queue.indexOf(value);
+ };
+ /**
+ * Returns not uploaded items
+ * @returns {Array}
+ */
+ FileUploader.prototype.getNotUploadedItems = function() {
+ return this.queue.filter(function(item) {
+ return !item.isUploaded;
+ });
+ };
+ /**
+ * Returns items ready for upload
+ * @returns {Array}
+ */
+ FileUploader.prototype.getReadyItems = function() {
+ return this.queue
+ .filter(function(item) {
+ return (item.isReady && !item.isUploading);
+ })
+ .sort(function(item1, item2) {
+ return item1.index - item2.index;
+ });
+ };
+ /**
+ * Destroys instance of FileUploader
+ */
+ FileUploader.prototype.destroy = function() {
+ angular.forEach(this._directives, function(key) {
+ angular.forEach(this._directives[key], function(object) {
+ object.destroy();
+ }, this);
+ }, this);
+ };
+ /**
+ * Callback
+ * @param {Array} fileItems
+ */
+ FileUploader.prototype.onAfterAddingAll = function(fileItems) {};
+ /**
+ * Callback
+ * @param {FileItem} fileItem
+ */
+ FileUploader.prototype.onAfterAddingFile = function(fileItem) {};
+ /**
+ * Callback
+ * @param {File|Object} item
+ * @param {Object} filter
+ * @param {Object} options
+ * @private
+ */
+ FileUploader.prototype.onWhenAddingFileFailed = function(item, filter, options) {};
+ /**
+ * Callback
+ * @param {FileItem} fileItem
+ */
+ FileUploader.prototype.onBeforeUploadItem = function(fileItem) {};
+ /**
+ * Callback
+ * @param {FileItem} fileItem
+ * @param {Number} progress
+ */
+ FileUploader.prototype.onProgressItem = function(fileItem, progress) {};
+ /**
+ * Callback
+ * @param {Number} progress
+ */
+ FileUploader.prototype.onProgressAll = function(progress) {};
+ /**
+ * Callback
+ * @param {FileItem} item
+ * @param {*} response
+ * @param {Number} status
+ * @param {Object} headers
+ */
+ FileUploader.prototype.onSuccessItem = function(item, response, status, headers) {};
+ /**
+ * Callback
+ * @param {FileItem} item
+ * @param {*} response
+ * @param {Number} status
+ * @param {Object} headers
+ */
+ FileUploader.prototype.onErrorItem = function(item, response, status, headers) {};
+ /**
+ * Callback
+ * @param {FileItem} item
+ * @param {*} response
+ * @param {Number} status
+ * @param {Object} headers
+ */
+ FileUploader.prototype.onCancelItem = function(item, response, status, headers) {};
+ /**
+ * Callback
+ * @param {FileItem} item
+ * @param {*} response
+ * @param {Number} status
+ * @param {Object} headers
+ */
+ FileUploader.prototype.onCompleteItem = function(item, response, status, headers) {};
+ /**
+ * Callback
+ */
+ FileUploader.prototype.onCompleteAll = function() {};
+ /**********************
+ * PRIVATE
+ **********************/
+ /**
+ * Returns the total progress
+ * @param {Number} [value]
+ * @returns {Number}
+ * @private
+ */
+ FileUploader.prototype._getTotalProgress = function(value) {
+ if(this.removeAfterUpload) return value || 0;
+
+ var notUploaded = this.getNotUploadedItems().length;
+ var uploaded = notUploaded ? this.queue.length - notUploaded : this.queue.length;
+ var ratio = 100 / this.queue.length;
+ var current = (value || 0) * ratio / 100;
+
+ return Math.round(uploaded * ratio + current);
+ };
+ /**
+ * Returns array of filters
+ * @param {Array<Function>|String} filters
+ * @returns {Array<Function>}
+ * @private
+ */
+ FileUploader.prototype._getFilters = function(filters) {
+ if (angular.isUndefined(filters)) return this.filters;
+ if (angular.isArray(filters)) return filters;
+ var names = filters.match(/[^\s,]+/g);
+ return this.filters.filter(function(filter) {
+ return names.indexOf(filter.name) !== -1;
+ }, this);
+ };
+ /**
+ * Updates html
+ * @private
+ */
+ FileUploader.prototype._render = function() {
+ if (!$rootScope.$$phase) $rootScope.$apply();
+ };
+ /**
+ * Returns "true" if item is a file (not folder)
+ * @param {File|FileLikeObject} item
+ * @returns {Boolean}
+ * @private
+ */
+ FileUploader.prototype._folderFilter = function(item) {
+ return !!(item.size || item.type);
+ };
+ /**
+ * Returns "true" if the limit has not been reached
+ * @returns {Boolean}
+ * @private
+ */
+ FileUploader.prototype._queueLimitFilter = function() {
+ return this.queue.length < this.queueLimit;
+ };
+ /**
+ * Returns "true" if file pass all filters
+ * @param {File|Object} file
+ * @param {Array<Function>} filters
+ * @param {Object} options
+ * @returns {Boolean}
+ * @private
+ */
+ FileUploader.prototype._isValidFile = function(file, filters, options) {
+ this._failFilterIndex = -1;
+ return !filters.length ? true : filters.every(function(filter) {
+ this._failFilterIndex++;
+ return filter.fn.call(this, file, options);
+ }, this);
+ };
+ /**
+ * Checks whether upload successful
+ * @param {Number} status
+ * @returns {Boolean}
+ * @private
+ */
+ FileUploader.prototype._isSuccessCode = function(status) {
+ return (status >= 200 && status < 300) || status === 304;
+ };
+ /**
+ * Transforms the server response
+ * @param {*} response
+ * @param {Object} headers
+ * @returns {*}
+ * @private
+ */
+ FileUploader.prototype._transformResponse = function(response, headers) {
+ var headersGetter = this._headersGetter(headers);
+ angular.forEach($http.defaults.transformResponse, function(transformFn) {
+ response = transformFn(response, headersGetter);
+ });
+ return response;
+ };
+ /**
+ * Parsed response headers
+ * @param headers
+ * @returns {Object}
+ * @see https://github.com/angular/angular.js/blob/master/src/ng/http.js
+ * @private
+ */
+ FileUploader.prototype._parseHeaders = function(headers) {
+ var parsed = {}, key, val, i;
+
+ if (!headers) return parsed;
+
+ angular.forEach(headers.split('\n'), function(line) {
+ i = line.indexOf(':');
+ key = line.slice(0, i).trim().toLowerCase();
+ val = line.slice(i + 1).trim();
+
+ if (key) {
+ parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
+ }
+ });
+
+ return parsed;
+ };
+ /**
+ * Returns function that returns headers
+ * @param {Object} parsedHeaders
+ * @returns {Function}
+ * @private
+ */
+ FileUploader.prototype._headersGetter = function(parsedHeaders) {
+ return function(name) {
+ if (name) {
+ return parsedHeaders[name.toLowerCase()] || null;
+ }
+ return parsedHeaders;
+ };
+ };
+ /**
+ * The XMLHttpRequest transport
+ * @param {FileItem} item
+ * @private
+ */
+ FileUploader.prototype._xhrTransport = function(item) {
+ var xhr = item._xhr = new XMLHttpRequest();
+ var form = new FormData();
+ var that = this;
+
+ that._onBeforeUploadItem(item);
+
+ angular.forEach(item.formData, function(obj) {
+ angular.forEach(obj, function(value, key) {
+ form.append(key, value);
+ });
+ });
+
+ if ( typeof(item._file.size) != 'number' ) {
+ throw new TypeError('The file specified is no longer valid');
+ }
+
+ form.append(item.alias, item._file, item.file.name);
+
+ xhr.upload.onprogress = function(event) {
+ var progress = Math.round(event.lengthComputable ? event.loaded * 100 / event.total : 0);
+ that._onProgressItem(item, progress);
+ };
+
+ xhr.onload = function() {
+ var headers = that._parseHeaders(xhr.getAllResponseHeaders());
+ var response = that._transformResponse(xhr.response, headers);
+ var gist = that._isSuccessCode(xhr.status) ? 'Success' : 'Error';
+ var method = '_on' + gist + 'Item';
+ that[method](item, response, xhr.status, headers);
+ that._onCompleteItem(item, response, xhr.status, headers);
+ };
+
+ xhr.onerror = function() {
+ var headers = that._parseHeaders(xhr.getAllResponseHeaders());
+ var response = that._transformResponse(xhr.response, headers);
+ that._onErrorItem(item, response, xhr.status, headers);
+ that._onCompleteItem(item, response, xhr.status, headers);
+ };
+
+ xhr.onabort = function() {
+ var headers = that._parseHeaders(xhr.getAllResponseHeaders());
+ var response = that._transformResponse(xhr.response, headers);
+ that._onCancelItem(item, response, xhr.status, headers);
+ that._onCompleteItem(item, response, xhr.status, headers);
+ };
+
+ xhr.open(item.method, item.url, true);
+
+ xhr.withCredentials = item.withCredentials;
+
+ angular.forEach(item.headers, function(value, name) {
+ xhr.setRequestHeader(name, value);
+ });
+
+ xhr.send(form);
+ this._render();
+ };
+ /**
+ * The IFrame transport
+ * @param {FileItem} item
+ * @private
+ */
+ FileUploader.prototype._iframeTransport = function(item) {
+ var form = angular.element('<form style="display: none;" />');
+ var iframe = angular.element('<iframe name="iframeTransport' + Date.now() + '">');
+ var input = item._input;
+ var that = this;
+
+ if (item._form) item._form.replaceWith(input); // remove old form
+ item._form = form; // save link to new form
+
+ that._onBeforeUploadItem(item);
+
+ input.prop('name', item.alias);
+
+ angular.forEach(item.formData, function(obj) {
+ angular.forEach(obj, function(value, key) {
+ var element = angular.element('<input type="hidden" name="' + key + '" />');
+ element.val(value);
+ form.append(element);
+ });
+ });
+
+ form.prop({
+ action: item.url,
+ method: 'POST',
+ target: iframe.prop('name'),
+ enctype: 'multipart/form-data',
+ encoding: 'multipart/form-data' // old IE
+ });
+
+ iframe.bind('load', function() {
+ try {
+ // Fix for legacy IE browsers that loads internal error page
+ // when failed WS response received. In consequence iframe
+ // content access denied error is thrown becouse trying to
+ // access cross domain page. When such thing occurs notifying
+ // with empty response object. See more info at:
+ // http://stackoverflow.com/questions/151362/access-is-denied-error-on-accessing-iframe-document-object
+ // Note that if non standard 4xx or 5xx error code returned
+ // from WS then response content can be accessed without error
+ // but 'XHR' status becomes 200. In order to avoid confusion
+ // returning response via same 'success' event handler.
+
+ // fixed angular.contents() for iframes
+ var html = iframe[0].contentDocument.body.innerHTML;
+ } catch (e) {}
+
+ var xhr = {response: html, status: 200, dummy: true};
+ var headers = {};
+ var response = that._transformResponse(xhr.response, headers);
+
+ that._onSuccessItem(item, response, xhr.status, headers);
+ that._onCompleteItem(item, response, xhr.status, headers);
+ });
+
+ form.abort = function() {
+ var xhr = {status: 0, dummy: true};
+ var headers = {};
+ var response;
+
+ iframe.unbind('load').prop('src', 'javascript:false;');
+ form.replaceWith(input);
+
+ that._onCancelItem(item, response, xhr.status, headers);
+ that._onCompleteItem(item, response, xhr.status, headers);
+ };
+
+ input.after(form);
+ form.append(input).append(iframe);
+
+ form[0].submit();
+ this._render();
+ };
+ /**
+ * Inner callback
+ * @param {File|Object} item
+ * @param {Object} filter
+ * @param {Object} options
+ * @private
+ */
+ FileUploader.prototype._onWhenAddingFileFailed = function(item, filter, options) {
+ this.onWhenAddingFileFailed(item, filter, options);
+ };
+ /**
+ * Inner callback
+ * @param {FileItem} item
+ */
+ FileUploader.prototype._onAfterAddingFile = function(item) {
+ this.onAfterAddingFile(item);
+ };
+ /**
+ * Inner callback
+ * @param {Array<FileItem>} items
+ */
+ FileUploader.prototype._onAfterAddingAll = function(items) {
+ this.onAfterAddingAll(items);
+ };
+ /**
+ * Inner callback
+ * @param {FileItem} item
+ * @private
+ */
+ FileUploader.prototype._onBeforeUploadItem = function(item) {
+ item._onBeforeUpload();
+ this.onBeforeUploadItem(item);
+ };
+ /**
+ * Inner callback
+ * @param {FileItem} item
+ * @param {Number} progress
+ * @private
+ */
+ FileUploader.prototype._onProgressItem = function(item, progress) {
+ var total = this._getTotalProgress(progress);
+ this.progress = total;
+ item._onProgress(progress);
+ this.onProgressItem(item, progress);
+ this.onProgressAll(total);
+ this._render();
+ };
+ /**
+ * Inner callback
+ * @param {FileItem} item
+ * @param {*} response
+ * @param {Number} status
+ * @param {Object} headers
+ * @private
+ */
+ FileUploader.prototype._onSuccessItem = function(item, response, status, headers) {
+ item._onSuccess(response, status, headers);
+ this.onSuccessItem(item, response, status, headers);
+ };
+ /**
+ * Inner callback
+ * @param {FileItem} item
+ * @param {*} response
+ * @param {Number} status
+ * @param {Object} headers
+ * @private
+ */
+ FileUploader.prototype._onErrorItem = function(item, response, status, headers) {
+ item._onError(response, status, headers);
+ this.onErrorItem(item, response, status, headers);
+ };
+ /**
+ * Inner callback
+ * @param {FileItem} item
+ * @param {*} response
+ * @param {Number} status
+ * @param {Object} headers
+ * @private
+ */
+ FileUploader.prototype._onCancelItem = function(item, response, status, headers) {
+ item._onCancel(response, status, headers);
+ this.onCancelItem(item, response, status, headers);
+ };
+ /**
+ * Inner callback
+ * @param {FileItem} item
+ * @param {*} response
+ * @param {Number} status
+ * @param {Object} headers
+ * @private
+ */
+ FileUploader.prototype._onCompleteItem = function(item, response, status, headers) {
+ item._onComplete(response, status, headers);
+ this.onCompleteItem(item, response, status, headers);
+
+ var nextItem = this.getReadyItems()[0];
+ this.isUploading = false;
+
+ if(angular.isDefined(nextItem)) {
+ nextItem.upload();
+ return;
+ }
+
+ this.onCompleteAll();
+ this.progress = this._getTotalProgress();
+ this._render();
+ };
+ /**********************
+ * STATIC
+ **********************/
+ /**
+ * @borrows FileUploader.prototype.isFile
+ */
+ FileUploader.isFile = FileUploader.prototype.isFile;
+ /**
+ * @borrows FileUploader.prototype.isFileLikeObject
+ */
+ FileUploader.isFileLikeObject = FileUploader.prototype.isFileLikeObject;
+ /**
+ * @borrows FileUploader.prototype.isArrayLikeObject
+ */
+ FileUploader.isArrayLikeObject = FileUploader.prototype.isArrayLikeObject;
+ /**
+ * @borrows FileUploader.prototype.isHTML5
+ */
+ FileUploader.isHTML5 = FileUploader.prototype.isHTML5;
+ /**
+ * Inherits a target (Class_1) by a source (Class_2)
+ * @param {Function} target
+ * @param {Function} source
+ */
+ FileUploader.inherit = function(target, source) {
+ target.prototype = Object.create(source.prototype);
+ target.prototype.constructor = target;
+ target.super_ = source;
+ };
+ FileUploader.FileLikeObject = FileLikeObject;
+ FileUploader.FileItem = FileItem;
+ FileUploader.FileDirective = FileDirective;
+ FileUploader.FileSelect = FileSelect;
+ FileUploader.FileDrop = FileDrop;
+ FileUploader.FileOver = FileOver;
+
+ // ---------------------------
+
+ /**
+ * Creates an instance of FileLikeObject
+ * @param {File|HTMLInputElement|Object} fileOrInput
+ * @constructor
+ */
+ function FileLikeObject(fileOrInput) {
+ var isInput = angular.isElement(fileOrInput);
+ var fakePathOrObject = isInput ? fileOrInput.value : fileOrInput;
+ var postfix = angular.isString(fakePathOrObject) ? 'FakePath' : 'Object';
+ var method = '_createFrom' + postfix;
+ this[method](fakePathOrObject);
+ }
+
+ /**
+ * Creates file like object from fake path string
+ * @param {String} path
+ * @private
+ */
+ FileLikeObject.prototype._createFromFakePath = function(path) {
+ this.lastModifiedDate = null;
+ this.size = null;
+ this.type = 'like/' + path.slice(path.lastIndexOf('.') + 1).toLowerCase();
+ this.name = path.slice(path.lastIndexOf('/') + path.lastIndexOf('\\') + 2);
+ };
+ /**
+ * Creates file like object from object
+ * @param {File|FileLikeObject} object
+ * @private
+ */
+ FileLikeObject.prototype._createFromObject = function(object) {
+ this.lastModifiedDate = angular.copy(object.lastModifiedDate);
+ this.size = object.size;
+ this.type = object.type;
+ this.name = object.name;
+ };
+
+ // ---------------------------
+
+ /**
+ * Creates an instance of FileItem
+ * @param {FileUploader} uploader
+ * @param {File|HTMLInputElement|Object} some
+ * @param {Object} options
+ * @constructor
+ */
+ function FileItem(uploader, some, options) {
+ var isInput = angular.isElement(some);
+ var input = isInput ? angular.element(some) : null;
+ var file = !isInput ? some : null;
+
+ angular.extend(this, {
+ url: uploader.url,
+ alias: uploader.alias,
+ headers: angular.copy(uploader.headers),
+ formData: angular.copy(uploader.formData),
+ removeAfterUpload: uploader.removeAfterUpload,
+ withCredentials: uploader.withCredentials,
+ method: uploader.method
+ }, options, {
+ uploader: uploader,
+ file: new FileUploader.FileLikeObject(some),
+ isReady: false,
+ isUploading: false,
+ isUploaded: false,
+ isSuccess: false,
+ isCancel: false,
+ isError: false,
+ progress: 0,
+ index: null,
+ _file: file,
+ _input: input
+ });
+
+ if (input) this._replaceNode(input);
+ }
+ /**********************
+ * PUBLIC
+ **********************/
+ /**
+ * Uploads a FileItem
+ */
+ FileItem.prototype.upload = function() {
+ try {
+ this.uploader.uploadItem(this);
+ } catch (e) {
+ this.uploader._onCompleteItem( this, '', 0, [] );
+ this.uploader._onErrorItem( this, '', 0, [] );
+ }
+ };
+ /**
+ * Cancels uploading of FileItem
+ */
+ FileItem.prototype.cancel = function() {
+ this.uploader.cancelItem(this);
+ };
+ /**
+ * Removes a FileItem
+ */
+ FileItem.prototype.remove = function() {
+ this.uploader.removeFromQueue(this);
+ };
+ /**
+ * Callback
+ * @private
+ */
+ FileItem.prototype.onBeforeUpload = function() {};
+ /**
+ * Callback
+ * @param {Number} progress
+ * @private
+ */
+ FileItem.prototype.onProgress = function(progress) {};
+ /**
+ * Callback
+ * @param {*} response
+ * @param {Number} status
+ * @param {Object} headers
+ */
+ FileItem.prototype.onSuccess = function(response, status, headers) {};
+ /**
+ * Callback
+ * @param {*} response
+ * @param {Number} status
+ * @param {Object} headers
+ */
+ FileItem.prototype.onError = function(response, status, headers) {};
+ /**
+ * Callback
+ * @param {*} response
+ * @param {Number} status
+ * @param {Object} headers
+ */
+ FileItem.prototype.onCancel = function(response, status, headers) {};
+ /**
+ * Callback
+ * @param {*} response
+ * @param {Number} status
+ * @param {Object} headers
+ */
+ FileItem.prototype.onComplete = function(response, status, headers) {};
+ /**********************
+ * PRIVATE
+ **********************/
+ /**
+ * Inner callback
+ */
+ FileItem.prototype._onBeforeUpload = function() {
+ this.isReady = true;
+ this.isUploading = true;
+ this.isUploaded = false;
+ this.isSuccess = false;
+ this.isCancel = false;
+ this.isError = false;
+ this.progress = 0;
+ this.onBeforeUpload();
+ };
+ /**
+ * Inner callback
+ * @param {Number} progress
+ * @private
+ */
+ FileItem.prototype._onProgress = function(progress) {
+ this.progress = progress;
+ this.onProgress(progress);
+ };
+ /**
+ * Inner callback
+ * @param {*} response
+ * @param {Number} status
+ * @param {Object} headers
+ * @private
+ */
+ FileItem.prototype._onSuccess = function(response, status, headers) {
+ this.isReady = false;
+ this.isUploading = false;
+ this.isUploaded = true;
+ this.isSuccess = true;
+ this.isCancel = false;
+ this.isError = false;
+ this.progress = 100;
+ this.index = null;
+ this.onSuccess(response, status, headers);
+ };
+ /**
+ * Inner callback
+ * @param {*} response
+ * @param {Number} status
+ * @param {Object} headers
+ * @private
+ */
+ FileItem.prototype._onError = function(response, status, headers) {
+ this.isReady = false;
+ this.isUploading = false;
+ this.isUploaded = true;
+ this.isSuccess = false;
+ this.isCancel = false;
+ this.isError = true;
+ this.progress = 0;
+ this.index = null;
+ this.onError(response, status, headers);
+ };
+ /**
+ * Inner callback
+ * @param {*} response
+ * @param {Number} status
+ * @param {Object} headers
+ * @private
+ */
+ FileItem.prototype._onCancel = function(response, status, headers) {
+ this.isReady = false;
+ this.isUploading = false;
+ this.isUploaded = false;
+ this.isSuccess = false;
+ this.isCancel = true;
+ this.isError = false;
+ this.progress = 0;
+ this.index = null;
+ this.onCancel(response, status, headers);
+ };
+ /**
+ * Inner callback
+ * @param {*} response
+ * @param {Number} status
+ * @param {Object} headers
+ * @private
+ */
+ FileItem.prototype._onComplete = function(response, status, headers) {
+ this.onComplete(response, status, headers);
+ if (this.removeAfterUpload) this.remove();
+ };
+ /**
+ * Destroys a FileItem
+ */
+ FileItem.prototype._destroy = function() {
+ if (this._input) this._input.remove();
+ if (this._form) this._form.remove();
+ delete this._form;
+ delete this._input;
+ };
+ /**
+ * Prepares to uploading
+ * @private
+ */
+ FileItem.prototype._prepareToUploading = function() {
+ this.index = this.index || ++this.uploader._nextIndex;
+ this.isReady = true;
+ };
+ /**
+ * Replaces input element on his clone
+ * @param {JQLite|jQuery} input
+ * @private
+ */
+ FileItem.prototype._replaceNode = function(input) {
+ var clone = $compile(input.clone())(input.scope());
+ clone.prop('value', null); // FF fix
+ input.css('display', 'none');
+ input.after(clone); // remove jquery dependency
+ };
+
+ // ---------------------------
+
+ /**
+ * Creates instance of {FileDirective} object
+ * @param {Object} options
+ * @param {Object} options.uploader
+ * @param {HTMLElement} options.element
+ * @param {Object} options.events
+ * @param {String} options.prop
+ * @constructor
+ */
+ function FileDirective(options) {
+ angular.extend(this, options);
+ this.uploader._directives[this.prop].push(this);
+ this._saveLinks();
+ this.bind();
+ }
+ /**
+ * Map of events
+ * @type {Object}
+ */
+ FileDirective.prototype.events = {};
+ /**
+ * Binds events handles
+ */
+ FileDirective.prototype.bind = function() {
+ for(var key in this.events) {
+ var prop = this.events[key];
+ this.element.bind(key, this[prop]);
+ }
+ };
+ /**
+ * Unbinds events handles
+ */
+ FileDirective.prototype.unbind = function() {
+ for(var key in this.events) {
+ this.element.unbind(key, this.events[key]);
+ }
+ };
+ /**
+ * Destroys directive
+ */
+ FileDirective.prototype.destroy = function() {
+ var index = this.uploader._directives[this.prop].indexOf(this);
+ this.uploader._directives[this.prop].splice(index, 1);
+ this.unbind();
+ // this.element = null;
+ };
+ /**
+ * Saves links to functions
+ * @private
+ */
+ FileDirective.prototype._saveLinks = function() {
+ for(var key in this.events) {
+ var prop = this.events[key];
+ this[prop] = this[prop].bind(this);
+ }
+ };
+
+ // ---------------------------
+
+ FileUploader.inherit(FileSelect, FileDirective);
+
+ /**
+ * Creates instance of {FileSelect} object
+ * @param {Object} options
+ * @constructor
+ */
+ function FileSelect(options) {
+ FileSelect.super_.apply(this, arguments);
+
+ if(!this.uploader.isHTML5) {
+ this.element.removeAttr('multiple');
+ }
+ this.element.prop('value', null); // FF fix
+ }
+ /**
+ * Map of events
+ * @type {Object}
+ */
+ FileSelect.prototype.events = {
+ $destroy: 'destroy',
+ change: 'onChange'
+ };
+ /**
+ * Name of property inside uploader._directive object
+ * @type {String}
+ */
+ FileSelect.prototype.prop = 'select';
+ /**
+ * Returns options
+ * @return {Object|undefined}
+ */
+ FileSelect.prototype.getOptions = function() {};
+ /**
+ * Returns filters
+ * @return {Array<Function>|String|undefined}
+ */
+ FileSelect.prototype.getFilters = function() {};
+ /**
+ * If returns "true" then HTMLInputElement will be cleared
+ * @returns {Boolean}
+ */
+ FileSelect.prototype.isEmptyAfterSelection = function() {
+ return !!this.element.attr('multiple');
+ };
+ /**
+ * Event handler
+ */
+ FileSelect.prototype.onChange = function() {
+ var files = this.uploader.isHTML5 ? this.element[0].files : this.element[0];
+ var options = this.getOptions();
+ var filters = this.getFilters();
+
+ if (!this.uploader.isHTML5) this.destroy();
+ this.uploader.addToQueue(files, options, filters);
+ if (this.isEmptyAfterSelection()) this.element.prop('value', null);
+ };
+
+ // ---------------------------
+
+ FileUploader.inherit(FileDrop, FileDirective);
+
+ /**
+ * Creates instance of {FileDrop} object
+ * @param {Object} options
+ * @constructor
+ */
+ function FileDrop(options) {
+ FileDrop.super_.apply(this, arguments);
+ }
+ /**
+ * Map of events
+ * @type {Object}
+ */
+ FileDrop.prototype.events = {
+ $destroy: 'destroy',
+ drop: 'onDrop',
+ dragover: 'onDragOver',
+ dragleave: 'onDragLeave'
+ };
+ /**
+ * Name of property inside uploader._directive object
+ * @type {String}
+ */
+ FileDrop.prototype.prop = 'drop';
+ /**
+ * Returns options
+ * @return {Object|undefined}
+ */
+ FileDrop.prototype.getOptions = function() {};
+ /**
+ * Returns filters
+ * @return {Array<Function>|String|undefined}
+ */
+ FileDrop.prototype.getFilters = function() {};
+ /**
+ * Event handler
+ */
+ FileDrop.prototype.onDrop = function(event) {
+ var transfer = this._getTransfer(event);
+ if (!transfer) return;
+ var options = this.getOptions();
+ var filters = this.getFilters();
+ this._preventAndStop(event);
+ angular.forEach(this.uploader._directives.over, this._removeOverClass, this);
+ this.uploader.addToQueue(transfer.files, options, filters);
+ };
+ /**
+ * Event handler
+ */
+ FileDrop.prototype.onDragOver = function(event) {
+ var transfer = this._getTransfer(event);
+ if(!this._haveFiles(transfer.types)) return;
+ transfer.dropEffect = 'copy';
+ this._preventAndStop(event);
+ angular.forEach(this.uploader._directives.over, this._addOverClass, this);
+ };
+ /**
+ * Event handler
+ */
+ FileDrop.prototype.onDragLeave = function(event) {
+ if (event.currentTarget !== this.element[0]) return;
+ this._preventAndStop(event);
+ angular.forEach(this.uploader._directives.over, this._removeOverClass, this);
+ };
+ /**
+ * Helper
+ */
+ FileDrop.prototype._getTransfer = function(event) {
+ return event.dataTransfer ? event.dataTransfer : event.originalEvent.dataTransfer; // jQuery fix;
+ };
+ /**
+ * Helper
+ */
+ FileDrop.prototype._preventAndStop = function(event) {
+ event.preventDefault();
+ event.stopPropagation();
+ };
+ /**
+ * Returns "true" if types contains files
+ * @param {Object} types
+ */
+ FileDrop.prototype._haveFiles = function(types) {
+ if (!types) return false;
+ if (types.indexOf) {
+ return types.indexOf('Files') !== -1;
+ } else if(types.contains) {
+ return types.contains('Files');
+ } else {
+ return false;
+ }
+ };
+ /**
+ * Callback
+ */
+ FileDrop.prototype._addOverClass = function(item) {
+ item.addOverClass();
+ };
+ /**
+ * Callback
+ */
+ FileDrop.prototype._removeOverClass = function(item) {
+ item.removeOverClass();
+ };
+
+ // ---------------------------
+
+ FileUploader.inherit(FileOver, FileDirective);
+
+ /**
+ * Creates instance of {FileDrop} object
+ * @param {Object} options
+ * @constructor
+ */
+ function FileOver(options) {
+ FileOver.super_.apply(this, arguments);
+ }
+ /**
+ * Map of events
+ * @type {Object}
+ */
+ FileOver.prototype.events = {
+ $destroy: 'destroy'
+ };
+ /**
+ * Name of property inside uploader._directive object
+ * @type {String}
+ */
+ FileOver.prototype.prop = 'over';
+ /**
+ * Over class
+ * @type {string}
+ */
+ FileOver.prototype.overClass = 'nv-file-over';
+ /**
+ * Adds over class
+ */
+ FileOver.prototype.addOverClass = function() {
+ this.element.addClass(this.getOverClass());
+ };
+ /**
+ * Removes over class
+ */
+ FileOver.prototype.removeOverClass = function() {
+ this.element.removeClass(this.getOverClass());
+ };
+ /**
+ * Returns over class
+ * @returns {String}
+ */
+ FileOver.prototype.getOverClass = function() {
+ return this.overClass;
+ };
+
+ return FileUploader;
+ }])
+
+
+ .directive('nvFileSelect', ['$parse', 'FileUploader', function($parse, FileUploader) {
+ return {
+ link: function(scope, element, attributes) {
+ var uploader = scope.$eval(attributes.uploader);
+
+ if (!(uploader instanceof FileUploader)) {
+ throw new TypeError('"Uploader" must be an instance of FileUploader');
+ }
+
+ var object = new FileUploader.FileSelect({
+ uploader: uploader,
+ element: element
+ });
+
+ object.getOptions = $parse(attributes.options).bind(object, scope);
+ object.getFilters = function() {return attributes.filters;};
+ }
+ };
+ }])
+
+
+ .directive('nvFileDrop', ['$parse', 'FileUploader', function($parse, FileUploader) {
+ return {
+ link: function(scope, element, attributes) {
+ var uploader = scope.$eval(attributes.uploader);
+
+ if (!(uploader instanceof FileUploader)) {
+ throw new TypeError('"Uploader" must be an instance of FileUploader');
+ }
+
+ if (!uploader.isHTML5) return;
+
+ var object = new FileUploader.FileDrop({
+ uploader: uploader,
+ element: element
+ });
+
+ object.getOptions = $parse(attributes.options).bind(object, scope);
+ object.getFilters = function() {return attributes.filters;};
+ }
+ };
+ }])
+
+
+ .directive('nvFileOver', ['FileUploader', function(FileUploader) {
+ return {
+ link: function(scope, element, attributes) {
+ var uploader = scope.$eval(attributes.uploader);
+
+ if (!(uploader instanceof FileUploader)) {
+ throw new TypeError('"Uploader" must be an instance of FileUploader');
+ }
+
+ var object = new FileUploader.FileOver({
+ uploader: uploader,
+ element: element
+ });
+
+ object.getOverClass = function() {
+ return attributes.overClass || this.overClass;
+ };
+ }
+ };
+ }])
+
+ return module;
+})); \ No newline at end of file
diff --git a/www/crm/wp-content/plugins/civicrm/civicrm/bower_components/angular-file-upload/angular-file-upload.min.js b/www/crm/wp-content/plugins/civicrm/civicrm/bower_components/angular-file-upload/angular-file-upload.min.js
new file mode 100644
index 00000000..b81e0d02
--- /dev/null
+++ b/www/crm/wp-content/plugins/civicrm/civicrm/bower_components/angular-file-upload/angular-file-upload.min.js
@@ -0,0 +1,7 @@
+/*
+ angular-file-upload v1.1.6
+ https://github.com/nervgh/angular-file-upload
+*/
+
+!function(a,b){return"function"==typeof define&&define.amd?void define("angular-file-upload",["angular"],function(a){return b(a)}):b(a)}("undefined"==typeof angular?null:angular,function(a){var b=a.module("angularFileUpload",[]);return b.value("fileUploaderOptions",{url:"/",alias:"file",headers:{},queue:[],progress:0,autoUpload:!1,removeAfterUpload:!1,method:"POST",filters:[],formData:[],queueLimit:Number.MAX_VALUE,withCredentials:!1}).factory("FileUploader",["fileUploaderOptions","$rootScope","$http","$window","$compile",function(b,c,d,e,f){function g(c){var d=a.copy(b);a.extend(this,d,c,{isUploading:!1,_nextIndex:0,_failFilterIndex:-1,_directives:{select:[],drop:[],over:[]}}),this.filters.unshift({name:"queueLimit",fn:this._queueLimitFilter}),this.filters.unshift({name:"folder",fn:this._folderFilter})}function h(b){var c=a.isElement(b),d=c?b.value:b,e=a.isString(d)?"FakePath":"Object",f="_createFrom"+e;this[f](d)}function i(b,c,d){var e=a.isElement(c),f=e?a.element(c):null,h=e?null:c;a.extend(this,{url:b.url,alias:b.alias,headers:a.copy(b.headers),formData:a.copy(b.formData),removeAfterUpload:b.removeAfterUpload,withCredentials:b.withCredentials,method:b.method},d,{uploader:b,file:new g.FileLikeObject(c),isReady:!1,isUploading:!1,isUploaded:!1,isSuccess:!1,isCancel:!1,isError:!1,progress:0,index:null,_file:h,_input:f}),f&&this._replaceNode(f)}function j(b){a.extend(this,b),this.uploader._directives[this.prop].push(this),this._saveLinks(),this.bind()}function k(a){k.super_.apply(this,arguments),this.uploader.isHTML5||this.element.removeAttr("multiple"),this.element.prop("value",null)}function l(a){l.super_.apply(this,arguments)}function m(a){m.super_.apply(this,arguments)}return g.prototype.isHTML5=!(!e.File||!e.FormData),g.prototype.addToQueue=function(b,c,d){var e=this.isArrayLikeObject(b)?b:[b],f=this._getFilters(d),h=this.queue.length,i=[];a.forEach(e,function(a){var b=new g.FileLikeObject(a);if(this._isValidFile(b,f,c)){var d=new g.FileItem(this,a,c);i.push(d),this.queue.push(d),this._onAfterAddingFile(d)}else{var e=f[this._failFilterIndex];this._onWhenAddingFileFailed(b,e,c)}},this),this.queue.length!==h&&(this._onAfterAddingAll(i),this.progress=this._getTotalProgress()),this._render(),this.autoUpload&&this.uploadAll()},g.prototype.removeFromQueue=function(a){var b=this.getIndexOfItem(a),c=this.queue[b];c.isUploading&&c.cancel(),this.queue.splice(b,1),c._destroy(),this.progress=this._getTotalProgress()},g.prototype.clearQueue=function(){for(;this.queue.length;)this.queue[0].remove();this.progress=0},g.prototype.uploadItem=function(a){var b=this.getIndexOfItem(a),c=this.queue[b],d=this.isHTML5?"_xhrTransport":"_iframeTransport";c._prepareToUploading(),this.isUploading||(this.isUploading=!0,this[d](c))},g.prototype.cancelItem=function(a){var b=this.getIndexOfItem(a),c=this.queue[b],d=this.isHTML5?"_xhr":"_form";c&&c.isUploading&&c[d].abort()},g.prototype.uploadAll=function(){var b=this.getNotUploadedItems().filter(function(a){return!a.isUploading});b.length&&(a.forEach(b,function(a){a._prepareToUploading()}),b[0].upload())},g.prototype.cancelAll=function(){var b=this.getNotUploadedItems();a.forEach(b,function(a){a.cancel()})},g.prototype.isFile=function(a){var b=e.File;return b&&a instanceof b},g.prototype.isFileLikeObject=function(a){return a instanceof g.FileLikeObject},g.prototype.isArrayLikeObject=function(b){return a.isObject(b)&&"length"in b},g.prototype.getIndexOfItem=function(b){return a.isNumber(b)?b:this.queue.indexOf(b)},g.prototype.getNotUploadedItems=function(){return this.queue.filter(function(a){return!a.isUploaded})},g.prototype.getReadyItems=function(){return this.queue.filter(function(a){return a.isReady&&!a.isUploading}).sort(function(a,b){return a.index-b.index})},g.prototype.destroy=function(){a.forEach(this._directives,function(b){a.forEach(this._directives[b],function(a){a.destroy()},this)},this)},g.prototype.onAfterAddingAll=function(a){},g.prototype.onAfterAddingFile=function(a){},g.prototype.onWhenAddingFileFailed=function(a,b,c){},g.prototype.onBeforeUploadItem=function(a){},g.prototype.onProgressItem=function(a,b){},g.prototype.onProgressAll=function(a){},g.prototype.onSuccessItem=function(a,b,c,d){},g.prototype.onErrorItem=function(a,b,c,d){},g.prototype.onCancelItem=function(a,b,c,d){},g.prototype.onCompleteItem=function(a,b,c,d){},g.prototype.onCompleteAll=function(){},g.prototype._getTotalProgress=function(a){if(this.removeAfterUpload)return a||0;var b=this.getNotUploadedItems().length,c=b?this.queue.length-b:this.queue.length,d=100/this.queue.length,e=(a||0)*d/100;return Math.round(c*d+e)},g.prototype._getFilters=function(b){if(a.isUndefined(b))return this.filters;if(a.isArray(b))return b;var c=b.match(/[^\s,]+/g);return this.filters.filter(function(a){return-1!==c.indexOf(a.name)},this)},g.prototype._render=function(){c.$$phase||c.$apply()},g.prototype._folderFilter=function(a){return!(!a.size&&!a.type)},g.prototype._queueLimitFilter=function(){return this.queue.length<this.queueLimit},g.prototype._isValidFile=function(a,b,c){return this._failFilterIndex=-1,b.length?b.every(function(b){return this._failFilterIndex++,b.fn.call(this,a,c)},this):!0},g.prototype._isSuccessCode=function(a){return a>=200&&300>a||304===a},g.prototype._transformResponse=function(b,c){var e=this._headersGetter(c);return a.forEach(d.defaults.transformResponse,function(a){b=a(b,e)}),b},g.prototype._parseHeaders=function(b){var c,d,e,f={};return b?(a.forEach(b.split("\n"),function(a){e=a.indexOf(":"),c=a.slice(0,e).trim().toLowerCase(),d=a.slice(e+1).trim(),c&&(f[c]=f[c]?f[c]+", "+d:d)}),f):f},g.prototype._headersGetter=function(a){return function(b){return b?a[b.toLowerCase()]||null:a}},g.prototype._xhrTransport=function(b){var c=b._xhr=new XMLHttpRequest,d=new FormData,e=this;if(e._onBeforeUploadItem(b),a.forEach(b.formData,function(b){a.forEach(b,function(a,b){d.append(b,a)})}),"number"!=typeof b._file.size)throw new TypeError("The file specified is no longer valid");d.append(b.alias,b._file,b.file.name),c.upload.onprogress=function(a){var c=Math.round(a.lengthComputable?100*a.loaded/a.total:0);e._onProgressItem(b,c)},c.onload=function(){var a=e._parseHeaders(c.getAllResponseHeaders()),d=e._transformResponse(c.response,a),f=e._isSuccessCode(c.status)?"Success":"Error",g="_on"+f+"Item";e[g](b,d,c.status,a),e._onCompleteItem(b,d,c.status,a)},c.onerror=function(){var a=e._parseHeaders(c.getAllResponseHeaders()),d=e._transformResponse(c.response,a);e._onErrorItem(b,d,c.status,a),e._onCompleteItem(b,d,c.status,a)},c.onabort=function(){var a=e._parseHeaders(c.getAllResponseHeaders()),d=e._transformResponse(c.response,a);e._onCancelItem(b,d,c.status,a),e._onCompleteItem(b,d,c.status,a)},c.open(b.method,b.url,!0),c.withCredentials=b.withCredentials,a.forEach(b.headers,function(a,b){c.setRequestHeader(b,a)}),c.send(d),this._render()},g.prototype._iframeTransport=function(b){var c=a.element('<form style="display: none;" />'),d=a.element('<iframe name="iframeTransport'+Date.now()+'">'),e=b._input,f=this;b._form&&b._form.replaceWith(e),b._form=c,f._onBeforeUploadItem(b),e.prop("name",b.alias),a.forEach(b.formData,function(b){a.forEach(b,function(b,d){var e=a.element('<input type="hidden" name="'+d+'" />');e.val(b),c.append(e)})}),c.prop({action:b.url,method:"POST",target:d.prop("name"),enctype:"multipart/form-data",encoding:"multipart/form-data"}),d.bind("load",function(){try{var a=d[0].contentDocument.body.innerHTML}catch(c){}var e={response:a,status:200,dummy:!0},g={},h=f._transformResponse(e.response,g);f._onSuccessItem(b,h,e.status,g),f._onCompleteItem(b,h,e.status,g)}),c.abort=function(){var a,g={status:0,dummy:!0},h={};d.unbind("load").prop("src","javascript:false;"),c.replaceWith(e),f._onCancelItem(b,a,g.status,h),f._onCompleteItem(b,a,g.status,h)},e.after(c),c.append(e).append(d),c[0].submit(),this._render()},g.prototype._onWhenAddingFileFailed=function(a,b,c){this.onWhenAddingFileFailed(a,b,c)},g.prototype._onAfterAddingFile=function(a){this.onAfterAddingFile(a)},g.prototype._onAfterAddingAll=function(a){this.onAfterAddingAll(a)},g.prototype._onBeforeUploadItem=function(a){a._onBeforeUpload(),this.onBeforeUploadItem(a)},g.prototype._onProgressItem=function(a,b){var c=this._getTotalProgress(b);this.progress=c,a._onProgress(b),this.onProgressItem(a,b),this.onProgressAll(c),this._render()},g.prototype._onSuccessItem=function(a,b,c,d){a._onSuccess(b,c,d),this.onSuccessItem(a,b,c,d)},g.prototype._onErrorItem=function(a,b,c,d){a._onError(b,c,d),this.onErrorItem(a,b,c,d)},g.prototype._onCancelItem=function(a,b,c,d){a._onCancel(b,c,d),this.onCancelItem(a,b,c,d)},g.prototype._onCompleteItem=function(b,c,d,e){b._onComplete(c,d,e),this.onCompleteItem(b,c,d,e);var f=this.getReadyItems()[0];return this.isUploading=!1,a.isDefined(f)?void f.upload():(this.onCompleteAll(),this.progress=this._getTotalProgress(),void this._render())},g.isFile=g.prototype.isFile,g.isFileLikeObject=g.prototype.isFileLikeObject,g.isArrayLikeObject=g.prototype.isArrayLikeObject,g.isHTML5=g.prototype.isHTML5,g.inherit=function(a,b){a.prototype=Object.create(b.prototype),a.prototype.constructor=a,a.super_=b},g.FileLikeObject=h,g.FileItem=i,g.FileDirective=j,g.FileSelect=k,g.FileDrop=l,g.FileOver=m,h.prototype._createFromFakePath=function(a){this.lastModifiedDate=null,this.size=null,this.type="like/"+a.slice(a.lastIndexOf(".")+1).toLowerCase(),this.name=a.slice(a.lastIndexOf("/")+a.lastIndexOf("\\")+2)},h.prototype._createFromObject=function(b){this.lastModifiedDate=a.copy(b.lastModifiedDate),this.size=b.size,this.type=b.type,this.name=b.name},i.prototype.upload=function(){try{this.uploader.uploadItem(this)}catch(a){this.uploader._onCompleteItem(this,"",0,[]),this.uploader._onErrorItem(this,"",0,[])}},i.prototype.cancel=function(){this.uploader.cancelItem(this)},i.prototype.remove=function(){this.uploader.removeFromQueue(this)},i.prototype.onBeforeUpload=function(){},i.prototype.onProgress=function(a){},i.prototype.onSuccess=function(a,b,c){},i.prototype.onError=function(a,b,c){},i.prototype.onCancel=function(a,b,c){},i.prototype.onComplete=function(a,b,c){},i.prototype._onBeforeUpload=function(){this.isReady=!0,this.isUploading=!0,this.isUploaded=!1,this.isSuccess=!1,this.isCancel=!1,this.isError=!1,this.progress=0,this.onBeforeUpload()},i.prototype._onProgress=function(a){this.progress=a,this.onProgress(a)},i.prototype._onSuccess=function(a,b,c){this.isReady=!1,this.isUploading=!1,this.isUploaded=!0,this.isSuccess=!0,this.isCancel=!1,this.isError=!1,this.progress=100,this.index=null,this.onSuccess(a,b,c)},i.prototype._onError=function(a,b,c){this.isReady=!1,this.isUploading=!1,this.isUploaded=!0,this.isSuccess=!1,this.isCancel=!1,this.isError=!0,this.progress=0,this.index=null,this.onError(a,b,c)},i.prototype._onCancel=function(a,b,c){this.isReady=!1,this.isUploading=!1,this.isUploaded=!1,this.isSuccess=!1,this.isCancel=!0,this.isError=!1,this.progress=0,this.index=null,this.onCancel(a,b,c)},i.prototype._onComplete=function(a,b,c){this.onComplete(a,b,c),this.removeAfterUpload&&this.remove()},i.prototype._destroy=function(){this._input&&this._input.remove(),this._form&&this._form.remove(),delete this._form,delete this._input},i.prototype._prepareToUploading=function(){this.index=this.index||++this.uploader._nextIndex,this.isReady=!0},i.prototype._replaceNode=function(a){var b=f(a.clone())(a.scope());b.prop("value",null),a.css("display","none"),a.after(b)},j.prototype.events={},j.prototype.bind=function(){for(var a in this.events){var b=this.events[a];this.element.bind(a,this[b])}},j.prototype.unbind=function(){for(var a in this.events)this.element.unbind(a,this.events[a])},j.prototype.destroy=function(){var a=this.uploader._directives[this.prop].indexOf(this);this.uploader._directives[this.prop].splice(a,1),this.unbind()},j.prototype._saveLinks=function(){for(var a in this.events){var b=this.events[a];this[b]=this[b].bind(this)}},g.inherit(k,j),k.prototype.events={$destroy:"destroy",change:"onChange"},k.prototype.prop="select",k.prototype.getOptions=function(){},k.prototype.getFilters=function(){},k.prototype.isEmptyAfterSelection=function(){return!!this.element.attr("multiple")},k.prototype.onChange=function(){var a=this.uploader.isHTML5?this.element[0].files:this.element[0],b=this.getOptions(),c=this.getFilters();this.uploader.isHTML5||this.destroy(),this.uploader.addToQueue(a,b,c),this.isEmptyAfterSelection()&&this.element.prop("value",null)},g.inherit(l,j),l.prototype.events={$destroy:"destroy",drop:"onDrop",dragover:"onDragOver",dragleave:"onDragLeave"},l.prototype.prop="drop",l.prototype.getOptions=function(){},l.prototype.getFilters=function(){},l.prototype.onDrop=function(b){var c=this._getTransfer(b);if(c){var d=this.getOptions(),e=this.getFilters();this._preventAndStop(b),a.forEach(this.uploader._directives.over,this._removeOverClass,this),this.uploader.addToQueue(c.files,d,e)}},l.prototype.onDragOver=function(b){var c=this._getTransfer(b);this._haveFiles(c.types)&&(c.dropEffect="copy",this._preventAndStop(b),a.forEach(this.uploader._directives.over,this._addOverClass,this))},l.prototype.onDragLeave=function(b){b.currentTarget===this.element[0]&&(this._preventAndStop(b),a.forEach(this.uploader._directives.over,this._removeOverClass,this))},l.prototype._getTransfer=function(a){return a.dataTransfer?a.dataTransfer:a.originalEvent.dataTransfer},l.prototype._preventAndStop=function(a){a.preventDefault(),a.stopPropagation()},l.prototype._haveFiles=function(a){return a?a.indexOf?-1!==a.indexOf("Files"):a.contains?a.contains("Files"):!1:!1},l.prototype._addOverClass=function(a){a.addOverClass()},l.prototype._removeOverClass=function(a){a.removeOverClass()},g.inherit(m,j),m.prototype.events={$destroy:"destroy"},m.prototype.prop="over",m.prototype.overClass="nv-file-over",m.prototype.addOverClass=function(){this.element.addClass(this.getOverClass())},m.prototype.removeOverClass=function(){this.element.removeClass(this.getOverClass())},m.prototype.getOverClass=function(){return this.overClass},g}]).directive("nvFileSelect",["$parse","FileUploader",function(a,b){return{link:function(c,d,e){var f=c.$eval(e.uploader);if(!(f instanceof b))throw new TypeError('"Uploader" must be an instance of FileUploader');var g=new b.FileSelect({uploader:f,element:d});g.getOptions=a(e.options).bind(g,c),g.getFilters=function(){return e.filters}}}}]).directive("nvFileDrop",["$parse","FileUploader",function(a,b){return{link:function(c,d,e){var f=c.$eval(e.uploader);if(!(f instanceof b))throw new TypeError('"Uploader" must be an instance of FileUploader');if(f.isHTML5){var g=new b.FileDrop({uploader:f,element:d});g.getOptions=a(e.options).bind(g,c),g.getFilters=function(){return e.filters}}}}}]).directive("nvFileOver",["FileUploader",function(a){return{link:function(b,c,d){var e=b.$eval(d.uploader);if(!(e instanceof a))throw new TypeError('"Uploader" must be an instance of FileUploader');var f=new a.FileOver({uploader:e,element:c});f.getOverClass=function(){return d.overClass||this.overClass}}}}]),b});
+//# sourceMappingURL=angular-file-upload.min.map \ No newline at end of file
diff --git a/www/crm/wp-content/plugins/civicrm/civicrm/bower_components/angular-file-upload/angular-file-upload.min.map b/www/crm/wp-content/plugins/civicrm/civicrm/bower_components/angular-file-upload/angular-file-upload.min.map
new file mode 100644
index 00000000..779746a7
--- /dev/null
+++ b/www/crm/wp-content/plugins/civicrm/civicrm/bower_components/angular-file-upload/angular-file-upload.min.map
@@ -0,0 +1 @@
+{"version":3,"file":"angular-file-upload.min.js","sources":["angular-file-upload.js"],"names":["angular","factory","define","amd","module","value","url","alias","headers","queue","progress","autoUpload","removeAfterUpload","method","filters","formData","queueLimit","Number","MAX_VALUE","withCredentials","fileUploaderOptions","$rootScope","$http","$window","$compile","FileUploader","options","settings","copy","extend","this","isUploading","_nextIndex","_failFilterIndex","_directives","select","drop","over","unshift","name","fn","_queueLimitFilter","_folderFilter","FileLikeObject","fileOrInput","isInput","isElement","fakePathOrObject","postfix","isString","FileItem","uploader","some","input","element","file","isReady","isUploaded","isSuccess","isCancel","isError","index","_file","_input","_replaceNode","FileDirective","prop","push","_saveLinks","bind","FileSelect","super_","apply","arguments","isHTML5","removeAttr","FileDrop","FileOver","prototype","File","FormData","addToQueue","files","list","isArrayLikeObject","arrayOfFilters","_getFilters","count","length","addedFileItems","forEach","temp","_isValidFile","fileItem","_onAfterAddingFile","filter","_onWhenAddingFileFailed","_onAfterAddingAll","_getTotalProgress","_render","uploadAll","removeFromQueue","getIndexOfItem","item","cancel","splice","_destroy","clearQueue","remove","uploadItem","transport","_prepareToUploading","cancelItem","abort","items","getNotUploadedItems","upload","cancelAll","isFile","isFileLikeObject","isObject","isNumber","indexOf","getReadyItems","sort","item1","item2","destroy","key","object","onAfterAddingAll","fileItems","onAfterAddingFile","onWhenAddingFileFailed","onBeforeUploadItem","onProgressItem","onProgressAll","onSuccessItem","response","status","onErrorItem","onCancelItem","onCompleteItem","onCompleteAll","notUploaded","uploaded","ratio","current","Math","round","isUndefined","isArray","names","match","$$phase","$apply","size","type","every","call","_isSuccessCode","_transformResponse","headersGetter","_headersGetter","defaults","transformResponse","transformFn","_parseHeaders","val","i","parsed","split","line","slice","trim","toLowerCase","parsedHeaders","_xhrTransport","xhr","_xhr","XMLHttpRequest","form","that","_onBeforeUploadItem","obj","append","TypeError","onprogress","event","lengthComputable","loaded","total","_onProgressItem","onload","getAllResponseHeaders","gist","_onCompleteItem","onerror","_onErrorItem","onabort","_onCancelItem","open","setRequestHeader","send","_iframeTransport","iframe","Date","now","_form","replaceWith","action","target","enctype","encoding","html","contentDocument","body","innerHTML","e","dummy","_onSuccessItem","unbind","after","submit","_onBeforeUpload","_onProgress","_onSuccess","_onError","_onCancel","_onComplete","nextItem","isDefined","inherit","source","Object","create","constructor","_createFromFakePath","path","lastModifiedDate","lastIndexOf","_createFromObject","onBeforeUpload","onProgress","onSuccess","onError","onCancel","onComplete","clone","scope","css","events","$destroy","change","getOptions","getFilters","isEmptyAfterSelection","attr","onChange","dragover","dragleave","onDrop","transfer","_getTransfer","_preventAndStop","_removeOverClass","onDragOver","_haveFiles","types","dropEffect","_addOverClass","onDragLeave","currentTarget","dataTransfer","originalEvent","preventDefault","stopPropagation","contains","addOverClass","removeOverClass","overClass","addClass","getOverClass","removeClass","directive","$parse","link","attributes","$eval"],"mappings":";;;;;CAIC,SAASA,EAASC,GACf,MAAsB,kBAAXC,SAAyBA,OAAOC,QACvCD,QAAO,uBAAwB,WAAY,SAASF,GAChD,MAAOC,GAAQD,KAGZC,EAAQD,IAEF,mBAAZA,SAA0B,KAAOA,QAAS,SAASA,GAE5D,GAAII,GAASJ,EAAQI,OAAO,uBA6yCxB,OA7xCJA,GAGKC,MAAM,uBACHC,IAAK,IACLC,MAAO,OACPC,WACAC,SACAC,SAAU,EACVC,YAAY,EACZC,mBAAmB,EACnBC,OAAQ,OACRC,WACAC,YACAC,WAAYC,OAAOC,UACnBC,iBAAiB,IAIpBlB,QAAQ,gBAAiB,sBAAuB,aAAc,QAAS,UAAW,WAC/E,SAASmB,EAAqBC,EAAYC,EAAOC,EAASC,GAMtD,QAASC,GAAaC,GAClB,GAAIC,GAAW3B,EA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G,QAASA,GAGb2E,GAAO6H,WAAa+B,EAAOE,EAAWrQ,SAAS2C,KAAK4D,EAAQwH,GAC5DxH,EAAO8H,WAAa,WAAY,MAAOgC,GAAWjR,cAM7D8Q,UAAU,cAAe,SAAU,eAAgB,SAASC,EAAQpQ,GACjE,OACIqQ,KAAM,SAASrC,EAAOnM,EAASyO,GAC3B,GAAI5O,GAAWsM,EAAMuC,MAAMD,EAAW5O,SAEtC,MAAMA,YAAoB1B,IACtB,KAAM,IAAIiK,WAAU,iDAGxB,IAAKvI,EAASuB,QAAd,CAEA,GAAIuD,GAAS,GAAIxG,GAAamD,UAC1BzB,SAAUA,EACVG,QAASA,GAGb2E,GAAO6H,WAAa+B,EAAOE,EAAWrQ,SAAS2C,KAAK4D,EAAQwH,GAC5DxH,EAAO8H,WAAa,WAAY,MAAOgC,GAAWjR,eAM7D8Q,UAAU,cAAe,eAAgB,SAASnQ,GAC/C,OACIqQ,KAAM,SAASrC,EAAOnM,EAASyO,GAC3B,GAAI5O,GAAWsM,EAAMuC,MAAMD,EAAW5O,SAEtC,MAAMA,YAAoB1B,IACtB,KAAM,IAAIiK,WAAU,iDAGxB,IAAIzD,GAAS,GAAIxG,GAAaoD,UAC1B1B,SAAUA,EACVG,QAASA,GAGb2E,GAAOyJ,aAAe,WAClB,MAAOK,GAAWP,WAAa1P,KAAK0P,gBAM7CpR"} \ No newline at end of file
diff --git a/www/crm/wp-content/plugins/civicrm/civicrm/bower_components/angular-file-upload/bower.json b/www/crm/wp-content/plugins/civicrm/civicrm/bower_components/angular-file-upload/bower.json
new file mode 100644
index 00000000..57408474
--- /dev/null
+++ b/www/crm/wp-content/plugins/civicrm/civicrm/bower_components/angular-file-upload/bower.json
@@ -0,0 +1,18 @@
+{
+ "name": "angular-file-upload",
+ "main": "angular-file-upload.min.js",
+ "homepage": "https://github.com/nervgh/angular-file-upload",
+ "ignore": ["examples"],
+ "dependencies": {
+ "angular": "~1.2.11"
+ },
+ "devDependencies": {
+ "es5-shim": ">=3.4.0"
+ },
+ "keywords": [
+ "angular",
+ "file",
+ "upload",
+ "module"
+ ]
+}
diff --git a/www/crm/wp-content/plugins/civicrm/civicrm/bower_components/angular-file-upload/license.txt b/www/crm/wp-content/plugins/civicrm/civicrm/bower_components/angular-file-upload/license.txt
new file mode 100644
index 00000000..b4595373
--- /dev/null
+++ b/www/crm/wp-content/plugins/civicrm/civicrm/bower_components/angular-file-upload/license.txt
@@ -0,0 +1,21 @@
+The MIT License
+
+Copyright (c) 2013 nerv. https://github.com/nervgh
+
+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/www/crm/wp-content/plugins/civicrm/civicrm/bower_components/angular-file-upload/package.json b/www/crm/wp-content/plugins/civicrm/civicrm/bower_components/angular-file-upload/package.json
new file mode 100644
index 00000000..58bf867d
--- /dev/null
+++ b/www/crm/wp-content/plugins/civicrm/civicrm/bower_components/angular-file-upload/package.json
@@ -0,0 +1,19 @@
+{
+ "name": "angular-file-upload",
+ "version": "1.1.6",
+ "homepage": "https://github.com/nervgh/angular-file-upload",
+ "description": "Angular File Upload is a module for the AngularJS framework",
+ "author": {
+ "name": "nerv",
+ "url": "https://github.com/nervgh"
+ },
+ "main": "angular-file-upload.min.js",
+ "dependencies": {
+ "coffee-script": "~1.6.2",
+ "grunt-contrib-copy": "~0.4.1",
+ "grunt-contrib-clean": "~0.4.0",
+ "grunt-contrib-concat": "~0.3.0",
+ "grunt-contrib-uglify": "~0.2.1",
+ "grunt": "~0.4.1"
+ }
+}
diff --git a/www/crm/wp-content/plugins/civicrm/civicrm/bower_components/angular-file-upload/src/intro.js b/www/crm/wp-content/plugins/civicrm/civicrm/bower_components/angular-file-upload/src/intro.js
new file mode 100644
index 00000000..e4ff907e
--- /dev/null
+++ b/www/crm/wp-content/plugins/civicrm/civicrm/bower_components/angular-file-upload/src/intro.js
@@ -0,0 +1,11 @@
+(function(angular, factory) {
+ if (typeof define === 'function' && define.amd) {
+ define('angular-file-upload', ['angular'], function(angular) {
+ return factory(angular);
+ });
+ } else {
+ return factory(angular);
+ }
+}(typeof angular === 'undefined' ? null : angular, function(angular) {
+
+var module = angular.module('angularFileUpload', []);
diff --git a/www/crm/wp-content/plugins/civicrm/civicrm/bower_components/angular-file-upload/src/module.js b/www/crm/wp-content/plugins/civicrm/civicrm/bower_components/angular-file-upload/src/module.js
new file mode 100644
index 00000000..3813fd16
--- /dev/null
+++ b/www/crm/wp-content/plugins/civicrm/civicrm/bower_components/angular-file-upload/src/module.js
@@ -0,0 +1,1322 @@
+'use strict';
+
+/**
+ * Classes
+ *
+ * FileUploader
+ * FileUploader.FileLikeObject
+ * FileUploader.FileItem
+ * FileUploader.FileDirective
+ * FileUploader.FileSelect
+ * FileUploader.FileDrop
+ * FileUploader.FileOver
+ */
+
+module
+
+
+ .value('fileUploaderOptions', {
+ url: '/',
+ alias: 'file',
+ headers: {},
+ queue: [],
+ progress: 0,
+ autoUpload: false,
+ removeAfterUpload: false,
+ method: 'POST',
+ filters: [],
+ formData: [],
+ queueLimit: Number.MAX_VALUE,
+ withCredentials: false
+ })
+
+
+ .factory('FileUploader', ['fileUploaderOptions', '$rootScope', '$http', '$window', '$compile',
+ function(fileUploaderOptions, $rootScope, $http, $window, $compile) {
+ /**
+ * Creates an instance of FileUploader
+ * @param {Object} [options]
+ * @constructor
+ */
+ function FileUploader(options) {
+ var settings = angular.copy(fileUploaderOptions);
+ angular.extend(this, settings, options, {
+ isUploading: false,
+ _nextIndex: 0,
+ _failFilterIndex: -1,
+ _directives: {select: [], drop: [], over: []}
+ });
+
+ // add default filters
+ this.filters.unshift({name: 'queueLimit', fn: this._queueLimitFilter});
+ this.filters.unshift({name: 'folder', fn: this._folderFilter});
+ }
+ /**********************
+ * PUBLIC
+ **********************/
+ /**
+ * Checks a support the html5 uploader
+ * @returns {Boolean}
+ * @readonly
+ */
+ FileUploader.prototype.isHTML5 = !!($window.File && $window.FormData);
+ /**
+ * Adds items to the queue
+ * @param {File|HTMLInputElement|Object|FileList|Array<Object>} files
+ * @param {Object} [options]
+ * @param {Array<Function>|String} filters
+ */
+ FileUploader.prototype.addToQueue = function(files, options, filters) {
+ var list = this.isArrayLikeObject(files) ? files: [files];
+ var arrayOfFilters = this._getFilters(filters);
+ var count = this.queue.length;
+ var addedFileItems = [];
+
+ angular.forEach(list, function(some /*{File|HTMLInputElement|Object}*/) {
+ var temp = new FileUploader.FileLikeObject(some);
+
+ if (this._isValidFile(temp, arrayOfFilters, options)) {
+ var fileItem = new FileUploader.FileItem(this, some, options);
+ addedFileItems.push(fileItem);
+ this.queue.push(fileItem);
+ this._onAfterAddingFile(fileItem);
+ } else {
+ var filter = arrayOfFilters[this._failFilterIndex];
+ this._onWhenAddingFileFailed(temp, filter, options);
+ }
+ }, this);
+
+ if(this.queue.length !== count) {
+ this._onAfterAddingAll(addedFileItems);
+ this.progress = this._getTotalProgress();
+ }
+
+ this._render();
+ if (this.autoUpload) this.uploadAll();
+ };
+ /**
+ * Remove items from the queue. Remove last: index = -1
+ * @param {FileItem|Number} value
+ */
+ FileUploader.prototype.removeFromQueue = function(value) {
+ var index = this.getIndexOfItem(value);
+ var item = this.queue[index];
+ if (item.isUploading) item.cancel();
+ this.queue.splice(index, 1);
+ item._destroy();
+ this.progress = this._getTotalProgress();
+ };
+ /**
+ * Clears the queue
+ */
+ FileUploader.prototype.clearQueue = function() {
+ while(this.queue.length) {
+ this.queue[0].remove();
+ }
+ this.progress = 0;
+ };
+ /**
+ * Uploads a item from the queue
+ * @param {FileItem|Number} value
+ */
+ FileUploader.prototype.uploadItem = function(value) {
+ var index = this.getIndexOfItem(value);
+ var item = this.queue[index];
+ var transport = this.isHTML5 ? '_xhrTransport' : '_iframeTransport';
+
+ item._prepareToUploading();
+ if(this.isUploading) return;
+
+ this.isUploading = true;
+ this[transport](item);
+ };
+ /**
+ * Cancels uploading of item from the queue
+ * @param {FileItem|Number} value
+ */
+ FileUploader.prototype.cancelItem = function(value) {
+ var index = this.getIndexOfItem(value);
+ var item = this.queue[index];
+ var prop = this.isHTML5 ? '_xhr' : '_form';
+ if (item && item.isUploading) item[prop].abort();
+ };
+ /**
+ * Uploads all not uploaded items of queue
+ */
+ FileUploader.prototype.uploadAll = function() {
+ var items = this.getNotUploadedItems().filter(function(item) {
+ return !item.isUploading;
+ });
+ if (!items.length) return;
+
+ angular.forEach(items, function(item) {
+ item._prepareToUploading();
+ });
+ items[0].upload();
+ };
+ /**
+ * Cancels all uploads
+ */
+ FileUploader.prototype.cancelAll = function() {
+ var items = this.getNotUploadedItems();
+ angular.forEach(items, function(item) {
+ item.cancel();
+ });
+ };
+ /**
+ * Returns "true" if value an instance of File
+ * @param {*} value
+ * @returns {Boolean}
+ * @private
+ */
+ FileUploader.prototype.isFile = function(value) {
+ var fn = $window.File;
+ return (fn && value instanceof fn);
+ };
+ /**
+ * Returns "true" if value an instance of FileLikeObject
+ * @param {*} value
+ * @returns {Boolean}
+ * @private
+ */
+ FileUploader.prototype.isFileLikeObject = function(value) {
+ return value instanceof FileUploader.FileLikeObject;
+ };
+ /**
+ * Returns "true" if value is array like object
+ * @param {*} value
+ * @returns {Boolean}
+ */
+ FileUploader.prototype.isArrayLikeObject = function(value) {
+ return (angular.isObject(value) && 'length' in value);
+ };
+ /**
+ * Returns a index of item from the queue
+ * @param {Item|Number} value
+ * @returns {Number}
+ */
+ FileUploader.prototype.getIndexOfItem = function(value) {
+ return angular.isNumber(value) ? value : this.queue.indexOf(value);
+ };
+ /**
+ * Returns not uploaded items
+ * @returns {Array}
+ */
+ FileUploader.prototype.getNotUploadedItems = function() {
+ return this.queue.filter(function(item) {
+ return !item.isUploaded;
+ });
+ };
+ /**
+ * Returns items ready for upload
+ * @returns {Array}
+ */
+ FileUploader.prototype.getReadyItems = function() {
+ return this.queue
+ .filter(function(item) {
+ return (item.isReady && !item.isUploading);
+ })
+ .sort(function(item1, item2) {
+ return item1.index - item2.index;
+ });
+ };
+ /**
+ * Destroys instance of FileUploader
+ */
+ FileUploader.prototype.destroy = function() {
+ angular.forEach(this._directives, function(key) {
+ angular.forEach(this._directives[key], function(object) {
+ object.destroy();
+ }, this);
+ }, this);
+ };
+ /**
+ * Callback
+ * @param {Array} fileItems
+ */
+ FileUploader.prototype.onAfterAddingAll = function(fileItems) {};
+ /**
+ * Callback
+ * @param {FileItem} fileItem
+ */
+ FileUploader.prototype.onAfterAddingFile = function(fileItem) {};
+ /**
+ * Callback
+ * @param {File|Object} item
+ * @param {Object} filter
+ * @param {Object} options
+ * @private
+ */
+ FileUploader.prototype.onWhenAddingFileFailed = function(item, filter, options) {};
+ /**
+ * Callback
+ * @param {FileItem} fileItem
+ */
+ FileUploader.prototype.onBeforeUploadItem = function(fileItem) {};
+ /**
+ * Callback
+ * @param {FileItem} fileItem
+ * @param {Number} progress
+ */
+ FileUploader.prototype.onProgressItem = function(fileItem, progress) {};
+ /**
+ * Callback
+ * @param {Number} progress
+ */
+ FileUploader.prototype.onProgressAll = function(progress) {};
+ /**
+ * Callback
+ * @param {FileItem} item
+ * @param {*} response
+ * @param {Number} status
+ * @param {Object} headers
+ */
+ FileUploader.prototype.onSuccessItem = function(item, response, status, headers) {};
+ /**
+ * Callback
+ * @param {FileItem} item
+ * @param {*} response
+ * @param {Number} status
+ * @param {Object} headers
+ */
+ FileUploader.prototype.onErrorItem = function(item, response, status, headers) {};
+ /**
+ * Callback
+ * @param {FileItem} item
+ * @param {*} response
+ * @param {Number} status
+ * @param {Object} headers
+ */
+ FileUploader.prototype.onCancelItem = function(item, response, status, headers) {};
+ /**
+ * Callback
+ * @param {FileItem} item
+ * @param {*} response
+ * @param {Number} status
+ * @param {Object} headers
+ */
+ FileUploader.prototype.onCompleteItem = function(item, response, status, headers) {};
+ /**
+ * Callback
+ */
+ FileUploader.prototype.onCompleteAll = function() {};
+ /**********************
+ * PRIVATE
+ **********************/
+ /**
+ * Returns the total progress
+ * @param {Number} [value]
+ * @returns {Number}
+ * @private
+ */
+ FileUploader.prototype._getTotalProgress = function(value) {
+ if(this.removeAfterUpload) return value || 0;
+
+ var notUploaded = this.getNotUploadedItems().length;
+ var uploaded = notUploaded ? this.queue.length - notUploaded : this.queue.length;
+ var ratio = 100 / this.queue.length;
+ var current = (value || 0) * ratio / 100;
+
+ return Math.round(uploaded * ratio + current);
+ };
+ /**
+ * Returns array of filters
+ * @param {Array<Function>|String} filters
+ * @returns {Array<Function>}
+ * @private
+ */
+ FileUploader.prototype._getFilters = function(filters) {
+ if (angular.isUndefined(filters)) return this.filters;
+ if (angular.isArray(filters)) return filters;
+ var names = filters.match(/[^\s,]+/g);
+ return this.filters.filter(function(filter) {
+ return names.indexOf(filter.name) !== -1;
+ }, this);
+ };
+ /**
+ * Updates html
+ * @private
+ */
+ FileUploader.prototype._render = function() {
+ if (!$rootScope.$$phase) $rootScope.$apply();
+ };
+ /**
+ * Returns "true" if item is a file (not folder)
+ * @param {File|FileLikeObject} item
+ * @returns {Boolean}
+ * @private
+ */
+ FileUploader.prototype._folderFilter = function(item) {
+ return !!(item.size || item.type);
+ };
+ /**
+ * Returns "true" if the limit has not been reached
+ * @returns {Boolean}
+ * @private
+ */
+ FileUploader.prototype._queueLimitFilter = function() {
+ return this.queue.length < this.queueLimit;
+ };
+ /**
+ * Returns "true" if file pass all filters
+ * @param {File|Object} file
+ * @param {Array<Function>} filters
+ * @param {Object} options
+ * @returns {Boolean}
+ * @private
+ */
+ FileUploader.prototype._isValidFile = function(file, filters, options) {
+ this._failFilterIndex = -1;
+ return !filters.length ? true : filters.every(function(filter) {
+ this._failFilterIndex++;
+ return filter.fn.call(this, file, options);
+ }, this);
+ };
+ /**
+ * Checks whether upload successful
+ * @param {Number} status
+ * @returns {Boolean}
+ * @private
+ */
+ FileUploader.prototype._isSuccessCode = function(status) {
+ return (status >= 200 && status < 300) || status === 304;
+ };
+ /**
+ * Transforms the server response
+ * @param {*} response
+ * @param {Object} headers
+ * @returns {*}
+ * @private
+ */
+ FileUploader.prototype._transformResponse = function(response, headers) {
+ var headersGetter = this._headersGetter(headers);
+ angular.forEach($http.defaults.transformResponse, function(transformFn) {
+ response = transformFn(response, headersGetter);
+ });
+ return response;
+ };
+ /**
+ * Parsed response headers
+ * @param headers
+ * @returns {Object}
+ * @see https://github.com/angular/angular.js/blob/master/src/ng/http.js
+ * @private
+ */
+ FileUploader.prototype._parseHeaders = function(headers) {
+ var parsed = {}, key, val, i;
+
+ if (!headers) return parsed;
+
+ angular.forEach(headers.split('\n'), function(line) {
+ i = line.indexOf(':');
+ key = line.slice(0, i).trim().toLowerCase();
+ val = line.slice(i + 1).trim();
+
+ if (key) {
+ parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
+ }
+ });
+
+ return parsed;
+ };
+ /**
+ * Returns function that returns headers
+ * @param {Object} parsedHeaders
+ * @returns {Function}
+ * @private
+ */
+ FileUploader.prototype._headersGetter = function(parsedHeaders) {
+ return function(name) {
+ if (name) {
+ return parsedHeaders[name.toLowerCase()] || null;
+ }
+ return parsedHeaders;
+ };
+ };
+ /**
+ * The XMLHttpRequest transport
+ * @param {FileItem} item
+ * @private
+ */
+ FileUploader.prototype._xhrTransport = function(item) {
+ var xhr = item._xhr = new XMLHttpRequest();
+ var form = new FormData();
+ var that = this;
+
+ that._onBeforeUploadItem(item);
+
+ angular.forEach(item.formData, function(obj) {
+ angular.forEach(obj, function(value, key) {
+ form.append(key, value);
+ });
+ });
+
+ if ( typeof(item._file.size) != 'number' ) {
+ throw new TypeError('The file specified is no longer valid');
+ }
+
+ form.append(item.alias, item._file, item.file.name);
+
+ xhr.upload.onprogress = function(event) {
+ var progress = Math.round(event.lengthComputable ? event.loaded * 100 / event.total : 0);
+ that._onProgressItem(item, progress);
+ };
+
+ xhr.onload = function() {
+ var headers = that._parseHeaders(xhr.getAllResponseHeaders());
+ var response = that._transformResponse(xhr.response, headers);
+ var gist = that._isSuccessCode(xhr.status) ? 'Success' : 'Error';
+ var method = '_on' + gist + 'Item';
+ that[method](item, response, xhr.status, headers);
+ that._onCompleteItem(item, response, xhr.status, headers);
+ };
+
+ xhr.onerror = function() {
+ var headers = that._parseHeaders(xhr.getAllResponseHeaders());
+ var response = that._transformResponse(xhr.response, headers);
+ that._onErrorItem(item, response, xhr.status, headers);
+ that._onCompleteItem(item, response, xhr.status, headers);
+ };
+
+ xhr.onabort = function() {
+ var headers = that._parseHeaders(xhr.getAllResponseHeaders());
+ var response = that._transformResponse(xhr.response, headers);
+ that._onCancelItem(item, response, xhr.status, headers);
+ that._onCompleteItem(item, response, xhr.status, headers);
+ };
+
+ xhr.open(item.method, item.url, true);
+
+ xhr.withCredentials = item.withCredentials;
+
+ angular.forEach(item.headers, function(value, name) {
+ xhr.setRequestHeader(name, value);
+ });
+
+ xhr.send(form);
+ this._render();
+ };
+ /**
+ * The IFrame transport
+ * @param {FileItem} item
+ * @private
+ */
+ FileUploader.prototype._iframeTransport = function(item) {
+ var form = angular.element('<form style="display: none;" />');
+ var iframe = angular.element('<iframe name="iframeTransport' + Date.now() + '">');
+ var input = item._input;
+ var that = this;
+
+ if (item._form) item._form.replaceWith(input); // remove old form
+ item._form = form; // save link to new form
+
+ that._onBeforeUploadItem(item);
+
+ input.prop('name', item.alias);
+
+ angular.forEach(item.formData, function(obj) {
+ angular.forEach(obj, function(value, key) {
+ var element = angular.element('<input type="hidden" name="' + key + '" />');
+ element.val(value);
+ form.append(element);
+ });
+ });
+
+ form.prop({
+ action: item.url,
+ method: 'POST',
+ target: iframe.prop('name'),
+ enctype: 'multipart/form-data',
+ encoding: 'multipart/form-data' // old IE
+ });
+
+ iframe.bind('load', function() {
+ try {
+ // Fix for legacy IE browsers that loads internal error page
+ // when failed WS response received. In consequence iframe
+ // content access denied error is thrown becouse trying to
+ // access cross domain page. When such thing occurs notifying
+ // with empty response object. See more info at:
+ // http://stackoverflow.com/questions/151362/access-is-denied-error-on-accessing-iframe-document-object
+ // Note that if non standard 4xx or 5xx error code returned
+ // from WS then response content can be accessed without error
+ // but 'XHR' status becomes 200. In order to avoid confusion
+ // returning response via same 'success' event handler.
+
+ // fixed angular.contents() for iframes
+ var html = iframe[0].contentDocument.body.innerHTML;
+ } catch (e) {}
+
+ var xhr = {response: html, status: 200, dummy: true};
+ var headers = {};
+ var response = that._transformResponse(xhr.response, headers);
+
+ that._onSuccessItem(item, response, xhr.status, headers);
+ that._onCompleteItem(item, response, xhr.status, headers);
+ });
+
+ form.abort = function() {
+ var xhr = {status: 0, dummy: true};
+ var headers = {};
+ var response;
+
+ iframe.unbind('load').prop('src', 'javascript:false;');
+ form.replaceWith(input);
+
+ that._onCancelItem(item, response, xhr.status, headers);
+ that._onCompleteItem(item, response, xhr.status, headers);
+ };
+
+ input.after(form);
+ form.append(input).append(iframe);
+
+ form[0].submit();
+ this._render();
+ };
+ /**
+ * Inner callback
+ * @param {File|Object} item
+ * @param {Object} filter
+ * @param {Object} options
+ * @private
+ */
+ FileUploader.prototype._onWhenAddingFileFailed = function(item, filter, options) {
+ this.onWhenAddingFileFailed(item, filter, options);
+ };
+ /**
+ * Inner callback
+ * @param {FileItem} item
+ */
+ FileUploader.prototype._onAfterAddingFile = function(item) {
+ this.onAfterAddingFile(item);
+ };
+ /**
+ * Inner callback
+ * @param {Array<FileItem>} items
+ */
+ FileUploader.prototype._onAfterAddingAll = function(items) {
+ this.onAfterAddingAll(items);
+ };
+ /**
+ * Inner callback
+ * @param {FileItem} item
+ * @private
+ */
+ FileUploader.prototype._onBeforeUploadItem = function(item) {
+ item._onBeforeUpload();
+ this.onBeforeUploadItem(item);
+ };
+ /**
+ * Inner callback
+ * @param {FileItem} item
+ * @param {Number} progress
+ * @private
+ */
+ FileUploader.prototype._onProgressItem = function(item, progress) {
+ var total = this._getTotalProgress(progress);
+ this.progress = total;
+ item._onProgress(progress);
+ this.onProgressItem(item, progress);
+ this.onProgressAll(total);
+ this._render();
+ };
+ /**
+ * Inner callback
+ * @param {FileItem} item
+ * @param {*} response
+ * @param {Number} status
+ * @param {Object} headers
+ * @private
+ */
+ FileUploader.prototype._onSuccessItem = function(item, response, status, headers) {
+ item._onSuccess(response, status, headers);
+ this.onSuccessItem(item, response, status, headers);
+ };
+ /**
+ * Inner callback
+ * @param {FileItem} item
+ * @param {*} response
+ * @param {Number} status
+ * @param {Object} headers
+ * @private
+ */
+ FileUploader.prototype._onErrorItem = function(item, response, status, headers) {
+ item._onError(response, status, headers);
+ this.onErrorItem(item, response, status, headers);
+ };
+ /**
+ * Inner callback
+ * @param {FileItem} item
+ * @param {*} response
+ * @param {Number} status
+ * @param {Object} headers
+ * @private
+ */
+ FileUploader.prototype._onCancelItem = function(item, response, status, headers) {
+ item._onCancel(response, status, headers);
+ this.onCancelItem(item, response, status, headers);
+ };
+ /**
+ * Inner callback
+ * @param {FileItem} item
+ * @param {*} response
+ * @param {Number} status
+ * @param {Object} headers
+ * @private
+ */
+ FileUploader.prototype._onCompleteItem = function(item, response, status, headers) {
+ item._onComplete(response, status, headers);
+ this.onCompleteItem(item, response, status, headers);
+
+ var nextItem = this.getReadyItems()[0];
+ this.isUploading = false;
+
+ if(angular.isDefined(nextItem)) {
+ nextItem.upload();
+ return;
+ }
+
+ this.onCompleteAll();
+ this.progress = this._getTotalProgress();
+ this._render();
+ };
+ /**********************
+ * STATIC
+ **********************/
+ /**
+ * @borrows FileUploader.prototype.isFile
+ */
+ FileUploader.isFile = FileUploader.prototype.isFile;
+ /**
+ * @borrows FileUploader.prototype.isFileLikeObject
+ */
+ FileUploader.isFileLikeObject = FileUploader.prototype.isFileLikeObject;
+ /**
+ * @borrows FileUploader.prototype.isArrayLikeObject
+ */
+ FileUploader.isArrayLikeObject = FileUploader.prototype.isArrayLikeObject;
+ /**
+ * @borrows FileUploader.prototype.isHTML5
+ */
+ FileUploader.isHTML5 = FileUploader.prototype.isHTML5;
+ /**
+ * Inherits a target (Class_1) by a source (Class_2)
+ * @param {Function} target
+ * @param {Function} source
+ */
+ FileUploader.inherit = function(target, source) {
+ target.prototype = Object.create(source.prototype);
+ target.prototype.constructor = target;
+ target.super_ = source;
+ };
+ FileUploader.FileLikeObject = FileLikeObject;
+ FileUploader.FileItem = FileItem;
+ FileUploader.FileDirective = FileDirective;
+ FileUploader.FileSelect = FileSelect;
+ FileUploader.FileDrop = FileDrop;
+ FileUploader.FileOver = FileOver;
+
+ // ---------------------------
+
+ /**
+ * Creates an instance of FileLikeObject
+ * @param {File|HTMLInputElement|Object} fileOrInput
+ * @constructor
+ */
+ function FileLikeObject(fileOrInput) {
+ var isInput = angular.isElement(fileOrInput);
+ var fakePathOrObject = isInput ? fileOrInput.value : fileOrInput;
+ var postfix = angular.isString(fakePathOrObject) ? 'FakePath' : 'Object';
+ var method = '_createFrom' + postfix;
+ this[method](fakePathOrObject);
+ }
+
+ /**
+ * Creates file like object from fake path string
+ * @param {String} path
+ * @private
+ */
+ FileLikeObject.prototype._createFromFakePath = function(path) {
+ this.lastModifiedDate = null;
+ this.size = null;
+ this.type = 'like/' + path.slice(path.lastIndexOf('.') + 1).toLowerCase();
+ this.name = path.slice(path.lastIndexOf('/') + path.lastIndexOf('\\') + 2);
+ };
+ /**
+ * Creates file like object from object
+ * @param {File|FileLikeObject} object
+ * @private
+ */
+ FileLikeObject.prototype._createFromObject = function(object) {
+ this.lastModifiedDate = angular.copy(object.lastModifiedDate);
+ this.size = object.size;
+ this.type = object.type;
+ this.name = object.name;
+ };
+
+ // ---------------------------
+
+ /**
+ * Creates an instance of FileItem
+ * @param {FileUploader} uploader
+ * @param {File|HTMLInputElement|Object} some
+ * @param {Object} options
+ * @constructor
+ */
+ function FileItem(uploader, some, options) {
+ var isInput = angular.isElement(some);
+ var input = isInput ? angular.element(some) : null;
+ var file = !isInput ? some : null;
+
+ angular.extend(this, {
+ url: uploader.url,
+ alias: uploader.alias,
+ headers: angular.copy(uploader.headers),
+ formData: angular.copy(uploader.formData),
+ removeAfterUpload: uploader.removeAfterUpload,
+ withCredentials: uploader.withCredentials,
+ method: uploader.method
+ }, options, {
+ uploader: uploader,
+ file: new FileUploader.FileLikeObject(some),
+ isReady: false,
+ isUploading: false,
+ isUploaded: false,
+ isSuccess: false,
+ isCancel: false,
+ isError: false,
+ progress: 0,
+ index: null,
+ _file: file,
+ _input: input
+ });
+
+ if (input) this._replaceNode(input);
+ }
+ /**********************
+ * PUBLIC
+ **********************/
+ /**
+ * Uploads a FileItem
+ */
+ FileItem.prototype.upload = function() {
+ try {
+ this.uploader.uploadItem(this);
+ } catch (e) {
+ this.uploader._onCompleteItem( this, '', 0, [] );
+ this.uploader._onErrorItem( this, '', 0, [] );
+ }
+ };
+ /**
+ * Cancels uploading of FileItem
+ */
+ FileItem.prototype.cancel = function() {
+ this.uploader.cancelItem(this);
+ };
+ /**
+ * Removes a FileItem
+ */
+ FileItem.prototype.remove = function() {
+ this.uploader.removeFromQueue(this);
+ };
+ /**
+ * Callback
+ * @private
+ */
+ FileItem.prototype.onBeforeUpload = function() {};
+ /**
+ * Callback
+ * @param {Number} progress
+ * @private
+ */
+ FileItem.prototype.onProgress = function(progress) {};
+ /**
+ * Callback
+ * @param {*} response
+ * @param {Number} status
+ * @param {Object} headers
+ */
+ FileItem.prototype.onSuccess = function(response, status, headers) {};
+ /**
+ * Callback
+ * @param {*} response
+ * @param {Number} status
+ * @param {Object} headers
+ */
+ FileItem.prototype.onError = function(response, status, headers) {};
+ /**
+ * Callback
+ * @param {*} response
+ * @param {Number} status
+ * @param {Object} headers
+ */
+ FileItem.prototype.onCancel = function(response, status, headers) {};
+ /**
+ * Callback
+ * @param {*} response
+ * @param {Number} status
+ * @param {Object} headers
+ */
+ FileItem.prototype.onComplete = function(response, status, headers) {};
+ /**********************
+ * PRIVATE
+ **********************/
+ /**
+ * Inner callback
+ */
+ FileItem.prototype._onBeforeUpload = function() {
+ this.isReady = true;
+ this.isUploading = true;
+ this.isUploaded = false;
+ this.isSuccess = false;
+ this.isCancel = false;
+ this.isError = false;
+ this.progress = 0;
+ this.onBeforeUpload();
+ };
+ /**
+ * Inner callback
+ * @param {Number} progress
+ * @private
+ */
+ FileItem.prototype._onProgress = function(progress) {
+ this.progress = progress;
+ this.onProgress(progress);
+ };
+ /**
+ * Inner callback
+ * @param {*} response
+ * @param {Number} status
+ * @param {Object} headers
+ * @private
+ */
+ FileItem.prototype._onSuccess = function(response, status, headers) {
+ this.isReady = false;
+ this.isUploading = false;
+ this.isUploaded = true;
+ this.isSuccess = true;
+ this.isCancel = false;
+ this.isError = false;
+ this.progress = 100;
+ this.index = null;
+ this.onSuccess(response, status, headers);
+ };
+ /**
+ * Inner callback
+ * @param {*} response
+ * @param {Number} status
+ * @param {Object} headers
+ * @private
+ */
+ FileItem.prototype._onError = function(response, status, headers) {
+ this.isReady = false;
+ this.isUploading = false;
+ this.isUploaded = true;
+ this.isSuccess = false;
+ this.isCancel = false;
+ this.isError = true;
+ this.progress = 0;
+ this.index = null;
+ this.onError(response, status, headers);
+ };
+ /**
+ * Inner callback
+ * @param {*} response
+ * @param {Number} status
+ * @param {Object} headers
+ * @private
+ */
+ FileItem.prototype._onCancel = function(response, status, headers) {
+ this.isReady = false;
+ this.isUploading = false;
+ this.isUploaded = false;
+ this.isSuccess = false;
+ this.isCancel = true;
+ this.isError = false;
+ this.progress = 0;
+ this.index = null;
+ this.onCancel(response, status, headers);
+ };
+ /**
+ * Inner callback
+ * @param {*} response
+ * @param {Number} status
+ * @param {Object} headers
+ * @private
+ */
+ FileItem.prototype._onComplete = function(response, status, headers) {
+ this.onComplete(response, status, headers);
+ if (this.removeAfterUpload) this.remove();
+ };
+ /**
+ * Destroys a FileItem
+ */
+ FileItem.prototype._destroy = function() {
+ if (this._input) this._input.remove();
+ if (this._form) this._form.remove();
+ delete this._form;
+ delete this._input;
+ };
+ /**
+ * Prepares to uploading
+ * @private
+ */
+ FileItem.prototype._prepareToUploading = function() {
+ this.index = this.index || ++this.uploader._nextIndex;
+ this.isReady = true;
+ };
+ /**
+ * Replaces input element on his clone
+ * @param {JQLite|jQuery} input
+ * @private
+ */
+ FileItem.prototype._replaceNode = function(input) {
+ var clone = $compile(input.clone())(input.scope());
+ clone.prop('value', null); // FF fix
+ input.css('display', 'none');
+ input.after(clone); // remove jquery dependency
+ };
+
+ // ---------------------------
+
+ /**
+ * Creates instance of {FileDirective} object
+ * @param {Object} options
+ * @param {Object} options.uploader
+ * @param {HTMLElement} options.element
+ * @param {Object} options.events
+ * @param {String} options.prop
+ * @constructor
+ */
+ function FileDirective(options) {
+ angular.extend(this, options);
+ this.uploader._directives[this.prop].push(this);
+ this._saveLinks();
+ this.bind();
+ }
+ /**
+ * Map of events
+ * @type {Object}
+ */
+ FileDirective.prototype.events = {};
+ /**
+ * Binds events handles
+ */
+ FileDirective.prototype.bind = function() {
+ for(var key in this.events) {
+ var prop = this.events[key];
+ this.element.bind(key, this[prop]);
+ }
+ };
+ /**
+ * Unbinds events handles
+ */
+ FileDirective.prototype.unbind = function() {
+ for(var key in this.events) {
+ this.element.unbind(key, this.events[key]);
+ }
+ };
+ /**
+ * Destroys directive
+ */
+ FileDirective.prototype.destroy = function() {
+ var index = this.uploader._directives[this.prop].indexOf(this);
+ this.uploader._directives[this.prop].splice(index, 1);
+ this.unbind();
+ // this.element = null;
+ };
+ /**
+ * Saves links to functions
+ * @private
+ */
+ FileDirective.prototype._saveLinks = function() {
+ for(var key in this.events) {
+ var prop = this.events[key];
+ this[prop] = this[prop].bind(this);
+ }
+ };
+
+ // ---------------------------
+
+ FileUploader.inherit(FileSelect, FileDirective);
+
+ /**
+ * Creates instance of {FileSelect} object
+ * @param {Object} options
+ * @constructor
+ */
+ function FileSelect(options) {
+ FileSelect.super_.apply(this, arguments);
+
+ if(!this.uploader.isHTML5) {
+ this.element.removeAttr('multiple');
+ }
+ this.element.prop('value', null); // FF fix
+ }
+ /**
+ * Map of events
+ * @type {Object}
+ */
+ FileSelect.prototype.events = {
+ $destroy: 'destroy',
+ change: 'onChange'
+ };
+ /**
+ * Name of property inside uploader._directive object
+ * @type {String}
+ */
+ FileSelect.prototype.prop = 'select';
+ /**
+ * Returns options
+ * @return {Object|undefined}
+ */
+ FileSelect.prototype.getOptions = function() {};
+ /**
+ * Returns filters
+ * @return {Array<Function>|String|undefined}
+ */
+ FileSelect.prototype.getFilters = function() {};
+ /**
+ * If returns "true" then HTMLInputElement will be cleared
+ * @returns {Boolean}
+ */
+ FileSelect.prototype.isEmptyAfterSelection = function() {
+ return !!this.element.attr('multiple');
+ };
+ /**
+ * Event handler
+ */
+ FileSelect.prototype.onChange = function() {
+ var files = this.uploader.isHTML5 ? this.element[0].files : this.element[0];
+ var options = this.getOptions();
+ var filters = this.getFilters();
+
+ if (!this.uploader.isHTML5) this.destroy();
+ this.uploader.addToQueue(files, options, filters);
+ if (this.isEmptyAfterSelection()) this.element.prop('value', null);
+ };
+
+ // ---------------------------
+
+ FileUploader.inherit(FileDrop, FileDirective);
+
+ /**
+ * Creates instance of {FileDrop} object
+ * @param {Object} options
+ * @constructor
+ */
+ function FileDrop(options) {
+ FileDrop.super_.apply(this, arguments);
+ }
+ /**
+ * Map of events
+ * @type {Object}
+ */
+ FileDrop.prototype.events = {
+ $destroy: 'destroy',
+ drop: 'onDrop',
+ dragover: 'onDragOver',
+ dragleave: 'onDragLeave'
+ };
+ /**
+ * Name of property inside uploader._directive object
+ * @type {String}
+ */
+ FileDrop.prototype.prop = 'drop';
+ /**
+ * Returns options
+ * @return {Object|undefined}
+ */
+ FileDrop.prototype.getOptions = function() {};
+ /**
+ * Returns filters
+ * @return {Array<Function>|String|undefined}
+ */
+ FileDrop.prototype.getFilters = function() {};
+ /**
+ * Event handler
+ */
+ FileDrop.prototype.onDrop = function(event) {
+ var transfer = this._getTransfer(event);
+ if (!transfer) return;
+ var options = this.getOptions();
+ var filters = this.getFilters();
+ this._preventAndStop(event);
+ angular.forEach(this.uploader._directives.over, this._removeOverClass, this);
+ this.uploader.addToQueue(transfer.files, options, filters);
+ };
+ /**
+ * Event handler
+ */
+ FileDrop.prototype.onDragOver = function(event) {
+ var transfer = this._getTransfer(event);
+ if(!this._haveFiles(transfer.types)) return;
+ transfer.dropEffect = 'copy';
+ this._preventAndStop(event);
+ angular.forEach(this.uploader._directives.over, this._addOverClass, this);
+ };
+ /**
+ * Event handler
+ */
+ FileDrop.prototype.onDragLeave = function(event) {
+ if (event.currentTarget !== this.element[0]) return;
+ this._preventAndStop(event);
+ angular.forEach(this.uploader._directives.over, this._removeOverClass, this);
+ };
+ /**
+ * Helper
+ */
+ FileDrop.prototype._getTransfer = function(event) {
+ return event.dataTransfer ? event.dataTransfer : event.originalEvent.dataTransfer; // jQuery fix;
+ };
+ /**
+ * Helper
+ */
+ FileDrop.prototype._preventAndStop = function(event) {
+ event.preventDefault();
+ event.stopPropagation();
+ };
+ /**
+ * Returns "true" if types contains files
+ * @param {Object} types
+ */
+ FileDrop.prototype._haveFiles = function(types) {
+ if (!types) return false;
+ if (types.indexOf) {
+ return types.indexOf('Files') !== -1;
+ } else if(types.contains) {
+ return types.contains('Files');
+ } else {
+ return false;
+ }
+ };
+ /**
+ * Callback
+ */
+ FileDrop.prototype._addOverClass = function(item) {
+ item.addOverClass();
+ };
+ /**
+ * Callback
+ */
+ FileDrop.prototype._removeOverClass = function(item) {
+ item.removeOverClass();
+ };
+
+ // ---------------------------
+
+ FileUploader.inherit(FileOver, FileDirective);
+
+ /**
+ * Creates instance of {FileDrop} object
+ * @param {Object} options
+ * @constructor
+ */
+ function FileOver(options) {
+ FileOver.super_.apply(this, arguments);
+ }
+ /**
+ * Map of events
+ * @type {Object}
+ */
+ FileOver.prototype.events = {
+ $destroy: 'destroy'
+ };
+ /**
+ * Name of property inside uploader._directive object
+ * @type {String}
+ */
+ FileOver.prototype.prop = 'over';
+ /**
+ * Over class
+ * @type {string}
+ */
+ FileOver.prototype.overClass = 'nv-file-over';
+ /**
+ * Adds over class
+ */
+ FileOver.prototype.addOverClass = function() {
+ this.element.addClass(this.getOverClass());
+ };
+ /**
+ * Removes over class
+ */
+ FileOver.prototype.removeOverClass = function() {
+ this.element.removeClass(this.getOverClass());
+ };
+ /**
+ * Returns over class
+ * @returns {String}
+ */
+ FileOver.prototype.getOverClass = function() {
+ return this.overClass;
+ };
+
+ return FileUploader;
+ }])
+
+
+ .directive('nvFileSelect', ['$parse', 'FileUploader', function($parse, FileUploader) {
+ return {
+ link: function(scope, element, attributes) {
+ var uploader = scope.$eval(attributes.uploader);
+
+ if (!(uploader instanceof FileUploader)) {
+ throw new TypeError('"Uploader" must be an instance of FileUploader');
+ }
+
+ var object = new FileUploader.FileSelect({
+ uploader: uploader,
+ element: element
+ });
+
+ object.getOptions = $parse(attributes.options).bind(object, scope);
+ object.getFilters = function() {return attributes.filters;};
+ }
+ };
+ }])
+
+
+ .directive('nvFileDrop', ['$parse', 'FileUploader', function($parse, FileUploader) {
+ return {
+ link: function(scope, element, attributes) {
+ var uploader = scope.$eval(attributes.uploader);
+
+ if (!(uploader instanceof FileUploader)) {
+ throw new TypeError('"Uploader" must be an instance of FileUploader');
+ }
+
+ if (!uploader.isHTML5) return;
+
+ var object = new FileUploader.FileDrop({
+ uploader: uploader,
+ element: element
+ });
+
+ object.getOptions = $parse(attributes.options).bind(object, scope);
+ object.getFilters = function() {return attributes.filters;};
+ }
+ };
+ }])
+
+
+ .directive('nvFileOver', ['FileUploader', function(FileUploader) {
+ return {
+ link: function(scope, element, attributes) {
+ var uploader = scope.$eval(attributes.uploader);
+
+ if (!(uploader instanceof FileUploader)) {
+ throw new TypeError('"Uploader" must be an instance of FileUploader');
+ }
+
+ var object = new FileUploader.FileOver({
+ uploader: uploader,
+ element: element
+ });
+
+ object.getOverClass = function() {
+ return attributes.overClass || this.overClass;
+ };
+ }
+ };
+ }])
diff --git a/www/crm/wp-content/plugins/civicrm/civicrm/bower_components/angular-file-upload/src/outro.js b/www/crm/wp-content/plugins/civicrm/civicrm/bower_components/angular-file-upload/src/outro.js
new file mode 100644
index 00000000..a4051034
--- /dev/null
+++ b/www/crm/wp-content/plugins/civicrm/civicrm/bower_components/angular-file-upload/src/outro.js
@@ -0,0 +1,2 @@
+ return module;
+})); \ No newline at end of file