Showing
3 changed files
400-SOURCECODE/AIAHTML5.Web/app/controllers/AIController.js
... | ... | @@ -20,6 +20,20 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout |
20 | 20 | $scope.setActiveTab = function (tabToSet) { |
21 | 21 | $scope.activeTab = tabToSet; |
22 | 22 | localStorage.setItem("currentAITabView", $scope.activeTab); |
23 | + if (tabToSet == 2) { | |
24 | + var curSelectedRowId = $rootScope.getLocalStorageValue("AISelectedRowId"); | |
25 | + $('#' + $rootScope.getLocalStorageValue("currentAIImageId")).addClass("selected"); | |
26 | + $scope.idSelected = $rootScope.getLocalStorageValue("currentAIImageId"); | |
27 | + var selectedImageId = $rootScope.getLocalStorageValue("currentAIImageId"); | |
28 | + $scope.LoadAIJsonData(); | |
29 | + $scope.ReloadListViewImageDiv(selectedImageId); | |
30 | + $scope.showItem(selectedImageId); | |
31 | + } | |
32 | + else { | |
33 | + $('#' + $rootScope.getLocalStorageValue("currentAIImageId")).find('.thumbnail').addClass('HightLightThumbnail'); | |
34 | + $('#' + $rootScope.getLocalStorageValue("currentAIImageId")).removeClass('selected'); | |
35 | + $scope.loadAllAI(); | |
36 | + } | |
23 | 37 | }; |
24 | 38 | |
25 | 39 | $scope.$on('$viewContentLoaded', function (event) { |
... | ... | @@ -49,7 +63,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout |
49 | 63 | //set the local storage |
50 | 64 | |
51 | 65 | var curtab = $rootScope.getLocalStorageValue("currentAITabView"); |
52 | - if (curtab == 2) { | |
66 | + if (curtab == 2) { | |
53 | 67 | $scope.setActiveTab(2); |
54 | 68 | var curSelectedRowId = $rootScope.getLocalStorageValue("AISelectedRowId"); |
55 | 69 | if (typeof (curSelectedRowId) !== "undefined" && curSelectedRowId !== null && curSelectedRowId !== '') { |
... | ... | @@ -214,9 +228,6 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout |
214 | 228 | $scope.Reset = function (query) { |
215 | 229 | $('ul li a').removeAttr("style"); |
216 | 230 | query.SearchText = ""; |
217 | - | |
218 | - | |
219 | - | |
220 | 231 | //set localstorage values |
221 | 232 | localStorage.setItem("SearchText", ''); |
222 | 233 | localStorage.setItem("SearchByAlphabet", ''); |
... | ... | @@ -252,25 +263,17 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout |
252 | 263 | |
253 | 264 | $rootScope.isLoading = true; |
254 | 265 | $('#spinner').css('visibility', 'visible'); |
255 | - | |
256 | - | |
257 | 266 | $scope.filterstring = true; |
258 | 267 | |
259 | 268 | while ($scope.searchAIListViewData.length) { |
260 | 269 | $scope.searchAIListViewData.pop(); |
261 | 270 | } |
262 | 271 | |
263 | - | |
264 | - | |
265 | - | |
266 | 272 | if (typeof (query.SearchText) !== "undefined" && (query.SearchText !== null && query.SearchText !== "")) { |
267 | - | |
268 | 273 | localStorage.setItem("SearchText", query.SearchText); |
269 | - | |
270 | 274 | } |
271 | 275 | else { |
272 | 276 | localStorage.setItem("SearchText", ''); |
273 | - | |
274 | 277 | } |
275 | 278 | |
276 | 279 | var promise = DataService.getJson('~/../content/data/json/ai/ai_dat_contentlist.json') |
... | ... | @@ -295,13 +298,11 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout |
295 | 298 | if (posbodyregion > -1) { |
296 | 299 | selectimg = true; |
297 | 300 | //count = count + 1; |
298 | - | |
299 | 301 | } |
300 | 302 | else { |
301 | 303 | selectimg = false; |
302 | 304 | //count = count - 1; |
303 | 305 | } |
304 | - | |
305 | 306 | } |
306 | 307 | |
307 | 308 | if (selectimg === true) { |
... | ... | @@ -319,8 +320,6 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout |
319 | 320 | autoHideScrollbar: true, |
320 | 321 | //theme:"rounded" |
321 | 322 | }); |
322 | - | |
323 | - | |
324 | 323 | $scope.searchAIListViewData.push( |
325 | 324 | { |
326 | 325 | "_id": value._id, |
... | ... | @@ -328,8 +327,6 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout |
328 | 327 | "_Title": value._Title, |
329 | 328 | "_contentImage": value._contentImage, |
330 | 329 | "_ThumbnailImage": value._ThumbnailImage, |
331 | - | |
332 | - | |
333 | 330 | }); |
334 | 331 | } |
335 | 332 | }); |
... | ... | @@ -341,6 +338,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout |
341 | 338 | $('table > #ListViewDiv > #searchItem').remove(); |
342 | 339 | |
343 | 340 | $('#ListViewDiv').append('<tr id="searchItem"><td colspan="6"><strong style="color:black;">No illustration found for the selected search criteria!</strong></td></tr>'); |
341 | + localStorage.setItem("SearchText", ''); | |
344 | 342 | } |
345 | 343 | $rootScope.isLoading = false; |
346 | 344 | $('#spinner').css('visibility', 'hidden'); |
... | ... | @@ -413,13 +411,10 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout |
413 | 411 | |
414 | 412 | $compile($el)($scope); |
415 | 413 | |
416 | - | |
417 | 414 | $(".sidebar").mCustomScrollbar({ |
418 | 415 | autoHideScrollbar: true, |
419 | 416 | //theme:"rounded" |
420 | 417 | }); |
421 | - | |
422 | - | |
423 | 418 | $scope.searchAIListViewData.push( |
424 | 419 | { |
425 | 420 | "_id": value._id, |
... | ... | @@ -427,8 +422,6 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout |
427 | 422 | "_Title": value._Title, |
428 | 423 | "_contentImage": value._contentImage, |
429 | 424 | "_ThumbnailImage": value._ThumbnailImage, |
430 | - | |
431 | - | |
432 | 425 | }); |
433 | 426 | } |
434 | 427 | }); |
... | ... | @@ -491,7 +484,6 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout |
491 | 484 | if ($rootScope.refreshcheck == null) { |
492 | 485 | $location.path('/'); |
493 | 486 | } |
494 | - | |
495 | 487 | $rootScope.isLoading = true; |
496 | 488 | $('#spinner').css('visibility', 'visible'); |
497 | 489 | $scope.voId = $rootScope.getLocalStorageValue("currentAIImageId"); |
... | ... | @@ -513,17 +505,19 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout |
513 | 505 | .select('_contentImage'); |
514 | 506 | |
515 | 507 | $scope.clickedAIImage = "~/../content/images/ai/images/" + clickedAIImage[0]._contentImage; |
508 | + | |
516 | 509 | if (clickedAIImage.length > 0) { |
510 | + | |
517 | 511 | $.jsPanel({ |
518 | 512 | id: 'aiImagePanel', |
519 | 513 | selector: '.aiView', |
520 | 514 | theme: 'success', |
521 | 515 | currentController: 'AIController', |
522 | 516 | 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>' + | |
517 | + 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 | 518 | '<div class="col-sm-12 img-thumbnail" align="center">' + |
525 | 519 | '<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>' + | |
520 | + '<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 | 521 | '</div>', |
528 | 522 | //ajax: { |
529 | 523 | // url: 'app/views/ci/ci-view-detail.html' |
... | ... | @@ -531,49 +525,47 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout |
531 | 525 | title: $rootScope.getLocalStorageValue("currentViewTitle"), |
532 | 526 | position: { |
533 | 527 | top: 70, |
534 | - left: 20, | |
528 | + left: 20, | |
535 | 529 | }, |
536 | 530 | |
537 | 531 | size: { width: $(window).outerWidth() - 20, height: $(window).outerHeight() - 110 }, |
538 | 532 | |
539 | 533 | }); |
540 | 534 | |
541 | - | |
542 | 535 | $('#canvasDiv img').load(function () { |
543 | - | |
536 | + | |
544 | 537 | $rootScope.isLoading = false; |
545 | 538 | $('#spinner').css('visibility', 'hidden'); |
539 | + var canvas = document.getElementById("canvas"); | |
540 | + var canvasPaint = document.getElementById("canvasPaint"); | |
541 | + canvas.height = $(".img-thumbnail").height(); | |
542 | + canvasPaint.height = $(".img-thumbnail").height(); | |
546 | 543 | }); |
547 | - | |
548 | 544 | $rootScope.currentSlug = 'adam-images-detail'; |
549 | - | |
550 | 545 | $rootScope.openViews.push( |
551 | 546 | { |
552 | 547 | "module": $rootScope.currentActiveModuleTitle, "bodyView": tittle, "state": 'max', "BodyViewId": $rootScope.currentAIImageId, |
553 | 548 | "slug": $rootScope.currentSlug |
554 | 549 | }); |
555 | - | |
556 | - | |
557 | - //$("#aiImagePanel .img-thumbnail").css("height", $("#aiImagePanel .jsPanel-content").height()); | |
550 | + | |
551 | + $("#aiImagePanel .img-thumbnail").css("min-height", $("#aiImagePanel .jsPanel-content").height()); | |
558 | 552 | $('.jsPanel-content .jsPanel-theme-success').css('overflow-y', 'auto !important') |
559 | 553 | var jspContentHeight = $('.jsPanel-content').height(); |
554 | + | |
555 | + | |
560 | 556 | |
557 | + | |
561 | 558 | } |
562 | - | |
563 | - | |
564 | 559 | }, |
565 | 560 | function (error) { |
566 | 561 | // handle errors here |
567 | 562 | console.log(' $scope.AIllustrationData = ' + error.statusText); |
568 | 563 | } |
569 | - | |
570 | 564 | ); |
571 | - | |
572 | 565 | // console.log($rootScope.OpenAdamImages); |
573 | 566 | $('#AIView').css("height", $(window).outerHeight()); |
574 | 567 | |
575 | - $('#AIView').css("width", $(window).outerWidth()); | |
576 | - | |
568 | + $('#AIView').css("width", $(window).outerWidth()); | |
577 | 569 | } |
578 | 570 | |
579 | 571 | $scope.$on('annotationToolEvent', function (event, data) { |
... | ... | @@ -585,7 +577,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout |
585 | 577 | |
586 | 578 | $("#canvas").css("display", "block"); |
587 | 579 | $("#canvasPaint").css("display", "block"); |
588 | - | |
580 | + | |
589 | 581 | $rootScope.onDrawingCanvasClick(); |
590 | 582 | $rootScope.FreeStylePaint(); |
591 | 583 | }); |
... | ... | @@ -594,6 +586,9 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout |
594 | 586 | //console.log(id); |
595 | 587 | $scope.idSelected = id; |
596 | 588 | $scope.hiderow = true; |
589 | + $rootScope.isLoading = true; | |
590 | + $('#aiSpinner').css('visibility', 'visible'); | |
591 | + $('#aiSpinner').css('zIndex', '20000'); | |
597 | 592 | |
598 | 593 | var promise = DataService.getJson('~/../content/data/json/ai/ai_dat_contentlist.json') |
599 | 594 | promise.then( |
... | ... | @@ -615,16 +610,15 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout |
615 | 610 | var curAIListViewScroll = $rootScope.getLocalStorageValue("AIListViewScroll"); |
616 | 611 | if (typeof (curAIListViewScroll) !== "undefined" && curAIListViewScroll !== null && curAIListViewScroll !== '') { |
617 | 612 | if (typeof InstallTrigger !== 'undefined') { |
618 | - | |
619 | - $('#ListViewDiv').animate({ scrollTop: $rootScope.getLocalStorageValue("AIListViewScroll") }); | |
613 | + $('#ListViewDiv').animate({ scrollTop: $rootScope.getLocalStorageValue("AIListViewScroll") }); | |
620 | 614 | } |
621 | 615 | else { |
622 | - | |
623 | 616 | $('#ListViewDiv').scrollTop($rootScope.getLocalStorageValue("AIListViewScroll")); |
624 | 617 | } |
625 | 618 | |
626 | 619 | } |
627 | - | |
620 | + $rootScope.isLoading = false; | |
621 | + $('#aiSpinner').css('visibility', 'hidden'); | |
628 | 622 | }, |
629 | 623 | function (error) { |
630 | 624 | // handle errors here |
... | ... | @@ -640,9 +634,6 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout |
640 | 634 | $scope.hiderow = false; |
641 | 635 | } |
642 | 636 | } |
643 | - | |
644 | - | |
645 | - | |
646 | 637 | }] |
647 | 638 | ); |
648 | 639 | ... | ... |
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
... | ... | @@ -8,7 +8,7 @@ |
8 | 8 | <form class="form-inline padd5"> |
9 | 9 | <div class="form-group"> |
10 | 10 | <label for="exampleInputName2" class="text-primary">Search</label> |
11 | - <input type="text" ng-change="hideListViewDiv()" ng-model="query.SearchText" class="form-control input-sm col-sm" id="txtSerachInput" placeholder=""> | |
11 | + <input type="text" ng-model="query.SearchText" class="form-control input-sm col-sm" id="txtSerachInput" placeholder=""> | |
12 | 12 | </div> |
13 | 13 | <button type="button" class="btn btn-primary btn-sm" ng-click="ApplySearch(query)" style="margin-right:2px;"> |
14 | 14 | <i class="fa fa-search"></i> | ... | ... |