Commit 57b87639560e3d42cf32730b0a0afb722b51fb93
1 parent
df9cc2d5
partially updated 3D module
Showing
7 changed files
with
438 additions
and
123 deletions
400-SOURCECODE/AIAHTML5.Web/app/controllers/3dAController.js
1 | -AIA.controller("3dAController", ["$scope", "$rootScope", "pages", "$log", '$http', 'DataService', '$filter', '$location', '$document', '$sce', "$compile", | |
2 | -function ($scope, $rootScope, pages, log, $http, DataService, $filter, $location, $document, $sce, $compile) { | |
3 | - | |
4 | - | |
5 | - $scope.showTabButton = false; | |
6 | - $scope.threeDAnatomyData; | |
7 | - $scope.Id; | |
8 | - $scope.$on('$viewContentLoaded', function (event) { | |
1 | +AIA.controller("3dAController", ["$scope", "$rootScope", "pages", "$log", '$http', 'DataService', '$filter', '$location', '$document', '$sce', "$compile", "$timeout", "ModuleService", "$interval", | |
2 | +function ($scope, $rootScope, pages, log, $http, DataService, $filter, $location, $document, $sce, $compile, $timeout, ModuleService, $interval) { | |
3 | + | |
4 | + | |
5 | + // $scope.threeDAnatomyData; | |
6 | + | |
7 | + $scope.initialize3DWindowData = function (windowviewid, isOpenWithExistsModule, cbwindowid) { | |
8 | + if (isOpenWithExistsModule || cbwindowid == 0) { | |
9 | + if ($rootScope.TheeDWindowData != undefined) { | |
10 | + $rootScope.TheeDWindowData.length = 0; | |
11 | + } | |
12 | + else { | |
13 | + $rootScope.TheeDWindowData = []; | |
14 | + } | |
15 | + | |
16 | + $rootScope.TheeDWindowData.push( | |
17 | + { | |
18 | + 'multiwinid': windowviewid, | |
19 | + 'threeDAnatomyData': [], | |
20 | + 'searchCAListViewData': [], | |
21 | + 'ImagePath': '', | |
22 | + 'moduleName': '', | |
23 | + 'currentViewTitle': '', | |
24 | + 'parentSlugName': '', | |
25 | + 'currentSlug': '', | |
26 | + 'imageId': '', | |
27 | + 'imageName': '', | |
28 | + 'clickedCAVideo': '', | |
29 | + 'clickedCASummary': '', | |
30 | + 'hostedFolderId': '', | |
31 | + 'isTextVisible': true | |
32 | + }); | |
33 | + | |
34 | + } | |
35 | + else { | |
36 | + var isNewWindow = true; | |
37 | + for (var k = 0; k < $rootScope.TheeDWindowData.length; k++) { | |
38 | + if ($rootScope.TheeDWindowData[k].multiwinid == windowviewid) { | |
39 | + isNewWindow = false; | |
40 | + break; | |
41 | + } | |
42 | + } | |
43 | + | |
44 | + if (isNewWindow) { | |
45 | + $rootScope.TheeDWindowData.push( | |
46 | + { | |
47 | + 'multiwinid': windowviewid, | |
48 | + 'threeDAnatomyData': [], | |
49 | + 'searchCAListViewData': [], | |
50 | + 'ImagePath': '', | |
51 | + 'moduleName': '', | |
52 | + 'currentViewTitle': '', | |
53 | + 'parentSlugName': '', | |
54 | + 'currentSlug': '', | |
55 | + 'imageId': '', | |
56 | + 'imageName': '', | |
57 | + 'clickedCAVideo': '', | |
58 | + 'clickedCASummary': '', | |
59 | + 'hostedFolderId': '', | |
60 | + 'isTextVisible': true | |
61 | + }); | |
62 | + | |
63 | + } | |
64 | + } | |
65 | + } | |
66 | + | |
67 | + $scope.Get3DwindowStoreData = function (windowviewid, keyname) { | |
68 | + for (var x = 0 ; x < $rootScope.TheeDWindowData.length; x++) { | |
69 | + | |
70 | + if ($rootScope.TheeDWindowData[x].multiwinid == windowviewid) { | |
71 | + return $rootScope.TheeDWindowData[x][keyname]; | |
72 | + } | |
73 | + } | |
74 | + } | |
75 | + | |
76 | + $scope.Set3DwindowStoreData = function (windowviewid, keyname, value) { | |
77 | + for (var x = 0 ; x < $rootScope.TheeDWindowData.length; x++) { | |
78 | + | |
79 | + if ($rootScope.TheeDWindowData[x].multiwinid == windowviewid) { | |
80 | + $rootScope.TheeDWindowData[x][keyname] = value; | |
81 | + } | |
82 | + } | |
83 | + } | |
84 | + | |
85 | + $rootScope.Get3DWindowId = function () { | |
86 | + // handle for single window | |
87 | + if ($rootScope.TheeDWindowData.length > 0) { | |
88 | + for (var x = 0 ; x < $rootScope.TheeDWindowData.length; x++) { | |
89 | + | |
90 | + return $rootScope.TheeDWindowData[x].multiwinid; | |
91 | + } | |
92 | + } | |
93 | + else return 0; | |
94 | + } | |
95 | + | |
96 | + $scope.DisableUI = function () { | |
97 | + | |
98 | + var caImagePanelConetent = document.getElementsByClassName("jsPanel-content"); | |
99 | + for (var i = 0; i < caImagePanelConetent.length; i++) { | |
100 | + caImagePanelConetent[i].style.pointerEvents = "none"; | |
101 | + caImagePanelConetent[i].style.opacity = "0.7"; | |
102 | + | |
103 | + } | |
104 | + $rootScope.isLoading = true; | |
105 | + $('#spinner').css('visibility', 'visible'); | |
106 | + | |
107 | + // CB module disable all | |
108 | + $('#CBDetailPageDiv').css('pointer-events', 'none'); | |
109 | + $('#CBDetailPageDiv').css('opacity', '0.7'); | |
110 | + } | |
111 | + | |
112 | + $scope.EnableUI = function () { | |
113 | + | |
114 | + var caImagePanelConetent = document.getElementsByClassName("jsPanel-content"); | |
115 | + for (var i = 0; i < caImagePanelConetent.length; i++) { | |
116 | + caImagePanelConetent[i].style.pointerEvents = "auto"; | |
117 | + caImagePanelConetent[i].style.opacity = "1"; | |
118 | + } | |
119 | + | |
120 | + $rootScope.isLoading = false; | |
121 | + $('#spinner').css('visibility', 'hidden'); | |
122 | + // CB module enable all | |
123 | + $('#CBDetailPageDiv').css('pointer-events', 'auto'); | |
124 | + $('#CBDetailPageDiv').css('opacity', '1'); | |
125 | + } | |
126 | + | |
127 | + $scope.loadAIModuleById = function (moduleId) { | |
128 | + $rootScope.isCallFromOtherModule = undefined; | |
129 | + | |
130 | + $rootScope.MULTI_VIEW_ID += 1 | |
131 | + | |
132 | + $scope.initialize3DWindowData($rootScope.MULTI_VIEW_ID, true, undefined); | |
133 | + | |
134 | + $scope.DisableUI(); | |
135 | + | |
136 | + if ($rootScope.refreshcheck == null) { | |
137 | + $location.path('/'); | |
138 | + } | |
139 | + | |
9 | 140 | var currentURL = $location.path(); |
10 | 141 | var selectedModuleName = ''; |
11 | 142 | //set module title |
... | ... | @@ -16,25 +147,36 @@ function ($scope, $rootScope, pages, log, $http, DataService, $filter, $location |
16 | 147 | } |
17 | 148 | $rootScope.currentActiveModuleTitle = selectedModuleName; |
18 | 149 | }) |
19 | - if ($rootScope.refreshcheck == null) { | |
20 | - $location.path('/'); | |
21 | - } | |
150 | + | |
151 | + $scope.Set3DwindowStoreData($rootScope.MULTI_VIEW_ID, 'moduleName', "3D Anatomy"); | |
152 | + | |
153 | + $scope.Load3DJsonData($rootScope.MULTI_VIEW_ID); | |
154 | + | |
22 | 155 | $scope.scroll(); |
156 | + | |
157 | + | |
158 | + }; | |
159 | + | |
160 | + $scope.scroll = function () { | |
161 | + $("html,body").scrollTop(0); | |
162 | + } | |
163 | + | |
164 | + $scope.Load3DJsonData = function (windowviewid) { | |
165 | + | |
23 | 166 | var promise = DataService.getJson('~/../content/data/json/3da/3da_dat_contentlist.json') |
24 | 167 | promise.then( |
25 | 168 | function (result) { |
26 | - $scope.threeDAnatomyData = result; | |
27 | - | |
28 | - // $scope.selectedThreeDAdata = $scope.threeDAnatomyData.root.ThreeDAData; | |
29 | - | |
30 | - $scope.selectedThreeDAdata = new jinqJs() | |
31 | - .from($scope.threeDAnatomyData.root.ThreeDAData) | |
169 | + | |
170 | + var threeDAnatomyData = new jinqJs() | |
171 | + .from(result.root.ThreeDAData) | |
32 | 172 | .orderBy([{ field: '_Title', sort: 'asc' }]) |
33 | 173 | .select(); |
34 | 174 | |
175 | + $scope.Set3DwindowStoreData(windowviewid, 'threeDAnatomyData', threeDAnatomyData); | |
176 | + | |
35 | 177 | // console.log($scope.selectedCIListViewData); |
36 | 178 | $('#grid-view').empty(); |
37 | - angular.forEach($scope.selectedThreeDAdata, function (value, key) { | |
179 | + angular.forEach(threeDAnatomyData, function (value, key) { | |
38 | 180 | $scope.imagePath = "~/../content/images/3da/thumbnails/" + value._ThumbnailImage; |
39 | 181 | |
40 | 182 | var $el = $('<div id="3dView' + value._id + '" class="col-sm-3 col-md-2" title = "' + value._Title + '">' |
... | ... | @@ -52,36 +194,28 @@ function ($scope, $rootScope, pages, log, $http, DataService, $filter, $location |
52 | 194 | |
53 | 195 | }); |
54 | 196 | |
197 | + $timeout(function () { $scope.EnableUI(); }, 200); | |
55 | 198 | }, |
56 | 199 | function (error) { |
200 | + $scope.EnableUI(); | |
57 | 201 | // handle errors here |
58 | 202 | console.log(' $scope.threeDAnatomyData = ' + error.statusText); |
59 | 203 | } |
60 | 204 | ); |
61 | - | |
62 | - }); | |
63 | - $scope.scroll = function () { | |
64 | - // $window.scrollTo(0, 0); | |
65 | - $("html,body").scrollTop(0); | |
66 | - //alert("scroll"); | |
67 | - } | |
68 | - $scope.IsVisible = function () { | |
69 | - //$scope.scroll(); | |
70 | - | |
71 | - $location.url("/3dAnatomy"); | |
72 | - | |
73 | - } | |
74 | - | |
205 | + }; | |
75 | 206 | |
76 | 207 | $scope.Open3DModel = function ($event) { |
77 | 208 | $rootScope.currentBodyViewId = $event.currentTarget.id; |
209 | + var windowviewid = $rootScope.MULTI_VIEW_ID; | |
210 | + var selectedThreeDAdata = $scope.Get3DwindowStoreData(windowviewid, 'threeDAnatomyData'); | |
211 | + | |
78 | 212 | if ($event.currentTarget.textContent !== null && typeof ($event.currentTarget.textContent) !== "undefined") { |
79 | 213 | var ThreeDTitle = []; |
80 | 214 | ThreeDTitle = new jinqJs() |
81 | - .from($scope.selectedThreeDAdata) | |
215 | + .from(selectedThreeDAdata) | |
82 | 216 | .where('_id = ' + $event.currentTarget.id) |
83 | - .select('_Title'); | |
84 | - | |
217 | + .select('_Title', '_3dimagepath'); | |
218 | + | |
85 | 219 | $rootScope.ViewTitle = ThreeDTitle[0]._Title; |
86 | 220 | } |
87 | 221 | else { |
... | ... | @@ -93,121 +227,243 @@ function ($scope, $rootScope, pages, log, $http, DataService, $filter, $location |
93 | 227 | localStorage.setItem("currentViewTitleFromJson", $rootScope.ViewTitle); |
94 | 228 | localStorage.setItem("currentBodyViewId", $event.currentTarget.id); |
95 | 229 | |
230 | + var ImagePath = ThreeDTitle[0]._3dimagepath; | |
231 | + | |
232 | + $scope.Set3DwindowStoreData(windowviewid, 'currentViewTitle', $rootScope.ViewTitle); | |
233 | + $scope.Set3DwindowStoreData(windowviewid, 'imageId', $event.currentTarget.id); | |
234 | + $scope.Set3DwindowStoreData(windowviewid, 'ImagePath', ImagePath); | |
235 | + | |
96 | 236 | var u = $location.url(); |
97 | 237 | $location.url('/3d-anatomy-details'); |
98 | 238 | |
99 | 239 | } |
100 | 240 | |
101 | - $scope.Open3DModelBody = function () { | |
241 | + $scope.Open3DModelBodyMain = function () { | |
102 | 242 | |
103 | - if ($rootScope.refreshcheck == null) { | |
104 | - $location.path('/'); | |
243 | + if ($rootScope.isCallFromOtherModule) { | |
244 | + $scope.ThreeDModuleData = ModuleService.getModuleData("THREE_D_ANATOMY"); | |
245 | + $scope.readyToLoad = true; | |
246 | + $rootScope.ThreeDWindowLoadComplete = false; | |
247 | + $scope.wincount = 1; | |
248 | + var winlen = $scope.ThreeDModuleData.length; | |
249 | + var timeint = null; | |
250 | + var slideId = ""; | |
251 | + timeint = $interval(function () { | |
105 | 252 | |
106 | - } | |
107 | - $rootScope.isLoading = true; | |
108 | - $('#spinner').css('visibility', 'visible'); | |
109 | - //alert($rootScope.getLocalStorageValue("currentBodyViewId")); | |
110 | - $scope.voId3D = $rootScope.getLocalStorageValue("currentBodyViewId"); | |
253 | + if ($scope.readyToLoad == true) { | |
254 | + var windata = $scope.ThreeDModuleData[$scope.wincount - 1]; | |
255 | + slideId = windata.slideId; | |
256 | + $scope.Open3DModelBody(windata); | |
111 | 257 | |
112 | - //alert($scope.voId3D); | |
258 | + } | |
259 | + $scope.readyToLoad = false; | |
260 | + if ($scope.wincount < winlen && $rootScope.ThreeDWindowLoadComplete == true) { | |
261 | + $scope.wincount = $scope.wincount + 1; | |
262 | + $rootScope.ThreeDWindowLoadComplete = false; | |
263 | + $scope.readyToLoad = true; | |
264 | + } | |
113 | 265 | |
266 | + if ($scope.wincount == winlen && $rootScope.ThreeDWindowLoadComplete == true) { | |
267 | + $scope.stopInterval(); | |
268 | + $scope.$emit("LoadModuleComplete", "THREE_D_ANATOMY", slideId); | |
269 | + } | |
114 | 270 | |
115 | - //once you get id in scope push detail in jspanel content | |
116 | 271 | |
117 | - var openViews; | |
118 | - //if ($rootScope.openViews.length > 0) { | |
119 | - // openViews = new jinqJs() | |
120 | - // .from($rootScope.openViews) | |
121 | - // .where("BodyViewId==" + $scope.voId3D) | |
122 | - // .select(); | |
123 | - //} | |
124 | - //var counter = 1; | |
125 | - var tittle = $rootScope.getLocalStorageValue("currentViewTitleFromJson"); | |
126 | - $rootScope.currentActiveViewTitle = tittle; | |
127 | - localStorage.setItem("currentViewTitle", tittle); | |
128 | - //if (openViews != null && openViews.length > 0) { | |
129 | - // angular.forEach(openViews, function (value, key) { | |
272 | + }, 100); | |
130 | 273 | |
131 | - // if (value.body - views == tittle) { | |
132 | - // tittle = $rootScope.getLocalStorageValue("currentViewTitleFromJson") + counter++; | |
133 | - // $rootScope.currentActiveViewTitle = tittle; | |
134 | - // localStorage.setItem("currentViewTitle", tittle); | |
135 | - // } | |
274 | + $scope.stopInterval = function () { | |
275 | + if (angular.isDefined(timeint)) { | |
276 | + $interval.cancel(timeint); | |
277 | + timeint = undefined; | |
278 | + } | |
136 | 279 | |
137 | - // }); | |
138 | - //} | |
139 | - //else { | |
140 | - // localStorage.setItem("currentViewTitle", tittle); | |
280 | + }; | |
141 | 281 | |
142 | - //} | |
282 | + } | |
283 | + else { | |
284 | + $scope.Open3DModelBody(null); | |
285 | + } | |
286 | + } | |
143 | 287 | |
144 | - // alert($rootScope.getLocalStorageValue("currentViewTitle")); | |
288 | + $scope.Open3DModelBody = function (ThreeDModuleData) { | |
145 | 289 | |
146 | - var promise = DataService.getJson('~/../content/data/json/3da/3da_dat_contentlist.json') | |
147 | - promise.then( | |
148 | - function (result) { | |
149 | - $scope.threeDAnatomyData = result; | |
290 | + $scope.DisableUI(); | |
150 | 291 | |
151 | - var clicked3dAview = []; | |
152 | - clicked3dAview = new jinqJs().from($scope.threeDAnatomyData.root.ThreeDAData) | |
153 | - .where('_id == ' + $scope.voId3D) | |
292 | + if ($rootScope.isCallFromOtherModule == true) { | |
293 | + $scope.ThreeDOpenInOtherModules = ThreeDModuleData; | |
294 | + $rootScope.MULTI_VIEW_ID += 1; | |
295 | + var windowviewid = $rootScope.MULTI_VIEW_ID; | |
296 | + | |
297 | + $scope.initialize3DWindowData(windowviewid, false, $scope.ThreeDOpenInOtherModules.currentWindowId); | |
298 | + | |
299 | + var moduleName = $scope.ThreeDOpenInOtherModules.mType; | |
300 | + $scope.Set3DwindowStoreData(windowviewid, 'moduleName', moduleName); | |
301 | + | |
302 | + var promise = DataService.getJson('~/../content/data/json/3da/3da_dat_contentlist.json'); | |
303 | + promise.then( | |
304 | + function (result) { | |
305 | + | |
306 | + var imageId = $scope.ThreeDOpenInOtherModules.id; | |
307 | + | |
308 | + var clicked3DViewData = []; | |
309 | + clicked3DViewData = new jinqJs().from(result.root.ThreeDAData) | |
310 | + .where('_id == ' + imageId) | |
154 | 311 | .select('_Title', '_3dimagepath'); |
155 | - $scope.Selected3DImagePath = clicked3dAview[0]._3dimagepath; | |
156 | - $scope.threeDBodySystemTitle = clicked3dAview[0]._Title; | |
157 | - | |
158 | - if (clicked3dAview.length > 0) { | |
159 | - | |
160 | - $rootScope.isLoading = false; | |
161 | - $('#spinner').css('visibility', 'hidden'); | |
162 | - | |
163 | - $.jsPanel({ | |
164 | - id: '3DImagePanel', | |
165 | - selector: '.threeDView', | |
166 | - theme: 'success', | |
167 | - currentController: '3dAController', | |
168 | - parentSlug: '3d-anatomy-list', | |
169 | - content: '<div class="col-sm-12">' + | |
170 | - '<object data="' + $scope.Selected3DImagePath + '" width="100%" height="800px" type="image/svg+xml"></object>' + | |
171 | - '</div><script>$(document).ready(function(){var $ua = navigator.userAgent; if (($ua.match(/(iPod|iPhone|iPad|android)/i))) {var threeDivWidth = $("#ThreeDView").css("width");$("#ThreeDView").css({"left":"0px","width":"100%","min-idth": threeDivWidth}); var jspanelContainerWidth = $(".jsPanel-content").css("width"); $(".jsPanel-content").css({ "width": "100%", "min-width": jspanelContainerWidth}); $("#3DImagePanel").css("width", "100%"); }});</script>', | |
172 | - title: $rootScope.getLocalStorageValue("currentViewTitle"), | |
173 | - position: { | |
174 | - top: 70, | |
175 | - left: 1, | |
176 | - }, | |
177 | - | |
178 | - size: { width: $(window).outerWidth() - 20, height: $(window).outerHeight() - 10 }, | |
179 | 312 | |
180 | - }); | |
313 | + if (clicked3DViewData.length == 0) { | |
314 | + $rootScope.ThreeDWindowLoadComplete = true | |
315 | + return; | |
316 | + } | |
317 | + | |
318 | + $scope.Set3DwindowStoreData(windowviewid, 'imageId', imageId); | |
181 | 319 | |
182 | - $rootScope.currentSlug = '3d-anatomy-details'; | |
320 | + var ImagePath = clicked3DViewData[0]._3dimagepath; | |
321 | + | |
322 | + $scope.Set3DwindowStoreData(windowviewid, 'ImagePath', ImagePath); | |
183 | 323 | |
184 | - $rootScope.openViews.push( | |
185 | - { | |
186 | - "module": $rootScope.currentActiveModuleTitle, "bodyView": tittle, "state": 'max', "BodyViewId": $rootScope.currentBodyViewId, | |
187 | - "slug": $rootScope.currentSlug | |
188 | - }); | |
324 | + var ThreeDTitle = $scope.ThreeDOpenInOtherModules.anatomyTitle; | |
325 | + $scope.Set3DwindowStoreData(windowviewid, 'currentViewTitle', ThreeDTitle); | |
326 | + localStorage.setItem("currentViewTitle", ThreeDTitle); | |
189 | 327 | |
328 | + $scope.Set3DwindowStoreData(windowviewid, 'parentSlugName', ($location.url()).replace('/', '')); | |
190 | 329 | |
330 | + $scope.load3DAnimation(windowviewid); | |
331 | + | |
332 | + }, | |
333 | + function (error) { | |
334 | + // handle errors here | |
335 | + console.log(' $scope.CAllustrationData = ' + error.statusText); | |
191 | 336 | } |
192 | 337 | |
338 | + ); | |
339 | + } | |
340 | + else { | |
341 | + $scope.Set3DwindowStoreData($rootScope.MULTI_VIEW_ID, 'parentSlugName', '3d-anatomy-list'); | |
342 | + $scope.load3DAnimation($rootScope.MULTI_VIEW_ID); | |
343 | + } | |
193 | 344 | |
194 | - }, | |
195 | - function (error) { | |
196 | - // handle errors here | |
197 | - console.log(' $scope.CIllustrationData = ' + error.statusText); | |
198 | - } | |
345 | + } | |
199 | 346 | |
200 | - ); | |
201 | - $('#ThreeDView').css("height", $(window).outerHeight()); | |
347 | + $scope.load3DAnimation = function (windowviewid) { | |
348 | + | |
349 | + if ($rootScope.refreshcheck == null) { | |
350 | + $location.path('/'); | |
351 | + | |
352 | + } | |
353 | + | |
354 | + $scope.jsPanelID = 'ThreeDImagePanel' + '_' + windowviewid; | |
355 | + | |
356 | + var Selected3DImagePath = $scope.Get3DwindowStoreData(windowviewid, 'ImagePath'); | |
357 | + var tittle = $scope.Get3DwindowStoreData(windowviewid, 'currentViewTitle'); | |
358 | + | |
359 | + if ($rootScope.isCallFromOtherModule) { | |
360 | + // open JS panel for curriculum with define cornonate in CB jason | |
361 | + $scope.jsPanelWidth = $scope.ThreeDOpenInOtherModules.size.width;//1000; | |
362 | + if ($scope.ThreeDOpenInOtherModules.size.width < 900) | |
363 | + $scope.jsPanelWidth = 900; | |
364 | + | |
365 | + $scope.jsPanelHeight = $scope.ThreeDOpenInOtherModules.size.height; | |
366 | + if ($scope.ThreeDOpenInOtherModules.size.height > 750) | |
367 | + $scope.jsPanelHeight = 750; | |
368 | + $scope.jsPanelLeft = 320; | |
369 | + $scope.jsPanelTop = $rootScope.cBModulejsPanelTop(); | |
370 | + | |
371 | + } | |
372 | + else { | |
373 | + $scope.jsPanelWidth = $(window).outerWidth() - 23; | |
374 | + $scope.jsPanelHeight = $(window).outerHeight() - 104; | |
375 | + $scope.jsPanelLeft = 1; | |
376 | + $scope.jsPanelTop = 70; | |
377 | + } | |
378 | + | |
379 | + | |
380 | + if (Selected3DImagePath.length > 0) { | |
381 | + $.jsPanel({ | |
382 | + id: $scope.jsPanelID, | |
383 | + selector: '.threeDView', | |
384 | + theme: 'success', | |
385 | + currentController: '3dAController', | |
386 | + parentSlug: $scope.Get3DwindowStoreData(windowviewid, 'parentSlugName'), | |
387 | + content: '<div class="col-sm-12">' + | |
388 | + '<object data="' + Selected3DImagePath + '" width="100%" height="800px" type="image/svg+xml" id="threedImage_' + windowviewid + '" onload="AnimationOnLoad(event)"></object>' + | |
389 | + '</div><script>$(document).ready(function(){var $ua = navigator.userAgent; if (($ua.match(/(iPod|iPhone|iPad|android)/i))) {var threeDivWidth = $("#ThreeDView").css("width");$("#ThreeDView").css({"left":"0px","width":"100%","min-idth": threeDivWidth}); var jspanelContainerWidth = $(".jsPanel-content").css("width"); $(".jsPanel-content").css({ "width": "100%", "min-width": jspanelContainerWidth}); $("#ThreeDImagePanel_' + windowviewid + '").css("width", "100%"); }});</script>', | |
390 | + title: tittle, | |
391 | + position: { | |
392 | + top: $scope.jsPanelTop, | |
393 | + left: $scope.jsPanelLeft | |
394 | + }, | |
395 | + | |
396 | + size: { | |
397 | + width: $scope.jsPanelWidth, | |
398 | + height: $scope.jsPanelHeight | |
399 | + }, | |
400 | + | |
401 | + }); | |
402 | + | |
403 | + $rootScope.currentSlug = '3d-anatomy-details'; | |
404 | + $scope.Set3DwindowStoreData(windowviewid, 'currentSlug', '3d-anatomy-details'); | |
405 | + | |
406 | + $rootScope.openViews.push( | |
407 | + { | |
408 | + "module": $rootScope.currentActiveModuleTitle, "bodyView": tittle, "state": 'max', "BodyViewId": $rootScope.currentBodyViewId, | |
409 | + "slug": $scope.Get3DwindowStoreData(windowviewid, 'currentSlug') | |
410 | + }); | |
202 | 411 | |
203 | - $('#ThreeDView').css("width", $(window).outerWidth()); | |
204 | 412 | |
413 | + } | |
414 | + | |
415 | + if (!$rootScope.isCallFromOtherModule) { | |
416 | + $('#ThreeDView').css("height", $(window).outerHeight()-10); | |
417 | + | |
418 | + $('#ThreeDView').css("width", $(window).outerWidth()-20); | |
419 | + | |
420 | + } | |
421 | + | |
422 | + | |
423 | + } | |
424 | + | |
425 | + $scope.AnimationOnLoad = function (windowviewid) { | |
426 | + $scope.EnableUI(); | |
427 | + | |
428 | + if ($rootScope.isCallFromOtherModule) { | |
429 | + $scope.JsPanelclick(windowviewid); | |
430 | + $rootScope.ThreeDWindowLoadComplete = true; | |
431 | + } | |
432 | + $scope.JsPanelclick(windowviewid); | |
205 | 433 | } |
206 | 434 | |
207 | - | |
435 | + $scope.JsPanelclick = function (windowviewid) { | |
436 | + // call from while open module in CB | |
437 | + $("#ThreeDImagePanel_" + windowviewid).on('click', function (event) { | |
438 | + | |
439 | + // var pnlName = event.currentTarget.id; | |
440 | + $scope.$emit("cBEnableDisableMenuOption", ""); | |
441 | + | |
442 | + }); | |
443 | + $("#threedImage_" + windowviewid).on('click', function (event) { | |
208 | 444 | |
209 | -}] | |
445 | + // var pnlName = event.currentTarget.id; | |
446 | + $scope.$emit("cBEnableDisableMenuOption", ""); | |
210 | 447 | |
448 | + }); | |
449 | + $("#threedImage_" + windowviewid + "#document html body").on('click', function (event) { | |
211 | 450 | |
451 | + // var pnlName = event.currentTarget.id; | |
452 | + $scope.$emit("cBEnableDisableMenuOption", ""); | |
453 | + | |
454 | + }); | |
455 | + } | |
212 | 456 | |
213 | -); | |
214 | 457 | \ No newline at end of file |
458 | +}]); | |
459 | + | |
460 | +function AnimationOnLoad(event) { | |
461 | + | |
462 | + console.log('animation loaded') | |
463 | + var scope = angular.element(document.getElementById("ThreeDView")).scope(); | |
464 | + // var len = (event.target.id).split("_").length; | |
465 | + var windowviewid = (event.target.id).split("_")[1]; | |
466 | + | |
467 | + scope.$apply(function () { | |
468 | + scope.AnimationOnLoad(windowviewid); | |
469 | + }); | |
470 | +} | |
215 | 471 | \ No newline at end of file | ... | ... |
400-SOURCECODE/AIAHTML5.Web/app/controllers/CurrBuildController.js
... | ... | @@ -1211,6 +1211,7 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ |
1211 | 1211 | var AtlasWindowId = 0; |
1212 | 1212 | var CIWindowId = 0; |
1213 | 1213 | var CAWindowId = 0; |
1214 | + var ThreeDWindowId = 0; | |
1214 | 1215 | $scope.LoadModuleName = []; |
1215 | 1216 | $scope.Slidenumber = id; |
1216 | 1217 | |
... | ... | @@ -1278,6 +1279,14 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ |
1278 | 1279 | $scope.LoadModuleName.push(windowData.mType); |
1279 | 1280 | } |
1280 | 1281 | } |
1282 | + else if (windowData.mType == "THREE_D_ANATOMY") { | |
1283 | + ModuleService.setModuleData(windowData, ThreeDWindowId, $scope.Slidenumber); | |
1284 | + ThreeDWindowId = ThreeDWindowId + 1; | |
1285 | + var isFound = jQuery.inArray(windowData.mType, $scope.LoadModuleName) | |
1286 | + if (isFound == -1) { | |
1287 | + $scope.LoadModuleName.push(windowData.mType); | |
1288 | + } | |
1289 | + } | |
1281 | 1290 | |
1282 | 1291 | } |
1283 | 1292 | } |
... | ... | @@ -1323,6 +1332,14 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ |
1323 | 1332 | ModuleService.setModuleData(windowData, CAWindowId, $scope.Slidenumber); |
1324 | 1333 | |
1325 | 1334 | } |
1335 | + else if (windowData.mType == "THREE_D_ANATOMY") { | |
1336 | + var isFound = jQuery.inArray(windowData.mType, $scope.LoadModuleName) | |
1337 | + if (isFound == -1) { | |
1338 | + $scope.LoadModuleName.push(windowData.mType); | |
1339 | + } | |
1340 | + ModuleService.setModuleData(windowData, ThreeDWindowId, $scope.Slidenumber); | |
1341 | + | |
1342 | + } | |
1326 | 1343 | |
1327 | 1344 | } |
1328 | 1345 | |
... | ... | @@ -1411,10 +1428,22 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ |
1411 | 1428 | if (CAData != undefined && CAData.length > 0) { |
1412 | 1429 | $scope.loadClinicalAnimationModule(); |
1413 | 1430 | } |
1431 | + } | |
1432 | + else if (moduleName == "THREE_D_ANATOMY") { | |
1433 | + var ThreeDData = ModuleService.getModuleData(moduleName); | |
1414 | 1434 | |
1435 | + if (ThreeDData != undefined && ThreeDData.length > 0) { | |
1436 | + $scope.load3DAnatomyModule(); | |
1437 | + } | |
1415 | 1438 | } |
1416 | 1439 | |
1417 | 1440 | } |
1441 | + $scope.load3DAnatomyModule = function () { | |
1442 | + $rootScope.isCallFromOtherModule = true; | |
1443 | + $('#parentcustomDiv').append($('<div id="theeDCustomModuleDiv' + $scope.Slidenumber + '"></div>')); | |
1444 | + $e = $('#theeDCustomModuleDiv' + $scope.Slidenumber).append("<threed-anatomy-directive></threed-anatomy-directive>"); | |
1445 | + $compile($e)($scope); | |
1446 | + } | |
1418 | 1447 | $scope.loadClinicalAnimationModule = function () { |
1419 | 1448 | $rootScope.isCallFromOtherModule = true; |
1420 | 1449 | $('#parentcustomDiv').append($('<div id="caCustomModuleDiv' + $scope.Slidenumber + '"></div>')); | ... | ... |
400-SOURCECODE/AIAHTML5.Web/app/directives/AIADirectives.js
... | ... | @@ -25,4 +25,11 @@ AIA.directive('clinicalAnimationDirective', function (ModuleService) { |
25 | 25 | templateUrl: 'app/views/ca/clinical-animations-detail.html', |
26 | 26 | |
27 | 27 | } |
28 | +}); | |
29 | +AIA.directive('threedAnatomyDirective', function (ModuleService) { | |
30 | + return { | |
31 | + //restrict: 'E', | |
32 | + templateUrl: 'app/views/3dA/3d-anatomy-details.html', | |
33 | + | |
34 | + } | |
28 | 35 | }); |
29 | 36 | \ No newline at end of file | ... | ... |
400-SOURCECODE/AIAHTML5.Web/app/services/ModuleService.js
... | ... | @@ -10,9 +10,9 @@ var moduleDataObj = {}; |
10 | 10 | moduleDataObj.AAData = []; |
11 | 11 | |
12 | 12 | moduleDataObj.DAData = []; |
13 | -moduleDataObj.CAData = []; | |
14 | 13 | moduleDataObj.CIData = []; |
15 | 14 | moduleDataObj.CAData = []; |
15 | +moduleDataObj.ThreeDData = []; | |
16 | 16 | |
17 | 17 | AIA.service('ModuleService', function ($http, DataService) { |
18 | 18 | return { |
... | ... | @@ -142,11 +142,33 @@ AIA.service('ModuleService', function ($http, DataService) { |
142 | 142 | return moduleDataObj.CIData; |
143 | 143 | else if (moduleName == "CLINICAL_ANIMATIONS") |
144 | 144 | return moduleDataObj.CAData; |
145 | + else if (moduleName == "THREE_D_ANATOMY") | |
146 | + return moduleDataObj.ThreeDData; | |
147 | + | |
145 | 148 | }, |
146 | 149 | |
147 | 150 | setModuleData: function (windowData, windowId, SlideNo) { |
148 | 151 | |
149 | - if (windowData.mType == "CLINICAL_ANIMATIONS") { | |
152 | + if (windowData.mType == "THREE_D_ANATOMY") { | |
153 | + moduleDataObj.ThreeDData.push({ | |
154 | + slideId: SlideNo, | |
155 | + currentWindowId: windowId, | |
156 | + mType: windowData.mType, | |
157 | + threeDData:windowData.threeDData, | |
158 | + containsCapturedContent: windowData.containsCapturedContent, | |
159 | + anatomyTitle: windowData.windowTitle, | |
160 | + scrollPosition: windowData.scrollPosition, | |
161 | + imageId: windowData.imageId, | |
162 | + maximised: windowData.maximised, | |
163 | + minimised: windowData.minimised, | |
164 | + id: windowData.id, | |
165 | + position: windowData.position, | |
166 | + size: windowData.size, | |
167 | + contextMenu: windowData.contextMenu, | |
168 | + contentPath: windowData.contentPath | |
169 | + }); | |
170 | + } | |
171 | + else if (windowData.mType == "CLINICAL_ANIMATIONS") { | |
150 | 172 | moduleDataObj.CAData.push({ |
151 | 173 | slideId: SlideNo, |
152 | 174 | currentWindowId: windowId, |
... | ... | @@ -267,6 +289,7 @@ AIA.service('ModuleService', function ($http, DataService) { |
267 | 289 | moduleDataObj.AAData = []; |
268 | 290 | moduleDataObj.CIData = []; |
269 | 291 | moduleDataObj.CAData = []; |
292 | + moduleDataObj.ThreeDData = []; | |
270 | 293 | |
271 | 294 | } |
272 | 295 | }; | ... | ... |
400-SOURCECODE/AIAHTML5.Web/app/views/3dA/3d-anatomy-details.html
1 | 1 | <div> |
2 | 2 | <div ng-include="aap/widget/MainMenu.html"></div> |
3 | - <div ng-init="Open3DModelBody()" id="ThreeDView" class="threeDView" ng-controller="3dAController" style="position: absolute !important;"></div> | |
3 | + <div ng-init="Open3DModelBodyMain()" id="ThreeDView" class="threeDView" ng-controller="3dAController"></div> | |
4 | 4 | </div> |
5 | 5 | \ No newline at end of file | ... | ... |
400-SOURCECODE/AIAHTML5.Web/app/views/3dA/3dA-view.html
400-SOURCECODE/AIAHTML5.Web/app/widget/TopMenu.html
... | ... | @@ -50,7 +50,7 @@ |
50 | 50 | <li><a href="http://interactiveanatomy.com/content/help/about/Adam_Credits_AIA5.html" target="_blank">About A.D.A.M.</a></li>--> |
51 | 51 | </ul> |
52 | 52 | </li> |
53 | - <!--redirecting to Admin | |
53 | + <!--redirecting to Admin--> | |
54 | 54 | <li class="navbarItem"><a ng-click="reDirectURLToAdmin()" ng-show="haveRoleAdmin" style="cursor: pointer;">Admin</a></li> |
55 | 55 | </ul> |
56 | 56 | <ul class="nav navbar-nav navbar-right"> | ... | ... |