Commit 783cac03c63c0f0ece71505c8d877a2be0adba31
1 parent
fbc8fb64
CI module partially commited
Showing
2 changed files
with
273 additions
and
162 deletions
400-SOURCECODE/AIAHTML5.Web/app/controllers/CIController.js
@@ -9,14 +9,8 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | @@ -9,14 +9,8 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | ||
9 | $scope.CIAllSpeciality = []; | 9 | $scope.CIAllSpeciality = []; |
10 | $scope.selectedCIListViewData = []; | 10 | $scope.selectedCIListViewData = []; |
11 | 11 | ||
12 | - //************************************ | ||
13 | - | ||
14 | - $scope.showTabButton = true; | ||
15 | - // $scope.IllustrationData; | ||
16 | - | ||
17 | - $scope.searchCIListViewData = []; | 12 | + //$scope.searchCIListViewData = []; |
18 | $scope.SelectedCIthumbImage = []; | 13 | $scope.SelectedCIthumbImage = []; |
19 | - $scope.SelectedCIImage = []; | ||
20 | $scope.SelectedCISummary = []; | 14 | $scope.SelectedCISummary = []; |
21 | $scope.SelectedCIId = []; | 15 | $scope.SelectedCIId = []; |
22 | $scope.SelectedCITitle = []; | 16 | $scope.SelectedCITitle = []; |
@@ -24,6 +18,9 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | @@ -24,6 +18,9 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | ||
24 | $scope.filterstring = false; | 18 | $scope.filterstring = false; |
25 | $scope.idSelected; | 19 | $scope.idSelected; |
26 | $scope.srollListView; | 20 | $scope.srollListView; |
21 | + | ||
22 | + $scope.showTabButton = true; | ||
23 | + | ||
27 | $scope.query = { | 24 | $scope.query = { |
28 | selectedbodyregion: '', | 25 | selectedbodyregion: '', |
29 | selectedbodysystem: '', | 26 | selectedbodysystem: '', |
@@ -32,6 +29,15 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | @@ -32,6 +29,15 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | ||
32 | selectedspecialty: '', | 29 | selectedspecialty: '', |
33 | }; | 30 | }; |
34 | 31 | ||
32 | + //************************************ | ||
33 | + | ||
34 | + | ||
35 | + | ||
36 | + | ||
37 | + | ||
38 | + | ||
39 | + | ||
40 | + | ||
35 | $scope.setActiveTab = function (tabToSet) { | 41 | $scope.setActiveTab = function (tabToSet) { |
36 | $scope.activeTab = tabToSet; | 42 | $scope.activeTab = tabToSet; |
37 | localStorage.setItem("currentCITabView", $scope.activeTab); | 43 | localStorage.setItem("currentCITabView", $scope.activeTab); |
@@ -49,15 +55,18 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | @@ -49,15 +55,18 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | ||
49 | $rootScope.CIWindowData.push( | 55 | $rootScope.CIWindowData.push( |
50 | { | 56 | { |
51 | 'multiwinid': windowviewid, | 57 | 'multiwinid': windowviewid, |
52 | - 'IllustrationData':[], | 58 | + 'IllustrationData': [], |
59 | + 'searchCIListViewData': [], | ||
60 | + 'CIImagePath': '', | ||
61 | + 'ImageSummary': '', | ||
53 | 'moduleName': '', | 62 | 'moduleName': '', |
54 | 'currentViewTitle': '', | 63 | 'currentViewTitle': '', |
55 | 'parentSlugName': '', | 64 | 'parentSlugName': '', |
65 | + 'currentSlug': '', | ||
56 | 'sliderPercentValue': 1, | 66 | 'sliderPercentValue': 1, |
57 | 'imageId': '', | 67 | 'imageId': '', |
58 | 'imageName': '', | 68 | 'imageName': '', |
59 | 'bodySystemName': '', | 69 | 'bodySystemName': '', |
60 | - 'OpenItemImagePath': '', | ||
61 | 'isBodySystemSelected': false, | 70 | 'isBodySystemSelected': false, |
62 | 'typeOfEvent': '', | 71 | 'typeOfEvent': '', |
63 | 'selectedSystemName': null, | 72 | 'selectedSystemName': null, |
@@ -80,14 +89,18 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | @@ -80,14 +89,18 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | ||
80 | { | 89 | { |
81 | 'multiwinid': windowviewid, | 90 | 'multiwinid': windowviewid, |
82 | 'IllustrationData': [], | 91 | 'IllustrationData': [], |
92 | + 'searchCIListViewData': [], | ||
93 | + 'CIImagePath': '', | ||
94 | + 'ImageSummary': '', | ||
83 | 'moduleName': '', | 95 | 'moduleName': '', |
84 | 'currentViewTitle': '', | 96 | 'currentViewTitle': '', |
85 | 'parentSlugName': '', | 97 | 'parentSlugName': '', |
98 | + 'currentSlug':'', | ||
86 | 'sliderPercentValue': 1, | 99 | 'sliderPercentValue': 1, |
87 | 'imageId': '', | 100 | 'imageId': '', |
88 | 'imageName': '', | 101 | 'imageName': '', |
89 | 'bodySystemName': '', | 102 | 'bodySystemName': '', |
90 | - 'OpenItemImagePath': '', | 103 | + |
91 | 'isBodySystemSelected': false, | 104 | 'isBodySystemSelected': false, |
92 | 'typeOfEvent': '', | 105 | 'typeOfEvent': '', |
93 | 'selectedSystemName': null, | 106 | 'selectedSystemName': null, |
@@ -209,7 +222,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | @@ -209,7 +222,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | ||
209 | if (typeof (curSelectedRowId) !== "undefined" && curSelectedRowId !== null && curSelectedRowId !== '') { | 222 | if (typeof (curSelectedRowId) !== "undefined" && curSelectedRowId !== null && curSelectedRowId !== '') { |
210 | $scope.reRunSearchOnLoad($rootScope.MULTI_VIEW_ID); | 223 | $scope.reRunSearchOnLoad($rootScope.MULTI_VIEW_ID); |
211 | $scope.idSelected = curSelectedRowId; | 224 | $scope.idSelected = curSelectedRowId; |
212 | - $scope.ReloadListViewImageDiv($scope.idSelected); | 225 | + $scope.ReloadListViewImageDiv($scope.idSelected, $rootScope.MULTI_VIEW_ID); |
213 | } | 226 | } |
214 | else { | 227 | else { |
215 | $scope.reRunSearchOnLoad($rootScope.MULTI_VIEW_ID) | 228 | $scope.reRunSearchOnLoad($rootScope.MULTI_VIEW_ID) |
@@ -316,7 +329,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | @@ -316,7 +329,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | ||
316 | 329 | ||
317 | $timeout(function () | 330 | $timeout(function () |
318 | { | 331 | { |
319 | - $('#' + $rootScope.getLocalStorageValue("currentBodyViewId")).find('.thumbnail').addClass('HightLightThumbnail'); | 332 | + $('#' + $rootScope.getLocalStorageValue("currentImageId")).find('.thumbnail').addClass('HightLightThumbnail'); |
320 | if ($rootScope.getLocalStorageValue('CIGridViewScroll') !== null && $location.url() == "/clinical-illustrations") { | 333 | if ($rootScope.getLocalStorageValue('CIGridViewScroll') !== null && $location.url() == "/clinical-illustrations") { |
321 | $('html, body').animate({ scrollTop: $rootScope.getLocalStorageValue('CIGridViewScroll') }); | 334 | $('html, body').animate({ scrollTop: $rootScope.getLocalStorageValue('CIGridViewScroll') }); |
322 | } | 335 | } |
@@ -332,7 +345,11 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | @@ -332,7 +345,11 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | ||
332 | 345 | ||
333 | } | 346 | } |
334 | 347 | ||
335 | - $scope.showItem = function (id) { | 348 | + $scope.showItem = function (id, windowviewid) { |
349 | + | ||
350 | + if (windowviewid == undefined) | ||
351 | + windowviewid = $rootScope.MULTI_VIEW_ID; | ||
352 | + | ||
336 | $scope.idSelected = id; | 353 | $scope.idSelected = id; |
337 | localStorage.setItem("CISelectedRowId", id); | 354 | localStorage.setItem("CISelectedRowId", id); |
338 | 355 | ||
@@ -355,12 +372,15 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | @@ -355,12 +372,15 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | ||
355 | $scope.SelectedCITitle = SelectedCIthumbImage[0]._Title; | 372 | $scope.SelectedCITitle = SelectedCIthumbImage[0]._Title; |
356 | 373 | ||
357 | } | 374 | } |
358 | - else { | ||
359 | - if ($scope.searchCIListViewData.length > 0) { | 375 | + else |
376 | + { | ||
377 | + var searchCIListViewData = $scope.GetCIwindowStoreData(windowviewid, 'searchCIListViewData'); | ||
378 | + | ||
379 | + if (searchCIListViewData.length > 0) { | ||
360 | 380 | ||
361 | var SelectedCIthumbImage = []; | 381 | var SelectedCIthumbImage = []; |
362 | SelectedCIthumbImage = new jinqJs() | 382 | SelectedCIthumbImage = new jinqJs() |
363 | - .from($scope.searchCIListViewData) | 383 | + .from(searchCIListViewData) |
364 | .where('_id = ' + id) | 384 | .where('_id = ' + id) |
365 | .select('_ThumbnailImage', '_Summary', '_id', '_Title'); | 385 | .select('_ThumbnailImage', '_Summary', '_id', '_Title'); |
366 | 386 | ||
@@ -401,10 +421,9 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | @@ -401,10 +421,9 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | ||
401 | $scope.hideListViewDiv(); | 421 | $scope.hideListViewDiv(); |
402 | 422 | ||
403 | $scope.filterstring = false; | 423 | $scope.filterstring = false; |
404 | - while ($scope.searchCIListViewData.length) { | ||
405 | - $scope.searchCIListViewData.pop(); | ||
406 | - } | ||
407 | 424 | ||
425 | + $scope.SetCIwindowStoreData(windowviewid, 'searchCIListViewData', []); | ||
426 | + | ||
408 | $scope.loadAllCI(windowviewid); | 427 | $scope.loadAllCI(windowviewid); |
409 | 428 | ||
410 | } | 429 | } |
@@ -419,6 +438,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | @@ -419,6 +438,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | ||
419 | 438 | ||
420 | $scope.filterstring = true; | 439 | $scope.filterstring = true; |
421 | 440 | ||
441 | + $scope.SetCIwindowStoreData(windowviewid, 'searchCIListViewData', []); | ||
422 | 442 | ||
423 | filtercount = 0; | 443 | filtercount = 0; |
424 | if (typeof (query.selectedbodyregion) !== "undefined" && (query.selectedbodyregion !== null && query.selectedbodyregion !== "")) { | 444 | if (typeof (query.selectedbodyregion) !== "undefined" && (query.selectedbodyregion !== null && query.selectedbodyregion !== "")) { |
@@ -562,8 +582,8 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | @@ -562,8 +582,8 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | ||
562 | //theme:"rounded" | 582 | //theme:"rounded" |
563 | }); | 583 | }); |
564 | 584 | ||
565 | - | ||
566 | - $scope.searchCIListViewData.push( | 585 | + var cilistviewdata = []; |
586 | + cilistviewdata.push( | ||
567 | { | 587 | { |
568 | "_id": value._id, | 588 | "_id": value._id, |
569 | "_ImageId": value._ImageId, | 589 | "_ImageId": value._ImageId, |
@@ -578,11 +598,15 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | @@ -578,11 +598,15 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | ||
578 | "_Summary": value._Summary | 598 | "_Summary": value._Summary |
579 | 599 | ||
580 | }); | 600 | }); |
601 | + $scope.SetCIwindowStoreData(windowviewid, 'searchCIListViewData', cilistviewdata); | ||
602 | + | ||
581 | } | 603 | } |
582 | }); | 604 | }); |
583 | $('table > #ListViewDiv > #searchItem').remove(); | 605 | $('table > #ListViewDiv > #searchItem').remove(); |
606 | + | ||
607 | + var searchCIListViewData = $scope.GetCIwindowStoreData(windowviewid, 'searchCIListViewData'); | ||
584 | //Show Error Message in case of gridview if no data is found | 608 | //Show Error Message in case of gridview if no data is found |
585 | - if ($scope.searchCIListViewData.length == 0) { | 609 | + if (searchCIListViewData.length == 0) { |
586 | var $el = $('<div class="col-sm-12" style="padding-left:25px;padding-top:10px;"><strong style="color:white">No illustration found for the selected search criteria!</strong></div>').appendTo('#grid-view'); | 610 | var $el = $('<div class="col-sm-12" style="padding-left:25px;padding-top:10px;"><strong style="color:white">No illustration found for the selected search criteria!</strong></div>').appendTo('#grid-view'); |
587 | $compile($el)($scope); | 611 | $compile($el)($scope); |
588 | $('table > #ListViewDiv > #searchItem').remove(); | 612 | $('table > #ListViewDiv > #searchItem').remove(); |
@@ -601,29 +625,47 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | @@ -601,29 +625,47 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | ||
601 | 625 | ||
602 | $scope.openView = function ($event) { | 626 | $scope.openView = function ($event) { |
603 | 627 | ||
628 | + var windowviewid = $rootScope.MULTI_VIEW_ID; | ||
604 | $rootScope.MenuModuleName = "CI"; | 629 | $rootScope.MenuModuleName = "CI"; |
605 | $rootScope.disableAnnotationTB = false; | 630 | $rootScope.disableAnnotationTB = false; |
606 | $rootScope.CIAnotationIdentifyModeOff = true; | 631 | $rootScope.CIAnotationIdentifyModeOff = true; |
607 | - $rootScope.currentBodyViewId = $event.currentTarget.id; | ||
608 | if ($event.currentTarget.textContent !== null && typeof ($event.currentTarget.textContent) !== "undefined") { | 632 | if ($event.currentTarget.textContent !== null && typeof ($event.currentTarget.textContent) !== "undefined") { |
609 | - var CITitle = []; | ||
610 | - CITitle = new jinqJs() | 633 | + var selectedTileData = []; |
634 | + selectedTileData = new jinqJs() | ||
611 | .from($scope.selectedCIListViewData) | 635 | .from($scope.selectedCIListViewData) |
612 | .where('_id = ' + $event.currentTarget.id) | 636 | .where('_id = ' + $event.currentTarget.id) |
613 | - .select('_Title'); | ||
614 | - | ||
615 | - // console.log(CITitle); | ||
616 | - // console.log($scope.selectedCIListViewData); | 637 | + .select(); |
617 | 638 | ||
618 | - $rootScope.ViewTitle = CITitle[0]._Title; | 639 | + $rootScope.ViewTitle = selectedTileData[0]._Title; |
619 | } | 640 | } |
620 | else { | 641 | else { |
621 | $rootScope.ViewTitle = $event.currentTarget.textContent; | 642 | $rootScope.ViewTitle = $event.currentTarget.textContent; |
622 | 643 | ||
623 | } | 644 | } |
645 | + | ||
646 | + localStorage.setItem("currentViewTitle", $rootScope.ViewTitle); | ||
647 | + localStorage.setItem("currentImageId", $event.currentTarget.id); | ||
648 | + | ||
649 | + $scope.SetCIwindowStoreData(windowviewid, 'currentViewTitle', $rootScope.ViewTitle); | ||
650 | + $scope.SetCIwindowStoreData(windowviewid, 'imageId', $event.currentTarget.id); | ||
651 | + | ||
652 | + var imageName = selectedTileData[0]._contentImage; | ||
653 | + | ||
654 | + $scope.SetCIwindowStoreData(windowviewid, 'imageName', imageName); | ||
655 | + | ||
656 | + var imagePath = "~/../content/images/ci/images/" + imageName; | ||
657 | + | ||
658 | + $scope.SetCIwindowStoreData(windowviewid, 'CIImagePath', imagePath); | ||
659 | + | ||
660 | + var selectedImageCISummary = selectedTileData[0]._Summary | ||
661 | + | ||
662 | + $scope.SetCIwindowStoreData(windowviewid, 'ImageSummary', selectedImageCISummary); | ||
663 | + | ||
664 | + // store image for export | ||
665 | + var tittle = $rootScope.getLocalStorageValue("currentViewTitle"); | ||
666 | + $rootScope.StoreTitleName(tittle); | ||
667 | + $rootScope.StoreOrgImageName(imageName); | ||
624 | 668 | ||
625 | - localStorage.setItem("currentViewTitleFromJson", $rootScope.ViewTitle); | ||
626 | - localStorage.setItem("currentBodyViewId", $event.currentTarget.id); | ||
627 | 669 | ||
628 | //Set the vertical scroll value of the Grid-View. | 670 | //Set the vertical scroll value of the Grid-View. |
629 | var y = $($window).scrollTop(); | 671 | var y = $($window).scrollTop(); |
@@ -631,115 +673,195 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | @@ -631,115 +673,195 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | ||
631 | var u = $location.url(); | 673 | var u = $location.url(); |
632 | $location.url('/clinical-illustrations-detail'); | 674 | $location.url('/clinical-illustrations-detail'); |
633 | 675 | ||
634 | - // console.log($location.url('/clinical-illustrations-detail')); | 676 | + |
677 | + } | ||
678 | + | ||
679 | + $scope.openBodyViewMain = function () { | ||
680 | + | ||
681 | + if ($rootScope.isCallFromOtherModule) { | ||
682 | + $scope.CIModuleData = ModuleService.getModuleData("ATLAS_ANATOMY"); | ||
683 | + $scope.readyToLoad = true; | ||
684 | + $rootScope.CIWindowLoadComplete = false; | ||
685 | + $scope.wincount = 1; | ||
686 | + var winlen = $scope.CIModuleData.length; | ||
687 | + var timeint = null; | ||
688 | + var slideId = ""; | ||
689 | + timeint = $interval(function () { | ||
690 | + | ||
691 | + if ($scope.readyToLoad == true) { | ||
692 | + var windata = $scope.CIModuleData[$scope.wincount - 1]; | ||
693 | + slideId = windata.slideId; | ||
694 | + $scope.openBodyView(windata); | ||
695 | + | ||
696 | + } | ||
697 | + $scope.readyToLoad = false; | ||
698 | + if ($scope.wincount < winlen && $rootScope.CIWindowLoadComplete == true) { | ||
699 | + $scope.wincount = $scope.wincount + 1; | ||
700 | + $rootScope.CIWindowLoadComplete = false; | ||
701 | + $scope.readyToLoad = true; | ||
702 | + } | ||
703 | + | ||
704 | + if ($scope.wincount == winlen && $rootScope.CIWindowLoadComplete == true) { | ||
705 | + $scope.stopInterval(); | ||
706 | + $scope.$emit("LoadModuleComplete", "ATLAS_ANATOMY", slideId); | ||
707 | + } | ||
708 | + | ||
709 | + | ||
710 | + }, 100); | ||
711 | + | ||
712 | + $scope.stopInterval = function () { | ||
713 | + if (angular.isDefined(timeint)) { | ||
714 | + $interval.cancel(timeint); | ||
715 | + timeint = undefined; | ||
716 | + } | ||
717 | + | ||
718 | + }; | ||
635 | 719 | ||
720 | + } | ||
721 | + else { | ||
722 | + $scope.openBodyView(null); | ||
723 | + } | ||
636 | } | 724 | } |
637 | 725 | ||
638 | - $scope.openBodyView = function () { | 726 | + $scope.openBodyView = function (ciModuleData) { |
727 | + | ||
728 | + if ($rootScope.isCallFromOtherModule == true) { | ||
729 | + $scope.ciOpenInOtherModules = ciModuleData; | ||
730 | + $rootScope.MULTI_VIEW_ID += 1; | ||
731 | + var windowviewid = $rootScope.MULTI_VIEW_ID; | ||
732 | + | ||
733 | + $scope.initializeCIWindowData(windowviewid, false, $scope.ciOpenInOtherModules.currentWindowId); | ||
734 | + | ||
735 | + var moduleName = $scope.ciOpenInOtherModules.mType; | ||
736 | + $scope.SetCIwindowStoreData(windowviewid, 'moduleName', moduleName); | ||
737 | + | ||
738 | + var promise = DataService.getJson('~/../content/data/json/ci/ci_dat_contentlist.json') | ||
739 | + promise.then( | ||
740 | + function (result) { | ||
741 | + var IllustrationData = new jinqJs() | ||
742 | + .from(result.root.CIData) | ||
743 | + .orderBy([{ field: '_Title', sort: 'asc' }]) | ||
744 | + .select(); | ||
745 | + | ||
746 | + // serial no of imageid | ||
747 | + var imageId = $scope.ciOpenInOtherModules.id; | ||
748 | + | ||
749 | + $scope.SetCIwindowStoreData(windowviewid, 'imageId', imageId); | ||
750 | + | ||
751 | + var selectedTileData = []; | ||
752 | + selectedTileData = new jinqJs() | ||
753 | + .from(IllustrationData) | ||
754 | + .where('_id == ' + imageId) | ||
755 | + .select(); | ||
756 | + | ||
757 | + | ||
758 | + var imageName = selectedTileData[0]._contentImage; | ||
759 | + | ||
760 | + $scope.SetCIwindowStoreData(windowviewid, 'imageName', imageName); | ||
761 | + | ||
762 | + var imagePath = "~/../content/images/ci/images/" + imageName; | ||
763 | + | ||
764 | + $scope.SetCIwindowStoreData(windowviewid, 'CIImagePath', imagePath); | ||
765 | + | ||
766 | + var selectedImageCISummary = selectedTileData[0]._Summary | ||
767 | + | ||
768 | + $scope.SetCIwindowStoreData(windowviewid, 'ImageSummary', selectedImageCISummary); | ||
769 | + | ||
770 | + var ciTitle = $scope.ciOpenInOtherModules.anatomyTitle; | ||
771 | + $scope.SetCIwindowStoreData(windowviewid, 'currentViewTitle', ciTitle); | ||
772 | + localStorage.setItem("currentViewTitle", ciTitle); | ||
773 | + | ||
774 | + // store image for export | ||
775 | + $rootScope.StoreTitleName(ciTitle); | ||
776 | + $rootScope.StoreOrgImageName(selectedTileData[0]._contentImage); | ||
777 | + | ||
778 | + $scope.SetCIwindowStoreData(windowviewid, 'parentSlugName', ($location.url()).replace('/', '')); | ||
779 | + | ||
780 | + $scope.loadCIllustration(windowviewid); | ||
781 | + | ||
782 | + }, | ||
783 | + function (error) { | ||
784 | + // handle errors here | ||
785 | + console.log(' $scope.CIllustrationData = ' + error.statusText); | ||
786 | + } | ||
787 | + | ||
788 | + ); | ||
789 | + | ||
790 | + | ||
791 | + } | ||
792 | + else { | ||
793 | + $scope.SetCIwindowStoreData($rootScope.MULTI_VIEW_ID, 'parentSlugName', 'clinical-illustrations'); | ||
794 | + $scope.loadCIllustration($rootScope.MULTI_VIEW_ID); | ||
795 | + } | ||
796 | + | ||
797 | + | ||
798 | + | ||
799 | + } | ||
800 | + | ||
801 | + $scope.loadCIllustration = function (windowviewid) { | ||
639 | 802 | ||
640 | if ($rootScope.refreshcheck == null) { | 803 | if ($rootScope.refreshcheck == null) { |
641 | $location.path('/'); | 804 | $location.path('/'); |
642 | } | 805 | } |
806 | + | ||
807 | + $scope.jsPanelID = 'ciImagePanel' + '_' + windowviewid; | ||
808 | + var selectedCIImage = $scope.GetCIwindowStoreData(windowviewid, 'CIImagePath'); | ||
809 | + | ||
810 | + var selectedImageCISummary = $scope.GetCIwindowStoreData(windowviewid, 'ImageSummary'); | ||
811 | + var tittle = $scope.GetCIwindowStoreData(windowviewid, 'currentViewTitle'); | ||
812 | + var imageId = $scope.GetCIwindowStoreData(windowviewid, 'imageId'); | ||
813 | + | ||
814 | + | ||
815 | + $.jsPanel({ | ||
816 | + id: $scope.jsPanelID, | ||
817 | + selector: '.ciView', | ||
818 | + theme: 'success', | ||
819 | + currentController: 'CIController', | ||
820 | + parentSlug: $scope.GetCIwindowStoreData(windowviewid, 'parentSlugName'), | ||
821 | + content: '<div class="row" id="canvasDivCI_' + windowviewid + '"><div style="align:left;"><canvas id="canvasCI_' + windowviewid + '" ng-click="onDrawingCanvasClick($event)" width="1340" height="325" class="canvas-annotationStyle" style="position: absolute; background-color: transparent;z-index:1 "></canvas> <canvas id="canvasPaintCI_' + windowviewid + '" ng-click="FreeStylePaint($event)" width="1340" height="325" class="canvas-annotationStyle1" style="position: absolute;z-index:0;"></canvas></div>' + | ||
822 | + '<div class="col-sm-12 img-thumbnail" align="center">' + | ||
823 | + '<img src="' + selectedCIImage + '" alt="" title="" class="img-responsive "><div class="col-sm-12 well img-subtitle">' + | ||
824 | + '<div align="left" id="sid"><p>' + selectedImageCISummary + '</p></div><button id="btnTxtOnOff_' + windowviewid + '" class="btn btn-primary pull-right">Text Off</button>' + | ||
825 | + '<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 });$("#'+ $scope.jsPanelID+'").css("width", "100%"); }$("#btnTxtOnOff_' + windowviewid + '").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>' + | ||
826 | + '</div></div>', | ||
827 | + title: $rootScope.getLocalStorageValue("currentViewTitle"), | ||
828 | + position: { | ||
829 | + top: 70, | ||
830 | + left: 15, | ||
831 | + }, | ||
832 | + | ||
833 | + size: { width: $(window).outerWidth() - 30, height: $(window).outerHeight() - 125 }, | ||
643 | 834 | ||
644 | - $rootScope.isLoading = true; | ||
645 | - $('#spinner').css('visibility', 'visible'); | ||
646 | - $scope.voId = $rootScope.getLocalStorageValue("currentBodyViewId"); | ||
647 | - | ||
648 | - var counter = 1; | ||
649 | - var tittle = $rootScope.getLocalStorageValue("currentViewTitleFromJson"); | ||
650 | - localStorage.setItem("currentViewTitle", tittle); | ||
651 | - | 835 | + }); |
652 | 836 | ||
653 | - var promise = DataService.getJson('~/../content/data/json/ci/ci_dat_contentlist.json') | ||
654 | - promise.then( | ||
655 | - function (result) { | ||
656 | - $scope.CIllustrationData = result; | ||
657 | - $scope.CIlistViewData = $scope.CIllustrationData.root.CIData; | ||
658 | - | ||
659 | - var clickedCIImage = []; | ||
660 | - clickedCIImage = new jinqJs() | ||
661 | - .from($scope.CIlistViewData) | ||
662 | - .where('_id == ' + $scope.voId) | ||
663 | - .select('_contentImage'); | ||
664 | - | ||
665 | - // store image for export | ||
666 | - var tittle = $rootScope.getLocalStorageValue("currentViewTitle"); | ||
667 | - $rootScope.StoreTitleName(tittle); | ||
668 | - $rootScope.StoreOrgImageName(clickedCIImage[0]._contentImage); | ||
669 | - | ||
670 | - | ||
671 | - $scope.clickedCIImage = "~/../content/images/ci/images/" + clickedCIImage[0]._contentImage; | ||
672 | - | ||
673 | - var clickedCISummary = []; | ||
674 | - clickedCISummary = new jinqJs() | ||
675 | - .from($scope.CIlistViewData) | ||
676 | - .where('_id == ' + $scope.voId) | ||
677 | - .select('_Summary'); | ||
678 | - | ||
679 | - $scope.clickedCISummary = clickedCISummary[0]._Summary | ||
680 | - | ||
681 | - if (clickedCIImage.length > 0 && clickedCISummary.length > 0) { | ||
682 | - | ||
683 | - $.jsPanel({ | ||
684 | - id: 'ciImagePanel', | ||
685 | - selector: '.ciView', | ||
686 | - theme: 'success', | ||
687 | - currentController: 'CIController', | ||
688 | - parentSlug: 'clinical-illustrations', | ||
689 | - content: '<div class="row" id="canvasDiv"><div style="align:left;"><canvas id="canvas" ng-click="onDrawingCanvasClick($event)" width="1340" height="325" class="canvas-annotationStyle" style="position: absolute; background-color: transparent;z-index:1 "></canvas> <canvas id="canvasPaint" ng-click="FreeStylePaint($event)" width="1340" height="325" class="canvas-annotationStyle1" style="position: absolute;z-index:0;"></canvas></div>' + | ||
690 | - '<div class="col-sm-12 img-thumbnail" align="center">' + | ||
691 | - '<img src="' + $scope.clickedCIImage + '" alt="" title="" class="img-responsive "><div class="col-sm-12 well img-subtitle">' + | ||
692 | - '<div align="left" id="sid"><p>' + $scope.clickedCISummary + '</p></div><button id="btnTxtOnOff" class="btn btn-primary pull-right">Text Off</button>' + | ||
693 | - '<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 });$("#ciImagePanel").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>' + | ||
694 | - '</div></div>', | ||
695 | - title: $rootScope.getLocalStorageValue("currentViewTitle"), | ||
696 | - position: { | ||
697 | - top: 70, | ||
698 | - left: 15, | ||
699 | - }, | ||
700 | - | ||
701 | - size: { width: $(window).outerWidth() - 30, height: $(window).outerHeight() - 125 }, | ||
702 | - | ||
703 | - }); | ||
704 | - | ||
705 | - | ||
706 | - $('#canvasDiv img').load(function () { | ||
707 | - | ||
708 | - $rootScope.isLoading = false; | ||
709 | - $('#spinner').css('visibility', 'hidden'); | ||
710 | - }); | ||
711 | - | ||
712 | - $rootScope.currentSlug = 'clinical-illustrations-detail'; | ||
713 | - | ||
714 | - $rootScope.openViews.push( | ||
715 | - { | ||
716 | - "module": $rootScope.currentActiveModuleTitle, "bodyView": tittle, "state": 'max', "BodyViewId": $rootScope.currentBodyViewId, | ||
717 | - "slug": $rootScope.currentSlug | ||
718 | - }); | ||
719 | - | ||
720 | - | ||
721 | - $("#ciImagePanel .img-thumbnail").css("height", $("#ciImagePanel .jsPanel-content").height()); | ||
722 | - var jspContentHeight = $('.jsPanel-content').height(); | ||
723 | - | ||
724 | - // console.log($rootScope.OpenAdamImages); | ||
725 | - $('#CIView').css("height", $(window).outerHeight() - 65); | ||
726 | 837 | ||
727 | - $('#CIView').css("width", $(window).outerWidth() - 15); | 838 | + $('#canvasDivCI_' + windowviewid + ' img').load(function () { |
728 | 839 | ||
729 | - var canvasDIvHeight = parseInt($('#aiImagePanel').outerHeight()) - 90; | 840 | + $rootScope.isLoading = false; |
841 | + $('#spinner').css('visibility', 'hidden'); | ||
842 | + }); | ||
730 | 843 | ||
731 | - $('#canvasDiv').css('height', canvasDIvHeight); | ||
732 | - } | 844 | + $scope.SetCIwindowStoreData(windowviewid, 'currentSlug', 'clinical-illustrations-detail'); |
733 | 845 | ||
846 | + $rootScope.openViews.push( | ||
847 | + { | ||
848 | + "module": $rootScope.currentActiveModuleTitle, "bodyView": tittle, "state": 'max', "BodyViewId": imageId, | ||
849 | + "slug": $scope.GetCIwindowStoreData(windowviewid, 'currentSlug') | ||
850 | + }); | ||
734 | 851 | ||
735 | - }, | ||
736 | - function (error) { | ||
737 | - // handle errors here | ||
738 | - console.log(' $scope.CIllustrationData = ' + error.statusText); | ||
739 | - } | ||
740 | 852 | ||
741 | - ); | 853 | + $("#" + $scope.jsPanelID + " .img-thumbnail").css("height", $("#" + $scope.jsPanelID + " .jsPanel-content").height()); |
854 | + var jspContentHeight = $('.jsPanel-content').height(); | ||
742 | 855 | ||
856 | + // console.log($rootScope.OpenAdamImages); | ||
857 | + $('#CIView').css("height", $(window).outerHeight() - 65); | ||
858 | + | ||
859 | + $('#CIView').css("width", $(window).outerWidth() - 15); | ||
860 | + | ||
861 | + var canvasDIvHeight = parseInt($("#" + $scope.jsPanelID).outerHeight()) - 90; | ||
862 | + | ||
863 | + $('#canvasDivCI_' + windowviewid).css('height', canvasDIvHeight); | ||
864 | + | ||
743 | } | 865 | } |
744 | 866 | ||
745 | $scope.$on('annotationToolEvent', function (event, data) { | 867 | $scope.$on('annotationToolEvent', function (event, data) { |
@@ -756,53 +878,42 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | @@ -756,53 +878,42 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | ||
756 | $rootScope.FreeStylePaint(); | 878 | $rootScope.FreeStylePaint(); |
757 | }); | 879 | }); |
758 | 880 | ||
759 | - $scope.ReloadListViewImageDiv = function (id) { | 881 | + $scope.ReloadListViewImageDiv = function (id, windowviewid) { |
760 | //console.log(id); | 882 | //console.log(id); |
761 | $scope.idSelected = id; | 883 | $scope.idSelected = id; |
762 | $scope.hiderow = true; | 884 | $scope.hiderow = true; |
763 | 885 | ||
764 | - var promise = DataService.getJson('~/../content/data/json/ci/ci_dat_contentlist.json') | ||
765 | - promise.then( | ||
766 | - function (result) { | ||
767 | - $scope.IllustrationData = result; | 886 | + |
887 | + var IllustrationData = $scope.GetCIwindowStoreData(windowviewid, 'IllustrationData'); | ||
768 | 888 | ||
769 | - var SelectedCIthumbImage = []; | ||
770 | - SelectedCIthumbImage = new jinqJs() | ||
771 | - .from($scope.IllustrationData.root.CIData) | ||
772 | - .where('_id = ' + id) | ||
773 | - .select('_ThumbnailImage', '_Summary', '_id', '_Title'); | 889 | + var SelectedCIthumbImage = []; |
890 | + SelectedCIthumbImage = new jinqJs() | ||
891 | + .from(IllustrationData) | ||
892 | + .where('_id = ' + id) | ||
893 | + .select('_ThumbnailImage', '_Summary', '_id', '_Title'); | ||
774 | 894 | ||
775 | - $scope.SelectedCIthumbImage = "~/../content/images/ci/thumbnails/" + SelectedCIthumbImage[0]._ThumbnailImage; | ||
776 | - $scope.SelectedCISummary = SelectedCIthumbImage[0]._Summary; | ||
777 | - $scope.SelectedCIId = SelectedCIthumbImage[0]._id; | ||
778 | - $scope.SelectedCITitle = SelectedCIthumbImage[0]._Title; | 895 | + $scope.SelectedCIthumbImage = "~/../content/images/ci/thumbnails/" + SelectedCIthumbImage[0]._ThumbnailImage; |
896 | + $scope.SelectedCISummary = SelectedCIthumbImage[0]._Summary; | ||
897 | + $scope.SelectedCIId = SelectedCIthumbImage[0]._id; | ||
898 | + $scope.SelectedCITitle = SelectedCIthumbImage[0]._Title; | ||
779 | 899 | ||
780 | - //Set the scroll position of the tablebody to show selected row. | 900 | + //Set the scroll position of the tablebody to show selected row. |
781 | 901 | ||
782 | - var curCIListViewScroll = $rootScope.getLocalStorageValue("CIListViewScroll"); | ||
783 | - if (typeof (curCIListViewScroll) !== "undefined" && curCIListViewScroll !== null && curCIListViewScroll !== '') { | ||
784 | - if (typeof InstallTrigger !== 'undefined') | ||
785 | - { | 902 | + var curCIListViewScroll = $rootScope.getLocalStorageValue("CIListViewScroll"); |
903 | + if (typeof (curCIListViewScroll) !== "undefined" && curCIListViewScroll !== null && curCIListViewScroll !== '') { | ||
904 | + if (typeof InstallTrigger !== 'undefined') | ||
905 | + { | ||
786 | 906 | ||
787 | - $('#ListViewDiv').animate({ scrollTop: $rootScope.getLocalStorageValue("CIListViewScroll") }); | ||
788 | - } | ||
789 | - else | ||
790 | - { | 907 | + $('#ListViewDiv').animate({ scrollTop: $rootScope.getLocalStorageValue("CIListViewScroll") }); |
908 | + } | ||
909 | + else | ||
910 | + { | ||
791 | 911 | ||
792 | - $('#ListViewDiv').scrollTop($rootScope.getLocalStorageValue("CIListViewScroll")); | ||
793 | - } | 912 | + $('#ListViewDiv').scrollTop($rootScope.getLocalStorageValue("CIListViewScroll")); |
913 | + } | ||
794 | 914 | ||
795 | - } | ||
796 | - //else { | ||
797 | - // $('#ListViewDiv').scrollTop(0); | ||
798 | - //} | ||
799 | - | ||
800 | - }, | ||
801 | - function (error) { | ||
802 | - // handle errors here | ||
803 | - console.log(' $scope.AnimationData = ' + error.statusText); | ||
804 | - } | ||
805 | - ); | 915 | + } |
916 | + | ||
806 | }; | 917 | }; |
807 | 918 | ||
808 | $scope.hideListViewDiv = function () { | 919 | $scope.hideListViewDiv = function () { |
400-SOURCECODE/AIAHTML5.Web/app/views/ci/clinical-illustrations-detail.html
1 | <div> | 1 | <div> |
2 | <div ng-include="aap/widget/MainMenu.html"></div> | 2 | <div ng-include="aap/widget/MainMenu.html"></div> |
3 | - <div ng-init="openBodyView()" id="CIView" class="ciView" ng-controller="CIController" style=" "></div> <!--position: absolute !important;--> | 3 | + <div ng-init="openBodyViewMain()" id="CIView" class="ciView" ng-controller="CIController" style=" "></div> <!--position: absolute !important;--> |
4 | 4 | ||
5 | 5 | ||
6 | </div> | 6 | </div> |