Showing
3 changed files
400-SOURCECODE/AIAHTML5.Web/app/controllers/AIController.js
... | ... | @@ -17,16 +17,103 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout |
17 | 17 | SearchTextByAlphabet: '', |
18 | 18 | }; |
19 | 19 | |
20 | + $(document).ready(function () { | |
21 | + $timeout(function () { | |
22 | + var Count = 200; | |
23 | + localStorage.setItem("ImageCount", Count); | |
24 | + var searchByText = $rootScope.getLocalStorageValue("SearchText"); | |
25 | + var searchTextByAlphabet = $rootScope.getLocalStorageValue("SearchByAlphabet"); | |
26 | + $("#ListViewDiv").on('scroll', function () { | |
27 | + if ($(this).scrollTop() + $(this).innerHeight() >= $(this)[0].scrollHeight - 10) { | |
28 | + Count += 100; | |
29 | + var ImageCount = $rootScope.getLocalStorageValue("ImageCount"); | |
30 | + if (typeof (searchByText) !== "undefined" && searchByText !== null && searchByText !== '') { | |
31 | + $scope.query.SearchText = searchByText; | |
32 | + } | |
33 | + else if (typeof (searchTextByAlphabet) !== "undefined" && searchTextByAlphabet !== null && searchTextByAlphabet !== '') { | |
34 | + $scope.query.SearchTextByAlphabet = searchTextByAlphabet; | |
35 | + } | |
36 | + else { | |
37 | + $scope.query.SearchTextByAlphabet = ""; | |
38 | + } | |
39 | + | |
40 | + if ($scope.query.SearchText == "" && $scope.query.SearchTextByAlphabet == "") { | |
41 | + | |
42 | + $scope.LoadAIJsonData(Count); | |
43 | + $scope.loadAllAI(Count); | |
44 | + } | |
45 | + else if ($scope.query.SearchTextByAlphabet != "" || $scope.query.SearchText == "") { | |
46 | + $scope.ApplySearchByAlphabet($scope.query.SearchTextByAlphabet); | |
47 | + } | |
48 | + else { | |
49 | + $scope.ApplySearch($scope.query); | |
50 | + } | |
51 | + } | |
52 | + }); | |
53 | + }, 10); | |
54 | + }); | |
55 | + | |
56 | + $(document).ready(function () { | |
57 | + var Count = 200; | |
58 | + localStorage.setItem("ImageCount", Count); | |
59 | + var searchByText = $rootScope.getLocalStorageValue("SearchText"); | |
60 | + var searchTextByAlphabet = $rootScope.getLocalStorageValue("SearchByAlphabet"); | |
61 | + $(window).scroll(function () { | |
62 | + if ($(window).scrollTop() == $(document).height() - $(window).height()) { | |
63 | + Count += 100; | |
64 | + var ImageCount = $rootScope.getLocalStorageValue("ImageCount"); | |
65 | + if (typeof (searchByText) !== "undefined" && searchByText !== null && searchByText !== '') { | |
66 | + $scope.query.SearchText = searchByText; | |
67 | + } | |
68 | + else if (typeof (searchTextByAlphabet) !== "undefined" && searchTextByAlphabet !== null && searchTextByAlphabet !== '') { | |
69 | + $scope.query.SearchTextByAlphabet = searchTextByAlphabet; | |
70 | + } | |
71 | + else { | |
72 | + $scope.query.SearchTextByAlphabet = ""; | |
73 | + } | |
74 | + | |
75 | + if ($scope.query.SearchText == "" && $scope.query.SearchTextByAlphabet == "") { | |
76 | + | |
77 | + $scope.LoadAIJsonData(Count); | |
78 | + $scope.loadAllAI(Count); | |
79 | + } | |
80 | + else if ($scope.query.SearchTextByAlphabet != "" || $scope.query.SearchText == "") { | |
81 | + $scope.ApplySearchByAlphabet($scope.query.SearchTextByAlphabet ); | |
82 | + } | |
83 | + else { | |
84 | + $scope.ApplySearch($scope.query); | |
85 | + } | |
86 | + } | |
87 | + }); | |
88 | + | |
89 | + }); | |
90 | + | |
20 | 91 | $scope.setActiveTab = function (tabToSet) { |
21 | 92 | $scope.activeTab = tabToSet; |
22 | 93 | localStorage.setItem("currentAITabView", $scope.activeTab); |
94 | + var ImageCount = $rootScope.getLocalStorageValue("ImageCount"); | |
95 | + if (tabToSet == 2) { | |
96 | + var curSelectedRowId = $rootScope.getLocalStorageValue("AISelectedRowId"); | |
97 | + $('#' + $rootScope.getLocalStorageValue("currentAIImageId")).addClass("selected"); | |
98 | + $scope.idSelected = $rootScope.getLocalStorageValue("currentAIImageId"); | |
99 | + var selectedImageId = $rootScope.getLocalStorageValue("currentAIImageId"); | |
100 | + $scope.ReloadListViewImageDiv(selectedImageId, ImageCount); | |
101 | + } | |
102 | + else { | |
103 | + $('#' + $rootScope.getLocalStorageValue("currentAIImageId")).find('.thumbnail').addClass('HightLightThumbnail'); | |
104 | + $('#' + $rootScope.getLocalStorageValue("currentAIImageId")).removeClass('selected'); | |
105 | + $scope.loadAllAI(ImageCount); | |
106 | + } | |
23 | 107 | }; |
24 | 108 | |
25 | 109 | $scope.$on('$viewContentLoaded', function (event) { |
26 | 110 | |
111 | + var ImageCount = $rootScope.getLocalStorageValue("ImageCount"); | |
112 | + | |
27 | 113 | if ($rootScope.refreshcheck == null) { |
28 | 114 | $location.path('/'); |
29 | 115 | } |
116 | + | |
30 | 117 | // code that will be executed ... |
31 | 118 | // every time this view is loaded |
32 | 119 | |
... | ... | @@ -41,7 +128,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout |
41 | 128 | $rootScope.currentActiveModuleTitle = selectedModuleName; |
42 | 129 | }) |
43 | 130 | |
44 | - $scope.LoadAIJsonData(); | |
131 | + $scope.LoadAIJsonData(ImageCount); | |
45 | 132 | $scope.scroll(); |
46 | 133 | //push the details of open module in array $rootScope.openModules |
47 | 134 | $rootScope.openModules.push({ "ModuleId": 13 }); |
... | ... | @@ -49,13 +136,13 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout |
49 | 136 | //set the local storage |
50 | 137 | |
51 | 138 | var curtab = $rootScope.getLocalStorageValue("currentAITabView"); |
52 | - if (curtab == 2) { | |
139 | + if (curtab == 2) { | |
53 | 140 | $scope.setActiveTab(2); |
54 | 141 | var curSelectedRowId = $rootScope.getLocalStorageValue("AISelectedRowId"); |
55 | 142 | if (typeof (curSelectedRowId) !== "undefined" && curSelectedRowId !== null && curSelectedRowId !== '') { |
56 | 143 | $scope.reRunSearchOnLoad(); |
57 | 144 | $scope.idSelected = curSelectedRowId; |
58 | - $scope.ReloadListViewImageDiv($scope.idSelected); | |
145 | + $scope.ReloadListViewImageDiv($scope.idSelected, ImageCount); | |
59 | 146 | } |
60 | 147 | else { |
61 | 148 | $scope.reRunSearchOnLoad() |
... | ... | @@ -73,6 +160,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout |
73 | 160 | |
74 | 161 | var searchByText = $rootScope.getLocalStorageValue("SearchText"); |
75 | 162 | var searchTextByAlphabet = $rootScope.getLocalStorageValue("SearchByAlphabet"); |
163 | + var ImageCount = $rootScope.getLocalStorageValue("ImageCount"); | |
76 | 164 | |
77 | 165 | if (typeof (searchByText) !== "undefined" && searchByText !== null && searchByText !== '') { |
78 | 166 | $scope.query.SearchText = searchByText; |
... | ... | @@ -87,7 +175,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout |
87 | 175 | |
88 | 176 | if ($scope.query.SearchText == "" && $scope.query.SearchTextByAlphabet == "") { |
89 | 177 | |
90 | - $scope.loadAllAI(); | |
178 | + $scope.loadAllAI(ImageCount); | |
91 | 179 | } |
92 | 180 | else if ($scope.query.SearchTextByAlphabet != "" || $scope.query.SearchText == "") |
93 | 181 | { |
... | ... | @@ -99,8 +187,8 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout |
99 | 187 | |
100 | 188 | } |
101 | 189 | |
102 | - $scope.LoadAIJsonData = function () { | |
103 | - $('ul li a').removeAttr("style"); | |
190 | + $scope.LoadAIJsonData = function (ImageCount) { | |
191 | + $('ul li span').removeAttr("style"); | |
104 | 192 | var promise = DataService.getJson('~/../content/data/json/ai/ai_dat_contentlist.json') |
105 | 193 | promise.then( |
106 | 194 | function (result) { |
... | ... | @@ -108,7 +196,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout |
108 | 196 | $scope.selectedAIListViewData = new jinqJs() |
109 | 197 | .from($scope.IllustrationData.root.AIData) |
110 | 198 | .orderBy([{ field: '_Title', sort: 'asc' }]) |
111 | - .select(); | |
199 | + .select().slice(0, ImageCount); | |
112 | 200 | |
113 | 201 | }, |
114 | 202 | function (error) { |
... | ... | @@ -120,13 +208,17 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout |
120 | 208 | |
121 | 209 | }; |
122 | 210 | |
123 | - $scope.loadAllAI = function () { | |
211 | + $scope.loadAllAI = function (ImageCount) { | |
124 | 212 | $rootScope.isLoading = true; |
125 | 213 | localStorage.setItem("SearchText", ''); |
126 | 214 | localStorage.setItem("SearchByAlphabet", ''); |
127 | - $('ul li a').removeAttr("style"); | |
215 | + $('ul li span').removeAttr("style"); | |
128 | 216 | $('#aiSpinner').css('visibility', 'visible'); |
129 | 217 | $('#aiSpinner').css('zIndex', '20000'); |
218 | + if ($location.url() == "/ADAM-images") | |
219 | + { | |
220 | + $scope.DisableUI(); | |
221 | + } | |
130 | 222 | var promise = DataService.getJson('~/../content/data/json/ai/ai_dat_contentlist.json') |
131 | 223 | promise.then( |
132 | 224 | function (result) { |
... | ... | @@ -135,7 +227,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout |
135 | 227 | $scope.selectedAIListViewData = new jinqJs() |
136 | 228 | .from($scope.IllustrationData.root.AIData) |
137 | 229 | .orderBy([{ field: '_Title', sort: 'asc' }]) |
138 | - .select(); | |
230 | + .select().slice(0,ImageCount); | |
139 | 231 | |
140 | 232 | //console.log($scope.selectedAIListViewData); |
141 | 233 | |
... | ... | @@ -151,12 +243,18 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout |
151 | 243 | $timeout(function () { |
152 | 244 | $('#' + $rootScope.getLocalStorageValue("currentAIImageId")).find('.thumbnail').addClass('HightLightThumbnail'); |
153 | 245 | if ($rootScope.getLocalStorageValue('AIGridViewScroll') !== null && $location.url() == "/ADAM-images") { |
154 | - $('html, body').animate({ scrollTop: $rootScope.getLocalStorageValue('AIGridViewScroll') }); | |
246 | + //$('html, body').animate({ scrollTop: $rootScope.getLocalStorageValue('AIGridViewScroll') }); | |
155 | 247 | } |
156 | 248 | }, 100); |
157 | 249 | |
158 | 250 | $rootScope.isLoading = false; |
159 | 251 | $('#aiSpinner').css('visibility', 'hidden'); |
252 | + if ($location.url() == "/ADAM-images") { | |
253 | + setTimeout(function () { | |
254 | + $scope.EnableUI(); | |
255 | + }, 10); | |
256 | + } | |
257 | + | |
160 | 258 | |
161 | 259 | }, |
162 | 260 | function (error) { |
... | ... | @@ -179,7 +277,8 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout |
179 | 277 | //Set the vertical scroll value of the table. |
180 | 278 | var y = $('#ListViewDiv').scrollTop(); |
181 | 279 | localStorage.setItem("AIListViewScroll", y); |
182 | - | |
280 | + //$('#' + id).find('.thumbnail').addClass('HightLightThumbnail'); | |
281 | + localStorage.setItem("currentAIImageId", id); | |
183 | 282 | $scope.hiderow = true; |
184 | 283 | if ($scope.filterstring == false) { |
185 | 284 | |
... | ... | @@ -208,20 +307,18 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout |
208 | 307 | $scope.SelectedAITitle = SelectedAIthumbImage[0]._Title; |
209 | 308 | |
210 | 309 | } |
310 | + | |
211 | 311 | } |
212 | 312 | }; |
213 | 313 | |
214 | 314 | $scope.Reset = function (query) { |
215 | - $('ul li a').removeAttr("style"); | |
315 | + $('ul li span').removeAttr("style"); | |
216 | 316 | query.SearchText = ""; |
217 | - | |
218 | - | |
219 | - | |
220 | 317 | //set localstorage values |
221 | 318 | localStorage.setItem("SearchText", ''); |
222 | 319 | localStorage.setItem("SearchByAlphabet", ''); |
223 | 320 | localStorage.setItem("AIListViewScroll", ''); |
224 | - | |
321 | + var ImageCount = $rootScope.getLocalStorageValue("ImageCount"); | |
225 | 322 | if ($('.selected').hasClass("selected")) { $('.selected').removeClass("selected"); } |
226 | 323 | |
227 | 324 | $('#ListViewDiv').scrollTop(0); |
... | ... | @@ -232,11 +329,11 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout |
232 | 329 | while ($scope.searchAIListViewData.length) { |
233 | 330 | $scope.searchAIListViewData.pop(); |
234 | 331 | } |
235 | - $scope.loadAllAI(); | |
332 | + $scope.loadAllAI(ImageCount); | |
236 | 333 | } |
237 | 334 | |
238 | 335 | $scope.ApplySearch = function (query) { |
239 | - $('ul li a').removeAttr("style"); | |
336 | + $('ul li span').removeAttr("style"); | |
240 | 337 | var currentSearchtext = $rootScope.getLocalStorageValue("SearchText"); |
241 | 338 | localStorage.setItem("SearchText", ''); |
242 | 339 | if (currentSearchtext == "undefined" || (currentSearchtext == null || currentSearchtext == "")) |
... | ... | @@ -251,26 +348,19 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout |
251 | 348 | } |
252 | 349 | |
253 | 350 | $rootScope.isLoading = true; |
254 | - $('#spinner').css('visibility', 'visible'); | |
255 | - | |
256 | - | |
351 | + $('#aiSpinner').css('visibility', 'visible'); | |
352 | + $scope.DisableUI(); | |
257 | 353 | $scope.filterstring = true; |
258 | 354 | |
259 | - while ($scope.searchAIListViewData.length) { | |
260 | - $scope.searchAIListViewData.pop(); | |
261 | - } | |
262 | - | |
263 | - | |
264 | - | |
355 | + //while ($scope.searchAIListViewData.length) { | |
356 | + // $scope.searchAIListViewData.pop(); | |
357 | + //} | |
265 | 358 | |
266 | 359 | if (typeof (query.SearchText) !== "undefined" && (query.SearchText !== null && query.SearchText !== "")) { |
267 | - | |
268 | 360 | localStorage.setItem("SearchText", query.SearchText); |
269 | - | |
270 | 361 | } |
271 | 362 | else { |
272 | 363 | localStorage.setItem("SearchText", ''); |
273 | - | |
274 | 364 | } |
275 | 365 | |
276 | 366 | var promise = DataService.getJson('~/../content/data/json/ai/ai_dat_contentlist.json') |
... | ... | @@ -295,13 +385,11 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout |
295 | 385 | if (posbodyregion > -1) { |
296 | 386 | selectimg = true; |
297 | 387 | //count = count + 1; |
298 | - | |
299 | 388 | } |
300 | 389 | else { |
301 | 390 | selectimg = false; |
302 | 391 | //count = count - 1; |
303 | 392 | } |
304 | - | |
305 | 393 | } |
306 | 394 | |
307 | 395 | if (selectimg === true) { |
... | ... | @@ -315,12 +403,10 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout |
315 | 403 | $compile($el)($scope); |
316 | 404 | |
317 | 405 | |
318 | - $(".sidebar").mCustomScrollbar({ | |
319 | - autoHideScrollbar: true, | |
320 | - //theme:"rounded" | |
321 | - }); | |
322 | - | |
323 | - | |
406 | + //$(".sidebar").mCustomScrollbar({ | |
407 | + // autoHideScrollbar: true, | |
408 | + // //theme:"rounded" | |
409 | + //}); | |
324 | 410 | $scope.searchAIListViewData.push( |
325 | 411 | { |
326 | 412 | "_id": value._id, |
... | ... | @@ -328,8 +414,6 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout |
328 | 414 | "_Title": value._Title, |
329 | 415 | "_contentImage": value._contentImage, |
330 | 416 | "_ThumbnailImage": value._ThumbnailImage, |
331 | - | |
332 | - | |
333 | 417 | }); |
334 | 418 | } |
335 | 419 | }); |
... | ... | @@ -341,9 +425,13 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout |
341 | 425 | $('table > #ListViewDiv > #searchItem').remove(); |
342 | 426 | |
343 | 427 | $('#ListViewDiv').append('<tr id="searchItem"><td colspan="6"><strong style="color:black;">No illustration found for the selected search criteria!</strong></td></tr>'); |
428 | + localStorage.setItem("SearchText", ''); | |
344 | 429 | } |
345 | 430 | $rootScope.isLoading = false; |
346 | - $('#spinner').css('visibility', 'hidden'); | |
431 | + $('#aiSpinner').css('visibility', 'hidden'); | |
432 | + setTimeout(function () { | |
433 | + $scope.EnableUI(); | |
434 | + }, 10); | |
347 | 435 | |
348 | 436 | }, |
349 | 437 | function (error) { |
... | ... | @@ -352,25 +440,27 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout |
352 | 440 | } |
353 | 441 | ); |
354 | 442 | } |
443 | + $scope.DisableUI = function () { | |
444 | + | |
445 | + $('#imgParent').css('z-index', '1'); | |
446 | + document.getElementById("imgParent").style.pointerEvents = "none"; | |
447 | + document.getElementById("imgParent").style.opacity = "0.5"; | |
448 | + } | |
355 | 449 | |
450 | + $scope.EnableUI = function () { | |
451 | + document.getElementById("imgParent").style.pointerEvents = "auto"; | |
452 | + document.getElementById("imgParent").style.opacity = "1.0"; | |
453 | + } | |
356 | 454 | |
357 | - | |
455 | + $scope.counter = 1; | |
358 | 456 | $scope.ApplySearchByAlphabet = function (SearchTextByAlphabet) { |
359 | - | |
360 | - $rootScope.SearchTextByAlphabet = SearchTextByAlphabet | |
361 | - $rootScope.isLoading = true; | |
362 | - $('ul li a').removeAttr("style"); | |
363 | - $('#spinner').css('visibility', 'visible'); | |
457 | + $rootScope.SearchTextByAlphabet = SearchTextByAlphabet | |
458 | + $rootScope.isLoading = true; | |
459 | + $('#aiSpinner').css('visibility', 'visible'); | |
460 | + $scope.DisableUI(); | |
461 | + $('ul li span').removeAttr("style"); | |
364 | 462 | $('#' + $rootScope.SearchTextByAlphabet ).css({ "color": "white", "background-color": "#1B92D0" }); |
365 | - | |
366 | - //color: #0095da; | |
367 | - //background-color: #ffffff; | |
368 | - | |
369 | 463 | $scope.filterstring = true; |
370 | - | |
371 | - while ($scope.searchAIListViewData.length) { | |
372 | - $scope.searchAIListViewData.pop(); | |
373 | - } | |
374 | 464 | if (typeof (SearchTextByAlphabet) !== "undefined" && (SearchTextByAlphabet !== null && SearchTextByAlphabet !== "")) { |
375 | 465 | localStorage.setItem("SearchByAlphabet", SearchTextByAlphabet); |
376 | 466 | } |
... | ... | @@ -385,8 +475,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout |
385 | 475 | |
386 | 476 | $scope.selectedAIListViewData = new jinqJs() |
387 | 477 | .from($scope.IllustrationData.root.AIData) |
388 | - .orderBy([{ field: '_Title', sort: 'asc' }]) | |
389 | - .select(); | |
478 | + .orderBy([{ field: '_Title', sort: 'asc' }]).select(); | |
390 | 479 | |
391 | 480 | $('#grid-view').empty(); |
392 | 481 | |
... | ... | @@ -406,20 +495,12 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout |
406 | 495 | if (selectimg === true) { |
407 | 496 | $scope.imagePath = "~/../content/images/ai/thumbnails/" + value._ThumbnailImage; |
408 | 497 | |
409 | - var $el = $('<div id="' + value._id + '" class="col-sm-3 col-md-2" title = "' + value._Title + '" data-ng-click="OpenAdamImage($event)">' | |
498 | + var $el = $('<div id="' + value._id + '" ng-disabled="' + $scope.IsDisable + '" class="col-sm-3 col-md-2" title = "' + value._Title + '" data-ng-click="OpenAdamImage($event)">' | |
410 | 499 | + '<div style="width:auto;height:auto;" class="thumbnail" >' |
411 | 500 | + '<img style="height:150px" id="' + value._Title + '"ng-src="' + $scope.imagePath + '" alt="" title="" >' |
412 | 501 | + '<div class="caption"><p>' + value._Title + '</p></div></a></div></div>').appendTo('#grid-view'); |
413 | 502 | |
414 | 503 | $compile($el)($scope); |
415 | - | |
416 | - | |
417 | - $(".sidebar").mCustomScrollbar({ | |
418 | - autoHideScrollbar: true, | |
419 | - //theme:"rounded" | |
420 | - }); | |
421 | - | |
422 | - | |
423 | 504 | $scope.searchAIListViewData.push( |
424 | 505 | { |
425 | 506 | "_id": value._id, |
... | ... | @@ -427,10 +508,9 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout |
427 | 508 | "_Title": value._Title, |
428 | 509 | "_contentImage": value._contentImage, |
429 | 510 | "_ThumbnailImage": value._ThumbnailImage, |
430 | - | |
431 | - | |
432 | 511 | }); |
433 | 512 | } |
513 | + | |
434 | 514 | }); |
435 | 515 | $('table > #ListViewDiv > #searchItem').remove(); |
436 | 516 | //Show Error Message in case of gridview if no data is found |
... | ... | @@ -442,18 +522,23 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout |
442 | 522 | $('#ListViewDiv').append('<tr id="searchItem"><td colspan="6"><strong style="color:black;">No illustration found for the selected search criteria!</strong></td></tr>'); |
443 | 523 | } |
444 | 524 | $rootScope.isLoading = false; |
445 | - $('#spinner').css('visibility', 'hidden'); | |
446 | 525 | |
526 | + setTimeout(function () { | |
527 | + $scope.EnableUI(); | |
528 | + }, 10); | |
447 | 529 | }, |
448 | 530 | function (error) { |
449 | 531 | console.log(' $scope.IllustrationData = ' + error.statusText); |
450 | 532 | } |
533 | + | |
451 | 534 | ); |
535 | + | |
536 | + | |
452 | 537 | } |
453 | 538 | |
454 | 539 | |
455 | 540 | $scope.scroll = function () { |
456 | - $("html,body").scrollTop(0); | |
541 | + //$("html,body").scrollTop(0); | |
457 | 542 | } |
458 | 543 | |
459 | 544 | |
... | ... | @@ -491,9 +576,9 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout |
491 | 576 | if ($rootScope.refreshcheck == null) { |
492 | 577 | $location.path('/'); |
493 | 578 | } |
494 | - | |
495 | 579 | $rootScope.isLoading = true; |
496 | - $('#spinner').css('visibility', 'visible'); | |
580 | + $('#aiSpinner').css('visibility', 'visible'); | |
581 | + //$scope.DisableUI(); | |
497 | 582 | $scope.voId = $rootScope.getLocalStorageValue("currentAIImageId"); |
498 | 583 | |
499 | 584 | var counter = 1; |
... | ... | @@ -513,17 +598,19 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout |
513 | 598 | .select('_contentImage'); |
514 | 599 | |
515 | 600 | $scope.clickedAIImage = "~/../content/images/ai/images/" + clickedAIImage[0]._contentImage; |
601 | + | |
516 | 602 | if (clickedAIImage.length > 0) { |
603 | + | |
517 | 604 | $.jsPanel({ |
518 | 605 | id: 'aiImagePanel', |
519 | 606 | selector: '.aiView', |
520 | 607 | theme: 'success', |
521 | 608 | currentController: 'AIController', |
522 | 609 | parentSlug: 'ADAM-images', |
523 | - content: '<div class="row" id="canvasDiv"><div style="align:left;"><canvas id="canvas" ng-click="onDrawingCanvasClick($event)" width="1369" height="325" class="canvas-annotationStyle" style="position: absolute; background-color: transparent;z-index:1 "></canvas> <canvas id="canvasPaint" ng-click="FreeStylePaint($event)" width="1369" height="325" class="canvas-annotationStyle1" style="position: absolute;z-index:0;"></canvas></div>' + | |
610 | + content: '<div class="row" id="canvasDiv"><div style="align:left;"><canvas id="canvas" ng-click="onDrawingCanvasClick($event)" width="1369" class="canvas-annotationStyle" style="position: absolute; background-color: transparent;z-index:1 "></canvas> <canvas id="canvasPaint" ng-click="FreeStylePaint($event)" width="1369" class="canvas-annotationStyle1" style="position: absolute;z-index:0;"></canvas></div>' + | |
524 | 611 | '<div class="col-sm-12 img-thumbnail" align="center">' + |
525 | 612 | '<img src="' + $scope.clickedAIImage + '" alt="" title="" class="img-responsive ">' + |
526 | - '<script>$(document).ready(function(){ var $ua = navigator.userAgent;if(($ua.match(/(iPod|iPhone|iPad|android)/i))) { var jspanelContainerWidth = $(".jsPanel-content").css("width"); $(".jsPanel-content").css({ "width": "100%", "min-width": jspanelContainerWidth });$("#aiImagePanel").css("width", "100%"); }$("#btnTxtOnOff").click(function(){if($.trim($(this).text()) === "Text Off"){$(this).text("Text On");$("#sid").css("visibility","hidden");}else{$(this).text("Text Off");$("#sid").css("visibility","visible");}});});</script></div>' + | |
613 | + '<script>$(document).ready(function(){ var $ua = navigator.userAgent;if(($ua.match(/(iPod|iPhone|iPad|android)/i))) { var jspanelContainerWidth = $(".jsPanel-content").css("width"); $(".jsPanel-content").css({ "width": "100%", "min-width": jspanelContainerWidth });$("#aiImagePanel").css("width", "100%"); }$("#btnTxtOnOff").click(function(){if($.trim($(this).text()) === "Text Off"){$(this).text("Text On");$("#sid").css("visibility","hidden");}else{$(this).text("Text Off");$("#sid").css("visibility","visible");}});});</script></div>' + | |
527 | 614 | '</div>', |
528 | 615 | //ajax: { |
529 | 616 | // url: 'app/views/ci/ci-view-detail.html' |
... | ... | @@ -531,49 +618,47 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout |
531 | 618 | title: $rootScope.getLocalStorageValue("currentViewTitle"), |
532 | 619 | position: { |
533 | 620 | top: 70, |
534 | - left: 20, | |
621 | + left: 20, | |
535 | 622 | }, |
536 | 623 | |
537 | 624 | size: { width: $(window).outerWidth() - 20, height: $(window).outerHeight() - 110 }, |
538 | 625 | |
539 | 626 | }); |
540 | 627 | |
541 | - | |
542 | 628 | $('#canvasDiv img').load(function () { |
543 | - | |
629 | + | |
544 | 630 | $rootScope.isLoading = false; |
545 | - $('#spinner').css('visibility', 'hidden'); | |
631 | + $('#aiSpinner').css('visibility', 'hidden'); | |
632 | + var canvas = document.getElementById("canvas"); | |
633 | + var canvasPaint = document.getElementById("canvasPaint"); | |
634 | + canvas.height = $(".img-thumbnail").height(); | |
635 | + canvasPaint.height = $(".img-thumbnail").height(); | |
546 | 636 | }); |
547 | - | |
548 | 637 | $rootScope.currentSlug = 'adam-images-detail'; |
549 | - | |
550 | 638 | $rootScope.openViews.push( |
551 | 639 | { |
552 | 640 | "module": $rootScope.currentActiveModuleTitle, "bodyView": tittle, "state": 'max', "BodyViewId": $rootScope.currentAIImageId, |
553 | 641 | "slug": $rootScope.currentSlug |
554 | 642 | }); |
555 | - | |
556 | - | |
557 | - //$("#aiImagePanel .img-thumbnail").css("height", $("#aiImagePanel .jsPanel-content").height()); | |
643 | + | |
644 | + $("#aiImagePanel .img-thumbnail").css("min-height", $("#aiImagePanel .jsPanel-content").height()); | |
558 | 645 | $('.jsPanel-content .jsPanel-theme-success').css('overflow-y', 'auto !important') |
559 | 646 | var jspContentHeight = $('.jsPanel-content').height(); |
647 | + | |
648 | + | |
560 | 649 | |
650 | + | |
561 | 651 | } |
562 | - | |
563 | - | |
564 | 652 | }, |
565 | 653 | function (error) { |
566 | 654 | // handle errors here |
567 | 655 | console.log(' $scope.AIllustrationData = ' + error.statusText); |
568 | 656 | } |
569 | - | |
570 | 657 | ); |
571 | - | |
572 | 658 | // console.log($rootScope.OpenAdamImages); |
573 | 659 | $('#AIView').css("height", $(window).outerHeight()); |
574 | 660 | |
575 | - $('#AIView').css("width", $(window).outerWidth()); | |
576 | - | |
661 | + $('#AIView').css("width", $(window).outerWidth()); | |
577 | 662 | } |
578 | 663 | |
579 | 664 | $scope.$on('annotationToolEvent', function (event, data) { |
... | ... | @@ -585,15 +670,19 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout |
585 | 670 | |
586 | 671 | $("#canvas").css("display", "block"); |
587 | 672 | $("#canvasPaint").css("display", "block"); |
588 | - | |
673 | + | |
589 | 674 | $rootScope.onDrawingCanvasClick(); |
590 | 675 | $rootScope.FreeStylePaint(); |
591 | 676 | }); |
592 | 677 | |
593 | - $scope.ReloadListViewImageDiv = function (id) { | |
678 | + $scope.ReloadListViewImageDiv = function (id,imgCount) { | |
594 | 679 | //console.log(id); |
595 | 680 | $scope.idSelected = id; |
596 | 681 | $scope.hiderow = true; |
682 | + $rootScope.isLoading = true; | |
683 | + $('#aiSpinner').css('visibility', 'visible'); | |
684 | + $('#aiSpinner').css('zIndex', '20000'); | |
685 | + //$scope.DisableUI(); | |
597 | 686 | |
598 | 687 | var promise = DataService.getJson('~/../content/data/json/ai/ai_dat_contentlist.json') |
599 | 688 | promise.then( |
... | ... | @@ -604,7 +693,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout |
604 | 693 | SelectedAIthumbImage = new jinqJs() |
605 | 694 | .from($scope.IllustrationData.root.AIData) |
606 | 695 | .where('_id = ' + id) |
607 | - .select('_ThumbnailImage', '_id', '_Title'); | |
696 | + .select('_ThumbnailImage', '_id', '_Title').slice(0, imgCount); | |
608 | 697 | |
609 | 698 | $scope.SelectedAIthumbImage = "~/../content/images/ai/thumbnails/" + SelectedAIthumbImage[0]._ThumbnailImage; |
610 | 699 | $scope.SelectedAIId = SelectedAIthumbImage[0]._id; |
... | ... | @@ -615,16 +704,18 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout |
615 | 704 | var curAIListViewScroll = $rootScope.getLocalStorageValue("AIListViewScroll"); |
616 | 705 | if (typeof (curAIListViewScroll) !== "undefined" && curAIListViewScroll !== null && curAIListViewScroll !== '') { |
617 | 706 | if (typeof InstallTrigger !== 'undefined') { |
618 | - | |
619 | - $('#ListViewDiv').animate({ scrollTop: $rootScope.getLocalStorageValue("AIListViewScroll") }); | |
707 | + $('#ListViewDiv').animate({ scrollTop: $rootScope.getLocalStorageValue("AIListViewScroll") }); | |
620 | 708 | } |
621 | 709 | else { |
622 | - | |
623 | 710 | $('#ListViewDiv').scrollTop($rootScope.getLocalStorageValue("AIListViewScroll")); |
624 | 711 | } |
625 | 712 | |
626 | 713 | } |
627 | - | |
714 | + $rootScope.isLoading = false; | |
715 | + $('#aiSpinner').css('visibility', 'hidden'); | |
716 | + //setTimeout(function () { | |
717 | + // $scope.EnableUI(); | |
718 | + //}, 10); | |
628 | 719 | }, |
629 | 720 | function (error) { |
630 | 721 | // handle errors here |
... | ... | @@ -640,9 +731,6 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout |
640 | 731 | $scope.hiderow = false; |
641 | 732 | } |
642 | 733 | } |
643 | - | |
644 | - | |
645 | - | |
646 | 734 | }] |
647 | 735 | ); |
648 | 736 | ... | ... |
400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js
... | ... | @@ -1351,7 +1351,8 @@ function ($rootScope, $scope, Modules, $log, $location, $timeout, DataService, A |
1351 | 1351 | if (alreadyOpenThisView != null) { |
1352 | 1352 | for (var i = 0; i < $rootScope.openViews.length; i++) { |
1353 | 1353 | k++; |
1354 | - if ($rootScope.openViews[i].body - views == title) { | |
1354 | + //if ($rootScope.openViews[i].body - views == title) { | |
1355 | + if ($rootScope.openViews[i].body == title) { | |
1355 | 1356 | $rootScope.openViews.splice((k - 1), 1); |
1356 | 1357 | |
1357 | 1358 | $rootScope.openViews.push( |
... | ... | @@ -5426,7 +5427,7 @@ function ($rootScope, $scope, Modules, $log, $location, $timeout, DataService, A |
5426 | 5427 | |
5427 | 5428 | OpenJSPanel(); // open jsPanel here |
5428 | 5429 | if ($('#jsPanel-1').length > 0) { |
5429 | - $('.jsPanel-btn-norm').attr('style', 'display: none'); | |
5430 | + $('.jsPanel-btn-norm').attr('style', 'display: block'); | |
5430 | 5431 | } |
5431 | 5432 | |
5432 | 5433 | console.log('jsPanel loaded exist= ' + document.getElementById('jsPanel-1')); // document.getElementsByClassName('ppImagePanel')); |
... | ... | @@ -5596,18 +5597,23 @@ function ($rootScope, $scope, Modules, $log, $location, $timeout, DataService, A |
5596 | 5597 | ResizeImage(0); |
5597 | 5598 | } |
5598 | 5599 | }); |
5599 | - | |
5600 | - $(document).on('click', '#btnPrint', function () { | |
5600 | + | |
5601 | + $(document).one('click', '#btnPrint', function () { | |
5602 | + | |
5601 | 5603 | PrintDivContentByID('printBoxPor'); |
5604 | + this.stopPropagation(); | |
5605 | + | |
5602 | 5606 | }); |
5603 | - | |
5607 | + | |
5604 | 5608 | function PrintDivContentByID(id) { |
5605 | - | |
5606 | 5609 | if (id == 'printBoxPor') { |
5607 | 5610 | $("#printPSOptions").val("100%"); |
5608 | 5611 | ResizeImage(1); |
5609 | 5612 | } |
5610 | - var contents = document.getElementById(id).innerHTML; | |
5613 | + var contents; | |
5614 | + $(document).ready(function () { | |
5615 | + contents = document.getElementById(id).innerHTML; | |
5616 | + }); | |
5611 | 5617 | // code for printng in ipads |
5612 | 5618 | var $ua = navigator.userAgent; |
5613 | 5619 | if (($ua.match(/(iPod|iPhone|iPad|android)/i))) { | ... | ... |
400-SOURCECODE/AIAHTML5.Web/app/views/ai/ai-view.html
1 | 1 | <div class="bodyWrap row no-scroll"> |
2 | - <div ng-include=" 'app/widget/MainMenu.html' " /> | |
3 | - <div class="main"> | |
2 | + <div ng-include="'app/widget/MainMenu.html'" /> | |
3 | + <div class="main" id="imgParent" style=""> | |
4 | 4 | <div class="row"> |
5 | 5 | <div class="col-sm-12 stickey-area" style="padding-left:25px; width:99%"> |
6 | 6 | <div class="breadcrumb" style="padding-bottom:5px;"> |
... | ... | @@ -14,38 +14,41 @@ |
14 | 14 | <i class="fa fa-search"></i> |
15 | 15 | </button> |
16 | 16 | </form> |
17 | - <nav> | |
18 | - <ul class="pagination pagination-sm no-margin"> | |
19 | - <li><a id="A" href="#" ng-click="ApplySearchByAlphabet('A')">A</a></li> | |
20 | - <li><a id="B" href="#" ng-click="ApplySearchByAlphabet('B')">B</a></li> | |
21 | - <li><a id="C" href="#" ng-click="ApplySearchByAlphabet('C')">C</a></li> | |
22 | - <li><a id="D" href="#" ng-click="ApplySearchByAlphabet('D')">D</a></li> | |
23 | - <li><a id="E" href="#" ng-click="ApplySearchByAlphabet('E')">E</a></li> | |
24 | - <li><a id="F" href="#" ng-click="ApplySearchByAlphabet('F')">F</a></li> | |
25 | - <li><a id="G" href="#" ng-click="ApplySearchByAlphabet('G')">G</a></li> | |
26 | - <li><a id="H" href="#" ng-click="ApplySearchByAlphabet('H')">H</a></li> | |
27 | - <li><a id="I" href="#" ng-click="ApplySearchByAlphabet('I')">I</a></li> | |
28 | - <li><a id="J" href="#" ng-click="ApplySearchByAlphabet('J')">J</a></li> | |
29 | - <li><a id="K" href="#" ng-click="ApplySearchByAlphabet('K')">K</a></li> | |
30 | - <li><a id="L" href="#" ng-click="ApplySearchByAlphabet('L')">L</a></li> | |
31 | - <li><a id="M" href="#" ng-click="ApplySearchByAlphabet('M')">M</a></li> | |
32 | - <li><a id="N" href="#" ng-click="ApplySearchByAlphabet('N')">N</a></li> | |
33 | - <li><a id="O" href="#" ng-click="ApplySearchByAlphabet('O')">O</a></li> | |
34 | - <li><a id="P" href="#" ng-click="ApplySearchByAlphabet('P')">P</a></li> | |
35 | - <li><a id="Q" href="#" ng-click="ApplySearchByAlphabet('Q')">Q</a></li> | |
36 | - <li><a id="R" href="#" ng-click="ApplySearchByAlphabet('R')">R</a></li> | |
37 | - <li><a id="S" href="#" ng-click="ApplySearchByAlphabet('S')">S</a></li> | |
38 | - <li><a id="T" href="#" ng-click="ApplySearchByAlphabet('T')">T</a></li> | |
39 | - <li><a id="U" href="#" ng-click="ApplySearchByAlphabet('U')">U</a></li> | |
40 | - <li><a id="V" href="#" ng-click="ApplySearchByAlphabet('V')">V</a></li> | |
41 | - <li><a id="W" href="#" ng-click="ApplySearchByAlphabet('W')">W</a></li> | |
42 | - <li><a id="X" href="#" ng-click="ApplySearchByAlphabet('X')">X</a></li> | |
43 | - <li><a id="Y" href="#" ng-click="ApplySearchByAlphabet('Y')">Y</a></li> | |
44 | - <li><a id="Z" href="#" ng-click="ApplySearchByAlphabet('Z')">Z</a></li> | |
45 | - </ul> | |
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 | - </nav> | |
17 | + <nav> | |
18 | + <ul class="pagination pagination-sm no-margin" style="cursor: pointer;"> | |
19 | + <li><span id="A" ng-click="ApplySearchByAlphabet('A')"> A</span></li> | |
20 | + <li><span id="B" ng-click="ApplySearchByAlphabet('B')"> B</span></li> | |
21 | + <li><span id="C" ng-click="ApplySearchByAlphabet('C')"> C</span></li> | |
22 | + <li><span id="D" ng-click="ApplySearchByAlphabet('D')"> D</span></li> | |
23 | + <li><span id="E" ng-click="ApplySearchByAlphabet('E')"> E</span></li> | |
24 | + <li><span id="F" ng-click="ApplySearchByAlphabet('F')"> F</span></li> | |
25 | + <li><span id="G" ng-click="ApplySearchByAlphabet('G')"> G</span></li> | |
26 | + <li><span id="H" ng-click="ApplySearchByAlphabet('H')"> H</span></li> | |
27 | + <li><span id="I" ng-click="ApplySearchByAlphabet('I')"> I</span></li> | |
28 | + <li><span id="J" ng-click="ApplySearchByAlphabet('J')"> J</span></li> | |
29 | + <li><span id="K" ng-click="ApplySearchByAlphabet('K')"> K</span></li> | |
30 | + <li><span id="L" ng-click="ApplySearchByAlphabet('L')"> L</span></li> | |
31 | + <li><span id="M" ng-click="ApplySearchByAlphabet('M')"> M</span></li> | |
32 | + <li><span id="N" ng-click="ApplySearchByAlphabet('N')"> N</span></li> | |
33 | + <li><span id="O" ng-click="ApplySearchByAlphabet('O')"> O</span></li> | |
34 | + <li><span id="P" ng-click="ApplySearchByAlphabet('P')"> P</span></li> | |
35 | + <li><span id="Q" ng-click="ApplySearchByAlphabet('Q')"> Q</span></li> | |
36 | + <li><span id="R" ng-click="ApplySearchByAlphabet('R')"> R</span></li> | |
37 | + <li><span id="S" ng-click="ApplySearchByAlphabet('S')"> S</span></li> | |
38 | + <li><span id="T" ng-click="ApplySearchByAlphabet('T')"> T</span></li> | |
39 | + <li><span id="U" ng-click="ApplySearchByAlphabet('U')"> U</span></li> | |
40 | + <li><span id="V" ng-click="ApplySearchByAlphabet('V')"> V</span></li> | |
41 | + <li><span id="W" ng-click="ApplySearchByAlphabet('W')"> W</span></li> | |
42 | + <li><span id="X" ng-click="ApplySearchByAlphabet('X')"> X</span></li> | |
43 | + <li><span id="Y" ng-click="ApplySearchByAlphabet('Y')"> Y</span></li> | |
44 | + <li><span id="Z" ng-click="ApplySearchByAlphabet('Z')"> Z</span></li> | |
45 | + | |
46 | + </ul> | |
47 | + <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> | |
48 | + </nav> | |
49 | + | |
48 | 50 | </div> |
51 | + | |
49 | 52 | </div> |
50 | 53 | </div> |
51 | 54 | </div> |
... | ... | @@ -73,7 +76,7 @@ |
73 | 76 | {{item._Title}} |
74 | 77 | </td> |
75 | 78 | </tr> |
76 | - | |
79 | + | |
77 | 80 | </tbody> |
78 | 81 | </table> |
79 | 82 | </div> |
... | ... | @@ -94,8 +97,8 @@ |
94 | 97 | </div> |
95 | 98 | </div> |
96 | 99 | </div> |
97 | - <div id="aiSpinner" class="spinner" ng-show="isLoading" style="visibility:hidden"> | |
98 | - <img id="img-spinner" src="content/images/common/loading.gif" alt="Loading" /> | |
100 | + <div id="aiSpinner" class="spinner" ng-show="isLoading" style="visibility: hidden; opacity: 1; width: 100%; height: 100%; top: 0; bottom: 0%; left: 0; right: 0%; margin-left: 0px;"> | |
101 | + <img id="img-spinner" class="spinner" src="content/images/common/loading.gif" alt="Loading" /> | |
99 | 102 | </div> |
100 | 103 | </div> |
101 | 104 | ... | ... |