Commit d18ebf752ddbb238fd874c214fe8045e46082cbf
1 parent
3d61925d
merged Develop
Showing
2 changed files
with
145 additions
and
31 deletions
400-SOURCECODE/AIAHTML5.Web/app/controllers/AIController.js
... | ... | @@ -223,6 +223,9 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout |
223 | 223 | |
224 | 224 | $scope.ApplySearch = function (SearchText) { |
225 | 225 | |
226 | + $rootScope.isLoading = true; | |
227 | + $('#spinner').css('visibility', 'visible'); | |
228 | + | |
226 | 229 | |
227 | 230 | $scope.filterstring = true; |
228 | 231 | |
... | ... | @@ -260,7 +263,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout |
260 | 263 | var selectimg = true; |
261 | 264 | //var count = 0; |
262 | 265 | if (typeof (SearchText) !== "undefined" && (SearchText !== null && SearchText !== "")) { |
263 | - var posbodyregion = value._Title.indexOf(SearchText); | |
266 | + var posbodyregion = value._Title.toLowerCase().indexOf(SearchText.toLowerCase()); | |
264 | 267 | if (posbodyregion > -1) { |
265 | 268 | selectimg = true; |
266 | 269 | //count = count + 1; |
... | ... | @@ -276,12 +279,13 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout |
276 | 279 | if (selectimg === true) { |
277 | 280 | $scope.imagePath = "~/../content/images/ai/thumbnails/" + value._ThumbnailImage; |
278 | 281 | |
279 | - var $el = $('<div id="' + value._id + '" class="col-sm-3 col-md-2" title = "' + value._Title + '" data-ng-click="OpenAdamImage($event)">' | |
280 | - + '<div class="thumbnail" >' | |
281 | - + '<img id="' + value._Title + '"ng-src="' + $scope.imagePath + '" alt="" title="" >' | |
282 | - + '<div class="caption"><p>' + value._Title + '</p></div></a></div></div>').appendTo('#grid-view'); | |
282 | + var $el = $('<div id="' + value._id + '" class="col-sm-3 col-md-2" title = "' + value._Title + '" data-ng-click="AdamDetail($event)">' | |
283 | + + '<div style="width:auto;height:auto;" class="thumbnail" >' | |
284 | + + '<img style="height:150px" id="' + value._Title + '"ng-src="' + $scope.imagePath + '" alt="" title="" >' | |
285 | + + '<div class="caption"><p>' + value._Title + '</p></div></a></div></div>').appendTo('#grid-view'); | |
283 | 286 | |
284 | 287 | $compile($el)($scope); |
288 | + | |
285 | 289 | |
286 | 290 | $(".sidebar").mCustomScrollbar({ |
287 | 291 | autoHideScrollbar: true, |
... | ... | @@ -310,6 +314,9 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout |
310 | 314 | |
311 | 315 | $('#ListViewDiv').append('<tr id="searchItem"><td colspan="6"><strong style="color:black;">No illustration found for the selected search criteria!</strong></td></tr>'); |
312 | 316 | } |
317 | + $rootScope.isLoading = false; | |
318 | + $('#spinner').css('visibility', 'hidden'); | |
319 | + | |
313 | 320 | }, |
314 | 321 | function (error) { |
315 | 322 | // handle errors here |
... | ... | @@ -319,6 +326,113 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout |
319 | 326 | } |
320 | 327 | |
321 | 328 | |
329 | + | |
330 | + $scope.ApplySearchByAlphabet = function (SearchText) { | |
331 | + | |
332 | + $rootScope.isLoading = true; | |
333 | + $('#spinner').css('visibility', 'visible'); | |
334 | + | |
335 | + $scope.filterstring = true; | |
336 | + | |
337 | + while ($scope.searchAIListViewData.length) { | |
338 | + $scope.searchAIListViewData.pop(); | |
339 | + } | |
340 | + | |
341 | + | |
342 | + | |
343 | + | |
344 | + if (typeof (SearchText) !== "undefined" && (SearchText !== null && SearchText !== "")) { | |
345 | + | |
346 | + localStorage.setItem("AIImageId", SearchText); | |
347 | + | |
348 | + } | |
349 | + else { | |
350 | + localStorage.setItem("AIImageId", ''); | |
351 | + | |
352 | + } | |
353 | + | |
354 | + var promise = DataService.getJson('~/../content/data/json/ai/ai_dat_contentlist.json') | |
355 | + promise.then( | |
356 | + function (result) { | |
357 | + $scope.IllustrationData = result; | |
358 | + | |
359 | + $scope.selectedAIListViewData = new jinqJs() | |
360 | + .from($scope.IllustrationData.root.AIData) | |
361 | + .orderBy([{ field: '_Title', sort: 'asc' }]) | |
362 | + .select(); | |
363 | + | |
364 | + $('#grid-view').empty(); | |
365 | + | |
366 | + angular.forEach($scope.selectedAIListViewData, function (value, key) { | |
367 | + | |
368 | + var selectimg = true; | |
369 | + //var count = 0; | |
370 | + if (typeof (SearchText) !== "undefined" && (SearchText !== null && SearchText !== "")) { | |
371 | + | |
372 | + var firstChar = value._Title[0]; | |
373 | + | |
374 | + if (firstChar == SearchText) { | |
375 | + selectimg = true; | |
376 | + //count = count + 1; | |
377 | + | |
378 | + } | |
379 | + else { | |
380 | + selectimg = false; | |
381 | + //count = count - 1; | |
382 | + } | |
383 | + | |
384 | + } | |
385 | + | |
386 | + if (selectimg === true) { | |
387 | + $scope.imagePath = "~/../content/images/ai/thumbnails/" + value._ThumbnailImage; | |
388 | + | |
389 | + var $el = $('<div id="' + value._id + '" class="col-sm-3 col-md-2" title = "' + value._Title + '" data-ng-click="AdamDetail($event)">' | |
390 | + + '<div style="width:auto;height:auto;" class="thumbnail" >' | |
391 | + + '<img style="height:150px" id="' + value._Title + '"ng-src="' + $scope.imagePath + '" alt="" title="" >' | |
392 | + + '<div class="caption"><p>' + value._Title + '</p></div></a></div></div>').appendTo('#grid-view'); | |
393 | + | |
394 | + $compile($el)($scope); | |
395 | + | |
396 | + | |
397 | + $(".sidebar").mCustomScrollbar({ | |
398 | + autoHideScrollbar: true, | |
399 | + //theme:"rounded" | |
400 | + }); | |
401 | + | |
402 | + | |
403 | + $scope.searchAIListViewData.push( | |
404 | + { | |
405 | + "_id": value._id, | |
406 | + //"_ImageId": value._ImageId, | |
407 | + "_Title": value._Title, | |
408 | + "_contentImage": value._contentImage, | |
409 | + "_ThumbnailImage": value._ThumbnailImage, | |
410 | + | |
411 | + | |
412 | + }); | |
413 | + } | |
414 | + }); | |
415 | + $('table > #ListViewDiv > #searchItem').remove(); | |
416 | + //Show Error Message in case of gridview if no data is found | |
417 | + if ($scope.searchAIListViewData.length == 0) { | |
418 | + var $el = $('<div class="col-sm-12" style="padding-left:25px;padding-top:10px;"><strong style="color:white">No illustration found for the selected search criteria!</strong></div>').appendTo('#grid-view'); | |
419 | + $compile($el)($scope); | |
420 | + $('table > #ListViewDiv > #searchItem').remove(); | |
421 | + | |
422 | + $('#ListViewDiv').append('<tr id="searchItem"><td colspan="6"><strong style="color:black;">No illustration found for the selected search criteria!</strong></td></tr>'); | |
423 | + } | |
424 | + $rootScope.isLoading = false; | |
425 | + $('#spinner').css('visibility', 'hidden'); | |
426 | + | |
427 | + }, | |
428 | + function (error) { | |
429 | + // handle errors here | |
430 | + console.log(' $scope.IllustrationData = ' + error.statusText); | |
431 | + } | |
432 | + ); | |
433 | + } | |
434 | + | |
435 | + | |
322 | 436 | $scope.scroll = function () { |
323 | 437 | $("html,body").scrollTop(0); |
324 | 438 | } | ... | ... |
400-SOURCECODE/AIAHTML5.Web/app/views/ai/ai-view.html
... | ... | @@ -16,32 +16,32 @@ |
16 | 16 | </form> |
17 | 17 | <nav> |
18 | 18 | <ul class="pagination pagination-sm no-margin"> |
19 | - <li><a href="#" ng-click="ApplySearch('A')">A</a></li> | |
20 | - <li><a href="#" ng-click="ApplySearch('B')">B</a></li> | |
21 | - <li><a href="#" ng-click="ApplySearch('C')">C</a></li> | |
22 | - <li><a href="#" ng-click="ApplySearch('D')">D</a></li> | |
23 | - <li><a href="#" ng-click="ApplySearch('E')">E</a></li> | |
24 | - <li><a href="#" ng-click="ApplySearch('F')">F</a></li> | |
25 | - <li><a href="#" ng-click="ApplySearch('G')">G</a></li> | |
26 | - <li><a href="#" ng-click="ApplySearch('H')">H</a></li> | |
27 | - <li><a href="#" ng-click="ApplySearch('I')">I</a></li> | |
28 | - <li><a href="#" ng-click="ApplySearch('J')">J</a></li> | |
29 | - <li><a href="#" ng-click="ApplySearch('K')">K</a></li> | |
30 | - <li><a href="#" ng-click="ApplySearch('L')">L</a></li> | |
31 | - <li><a href="#" ng-click="ApplySearch('M')">M</a></li> | |
32 | - <li><a href="#" ng-click="ApplySearch('N')">N</a></li> | |
33 | - <li><a href="#" ng-click="ApplySearch('O')">O</a></li> | |
34 | - <li><a href="#" ng-click="ApplySearch('P')">P</a></li> | |
35 | - <li><a href="#" ng-click="ApplySearch('Q')">Q</a></li> | |
36 | - <li><a href="#" ng-click="ApplySearch('R')">R</a></li> | |
37 | - <li><a href="#" ng-click="ApplySearch('S')">S</a></li> | |
38 | - <li><a href="#" ng-click="ApplySearch('T')">T</a></li> | |
39 | - <li><a href="#" ng-click="ApplySearch('U')">U</a></li> | |
40 | - <li><a href="#" ng-click="ApplySearch('V')">V</a></li> | |
41 | - <li><a href="#" ng-click="ApplySearch('W')">W</a></li> | |
42 | - <li><a href="#" ng-click="ApplySearch('X')">X</a></li> | |
43 | - <li><a href="#" ng-click="ApplySearch('Y')">Y</a></li> | |
44 | - <li><a href="#" ng-click="ApplySearch('Z')">Z</a></li> | |
19 | + <li><a href="#" ng-click="ApplySearchByAlphabet('A')">A</a></li> | |
20 | + <li><a href="#" ng-click="ApplySearchByAlphabet('B')">B</a></li> | |
21 | + <li><a href="#" ng-click="ApplySearchByAlphabet('C')">C</a></li> | |
22 | + <li><a href="#" ng-click="ApplySearchByAlphabet('D')">D</a></li> | |
23 | + <li><a href="#" ng-click="ApplySearchByAlphabet('E')">E</a></li> | |
24 | + <li><a href="#" ng-click="ApplySearchByAlphabet('F')">F</a></li> | |
25 | + <li><a href="#" ng-click="ApplySearchByAlphabet('G')">G</a></li> | |
26 | + <li><a href="#" ng-click="ApplySearchByAlphabet('H')">H</a></li> | |
27 | + <li><a href="#" ng-click="ApplySearchByAlphabet('I')">I</a></li> | |
28 | + <li><a href="#" ng-click="ApplySearchByAlphabet('J')">J</a></li> | |
29 | + <li><a href="#" ng-click="ApplySearchByAlphabet('K')">K</a></li> | |
30 | + <li><a href="#" ng-click="ApplySearchByAlphabet('L')">L</a></li> | |
31 | + <li><a href="#" ng-click="ApplySearchByAlphabet('M')">M</a></li> | |
32 | + <li><a href="#" ng-click="ApplySearchByAlphabet('N')">N</a></li> | |
33 | + <li><a href="#" ng-click="ApplySearchByAlphabet('O')">O</a></li> | |
34 | + <li><a href="#" ng-click="ApplySearchByAlphabet('P')">P</a></li> | |
35 | + <li><a href="#" ng-click="ApplySearchByAlphabet('Q')">Q</a></li> | |
36 | + <li><a href="#" ng-click="ApplySearchByAlphabet('R')">R</a></li> | |
37 | + <li><a href="#" ng-click="ApplySearchByAlphabet('S')">S</a></li> | |
38 | + <li><a href="#" ng-click="ApplySearchByAlphabet('T')">T</a></li> | |
39 | + <li><a href="#" ng-click="ApplySearchByAlphabet('U')">U</a></li> | |
40 | + <li><a href="#" ng-click="ApplySearchByAlphabet('V')">V</a></li> | |
41 | + <li><a href="#" ng-click="ApplySearchByAlphabet('W')">W</a></li> | |
42 | + <li><a href="#" ng-click="ApplySearchByAlphabet('X')">X</a></li> | |
43 | + <li><a href="#" ng-click="ApplySearchByAlphabet('Y')">Y</a></li> | |
44 | + <li><a href="#" ng-click="ApplySearchByAlphabet('Z')">Z</a></li> | |
45 | 45 | </ul> |
46 | 46 | <button type="button" class="btn btn-primary btn-sm" ng-click="Reset(query)" style = "margin-bottom:23px"><i class="fa fa-eye"></i>Show All</button> |
47 | 47 | </nav> | ... | ... |