Commit b65ca6a8e21ebdf41b796a3dba69cad003bc7e18
1 parent
b3db3c0a
updating CI for curriculum builder
Showing
1 changed file
with
306 additions
and
248 deletions
400-SOURCECODE/AIAHTML5.Web/app/controllers/CIController.js
1 | AIA.controller("CIController", ["$scope", "$window", "$rootScope", "$compile", "$http", "$log", "$location", "$timeout", "pages", "BodyRegions", "BodySystems", "ViewOrientations", "ImageTypes", "MedicalSpecialties", "DataService", | 1 | AIA.controller("CIController", ["$scope", "$window", "$rootScope", "$compile", "$http", "$log", "$location", "$timeout", "pages", "BodyRegions", "BodySystems", "ViewOrientations", "ImageTypes", "MedicalSpecialties", "DataService", |
2 | function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout, pages, BodyRegions, BodySystems, ViewOrientations, ImageTypes, MedicalSpecialties, DataService) { | 2 | function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout, pages, BodyRegions, BodySystems, ViewOrientations, ImageTypes, MedicalSpecialties, DataService) { |
3 | - // $rootScope.currentActiveModuleTitle = pages[3].name; | ||
4 | - $scope.showTabButton = true; | ||
5 | - $scope.IllustrationData; | 3 | + |
4 | + | ||
6 | $scope.CIAllBodyRegion = []; | 5 | $scope.CIAllBodyRegion = []; |
7 | $scope.CIAllBodySystem = []; | 6 | $scope.CIAllBodySystem = []; |
8 | $scope.CIAllOrientation = []; | 7 | $scope.CIAllOrientation = []; |
9 | $scope.CIAllImageType = []; | 8 | $scope.CIAllImageType = []; |
10 | $scope.CIAllSpeciality = []; | 9 | $scope.CIAllSpeciality = []; |
10 | + $scope.selectedCIListViewData = []; | ||
11 | + | ||
12 | + //************************************ | ||
13 | + | ||
14 | + $scope.showTabButton = true; | ||
15 | + // $scope.IllustrationData; | ||
16 | + | ||
11 | $scope.searchCIListViewData = []; | 17 | $scope.searchCIListViewData = []; |
12 | $scope.SelectedCIthumbImage = []; | 18 | $scope.SelectedCIthumbImage = []; |
13 | $scope.SelectedCIImage = []; | 19 | $scope.SelectedCIImage = []; |
14 | $scope.SelectedCISummary = []; | 20 | $scope.SelectedCISummary = []; |
15 | $scope.SelectedCIId = []; | 21 | $scope.SelectedCIId = []; |
16 | $scope.SelectedCITitle = []; | 22 | $scope.SelectedCITitle = []; |
17 | - $scope.selectedCIListViewData = []; | 23 | + |
18 | $scope.filterstring = false; | 24 | $scope.filterstring = false; |
19 | $scope.idSelected; | 25 | $scope.idSelected; |
20 | $scope.srollListView; | 26 | $scope.srollListView; |
@@ -30,8 +36,138 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | @@ -30,8 +36,138 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | ||
30 | $scope.activeTab = tabToSet; | 36 | $scope.activeTab = tabToSet; |
31 | localStorage.setItem("currentCITabView", $scope.activeTab); | 37 | localStorage.setItem("currentCITabView", $scope.activeTab); |
32 | }; | 38 | }; |
39 | + | ||
40 | + $scope.initializeCIWindowData = function (windowviewid, isOpenWithExistsModule, cbwindowid) { | ||
41 | + if (isOpenWithExistsModule || cbwindowid == 0) { | ||
42 | + if ($rootScope.CIWindowData != undefined) { | ||
43 | + $rootScope.CIWindowData.length = 0; | ||
44 | + } | ||
45 | + else { | ||
46 | + $rootScope.CIWindowData = []; | ||
47 | + } | ||
48 | + | ||
49 | + $rootScope.CIWindowData.push( | ||
50 | + { | ||
51 | + 'multiwinid': windowviewid, | ||
52 | + 'IllustrationData':[], | ||
53 | + 'moduleName': '', | ||
54 | + 'currentViewTitle': '', | ||
55 | + 'parentSlugName': '', | ||
56 | + 'sliderPercentValue': 1, | ||
57 | + 'imageId': '', | ||
58 | + 'imageName': '', | ||
59 | + 'bodySystemName': '', | ||
60 | + 'OpenItemImagePath': '', | ||
61 | + 'isBodySystemSelected': false, | ||
62 | + 'typeOfEvent': '', | ||
63 | + 'selectedSystemName': null, | ||
64 | + 'SelectedSystemID': 0 | ||
65 | + | ||
66 | + }); | ||
67 | + | ||
68 | + } | ||
69 | + else { | ||
70 | + var isNewWindow = true; | ||
71 | + for (var k = 0; k < $rootScope.CIWindowData.length; k++) { | ||
72 | + if ($rootScope.CIWindowData[k].multiwinid == windowviewid) { | ||
73 | + isNewWindow = false; | ||
74 | + break; | ||
75 | + } | ||
76 | + } | ||
77 | + | ||
78 | + if (isNewWindow) { | ||
79 | + $rootScope.CIWindowData.push( | ||
80 | + { | ||
81 | + 'multiwinid': windowviewid, | ||
82 | + 'IllustrationData': [], | ||
83 | + 'moduleName': '', | ||
84 | + 'currentViewTitle': '', | ||
85 | + 'parentSlugName': '', | ||
86 | + 'sliderPercentValue': 1, | ||
87 | + 'imageId': '', | ||
88 | + 'imageName': '', | ||
89 | + 'bodySystemName': '', | ||
90 | + 'OpenItemImagePath': '', | ||
91 | + 'isBodySystemSelected': false, | ||
92 | + 'typeOfEvent': '', | ||
93 | + 'selectedSystemName': null, | ||
94 | + 'SelectedSystemID': 0 | ||
95 | + | ||
96 | + }); | ||
97 | + | ||
98 | + } | ||
99 | + } | ||
100 | + } | ||
101 | + | ||
102 | + $scope.GetCIwindowStoreData = function (windowviewid, keyname) { | ||
103 | + for (var x = 0 ; x < $rootScope.CIWindowData.length; x++) { | ||
104 | + | ||
105 | + if ($rootScope.CIWindowData[x].multiwinid == windowviewid) { | ||
106 | + return $rootScope.CIWindowData[x][keyname]; | ||
107 | + } | ||
108 | + } | ||
109 | + } | ||
110 | + | ||
111 | + $scope.SetCIwindowStoreData = function (windowviewid, keyname, value) { | ||
112 | + for (var x = 0 ; x < $rootScope.CIWindowData.length; x++) { | ||
113 | + | ||
114 | + if ($rootScope.CIWindowData[x].multiwinid == windowviewid) { | ||
115 | + $rootScope.CIWindowData[x][keyname] = value; | ||
116 | + } | ||
117 | + } | ||
118 | + } | ||
119 | + | ||
120 | + $rootScope.GetCIWindowId = function () { | ||
121 | + // handle for single window | ||
122 | + if ($rootScope.CIWindowData.length > 0) { | ||
123 | + for (var x = 0 ; x < $rootScope.CIWindowData.length; x++) { | ||
124 | + | ||
125 | + return $rootScope.CIWindowData[x].multiwinid; | ||
126 | + } | ||
127 | + } | ||
128 | + else return 0; | ||
129 | + } | ||
130 | + | ||
131 | + $scope.DisableUI = function () { | ||
132 | + | ||
133 | + var ciImagePanelConetent = document.getElementsByClassName("jsPanel-content"); | ||
134 | + for (var i = 0; i < ciImagePanelConetent.length; i++) { | ||
135 | + ciImagePanelConetent[i].style.pointerEvents = "none"; | ||
136 | + ciImagePanelConetent[i].style.opacity = "0.7"; | ||
137 | + | ||
138 | + } | ||
139 | + $rootScope.isLoading = true; | ||
140 | + $('#spinner').css('visibility', 'visible'); | ||
141 | + | ||
142 | + // CB module disable all | ||
143 | + $('#CBDetailPageDiv').css('pointer-events', 'none'); | ||
144 | + $('#CBDetailPageDiv').css('opacity', '0.7'); | ||
145 | + } | ||
146 | + | ||
147 | + $scope.EnableUI = function () { | ||
148 | + | ||
149 | + var ciImagePanelConetent = document.getElementsByClassName("jsPanel-content"); | ||
150 | + for (var i = 0; i < ciImagePanelConetent.length; i++) { | ||
151 | + ciImagePanelConetent[i].style.pointerEvents = "auto"; | ||
152 | + ciImagePanelConetent[i].style.opacity = "1"; | ||
153 | + } | ||
154 | + | ||
155 | + $rootScope.isLoading = false; | ||
156 | + $('#spinner').css('visibility', 'hidden'); | ||
157 | + // CB module enable all | ||
158 | + $('#CBDetailPageDiv').css('pointer-events', 'auto'); | ||
159 | + $('#CBDetailPageDiv').css('opacity', '1'); | ||
160 | + } | ||
161 | + | ||
33 | $scope.loadAIModuleById = function (moduleId) { | 162 | $scope.loadAIModuleById = function (moduleId) { |
34 | 163 | ||
164 | + $rootScope.isCallFromOtherModule = undefined; | ||
165 | + | ||
166 | + $rootScope.MULTI_VIEW_ID += 1 | ||
167 | + | ||
168 | + $scope.initializeCIWindowData($rootScope.MULTI_VIEW_ID, true, undefined); | ||
169 | + | ||
170 | + $scope.DisableUI(); | ||
35 | 171 | ||
36 | if ($rootScope.refreshcheck == null) { | 172 | if ($rootScope.refreshcheck == null) { |
37 | $location.path('/'); | 173 | $location.path('/'); |
@@ -50,7 +186,9 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | @@ -50,7 +186,9 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | ||
50 | $rootScope.currentActiveModuleTitle = selectedModuleName; | 186 | $rootScope.currentActiveModuleTitle = selectedModuleName; |
51 | }) | 187 | }) |
52 | 188 | ||
53 | - $scope.LoadCIJsonData(); | 189 | + $scope.SetCIwindowStoreData($rootScope.MULTI_VIEW_ID, 'moduleName', "Clinical Illustrations"); |
190 | + | ||
191 | + $scope.LoadCIJsonData($rootScope.MULTI_VIEW_ID); | ||
54 | 192 | ||
55 | $scope.CIAllBodyRegion = BodyRegions; | 193 | $scope.CIAllBodyRegion = BodyRegions; |
56 | $scope.CIAllBodySystem = BodySystems; | 194 | $scope.CIAllBodySystem = BodySystems; |
@@ -63,28 +201,31 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | @@ -63,28 +201,31 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | ||
63 | 201 | ||
64 | //set the local storage | 202 | //set the local storage |
65 | 203 | ||
204 | + setTimeout(function () { | ||
66 | var curtab = $rootScope.getLocalStorageValue("currentCITabView"); | 205 | var curtab = $rootScope.getLocalStorageValue("currentCITabView"); |
67 | if (curtab == 2) { | 206 | if (curtab == 2) { |
68 | $scope.setActiveTab(2); | 207 | $scope.setActiveTab(2); |
69 | var curSelectedRowId = $rootScope.getLocalStorageValue("CISelectedRowId"); | 208 | var curSelectedRowId = $rootScope.getLocalStorageValue("CISelectedRowId"); |
70 | if (typeof (curSelectedRowId) !== "undefined" && curSelectedRowId !== null && curSelectedRowId !== '') { | 209 | if (typeof (curSelectedRowId) !== "undefined" && curSelectedRowId !== null && curSelectedRowId !== '') { |
71 | - $scope.reRunSearchOnLoad(); | 210 | + $scope.reRunSearchOnLoad($rootScope.MULTI_VIEW_ID); |
72 | $scope.idSelected = curSelectedRowId; | 211 | $scope.idSelected = curSelectedRowId; |
73 | $scope.ReloadListViewImageDiv($scope.idSelected); | 212 | $scope.ReloadListViewImageDiv($scope.idSelected); |
74 | } | 213 | } |
75 | else { | 214 | else { |
76 | - $scope.reRunSearchOnLoad() | 215 | + $scope.reRunSearchOnLoad($rootScope.MULTI_VIEW_ID) |
77 | $scope.idSelected = ''; | 216 | $scope.idSelected = ''; |
78 | } | 217 | } |
79 | } | 218 | } |
80 | else { | 219 | else { |
81 | $scope.setActiveTab(1); | 220 | $scope.setActiveTab(1); |
82 | - $scope.reRunSearchOnLoad(); | 221 | + $scope.reRunSearchOnLoad($rootScope.MULTI_VIEW_ID); |
83 | 222 | ||
84 | } | 223 | } |
224 | + | ||
225 | + }, 200); | ||
85 | } | 226 | } |
86 | 227 | ||
87 | - $scope.reRunSearchOnLoad = function () { | 228 | + $scope.reRunSearchOnLoad = function (windowviewid) { |
88 | 229 | ||
89 | var curBodyRegion = $rootScope.getLocalStorageValue("CICurBodyRegion"); | 230 | var curBodyRegion = $rootScope.getLocalStorageValue("CICurBodyRegion"); |
90 | if (typeof (curBodyRegion) !== "undefined" && curBodyRegion !== null && curBodyRegion !== '') { | 231 | if (typeof (curBodyRegion) !== "undefined" && curBodyRegion !== null && curBodyRegion !== '') { |
@@ -128,7 +269,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | @@ -128,7 +269,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | ||
128 | 269 | ||
129 | 270 | ||
130 | if ($scope.query.selectedbodyregion == "" && $scope.query.selectedbodysystem == "" && $scope.query.selectedorientation == "" && $scope.query.selectedimagetype == "" && $scope.query.selectedspecialty == "") { | 271 | if ($scope.query.selectedbodyregion == "" && $scope.query.selectedbodysystem == "" && $scope.query.selectedorientation == "" && $scope.query.selectedimagetype == "" && $scope.query.selectedspecialty == "") { |
131 | - $scope.loadAllCI(); | 272 | + $scope.loadAllCI(windowviewid); |
132 | } | 273 | } |
133 | else { | 274 | else { |
134 | $scope.ApplySearch($scope.query); | 275 | $scope.ApplySearch($scope.query); |
@@ -136,19 +277,24 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | @@ -136,19 +277,24 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | ||
136 | 277 | ||
137 | } | 278 | } |
138 | 279 | ||
139 | - $scope.LoadCIJsonData = function () { | 280 | + $scope.LoadCIJsonData = function (windowviewid) { |
140 | 281 | ||
141 | var promise = DataService.getJson('~/../content/data/json/ci/ci_dat_contentlist.json') | 282 | var promise = DataService.getJson('~/../content/data/json/ci/ci_dat_contentlist.json') |
142 | promise.then( | 283 | promise.then( |
143 | function (result) { | 284 | function (result) { |
144 | - $scope.IllustrationData = result; | ||
145 | - $scope.selectedCIListViewData = new jinqJs() | ||
146 | - .from($scope.IllustrationData.root.CIData) | 285 | + |
286 | + var IllustrationData = new jinqJs() | ||
287 | + .from(result.root.CIData) | ||
147 | .orderBy([{ field: '_Title', sort: 'asc' }]) | 288 | .orderBy([{ field: '_Title', sort: 'asc' }]) |
148 | .select(); | 289 | .select(); |
149 | 290 | ||
291 | + $scope.SetCIwindowStoreData(windowviewid, 'IllustrationData', IllustrationData); | ||
292 | + | ||
293 | + $scope.selectedCIListViewData = IllustrationData; | ||
294 | + | ||
150 | }, | 295 | }, |
151 | function (error) { | 296 | function (error) { |
297 | + $scope.EnableUI(); | ||
152 | // handle errors here | 298 | // handle errors here |
153 | console.log(' $scope.IllustrationData = ' + error.statusText); | 299 | console.log(' $scope.IllustrationData = ' + error.statusText); |
154 | } | 300 | } |
@@ -157,63 +303,28 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | @@ -157,63 +303,28 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | ||
157 | 303 | ||
158 | }; | 304 | }; |
159 | 305 | ||
160 | - $scope.loadAllCI = function () { | ||
161 | - $('#ciSpinner').css('visibility', 'visible'); | ||
162 | - $('#ciSpinner').css('zIndex', '20000'); | ||
163 | - var promise = DataService.getJson('~/../content/data/json/ci/ci_dat_contentlist.json') | ||
164 | - promise.then( | ||
165 | - function (result) { | ||
166 | - $scope.IllustrationData = result; | ||
167 | - | ||
168 | - $scope.selectedCIListViewData = new jinqJs() | ||
169 | - .from($scope.IllustrationData.root.CIData) | ||
170 | - .orderBy([{ field: '_Title', sort: 'asc' }]) | ||
171 | - .select(); | ||
172 | - | ||
173 | - // console.log($scope.selectedCIListViewData); | ||
174 | - | ||
175 | - | ||
176 | - | ||
177 | - $('#grid-view').empty(); | ||
178 | - var $e1 = $('<ul><li ng-repeat="value in selectedCIListViewData" class="col-sm-3 col-md-2"><div id="{{value._id}}" title = "{{value._Title}}" class="GridViewDataDivHeight" data-ng-click="openView($event)">' | ||
179 | - + '<div class="thumbnail" >' | ||
180 | - + '<img id="{{value._Title}}" ng-src="~/../content/images/ci/thumbnails/{{value._ThumbnailImage}}" >'//alt="{{value._Title}}" >' | ||
181 | - + '<div class="caption"><p> {{value._Title}}</p></div></a></div></div></li></ul>').appendTo('#grid-view'); | ||
182 | - $compile($e1)($scope); | ||
183 | - //angular.forEach($scope.selectedCIListViewData, function (value, key) { | ||
184 | - // $scope.imagePath = "~/../content/images/ci/thumbnails/" + value._ThumbnailImage; | ||
185 | - | ||
186 | - // var $el = $('<div id="' + value._id + '" class="col-sm-3 col-md-2" title = "' + value._Title + '" data-ng-click="openView($event)">' | ||
187 | - // + '<div class="thumbnail" >' | ||
188 | - // + '<img id="' + value._Title + '"ng-src="' + $scope.imagePath + '" alt="" title="" >' | ||
189 | - // + '<div class="caption"><p>' + value._Title + '</p></div></a></div></div>').appendTo('#grid-view'); | ||
190 | - | 306 | + $scope.loadAllCI = function (windowviewid) { |
191 | 307 | ||
192 | - // $compile($el)($scope); | 308 | + $scope.selectedCIListViewData = $scope.GetCIwindowStoreData(windowviewid, 'IllustrationData'); |
193 | 309 | ||
194 | - // $(".sidebar").mCustomScrollbar({ | ||
195 | - // autoHideScrollbar: true, | ||
196 | - // //theme:"rounded" | ||
197 | - // }); | ||
198 | - | ||
199 | - //}); | ||
200 | - $timeout(function () | ||
201 | - { | ||
202 | - $('#' + $rootScope.getLocalStorageValue("currentBodyViewId")).find('.thumbnail').addClass('HightLightThumbnail'); | ||
203 | - if ($rootScope.getLocalStorageValue('CIGridViewScroll') !== null && $location.url() == "/clinical-illustrations") { | ||
204 | - $('html, body').animate({ scrollTop: $rootScope.getLocalStorageValue('CIGridViewScroll') }); | ||
205 | - } | ||
206 | - }, 100); | 310 | + $('#grid-view').empty(); |
311 | + var $e1 = $('<ul><li ng-repeat="value in selectedCIListViewData" class="col-sm-3 col-md-2"><div id="{{value._id}}" title = "{{value._Title}}" class="GridViewDataDivHeight" data-ng-click="openView($event)">' | ||
312 | + + '<div class="thumbnail" >' | ||
313 | + + '<img id="{{value._Title}}" ng-src="~/../content/images/ci/thumbnails/{{value._ThumbnailImage}}" >'//alt="{{value._Title}}" >' | ||
314 | + + '<div class="caption"><p> {{value._Title}}</p></div></a></div></div></li></ul>').appendTo('#grid-view'); | ||
315 | + $compile($e1)($scope); | ||
316 | + | ||
317 | + $timeout(function () | ||
318 | + { | ||
319 | + $('#' + $rootScope.getLocalStorageValue("currentBodyViewId")).find('.thumbnail').addClass('HightLightThumbnail'); | ||
320 | + if ($rootScope.getLocalStorageValue('CIGridViewScroll') !== null && $location.url() == "/clinical-illustrations") { | ||
321 | + $('html, body').animate({ scrollTop: $rootScope.getLocalStorageValue('CIGridViewScroll') }); | ||
322 | + } | ||
323 | + }, 100); | ||
207 | 324 | ||
208 | 325 | ||
209 | - $timeout(function () { $('#ciSpinner').css('visibility', 'hidden'); }, 300); | ||
210 | - }, | ||
211 | - function (error) { | ||
212 | - // handle errors here | ||
213 | - console.log(' $scope.IllustrationData = ' + error.statusText); | ||
214 | - } | ||
215 | - ); | ||
216 | - | 326 | + $timeout(function () { $scope.EnableUI(); }, 400); |
327 | + | ||
217 | } | 328 | } |
218 | 329 | ||
219 | $scope.IsVisible = function () { | 330 | $scope.IsVisible = function () { |
@@ -262,7 +373,10 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | @@ -262,7 +373,10 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | ||
262 | } | 373 | } |
263 | }; | 374 | }; |
264 | 375 | ||
265 | - $scope.Reset = function (query) { | 376 | + $scope.Reset = function (query, windowviewid) { |
377 | + | ||
378 | + if (windowviewid == undefined) // call from also home controller list manager | ||
379 | + windowviewid = $rootScope.MULTI_VIEW_ID; | ||
266 | 380 | ||
267 | query.selectedbodyregion = ""; | 381 | query.selectedbodyregion = ""; |
268 | query.selectedbodysystem = ""; | 382 | query.selectedbodysystem = ""; |
@@ -291,21 +405,21 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | @@ -291,21 +405,21 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | ||
291 | $scope.searchCIListViewData.pop(); | 405 | $scope.searchCIListViewData.pop(); |
292 | } | 406 | } |
293 | 407 | ||
294 | - $scope.loadAllCI(); | 408 | + $scope.loadAllCI(windowviewid); |
295 | 409 | ||
296 | } | 410 | } |
297 | 411 | ||
298 | - $scope.ApplySearch = function (query) { | 412 | + $scope.ApplySearch = function (query, windowviewid) { |
299 | 413 | ||
300 | - | ||
301 | - $scope.filterstring = true; | ||
302 | - | ||
303 | - while ($scope.searchCIListViewData.length) { | ||
304 | - $scope.searchCIListViewData.pop(); | 414 | + if (windowviewid == undefined) { |
415 | + windowviewid = $rootScope.MULTI_VIEW_ID; | ||
305 | } | 416 | } |
417 | + | ||
418 | + $scope.DisableUI(); | ||
306 | 419 | ||
307 | - | 420 | + $scope.filterstring = true; |
308 | 421 | ||
422 | + | ||
309 | filtercount = 0; | 423 | filtercount = 0; |
310 | if (typeof (query.selectedbodyregion) !== "undefined" && (query.selectedbodyregion !== null && query.selectedbodyregion !== "")) { | 424 | if (typeof (query.selectedbodyregion) !== "undefined" && (query.selectedbodyregion !== null && query.selectedbodyregion !== "")) { |
311 | filtercount = filtercount + 1; | 425 | filtercount = filtercount + 1; |
@@ -357,139 +471,126 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | @@ -357,139 +471,126 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | ||
357 | 471 | ||
358 | } | 472 | } |
359 | 473 | ||
474 | + $scope.selectedCIListViewData = $scope.GetCIwindowStoreData(windowviewid, 'IllustrationData'); | ||
360 | 475 | ||
361 | - var promise = DataService.getJson('~/../content/data/json/ci/ci_dat_contentlist.json') | ||
362 | - promise.then( | ||
363 | - function (result) { | ||
364 | - $scope.IllustrationData = result; | ||
365 | - | ||
366 | - $scope.selectedCIListViewData = new jinqJs() | ||
367 | - .from($scope.IllustrationData.root.CIData) | ||
368 | - .orderBy([{ field: '_Title', sort: 'asc' }]) | ||
369 | - .select(); | ||
370 | - | ||
371 | - $('#grid-view').empty(); | ||
372 | - | ||
373 | - angular.forEach($scope.selectedCIListViewData, function (value, key) { | ||
374 | - | ||
375 | - var selectimg = true; | ||
376 | - var count = 0; | 476 | + $('#grid-view').empty(); |
377 | 477 | ||
478 | + angular.forEach($scope.selectedCIListViewData, function (value, key) { | ||
378 | 479 | ||
379 | - if (typeof (query.selectedbodyregion) !== "undefined" && (query.selectedbodyregion !== null && query.selectedbodyregion !== "")) { | ||
380 | - var posbodyregion = value._BodyRegion.indexOf((query.selectedbodyregion.trim())); | ||
381 | - if (posbodyregion > -1) { | ||
382 | - selectimg = true; | ||
383 | - count = count + 1; | 480 | + var selectimg = true; |
481 | + var count = 0; | ||
384 | 482 | ||
385 | - } | ||
386 | - else { | ||
387 | - selectimg = false; | ||
388 | - count = count - 1; | ||
389 | - } | ||
390 | 483 | ||
391 | - } | ||
392 | - | ||
393 | - if (typeof (query.selectedbodysystem) !== "undefined" && (query.selectedbodysystem !== null && query.selectedbodysystem !== "")) { | ||
394 | - var posbodysystem = value._BodySystem.indexOf(query.selectedbodysystem); | ||
395 | - if (posbodysystem > -1) { | ||
396 | - count = count + 1; | ||
397 | - selectimg = true; | ||
398 | - } else { | ||
399 | - selectimg = false; | ||
400 | - count = count - 1; | ||
401 | - } | ||
402 | - } | ||
403 | - | ||
404 | - if (typeof (query.selectedorientation) !== "undefined" && (query.selectedorientation !== null && query.selectedorientation !== "")) { | ||
405 | - var posorientation = value._ViewOrientation.indexOf(query.selectedorientation); | ||
406 | - if (posorientation > -1) { | ||
407 | - count = count + 1; | ||
408 | - selectimg = true; | ||
409 | - | ||
410 | - } else { | ||
411 | - selectimg = false; | ||
412 | - count = count - 1; | ||
413 | - } | ||
414 | - | ||
415 | - } | ||
416 | - | ||
417 | - if (typeof (query.selectedimagetype) !== "undefined" && (query.selectedimagetype !== null && query.selectedimagetype !== "")) { | ||
418 | - var posimagetype = value._ImageType.indexOf(query.selectedimagetype); | ||
419 | - if (posimagetype > -1) { | ||
420 | - count = count + 1; | ||
421 | - selectimg = true; | ||
422 | - | ||
423 | - } else { | ||
424 | - selectimg = false; | ||
425 | - count = count - 1; | ||
426 | - } | ||
427 | - | ||
428 | - } | ||
429 | - | ||
430 | - if (typeof (query.selectedspecialty) !== "undefined" && (query.selectedspecialty !== null && query.selectedspecialty !== "")) { | ||
431 | - var posspeciality = value._MedicalSpecialty.indexOf(query.selectedspecialty); | ||
432 | - if (posspeciality > -1) { | ||
433 | - count = count + 1; | ||
434 | - selectimg = true; | ||
435 | - } else { | ||
436 | - selectimg = false; | ||
437 | - count = count - 1; | ||
438 | - } | ||
439 | - | ||
440 | - } | ||
441 | - | ||
442 | - if (selectimg === true && count >= filtercount) { | ||
443 | - | ||
444 | - | ||
445 | - $scope.imagePath = "~/../content/images/ci/thumbnails/" + value._ThumbnailImage; | ||
446 | - | ||
447 | - var $el = $('<div id="' + value._id + '" class="col-sm-3 col-md-2" title = "' + value._Title + '" data-ng-click="openView($event)">' | ||
448 | - + '<div class="thumbnail" >' | ||
449 | - + '<img id="' + value._Title + '"ng-src="' + $scope.imagePath + '" alt="" title="" >' | ||
450 | - + '<div class="caption"><p>' + value._Title + '</p></div></a></div></div>').appendTo('#grid-view'); | ||
451 | - | ||
452 | - | ||
453 | - $compile($el)($scope); | ||
454 | - | ||
455 | - $(".sidebar").mCustomScrollbar({ | ||
456 | - autoHideScrollbar: true, | ||
457 | - //theme:"rounded" | ||
458 | - }); | ||
459 | - | ||
460 | - | ||
461 | - $scope.searchCIListViewData.push( | ||
462 | - { | ||
463 | - "_id": value._id, | ||
464 | - "_ImageId": value._ImageId, | ||
465 | - "_Title": value._Title, | ||
466 | - "_contentImage": value._contentImage, | ||
467 | - "_ThumbnailImage": value._ThumbnailImage, | ||
468 | - "_BodySystem": value._BodySystem, | ||
469 | - "_BodyRegion": value._BodyRegion, | ||
470 | - "_ViewOrientation": value._ViewOrientation, | ||
471 | - "_MedicalSpecialty": value._MedicalSpecialty, | ||
472 | - "_ImageType": value._ImageType, | ||
473 | - "_Summary": value._Summary | ||
474 | - | ||
475 | - }); | ||
476 | - } | ||
477 | - }); | ||
478 | - $('table > #ListViewDiv > #searchItem').remove(); | ||
479 | - //Show Error Message in case of gridview if no data is found | ||
480 | - if ($scope.searchCIListViewData.length == 0) { | ||
481 | - 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'); | ||
482 | - $compile($el)($scope); | ||
483 | - $('table > #ListViewDiv > #searchItem').remove(); | 484 | + if (typeof (query.selectedbodyregion) !== "undefined" && (query.selectedbodyregion !== null && query.selectedbodyregion !== "")) { |
485 | + var posbodyregion = value._BodyRegion.indexOf((query.selectedbodyregion.trim())); | ||
486 | + if (posbodyregion > -1) { | ||
487 | + selectimg = true; | ||
488 | + count = count + 1; | ||
489 | + | ||
490 | + } | ||
491 | + else { | ||
492 | + selectimg = false; | ||
493 | + count = count - 1; | ||
494 | + } | ||
495 | + | ||
496 | + } | ||
497 | + | ||
498 | + if (typeof (query.selectedbodysystem) !== "undefined" && (query.selectedbodysystem !== null && query.selectedbodysystem !== "")) { | ||
499 | + var posbodysystem = value._BodySystem.indexOf(query.selectedbodysystem); | ||
500 | + if (posbodysystem > -1) { | ||
501 | + count = count + 1; | ||
502 | + selectimg = true; | ||
503 | + } else { | ||
504 | + selectimg = false; | ||
505 | + count = count - 1; | ||
506 | + } | ||
507 | + } | ||
508 | + | ||
509 | + if (typeof (query.selectedorientation) !== "undefined" && (query.selectedorientation !== null && query.selectedorientation !== "")) { | ||
510 | + var posorientation = value._ViewOrientation.indexOf(query.selectedorientation); | ||
511 | + if (posorientation > -1) { | ||
512 | + count = count + 1; | ||
513 | + selectimg = true; | ||
514 | + | ||
515 | + } else { | ||
516 | + selectimg = false; | ||
517 | + count = count - 1; | ||
518 | + } | ||
519 | + | ||
520 | + } | ||
521 | + | ||
522 | + if (typeof (query.selectedimagetype) !== "undefined" && (query.selectedimagetype !== null && query.selectedimagetype !== "")) { | ||
523 | + var posimagetype = value._ImageType.indexOf(query.selectedimagetype); | ||
524 | + if (posimagetype > -1) { | ||
525 | + count = count + 1; | ||
526 | + selectimg = true; | ||
527 | + | ||
528 | + } else { | ||
529 | + selectimg = false; | ||
530 | + count = count - 1; | ||
531 | + } | ||
532 | + | ||
533 | + } | ||
534 | + | ||
535 | + if (typeof (query.selectedspecialty) !== "undefined" && (query.selectedspecialty !== null && query.selectedspecialty !== "")) { | ||
536 | + var posspeciality = value._MedicalSpecialty.indexOf(query.selectedspecialty); | ||
537 | + if (posspeciality > -1) { | ||
538 | + count = count + 1; | ||
539 | + selectimg = true; | ||
540 | + } else { | ||
541 | + selectimg = false; | ||
542 | + count = count - 1; | ||
543 | + } | ||
544 | + | ||
545 | + } | ||
546 | + | ||
547 | + if (selectimg === true && count >= filtercount) { | ||
548 | + | ||
549 | + | ||
550 | + $scope.imagePath = "~/../content/images/ci/thumbnails/" + value._ThumbnailImage; | ||
551 | + | ||
552 | + var $el = $('<div id="' + value._id + '" class="col-sm-3 col-md-2" title = "' + value._Title + '" data-ng-click="openView($event)">' | ||
553 | + + '<div class="thumbnail" >' | ||
554 | + + '<img id="' + value._Title + '"ng-src="' + $scope.imagePath + '" alt="" title="" >' | ||
555 | + + '<div class="caption"><p>' + value._Title + '</p></div></a></div></div>').appendTo('#grid-view'); | ||
556 | + | ||
557 | + | ||
558 | + $compile($el)($scope); | ||
559 | + | ||
560 | + $(".sidebar").mCustomScrollbar({ | ||
561 | + autoHideScrollbar: true, | ||
562 | + //theme:"rounded" | ||
563 | + }); | ||
564 | + | ||
565 | + | ||
566 | + $scope.searchCIListViewData.push( | ||
567 | + { | ||
568 | + "_id": value._id, | ||
569 | + "_ImageId": value._ImageId, | ||
570 | + "_Title": value._Title, | ||
571 | + "_contentImage": value._contentImage, | ||
572 | + "_ThumbnailImage": value._ThumbnailImage, | ||
573 | + "_BodySystem": value._BodySystem, | ||
574 | + "_BodyRegion": value._BodyRegion, | ||
575 | + "_ViewOrientation": value._ViewOrientation, | ||
576 | + "_MedicalSpecialty": value._MedicalSpecialty, | ||
577 | + "_ImageType": value._ImageType, | ||
578 | + "_Summary": value._Summary | ||
579 | + | ||
580 | + }); | ||
581 | + } | ||
582 | + }); | ||
583 | + $('table > #ListViewDiv > #searchItem').remove(); | ||
584 | + //Show Error Message in case of gridview if no data is found | ||
585 | + if ($scope.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'); | ||
587 | + $compile($el)($scope); | ||
588 | + $('table > #ListViewDiv > #searchItem').remove(); | ||
484 | 589 | ||
485 | - $('#ListViewDiv').append('<tr id="searchItem"><td colspan="6"><strong style="color:black;">No illustration found for the selected search criteria!</strong></td></tr>'); | ||
486 | - } | ||
487 | - }, | ||
488 | - function (error) { | ||
489 | - // handle errors here | ||
490 | - console.log(' $scope.IllustrationData = ' + error.statusText); | ||
491 | - } | ||
492 | - ); | 590 | + $('#ListViewDiv').append('<tr id="searchItem"><td colspan="6"><strong style="color:black;">No illustration found for the selected search criteria!</strong></td></tr>'); |
591 | + } | ||
592 | + | ||
593 | + $timeout(function () { $scope.EnableUI(); }, 400); | ||
493 | } | 594 | } |
494 | 595 | ||
495 | 596 | ||
@@ -543,51 +644,11 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | @@ -543,51 +644,11 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | ||
543 | $rootScope.isLoading = true; | 644 | $rootScope.isLoading = true; |
544 | $('#spinner').css('visibility', 'visible'); | 645 | $('#spinner').css('visibility', 'visible'); |
545 | $scope.voId = $rootScope.getLocalStorageValue("currentBodyViewId"); | 646 | $scope.voId = $rootScope.getLocalStorageValue("currentBodyViewId"); |
546 | - | ||
547 | - | ||
548 | - //once you get id in scope push detail in jspanel content | ||
549 | - | ||
550 | - // var openViews; | ||
551 | - // console.log($rootScope.openViews); | ||
552 | - // if ($rootScope.openViews.length > 0 && $rootScope.openViews != null && $rootScope.openViews != undefined) { | ||
553 | - // alert("entered"); | ||
554 | - //for (var i=0; i <= $rootScope.openViews.length - 1; i++) { | ||
555 | - // if ($rootScope.openViews[i].BodyViewId == $scope.voId) { | ||
556 | - // alert("success"); | ||
557 | - // openViews = $rootScope.openViews; | ||
558 | - // } | ||
559 | - //} | ||
560 | - // openViews = $rootScope.openViews; | ||
561 | - | ||
562 | - | ||
563 | - //alert($rootScope.openViews); | ||
564 | - //openViews = new jinqJs() | ||
565 | - // .from($rootScope.openViews) | ||
566 | - // .where("BodyViewId==" + $scope.voId) | ||
567 | - // .select(); | ||
568 | - //} | ||
569 | 647 | ||
570 | var counter = 1; | 648 | var counter = 1; |
571 | var tittle = $rootScope.getLocalStorageValue("currentViewTitleFromJson"); | 649 | var tittle = $rootScope.getLocalStorageValue("currentViewTitleFromJson"); |
572 | localStorage.setItem("currentViewTitle", tittle); | 650 | localStorage.setItem("currentViewTitle", tittle); |
573 | - //if (openViews != null && openViews.length > 0 && openViews != undefined) { | ||
574 | - // // alert("aaa"); | ||
575 | - // console.log(openViews); | ||
576 | - // angular.forEach(openViews, function (value, key) { | ||
577 | - // if (value.body - views == tittle) { | ||
578 | - // tittle = $rootScope.getLocalStorageValue("currentViewTitleFromJson") + counter++; | ||
579 | - // $rootScope.currentActiveViewTitle = tittle; | ||
580 | - // localStorage.setItem("currentViewTitle", tittle); | ||
581 | - // } | ||
582 | - | ||
583 | - // }); | ||
584 | - //} | ||
585 | - //else { | ||
586 | - // localStorage.setItem("currentViewTitle", tittle); | ||
587 | - | ||
588 | - //} | ||
589 | - | ||
590 | - //alert($rootScope.getLocalStorageValue("currentViewTitle")); | 651 | + |
591 | 652 | ||
592 | var promise = DataService.getJson('~/../content/data/json/ci/ci_dat_contentlist.json') | 653 | var promise = DataService.getJson('~/../content/data/json/ci/ci_dat_contentlist.json') |
593 | promise.then( | 654 | promise.then( |
@@ -630,10 +691,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | @@ -630,10 +691,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | ||
630 | '<img src="' + $scope.clickedCIImage + '" alt="" title="" class="img-responsive "><div class="col-sm-12 well img-subtitle">' + | 691 | '<img src="' + $scope.clickedCIImage + '" alt="" title="" class="img-responsive "><div class="col-sm-12 well img-subtitle">' + |
631 | '<div align="left" id="sid"><p>' + $scope.clickedCISummary + '</p></div><button id="btnTxtOnOff" class="btn btn-primary pull-right">Text Off</button>' + | 692 | '<div align="left" id="sid"><p>' + $scope.clickedCISummary + '</p></div><button id="btnTxtOnOff" class="btn btn-primary pull-right">Text Off</button>' + |
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 });$("#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>' + | 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>' + |
633 | - '</div></div>', | ||
634 | - //ajax: { | ||
635 | - // url: 'app/views/ci/ci-view-detail.html' | ||
636 | - //}, | 694 | + '</div></div>', |
637 | title: $rootScope.getLocalStorageValue("currentViewTitle"), | 695 | title: $rootScope.getLocalStorageValue("currentViewTitle"), |
638 | position: { | 696 | position: { |
639 | top: 70, | 697 | top: 70, |