diff options
author | Eddy Hautot <eh552t@intl.att.com> | 2018-07-03 10:07:37 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2018-07-03 10:07:37 +0000 |
commit | 13e80f1b27a0a86de516594b502be51c7ae59258 (patch) | |
tree | 8eacdf5afe1ccc310290aa3528d9eacbc19de512 /src | |
parent | a3136f2e3c1d2aec41cd42c9d1897d43f8ce134a (diff) | |
parent | da3e1d9567b3b7a9a2b9c6db0c3cf8e1542d554b (diff) |
Merge "Remove angucomplete"
Diffstat (limited to 'src')
6 files changed, 3 insertions, 319 deletions
diff --git a/src/main/resources/META-INF/resources/designer/css/angucomplete.css b/src/main/resources/META-INF/resources/designer/css/angucomplete.css deleted file mode 100644 index 8e48ced0c..000000000 --- a/src/main/resources/META-INF/resources/designer/css/angucomplete.css +++ /dev/null @@ -1,67 +0,0 @@ -.angucomplete-holder { - position: relative; -} - -.angucomplete-dropdown { - border-color: #ececec; - border-width: 1px; - border-style: solid; - border-radius: 2px; - width: 400px; - padding: 6px; - cursor: pointer; - z-index: 9999; - position: absolute; - /*top: 32px; - left: 0px; - */ - margin-top: -6px; - background-color: #ffffff; -} - -.angucomplete-searching { - color: #acacac; - font-size: 14px; -} - -.angucomplete-description { - font-size: 14px; -} - -.angucomplete-row { - padding: 5px; - color: #000000; - margin-bottom: 4px; - -} - -.angucomplete-selected-row, .angucomplete-row:hover { - background-color: lightblue; - color: #ffffff; -} - -.angucomplete-image-holder { - padding-top: 2px; - float: left; - margin-right: 10px; - margin-left: 5px; -} - -.angucomplete-image { - height: 34px; - width: 34px; - border-radius: 50%; - border-color: #ececec; - border-style: solid; - border-width: 1px; -} - -.angucomplete-image-default { - /* Add your own default image here - background-image: url('/assets/default.png'); - */ - background-position: center; - background-size: contain; - height: 34px; - width: 34px; -} diff --git a/src/main/resources/META-INF/resources/designer/index.html b/src/main/resources/META-INF/resources/designer/index.html index fdd496968..9af352eaf 100644 --- a/src/main/resources/META-INF/resources/designer/index.html +++ b/src/main/resources/META-INF/resources/designer/index.html @@ -64,7 +64,6 @@ <link href="css/utm_custom_style.css" rel="stylesheet"> <link href="css/AdminLTE.css" rel="stylesheet" type="text/css" /> -<link href="css/angucomplete.css" rel="stylesheet" type="text/css" /> <link href="css/ui-grid.css" rel="stylesheet"> <link href="css/ui-grid-stable.css" rel="stylesheet"> @@ -127,7 +126,6 @@ <script src="lib/ui-grid-stable.js"></script> <script src="lib/ui-grid-unstable.js"></script> <script src="lib/multiselect.js"></script> - <script type="text/javascript" src="lib/angucomplete.js"></script> <!-- Start Up Files --> <script src="scripts/app.js"></script> diff --git a/src/main/resources/META-INF/resources/designer/lib/angucomplete.js b/src/main/resources/META-INF/resources/designer/lib/angucomplete.js deleted file mode 100644 index 261aa9a56..000000000 --- a/src/main/resources/META-INF/resources/designer/lib/angucomplete.js +++ /dev/null @@ -1,246 +0,0 @@ -/** - * Angucomplete - * Autocomplete directive for AngularJS - * By Daryl Rowland - */ - -angular.module('angucomplete', [] ) - .directive('angucomplete', function ($parse, $http, $sce, $timeout) { - return { - restrict: 'EA', - scope: { - "id": "@id", - "placeholder": "@placeholder", - "selectedObject": "=selectedobject", - "url": "@url", - "dataField": "@datafield", - "titleField": "@titlefield", - "descriptionField": "@descriptionfield", - "imageField": "@imagefield", - "imageUri": "@imageuri", - "inputClass": "@inputclass", - "userPause": "@pause", - "localData": "=localdata", - "searchFields": "@searchfields", - "minLengthUser": "@minlength", - "matchClass": "@matchclass" - }, - template: '<div class="angucomplete-holder"><input id="{{id}}_value" ng-model="searchStr" type="text" placeholder="{{placeholder}}" class="{{inputClass}}" onmouseup="this.select();" ng-focus="resetHideResults()" ng-blur="hideResults()" /><div id="{{id}}_dropdown" class="angucomplete-dropdown" style="height:300px;overflow:auto;" ng-if="showDropdown"><div class="angucomplete-searching" ng-show="searching">Searching...</div><div class="angucomplete-searching" ng-show="!searching && (!results || results.length == 0)">No results found</div><div class="angucomplete-row" ng-repeat="result in results" ng-click="selectResult(result)" ng-mouseover="hoverRow()" ng-class="{\'angucomplete-selected-row\': $index == currentIndex}"><div ng-if="imageField" class="angucomplete-image-holder"><img ng-if="result.image && result.image != \'\'" ng-src="{{result.image}}" class="angucomplete-image"/><div ng-if="!result.image && result.image != \'\'" class="angucomplete-image-default"></div></div><div class="angucomplete-title" ng-if="matchClass" ng-bind-html="result.title"></div><div class="angucomplete-title" ng-if="!matchClass">{{ result.title }}</div><div ng-if="result.description && result.description != \'\'" class="angucomplete-description">{{result.description}}</div></div></div></div>', - - link: function($scope, elem, attrs) { - $scope.lastSearchTerm = null; - $scope.currentIndex = null; - $scope.justChanged = false; - $scope.searchTimer = null; - $scope.hideTimer = null; - $scope.searching = false; - $scope.pause = 500; - $scope.minLength = 3; - $scope.searchStr = null; - - if ($scope.minLengthUser && $scope.minLengthUser != "") { - $scope.minLength = $scope.minLengthUser; - } - - if ($scope.userPause) { - $scope.pause = $scope.userPause; - } - - isNewSearchNeeded = function(newTerm, oldTerm) { - return newTerm.length >= $scope.minLength && newTerm != oldTerm - } - - $scope.processResults = function(responseData, str) { - if (responseData && responseData.length > 0) { - $scope.results = []; - - var titleFields = []; - if ($scope.titleField && $scope.titleField != "") { - titleFields = $scope.titleField.split(","); - } - - for (var i = 0; i < responseData.length; i++) { - // Get title variables - var titleCode = []; - - for (var t = 0; t < titleFields.length; t++) { - titleCode.push(responseData[i][titleFields[t]]); - } - - var description = ""; - if ($scope.descriptionField) { - description = responseData[i][$scope.descriptionField]; - } - - var imageUri = ""; - if ($scope.imageUri) { - imageUri = $scope.imageUri; - } - - var image = ""; - if ($scope.imageField) { - image = imageUri + responseData[i][$scope.imageField]; - } - - var text = titleCode.join(' '); - if ($scope.matchClass) { - var re = new RegExp(str, 'i'); - var strPart = text.match(re)[0]; - text = $sce.trustAsHtml(text.replace(re, '<span class="'+ $scope.matchClass +'">'+ strPart +'</span>')); - } - - var resultRow = { - title: text, - description: description, - image: image, - originalObject: responseData[i] - } - - $scope.results[$scope.results.length] = resultRow; - } - - - } else { - $scope.results = []; - } - } - - $scope.searchTimerComplete = function(str) { - // Begin the search - - if (str.length >= $scope.minLength) { - if ($scope.localData) { - var searchFields = $scope.searchFields.split(","); - - var matches = []; - - for (var i = 0; i < $scope.localData.length; i++) { - var match = false; - - for (var s = 0; s < searchFields.length; s++) { - match = match || (typeof $scope.localData[i][searchFields[s]] === 'string' && typeof str === 'string' && $scope.localData[i][searchFields[s]].toLowerCase().indexOf(str.toLowerCase()) >= 0); - } - - if (match) { - matches[matches.length] = $scope.localData[i]; - } - } - - $scope.searching = false; - $scope.processResults(matches, str); - - } else { - $http.get($scope.url + str, {}). - success(function(responseData, status, headers, config) { - $scope.searching = false; - $scope.processResults((($scope.dataField) ? responseData[$scope.dataField] : responseData ), str); - }). - error(function(data, status, headers, config) { - console.log("error"); - }); - } - } - } - - $scope.hideResults = function() { - $scope.hideTimer = $timeout(function() { - $scope.showDropdown = false; - }, $scope.pause); - }; - - $scope.resetHideResults = function() { - if($scope.hideTimer) { - $timeout.cancel($scope.hideTimer); - }; - }; - - $scope.hoverRow = function(index) { - $scope.currentIndex = index; - } - - $scope.keyPressed = function(event) { - if (!(event.which == 38 || event.which == 40 || event.which == 13)) { - if (!$scope.searchStr || $scope.searchStr == "") { - $scope.showDropdown = false; - $scope.lastSearchTerm = null - } else if (isNewSearchNeeded($scope.searchStr, $scope.lastSearchTerm)) { - $scope.lastSearchTerm = $scope.searchStr - $scope.showDropdown = true; - $scope.currentIndex = -1; - $scope.results = []; - - if ($scope.searchTimer) { - $timeout.cancel($scope.searchTimer); - } - - $scope.searching = true; - - $scope.searchTimer = $timeout(function() { - $scope.searchTimerComplete($scope.searchStr); - }, $scope.pause); - } - } else { - event.preventDefault(); - } - } - - $scope.selectResult = function(result) { - if ($scope.matchClass) { - result.title = result.title.toString().replace(/(<([^>]+)>)/ig, ''); - } - $scope.searchStr = $scope.lastSearchTerm = result.title; - $scope.selectedObject = result; - $scope.showDropdown = false; - $scope.results = []; - //$scope.$apply(); - } - - var inputField = elem.find('input'); - - inputField.on('keyup', $scope.keyPressed); - - elem.on("keyup", function (event) { - if(event.which === 40) { - if ($scope.results && ($scope.currentIndex + 1) < $scope.results.length) { - $scope.currentIndex ++; - $scope.$apply(); - event.preventDefault; - event.stopPropagation(); - } - - $scope.$apply(); - } else if(event.which == 38) { - if ($scope.currentIndex >= 1) { - $scope.currentIndex --; - $scope.$apply(); - event.preventDefault; - event.stopPropagation(); - } - - } else if (event.which == 13) { - if ($scope.results && $scope.currentIndex >= 0 && $scope.currentIndex < $scope.results.length) { - $scope.selectResult($scope.results[$scope.currentIndex]); - $scope.$apply(); - event.preventDefault; - event.stopPropagation(); - } else { - $scope.results = []; - $scope.$apply(); - event.preventDefault; - event.stopPropagation(); - } - - } else if (event.which == 27) { - $scope.results = []; - $scope.showDropdown = false; - $scope.$apply(); - } else if (event.which == 8) { - $scope.selectedObject = null; - $scope.$apply(); - } - }); - - } - }; -}); - diff --git a/src/main/resources/META-INF/resources/designer/partials/menu.html b/src/main/resources/META-INF/resources/designer/partials/menu.html index 036402caf..48544dfe8 100644 --- a/src/main/resources/META-INF/resources/designer/partials/menu.html +++ b/src/main/resources/META-INF/resources/designer/partials/menu.html @@ -101,7 +101,7 @@ width="234px" style="display: inline-block; float: left"> <div class="navbar-brand logo" ng-href="" style="display: inline-block; float: left"> - <b>Closed Loop Definition</b> + <b>CLAMP</b> </div> </div> diff --git a/src/main/resources/META-INF/resources/designer/scripts/CldsModelService.js b/src/main/resources/META-INF/resources/designer/scripts/CldsModelService.js index 89197af3a..32c11221e 100644 --- a/src/main/resources/META-INF/resources/designer/scripts/CldsModelService.js +++ b/src/main/resources/META-INF/resources/designer/scripts/CldsModelService.js @@ -316,7 +316,7 @@ app.service('cldsModelService', ['alertService', '$http', '$q', function(alertSe // display status if ($("#status_clds").length >= 1) $("#status_clds").remove(); - $("#activity_modeler").append('<span id="status_clds" style="position: absolute; left: 61%;top: 51px; font-size:20px;">Status: ' + statusMsg + '</span>'); + $("#activity_modeler").append('<span id="status_clds" style="position: absolute; left: 61%;top: 151px; font-size:20px;">Status: ' + statusMsg + '</span>'); } diff --git a/src/main/resources/META-INF/resources/designer/scripts/app.js b/src/main/resources/META-INF/resources/designer/scripts/app.js index 71fd98125..3fb0a242e 100644 --- a/src/main/resources/META-INF/resources/designer/scripts/app.js +++ b/src/main/resources/META-INF/resources/designer/scripts/app.js @@ -40,8 +40,7 @@ var app = angular.module('clds-app', ['ngRoute', 'ngSanitize', 'ngCookies', 'ui.bootstrap.modal', - 'ui.grid.exporter', - 'angucomplete' + 'ui.grid.exporter' ]) .config(['cfpLoadingBarProvider', function(cfpLoadingBarProvider) { |