Commit ff92ae7cd51336a80595100e0d8284d7ca3d122f
1 parent
ce429382
BUG FIXING #39251
Showing
2 changed files
with
37 additions
and
73 deletions
400-SOURCECODE/AIAHTML5.Web/app/controllers/AIController.js
@@ -17,7 +17,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | @@ -17,7 +17,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | ||
17 | SearchTextByAlphabet: '', | 17 | SearchTextByAlphabet: '', |
18 | SelectedDiv: '' | 18 | SelectedDiv: '' |
19 | }; | 19 | }; |
20 | - var Count = 200; | 20 | + var Count = 100;//Bug#39251 |
21 | localStorage.setItem("ImageCount", Count); | 21 | localStorage.setItem("ImageCount", Count); |
22 | var searchByText = $rootScope.getLocalStorageValue("SearchText"); | 22 | var searchByText = $rootScope.getLocalStorageValue("SearchText"); |
23 | var searchTextByAlphabet = $rootScope.getLocalStorageValue("SearchByAlphabet"); | 23 | var searchTextByAlphabet = $rootScope.getLocalStorageValue("SearchByAlphabet"); |
@@ -28,7 +28,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | @@ -28,7 +28,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | ||
28 | if ($scope.query.SelectedDiv == 2) { | 28 | if ($scope.query.SelectedDiv == 2) { |
29 | 29 | ||
30 | if ($(this).scrollTop() + $(this).innerHeight() >= $(this)[0].scrollHeight - 10) { | 30 | if ($(this).scrollTop() + $(this).innerHeight() >= $(this)[0].scrollHeight - 10) { |
31 | - Count += 100; | 31 | + Count += 50;//Bug#39251 |
32 | //$(window).scrollTop(0); | 32 | //$(window).scrollTop(0); |
33 | var ImageCount = $rootScope.getLocalStorageValue("ImageCount"); | 33 | var ImageCount = $rootScope.getLocalStorageValue("ImageCount"); |
34 | if (typeof (searchByText) !== "undefined" && searchByText !== null && searchByText !== '') { | 34 | if (typeof (searchByText) !== "undefined" && searchByText !== null && searchByText !== '') { |
@@ -61,7 +61,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | @@ -61,7 +61,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | ||
61 | $(window).scroll(function () { | 61 | $(window).scroll(function () { |
62 | if ($scope.query.SelectedDiv == 1) { | 62 | if ($scope.query.SelectedDiv == 1) { |
63 | if ($(window).scrollTop() == $(document).height() - $(window).height()) { | 63 | if ($(window).scrollTop() == $(document).height() - $(window).height()) { |
64 | - Count += 100; | 64 | + Count += 50;//Bug#39251 |
65 | var ImageCount = $rootScope.getLocalStorageValue("ImageCount"); | 65 | var ImageCount = $rootScope.getLocalStorageValue("ImageCount"); |
66 | if (typeof (searchByText) !== "undefined" && searchByText !== null && searchByText !== '') { | 66 | if (typeof (searchByText) !== "undefined" && searchByText !== null && searchByText !== '') { |
67 | $scope.query.SearchText = searchByText; | 67 | $scope.query.SearchText = searchByText; |
@@ -203,21 +203,11 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | @@ -203,21 +203,11 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | ||
203 | 203 | ||
204 | $scope.LoadAIJsonData = function (ImageCount) { | 204 | $scope.LoadAIJsonData = function (ImageCount) { |
205 | $('ul li span').removeAttr("style"); | 205 | $('ul li span').removeAttr("style"); |
206 | - var promise = DataService.getJson('~/../content/data/json/ai/ai_dat_contentlist.json') | ||
207 | - promise.then( | ||
208 | - function (result) { | ||
209 | - $scope.IllustrationData = result; | 206 | + //Bug#39251 |
210 | $scope.selectedAIListViewData = new jinqJs() | 207 | $scope.selectedAIListViewData = new jinqJs() |
211 | - .from($scope.IllustrationData.root.AIData) | 208 | + .from($rootScope.IllustrationImageData.root.AIData) |
212 | .orderBy([{ field: '_Title', sort: 'asc' }]) | 209 | .orderBy([{ field: '_Title', sort: 'asc' }]) |
213 | .select().slice(0, ImageCount); | 210 | .select().slice(0, ImageCount); |
214 | - | ||
215 | - }, | ||
216 | - function (error) { | ||
217 | - // handle errors here | ||
218 | - console.log(' $scope.IllustrationData = ' + error.statusText); | ||
219 | - } | ||
220 | - ); | ||
221 | }; | 211 | }; |
222 | 212 | ||
223 | $scope.loadAllAI = function (ImageCount) { | 213 | $scope.loadAllAI = function (ImageCount) { |
@@ -229,14 +219,10 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | @@ -229,14 +219,10 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | ||
229 | $('#aiSpinner').css('zIndex', '20000'); | 219 | $('#aiSpinner').css('zIndex', '20000'); |
230 | if ($location.url() == "/ADAM-images") { | 220 | if ($location.url() == "/ADAM-images") { |
231 | $scope.DisableUI(); | 221 | $scope.DisableUI(); |
232 | - } | ||
233 | - var promise = DataService.getJson('~/../content/data/json/ai/ai_dat_contentlist.json') | ||
234 | - promise.then( | ||
235 | - function (result) { | ||
236 | - $scope.IllustrationData = result; | ||
237 | 222 | ||
223 | + } //Bug#39251 | ||
238 | $scope.selectedAIListViewData = new jinqJs() | 224 | $scope.selectedAIListViewData = new jinqJs() |
239 | - .from($scope.IllustrationData.root.AIData) | 225 | + .from($rootScope.IllustrationImageData.root.AIData) |
240 | .orderBy([{ field: '_Title', sort: 'asc' }]) | 226 | .orderBy([{ field: '_Title', sort: 'asc' }]) |
241 | .select().slice(0, ImageCount); | 227 | .select().slice(0, ImageCount); |
242 | 228 | ||
@@ -252,11 +238,12 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | @@ -252,11 +238,12 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | ||
252 | $compile($e1)($scope); | 238 | $compile($e1)($scope); |
253 | 239 | ||
254 | $timeout(function () { | 240 | $timeout(function () { |
241 | + | ||
255 | $('#' + $rootScope.getLocalStorageValue("currentAIImageId")).find('.thumbnail').addClass('HightLightThumbnail'); | 242 | $('#' + $rootScope.getLocalStorageValue("currentAIImageId")).find('.thumbnail').addClass('HightLightThumbnail'); |
256 | if ($rootScope.getLocalStorageValue('AIGridViewScroll') !== null && $location.url() == "/ADAM-images" && $scope.query.SelectedDiv == 1) { | 243 | if ($rootScope.getLocalStorageValue('AIGridViewScroll') !== null && $location.url() == "/ADAM-images" && $scope.query.SelectedDiv == 1) { |
257 | $('html, body').animate({ scrollTop: $rootScope.getLocalStorageValue('AIGridViewScroll') }); | 244 | $('html, body').animate({ scrollTop: $rootScope.getLocalStorageValue('AIGridViewScroll') }); |
258 | } | 245 | } |
259 | - }, 100); | 246 | + }, 10);//Bug#39251 |
260 | 247 | ||
261 | $rootScope.isLoading = false; | 248 | $rootScope.isLoading = false; |
262 | $('#aiSpinner').css('visibility', 'hidden'); | 249 | $('#aiSpinner').css('visibility', 'hidden'); |
@@ -266,14 +253,6 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | @@ -266,14 +253,6 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | ||
266 | }, 10); | 253 | }, 10); |
267 | } | 254 | } |
268 | 255 | ||
269 | - | ||
270 | - }, | ||
271 | - function (error) { | ||
272 | - // handle errors here | ||
273 | - console.log(' $scope.IllustrationData = ' + error.statusText); | ||
274 | - } | ||
275 | - ); | ||
276 | - | ||
277 | } | 256 | } |
278 | 257 | ||
279 | $scope.IsVisible = function () { | 258 | $scope.IsVisible = function () { |
@@ -376,14 +355,10 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | @@ -376,14 +355,10 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | ||
376 | else { | 355 | else { |
377 | localStorage.setItem("SearchText", ''); | 356 | localStorage.setItem("SearchText", ''); |
378 | } | 357 | } |
379 | - | ||
380 | - var promise = DataService.getJson('~/../content/data/json/ai/ai_dat_contentlist.json') | ||
381 | - promise.then( | ||
382 | - function (result) { | ||
383 | - $scope.IllustrationData = result; | ||
384 | - | 358 | + //Bug#39251 |
385 | $scope.selectedAIListViewData = new jinqJs() | 359 | $scope.selectedAIListViewData = new jinqJs() |
386 | - .from($scope.IllustrationData.root.AIData) | 360 | + .from($rootScope.IllustrationImageData.root.AIData) |
361 | + .where(function (value, key){return value._Title.toLowerCase().indexOf($scope.query.SearchText.toLowerCase());}) | ||
387 | .orderBy([{ field: '_Title', sort: 'asc' }]) | 362 | .orderBy([{ field: '_Title', sort: 'asc' }]) |
388 | .select(); | 363 | .select(); |
389 | 364 | ||
@@ -441,13 +416,6 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | @@ -441,13 +416,6 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | ||
441 | $scope.EnableUI(); | 416 | $scope.EnableUI(); |
442 | 417 | ||
443 | }, 10); | 418 | }, 10); |
444 | - | ||
445 | - }, | ||
446 | - function (error) { | ||
447 | - // handle errors here | ||
448 | - console.log(' $scope.IllustrationData = ' + error.statusText); | ||
449 | - } | ||
450 | - ); | ||
451 | } | 419 | } |
452 | $scope.DisableUI = function () { | 420 | $scope.DisableUI = function () { |
453 | 421 | ||
@@ -482,13 +450,10 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | @@ -482,13 +450,10 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | ||
482 | else { | 450 | else { |
483 | localStorage.setItem("SearchByAlphabet", ''); | 451 | localStorage.setItem("SearchByAlphabet", ''); |
484 | } | 452 | } |
485 | - var promise = DataService.getJson('~/../content/data/json/ai/ai_dat_contentlist.json') | ||
486 | - promise.then( | ||
487 | - function (result) { | ||
488 | - $scope.IllustrationData = result; | ||
489 | - | 453 | + //Bug#39251 |
490 | $scope.selectedAIListViewData = new jinqJs() | 454 | $scope.selectedAIListViewData = new jinqJs() |
491 | - .from($scope.IllustrationData.root.AIData) | 455 | + .from($rootScope.IllustrationImageData.root.AIData) |
456 | + .where(function (value, key) { return value._Title[0] === SearchTextByAlphabet; }) | ||
492 | .orderBy([{ field: '_Title', sort: 'asc' }]).select(); | 457 | .orderBy([{ field: '_Title', sort: 'asc' }]).select(); |
493 | 458 | ||
494 | $('#grid-view').empty(); | 459 | $('#grid-view').empty(); |
@@ -538,15 +503,10 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | @@ -538,15 +503,10 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | ||
538 | $('#ListViewDiv').append('<tr id="searchItem"><td colspan="6"><strong style="color:black;">No illustration found for the selected search criteria!</strong></td></tr>'); | 503 | $('#ListViewDiv').append('<tr id="searchItem"><td colspan="6"><strong style="color:black;">No illustration found for the selected search criteria!</strong></td></tr>'); |
539 | } | 504 | } |
540 | $rootScope.isLoading = false; | 505 | $rootScope.isLoading = false; |
541 | - | ||
542 | - setTimeout(function () { | ||
543 | - $scope.EnableUI(); | ||
544 | - }, 10); | ||
545 | - }, | ||
546 | - function (error) { | ||
547 | - console.log(' $scope.IllustrationData = ' + error.statusText); | ||
548 | - } | ||
549 | - ); | 506 | + $scope.EnableUI(); |
507 | + //setTimeout(function () { | ||
508 | + // $scope.EnableUI(); | ||
509 | + //}, 10); | ||
550 | } | 510 | } |
551 | 511 | ||
552 | 512 | ||
@@ -691,14 +651,10 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | @@ -691,14 +651,10 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | ||
691 | $rootScope.isLoading = true; | 651 | $rootScope.isLoading = true; |
692 | $('#aiSpinner').css('visibility', 'visible'); | 652 | $('#aiSpinner').css('visibility', 'visible'); |
693 | $('#aiSpinner').css('zIndex', '20000'); | 653 | $('#aiSpinner').css('zIndex', '20000'); |
694 | - var promise = DataService.getJson('~/../content/data/json/ai/ai_dat_contentlist.json') | ||
695 | - promise.then( | ||
696 | - function (result) { | ||
697 | - $scope.IllustrationData = result; | ||
698 | - | 654 | + //Bug#39251 |
699 | var SelectedAIthumbImage = []; | 655 | var SelectedAIthumbImage = []; |
700 | SelectedAIthumbImage = new jinqJs() | 656 | SelectedAIthumbImage = new jinqJs() |
701 | - .from($scope.IllustrationData.root.AIData) | 657 | + .from($rootScope.IllustrationImageData.root.AIData) |
702 | .where('_id = ' + id) | 658 | .where('_id = ' + id) |
703 | .select('_ThumbnailImage', '_id', '_Title').slice(0, imgCount); | 659 | .select('_ThumbnailImage', '_id', '_Title').slice(0, imgCount); |
704 | 660 | ||
@@ -720,13 +676,6 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | @@ -720,13 +676,6 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | ||
720 | } | 676 | } |
721 | $rootScope.isLoading = false; | 677 | $rootScope.isLoading = false; |
722 | $('#aiSpinner').css('visibility', 'hidden'); | 678 | $('#aiSpinner').css('visibility', 'hidden'); |
723 | - | ||
724 | - }, | ||
725 | - function (error) { | ||
726 | - // handle errors here | ||
727 | - console.log(' $scope.AnimationData = ' + error.statusText); | ||
728 | - } | ||
729 | - ); | ||
730 | }; | 679 | }; |
731 | 680 | ||
732 | $scope.hideListViewDiv = function () { | 681 | $scope.hideListViewDiv = function () { |
400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js
@@ -189,6 +189,7 @@ function ($rootScope, $scope, Modules, $log, $location, $timeout, DataService, A | @@ -189,6 +189,7 @@ function ($rootScope, $scope, Modules, $log, $location, $timeout, DataService, A | ||
189 | } | 189 | } |
190 | 190 | ||
191 | $rootScope.getConfigurationValues(); | 191 | $rootScope.getConfigurationValues(); |
192 | + $rootScope.LoadIllustrationImageData();//Start Bug#39251 | ||
192 | } | 193 | } |
193 | } | 194 | } |
194 | $rootScope.getConfigurationValues = function () { | 195 | $rootScope.getConfigurationValues = function () { |
@@ -437,7 +438,7 @@ function ($rootScope, $scope, Modules, $log, $location, $timeout, DataService, A | @@ -437,7 +438,7 @@ function ($rootScope, $scope, Modules, $log, $location, $timeout, DataService, A | ||
437 | 438 | ||
438 | 439 | ||
439 | $scope.ValidateClientSiteUrl = function () { | 440 | $scope.ValidateClientSiteUrl = function () { |
440 | - debugger | 441 | + |
441 | $rootScope.isCallFromSite = true; | 442 | $rootScope.isCallFromSite = true; |
442 | 443 | ||
443 | var siteInfo = params.split('&'); | 444 | var siteInfo = params.split('&'); |
@@ -5757,6 +5758,20 @@ function ($rootScope, $scope, Modules, $log, $location, $timeout, DataService, A | @@ -5757,6 +5758,20 @@ function ($rootScope, $scope, Modules, $log, $location, $timeout, DataService, A | ||
5757 | 5758 | ||
5758 | }; | 5759 | }; |
5759 | 5760 | ||
5761 | + //Start Bug#39251 | ||
5762 | + $rootScope.LoadIllustrationImageData = function () { | ||
5763 | + var promise = DataService.getJson('~/../content/data/json/ai/ai_dat_contentlist.json'); | ||
5764 | + promise.then( | ||
5765 | + function (result) { | ||
5766 | + $rootScope.IllustrationImageData = result; | ||
5767 | + }, | ||
5768 | + function (error) { | ||
5769 | + // handle errors here | ||
5770 | + console.log(' $scope.IllustrationImageData = ' + error.statusText); | ||
5771 | + } | ||
5772 | + ); | ||
5773 | + }; | ||
5774 | + //END Bug#39251 | ||
5760 | }] | 5775 | }] |
5761 | ); | 5776 | ); |
5762 | 5777 |