diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/AIController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/AIController.js
index 3b9a02b..37b2cf8 100644
--- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/AIController.js
+++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/AIController.js
@@ -223,6 +223,9 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
$scope.ApplySearch = function (SearchText) {
+ $rootScope.isLoading = true;
+ $('#spinner').css('visibility', 'visible');
+
$scope.filterstring = true;
@@ -260,7 +263,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
var selectimg = true;
//var count = 0;
if (typeof (SearchText) !== "undefined" && (SearchText !== null && SearchText !== "")) {
- var posbodyregion = value._Title.indexOf(SearchText);
+ var posbodyregion = value._Title.toLowerCase().indexOf(SearchText.toLowerCase());
if (posbodyregion > -1) {
selectimg = true;
//count = count + 1;
@@ -276,12 +279,13 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
if (selectimg === true) {
$scope.imagePath = "~/../content/images/ai/thumbnails/" + value._ThumbnailImage;
- var $el = $('
'
- + '
'
- + '
![]()
'
- + '
').appendTo('#grid-view');
+ var $el = $(''
+ + '
'
+ + '
![]()
'
+ + '
').appendTo('#grid-view');
$compile($el)($scope);
+
$(".sidebar").mCustomScrollbar({
autoHideScrollbar: true,
@@ -310,6 +314,9 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
$('#ListViewDiv').append('No illustration found for the selected search criteria! |
');
}
+ $rootScope.isLoading = false;
+ $('#spinner').css('visibility', 'hidden');
+
},
function (error) {
// handle errors here
@@ -319,6 +326,113 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
}
+
+ $scope.ApplySearchByAlphabet = function (SearchText) {
+
+ $rootScope.isLoading = true;
+ $('#spinner').css('visibility', 'visible');
+
+ $scope.filterstring = true;
+
+ while ($scope.searchAIListViewData.length) {
+ $scope.searchAIListViewData.pop();
+ }
+
+
+
+
+ if (typeof (SearchText) !== "undefined" && (SearchText !== null && SearchText !== "")) {
+
+ localStorage.setItem("AIImageId", SearchText);
+
+ }
+ else {
+ localStorage.setItem("AIImageId", '');
+
+ }
+
+ var promise = DataService.getJson('~/../content/data/json/ai/ai_dat_contentlist.json')
+ promise.then(
+ function (result) {
+ $scope.IllustrationData = result;
+
+ $scope.selectedAIListViewData = new jinqJs()
+ .from($scope.IllustrationData.root.AIData)
+ .orderBy([{ field: '_Title', sort: 'asc' }])
+ .select();
+
+ $('#grid-view').empty();
+
+ angular.forEach($scope.selectedAIListViewData, function (value, key) {
+
+ var selectimg = true;
+ //var count = 0;
+ if (typeof (SearchText) !== "undefined" && (SearchText !== null && SearchText !== "")) {
+
+ var firstChar = value._Title[0];
+
+ if (firstChar == SearchText) {
+ selectimg = true;
+ //count = count + 1;
+
+ }
+ else {
+ selectimg = false;
+ //count = count - 1;
+ }
+
+ }
+
+ if (selectimg === true) {
+ $scope.imagePath = "~/../content/images/ai/thumbnails/" + value._ThumbnailImage;
+
+ var $el = $(''
+ + '
'
+ + '
![]()
'
+ + '
').appendTo('#grid-view');
+
+ $compile($el)($scope);
+
+
+ $(".sidebar").mCustomScrollbar({
+ autoHideScrollbar: true,
+ //theme:"rounded"
+ });
+
+
+ $scope.searchAIListViewData.push(
+ {
+ "_id": value._id,
+ //"_ImageId": value._ImageId,
+ "_Title": value._Title,
+ "_contentImage": value._contentImage,
+ "_ThumbnailImage": value._ThumbnailImage,
+
+
+ });
+ }
+ });
+ $('table > #ListViewDiv > #searchItem').remove();
+ //Show Error Message in case of gridview if no data is found
+ if ($scope.searchAIListViewData.length == 0) {
+ var $el = $('No illustration found for the selected search criteria!
').appendTo('#grid-view');
+ $compile($el)($scope);
+ $('table > #ListViewDiv > #searchItem').remove();
+
+ $('#ListViewDiv').append('No illustration found for the selected search criteria! |
');
+ }
+ $rootScope.isLoading = false;
+ $('#spinner').css('visibility', 'hidden');
+
+ },
+ function (error) {
+ // handle errors here
+ console.log(' $scope.IllustrationData = ' + error.statusText);
+ }
+ );
+ }
+
+
$scope.scroll = function () {
$("html,body").scrollTop(0);
}
diff --git a/400-SOURCECODE/AIAHTML5.Web/app/views/ai/ai-view.html b/400-SOURCECODE/AIAHTML5.Web/app/views/ai/ai-view.html
index 6b8c6cb..c252b82 100644
--- a/400-SOURCECODE/AIAHTML5.Web/app/views/ai/ai-view.html
+++ b/400-SOURCECODE/AIAHTML5.Web/app/views/ai/ai-view.html
@@ -16,32 +16,32 @@