Commit 23c5c78bd11436736d22634d93a0851fa6ef3f59

Authored by Nikita Kulshreshtha
2 parents 7fe216b1 39b462be

merged AIAHTML_BUG_Disable

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;
... ... @@ -86,7 +174,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
86 174  
87 175 if ($scope.query.SearchText == "" && $scope.query.SearchTextByAlphabet == "") {
88 176  
89   - $scope.loadAllAI();
  177 + $scope.loadAllAI(ImageCount);
90 178 }
91 179 else if ($scope.query.SearchTextByAlphabet != "" || $scope.query.SearchText == "") {
92 180 $scope.ApplySearchByAlphabet($scope.query.SearchTextByAlphabet);
... ... @@ -97,8 +185,8 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
97 185  
98 186 }
99 187  
100   - $scope.LoadAIJsonData = function () {
101   - $('ul li a').removeAttr("style");
  188 + $scope.LoadAIJsonData = function (ImageCount) {
  189 + $('ul li span').removeAttr("style");
102 190 var promise = DataService.getJson('~/../content/data/json/ai/ai_dat_contentlist.json')
103 191 promise.then(
104 192 function (result) {
... ... @@ -106,7 +194,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
106 194 $scope.selectedAIListViewData = new jinqJs()
107 195 .from($scope.IllustrationData.root.AIData)
108 196 .orderBy([{ field: '_Title', sort: 'asc' }])
109   - .select();
  197 + .select().slice(0, ImageCount);
110 198  
111 199 },
112 200 function (error) {
... ... @@ -118,13 +206,17 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
118 206  
119 207 };
120 208  
121   - $scope.loadAllAI = function () {
  209 + $scope.loadAllAI = function (ImageCount) {
122 210 $rootScope.isLoading = true;
123 211 localStorage.setItem("SearchText", '');
124 212 localStorage.setItem("SearchByAlphabet", '');
125   - $('ul li a').removeAttr("style");
  213 + $('ul li span').removeAttr("style");
126 214 $('#aiSpinner').css('visibility', 'visible');
127 215 $('#aiSpinner').css('zIndex', '20000');
  216 + if ($location.url() == "/ADAM-images")
  217 + {
  218 + $scope.DisableUI();
  219 + }
128 220 var promise = DataService.getJson('~/../content/data/json/ai/ai_dat_contentlist.json')
129 221 promise.then(
130 222 function (result) {
... ... @@ -133,7 +225,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
133 225 $scope.selectedAIListViewData = new jinqJs()
134 226 .from($scope.IllustrationData.root.AIData)
135 227 .orderBy([{ field: '_Title', sort: 'asc' }])
136   - .select();
  228 + .select().slice(0,ImageCount);
137 229  
138 230 //console.log($scope.selectedAIListViewData);
139 231  
... ... @@ -149,12 +241,18 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
149 241 $timeout(function () {
150 242 $('#' + $rootScope.getLocalStorageValue("currentAIImageId")).find('.thumbnail').addClass('HightLightThumbnail');
151 243 if ($rootScope.getLocalStorageValue('AIGridViewScroll') !== null && $location.url() == "/ADAM-images") {
152   - $('html, body').animate({ scrollTop: $rootScope.getLocalStorageValue('AIGridViewScroll') });
  244 + //$('html, body').animate({ scrollTop: $rootScope.getLocalStorageValue('AIGridViewScroll') });
153 245 }
154 246 }, 100);
155 247  
156 248 $rootScope.isLoading = false;
157 249 $('#aiSpinner').css('visibility', 'hidden');
  250 + if ($location.url() == "/ADAM-images") {
  251 + setTimeout(function () {
  252 + $scope.EnableUI();
  253 + }, 10);
  254 + }
  255 +
158 256  
159 257 },
160 258 function (error) {
... ... @@ -177,7 +275,8 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
177 275 //Set the vertical scroll value of the table.
178 276 var y = $('#ListViewDiv').scrollTop();
179 277 localStorage.setItem("AIListViewScroll", y);
180   -
  278 + //$('#' + id).find('.thumbnail').addClass('HightLightThumbnail');
  279 + localStorage.setItem("currentAIImageId", id);
181 280 $scope.hiderow = true;
182 281 if ($scope.filterstring == false) {
183 282  
... ... @@ -206,20 +305,18 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
206 305 $scope.SelectedAITitle = SelectedAIthumbImage[0]._Title;
207 306  
208 307 }
  308 +
209 309 }
210 310 };
211 311  
212 312 $scope.Reset = function (query) {
213   - $('ul li a').removeAttr("style");
  313 + $('ul li span').removeAttr("style");
214 314 query.SearchText = "";
215   -
216   -
217   -
218 315 //set localstorage values
219 316 localStorage.setItem("SearchText", '');
220 317 localStorage.setItem("SearchByAlphabet", '');
221 318 localStorage.setItem("AIListViewScroll", '');
222   -
  319 + var ImageCount = $rootScope.getLocalStorageValue("ImageCount");
223 320 if ($('.selected').hasClass("selected")) { $('.selected').removeClass("selected"); }
224 321  
225 322 $('#ListViewDiv').scrollTop(0);
... ... @@ -230,11 +327,11 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
230 327 while ($scope.searchAIListViewData.length) {
231 328 $scope.searchAIListViewData.pop();
232 329 }
233   - $scope.loadAllAI();
  330 + $scope.loadAllAI(ImageCount);
234 331 }
235 332  
236 333 $scope.ApplySearch = function (query) {
237   - $('ul li a').removeAttr("style");
  334 + $('ul li span').removeAttr("style");
238 335 var currentSearchtext = $rootScope.getLocalStorageValue("SearchText");
239 336 localStorage.setItem("SearchText", '');
240 337 if (currentSearchtext == "undefined" || (currentSearchtext == null || currentSearchtext == "")) {
... ... @@ -247,29 +344,22 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
247 344 }
248 345  
249 346 $rootScope.isLoading = true;
250   - $('#spinner').css('visibility', 'visible');
251   -
  347 + $('#aiSpinner').css('visibility', 'visible');
  348 + $scope.DisableUI();
252 349 $rootScope.isLoading = true;
253 350 $('#spinner').css('visibility', 'visible');
254 351  
255   -
256 352 $scope.filterstring = true;
257 353  
258   - while ($scope.searchAIListViewData.length) {
259   - $scope.searchAIListViewData.pop();
260   - }
261   -
262   -
263   -
  354 + //while ($scope.searchAIListViewData.length) {
  355 + // $scope.searchAIListViewData.pop();
  356 + //}
264 357  
265 358 if (typeof (query.SearchText) !== "undefined" && (query.SearchText !== null && query.SearchText !== "")) {
266   -
267 359 localStorage.setItem("SearchText", query.SearchText);
268   -
269 360 }
270 361 else {
271 362 localStorage.setItem("SearchText", '');
272   -
273 363 }
274 364  
275 365 var promise = DataService.getJson('~/../content/data/json/ai/ai_dat_contentlist.json')
... ... @@ -294,13 +384,11 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
294 384 if (posbodyregion > -1) {
295 385 selectimg = true;
296 386 //count = count + 1;
297   -
298 387 }
299 388 else {
300 389 selectimg = false;
301 390 //count = count - 1;
302 391 }
303   -
304 392 }
305 393  
306 394 if (selectimg === true) {
... ... @@ -421,12 +509,10 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
421 509 $compile($el)($scope);
422 510  
423 511  
424   - $(".sidebar").mCustomScrollbar({
425   - autoHideScrollbar: true,
426   - //theme:"rounded"
427   - });
428   -
429   -
  512 + //$(".sidebar").mCustomScrollbar({
  513 + // autoHideScrollbar: true,
  514 + // //theme:"rounded"
  515 + //});
430 516 $scope.searchAIListViewData.push(
431 517 {
432 518 "_id": value._id,
... ... @@ -434,8 +520,6 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
434 520 "_Title": value._Title,
435 521 "_contentImage": value._contentImage,
436 522 "_ThumbnailImage": value._ThumbnailImage,
437   -
438   -
439 523 });
440 524 }
441 525 });
... ... @@ -447,9 +531,13 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
447 531 $('table > #ListViewDiv > #searchItem').remove();
448 532  
449 533 $('#ListViewDiv').append('<tr id="searchItem"><td colspan="6"><strong style="color:black;">No illustration found for the selected search criteria!</strong></td></tr>');
  534 + localStorage.setItem("SearchText", '');
450 535 }
451 536 $rootScope.isLoading = false;
452   - $('#spinner').css('visibility', 'hidden');
  537 + $('#aiSpinner').css('visibility', 'hidden');
  538 + setTimeout(function () {
  539 + $scope.EnableUI();
  540 + }, 10);
453 541  
454 542 },
455 543 function (error) {
... ... @@ -458,25 +546,27 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
458 546 }
459 547 );
460 548 }
  549 + $scope.DisableUI = function () {
  550 +
  551 + $('#imgParent').css('z-index', '1');
  552 + document.getElementById("imgParent").style.pointerEvents = "none";
  553 + document.getElementById("imgParent").style.opacity = "0.5";
  554 + }
461 555  
  556 + $scope.EnableUI = function () {
  557 + document.getElementById("imgParent").style.pointerEvents = "auto";
  558 + document.getElementById("imgParent").style.opacity = "1.0";
  559 + }
462 560  
463   -
  561 + $scope.counter = 1;
464 562 $scope.ApplySearchByAlphabet = function (SearchTextByAlphabet) {
465   -
466 563 $rootScope.SearchTextByAlphabet = SearchTextByAlphabet
467 564 $rootScope.isLoading = true;
468   - $('ul li a').removeAttr("style");
469   - $('#spinner').css('visibility', 'visible');
  565 + $('#aiSpinner').css('visibility', 'visible');
  566 + $scope.DisableUI();
  567 + $('ul li span').removeAttr("style");
470 568 $('#' + $rootScope.SearchTextByAlphabet).css({ "color": "white", "background-color": "#1B92D0" });
471   -
472   - //color: #0095da;
473   - //background-color: #ffffff;
474   -
475 569 $scope.filterstring = true;
476   -
477   - while ($scope.searchAIListViewData.length) {
478   - $scope.searchAIListViewData.pop();
479   - }
480 570 if (typeof (SearchTextByAlphabet) !== "undefined" && (SearchTextByAlphabet !== null && SearchTextByAlphabet !== "")) {
481 571 localStorage.setItem("SearchByAlphabet", SearchTextByAlphabet);
482 572 }
... ... @@ -491,8 +581,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
491 581  
492 582 $scope.selectedAIListViewData = new jinqJs()
493 583 .from($scope.IllustrationData.root.AIData)
494   - .orderBy([{ field: '_Title', sort: 'asc' }])
495   - .select();
  584 + .orderBy([{ field: '_Title', sort: 'asc' }]).select();
496 585  
497 586 $('#grid-view').empty();
498 587  
... ... @@ -512,20 +601,12 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
512 601 if (selectimg === true) {
513 602 $scope.imagePath = "~/../content/images/ai/thumbnails/" + value._ThumbnailImage;
514 603  
515   - var $el = $('<div id="' + value._id + '" class="col-sm-3 col-md-2" title = "' + value._Title + '" data-ng-click="OpenAdamImage($event)">'
  604 + 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)">'
516 605 + '<div style="width:auto;height:auto;" class="thumbnail" >'
517 606 + '<img style="height:150px" id="' + value._Title + '"ng-src="' + $scope.imagePath + '" alt="" title="" >'
518 607 + '<div class="caption"><p>' + value._Title + '</p></div></a></div></div>').appendTo('#grid-view');
519 608  
520 609 $compile($el)($scope);
521   -
522   -
523   - $(".sidebar").mCustomScrollbar({
524   - autoHideScrollbar: true,
525   - //theme:"rounded"
526   - });
527   -
528   -
529 610 $scope.searchAIListViewData.push(
530 611 {
531 612 "_id": value._id,
... ... @@ -533,10 +614,9 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
533 614 "_Title": value._Title,
534 615 "_contentImage": value._contentImage,
535 616 "_ThumbnailImage": value._ThumbnailImage,
536   -
537   -
538 617 });
539 618 }
  619 +
540 620 });
541 621 $('table > #ListViewDiv > #searchItem').remove();
542 622 //Show Error Message in case of gridview if no data is found
... ... @@ -548,18 +628,23 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
548 628 $('#ListViewDiv').append('<tr id="searchItem"><td colspan="6"><strong style="color:black;">No illustration found for the selected search criteria!</strong></td></tr>');
549 629 }
550 630 $rootScope.isLoading = false;
551   - $('#spinner').css('visibility', 'hidden');
552 631  
  632 + setTimeout(function () {
  633 + $scope.EnableUI();
  634 + }, 10);
553 635 },
554 636 function (error) {
555 637 console.log(' $scope.IllustrationData = ' + error.statusText);
556 638 }
  639 +
557 640 );
  641 +
  642 +
558 643 }
559 644  
560 645  
561 646 $scope.scroll = function () {
562   - $("html,body").scrollTop(0);
  647 + //$("html,body").scrollTop(0);
563 648 }
564 649  
565 650  
... ... @@ -597,9 +682,9 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
597 682 if ($rootScope.refreshcheck == null) {
598 683 $location.path('/');
599 684 }
600   -
601 685 $rootScope.isLoading = true;
602   - $('#spinner').css('visibility', 'visible');
  686 + $('#aiSpinner').css('visibility', 'visible');
  687 + //$scope.DisableUI();
603 688 $scope.voId = $rootScope.getLocalStorageValue("currentAIImageId");
604 689  
605 690 var counter = 1;
... ... @@ -619,17 +704,19 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
619 704 .select('_contentImage');
620 705  
621 706 $scope.clickedAIImage = "~/../content/images/ai/images/" + clickedAIImage[0]._contentImage;
  707 +
622 708 if (clickedAIImage.length > 0) {
  709 +
623 710 $.jsPanel({
624 711 id: 'aiImagePanel',
625 712 selector: '.aiView',
626 713 theme: 'success',
627 714 currentController: 'AIController',
628 715 parentSlug: 'ADAM-images',
629   - 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>' +
  716 + 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>' +
630 717 '<div class="col-sm-12 img-thumbnail" align="center">' +
631 718 '<img src="' + $scope.clickedAIImage + '" alt="" title="" class="img-responsive ">' +
632   - '<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>' +
  719 + '<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>' +
633 720 '</div>',
634 721 //ajax: {
635 722 // url: 'app/views/ci/ci-view-detail.html'
... ... @@ -637,49 +724,47 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
637 724 title: $rootScope.getLocalStorageValue("currentViewTitle"),
638 725 position: {
639 726 top: 70,
640   - left: 20,
  727 + left: 20,
641 728 },
642 729  
643 730 size: { width: $(window).outerWidth() - 20, height: $(window).outerHeight() - 110 },
644 731  
645 732 });
646 733  
647   -
648 734 $('#canvasDiv img').load(function () {
649   -
  735 +
650 736 $rootScope.isLoading = false;
651   - $('#spinner').css('visibility', 'hidden');
  737 + $('#aiSpinner').css('visibility', 'hidden');
  738 + var canvas = document.getElementById("canvas");
  739 + var canvasPaint = document.getElementById("canvasPaint");
  740 + canvas.height = $(".img-thumbnail").height();
  741 + canvasPaint.height = $(".img-thumbnail").height();
652 742 });
653   -
654 743 $rootScope.currentSlug = 'adam-images-detail';
655   -
656 744 $rootScope.openViews.push(
657 745 {
658 746 "module": $rootScope.currentActiveModuleTitle, "bodyView": tittle, "state": 'max', "BodyViewId": $rootScope.currentAIImageId,
659 747 "slug": $rootScope.currentSlug
660 748 });
661   -
662   -
663   - //$("#aiImagePanel .img-thumbnail").css("height", $("#aiImagePanel .jsPanel-content").height());
  749 +
  750 + $("#aiImagePanel .img-thumbnail").css("min-height", $("#aiImagePanel .jsPanel-content").height());
664 751 $('.jsPanel-content .jsPanel-theme-success').css('overflow-y', 'auto !important')
665 752 var jspContentHeight = $('.jsPanel-content').height();
  753 +
  754 +
666 755  
  756 +
667 757 }
668   -
669   -
670 758 },
671 759 function (error) {
672 760 // handle errors here
673 761 console.log(' $scope.AIllustrationData = ' + error.statusText);
674 762 }
675   -
676 763 );
677   -
678 764 // console.log($rootScope.OpenAdamImages);
679 765 $('#AIView').css("height", $(window).outerHeight());
680 766  
681   - $('#AIView').css("width", $(window).outerWidth());
682   -
  767 + $('#AIView').css("width", $(window).outerWidth());
683 768 }
684 769  
685 770 $scope.$on('annotationToolEvent', function (event, data) {
... ... @@ -691,15 +776,19 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
691 776  
692 777 $("#canvas").css("display", "block");
693 778 $("#canvasPaint").css("display", "block");
694   -
  779 +
695 780 $rootScope.onDrawingCanvasClick();
696 781 $rootScope.FreeStylePaint();
697 782 });
698 783  
699   - $scope.ReloadListViewImageDiv = function (id) {
  784 + $scope.ReloadListViewImageDiv = function (id,imgCount) {
700 785 //console.log(id);
701 786 $scope.idSelected = id;
702 787 $scope.hiderow = true;
  788 + $rootScope.isLoading = true;
  789 + $('#aiSpinner').css('visibility', 'visible');
  790 + $('#aiSpinner').css('zIndex', '20000');
  791 + //$scope.DisableUI();
703 792  
704 793 var promise = DataService.getJson('~/../content/data/json/ai/ai_dat_contentlist.json')
705 794 promise.then(
... ... @@ -710,7 +799,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
710 799 SelectedAIthumbImage = new jinqJs()
711 800 .from($scope.IllustrationData.root.AIData)
712 801 .where('_id = ' + id)
713   - .select('_ThumbnailImage', '_id', '_Title');
  802 + .select('_ThumbnailImage', '_id', '_Title').slice(0, imgCount);
714 803  
715 804 $scope.SelectedAIthumbImage = "~/../content/images/ai/thumbnails/" + SelectedAIthumbImage[0]._ThumbnailImage;
716 805 $scope.SelectedAIId = SelectedAIthumbImage[0]._id;
... ... @@ -721,16 +810,18 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
721 810 var curAIListViewScroll = $rootScope.getLocalStorageValue("AIListViewScroll");
722 811 if (typeof (curAIListViewScroll) !== "undefined" && curAIListViewScroll !== null && curAIListViewScroll !== '') {
723 812 if (typeof InstallTrigger !== 'undefined') {
724   -
725   - $('#ListViewDiv').animate({ scrollTop: $rootScope.getLocalStorageValue("AIListViewScroll") });
  813 + $('#ListViewDiv').animate({ scrollTop: $rootScope.getLocalStorageValue("AIListViewScroll") });
726 814 }
727 815 else {
728   -
729 816 $('#ListViewDiv').scrollTop($rootScope.getLocalStorageValue("AIListViewScroll"));
730 817 }
731 818  
732 819 }
733   -
  820 + $rootScope.isLoading = false;
  821 + $('#aiSpinner').css('visibility', 'hidden');
  822 + //setTimeout(function () {
  823 + // $scope.EnableUI();
  824 + //}, 10);
734 825 },
735 826 function (error) {
736 827 // handle errors here
... ... @@ -746,9 +837,6 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
746 837 $scope.hiderow = false;
747 838 }
748 839 }
749   -
750   -
751   -
752 840 }]
753 841 );
754 842  
... ...
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-views == 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  
... ...