Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'libs/bower_components/ngDialog/js')
-rw-r--r--libs/bower_components/ngDialog/js/ngDialog.js953
-rw-r--r--libs/bower_components/ngDialog/js/ngDialog.min.js2
2 files changed, 0 insertions, 955 deletions
diff --git a/libs/bower_components/ngDialog/js/ngDialog.js b/libs/bower_components/ngDialog/js/ngDialog.js
deleted file mode 100644
index ddd287c142..0000000000
--- a/libs/bower_components/ngDialog/js/ngDialog.js
+++ /dev/null
@@ -1,953 +0,0 @@
-/*
- * ngDialog - easy modals and popup windows
- * http://github.com/likeastore/ngDialog
- * (c) 2013-2015 MIT License, https://likeastore.com
- */
-
-(function (root, factory) {
- if (typeof module !== 'undefined' && module.exports) {
- // CommonJS
- if (typeof angular === 'undefined') {
- factory(require('angular'));
- } else {
- factory(angular);
- }
- module.exports = 'ngDialog';
- } else if (typeof define === 'function' && define.amd) {
- // AMD
- define(['angular'], factory);
- } else {
- // Global Variables
- factory(root.angular);
- }
-}(this, function (angular) {
- 'use strict';
-
- var m = angular.module('ngDialog', []);
-
- var $el = angular.element;
- var isDef = angular.isDefined;
- var style = (document.body || document.documentElement).style;
- var animationEndSupport = isDef(style.animation) || isDef(style.WebkitAnimation) || isDef(style.MozAnimation) || isDef(style.MsAnimation) || isDef(style.OAnimation);
- var animationEndEvent = 'animationend webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend';
- var focusableElementSelector = 'a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, *[tabindex], *[contenteditable]';
- var disabledAnimationClass = 'ngdialog-disabled-animation';
- var forceElementsReload = { html: false, body: false };
- var scopes = {};
- var openIdStack = [];
- var activeBodyClasses = [];
- var keydownIsBound = false;
- var openOnePerName = false;
- var closeByNavigationDialogStack = [];
-
- var UI_ROUTER_VERSION_LEGACY = 'legacy';
- var UI_ROUTER_VERSION_ONE_PLUS = '1.0.0+';
-
- m.provider('ngDialog', function () {
- var defaults = this.defaults = {
- className: 'ngdialog-theme-default',
- appendClassName: '',
- disableAnimation: false,
- plain: false,
- showClose: true,
- closeByDocument: true,
- closeByEscape: true,
- closeByNavigation: false,
- appendTo: false,
- preCloseCallback: false,
- onOpenCallback: false,
- overlay: true,
- cache: true,
- trapFocus: true,
- preserveFocus: true,
- ariaAuto: true,
- ariaRole: null,
- ariaLabelledById: null,
- ariaLabelledBySelector: null,
- ariaDescribedById: null,
- ariaDescribedBySelector: null,
- bodyClassName: 'ngdialog-open',
- width: null,
- height: null
- };
-
- this.setForceHtmlReload = function (_useIt) {
- forceElementsReload.html = _useIt || false;
- };
-
- this.setForceBodyReload = function (_useIt) {
- forceElementsReload.body = _useIt || false;
- };
-
- this.setDefaults = function (newDefaults) {
- angular.extend(defaults, newDefaults);
- };
-
- this.setOpenOnePerName = function (isOpenOne) {
- openOnePerName = isOpenOne || false;
- };
-
- var globalID = 0, dialogsCount = 0, closeByDocumentHandler, defers = {};
-
- this.$get = ['$document', '$templateCache', '$compile', '$q', '$http', '$rootScope', '$timeout', '$window', '$controller', '$injector',
- function ($document, $templateCache, $compile, $q, $http, $rootScope, $timeout, $window, $controller, $injector) {
- var $elements = [];
-
- var privateMethods = {
- onDocumentKeydown: function (event) {
- if (event.keyCode === 27) {
- publicMethods.close('$escape');
- }
- },
-
- activate: function($dialog) {
- var options = $dialog.data('$ngDialogOptions');
-
- if (options.trapFocus) {
- $dialog.on('keydown', privateMethods.onTrapFocusKeydown);
-
- // Catch rogue changes (eg. after unfocusing everything by clicking a non-focusable element)
- $elements.body.on('keydown', privateMethods.onTrapFocusKeydown);
- }
- },
-
- deactivate: function ($dialog) {
- $dialog.off('keydown', privateMethods.onTrapFocusKeydown);
- $elements.body.off('keydown', privateMethods.onTrapFocusKeydown);
- },
-
- deactivateAll: function (els) {
- angular.forEach(els,function(el) {
- var $dialog = angular.element(el);
- privateMethods.deactivate($dialog);
- });
- },
-
- setBodyPadding: function (width) {
- var originalBodyPadding = parseInt(($elements.body.css('padding-right') || 0), 10);
- $elements.body.css('padding-right', (originalBodyPadding + width) + 'px');
- $elements.body.data('ng-dialog-original-padding', originalBodyPadding);
- $rootScope.$broadcast('ngDialog.setPadding', width);
- },
-
- resetBodyPadding: function () {
- var originalBodyPadding = $elements.body.data('ng-dialog-original-padding');
- if (originalBodyPadding) {
- $elements.body.css('padding-right', originalBodyPadding + 'px');
- } else {
- $elements.body.css('padding-right', '');
- }
- $rootScope.$broadcast('ngDialog.setPadding', 0);
- },
-
- performCloseDialog: function ($dialog, value) {
- var options = $dialog.data('$ngDialogOptions');
- var id = $dialog.attr('id');
- var scope = scopes[id];
- privateMethods.deactivate($dialog);
-
- if (!scope) {
- // Already closed
- return;
- }
-
- if (typeof $window.Hammer !== 'undefined') {
- var hammerTime = scope.hammerTime;
- hammerTime.off('tap', closeByDocumentHandler);
- hammerTime.destroy && hammerTime.destroy();
- delete scope.hammerTime;
- } else {
- $dialog.unbind('click');
- }
-
- if (dialogsCount === 1) {
- $elements.body.unbind('keydown', privateMethods.onDocumentKeydown);
- }
-
- if (!$dialog.hasClass('ngdialog-closing')){
- dialogsCount -= 1;
- }
-
- var previousFocus = $dialog.data('$ngDialogPreviousFocus');
- if (previousFocus && previousFocus.focus) {
- previousFocus.focus();
- }
-
- $rootScope.$broadcast('ngDialog.closing', $dialog, value);
- dialogsCount = dialogsCount < 0 ? 0 : dialogsCount;
- if (animationEndSupport && !options.disableAnimation) {
- scope.$destroy();
- $dialog.unbind(animationEndEvent).bind(animationEndEvent, function () {
- privateMethods.closeDialogElement($dialog, value);
- }).addClass('ngdialog-closing');
- } else {
- scope.$destroy();
- privateMethods.closeDialogElement($dialog, value);
- }
- if (defers[id]) {
- defers[id].resolve({
- id: id,
- value: value,
- $dialog: $dialog,
- remainingDialogs: dialogsCount
- });
- delete defers[id];
- }
- if (scopes[id]) {
- delete scopes[id];
- }
- openIdStack.splice(openIdStack.indexOf(id), 1);
- if (!openIdStack.length) {
- $elements.body.unbind('keydown', privateMethods.onDocumentKeydown);
- keydownIsBound = false;
- }
-
- if (dialogsCount == 0)
- {
- closeByDocumentHandler = undefined;
- }
- },
-
- closeDialogElement: function($dialog, value) {
- var options = $dialog.data('$ngDialogOptions');
- $dialog.remove();
-
- activeBodyClasses.splice(activeBodyClasses.indexOf(options.bodyClassName), 1);
- if (activeBodyClasses.indexOf(options.bodyClassName) === -1) {
- $elements.html.removeClass(options.bodyClassName);
- $elements.body.removeClass(options.bodyClassName);
- }
-
- if (dialogsCount === 0) {
- privateMethods.resetBodyPadding();
- }
-
- $rootScope.$broadcast('ngDialog.closed', $dialog, value);
- },
-
- closeDialog: function ($dialog, value) {
- var preCloseCallback = $dialog.data('$ngDialogPreCloseCallback');
-
- if (preCloseCallback && angular.isFunction(preCloseCallback)) {
-
- var preCloseCallbackResult = preCloseCallback.call($dialog, value);
-
- if (angular.isObject(preCloseCallbackResult)) {
- if (preCloseCallbackResult.closePromise) {
- preCloseCallbackResult.closePromise.then(function () {
- privateMethods.performCloseDialog($dialog, value);
- }, function () {
- return false;
- });
- } else {
- preCloseCallbackResult.then(function () {
- privateMethods.performCloseDialog($dialog, value);
- }, function () {
- return false;
- });
- }
- } else if (preCloseCallbackResult !== false) {
- privateMethods.performCloseDialog($dialog, value);
- } else {
- return false;
- }
- } else {
- privateMethods.performCloseDialog($dialog, value);
- }
- },
-
- onTrapFocusKeydown: function(ev) {
- var el = angular.element(ev.currentTarget);
- var $dialog;
-
- if (el.hasClass('ngdialog')) {
- $dialog = el;
- } else {
- $dialog = privateMethods.getActiveDialog();
-
- if ($dialog === null) {
- return;
- }
- }
-
- var isTab = (ev.keyCode === 9);
- var backward = (ev.shiftKey === true);
-
- if (isTab) {
- privateMethods.handleTab($dialog, ev, backward);
- }
- },
-
- handleTab: function($dialog, ev, backward) {
- var focusableElements = privateMethods.getFocusableElements($dialog);
-
- if (focusableElements.length === 0) {
- if (document.activeElement && document.activeElement.blur) {
- document.activeElement.blur();
- }
- return;
- }
-
- var currentFocus = document.activeElement;
- var focusIndex = Array.prototype.indexOf.call(focusableElements, currentFocus);
-
- var isFocusIndexUnknown = (focusIndex === -1);
- var isFirstElementFocused = (focusIndex === 0);
- var isLastElementFocused = (focusIndex === focusableElements.length - 1);
-
- var cancelEvent = false;
-
- if (backward) {
- if (isFocusIndexUnknown || isFirstElementFocused) {
- focusableElements[focusableElements.length - 1].focus();
- cancelEvent = true;
- }
- } else {
- if (isFocusIndexUnknown || isLastElementFocused) {
- focusableElements[0].focus();
- cancelEvent = true;
- }
- }
-
- if (cancelEvent) {
- ev.preventDefault();
- ev.stopPropagation();
- }
- },
-
- autoFocus: function($dialog) {
- var dialogEl = $dialog[0];
-
- // Browser's (Chrome 40, Forefix 37, IE 11) don't appear to honor autofocus on the dialog, but we should
- var autoFocusEl = dialogEl.querySelector('*[autofocus]');
- if (autoFocusEl !== null) {
- autoFocusEl.focus();
-
- if (document.activeElement === autoFocusEl) {
- return;
- }
-
- // Autofocus element might was display: none, so let's continue
- }
-
- var focusableElements = privateMethods.getFocusableElements($dialog);
-
- if (focusableElements.length > 0) {
- focusableElements[0].focus();
- return;
- }
-
- // We need to focus something for the screen readers to notice the dialog
- var contentElements = privateMethods.filterVisibleElements(dialogEl.querySelectorAll('h1,h2,h3,h4,h5,h6,p,span'));
-
- if (contentElements.length > 0) {
- var contentElement = contentElements[0];
- $el(contentElement).attr('tabindex', '-1').css('outline', '0');
- contentElement.focus();
- }
- },
-
- getFocusableElements: function ($dialog) {
- var dialogEl = $dialog[0];
-
- var rawElements = dialogEl.querySelectorAll(focusableElementSelector);
-
- // Ignore untabbable elements, ie. those with tabindex = -1
- var tabbableElements = privateMethods.filterTabbableElements(rawElements);
-
- return privateMethods.filterVisibleElements(tabbableElements);
- },
-
- filterTabbableElements: function (els) {
- var tabbableFocusableElements = [];
-
- for (var i = 0; i < els.length; i++) {
- var el = els[i];
-
- if ($el(el).attr('tabindex') !== '-1') {
- tabbableFocusableElements.push(el);
- }
- }
-
- return tabbableFocusableElements;
- },
-
- filterVisibleElements: function (els) {
- var visibleFocusableElements = [];
-
- for (var i = 0; i < els.length; i++) {
- var el = els[i];
-
- if (el.offsetWidth > 0 || el.offsetHeight > 0) {
- visibleFocusableElements.push(el);
- }
- }
-
- return visibleFocusableElements;
- },
-
- getActiveDialog: function () {
- var dialogs = document.querySelectorAll('.ngdialog');
-
- if (dialogs.length === 0) {
- return null;
- }
-
- // TODO: This might be incorrect if there are a mix of open dialogs with different 'appendTo' values
- return $el(dialogs[dialogs.length - 1]);
- },
-
- applyAriaAttributes: function ($dialog, options) {
- if (options.ariaAuto) {
- if (!options.ariaRole) {
- var detectedRole = (privateMethods.getFocusableElements($dialog).length > 0) ?
- 'dialog' :
- 'alertdialog';
-
- options.ariaRole = detectedRole;
- }
-
- if (!options.ariaLabelledBySelector) {
- options.ariaLabelledBySelector = 'h1,h2,h3,h4,h5,h6';
- }
-
- if (!options.ariaDescribedBySelector) {
- options.ariaDescribedBySelector = 'article,section,p';
- }
- }
-
- if (options.ariaRole) {
- $dialog.attr('role', options.ariaRole);
- }
-
- privateMethods.applyAriaAttribute(
- $dialog, 'aria-labelledby', options.ariaLabelledById, options.ariaLabelledBySelector);
-
- privateMethods.applyAriaAttribute(
- $dialog, 'aria-describedby', options.ariaDescribedById, options.ariaDescribedBySelector);
- },
-
- applyAriaAttribute: function($dialog, attr, id, selector) {
- if (id) {
- $dialog.attr(attr, id);
- return;
- }
-
- if (selector) {
- var dialogId = $dialog.attr('id');
-
- var firstMatch = $dialog[0].querySelector(selector);
-
- if (!firstMatch) {
- return;
- }
-
- var generatedId = dialogId + '-' + attr;
-
- $el(firstMatch).attr('id', generatedId);
-
- $dialog.attr(attr, generatedId);
-
- return generatedId;
- }
- },
-
- detectUIRouter: function() {
- // Detect if ui-router module is installed
- // Returns ui-router version string if installed
- // Otherwise false
-
- if ($injector.has('$transitions')) {
- // Only 1.0.0+ ui.router allows us to inject $transitions
- return UI_ROUTER_VERSION_ONE_PLUS;
- }
- else if ($injector.has('$state')) {
- // The legacy ui.router allows us to inject $state
- return UI_ROUTER_VERSION_LEGACY;
- }
- return false;
- },
-
- getRouterLocationEventName: function() {
- if (privateMethods.detectUIRouter()) {
- return '$stateChangeStart';
- }
- return '$locationChangeStart';
- }
- };
-
- var publicMethods = {
- __PRIVATE__: privateMethods,
-
- /*
- * @param {Object} options:
- * - template {String} - id of ng-template, url for partial, plain string (if enabled)
- * - plain {Boolean} - enable plain string templates, default false
- * - scope {Object}
- * - controller {String}
- * - controllerAs {String}
- * - className {String} - dialog theme class
- * - appendClassName {String} - dialog theme class to be appended to defaults
- * - disableAnimation {Boolean} - set to true to disable animation
- * - showClose {Boolean} - show close button, default true
- * - closeByEscape {Boolean} - default true
- * - closeByDocument {Boolean} - default true
- * - preCloseCallback {String|Function} - user supplied function name/function called before closing dialog (if set)
- * - onOpenCallback {String|Function} - user supplied function name/function called after opening dialog (if set)
- * - bodyClassName {String} - class added to body at open dialog
- * @return {Object} dialog
- */
- open: function (opts) {
- var dialogID = null;
- opts = opts || {};
- if (openOnePerName && opts.name) {
- dialogID = opts.name.toLowerCase().replace(/\s/g, '-') + '-dialog';
- if (this.isOpen(dialogID)) {
- return;
- }
- }
- var options = angular.copy(defaults);
- var localID = ++globalID;
- dialogID = dialogID || 'ngdialog' + localID;
- openIdStack.push(dialogID);
-
- // Merge opts.data with predefined via setDefaults
- if (typeof options.data !== 'undefined') {
- if (typeof opts.data === 'undefined') {
- opts.data = {};
- }
- opts.data = angular.merge(angular.copy(options.data), opts.data);
- }
-
- angular.extend(options, opts);
-
- var defer;
- defers[dialogID] = defer = $q.defer();
-
- var scope;
- scopes[dialogID] = scope = angular.isObject(options.scope) ? options.scope.$new() : $rootScope.$new();
-
- var $dialog, $dialogParent, $dialogContent;
-
- var resolve = angular.extend({}, options.resolve);
-
- angular.forEach(resolve, function (value, key) {
- resolve[key] = angular.isString(value) ? $injector.get(value) : $injector.invoke(value, null, null, key);
- });
-
- $q.all({
- template: loadTemplate(options.template || options.templateUrl),
- locals: $q.all(resolve)
- }).then(function (setup) {
- var template = setup.template,
- locals = setup.locals;
-
- if (options.showClose) {
- template += '<button aria-label="Dismiss" class="ngdialog-close"></button>';
- }
-
- var hasOverlayClass = options.overlay ? '' : ' ngdialog-no-overlay';
- $dialog = $el('<div id="' + dialogID + '" class="ngdialog' + hasOverlayClass + '"></div>');
- $dialog.html((options.overlay ?
- '<div class="ngdialog-overlay"></div><div class="ngdialog-content" role="document">' + template + '</div>' :
- '<div class="ngdialog-content" role="document">' + template + '</div>'));
-
- $dialog.data('$ngDialogOptions', options);
-
- scope.ngDialogId = dialogID;
-
- if (options.data && angular.isString(options.data)) {
- var firstLetter = options.data.replace(/^\s*/, '')[0];
- scope.ngDialogData = (firstLetter === '{' || firstLetter === '[') ? angular.fromJson(options.data) : new String(options.data);
- scope.ngDialogData.ngDialogId = dialogID;
- } else if (options.data && angular.isObject(options.data)) {
- scope.ngDialogData = options.data;
- scope.ngDialogData.ngDialogId = dialogID;
- }
-
- if (options.className) {
- $dialog.addClass(options.className);
- }
-
- if (options.appendClassName) {
- $dialog.addClass(options.appendClassName);
- }
-
- if (options.width) {
- $dialogContent = $dialog[0].querySelector('.ngdialog-content');
- if (angular.isString(options.width)) {
- $dialogContent.style.width = options.width;
- } else {
- $dialogContent.style.width = options.width + 'px';
- }
- }
-
- if (options.height) {
- $dialogContent = $dialog[0].querySelector('.ngdialog-content');
- if (angular.isString(options.height)) {
- $dialogContent.style.height = options.height;
- } else {
- $dialogContent.style.height = options.height + 'px';
- }
- }
-
- if (options.disableAnimation) {
- $dialog.addClass(disabledAnimationClass);
- }
-
- if (options.appendTo && angular.isString(options.appendTo)) {
- $dialogParent = angular.element(document.querySelector(options.appendTo));
- } else {
- $dialogParent = $elements.body;
- }
-
- privateMethods.applyAriaAttributes($dialog, options);
-
- [
- { name: '$ngDialogPreCloseCallback', value: options.preCloseCallback },
- { name: '$ngDialogOnOpenCallback', value: options.onOpenCallback }
- ].forEach(function (option) {
- if (option.value) {
- var callback;
-
- if (angular.isFunction(option.value)) {
- callback = option.value;
- } else if (angular.isString(option.value)) {
- if (scope) {
- if (angular.isFunction(scope[option.value])) {
- callback = scope[option.value];
- } else if (scope.$parent && angular.isFunction(scope.$parent[option.value])) {
- callback = scope.$parent[option.value];
- } else if ($rootScope && angular.isFunction($rootScope[option.value])) {
- callback = $rootScope[option.value];
- }
- }
- }
-
- if (callback) {
- $dialog.data(option.name, callback);
- }
- }
- });
-
- scope.closeThisDialog = function (value) {
- privateMethods.closeDialog($dialog, value);
- };
-
- if (options.controller && (angular.isString(options.controller) || angular.isArray(options.controller) || angular.isFunction(options.controller))) {
-
- var label;
-
- if (options.controllerAs && angular.isString(options.controllerAs)) {
- label = options.controllerAs;
- }
-
- var controllerInstance = $controller(options.controller, angular.extend(
- locals,
- {
- $scope: scope,
- $element: $dialog
- }),
- true,
- label
- );
-
- if(options.bindToController) {
- angular.extend(controllerInstance.instance, {ngDialogId: scope.ngDialogId, ngDialogData: scope.ngDialogData, closeThisDialog: scope.closeThisDialog, confirm: scope.confirm});
- }
-
- if(typeof controllerInstance === 'function'){
- $dialog.data('$ngDialogControllerController', controllerInstance());
- } else {
- $dialog.data('$ngDialogControllerController', controllerInstance);
- }
- }
-
- $timeout(function () {
- var $activeDialogs = document.querySelectorAll('.ngdialog');
- privateMethods.deactivateAll($activeDialogs);
-
- $compile($dialog)(scope);
- var widthDiffs = $window.innerWidth - $elements.body.prop('clientWidth');
- $elements.html.addClass(options.bodyClassName);
- $elements.body.addClass(options.bodyClassName);
- activeBodyClasses.push(options.bodyClassName);
- var scrollBarWidth = widthDiffs - ($window.innerWidth - $elements.body.prop('clientWidth'));
- if (scrollBarWidth > 0) {
- privateMethods.setBodyPadding(scrollBarWidth);
- }
- $dialogParent.append($dialog);
-
- privateMethods.activate($dialog);
-
- if (options.trapFocus) {
- privateMethods.autoFocus($dialog);
- }
-
- if (options.name) {
- $rootScope.$broadcast('ngDialog.opened', {dialog: $dialog, name: options.name});
- } else {
- $rootScope.$broadcast('ngDialog.opened', $dialog);
- }
- var onOpenCallback = $dialog.data('$ngDialogOnOpenCallback');
- if (onOpenCallback && angular.isFunction(onOpenCallback)) {
- onOpenCallback.call($dialog);
- }
-
- });
-
- if (!keydownIsBound) {
- $elements.body.bind('keydown', privateMethods.onDocumentKeydown);
- keydownIsBound = true;
- }
-
- if (options.closeByNavigation) {
- closeByNavigationDialogStack.push($dialog);
- }
-
- if (options.preserveFocus) {
- $dialog.data('$ngDialogPreviousFocus', document.activeElement);
- }
-
- closeByDocumentHandler = function (event) {
- var isOverlay = options.closeByDocument ? $el(event.target).hasClass('ngdialog-overlay') : false;
- var isCloseBtn = $el(event.target).hasClass('ngdialog-close');
-
- if (isOverlay || isCloseBtn) {
- publicMethods.close($dialog.attr('id'), isCloseBtn ? '$closeButton' : '$document');
- }
- };
-
- if (typeof $window.Hammer !== 'undefined') {
- var hammerTime = scope.hammerTime = $window.Hammer($dialog[0]);
- hammerTime.on('tap', closeByDocumentHandler);
- } else {
- $dialog.bind('click', closeByDocumentHandler);
- }
-
- dialogsCount += 1;
-
- return publicMethods;
- });
-
- return {
- id: dialogID,
- closePromise: defer.promise,
- close: function (value) {
- privateMethods.closeDialog($dialog, value);
- }
- };
-
- function loadTemplateUrl (tmpl, config) {
- var config = config || {};
- config.headers = config.headers || {};
-
- angular.extend(config.headers, {'Accept': 'text/html'});
-
- $rootScope.$broadcast('ngDialog.templateLoading', tmpl);
- return $http.get(tmpl, config).then(function(res) {
- $rootScope.$broadcast('ngDialog.templateLoaded', tmpl);
- return res.data || '';
- });
- }
-
- function loadTemplate (tmpl) {
- if (!tmpl) {
- return 'Empty template';
- }
-
- if (angular.isString(tmpl) && options.plain) {
- return tmpl;
- }
-
- if (typeof options.cache === 'boolean' && !options.cache) {
- return loadTemplateUrl(tmpl, {cache: false});
- }
-
- return loadTemplateUrl(tmpl, {cache: $templateCache});
- }
- },
-
- /*
- * @param {Object} options:
- * - template {String} - id of ng-template, url for partial, plain string (if enabled)
- * - plain {Boolean} - enable plain string templates, default false
- * - name {String}
- * - scope {Object}
- * - controller {String}
- * - controllerAs {String}
- * - className {String} - dialog theme class
- * - appendClassName {String} - dialog theme class to be appended to defaults
- * - showClose {Boolean} - show close button, default true
- * - closeByEscape {Boolean} - default false
- * - closeByDocument {Boolean} - default false
- * - preCloseCallback {String|Function} - user supplied function name/function called before closing dialog (if set); not called on confirm
- * - bodyClassName {String} - class added to body at open dialog
- *
- * @return {Object} dialog
- */
- openConfirm: function (opts) {
- var defer = $q.defer();
- var options = angular.copy(defaults);
-
- opts = opts || {};
-
- // Merge opts.data with predefined via setDefaults
- if (typeof options.data !== 'undefined') {
- if (typeof opts.data === 'undefined') {
- opts.data = {};
- }
- opts.data = angular.merge(angular.copy(options.data), opts.data);
- }
-
- angular.extend(options, opts);
-
- options.scope = angular.isObject(options.scope) ? options.scope.$new() : $rootScope.$new();
- options.scope.confirm = function (value) {
- defer.resolve(value);
- var $dialog = $el(document.getElementById(openResult.id));
- privateMethods.performCloseDialog($dialog, value);
- };
-
- var openResult = publicMethods.open(options);
- if (openResult) {
- openResult.closePromise.then(function (data) {
- if (data) {
- return defer.reject(data.value);
- }
- return defer.reject();
- });
- return defer.promise;
- }
- },
-
- isOpen: function(id) {
- var $dialog = $el(document.getElementById(id));
- return $dialog.length > 0;
- },
-
- /*
- * @param {String} id
- * @return {Object} dialog
- */
- close: function (id, value) {
- var $dialog = $el(document.getElementById(id));
-
- if ($dialog.length) {
- privateMethods.closeDialog($dialog, value);
- } else {
- if (id === '$escape') {
- var topDialogId = openIdStack[openIdStack.length - 1];
- $dialog = $el(document.getElementById(topDialogId));
- if ($dialog.data('$ngDialogOptions').closeByEscape) {
- privateMethods.closeDialog($dialog, '$escape');
- }
- } else {
- publicMethods.closeAll(value);
- }
- }
-
- return publicMethods;
- },
-
- closeAll: function (value) {
- var $all = document.querySelectorAll('.ngdialog');
-
- // Reverse order to ensure focus restoration works as expected
- for (var i = $all.length - 1; i >= 0; i--) {
- var dialog = $all[i];
- privateMethods.closeDialog($el(dialog), value);
- }
- },
-
- getOpenDialogs: function() {
- return openIdStack;
- },
-
- getDefaults: function () {
- return defaults;
- }
- };
-
- angular.forEach(
- ['html', 'body'],
- function(elementName) {
- $elements[elementName] = $document.find(elementName);
- if (forceElementsReload[elementName]) {
- var eventName = privateMethods.getRouterLocationEventName();
- $rootScope.$on(eventName, function () {
- $elements[elementName] = $document.find(elementName);
- });
- }
- }
- );
-
- // Listen to navigation events to close dialog
- var uiRouterVersion = privateMethods.detectUIRouter();
- if (uiRouterVersion === UI_ROUTER_VERSION_ONE_PLUS) {
- var $transitions = $injector.get('$transitions');
- $transitions.onStart({}, function (trans) {
- while (closeByNavigationDialogStack.length > 0) {
- var toCloseDialog = closeByNavigationDialogStack.pop();
- if (privateMethods.closeDialog(toCloseDialog) === false) {
- return false;
- }
- }
- });
- }
- else {
- var eventName = uiRouterVersion === UI_ROUTER_VERSION_LEGACY ? '$stateChangeStart' : '$locationChangeStart';
- $rootScope.$on(eventName, function ($event) {
- while (closeByNavigationDialogStack.length > 0) {
- var toCloseDialog = closeByNavigationDialogStack.pop();
- if (privateMethods.closeDialog(toCloseDialog) === false) {
- $event.preventDefault();
- }
- }
- });
- }
-
- return publicMethods;
- }];
- });
-
- m.directive('ngDialog', ['ngDialog', function (ngDialog) {
- return {
- restrict: 'A',
- scope: {
- ngDialogScope: '='
- },
- link: function (scope, elem, attrs) {
- elem.on('click', function (e) {
- e.preventDefault();
-
- var ngDialogScope = angular.isDefined(scope.ngDialogScope) ? scope.ngDialogScope : 'noScope';
- angular.isDefined(attrs.ngDialogClosePrevious) && ngDialog.close(attrs.ngDialogClosePrevious);
-
- var defaults = ngDialog.getDefaults();
-
- ngDialog.open({
- template: attrs.ngDialog,
- className: attrs.ngDialogClass || defaults.className,
- appendClassName: attrs.ngDialogAppendClass,
- controller: attrs.ngDialogController,
- controllerAs: attrs.ngDialogControllerAs,
- bindToController: attrs.ngDialogBindToController,
- disableAnimation: attrs.ngDialogDisableAnimation,
- scope: ngDialogScope,
- data: attrs.ngDialogData,
- showClose: attrs.ngDialogShowClose === 'false' ? false : (attrs.ngDialogShowClose === 'true' ? true : defaults.showClose),
- closeByDocument: attrs.ngDialogCloseByDocument === 'false' ? false : (attrs.ngDialogCloseByDocument === 'true' ? true : defaults.closeByDocument),
- closeByEscape: attrs.ngDialogCloseByEscape === 'false' ? false : (attrs.ngDialogCloseByEscape === 'true' ? true : defaults.closeByEscape),
- overlay: attrs.ngDialogOverlay === 'false' ? false : (attrs.ngDialogOverlay === 'true' ? true : defaults.overlay),
- preCloseCallback: attrs.ngDialogPreCloseCallback || defaults.preCloseCallback,
- onOpenCallback: attrs.ngDialogOnOpenCallback || defaults.onOpenCallback,
- bodyClassName: attrs.ngDialogBodyClass || defaults.bodyClassName
- });
- });
- }
- };
- }]);
-
- return m;
-}));
diff --git a/libs/bower_components/ngDialog/js/ngDialog.min.js b/libs/bower_components/ngDialog/js/ngDialog.min.js
deleted file mode 100644
index aa9cee34f6..0000000000
--- a/libs/bower_components/ngDialog/js/ngDialog.min.js
+++ /dev/null
@@ -1,2 +0,0 @@
-/*! ng-dialog - v1.2.0 (https://github.com/likeastore/ngDialog) */
-!function(a,b){"undefined"!=typeof module&&module.exports?(b("undefined"==typeof angular?require("angular"):angular),module.exports="ngDialog"):"function"==typeof define&&define.amd?define(["angular"],b):b(a.angular)}(this,function(a){"use strict";var b=a.module("ngDialog",[]),c=a.element,d=a.isDefined,e=(document.body||document.documentElement).style,f=d(e.animation)||d(e.WebkitAnimation)||d(e.MozAnimation)||d(e.MsAnimation)||d(e.OAnimation),g="animationend webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend",h="a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, *[tabindex], *[contenteditable]",i="ngdialog-disabled-animation",j={html:!1,body:!1},k={},l=[],m=[],n=!1,o=!1,p=[],q="legacy",r="1.0.0+";return b.provider("ngDialog",function(){var b=this.defaults={className:"ngdialog-theme-default",appendClassName:"",disableAnimation:!1,plain:!1,showClose:!0,closeByDocument:!0,closeByEscape:!0,closeByNavigation:!1,appendTo:!1,preCloseCallback:!1,onOpenCallback:!1,overlay:!0,cache:!0,trapFocus:!0,preserveFocus:!0,ariaAuto:!0,ariaRole:null,ariaLabelledById:null,ariaLabelledBySelector:null,ariaDescribedById:null,ariaDescribedBySelector:null,bodyClassName:"ngdialog-open",width:null,height:null};this.setForceHtmlReload=function(a){j.html=a||!1},this.setForceBodyReload=function(a){j.body=a||!1},this.setDefaults=function(c){a.extend(b,c)},this.setOpenOnePerName=function(a){o=a||!1};var d,e=0,s=0,t={};this.$get=["$document","$templateCache","$compile","$q","$http","$rootScope","$timeout","$window","$controller","$injector",function(u,v,w,x,y,z,A,B,C,D){var E=[],F={onDocumentKeydown:function(a){27===a.keyCode&&G.close("$escape")},activate:function(a){var b=a.data("$ngDialogOptions");b.trapFocus&&(a.on("keydown",F.onTrapFocusKeydown),E.body.on("keydown",F.onTrapFocusKeydown))},deactivate:function(a){a.off("keydown",F.onTrapFocusKeydown),E.body.off("keydown",F.onTrapFocusKeydown)},deactivateAll:function(b){a.forEach(b,function(b){var c=a.element(b);F.deactivate(c)})},setBodyPadding:function(a){var b=parseInt(E.body.css("padding-right")||0,10);E.body.css("padding-right",b+a+"px"),E.body.data("ng-dialog-original-padding",b),z.$broadcast("ngDialog.setPadding",a)},resetBodyPadding:function(){var a=E.body.data("ng-dialog-original-padding");a?E.body.css("padding-right",a+"px"):E.body.css("padding-right",""),z.$broadcast("ngDialog.setPadding",0)},performCloseDialog:function(a,b){var c=a.data("$ngDialogOptions"),e=a.attr("id"),h=k[e];if(F.deactivate(a),h){if("undefined"!=typeof B.Hammer){var i=h.hammerTime;i.off("tap",d),i.destroy&&i.destroy(),delete h.hammerTime}else a.unbind("click");1===s&&E.body.unbind("keydown",F.onDocumentKeydown),a.hasClass("ngdialog-closing")||(s-=1);var j=a.data("$ngDialogPreviousFocus");j&&j.focus&&j.focus(),z.$broadcast("ngDialog.closing",a,b),s=s<0?0:s,f&&!c.disableAnimation?(h.$destroy(),a.unbind(g).bind(g,function(){F.closeDialogElement(a,b)}).addClass("ngdialog-closing")):(h.$destroy(),F.closeDialogElement(a,b)),t[e]&&(t[e].resolve({id:e,value:b,$dialog:a,remainingDialogs:s}),delete t[e]),k[e]&&delete k[e],l.splice(l.indexOf(e),1),l.length||(E.body.unbind("keydown",F.onDocumentKeydown),n=!1),0==s&&(d=void 0)}},closeDialogElement:function(a,b){var c=a.data("$ngDialogOptions");a.remove(),m.splice(m.indexOf(c.bodyClassName),1),m.indexOf(c.bodyClassName)===-1&&(E.html.removeClass(c.bodyClassName),E.body.removeClass(c.bodyClassName)),0===s&&F.resetBodyPadding(),z.$broadcast("ngDialog.closed",a,b)},closeDialog:function(b,c){var d=b.data("$ngDialogPreCloseCallback");if(d&&a.isFunction(d)){var e=d.call(b,c);if(a.isObject(e))e.closePromise?e.closePromise.then(function(){F.performCloseDialog(b,c)},function(){return!1}):e.then(function(){F.performCloseDialog(b,c)},function(){return!1});else{if(e===!1)return!1;F.performCloseDialog(b,c)}}else F.performCloseDialog(b,c)},onTrapFocusKeydown:function(b){var c,d=a.element(b.currentTarget);if(d.hasClass("ngdialog"))c=d;else if(c=F.getActiveDialog(),null===c)return;var e=9===b.keyCode,f=b.shiftKey===!0;e&&F.handleTab(c,b,f)},handleTab:function(a,b,c){var d=F.getFocusableElements(a);if(0===d.length)return void(document.activeElement&&document.activeElement.blur&&document.activeElement.blur());var e=document.activeElement,f=Array.prototype.indexOf.call(d,e),g=f===-1,h=0===f,i=f===d.length-1,j=!1;c?(g||h)&&(d[d.length-1].focus(),j=!0):(g||i)&&(d[0].focus(),j=!0),j&&(b.preventDefault(),b.stopPropagation())},autoFocus:function(a){var b=a[0],d=b.querySelector("*[autofocus]");if(null===d||(d.focus(),document.activeElement!==d)){var e=F.getFocusableElements(a);if(e.length>0)return void e[0].focus();var f=F.filterVisibleElements(b.querySelectorAll("h1,h2,h3,h4,h5,h6,p,span"));if(f.length>0){var g=f[0];c(g).attr("tabindex","-1").css("outline","0"),g.focus()}}},getFocusableElements:function(a){var b=a[0],c=b.querySelectorAll(h),d=F.filterTabbableElements(c);return F.filterVisibleElements(d)},filterTabbableElements:function(a){for(var b=[],d=0;d<a.length;d++){var e=a[d];"-1"!==c(e).attr("tabindex")&&b.push(e)}return b},filterVisibleElements:function(a){for(var b=[],c=0;c<a.length;c++){var d=a[c];(d.offsetWidth>0||d.offsetHeight>0)&&b.push(d)}return b},getActiveDialog:function(){var a=document.querySelectorAll(".ngdialog");return 0===a.length?null:c(a[a.length-1])},applyAriaAttributes:function(a,b){if(b.ariaAuto){if(!b.ariaRole){var c=F.getFocusableElements(a).length>0?"dialog":"alertdialog";b.ariaRole=c}b.ariaLabelledBySelector||(b.ariaLabelledBySelector="h1,h2,h3,h4,h5,h6"),b.ariaDescribedBySelector||(b.ariaDescribedBySelector="article,section,p")}b.ariaRole&&a.attr("role",b.ariaRole),F.applyAriaAttribute(a,"aria-labelledby",b.ariaLabelledById,b.ariaLabelledBySelector),F.applyAriaAttribute(a,"aria-describedby",b.ariaDescribedById,b.ariaDescribedBySelector)},applyAriaAttribute:function(a,b,d,e){if(d)return void a.attr(b,d);if(e){var f=a.attr("id"),g=a[0].querySelector(e);if(!g)return;var h=f+"-"+b;return c(g).attr("id",h),a.attr(b,h),h}},detectUIRouter:function(){return D.has("$transitions")?r:!!D.has("$state")&&q},getRouterLocationEventName:function(){return F.detectUIRouter()?"$stateChangeStart":"$locationChangeStart"}},G={__PRIVATE__:F,open:function(f){function g(b,c){var c=c||{};return c.headers=c.headers||{},a.extend(c.headers,{Accept:"text/html"}),z.$broadcast("ngDialog.templateLoading",b),y.get(b,c).then(function(a){return z.$broadcast("ngDialog.templateLoaded",b),a.data||""})}function h(b){return b?a.isString(b)&&q.plain?b:"boolean"!=typeof q.cache||q.cache?g(b,{cache:v}):g(b,{cache:!1}):"Empty template"}var j=null;if(f=f||{},!(o&&f.name&&(j=f.name.toLowerCase().replace(/\s/g,"-")+"-dialog",this.isOpen(j)))){var q=a.copy(b),r=++e;j=j||"ngdialog"+r,l.push(j),"undefined"!=typeof q.data&&("undefined"==typeof f.data&&(f.data={}),f.data=a.merge(a.copy(q.data),f.data)),a.extend(q,f);var u;t[j]=u=x.defer();var H;k[j]=H=a.isObject(q.scope)?q.scope.$new():z.$new();var I,J,K,L=a.extend({},q.resolve);return a.forEach(L,function(b,c){L[c]=a.isString(b)?D.get(b):D.invoke(b,null,null,c)}),x.all({template:h(q.template||q.templateUrl),locals:x.all(L)}).then(function(b){var e=b.template,f=b.locals;q.showClose&&(e+='<button aria-label="Dismiss" class="ngdialog-close"></button>');var g=q.overlay?"":" ngdialog-no-overlay";if(I=c('<div id="'+j+'" class="ngdialog'+g+'"></div>'),I.html(q.overlay?'<div class="ngdialog-overlay"></div><div class="ngdialog-content" role="document">'+e+"</div>":'<div class="ngdialog-content" role="document">'+e+"</div>"),I.data("$ngDialogOptions",q),H.ngDialogId=j,q.data&&a.isString(q.data)){var h=q.data.replace(/^\s*/,"")[0];H.ngDialogData="{"===h||"["===h?a.fromJson(q.data):new String(q.data),H.ngDialogData.ngDialogId=j}else q.data&&a.isObject(q.data)&&(H.ngDialogData=q.data,H.ngDialogData.ngDialogId=j);if(q.className&&I.addClass(q.className),q.appendClassName&&I.addClass(q.appendClassName),q.width&&(K=I[0].querySelector(".ngdialog-content"),a.isString(q.width)?K.style.width=q.width:K.style.width=q.width+"px"),q.height&&(K=I[0].querySelector(".ngdialog-content"),a.isString(q.height)?K.style.height=q.height:K.style.height=q.height+"px"),q.disableAnimation&&I.addClass(i),J=q.appendTo&&a.isString(q.appendTo)?a.element(document.querySelector(q.appendTo)):E.body,F.applyAriaAttributes(I,q),[{name:"$ngDialogPreCloseCallback",value:q.preCloseCallback},{name:"$ngDialogOnOpenCallback",value:q.onOpenCallback}].forEach(function(b){if(b.value){var c;a.isFunction(b.value)?c=b.value:a.isString(b.value)&&H&&(a.isFunction(H[b.value])?c=H[b.value]:H.$parent&&a.isFunction(H.$parent[b.value])?c=H.$parent[b.value]:z&&a.isFunction(z[b.value])&&(c=z[b.value])),c&&I.data(b.name,c)}}),H.closeThisDialog=function(a){F.closeDialog(I,a)},q.controller&&(a.isString(q.controller)||a.isArray(q.controller)||a.isFunction(q.controller))){var k;q.controllerAs&&a.isString(q.controllerAs)&&(k=q.controllerAs);var l=C(q.controller,a.extend(f,{$scope:H,$element:I}),!0,k);q.bindToController&&a.extend(l.instance,{ngDialogId:H.ngDialogId,ngDialogData:H.ngDialogData,closeThisDialog:H.closeThisDialog,confirm:H.confirm}),"function"==typeof l?I.data("$ngDialogControllerController",l()):I.data("$ngDialogControllerController",l)}if(A(function(){var b=document.querySelectorAll(".ngdialog");F.deactivateAll(b),w(I)(H);var c=B.innerWidth-E.body.prop("clientWidth");E.html.addClass(q.bodyClassName),E.body.addClass(q.bodyClassName),m.push(q.bodyClassName);var d=c-(B.innerWidth-E.body.prop("clientWidth"));d>0&&F.setBodyPadding(d),J.append(I),F.activate(I),q.trapFocus&&F.autoFocus(I),q.name?z.$broadcast("ngDialog.opened",{dialog:I,name:q.name}):z.$broadcast("ngDialog.opened",I);var e=I.data("$ngDialogOnOpenCallback");e&&a.isFunction(e)&&e.call(I)}),n||(E.body.bind("keydown",F.onDocumentKeydown),n=!0),q.closeByNavigation&&p.push(I),q.preserveFocus&&I.data("$ngDialogPreviousFocus",document.activeElement),d=function(a){var b=!!q.closeByDocument&&c(a.target).hasClass("ngdialog-overlay"),d=c(a.target).hasClass("ngdialog-close");(b||d)&&G.close(I.attr("id"),d?"$closeButton":"$document")},"undefined"!=typeof B.Hammer){var o=H.hammerTime=B.Hammer(I[0]);o.on("tap",d)}else I.bind("click",d);return s+=1,G}),{id:j,closePromise:u.promise,close:function(a){F.closeDialog(I,a)}}}},openConfirm:function(d){var e=x.defer(),f=a.copy(b);d=d||{},"undefined"!=typeof f.data&&("undefined"==typeof d.data&&(d.data={}),d.data=a.merge(a.copy(f.data),d.data)),a.extend(f,d),f.scope=a.isObject(f.scope)?f.scope.$new():z.$new(),f.scope.confirm=function(a){e.resolve(a);var b=c(document.getElementById(g.id));F.performCloseDialog(b,a)};var g=G.open(f);if(g)return g.closePromise.then(function(a){return a?e.reject(a.value):e.reject()}),e.promise},isOpen:function(a){var b=c(document.getElementById(a));return b.length>0},close:function(a,b){var d=c(document.getElementById(a));if(d.length)F.closeDialog(d,b);else if("$escape"===a){var e=l[l.length-1];d=c(document.getElementById(e)),d.data("$ngDialogOptions").closeByEscape&&F.closeDialog(d,"$escape")}else G.closeAll(b);return G},closeAll:function(a){for(var b=document.querySelectorAll(".ngdialog"),d=b.length-1;d>=0;d--){var e=b[d];F.closeDialog(c(e),a)}},getOpenDialogs:function(){return l},getDefaults:function(){return b}};a.forEach(["html","body"],function(a){if(E[a]=u.find(a),j[a]){var b=F.getRouterLocationEventName();z.$on(b,function(){E[a]=u.find(a)})}});var H=F.detectUIRouter();if(H===r){var I=D.get("$transitions");I.onStart({},function(a){for(;p.length>0;){var b=p.pop();if(F.closeDialog(b)===!1)return!1}})}else{var J=H===q?"$stateChangeStart":"$locationChangeStart";z.$on(J,function(a){for(;p.length>0;){var b=p.pop();F.closeDialog(b)===!1&&a.preventDefault()}})}return G}]}),b.directive("ngDialog",["ngDialog",function(b){return{restrict:"A",scope:{ngDialogScope:"="},link:function(c,d,e){d.on("click",function(d){d.preventDefault();var f=a.isDefined(c.ngDialogScope)?c.ngDialogScope:"noScope";a.isDefined(e.ngDialogClosePrevious)&&b.close(e.ngDialogClosePrevious);var g=b.getDefaults();b.open({template:e.ngDialog,className:e.ngDialogClass||g.className,appendClassName:e.ngDialogAppendClass,controller:e.ngDialogController,controllerAs:e.ngDialogControllerAs,bindToController:e.ngDialogBindToController,disableAnimation:e.ngDialogDisableAnimation,scope:f,data:e.ngDialogData,showClose:"false"!==e.ngDialogShowClose&&("true"===e.ngDialogShowClose||g.showClose),closeByDocument:"false"!==e.ngDialogCloseByDocument&&("true"===e.ngDialogCloseByDocument||g.closeByDocument),closeByEscape:"false"!==e.ngDialogCloseByEscape&&("true"===e.ngDialogCloseByEscape||g.closeByEscape),overlay:"false"!==e.ngDialogOverlay&&("true"===e.ngDialogOverlay||g.overlay),preCloseCallback:e.ngDialogPreCloseCallback||g.preCloseCallback,onOpenCallback:e.ngDialogOnOpenCallback||g.onOpenCallback,bodyClassName:e.ngDialogBodyClass||g.bodyClassName})})}}}]),b}); \ No newline at end of file