Commit d9702b98f44414d529e4c4514577e1dbeb725d77
1 parent
b83d55f0
In between code for calling module service
Showing
5 changed files
with
26 additions
and
197 deletions
400-SOURCECODE/AIAHTML5.Web/AIAHTML5.Web.csproj
@@ -55,6 +55,7 @@ | @@ -55,6 +55,7 @@ | ||
55 | <Content Include="app\main\Link.js" /> | 55 | <Content Include="app\main\Link.js" /> |
56 | <Content Include="app\services\AuthenticationService.js" /> | 56 | <Content Include="app\services\AuthenticationService.js" /> |
57 | <Content Include="app\services\DataService.js" /> | 57 | <Content Include="app\services\DataService.js" /> |
58 | + <Content Include="app\services\ModuleService.js" /> | ||
58 | <Content Include="app\utility\BitmapData.js" /> | 59 | <Content Include="app\utility\BitmapData.js" /> |
59 | <Content Include="app\utility\Matrix.js" /> | 60 | <Content Include="app\utility\Matrix.js" /> |
60 | <Content Include="app\utility\Paint.js" /> | 61 | <Content Include="app\utility\Paint.js" /> |
400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
@@ -268,7 +268,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo | @@ -268,7 +268,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo | ||
268 | 268 | ||
269 | 269 | ||
270 | $scope.openView = function ($event) { | 270 | $scope.openView = function ($event) { |
271 | - | 271 | + |
272 | $rootScope.isLoading = true; | 272 | $rootScope.isLoading = true; |
273 | $('#spinner').css('visibility', 'visible'); | 273 | $('#spinner').css('visibility', 'visible'); |
274 | 274 |
400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js
1 | 'use strict'; | 1 | 'use strict'; |
2 | 2 | ||
3 | -AIA.controller("TileViewListController", ["$scope", "$rootScope", "$compile", "$http", "$log", "$location", "BodyRegions", "BodySystems", "ViewOrientations", "ImageTypes", "$timeout", "Modules", "$routeParams", "DataService", | ||
4 | -function ($scope, $rootScope, $compile, $http, $log, $location, BodyRegions, BodySystems, ViewOrientations, ImageTypes, $timeout, Modules, $routeParam, DataService) | 3 | +AIA.controller("TileViewListController", ["$scope", "$rootScope", "$compile", "$http", "$log", "$location", "BodyRegions", "BodySystems", "ViewOrientations", "ImageTypes", "$timeout", "Modules", "$routeParams", "DataService","ModuleService" , |
4 | +function ($scope, $rootScope, $compile, $http, $log, $location, BodyRegions, BodySystems, ViewOrientations, ImageTypes, $timeout, Modules, $routeParam, DataService,ModuleService) | ||
5 | { | 5 | { |
6 | var ATLAS_ANATOMY = 'Atlas Anatomy'; | 6 | var ATLAS_ANATOMY = 'Atlas Anatomy'; |
7 | var CLINICAL_ILLUSTRATION ='Clinical Illustrations'; | 7 | var CLINICAL_ILLUSTRATION ='Clinical Illustrations'; |
@@ -15,6 +15,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, BodyRegions, Bod | @@ -15,6 +15,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, BodyRegions, Bod | ||
15 | 15 | ||
16 | $scope.loadForModuleById = function (moduleId) { | 16 | $scope.loadForModuleById = function (moduleId) { |
17 | 17 | ||
18 | + $scope.moduleId = moduleId; | ||
19 | + | ||
18 | console.log('loadForModuleById is called') | 20 | console.log('loadForModuleById is called') |
19 | var moduleName = Modules[moduleId].Name; | 21 | var moduleName = Modules[moduleId].Name; |
20 | 22 | ||
@@ -63,7 +65,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, BodyRegions, Bod | @@ -63,7 +65,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, BodyRegions, Bod | ||
63 | angular.forEach($scope.data, function (value, key) { | 65 | angular.forEach($scope.data, function (value, key) { |
64 | $scope.imagePath = "~/../content/images/aa/thumbnails/" + value._TinyImageName; | 66 | $scope.imagePath = "~/../content/images/aa/thumbnails/" + value._TinyImageName; |
65 | 67 | ||
66 | - var $el = $('<div id="' + value._Id + '" class="col-sm-3 col-md-3" title = "' + value._Title + '" data-ng-click="openView($event)">' | 68 | + var $el = $('<div id="' + value._Id + '" class="col-sm-3 col-md-3" title = "' + value._Title + '" data-ng-click="openModuleItem($event)">' |
67 | + '<div class="thumbnail" >' | 69 | + '<div class="thumbnail" >' |
68 | + '<img class="tinyImg" id="' + value._Title + '"ng-src="' + $scope.imagePath + '" alt="" title="" >' | 70 | + '<img class="tinyImg" id="' + value._Title + '"ng-src="' + $scope.imagePath + '" alt="" title="" >' |
69 | + '<div class="caption"><p>' + value._Title + '</p></div></a></div></div>').appendTo('#grid-view'); | 71 | + '<div class="caption"><p>' + value._Title + '</p></div></a></div></div>').appendTo('#grid-view'); |
@@ -95,200 +97,16 @@ function ($scope, $rootScope, $compile, $http, $log, $location, BodyRegions, Bod | @@ -95,200 +97,16 @@ function ($scope, $rootScope, $compile, $http, $log, $location, BodyRegions, Bod | ||
95 | $("html,body").scrollTop(0); | 97 | $("html,body").scrollTop(0); |
96 | } | 98 | } |
97 | 99 | ||
98 | - $scope.openModule = function (moduleId) { | ||
99 | - | ||
100 | - | 100 | + $scope.openModuleItem = function (event) { |
101 | + | ||
102 | + alert('call on TileViewListController'); | ||
101 | 103 | ||
102 | - } | 104 | + var moduleDetails = []; |
105 | + moduleDetails.push($scope.moduleId); | ||
106 | + | ||
107 | + var isSaved= ModuleService.SaveOpenedModules(); | ||
108 | + alert(isSaved); | ||
103 | 109 | ||
104 | - $scope.ApplySearch = function (query) { | ||
105 | - | ||
106 | - $scope.filterstring = true; | ||
107 | - | ||
108 | - while ($scope.searchCIListViewData.length) { | ||
109 | - $scope.searchCIListViewData.pop(); | ||
110 | - } | ||
111 | - | ||
112 | - //$('#grid-view').empty(); | ||
113 | - | ||
114 | - filtercount = 0; | ||
115 | - if (typeof (query.selectedbodyregion) !== "undefined" && (query.selectedbodyregion !== null && query.selectedbodyregion !== "")) { | ||
116 | - filtercount = filtercount + 1; | ||
117 | - localStorage.setItem("CICurBodyRegion", query.selectedbodyregion); | ||
118 | - } | ||
119 | - else { | ||
120 | - localStorage.setItem("CICurBodyRegion", ''); | ||
121 | - } | ||
122 | - | ||
123 | - if (typeof (query.selectedbodysystem) !== "undefined" && (query.selectedbodysystem !== null && query.selectedbodysystem !== "")) { | ||
124 | - filtercount = filtercount + 1; | ||
125 | - localStorage.setItem("CICurBodySystem", query.selectedbodysystem); | ||
126 | - } | ||
127 | - else { | ||
128 | - localStorage.setItem("CICurBodySystem", ''); | ||
129 | - } | ||
130 | - | ||
131 | - if (typeof (query.selectedorientation) !== "undefined" && (query.selectedorientation !== null && query.selectedorientation !== '')) { | ||
132 | - filtercount = filtercount + 1; | ||
133 | - localStorage.setItem("CICurOrientation", query.selectedorientation); | ||
134 | - } | ||
135 | - else { | ||
136 | - localStorage.setItem("CICurOrientation", ''); | ||
137 | - } | ||
138 | - | ||
139 | - if (typeof (query.selectedimagetype) !== "undefined" && (query.selectedimagetype !== null && query.selectedimagetype !== '')) { | ||
140 | - filtercount = filtercount + 1; | ||
141 | - localStorage.setItem("CICurImageType", query.selectedimagetype); | ||
142 | - } | ||
143 | - else { | ||
144 | - localStorage.setItem("CICurImageType", ''); | ||
145 | - } | ||
146 | - | ||
147 | - if (typeof (query.selectedspecialty) !== "undefined" && (query.selectedspecialty !== null && query.selectedspecialty !== '')) { | ||
148 | - filtercount = filtercount + 1; | ||
149 | - localStorage.setItem("CICurSpeciality", query.selectedspecialty); | ||
150 | - } | ||
151 | - else { | ||
152 | - localStorage.setItem("CICurSpeciality", ''); | ||
153 | - } | ||
154 | - | ||
155 | - | ||
156 | - var promise = DataService.getJson('~/../content/data/json/ci/ci_dat_contentlist.json') | ||
157 | - promise.then( | ||
158 | - function (result) { | ||
159 | - $scope.IllustrationData = result; | ||
160 | - //$scope.selectedCIListViewData = $scope.IllustrationData.root.CIData; | ||
161 | - | ||
162 | - $scope.selectedCIListViewData = new jinqJs() | ||
163 | - .from($scope.IllustrationData.root.CIData) | ||
164 | - .orderBy([{ field: '_Title', sort: 'asc' }]) | ||
165 | - .select(); | ||
166 | - | ||
167 | - $('#grid-view').empty(); | ||
168 | - | ||
169 | - angular.forEach($scope.selectedCIListViewData, function (value, key) { | ||
170 | - | ||
171 | - var selectimg = true; | ||
172 | - var count = 0; | ||
173 | - | ||
174 | - | ||
175 | - if (typeof (query.selectedbodyregion) !== "undefined" && (query.selectedbodyregion !== null && query.selectedbodyregion !== "")) { | ||
176 | - var posbodyregion = value._BodyRegion.indexOf((query.selectedbodyregion.trim())); | ||
177 | - if (posbodyregion > -1) { | ||
178 | - selectimg = true; | ||
179 | - count = count + 1; | ||
180 | - | ||
181 | - } | ||
182 | - else { | ||
183 | - selectimg = false; | ||
184 | - count = count - 1; | ||
185 | - } | ||
186 | - | ||
187 | - } | ||
188 | - | ||
189 | - if (typeof (query.selectedbodysystem) !== "undefined" && (query.selectedbodysystem !== null && query.selectedbodysystem !== "")) { | ||
190 | - var posbodysystem = value._BodySystem.indexOf(query.selectedbodysystem); | ||
191 | - if (posbodysystem > -1) { | ||
192 | - count = count + 1; | ||
193 | - selectimg = true; | ||
194 | - } else { | ||
195 | - selectimg = false; | ||
196 | - count = count - 1; | ||
197 | - } | ||
198 | - } | ||
199 | - | ||
200 | - if (typeof (query.selectedorientation) !== "undefined" && (query.selectedorientation !== null && query.selectedorientation !== "")) { | ||
201 | - var posorientation = value._ViewOrientation.indexOf(query.selectedorientation); | ||
202 | - if (posorientation > -1) { | ||
203 | - count = count + 1; | ||
204 | - selectimg = true; | ||
205 | - | ||
206 | - } else { | ||
207 | - selectimg = false; | ||
208 | - count = count - 1; | ||
209 | - } | ||
210 | - | ||
211 | - } | ||
212 | - | ||
213 | - if (typeof (query.selectedimagetype) !== "undefined" && (query.selectedimagetype !== null && query.selectedimagetype !== "")) { | ||
214 | - var posimagetype = value._ImageType.indexOf(query.selectedimagetype); | ||
215 | - if (posimagetype > -1) { | ||
216 | - count = count + 1; | ||
217 | - selectimg = true; | ||
218 | - | ||
219 | - } else { | ||
220 | - selectimg = false; | ||
221 | - count = count - 1; | ||
222 | - } | ||
223 | - | ||
224 | - } | ||
225 | - | ||
226 | - if (typeof (query.selectedspecialty) !== "undefined" && (query.selectedspecialty !== null && query.selectedspecialty !== "")) { | ||
227 | - var posspeciality = value._MedicalSpecialty.indexOf(query.selectedspecialty); | ||
228 | - if (posspeciality > -1) { | ||
229 | - count = count + 1; | ||
230 | - selectimg = true; | ||
231 | - } else { | ||
232 | - selectimg = false; | ||
233 | - count = count - 1; | ||
234 | - } | ||
235 | - | ||
236 | - } | ||
237 | - | ||
238 | - if (selectimg === true && count >= filtercount) { | ||
239 | - | ||
240 | - | ||
241 | - $scope.imagePath = "~/../content/images/ci/thumbnails/" + value._ThumbnailImage; | ||
242 | - | ||
243 | - var $el = $('<div id="' + value._id + '" class="col-sm-3 col-md-2" title = "' + value._Title + '" data-ng-click="openView($event)">' | ||
244 | - + '<div class="thumbnail" >' | ||
245 | - + '<img id="' + value._Title + '"ng-src="' + $scope.imagePath + '" alt="" title="" >' | ||
246 | - + '<div class="caption"><p>' + value._Title + '</p></div></a></div></div>').appendTo('#grid-view'); | ||
247 | - | ||
248 | - | ||
249 | - $compile($el)($scope); | ||
250 | - | ||
251 | - $(".sidebar").mCustomScrollbar({ | ||
252 | - autoHideScrollbar: true, | ||
253 | - //theme:"rounded" | ||
254 | - }); | ||
255 | - | ||
256 | - | ||
257 | - $scope.searchCIListViewData.push( | ||
258 | - { | ||
259 | - "_id": value._id, | ||
260 | - "_ImageId": value._ImageId, | ||
261 | - "_Title": value._Title, | ||
262 | - "_contentImage": value._contentImage, | ||
263 | - "_ThumbnailImage": value._ThumbnailImage, | ||
264 | - "_BodySystem": value._BodySystem, | ||
265 | - "_BodyRegion": value._BodyRegion, | ||
266 | - "_ViewOrientation": value._ViewOrientation, | ||
267 | - "_MedicalSpecialty": value._MedicalSpecialty, | ||
268 | - "_ImageType": value._ImageType, | ||
269 | - "_Summary": value._Summary | ||
270 | - | ||
271 | - }); | ||
272 | - | ||
273 | - } | ||
274 | - | ||
275 | - | ||
276 | - }); | ||
277 | - | ||
278 | - //Show Error Message in case of gridview if no data is found | ||
279 | - if ($scope.searchCIListViewData.length == 0) { | ||
280 | - | ||
281 | - 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'); | ||
282 | - $compile($el)($scope); | ||
283 | - } | ||
284 | - }, | ||
285 | - function (error) { | ||
286 | - // handle errors here | ||
287 | - console.log(' $scope.IllustrationData = ' + error.statusText); | ||
288 | - } | ||
289 | - ); | ||
290 | - | ||
291 | - | ||
292 | } | 110 | } |
293 | 111 | ||
294 | }]); | 112 | }]); |
400-SOURCECODE/AIAHTML5.Web/app/services/ModuleService.js
0 → 100644
400-SOURCECODE/AIAHTML5.Web/index.html
@@ -1138,7 +1138,8 @@ | @@ -1138,7 +1138,8 @@ | ||
1138 | <script src="libs/jquery/jquery_plugin/jqueryui.js"></script> | 1138 | <script src="libs/jquery/jquery_plugin/jqueryui.js"></script> |
1139 | 1139 | ||
1140 | <script src="app/controllers/TileViewListController.js"></script> | 1140 | <script src="app/controllers/TileViewListController.js"></script> |
1141 | - | 1141 | + |
1142 | + <script src="app/services/ModuleService.js"></script> | ||
1142 | 1143 | ||
1143 | <script src="libs/jquery/jquery_plugin/color-picker/jquery.minicolors.min.js"></script> | 1144 | <script src="libs/jquery/jquery_plugin/color-picker/jquery.minicolors.min.js"></script> |
1144 | <!--<script src="libs/colorpicker/jquery.minicolors.min.js"></script>--> | 1145 | <!--<script src="libs/colorpicker/jquery.minicolors.min.js"></script>--> |