diff options
author | 2018-07-05 22:37:35 -0400 | |
---|---|---|
committer | 2018-07-25 09:17:09 +0000 | |
commit | 58b91dd3baaaf72ab65062a4804403cd4a5935b2 (patch) | |
tree | 801b1f39b3bee25ecbaae387339955d55651e98b /cvp/3rd_party/static/testapi-ui/assets/lib/angular-confirm-modal/angular-confirm.js | |
parent | 947f1bf0147c40971fdae36feecd477ab3caf3b8 (diff) |
Move OVP web portal code to a separate repo
The new repo for web portal is https://gerrit.opnfv.org/gerrit/dovetail-webportal
JIRA: DOVETAIL-671
Change-Id: Iac085abc3d175b9a091d70d0448af56c7a6845e9
Signed-off-by: xudan <xudan16@huawei.com>
Diffstat (limited to 'cvp/3rd_party/static/testapi-ui/assets/lib/angular-confirm-modal/angular-confirm.js')
-rw-r--r-- | cvp/3rd_party/static/testapi-ui/assets/lib/angular-confirm-modal/angular-confirm.js | 108 |
1 files changed, 0 insertions, 108 deletions
diff --git a/cvp/3rd_party/static/testapi-ui/assets/lib/angular-confirm-modal/angular-confirm.js b/cvp/3rd_party/static/testapi-ui/assets/lib/angular-confirm-modal/angular-confirm.js deleted file mode 100644 index ed08ca63..00000000 --- a/cvp/3rd_party/static/testapi-ui/assets/lib/angular-confirm-modal/angular-confirm.js +++ /dev/null @@ -1,108 +0,0 @@ -/* - * angular-confirm - * https://github.com/Schlogen/angular-confirm - * @version v1.2.3 - 2016-01-26 - * @license Apache - */ -(function (root, factory) { - 'use strict'; - if (typeof define === 'function' && define.amd) { - define(['angular'], factory); - } else if (typeof module !== 'undefined' && typeof module.exports === 'object') { - module.exports = factory(require('angular')); - } else { - return factory(root.angular); - } -}(this, function (angular) { -angular.module('angular-confirm', ['ui.bootstrap.modal']) - .controller('ConfirmModalController', function ($scope, $uibModalInstance, data) { - $scope.data = angular.copy(data); - - $scope.ok = function (closeMessage) { - $uibModalInstance.close(closeMessage); - }; - - $scope.cancel = function (dismissMessage) { - if (angular.isUndefined(dismissMessage)) { - dismissMessage = 'cancel'; - } - $uibModalInstance.dismiss(dismissMessage); - }; - - }) - .value('$confirmModalDefaults', { - template: '<div class="modal-header"><h3 class="modal-title">{{data.title}}</h3></div>' + - '<div class="modal-body">{{data.text}}</div>' + - '<div class="modal-footer">' + - '<button class="btn btn-primary" ng-click="ok()">{{data.ok}}</button>' + - '<button class="btn btn-default" ng-click="cancel()">{{data.cancel}}</button>' + - '</div>', - controller: 'ConfirmModalController', - defaultLabels: { - title: 'Confirm', - ok: 'OK', - cancel: 'Cancel' - } - }) - .factory('$confirm', function ($uibModal, $confirmModalDefaults) { - return function (data, settings) { - var defaults = angular.copy($confirmModalDefaults); - settings = angular.extend(defaults, (settings || {})); - - data = angular.extend({}, settings.defaultLabels, data || {}); - - if ('templateUrl' in settings && 'template' in settings) { - delete settings.template; - } - - settings.resolve = { - data: function () { - return data; - } - }; - - return $uibModal.open(settings).result; - }; - }) - .directive('confirm', function ($confirm) { - return { - priority: 1, - restrict: 'A', - scope: { - confirmIf: "=", - ngClick: '&', - confirm: '@', - confirmSettings: "=", - confirmTitle: '@', - confirmOk: '@', - confirmCancel: '@' - }, - link: function (scope, element, attrs) { - - element.unbind("click").bind("click", function ($event) { - - $event.preventDefault(); - - if (angular.isUndefined(scope.confirmIf) || scope.confirmIf) { - - var data = {text: scope.confirm}; - if (scope.confirmTitle) { - data.title = scope.confirmTitle; - } - if (scope.confirmOk) { - data.ok = scope.confirmOk; - } - if (scope.confirmCancel) { - data.cancel = scope.confirmCancel; - } - $confirm(data, scope.confirmSettings || {}).then(scope.ngClick); - } else { - - scope.$apply(scope.ngClick); - } - }); - - } - } - }); -})); |