Commit 8419cab3353b0755528584f0df24696b656f9856
1 parent
a6c52ec0
add my animation complete and fix other bugs
Showing
25 changed files
with
951 additions
and
102 deletions
.gitignore
... | ... | @@ -43,8 +43,9 @@ $tf*/ |
43 | 43 | 400-SOURCECODE/AIAHTML5.Web/app/views/da/da-view.html.orig |
44 | 44 | 400-SOURCECODE/.vs/config/applicationhost.config |
45 | 45 | 400-SOURCECODE/.vs/config/applicationhost.config |
46 | -400-SOURCECODE/AIAHTML5.ADMIN.Web | |
47 | 46 | 400-SOURCECODE/AIAHTML5.ADMIN.API/LogDetailsFile/LicenseCreation/LicenseCreation-30-11-18.txt |
48 | 47 | 400-SOURCECODE/AIAHTML5.Web/Web.config |
49 | -400-SOURCECODE/AIAHTML5.Web/Web.config | |
50 | -400-SOURCECODE/AIAHTML5.Web/Web.config | |
51 | 48 | \ No newline at end of file |
49 | +# exclude everything | |
50 | +400-SOURCECODE/AIAHTML5.Web/content/data/AnimationMp4/* | |
51 | +# exception to the rule | |
52 | +!400-SOURCECODE/AIAHTML5.Web/content/data/AnimationMp4/.gitkeep.txt | ... | ... |
400-SOURCECODE/AIAHTML5.API/Controllers/AuthenticateController.cs
... | ... | @@ -12,6 +12,10 @@ using AIAHTML5.API.Models; |
12 | 12 | using System.Collections; |
13 | 13 | |
14 | 14 | using System.Data.SqlClient; |
15 | +using System.IO; | |
16 | +using System.Web.Hosting; | |
17 | +using System.Configuration; | |
18 | + | |
15 | 19 | namespace AIAHTML5.API.Controllers |
16 | 20 | { |
17 | 21 | public class AuthenticateController : ApiController |
... | ... | @@ -376,6 +380,32 @@ namespace AIAHTML5.API.Controllers |
376 | 380 | return insertImageResult; |
377 | 381 | } |
378 | 382 | |
383 | + private static int SaveAnimationFile(JArray JsonvidData) | |
384 | + { | |
385 | + int result = 0; | |
386 | + string Path = ConfigurationManager.AppSettings["ANIMATION_HOSTING_SERVER"]; | |
387 | + foreach (JObject item in JsonvidData) | |
388 | + { | |
389 | + string data = item.GetValue("Data").ToString(); | |
390 | + // string folderName = item.GetValue("folderNo").ToString(); | |
391 | + string fileName = item.GetValue("FileName").ToString(); | |
392 | + | |
393 | + //Convert Base64 Encoded string to Byte Array. | |
394 | + byte[] imageBytes = Convert.FromBase64String(data); | |
395 | + | |
396 | + //Save the Byte Array as Image File. | |
397 | + // string Path = HostingEnvironment.MapPath("~/../content/data/AnimationMp4/"+ folderName); | |
398 | + | |
399 | + // DirectoryInfo di = Directory.CreateDirectory(Path); | |
400 | + string filePath = HostingEnvironment.MapPath(Path + fileName + ".mp4"); | |
401 | + | |
402 | + File.WriteAllBytes(filePath, imageBytes); | |
403 | + | |
404 | + } | |
405 | + result = 1; | |
406 | + | |
407 | + return result; | |
408 | + } | |
379 | 409 | |
380 | 410 | |
381 | 411 | [HttpPost] |
... | ... | @@ -413,6 +443,32 @@ namespace AIAHTML5.API.Controllers |
413 | 443 | return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex.Message); |
414 | 444 | } |
415 | 445 | } |
446 | + | |
447 | + [HttpPost] | |
448 | + [Route("api/saveAnimationVideo")] | |
449 | + public HttpResponseMessage saveAnimationVideo([FromBody]JArray JsonvidData) | |
450 | + { | |
451 | + int Status = 0; | |
452 | + | |
453 | + try | |
454 | + { | |
455 | + Status= SaveAnimationFile(JsonvidData); | |
456 | + | |
457 | + if (Status == 1) | |
458 | + { | |
459 | + return new HttpResponseMessage { StatusCode = HttpStatusCode.OK, Content = new StringContent("Save Sccuessful") }; | |
460 | + } | |
461 | + else | |
462 | + { | |
463 | + return new HttpResponseMessage { StatusCode = HttpStatusCode.BadRequest, Content = new StringContent("file not saved") }; | |
464 | + } | |
465 | + } | |
466 | + catch (Exception ex) | |
467 | + { | |
468 | + // Log exception code goes here | |
469 | + return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex.Message); | |
470 | + } | |
471 | + } | |
416 | 472 | // PUT api/authenticate/5 |
417 | 473 | public void Put(int id, [FromBody]string value) |
418 | 474 | { | ... | ... |
400-SOURCECODE/AIAHTML5.API/Controllers/ConfigurationController.cs
1 | -using System; | |
1 | +using System; | |
2 | 2 | using System.Collections.Generic; |
3 | 3 | using System.Linq; |
4 | 4 | using System.Net; |
5 | 5 | using System.Net.Http; |
6 | 6 | using System.Web.Http; |
7 | 7 | using System.Configuration; |
8 | +using Newtonsoft.Json; | |
9 | + | |
8 | 10 | namespace AIAHTML5.API.Controllers |
9 | 11 | { |
10 | 12 | public class ConfigurationController : ApiController |
... | ... | @@ -13,12 +15,21 @@ namespace AIAHTML5.API.Controllers |
13 | 15 | [HttpGet] |
14 | 16 | public HttpResponseMessage GetConfigurationvalues() |
15 | 17 | { |
16 | - // int current_year = Int32.Parse(ConfigurationManager.AppSettings["Copyrightyear"]); | |
17 | - | |
18 | - int current_year = DateTime.Now.Year; | |
18 | + dynamic responseData; | |
19 | + MyConfig mconfig = new MyConfig(); | |
20 | + mconfig.current_year= DateTime.Now.Year; | |
21 | + mconfig.serverPath = ConfigurationManager.AppSettings["ANIMATION_HOSTING_SERVER"]; | |
22 | + mconfig.fileSize = Int32.Parse(ConfigurationManager.AppSettings["UploadMaxFileSize"]); | |
19 | 23 | |
20 | - HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK, current_year); | |
21 | - return response; | |
24 | + responseData = JsonConvert.SerializeObject(mconfig); | |
25 | + | |
26 | + return new HttpResponseMessage { StatusCode = HttpStatusCode.OK, Content = new StringContent(responseData) }; | |
22 | 27 | } |
23 | 28 | } |
29 | +} | |
30 | +public class MyConfig | |
31 | +{ | |
32 | + public int current_year { get; set; } | |
33 | + public string serverPath { get; set; } | |
34 | + public int fileSize { get; set; } | |
24 | 35 | } |
25 | 36 | \ No newline at end of file | ... | ... |
400-SOURCECODE/AIAHTML5.API/Web.config
... | ... | @@ -31,7 +31,9 @@ |
31 | 31 | </log4net> |
32 | 32 | |
33 | 33 | <appSettings> |
34 | - <add key="Copyrightyear" value="2018" /> | |
34 | + <add key="ANIMATION_HOSTING_SERVER" value="~/../content/data/AnimationMp4/" /> | |
35 | + <!-- set to 10mb upload file size for single file at a time --> | |
36 | + <add key="UploadMaxFileSize" value="10485760" /> | |
35 | 37 | |
36 | 38 | <add key="SenderEmailAddress" value="support@interactiveanatomy.com" /> |
37 | 39 | <!--<add key="SenderEmailAddress" value="support@interactiveanatomy.com" />--> |
... | ... | @@ -45,7 +47,6 @@ |
45 | 47 | <add key="Site_Url" value ="http://qa.beta.interactiveanatomy.com/"/> |
46 | 48 | <add key ="HostAddress" value="10.100.12.13" /> |
47 | 49 | <add key="AdminSupport" value="sumit.maheshwari@ebix.com,nikita.kulshreshtha@ebix.com"/> |
48 | - <!-- <add key ="AIADatabaseV5Context" value="Data Source=UAT_WEB_SERVER\SQLEXPRESS;Initial Catalog=AIADatabaseV5;User ID=aia_dev;Password=aia@!@#$;"/>--> | |
49 | 50 | <add key ="LogoPath" value="~/content/images/logo.png"/> |
50 | 51 | <add key ="UnblockUserEmailTemplate" value="~/Templates/unblock-User.html"/> |
51 | 52 | <add key ="ForgotPasswordEmailTemplate" value="~/Templates/forgot-Password.html"/> |
... | ... | @@ -53,13 +54,15 @@ |
53 | 54 | |
54 | 55 | |
55 | 56 | <add key ="AIADatabaseV5Context" value="Data Source=192.168.90.53;Initial Catalog=AIADatabaseV5;User ID=AIA_Dev;Password=india123;"/> |
56 | - | |
57 | + | |
57 | 58 | </appSettings> |
58 | 59 | |
59 | 60 | |
60 | 61 | <system.web> |
61 | 62 | <compilation debug="true" targetFramework="4.5" /> |
62 | - <httpRuntime targetFramework="4.5" /> | |
63 | + <!-- maxRequestLength allow in KB--> | |
64 | + <!-- set 100mb for myanimation request posted through API to save on server --> | |
65 | + <httpRuntime targetFramework="4.5" maxRequestLength="102400" /> | |
63 | 66 | <customErrors mode="Off"/> |
64 | 67 | |
65 | 68 | </system.web> | ... | ... |
400-SOURCECODE/AIAHTML5.Web/Web.config
... | ... | @@ -21,7 +21,7 @@ |
21 | 21 | |
22 | 22 | </location> |
23 | 23 | <system.webServer> |
24 | - <!--<rewrite> | |
24 | + <rewrite> | |
25 | 25 | <rules> |
26 | 26 | <rule name="AngularJS Routes" stopProcessing="true"> |
27 | 27 | <match url=".*" /> |
... | ... | @@ -33,7 +33,7 @@ |
33 | 33 | <action type="Rewrite" url="/" /> |
34 | 34 | </rule> |
35 | 35 | </rules> |
36 | - </rewrite>--> | |
36 | + </rewrite> | |
37 | 37 | <staticContent> |
38 | 38 | |
39 | 39 | <remove fileExtension=".mp3" /> |
... | ... | @@ -44,7 +44,6 @@ |
44 | 44 | <mimeMap fileExtension=".woff2" mimeType="application/font-woff2" /> |
45 | 45 | <mimeMap fileExtension=".mp3" mimeType="audio/mpeg" /> |
46 | 46 | <mimeMap fileExtension=".vtt" mimeType="text/vtt" /> |
47 | - <!--<mimeMap fileExtension=".json" mimeType="application/json" />--> | |
48 | 47 | |
49 | 48 | </staticContent> |
50 | 49 | <defaultDocument enabled="true"> | ... | ... |
400-SOURCECODE/AIAHTML5.Web/app/controllers/3dAController.js
... | ... | @@ -271,7 +271,7 @@ function ($scope, $rootScope, pages, log, $http, DataService, $filter, $location |
271 | 271 | } |
272 | 272 | |
273 | 273 | $rootScope.Open3DModelBodyMain = function () { |
274 | - | |
274 | + $scope.DisableUI(); | |
275 | 275 | if ($rootScope.isCallFromOtherModule) { |
276 | 276 | $scope.ThreeDModuleData = ModuleService.getModuleData("THREE_D_ANATOMY"); |
277 | 277 | $scope.readyToLoad = true; |
... | ... | @@ -528,7 +528,7 @@ function ($scope, $rootScope, pages, log, $http, DataService, $filter, $location |
528 | 528 | |
529 | 529 | if (index != -1) { |
530 | 530 | // remove module which one is loaded |
531 | - $scope.TheeDWindowData.splice(index, 1); | |
531 | + $rootScope.TheeDWindowData.splice(index, 1); | |
532 | 532 | if ($('#' + panelid).html() != undefined) { |
533 | 533 | |
534 | 534 | $('#' + panelid).remove(); | ... | ... |
400-SOURCECODE/AIAHTML5.Web/app/controllers/AIController.js
... | ... | @@ -195,7 +195,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout |
195 | 195 | |
196 | 196 | if (index != -1) { |
197 | 197 | // remove module which one is loaded |
198 | - $scope.AIWindowData.splice(index, 1); | |
198 | + $rootScope.AIWindowData.splice(index, 1); | |
199 | 199 | if ($('#' + panelid).html() != undefined) { |
200 | 200 | |
201 | 201 | $('#' + panelid).remove(); |
... | ... | @@ -993,7 +993,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout |
993 | 993 | } |
994 | 994 | |
995 | 995 | $rootScope.OpenAdamImageViewMain = function () { |
996 | - | |
996 | + $scope.DisableUI(); | |
997 | 997 | if ($rootScope.isCallFromOtherModule) { |
998 | 998 | $scope.AIModuleData = ModuleService.getModuleData("ADAM_IMAGES"); |
999 | 999 | $scope.readyToLoad = true; |
... | ... | @@ -1169,7 +1169,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout |
1169 | 1169 | }); |
1170 | 1170 | |
1171 | 1171 | $('#canvasDivAI_' + windowviewid + ' img').load(function () { |
1172 | - | |
1172 | + $scope.EnableUI(); | |
1173 | 1173 | $scope.JsPanelclick(windowviewid); |
1174 | 1174 | |
1175 | 1175 | var canvas = document.getElementById("canvasAI_" + windowviewid); | ... | ... |
400-SOURCECODE/AIAHTML5.Web/app/controllers/CAController.js
... | ... | @@ -650,7 +650,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout |
650 | 650 | } |
651 | 651 | |
652 | 652 | $rootScope.openCABodyViewMain = function () { |
653 | - | |
653 | + $scope.DisableUI(); | |
654 | 654 | if ($rootScope.isCallFromOtherModule) { |
655 | 655 | $scope.CAModuleData = ModuleService.getModuleData("CLINICAL_ANIMATIONS"); |
656 | 656 | $scope.readyToLoad = true; |
... | ... | @@ -928,6 +928,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout |
928 | 928 | |
929 | 929 | $scope.videoOnLoad = function (windowviewid) |
930 | 930 | { |
931 | + $scope.EnableUI(); | |
931 | 932 | $rootScope.isLoading = false; |
932 | 933 | $('#spinner').css('visibility', 'hidden'); |
933 | 934 | |
... | ... | @@ -1036,7 +1037,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout |
1036 | 1037 | |
1037 | 1038 | if (index != -1) { |
1038 | 1039 | // remove module which one is loaded |
1039 | - $scope.CAWindowData.splice(index, 1); | |
1040 | + $rootScope.CAWindowData.splice(index, 1); | |
1040 | 1041 | if ($('#' + panelid).html() != undefined) { |
1041 | 1042 | |
1042 | 1043 | $('#' + panelid).remove(); | ... | ... |
400-SOURCECODE/AIAHTML5.Web/app/controllers/CIController.js
... | ... | @@ -712,7 +712,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout |
712 | 712 | } |
713 | 713 | |
714 | 714 | $rootScope.openCIBodyViewMain = function () { |
715 | - | |
715 | + $scope.DisableUI(); | |
716 | 716 | if ($rootScope.isCallFromOtherModule) { |
717 | 717 | $scope.CIModuleData = ModuleService.getModuleData("CLINICAL_ILLUSTRATIONS"); |
718 | 718 | $scope.readyToLoad = true; |
... | ... | @@ -945,7 +945,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout |
945 | 945 | |
946 | 946 | |
947 | 947 | $('#canvasDivCI_' + windowviewid + ' img').load(function () { |
948 | - | |
948 | + $scope.EnableUI(); | |
949 | 949 | $rootScope.isLoading = false; |
950 | 950 | $('#spinner').css('visibility', 'hidden'); |
951 | 951 | |
... | ... | @@ -1085,7 +1085,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout |
1085 | 1085 | |
1086 | 1086 | if (index != -1) { |
1087 | 1087 | // remove module which one is loaded |
1088 | - $scope.CIWindowData.splice(index, 1); | |
1088 | + $rootScope.CIWindowData.splice(index, 1); | |
1089 | 1089 | if ($('#' + panelid).html() != undefined) { |
1090 | 1090 | |
1091 | 1091 | $('#' + panelid).remove(); | ... | ... |
400-SOURCECODE/AIAHTML5.Web/app/controllers/CurrBuildController.js
1 | -AIA.controller("CurrBuildController", ["$scope", "$rootScope", "pages", "$log", "Modules", "$http", "$compile", "$location", "$timeout", "ModuleService", "$interval","$window", | |
2 | -function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $timeout, ModuleService, $interval, $window) { | |
1 | +AIA.controller("CurrBuildController", ["$scope", "$rootScope", "pages", "$log", "Modules", "$http", "$compile", "$location", "$timeout", "ModuleService", "$interval","$window","AuthenticationService","AIAConstants", | |
2 | +function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $timeout, ModuleService, $interval, $window, AuthenticationService, AIAConstants) { | |
3 | 3 | |
4 | 4 | $scope.showTabButton = false; |
5 | 5 | $scope.listCurriculumBuilder = null; |
... | ... | @@ -12,6 +12,7 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ |
12 | 12 | $rootScope.contentNotesForSaveCB = []; |
13 | 13 | $rootScope.dynamicUpdatedJsonForSaveCB = ""; |
14 | 14 | $scope.isChangeFromDropDown=false; |
15 | + $rootScope.collectAnimationSource = []; | |
15 | 16 | $scope.IsVisible = function () { |
16 | 17 | $scope.scroll(); |
17 | 18 | } |
... | ... | @@ -46,10 +47,16 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ |
46 | 47 | tinymce.execCommand('mceRemoveEditor', true, 'CBTextArea'); |
47 | 48 | tinymce.execCommand('mceAddEditor', true, 'CBTextArea'); |
48 | 49 | |
49 | - if ($('#' + id).html() != undefined) { | |
50 | - | |
51 | - $('#' + id).remove(); | |
50 | + //remove minized module | |
51 | + if ($('#jsPanel-min-container').html() != undefined) { | |
52 | 52 | |
53 | + $('#jsPanel-min-container').remove(); | |
54 | + | |
55 | + } | |
56 | + //clear if animation data exist | |
57 | + $rootScope.collectAnimationSource=[]; | |
58 | + if ($('#' + id).html() != undefined) { | |
59 | + $('#' + id).remove(); | |
53 | 60 | } |
54 | 61 | } |
55 | 62 | |
... | ... | @@ -428,6 +435,7 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ |
428 | 435 | $rootScope.contentNotesForSaveCB = []; |
429 | 436 | $rootScope.dynamicUpdatedJsonForSaveCB = ""; |
430 | 437 | $scope.isChangeFromDropDown=false; |
438 | + $rootScope.collectAnimationSource = []; | |
431 | 439 | |
432 | 440 | if (($location.url() == "/curriculum-builder")) { |
433 | 441 | $location.url("/curriculum-builder-detail"); |
... | ... | @@ -545,6 +553,7 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ |
545 | 553 | $("#AddSection").addClass("cbAddSection"); |
546 | 554 | $("#openResourceId").removeClass("openResources"); |
547 | 555 | $("#openPictureId").removeClass("OpenPitures"); |
556 | + $("#openAnimationId").removeClass("OpenPitures"); | |
548 | 557 | $("#export_btn").addClass("importExportSection"); |
549 | 558 | $("#import_btn").addClass("importExportSection"); |
550 | 559 | } |
... | ... | @@ -555,6 +564,7 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ |
555 | 564 | $("#AddSection").removeClass("cbAddSection"); |
556 | 565 | $("#openResourceId").addClass("openResources"); |
557 | 566 | $("#openPictureId").addClass("OpenPitures"); |
567 | + $("#openAnimationId").addClass("OpenPitures"); | |
558 | 568 | $("#export_btn").removeClass("importExportSection"); |
559 | 569 | $("#import_btn").removeClass("importExportSection"); |
560 | 570 | } |
... | ... | @@ -576,7 +586,8 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ |
576 | 586 | $('#cbparentcustomDiv').empty(); |
577 | 587 | } |
578 | 588 | |
579 | - if ($scope.SelectedNotes != "" && $scope.SelectedNotes != undefined) { | |
589 | + if (($scope.SelectedNotes != "" && $scope.SelectedNotes != undefined)|| | |
590 | + ($scope.selectedNodeSingleObj.windows != "" && $scope.selectedNodeSingleObj.windows != undefined)) { | |
580 | 591 | tinymce.get("CBTextArea").setContent($scope.SelectedNotes); |
581 | 592 | $scope.LoadModuleName = []; |
582 | 593 | $scope.Slidenumber = $scope.selectedNodeSingleObj._id; |
... | ... | @@ -1163,14 +1174,14 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ |
1163 | 1174 | } |
1164 | 1175 | |
1165 | 1176 | $scope.ExportCurriculum =function() |
1166 | - { | |
1177 | + { | |
1167 | 1178 | var filename = document.getElementById("filename").value; |
1168 | 1179 | if (filename == "" ||filename == " ") |
1169 | 1180 | { |
1170 | 1181 | alert("Curriculum name is empty!"); |
1171 | 1182 | return; |
1172 | 1183 | } |
1173 | - | |
1184 | + $scope.CBDisableUI(); | |
1174 | 1185 | var strFromParent=$scope.selectedNodeSingleObj['structure']; |
1175 | 1186 | var parentLevel=$scope.selectedNodeSingleObj._label; |
1176 | 1187 | var parentId=$scope.selectedNodeSingleObj._id ; |
... | ... | @@ -1200,8 +1211,8 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ |
1200 | 1211 | if(childId!=undefined) |
1201 | 1212 | { |
1202 | 1213 | for (var k = 0; k < $rootScope.contentNotesForSaveCB.length; k++) { |
1203 | - if (($rootScope.contentNotesForSaveCB[k]._id == childId)) { | |
1204 | - $scope.SectionContentForExportCB.push($rootScope.contentNotesForSaveCB[k]); | |
1214 | + if (($rootScope.contentNotesForSaveCB[k]._id == childId)) { | |
1215 | + $scope.SectionContentForExportCB.push($rootScope.contentNotesForSaveCB[k]); | |
1205 | 1216 | break; |
1206 | 1217 | } |
1207 | 1218 | } |
... | ... | @@ -1238,27 +1249,87 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ |
1238 | 1249 | |
1239 | 1250 | }; |
1240 | 1251 | |
1241 | - //add extension | |
1242 | - filename += '.json'; | |
1243 | - var blob = new Blob([angular.toJson($rootScope.dynamicUpdatedJsonForExportCB, true)], { type: 'text/text' }); | |
1244 | - if (window.navigator && window.navigator.msSaveOrOpenBlob) { | |
1245 | - window.navigator.msSaveOrOpenBlob(blob, filename); | |
1246 | - } | |
1247 | - else { | |
1248 | - document.execCommand("SaveAs", true, filename); | |
1249 | - | |
1250 | - var event = document.createEvent('MouseEvents'), | |
1251 | - saveElement = document.createElement('a'); | |
1252 | - saveElement.download = filename; | |
1253 | - saveElement.href = window.URL.createObjectURL(blob); | |
1254 | - saveElement.dataset.downloadurl = ['text/json', saveElement.download, saveElement.href].join(':'); | |
1255 | - event.initEvent('click', true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null); | |
1256 | - saveElement.dispatchEvent(event); | |
1257 | - | |
1252 | + $scope.saveCBwithAnimation("exportcb",filename); | |
1253 | + } | |
1254 | + | |
1255 | + $scope.saveCBwithAnimation=function(downloadtype,filename) | |
1256 | + { | |
1257 | + if($rootScope.collectAnimationSource.length>0) | |
1258 | + { | |
1259 | + var AnimationData=[]; | |
1260 | + function getBase64Image(base64string) { | |
1261 | + return base64string.replace(/^data:video\/(mp4);base64,/, ""); | |
1262 | + } | |
1263 | + | |
1264 | + for (var k = 0; k < $rootScope.collectAnimationSource.length; k++) { | |
1265 | + AnimationData.push({ | |
1266 | + "Data":getBase64Image($rootScope.collectAnimationSource[k].Source), | |
1267 | + //"folderNo":$rootScope.collectAnimationSource[k].imageId, | |
1268 | + "FileName":$rootScope.collectAnimationSource[k].windowTitle, | |
1269 | + | |
1270 | + }); | |
1271 | + | |
1272 | + } | |
1273 | + | |
1274 | + AuthenticationService.saveAnimationVideo(AnimationData) | |
1275 | + .then( | |
1276 | + function (result) { | |
1277 | + if(result!=null) | |
1278 | + { | |
1279 | + $scope.downloadCurriculum(downloadtype,filename); | |
1280 | + $rootScope.collectAnimationSource = []; | |
1281 | + //clear video source after save on server | |
1282 | + // next time it load from server | |
1283 | + for (var i = 0; i < $rootScope.VideoWindowData.length; i++) { | |
1284 | + $rootScope.VideoWindowData[i].videoSource=""; | |
1285 | + } | |
1286 | + } | |
1287 | + }, | |
1288 | + function (error) { | |
1289 | + console.log(' Error in Saving video = ' + error.statusText); | |
1290 | + $scope.CBEnableUI(); | |
1291 | + $rootScope.errorMessage = AIAConstants.SAVE_ANIMATION_ERROR+"\n"+error.ExceptionMessage;; | |
1292 | + $("#messageModal").css('zIndex', 80000000000); | |
1293 | + $("#messageModal").modal('show'); | |
1294 | + }) | |
1258 | 1295 | } |
1296 | + else | |
1297 | + { | |
1298 | + $scope.downloadCurriculum(downloadtype,filename); | |
1299 | + } | |
1300 | + } | |
1301 | + $scope.downloadCurriculum=function(downloadtype,filename) | |
1302 | + { | |
1303 | + //add extension | |
1304 | + filename += '.json'; | |
1305 | + if(downloadtype=="exportcb") | |
1306 | + { | |
1307 | + var blob = new Blob([angular.toJson($rootScope.dynamicUpdatedJsonForExportCB, true)], { type: 'text/text' }); | |
1308 | + } | |
1309 | + else | |
1310 | + { | |
1311 | + var blob = new Blob([angular.toJson($rootScope.dynamicUpdatedJsonForSaveCB, true)], { type: 'text/text' }); | |
1312 | + } | |
1313 | + | |
1314 | + if (window.navigator && window.navigator.msSaveOrOpenBlob) { | |
1315 | + window.navigator.msSaveOrOpenBlob(blob, filename); | |
1316 | + } | |
1317 | + else { | |
1318 | + document.execCommand("SaveAs", true, filename); | |
1319 | + | |
1320 | + var event = document.createEvent('MouseEvents'), | |
1321 | + saveElement = document.createElement('a'); | |
1322 | + saveElement.download = filename; | |
1323 | + saveElement.href = window.URL.createObjectURL(blob); | |
1324 | + saveElement.dataset.downloadurl = ['text/json', saveElement.download, saveElement.href].join(':'); | |
1325 | + event.initEvent('click', true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null); | |
1326 | + saveElement.dispatchEvent(event); | |
1327 | + | |
1328 | + } | |
1259 | 1329 | $rootScope.dynamicUpdatedJsonForExportCB = ""; |
1260 | - $("#filename").val(""); | |
1261 | - | |
1330 | + $rootScope.dynamicUpdatedJsonForSaveCB = ""; | |
1331 | + $("#filename").val(""); | |
1332 | + $scope.CBEnableUI(); | |
1262 | 1333 | } |
1263 | 1334 | |
1264 | 1335 | $rootScope.DeleteSlideSection = function () { |
... | ... | @@ -1637,7 +1708,7 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ |
1637 | 1708 | alert("Curriculum name is empty!"); |
1638 | 1709 | return; |
1639 | 1710 | } |
1640 | - | |
1711 | + $scope.CBDisableUI(); | |
1641 | 1712 | var cbCurrentId = document.getElementById('cbSelect').value; |
1642 | 1713 | if ($rootScope.structureObjForSaveCB.length == 0) { |
1643 | 1714 | $rootScope.structureObjForSaveCB = $rootScope.stru.structure.structure; |
... | ... | @@ -1672,27 +1743,8 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ |
1672 | 1743 | |
1673 | 1744 | }; |
1674 | 1745 | |
1675 | - //add extension | |
1676 | - filename += '.json'; | |
1677 | - | |
1678 | - var blob = new Blob([angular.toJson($rootScope.dynamicUpdatedJsonForSaveCB, true)], { type: 'text/text' }); | |
1679 | - if (window.navigator && window.navigator.msSaveOrOpenBlob) { | |
1680 | - window.navigator.msSaveOrOpenBlob(blob, filename); | |
1681 | - } | |
1682 | - else { | |
1683 | - document.execCommand("SaveAs", true, filename); | |
1684 | - | |
1685 | - var event = document.createEvent('MouseEvents'), | |
1686 | - saveElement = document.createElement('a'); | |
1687 | - saveElement.download = filename; | |
1688 | - saveElement.href = window.URL.createObjectURL(blob); | |
1689 | - saveElement.dataset.downloadurl = ['text/json', saveElement.download, saveElement.href].join(':'); | |
1690 | - event.initEvent('click', true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null); | |
1691 | - saveElement.dispatchEvent(event); | |
1692 | - //window.URL.revokeObjectURL(url); // clean the url.createObjectURL resource | |
1693 | - } | |
1694 | - $rootScope.dynamicUpdatedJsonForSaveCB = ""; | |
1695 | - $("#filename").val(""); | |
1746 | + $scope.saveCBwithAnimation("savecb",filename); | |
1747 | + | |
1696 | 1748 | } |
1697 | 1749 | |
1698 | 1750 | $rootScope.updatedContentFromEditor = function (cbCurrentId) { |
... | ... | @@ -1850,6 +1902,7 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ |
1850 | 1902 | var ADAMIMGWindowId = 0; |
1851 | 1903 | var LabWindowId = 0; |
1852 | 1904 | var PicWindowId = 0; |
1905 | + var AniWindowId = 0; | |
1853 | 1906 | |
1854 | 1907 | //check for multiple windows, if Array.isArray==true |
1855 | 1908 | if (allwindowData != undefined) { |
... | ... | @@ -1864,6 +1917,21 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ |
1864 | 1917 | $scope.LoadModuleName.push(windowData.mType); |
1865 | 1918 | } |
1866 | 1919 | } |
1920 | + else if (windowData.mType == "MY_ANIMATIONS") { | |
1921 | + for (var k = 0; k < $rootScope.collectAnimationSource.length; k++) { | |
1922 | + if($rootScope.collectAnimationSource[k].SlideId==id && $rootScope.collectAnimationSource[k].imageId==windowData.imageId) | |
1923 | + { | |
1924 | + windowData.videoSource=$rootScope.collectAnimationSource[k].Source; | |
1925 | + } | |
1926 | + } | |
1927 | + ModuleService.setModuleData(windowData, AniWindowId); | |
1928 | + AniWindowId = AniWindowId + 1; | |
1929 | + | |
1930 | + var isFound = jQuery.inArray(windowData.mType, $scope.LoadModuleName) | |
1931 | + if (isFound == -1) { | |
1932 | + $scope.LoadModuleName.push(windowData.mType); | |
1933 | + } | |
1934 | + } | |
1867 | 1935 | else if (windowData.mType == "DISSECTIBLE_ANATOMY") { |
1868 | 1936 | ModuleService.setModuleData(windowData, DawindowId); |
1869 | 1937 | DawindowId = DawindowId + 1; |
... | ... | @@ -2009,6 +2077,9 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ |
2009 | 2077 | case "MY_PICTURES": |
2010 | 2078 | $scope.loadMyPictureModule(moduleName); |
2011 | 2079 | break; |
2080 | + case "MY_ANIMATIONS": | |
2081 | + $scope.loadMyAnimationModule(moduleName); | |
2082 | + break; | |
2012 | 2083 | } |
2013 | 2084 | |
2014 | 2085 | } |
... | ... | @@ -2035,6 +2106,28 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ |
2035 | 2106 | } |
2036 | 2107 | } |
2037 | 2108 | |
2109 | + $scope.loadMyAnimationModule = function (moduleName) { | |
2110 | + | |
2111 | + var aniData = ModuleService.getModuleData(moduleName); | |
2112 | + | |
2113 | + if (aniData != undefined && aniData.length > 0) { | |
2114 | + $rootScope.isCallFromOtherModule = true; | |
2115 | + | |
2116 | + var vidSectionExist = document.getElementById('vidCustomModuleDiv'); | |
2117 | + | |
2118 | + if (vidSectionExist == null) { | |
2119 | + $('#cbparentcustomDiv').append($('<div id="vidCustomModuleDiv"></div>')); | |
2120 | + $e = $('#vidCustomModuleDiv').append("<my-animation-directive></my-animation-directive>"); | |
2121 | + $compile($e)($scope); | |
2122 | + } | |
2123 | + else { | |
2124 | + // open lab panel on same slide by open resource | |
2125 | + $rootScope.OpenMyAnimationViewMain(); | |
2126 | + } | |
2127 | + | |
2128 | + } | |
2129 | + } | |
2130 | + | |
2038 | 2131 | $scope.loadLabExerciseModule = function (moduleName) { |
2039 | 2132 | |
2040 | 2133 | var labData = ModuleService.getModuleData(moduleName); |
... | ... | @@ -2078,6 +2171,7 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ |
2078 | 2171 | |
2079 | 2172 | } |
2080 | 2173 | } |
2174 | + | |
2081 | 2175 | $scope.load3DAnatomyModule = function (moduleName) { |
2082 | 2176 | |
2083 | 2177 | var ThreeDData = ModuleService.getModuleData(moduleName); |
... | ... | @@ -2099,6 +2193,7 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ |
2099 | 2193 | |
2100 | 2194 | } |
2101 | 2195 | } |
2196 | + | |
2102 | 2197 | $scope.loadClinicalAnimationModule = function (moduleName) { |
2103 | 2198 | var CAData = ModuleService.getModuleData(moduleName); |
2104 | 2199 | |
... | ... | @@ -2349,6 +2444,57 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ |
2349 | 2444 | } |
2350 | 2445 | |
2351 | 2446 | } |
2447 | + //Save My-Animation activity for CB | |
2448 | + $scope.saveMyAnimationWindowActivity = function (isNotSaved,slideId) { | |
2449 | + if ($rootScope.VideoWindowData != undefined && $rootScope.VideoWindowData.length > 0) { | |
2450 | + for (var i = 0; i < $rootScope.VideoWindowData.length; i++) { | |
2451 | + var isSourceExist = $rootScope.VideoWindowData[i].isSourceExist; | |
2452 | + if(isSourceExist==true) | |
2453 | + { | |
2454 | + var imageId = $rootScope.VideoWindowData[i].imageId; | |
2455 | + var exist = new jinqJs() | |
2456 | + .from($rootScope.collectAnimationSource) | |
2457 | + .where('imageId == ' + imageId) | |
2458 | + .select(); | |
2459 | + if(exist.length<=0) | |
2460 | + { | |
2461 | + $rootScope.collectAnimationSource.push( | |
2462 | + { | |
2463 | + "SlideId": slideId, | |
2464 | + "Source": $rootScope.VideoWindowData[i].videoSource, | |
2465 | + "imageId": $rootScope.VideoWindowData[i].imageId,//use for other purpose until save or export cb | |
2466 | + "windowTitle": $rootScope.VideoWindowData[i].currentViewTitle | |
2467 | + }); | |
2468 | + } | |
2469 | + } | |
2470 | + $scope.updatedWindowListForSaveCB.push({ | |
2471 | + | |
2472 | + containsCapturedContent: true, | |
2473 | + contextMenu: { lockResize: false, hideToolBar: false, hideTitleBar: false }, | |
2474 | + position: { | |
2475 | + top: $rootScope.VideoWindowData[i].top, | |
2476 | + left: $rootScope.VideoWindowData[i].left, | |
2477 | + }, | |
2478 | + size: { | |
2479 | + height: $rootScope.VideoWindowData[i].height, | |
2480 | + width: $rootScope.VideoWindowData[i].width | |
2481 | + }, | |
2482 | + imageId: $rootScope.VideoWindowData[i].imageId, | |
2483 | + minimised: $rootScope.VideoWindowData[i].minimised, | |
2484 | + windowTitle: $rootScope.VideoWindowData[i].currentViewTitle, | |
2485 | + maximised: $rootScope.VideoWindowData[i].maximised, | |
2486 | + mType: $rootScope.VideoWindowData[i].moduleName, | |
2487 | + id: $rootScope.VideoWindowData[i].imageId, | |
2488 | + scrollFlvPosition: { vertical: 0, horizontal: 0 }, | |
2489 | + windowListId: 0, | |
2490 | + videoSource: ""//keeping source in $scope.collectAnimationSource | |
2491 | + }); | |
2492 | + | |
2493 | + } | |
2494 | + if(isNotSaved) | |
2495 | + $rootScope.VideoWindowData = []; | |
2496 | + } | |
2497 | + } | |
2352 | 2498 | |
2353 | 2499 | //Save ATLAS_ANATOMY activity for CB |
2354 | 2500 | $scope.saveAAWindowActivity = function (isNotSaved) { |
... | ... | @@ -2479,6 +2625,7 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ |
2479 | 2625 | |
2480 | 2626 | $scope.updateWindowsContentForSaveCB = function (currentId,isNotSaved) { |
2481 | 2627 | $scope.saveMyPictureWindowActivity(isNotSaved); |
2628 | + $scope.saveMyAnimationWindowActivity(isNotSaved,currentId); | |
2482 | 2629 | $scope.saveDAWindowActivity(isNotSaved); |
2483 | 2630 | $scope.saveAAWindowActivity(isNotSaved); |
2484 | 2631 | $scope.saveCIWindowActivity(isNotSaved); |
... | ... | @@ -2529,7 +2676,6 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ |
2529 | 2676 | |
2530 | 2677 | } |
2531 | 2678 | |
2532 | - | |
2533 | 2679 | }] |
2534 | 2680 | ); |
2535 | 2681 | ... | ... |
400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
... | ... | @@ -610,6 +610,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l |
610 | 610 | |
611 | 611 | $rootScope.openDABodyViewMain = function () { |
612 | 612 | $scope.ScopeVariablesDeclare(); |
613 | + $scope.DisableUI(); | |
613 | 614 | if ($rootScope.isCallFromOtherModule) { |
614 | 615 | $scope.DAModuleData = ModuleService.getModuleData("DISSECTIBLE_ANATOMY"); |
615 | 616 | $scope.readyToLoad=true; |
... | ... | @@ -1136,7 +1137,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l |
1136 | 1137 | rootScope.$apply(function () { |
1137 | 1138 | rootScope.isLoading = true; |
1138 | 1139 | }) |
1139 | - var scope = angular.element(document.geSideBarToggleDAtElementsByClassName("daBodyView")).scope(); | |
1140 | + var scope = angular.element(document.getElementsByClassName("daBodyView")).scope(); | |
1140 | 1141 | scope.$apply(function () { |
1141 | 1142 | |
1142 | 1143 | if ($scope.GetwindowStoreData(windviewid,'isTransparencyActivated')) { |
... | ... | @@ -12187,7 +12188,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l |
12187 | 12188 | |
12188 | 12189 | if (index != -1) { |
12189 | 12190 | // remove module which one is loaded |
12190 | - $scope.DaWindowData.splice(index, 1); | |
12191 | + $rootScope.DaWindowData.splice(index, 1); | |
12191 | 12192 | |
12192 | 12193 | if ($('#' + panelid).html() != undefined) { |
12193 | 12194 | ... | ... |
400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js
... | ... | @@ -177,6 +177,80 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data |
177 | 177 | |
178 | 178 | } |
179 | 179 | |
180 | + $rootScope.OpenMyAnimation = function () { | |
181 | + $rootScope.CloseListManager(); | |
182 | + $rootScope.CloseAnnotationTool(); | |
183 | + | |
184 | + // close list if opened in DA | |
185 | + var searchedTermListPopUp = $("#HomeContainerDiv").find("div[id*='searchedTermListPopUp']"); | |
186 | + for (var i = 0 ; i < searchedTermListPopUp.length; i++) { | |
187 | + var windowviewid = (searchedTermListPopUp[i].id).split('_')[1]; | |
188 | + $('#searchedTermListPopUp_' + windowviewid).css('display', 'none'); | |
189 | + $('#searchedTermListPopUp_' + windowviewid).css("visibility", "hidden"); | |
190 | + $('#searchTermListUl_' + windowviewid).empty(); | |
191 | + } | |
192 | + | |
193 | + var fileupload = document.getElementById("myAnimationFile"); | |
194 | + $timeout(function () { | |
195 | + $(fileupload).trigger('click'); | |
196 | + }, 300); | |
197 | + | |
198 | + $(fileupload).val('');//old file path | |
199 | + fileupload.onchange = function (e) { | |
200 | + | |
201 | + var fileId, file, objFileRead; | |
202 | + if (typeof window.FileReader !== 'function') { | |
203 | + alert("The file API isn't supported on this browser yet."); | |
204 | + return; | |
205 | + } | |
206 | + fileId = document.getElementById('myAnimationFile'); | |
207 | + if (!fileId) { | |
208 | + alert("File couldn't find the element."); | |
209 | + } | |
210 | + else if (!fileId.files) { | |
211 | + alert("This browser doesn't seem to support the `files` property of file inputs."); | |
212 | + } | |
213 | + else if (!fileId.files[0]) { | |
214 | + alert("Please select a file before clicking 'Load'"); | |
215 | + } | |
216 | + else { | |
217 | + file = fileId.files[0]; | |
218 | + var extension = file.name.split(".")[1]; | |
219 | + if (extension == "mp4" && file.type=="video/mp4") { | |
220 | + if (file.size <= $rootScope.MaxOneFileSize) { | |
221 | + var reader = new FileReader(); | |
222 | + reader.onloadend = function () { | |
223 | + var date = new Date(); | |
224 | + var animationId = date.getTime(); | |
225 | + //set default module data | |
226 | + var AniOpenData = { | |
227 | + "mType": 'MY_ANIMATIONS', | |
228 | + "id":animationId,//user for identify resource until save or export cb | |
229 | + "videoSource":reader.result, | |
230 | + "windowTitle": file.name.split(".")[0], | |
231 | + "size": { height: 500, width: 800 } | |
232 | + }; | |
233 | + AIAModuleOpenResourceInfo(AniOpenData); | |
234 | + } | |
235 | + if (file) { | |
236 | + reader.readAsDataURL(file); | |
237 | + } | |
238 | + } | |
239 | + else | |
240 | + { | |
241 | + alert("File size not allow more than 10MB.Please try again"); | |
242 | + } | |
243 | + } | |
244 | + else | |
245 | + { | |
246 | + alert("Please select a file in mp4 format.Please try again"); | |
247 | + } | |
248 | + | |
249 | + } | |
250 | + }; | |
251 | + | |
252 | + } | |
253 | + | |
180 | 254 | $rootScope.openResource = function () { |
181 | 255 | |
182 | 256 | $rootScope.CloseListManager(); |
... | ... | @@ -504,6 +578,20 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data |
504 | 578 | } |
505 | 579 | |
506 | 580 | break; |
581 | + case "MY_ANIMATIONS": | |
582 | + var vidSectionExist = document.getElementById('vidCustomModuleDiv'); | |
583 | + | |
584 | + if (vidSectionExist == null ||vidSectionExist==undefined) { | |
585 | + $(BasemoduleDivId).append($('<div id="vidCustomModuleDiv"></div>')); | |
586 | + var html = $('#vidCustomModuleDiv').append("<my-animation-directive></my-animation-directive>"); | |
587 | + $compile(html)($scope); | |
588 | + } | |
589 | + else { | |
590 | + // open another Animation | |
591 | + $rootScope.OpenMyAnimationViewMain(); | |
592 | + } | |
593 | + | |
594 | + break; | |
507 | 595 | } |
508 | 596 | } |
509 | 597 | |
... | ... | @@ -628,10 +716,12 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data |
628 | 716 | $rootScope.getConfigurationValues = function () { |
629 | 717 | ConfigurationService.getCofigValue() |
630 | 718 | .then( |
631 | - function (configresult) { | |
632 | - $rootScope.current_year = configresult; | |
719 | + function (configresult) { | |
720 | + $rootScope.current_year = configresult.current_year; | |
721 | + $rootScope.aiaAnimationPath = configresult.serverPath; | |
722 | + $rootScope.MaxOneFileSize = configresult.fileSize; | |
633 | 723 | |
634 | - }); | |
724 | + }); | |
635 | 725 | } |
636 | 726 | $rootScope.AuthenticateUser = function (userInfo) { |
637 | 727 | if (navigator.cookieEnabled) { |
... | ... | @@ -1777,6 +1867,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data |
1777 | 1867 | $("#fileMenuAnchor").removeClass("disableFileMenu"); |
1778 | 1868 | $("#openResourceId").removeClass("openResources"); |
1779 | 1869 | $("#openPictureId").removeClass("OpenPitures"); |
1870 | + $("#openAnimationId").removeClass("OpenPitures"); | |
1780 | 1871 | $rootScope.disableMenuoption = "disableMenuoption"; |
1781 | 1872 | $rootScope.newCurriculum = "newCurriculum"; |
1782 | 1873 | $rootScope.openCurriculum = "openCurriculum"; |
... | ... | @@ -1797,6 +1888,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data |
1797 | 1888 | $("#fileMenuAnchor").removeClass("disableFileMenu"); |
1798 | 1889 | $("#openResourceId").removeClass("openResources"); |
1799 | 1890 | $("#openPictureId").removeClass("OpenPitures"); |
1891 | + $("#openAnimationId").removeClass("OpenPitures"); | |
1800 | 1892 | $rootScope.disableMenuoption = "disableMenuoption"; |
1801 | 1893 | $rootScope.newCurriculum = "newCurriculum"; |
1802 | 1894 | $rootScope.openCurriculum = "openCurriculum"; |
... | ... | @@ -1815,6 +1907,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data |
1815 | 1907 | $("#fileMenuAnchor").removeClass("disableFileMenu"); |
1816 | 1908 | $("#openResourceId").removeClass("openResources"); |
1817 | 1909 | $("#openPictureId").removeClass("OpenPitures"); |
1910 | + $("#openAnimationId").removeClass("OpenPitures"); | |
1818 | 1911 | $rootScope.disableMenuoption = "disableMenuoption"; |
1819 | 1912 | $rootScope.newCurriculum = "newCurriculum"; |
1820 | 1913 | $rootScope.openCurriculum = "openCurriculum"; |
... | ... | @@ -1833,6 +1926,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data |
1833 | 1926 | $("#fileMenuAnchor").removeClass("disableFileMenu"); |
1834 | 1927 | $("#openResourceId").removeClass("openResources"); |
1835 | 1928 | $("#openPictureId").removeClass("OpenPitures"); |
1929 | + $("#openAnimationId").removeClass("OpenPitures"); | |
1836 | 1930 | $rootScope.disableMenuoption = "disableMenuoption"; |
1837 | 1931 | $rootScope.newCurriculum = "newCurriculum"; |
1838 | 1932 | $rootScope.openCurriculum = "openCurriculum"; |
... | ... | @@ -1853,6 +1947,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data |
1853 | 1947 | |
1854 | 1948 | $("#labExPdfOption").addClass("disableSubMenu"); |
1855 | 1949 | $("#openPictureId").addClass("OpenPitures"); |
1950 | + $("#openAnimationId").addClass("OpenPitures"); | |
1856 | 1951 | $rootScope.disableMenuoption = "disableMenuoption"; |
1857 | 1952 | $("#fileMenuAnchor").removeClass("disableFileMenu"); |
1858 | 1953 | $("#printAVAnchor").addClass("PrintViewer"); |
... | ... | @@ -1871,7 +1966,8 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data |
1871 | 1966 | $rootScope.openCurriculum = ""; |
1872 | 1967 | $rootScope.saveCurriculam = ""; |
1873 | 1968 | $("#openResourceId").removeClass("openResources"); |
1874 | - $("#openPictureId").removeClass("OpenPitures"); | |
1969 | + $("#openPictureId").removeClass("OpenPitures"); | |
1970 | + $("#openAnimationId").removeClass("OpenPitures"); | |
1875 | 1971 | $rootScope.disableMenuoption = "disableMenuoption"; |
1876 | 1972 | $("#printAVAnchor").addClass("PrintViewer"); |
1877 | 1973 | $("#printAllAVAnchor").addClass("PrintViewer"); |
... | ... | @@ -1888,6 +1984,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data |
1888 | 1984 | $("#fileMenuAnchor").removeClass("disableFileMenu"); |
1889 | 1985 | $("#openResourceId").removeClass("openResources"); |
1890 | 1986 | $("#openPictureId").removeClass("OpenPitures"); |
1987 | + $("#openAnimationId").removeClass("OpenPitures"); | |
1891 | 1988 | $rootScope.disableMenuoption = "disableMenuoption"; |
1892 | 1989 | $rootScope.newCurriculum = "newCurriculum"; |
1893 | 1990 | $rootScope.openCurriculum = "openCurriculum"; |
... | ... | @@ -1907,6 +2004,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data |
1907 | 2004 | $("#fileMenuAnchor").removeClass("disableFileMenu"); |
1908 | 2005 | $("#openResourceId").removeClass("openResources"); |
1909 | 2006 | $("#openPictureId").removeClass("OpenPitures"); |
2007 | + $("#openAnimationId").removeClass("OpenPitures"); | |
1910 | 2008 | $rootScope.disableMenuoption = "disableMenuoption"; |
1911 | 2009 | $rootScope.newCurriculum = "newCurriculum"; |
1912 | 2010 | $rootScope.openCurriculum = "openCurriculum"; |
... | ... | @@ -1925,6 +2023,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data |
1925 | 2023 | $("#fileMenuAnchor").removeClass("disableFileMenu"); |
1926 | 2024 | $("#openResourceId").removeClass("openResources"); |
1927 | 2025 | $("#openPictureId").removeClass("OpenPitures"); |
2026 | + $("#openAnimationId").removeClass("OpenPitures"); | |
1928 | 2027 | $rootScope.disableMenuoption = "disableMenuoption"; |
1929 | 2028 | $rootScope.newCurriculum = "newCurriculum"; |
1930 | 2029 | $rootScope.openCurriculum = "openCurriculum"; |
... | ... | @@ -1984,7 +2083,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data |
1984 | 2083 | } |
1985 | 2084 | else { |
1986 | 2085 | // first panel |
1987 | - paneltopPosition = 680; | |
2086 | + paneltopPosition = 610; | |
1988 | 2087 | } |
1989 | 2088 | |
1990 | 2089 | return paneltopPosition; |
... | ... | @@ -5980,7 +6079,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data |
5980 | 6079 | $('#bodySystems').empty(); |
5981 | 6080 | $('#termList').empty(); |
5982 | 6081 | $('#viewName').empty(); |
5983 | - var modulePanel = $("#HomeContainerDiv").find("div[id*='ImagePanel']").not("div[id*='caImagePanel']").not("div[id*='ThreeDImagePanel']").not("div[id*='ciImagePanel']").not("div[id*='aiImagePanel']").not("div[id*='picImagePanel']"); | |
6082 | + var modulePanel = $("#HomeContainerDiv").find("div[id*='ImagePanel']").not("div[id*='caImagePanel']").not("div[id*='ThreeDImagePanel']").not("div[id*='ciImagePanel']").not("div[id*='aiImagePanel']").not("div[id*='picImagePanel']").not("div[id*='vidImagePanel']"); | |
5984 | 6083 | if (modulePanel != undefined && modulePanel.length>0) { |
5985 | 6084 | for (var i = 0 ; i < modulePanel.length; i++) { |
5986 | 6085 | var paneld = modulePanel[i].id; |
... | ... | @@ -6006,7 +6105,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data |
6006 | 6105 | $('#bodySystems').empty(); |
6007 | 6106 | $('#termList').empty(); |
6008 | 6107 | $('#viewName').empty(); |
6009 | - var modulePanel = $("#HomeContainerDiv").find("div[id*='ImagePanel']").not("div[id*='caImagePanel']").not("div[id*='ThreeDImagePanel']").not("div[id*='ciImagePanel']").not("div[id*='aiImagePanel']").not("div[id*='labImagePanel']").not("div[id*='picImagePanel']"); | |
6108 | + var modulePanel = $("#HomeContainerDiv").find("div[id*='ImagePanel']").not("div[id*='caImagePanel']").not("div[id*='ThreeDImagePanel']").not("div[id*='ciImagePanel']").not("div[id*='aiImagePanel']").not("div[id*='labImagePanel']").not("div[id*='picImagePanel']").not("div[id*='vidImagePanel']"); | |
6010 | 6109 | if (modulePanel != undefined && modulePanel.length>0) { |
6011 | 6110 | for (var index = 0 ; index < modulePanel.length; index++) { |
6012 | 6111 | var paneld = modulePanel[index].id; |
... | ... | @@ -6660,7 +6759,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data |
6660 | 6759 | |
6661 | 6760 | var pageno = 0; |
6662 | 6761 | // select all open module div. |
6663 | - var modulePanel = $("#HomeContainerDiv").find("div[id*='ImagePanel']").not("div[id*='caImagePanel']").not("div[id*='ThreeDImagePanel']").not("div[id*='labImagePanel']"); | |
6762 | + var modulePanel = $("#HomeContainerDiv").find("div[id*='ImagePanel']").not("div[id*='caImagePanel']").not("div[id*='ThreeDImagePanel']").not("div[id*='labImagePanel']").not("div[id*='vidImagePanel']"); | |
6664 | 6763 | |
6665 | 6764 | for (var i = 0 ; i < modulePanel.length; i++) { |
6666 | 6765 | ... | ... |
400-SOURCECODE/AIAHTML5.Web/app/controllers/LabExercController.js
... | ... | @@ -244,7 +244,7 @@ function ($scope, $rootScope, pages, log, $http, $timeout, DataService, $filter, |
244 | 244 | } |
245 | 245 | |
246 | 246 | $rootScope.InitializeLabExerciseMain = function () { |
247 | - | |
247 | + $scope.DisableUI(); | |
248 | 248 | if ($rootScope.isCallFromOtherModule) { |
249 | 249 | $scope.LEModuleData = ModuleService.getModuleData("LAB_EXERCISE"); |
250 | 250 | $scope.readyToLoad = true; |
... | ... | @@ -431,6 +431,7 @@ function ($scope, $rootScope, pages, log, $http, $timeout, DataService, $filter, |
431 | 431 | else { |
432 | 432 | $scope.GetQuizByTopic(windowviewid); |
433 | 433 | } |
434 | + $scope.DisableUI(); | |
434 | 435 | |
435 | 436 | }, |
436 | 437 | function (error) { |
... | ... | @@ -571,7 +572,7 @@ function ($scope, $rootScope, pages, log, $http, $timeout, DataService, $filter, |
571 | 572 | |
572 | 573 | if (index != -1) { |
573 | 574 | // remove module which one is loaded |
574 | - $scope.LEWindowData.splice(index, 1); | |
575 | + $rootScope.LEWindowData.splice(index, 1); | |
575 | 576 | if ($('#' + panelid).html() != undefined) { |
576 | 577 | |
577 | 578 | $('#' + panelid).remove(); | ... | ... |
400-SOURCECODE/AIAHTML5.Web/app/controllers/MyAnimationController.js
0 → 100644
1 | +'use strict'; | |
2 | + | |
3 | +AIA.controller("MyAnimationController", ["$scope", "$window", "$rootScope", "$compile", "$http", "$log", "$location", "$timeout", "ModuleService", "$interval", "AIAConstants", | |
4 | +function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout, ModuleService, $interval, AIAConstants) { | |
5 | + $scope.ObjectAttribute=function(windowviewid) | |
6 | + { | |
7 | + var windata={ | |
8 | + 'multiwinid': windowviewid, | |
9 | + 'videoSource': "", | |
10 | + 'moduleName': '', | |
11 | + 'currentViewTitle': '', | |
12 | + 'parentSlugName': '', | |
13 | + 'currentSlug': '', | |
14 | + 'imageId': '', | |
15 | + 'top': 0, | |
16 | + 'left': 0, | |
17 | + 'width': 0, | |
18 | + 'height': 0, | |
19 | + 'minimised': false, | |
20 | + 'maximised': false, | |
21 | + 'isSourceExist':true | |
22 | + }; | |
23 | + return windata; | |
24 | + } | |
25 | + | |
26 | + $scope.initializeVideoWindowData = function (windowviewid, isOpenWithExistsModule, openPanelNo) { | |
27 | + if (isOpenWithExistsModule || openPanelNo == 0) { | |
28 | + if ($rootScope.VideoWindowData != undefined) { | |
29 | + $rootScope.VideoWindowData.length = 0; | |
30 | + } | |
31 | + else { | |
32 | + $rootScope.VideoWindowData = []; | |
33 | + } | |
34 | + | |
35 | + $rootScope.VideoWindowData.push($scope.ObjectAttribute(windowviewid)); | |
36 | + | |
37 | + } | |
38 | + else { | |
39 | + var isNewWindow = true; | |
40 | + for (var k = 0; k < $rootScope.VideoWindowData.length; k++) { | |
41 | + if ($rootScope.VideoWindowData[k].multiwinid == windowviewid) { | |
42 | + isNewWindow = false; | |
43 | + break; | |
44 | + } | |
45 | + } | |
46 | + | |
47 | + if (isNewWindow) { | |
48 | + $rootScope.VideoWindowData.push($scope.ObjectAttribute(windowviewid)); | |
49 | + } | |
50 | + } | |
51 | + } | |
52 | + | |
53 | + $scope.GetVideowindowStoreData = function (windowviewid, keyname) { | |
54 | + for (var x = 0 ; x < $rootScope.VideoWindowData.length; x++) { | |
55 | + | |
56 | + if ($rootScope.VideoWindowData[x].multiwinid == windowviewid) { | |
57 | + return $rootScope.VideoWindowData[x][keyname]; | |
58 | + } | |
59 | + } | |
60 | + } | |
61 | + | |
62 | + $scope.SetVideowindowStoreData = function (windowviewid, keyname, value) { | |
63 | + for (var x = 0 ; x < $rootScope.VideoWindowData.length; x++) { | |
64 | + | |
65 | + if ($rootScope.VideoWindowData[x].multiwinid == windowviewid) { | |
66 | + $rootScope.VideoWindowData[x][keyname] = value; | |
67 | + } | |
68 | + } | |
69 | + } | |
70 | + | |
71 | + $scope.DisableUI = function () { | |
72 | + | |
73 | + var aniImagePanelConetent = document.getElementsByClassName("jsPanel-content"); | |
74 | + for (var i = 0; i < aniImagePanelConetent.length; i++) { | |
75 | + aniImagePanelConetent[i].style.pointerEvents = "none"; | |
76 | + aniImagePanelConetent[i].style.opacity = "0.7"; | |
77 | + | |
78 | + } | |
79 | + $rootScope.isLoading = true; | |
80 | + $('#spinner').css('visibility', 'visible'); | |
81 | + | |
82 | + // CB module disable all | |
83 | + $('#CBDetailPageDiv').css('pointer-events', 'none'); | |
84 | + $('#CBDetailPageDiv').css('opacity', '0.7'); | |
85 | + } | |
86 | + | |
87 | + $scope.EnableUI = function () { | |
88 | + | |
89 | + var aniImagePanelConetent = document.getElementsByClassName("jsPanel-content"); | |
90 | + for (var i = 0; i < aniImagePanelConetent.length; i++) { | |
91 | + aniImagePanelConetent[i].style.pointerEvents = "auto"; | |
92 | + aniImagePanelConetent[i].style.opacity = "1"; | |
93 | + } | |
94 | + | |
95 | + $rootScope.isLoading = false; | |
96 | + $('#spinner').css('visibility', 'hidden'); | |
97 | + // CB module enable all | |
98 | + $('#CBDetailPageDiv').css('pointer-events', 'auto'); | |
99 | + $('#CBDetailPageDiv').css('opacity', '1'); | |
100 | + | |
101 | + } | |
102 | + | |
103 | + $scope.RemoveJSPanel = function (panelid) { | |
104 | + | |
105 | + var len = (panelid).split("_").length; | |
106 | + var windowviewid = (panelid).split("_")[len - 1]; | |
107 | + | |
108 | + // remove old stored data after close panel | |
109 | + for (var index = 0 ; index < $rootScope.VideoWindowData.length; index++) { | |
110 | + | |
111 | + if ($rootScope.VideoWindowData[index].multiwinid == windowviewid) { | |
112 | + | |
113 | + if (index != -1) { | |
114 | + // remove module which one is loaded | |
115 | + var reffid=$rootScope.VideoWindowData[index].imageId; | |
116 | + $rootScope.VideoWindowData.splice(index, 1); | |
117 | + //remove also stream/source video from close panel from cb | |
118 | + if($rootScope.collectAnimationSource !=undefined) | |
119 | + { | |
120 | + for (var vdx = 0 ; vdx < $rootScope.collectAnimationSource.length; vdx++) { | |
121 | + if(reffid==$rootScope.collectAnimationSource[vdx].imageId) | |
122 | + $rootScope.collectAnimationSource.splice(vdx, 1); | |
123 | + } | |
124 | + } | |
125 | + if ($('#' + panelid).html() != undefined) { | |
126 | + | |
127 | + $('#' + panelid).remove(); | |
128 | + | |
129 | + } | |
130 | + $rootScope.resetjsPanelTop(panelid); | |
131 | + } | |
132 | + } | |
133 | + } | |
134 | + } | |
135 | + $scope.PanelActivity = function () { | |
136 | + | |
137 | + $("#" + $scope.jsPanelID).resizable({ | |
138 | + stop: function (event, ui) { | |
139 | + var len = (event.currentTarget.id).split("_").length; | |
140 | + var windowviewid = (event.currentTarget.id).split("_")[len - 1]; | |
141 | + $scope.SetVideowindowStoreData(windowviewid, 'width', ui.size.width); | |
142 | + $scope.SetVideowindowStoreData(windowviewid, 'height', ui.size.height); | |
143 | + } | |
144 | + }); | |
145 | + | |
146 | + $("#" + $scope.jsPanelID).draggable({ | |
147 | + stop: function (event, ui) { | |
148 | + var len = (event.currentTarget.id).split("_").length; | |
149 | + var windowviewid = (event.currentTarget.id).split("_")[len - 1]; | |
150 | + //var offSets = $(this).offset(); var postions = (this).position(); (this).offsetTop (this).offsetLeft | |
151 | + $scope.SetVideowindowStoreData(windowviewid, 'top', ui.position.top); | |
152 | + $scope.SetVideowindowStoreData(windowviewid, 'left', ui.position.left); | |
153 | + } | |
154 | + }); | |
155 | + // close panel | |
156 | + $(document).on("click", "#" + $scope.jsPanelID + " .jsPanel-hdr .jsPanel-hdr-r .jsPanel-btn-close .jsglyph-remove", function () { | |
157 | + | |
158 | + var panelid = $(event.target).parent().parent().parent().parent().attr('id'); | |
159 | + | |
160 | + $scope.RemoveJSPanel(panelid); | |
161 | + | |
162 | + }); | |
163 | + } | |
164 | + | |
165 | + $rootScope.OpenMyAnimationViewMain = function () { | |
166 | + if ($rootScope.isCallFromOtherModule) { | |
167 | + $scope.DisableUI(); | |
168 | + $scope.VideoModuleData = ModuleService.getModuleData("MY_ANIMATIONS"); | |
169 | + $scope.readyToLoad = true; | |
170 | + $rootScope.VideoLoadComplete = false; | |
171 | + $scope.wincount = 1; | |
172 | + var winlen = $scope.VideoModuleData.length; | |
173 | + var timeint = null; | |
174 | + timeint = $interval(function () { | |
175 | + | |
176 | + if ($scope.readyToLoad == true) { | |
177 | + var windata = $scope.VideoModuleData[$scope.wincount - 1]; | |
178 | + $scope.OpenAnimationView(windata); | |
179 | + | |
180 | + } | |
181 | + $scope.readyToLoad = false; | |
182 | + if ($scope.wincount < winlen && $rootScope.VideoLoadComplete == true) { | |
183 | + $scope.wincount = $scope.wincount + 1; | |
184 | + $rootScope.VideoLoadComplete = false; | |
185 | + $scope.readyToLoad = true; | |
186 | + } | |
187 | + | |
188 | + if ($scope.wincount == winlen && $rootScope.VideoLoadComplete == true) { | |
189 | + $scope.stopInterval(); | |
190 | + $scope.$emit("LoadModuleComplete", "MY_ANIMATIONS"); | |
191 | + } | |
192 | + | |
193 | + | |
194 | + }, 100); | |
195 | + | |
196 | + $scope.stopInterval = function () { | |
197 | + if (angular.isDefined(timeint)) { | |
198 | + $interval.cancel(timeint); | |
199 | + timeint = undefined; | |
200 | + } | |
201 | + | |
202 | + }; | |
203 | + | |
204 | + } | |
205 | + | |
206 | + } | |
207 | + | |
208 | + $scope.OpenAnimationView = function (vidModuleData) { | |
209 | + $scope.VidOpenInOtherModules = vidModuleData; | |
210 | + $rootScope.MULTI_VIEW_ID += 1; | |
211 | + var windowviewid = $rootScope.MULTI_VIEW_ID; | |
212 | + | |
213 | + $scope.initializeVideoWindowData(windowviewid, false, $scope.VidOpenInOtherModules.currentWindowId); | |
214 | + | |
215 | + var moduleName = $scope.VidOpenInOtherModules.mType; | |
216 | + $scope.SetVideowindowStoreData(windowviewid, 'moduleName', moduleName); | |
217 | + // serial no of imageid | |
218 | + var imageId = $scope.VidOpenInOtherModules.id; | |
219 | + | |
220 | + $scope.SetVideowindowStoreData(windowviewid, 'imageId', imageId); | |
221 | + | |
222 | + var videoSource=$scope.VidOpenInOtherModules.videoSource; | |
223 | + | |
224 | + $scope.SetVideowindowStoreData(windowviewid, 'videoSource', videoSource); | |
225 | + | |
226 | + if(videoSource=="" ||videoSource==undefined) | |
227 | + { | |
228 | + $scope.SetVideowindowStoreData(windowviewid, 'isSourceExist', false); | |
229 | + } | |
230 | + | |
231 | + var aiTitle = $scope.VidOpenInOtherModules.anatomyTitle; | |
232 | + $scope.SetVideowindowStoreData(windowviewid, 'currentViewTitle', aiTitle); | |
233 | + localStorage.setItem("currentViewTitle", aiTitle); | |
234 | + var isMaximize = $scope.VidOpenInOtherModules.maximised; | |
235 | + var isMinimize = $scope.VidOpenInOtherModules.minimised; | |
236 | + $scope.SetVideowindowStoreData(windowviewid, 'maximised', isMaximize); | |
237 | + $scope.SetVideowindowStoreData(windowviewid, 'minimised', isMinimize); | |
238 | + | |
239 | + if($location.url()== "/curriculum-builder-detail") { | |
240 | + $scope.SetVideowindowStoreData(windowviewid,'parentSlugName',($location.url()).replace('/', '')); | |
241 | + } | |
242 | + else | |
243 | + { | |
244 | + $scope.SetVideowindowStoreData(windowviewid,'parentSlugName','');//back to home screen | |
245 | + } | |
246 | + | |
247 | + $scope.loadMyAnimation(windowviewid); | |
248 | + | |
249 | + } | |
250 | + | |
251 | + $scope.loadMyAnimation = function (windowviewid) { | |
252 | + $scope.DisableUI(); | |
253 | + $scope.jsPanelID = 'vidImagePanel' + '_' + windowviewid; | |
254 | + var tittle = $scope.GetVideowindowStoreData(windowviewid, 'currentViewTitle'); | |
255 | + var animationSource = $scope.GetVideowindowStoreData(windowviewid, 'videoSource'); | |
256 | + var isSourceExist = $scope.GetVideowindowStoreData(windowviewid, 'isSourceExist'); | |
257 | + | |
258 | + if(isSourceExist==true) | |
259 | + { | |
260 | + // get animation from uploaded stream | |
261 | + if (animationSource.indexOf('base64') == -1) { | |
262 | + animationSource="data:video/mp4;base64,"+animationSource; | |
263 | + } | |
264 | + } | |
265 | + else | |
266 | + { | |
267 | + // get animation from server | |
268 | + animationSource=$scope.aiaAnimationPath+ tittle + ".mp4"; | |
269 | + } | |
270 | + | |
271 | + var playerScript = "~/../libs/video_4_12_11/video_4_12_11.js"; | |
272 | + | |
273 | + if ($rootScope.isCallFromOtherModule) { | |
274 | + // open JS panel for curriculum with define cornonate in CB jason | |
275 | + $scope.jsPanelWidth = $scope.VidOpenInOtherModules.size.width;//1000; | |
276 | + if ($scope.VidOpenInOtherModules.size.width < 800) | |
277 | + $scope.jsPanelWidth = 800; | |
278 | + | |
279 | + $scope.jsPanelHeight = $scope.VidOpenInOtherModules.size.height; | |
280 | + if ($scope.VidOpenInOtherModules.size.height > 360) | |
281 | + $scope.jsPanelHeight = 360; | |
282 | + $scope.jsPanelLeft = 320; | |
283 | + $scope.jsPanelTop = $rootScope.cBModulejsPanelTop(); | |
284 | + if($location.url()!= "/curriculum-builder-detail") { | |
285 | + $scope.jsPanelLeft = 1; | |
286 | + } | |
287 | + | |
288 | + } | |
289 | + else { | |
290 | + $scope.jsPanelWidth = $(window).outerWidth() - 20; | |
291 | + $scope.jsPanelHeight = $(window).outerHeight() - 105; | |
292 | + $scope.jsPanelLeft = 1; | |
293 | + $scope.jsPanelTop = 70; | |
294 | + } | |
295 | + | |
296 | + | |
297 | + if (animationSource.length > 0 ) { | |
298 | + $scope.jsPanelVideo = $.jsPanel({ | |
299 | + id: $scope.jsPanelID, | |
300 | + selector: '.videoView', | |
301 | + theme: 'success', | |
302 | + currentController: 'MyAnimationController', | |
303 | + parentSlug: $scope.GetVideowindowStoreData(windowviewid, 'parentSlugName'), | |
304 | + content: '<script src="' + playerScript + '"></script><script>$(document).ready(function(){videojs("#playerinlineVideo_' + windowviewid + '").pause();});</script>' + | |
305 | + '<div id="pid" class="row"><div id="divplayerinlineVideo_' + windowviewid + '" class="col-sm-12" align="center" width="640" height="480"><video width="640" height="400"' + | |
306 | + 'class="ADAM_Video video-js vjs-default-skin vjs-big-play-centered" type="$videoType" id="playerinlineVideo_' + windowviewid + '" onloadstart="videoOnLoad(event)"' + | |
307 | + // ' poster="' + poster + '"' + | |
308 | + 'controls="true" preload="none" allowfullscreen="true" allowscriptaccess="always" ' + | |
309 | + // ' ad="' + admp4 + '"' + | |
310 | + ' nonad="' + animationSource + '"' + | |
311 | + //' hd="' + hdvideo + '" ' + | |
312 | + ' nonhd="' + animationSource + '">' + | |
313 | + ' <source type="video/mp4" src="' + animationSource + '">' + | |
314 | + //' <source type="video/webm" src="' + webm + '">' + | |
315 | + // ' <source type="video/ogv" src="' + ogv + '">' + | |
316 | + // ' <track src="' + vtt + '" kind="captions" srclang="en" label="On">'+ | |
317 | + '<object width="640" height="400"' + | |
318 | + ' type="application/x-shockwave-flash" data="//vjs.zencdn.net/3.2/video-js.swf"><param name="allowfullscreen" value="true">' + | |
319 | + ' <param name="allowscriptaccess" value="always"><param name="movie" value="//vjs.zencdn.net/3.2/video-js.swf">' + | |
320 | + ' <param name="flashvars" ng-value="controls=true&file=' + animationSource + '"><img ng-src="content/images/common/player/frameaccuracy_logo.jpg" style="height:80%;" alt="Here we are" title="No video playback capabilities"></object></video></div></div>', | |
321 | + | |
322 | + title: tittle, | |
323 | + position: { | |
324 | + top: $scope.jsPanelTop, | |
325 | + left: $scope.jsPanelLeft | |
326 | + }, | |
327 | + | |
328 | + size: { | |
329 | + width: $scope.jsPanelWidth, | |
330 | + height: $scope.jsPanelHeight | |
331 | + }, | |
332 | + | |
333 | + | |
334 | + }); | |
335 | + | |
336 | + var isMaximize = $scope.GetVideowindowStoreData(windowviewid, 'maximised'); | |
337 | + var isMinimize = $scope.GetVideowindowStoreData(windowviewid, 'minimised'); | |
338 | + if (isMaximize) { | |
339 | + $scope.jsPanelVideo.maximize(); | |
340 | + } | |
341 | + else if (isMinimize) { | |
342 | + $scope.jsPanelVideo.minimize(); | |
343 | + } | |
344 | + else { | |
345 | + $scope.jsPanelVideo.normalize(); | |
346 | + } | |
347 | + $scope.SetVideowindowStoreData(windowviewid, 'top', $scope.jsPanelTop); | |
348 | + $scope.SetVideowindowStoreData(windowviewid, 'left', $scope.jsPanelLeft); | |
349 | + $scope.SetVideowindowStoreData(windowviewid, 'width', $scope.jsPanelWidth); | |
350 | + $scope.SetVideowindowStoreData(windowviewid, 'height', $scope.jsPanelHeight); | |
351 | + | |
352 | + $scope.SetVideowindowStoreData(windowviewid, 'currentSlug', 'clinical-animations-detail'); | |
353 | + $('html, body').animate({ scrollTop: 0 }); | |
354 | + $rootScope.openViews.push( | |
355 | + { | |
356 | + "module": $rootScope.currentActiveModuleTitle, "bodyView": tittle, "state": 'max', "BodyViewId": $rootScope.currentBodyViewId, | |
357 | + "slug": $scope.GetVideowindowStoreData(windowviewid, 'currentSlug') | |
358 | + }); | |
359 | + | |
360 | + | |
361 | + var jspContentHeight = $('.jsPanel-content').height(); | |
362 | + var videoHeight = $('#divplayerinlineVideo_'+ windowviewid +' div').height(); | |
363 | + if (videoHeight <= 0) | |
364 | + videoHeight = 360; | |
365 | + var textH = $('.video-subtitle').height(); | |
366 | + textH = textH + 40; | |
367 | + var blackBorderHeight = jspContentHeight - (videoHeight + textH); | |
368 | + | |
369 | + if ($('.jsPanel-content').length > 0) { | |
370 | + $('.video-subtitle').css('margin-bottom', blackBorderHeight); | |
371 | + $('#divplayerinlineVideo_'+ windowviewid ).css('background', '#fff'); | |
372 | + //Android > Clinical Animations > The animation does not fit to the screen in the Landscape mode. | |
373 | + var $ua = navigator.userAgent; | |
374 | + if (($ua.match(/(iPod|iPhone|iPad|android)/i))) { $('.jsPanel-content').css("width", "100%"); } | |
375 | + } | |
376 | + | |
377 | + } | |
378 | + | |
379 | + if (!$rootScope.isCallFromOtherModule) { | |
380 | + $('#VideoView').css("height", $(window).outerHeight() - 20); | |
381 | + | |
382 | + $('#VideoView').css("width", $(window).outerWidth() - 30); | |
383 | + | |
384 | + } | |
385 | + //Calling methode for save Js Panel Activity for SaveCB | |
386 | + $scope.PanelActivity(); | |
387 | + } | |
388 | + | |
389 | + $scope.videoOnLoad = function (windowviewid) | |
390 | + { | |
391 | + $scope.EnableUI(); | |
392 | + if ($rootScope.isCallFromOtherModule) { | |
393 | + $rootScope.VideoLoadComplete = true; | |
394 | + } | |
395 | + $scope.JsPanelclick(windowviewid); | |
396 | + | |
397 | + } | |
398 | + | |
399 | + $scope.JsPanelclick = function (windowviewid) { | |
400 | + | |
401 | + //reset option list manager and annotation | |
402 | + //call when module loaded | |
403 | + $rootScope.resetMenuOption(); | |
404 | + // call from while open module in CB | |
405 | + $("#vidImagePanel_" + windowviewid).on('click', function (event) { | |
406 | + var pnlName = event.currentTarget.id; | |
407 | + $rootScope.resetMenuOptionOnClick(pnlName); | |
408 | + | |
409 | + }); | |
410 | + } | |
411 | + | |
412 | + }]); | |
413 | + | |
414 | + function videoOnLoad(event) { | |
415 | + | |
416 | + console.log('video loaded') | |
417 | + var scope = angular.element(document.getElementById("VideoView")).scope(); | |
418 | + // var len = (event.target.id).split("_").length; | |
419 | + var windowviewid = (event.target.id).split("_")[1]; | |
420 | + | |
421 | + scope.$apply(function () { | |
422 | + scope.videoOnLoad(windowviewid); | |
423 | + }); | |
424 | + } | |
0 | 425 | \ No newline at end of file | ... | ... |
400-SOURCECODE/AIAHTML5.Web/app/controllers/MyPictureController.js
... | ... | @@ -91,6 +91,38 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout |
91 | 91 | } |
92 | 92 | } |
93 | 93 | } |
94 | + | |
95 | + $scope.DisableUI = function () { | |
96 | + | |
97 | + var myImagePanelConetent = document.getElementsByClassName("jsPanel-content"); | |
98 | + for (var i = 0; i < myImagePanelConetent.length; i++) { | |
99 | + myImagePanelConetent[i].style.pointerEvents = "none"; | |
100 | + myImagePanelConetent[i].style.opacity = "0.7"; | |
101 | + | |
102 | + } | |
103 | + $rootScope.isLoading = true; | |
104 | + $('#spinner').css('visibility', 'visible'); | |
105 | + | |
106 | + // CB module disable all | |
107 | + $('#CBDetailPageDiv').css('pointer-events', 'none'); | |
108 | + $('#CBDetailPageDiv').css('opacity', '0.7'); | |
109 | + } | |
110 | + | |
111 | + $scope.EnableUI = function () { | |
112 | + | |
113 | + var myImagePanelConetent = document.getElementsByClassName("jsPanel-content"); | |
114 | + for (var i = 0; i < myImagePanelConetent.length; i++) { | |
115 | + myImagePanelConetent[i].style.pointerEvents = "auto"; | |
116 | + myImagePanelConetent[i].style.opacity = "1"; | |
117 | + } | |
118 | + | |
119 | + $rootScope.isLoading = false; | |
120 | + $('#spinner').css('visibility', 'hidden'); | |
121 | + // CB module enable all | |
122 | + $('#CBDetailPageDiv').css('pointer-events', 'auto'); | |
123 | + $('#CBDetailPageDiv').css('opacity', '1'); | |
124 | + | |
125 | + } | |
94 | 126 | |
95 | 127 | $scope.RemoveJSPanel = function (panelid) { |
96 | 128 | |
... | ... | @@ -104,7 +136,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout |
104 | 136 | |
105 | 137 | if (index != -1) { |
106 | 138 | // remove module which one is loaded |
107 | - $scope.PICWindowData.splice(index, 1); | |
139 | + $rootScope.PICWindowData.splice(index, 1); | |
108 | 140 | if ($('#' + panelid).html() != undefined) { |
109 | 141 | |
110 | 142 | $('#' + panelid).remove(); |
... | ... | @@ -145,7 +177,8 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout |
145 | 177 | }); |
146 | 178 | } |
147 | 179 | |
148 | - $rootScope.OpenMyPictureViewMain = function () { | |
180 | + $rootScope.OpenMyPictureViewMain = function () { | |
181 | + $scope.DisableUI(); | |
149 | 182 | if ($rootScope.isCallFromOtherModule) { |
150 | 183 | $scope.PicModuleData = ModuleService.getModuleData("MY_PICTURES"); |
151 | 184 | $scope.readyToLoad = true; |
... | ... | @@ -314,7 +347,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout |
314 | 347 | $rootScope.LoadCBSavedAnnotation("canvasPIC_"+windowviewid,"canvasPaintPIC_"+windowviewid,annotationData); |
315 | 348 | } |
316 | 349 | } |
317 | - | |
350 | + $scope.EnableUI(); | |
318 | 351 | $rootScope.PicLoadComplete = true; |
319 | 352 | }); |
320 | 353 | ... | ... |
400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js
... | ... | @@ -415,7 +415,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou |
415 | 415 | } |
416 | 416 | |
417 | 417 | $rootScope.openAAModuleItemMain = function () { |
418 | - | |
418 | + $scope.DisableUI(); | |
419 | 419 | if ($rootScope.isCallFromOtherModule) { |
420 | 420 | $scope.AAModuleData = ModuleService.getModuleData("ATLAS_ANATOMY"); |
421 | 421 | $scope.readyToLoad=true; |
... | ... | @@ -3294,7 +3294,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou |
3294 | 3294 | |
3295 | 3295 | if (index != -1) { |
3296 | 3296 | // remove module which one is loaded |
3297 | - $scope.AAWindowData.splice(index, 1); | |
3297 | + $rootScope.AAWindowData.splice(index, 1); | |
3298 | 3298 | if ($('#' + panelid).html() != undefined) { |
3299 | 3299 | |
3300 | 3300 | $('#' + panelid).remove(); | ... | ... |
400-SOURCECODE/AIAHTML5.Web/app/directives/AIADirectives.js
... | ... | @@ -53,4 +53,11 @@ AIA.directive('myPictureDirective', function (ModuleService) { |
53 | 53 | templateUrl: 'app/views/MyPicture/MyPicture.html', |
54 | 54 | |
55 | 55 | } |
56 | +}); | |
57 | +AIA.directive('myAnimationDirective', function (ModuleService) { | |
58 | + return { | |
59 | + //restrict: 'E', | |
60 | + templateUrl: 'app/views/MyAnimation/MyAnimation.html', | |
61 | + | |
62 | + } | |
56 | 63 | }); |
57 | 64 | \ No newline at end of file | ... | ... |
400-SOURCECODE/AIAHTML5.Web/app/main/AIA.js
... | ... | @@ -216,6 +216,13 @@ AIA.constant('pages', [ |
216 | 216 | pageController: 'MyPictureController' |
217 | 217 | |
218 | 218 | }, |
219 | + { //added for myanimation | |
220 | + name: 'MyAnimation', | |
221 | + pageSlug: 'my-animation', | |
222 | + pageUrl: 'app/views/MyAnimation/MyAnimation.html', | |
223 | + pageController: 'MyAnimationController' | |
224 | + | |
225 | + }, | |
219 | 226 | |
220 | 227 | ]); |
221 | 228 | |
... | ... | @@ -535,7 +542,8 @@ AIA.constant("AIAConstants", { |
535 | 542 | "ERROR_IN_FECTHING_DETAILS": "Error in fecthing details.", |
536 | 543 | "PLEASE_ENTER_SEARCH_TEXT": "Please enter the text to search.", |
537 | 544 | "SETTINGS_SAVED": "Your current settings has been saved.", |
538 | - "SETTING_SAVE_ERROR":"There is some error in saving your current settings. Please try after sometime." | |
545 | + "SETTING_SAVE_ERROR":"There is some error in saving your current settings. Please try after sometime.", | |
546 | + "SAVE_ANIMATION_ERROR":"There is some error while saving your animation. Please try after sometime." | |
539 | 547 | }) |
540 | 548 | |
541 | 549 | ... | ... |
400-SOURCECODE/AIAHTML5.Web/app/services/AuthenticationService.js
1 | -AIA.factory('AuthenticationService', function ($http, $q, $rootScope, LoginConstants) { | |
1 | +AIA.factory('AuthenticationService', function ($http, $q, $rootScope, LoginConstants, AIAConstants) { | |
2 | 2 | return { |
3 | 3 | authenticateUser: function (userInfo) { |
4 | 4 | var deferred = $q.defer(); |
... | ... | @@ -64,7 +64,24 @@ |
64 | 64 | }); |
65 | 65 | return deferred.promise; |
66 | 66 | }, |
67 | + | |
68 | + saveAnimationVideo: function (vidData) { | |
69 | + var deferred = $q.defer(); | |
67 | 70 | |
71 | + $http.post('/API/api/saveAnimationVideo', JSON.stringify(vidData), { | |
72 | + headers: { | |
73 | + 'Content-Type': 'application/json' | |
74 | + } | |
75 | + }) | |
76 | + .success(function (data, status, headers, config) { | |
77 | + console.log('success') | |
78 | + deferred.resolve(data); | |
79 | + }).error(function (data, status, headers, config) { | |
80 | + console.log('error') | |
81 | + deferred.reject(data); | |
82 | + }); | |
83 | + return deferred.promise; | |
84 | + }, | |
68 | 85 | |
69 | 86 | validateClientSite: function (clientInfo) { |
70 | 87 | var deferred = $q.defer(); | ... | ... |
400-SOURCECODE/AIAHTML5.Web/app/services/ModuleService.js
... | ... | @@ -16,6 +16,7 @@ moduleDataObj.ThreeDData = []; |
16 | 16 | moduleDataObj.AIData = []; |
17 | 17 | moduleDataObj.LabData = []; |
18 | 18 | moduleDataObj.PICData = []; |
19 | +moduleDataObj.VideoData = []; | |
19 | 20 | |
20 | 21 | AIA.service('ModuleService', function ($http, DataService) { |
21 | 22 | return { |
... | ... | @@ -153,6 +154,8 @@ AIA.service('ModuleService', function ($http, DataService) { |
153 | 154 | return moduleDataObj.LabData; |
154 | 155 | else if (moduleName == "MY_PICTURES") |
155 | 156 | return moduleDataObj.PICData; |
157 | + else if (moduleName == "MY_ANIMATIONS") | |
158 | + return moduleDataObj.VideoData; | |
156 | 159 | |
157 | 160 | }, |
158 | 161 | |
... | ... | @@ -176,6 +179,23 @@ AIA.service('ModuleService', function ($http, DataService) { |
176 | 179 | annotationData: windowData.annotationData |
177 | 180 | }); |
178 | 181 | } |
182 | + else if (windowData.mType == "MY_ANIMATIONS") { | |
183 | + moduleDataObj.VideoData.push({ | |
184 | + currentWindowId: windowId, | |
185 | + mType: windowData.mType, | |
186 | + containsCapturedContent: windowData.containsCapturedContent, | |
187 | + anatomyTitle: windowData.windowTitle, | |
188 | + scrollPosition: windowData.scrollPosition, | |
189 | + imageId: windowData.imageId, | |
190 | + videoSource: windowData.videoSource, | |
191 | + maximised: windowData.maximised, | |
192 | + minimised: windowData.minimised, | |
193 | + id: windowData.id, | |
194 | + position: windowData.position, | |
195 | + size: windowData.size, | |
196 | + contextMenu: windowData.contextMenu | |
197 | + }); | |
198 | + } | |
179 | 199 | else if (windowData.mType == "LAB_EXERCISE") { |
180 | 200 | moduleDataObj.LabData.push({ |
181 | 201 | currentWindowId: windowId, |
... | ... | @@ -350,6 +370,7 @@ AIA.service('ModuleService', function ($http, DataService) { |
350 | 370 | moduleDataObj.AIData = []; |
351 | 371 | moduleDataObj.LabData = []; |
352 | 372 | moduleDataObj.PICData = []; |
373 | + moduleDataObj.VideoData = []; | |
353 | 374 | |
354 | 375 | }, |
355 | 376 | ClearWinDataByModule: function (moduleName) { |
... | ... | @@ -382,6 +403,9 @@ AIA.service('ModuleService', function ($http, DataService) { |
382 | 403 | else if (moduleName == "MY_PICTURES") { |
383 | 404 | moduleDataObj.PICData = []; |
384 | 405 | } |
406 | + else if (moduleName == "MY_ANIMATIONS") { | |
407 | + moduleDataObj.VideoData = []; | |
408 | + } | |
385 | 409 | |
386 | 410 | }, |
387 | 411 | ... | ... |
400-SOURCECODE/AIAHTML5.Web/app/views/MyAnimation/MyAnimation.html
0 → 100644
1 | +<div> | |
2 | + <div ng-include="aap/widget/MainMenu.html"></div> | |
3 | + <div ng-init="OpenMyAnimationViewMain()" id="VideoView" class="videoView" ng-controller="MyAnimationController" style=" "></div> <!--position: absolute !important;--> | |
4 | + <style> | |
5 | + .jsPanel-content.jsPanel-theme-success { | |
6 | + overflow-y: auto !important; | |
7 | + } | |
8 | + </style> | |
9 | +</div> | |
0 | 10 | \ No newline at end of file | ... | ... |
400-SOURCECODE/AIAHTML5.Web/app/widget/TopMenu.html
... | ... | @@ -5,7 +5,7 @@ |
5 | 5 | <ul class="dropdown-menu"> |
6 | 6 | <li id="openResourceId"><a href="#" ng-click="openResource()">Open Resources</a></li> |
7 | 7 | <li id="openPictureId"><a href="#" ng-click="OpenMyPicture()">Open My Pictures</a></li> |
8 | - <li ng-class="disableMenuoption"><a href="#">Open My Animations</a></li> | |
8 | + <li id="openAnimationId"><a href="#" ng-click="OpenMyAnimation()">Open My Animations</a></li> | |
9 | 9 | <li role="separator" class="divider"></li> |
10 | 10 | <li ng-class="disableMenuoption"><a href="#">Test Creator</a></li> |
11 | 11 | <li ng-class="disableMenuoption"><a href="#">Open Test</a></li> |
... | ... | @@ -84,7 +84,9 @@ |
84 | 84 | </div> |
85 | 85 | </div> |
86 | 86 | |
87 | - <input type="file" id="openCBJsonFile" style="display: none" /> | |
88 | - <input type="file" id="myPictureFile" style="display: none" /> | |
87 | + <input type="file" id="openCBJsonFile" accept=".json" style="display: none" /> | |
88 | + <input type="file" id="myPictureFile" accept="image/png, image/jpeg" style="display: none" /> | |
89 | + <input type="file" id="myAnimationFile" accept=".mp4" style="display: none" /> | |
90 | + <!-- <input type="file" id="myAnimationFile" accept="video/mp4,video/x-m4v,video/*" style="display: none" /> --> | |
89 | 91 | |
90 | 92 | </div> |
91 | 93 | \ No newline at end of file | ... | ... |
400-SOURCECODE/AIAHTML5.Web/content/data/AnimationMp4/.gitkeep.txt
0 → 100644
1 | +keep this file always | |
2 | +You can't commit empty folders in git. If you want it then you need to put something in it, even just an empty file. | |
3 | +All added video file ignored iside this folder | |
4 | +Rule added in .gitingore file | |
5 | +400-SOURCECODE/AIAHTML5.Web/content/data/AnimationMp4/* | |
0 | 6 | \ No newline at end of file | ... | ... |
400-SOURCECODE/AIAHTML5.Web/index.aspx
... | ... | @@ -1558,7 +1558,7 @@ |
1558 | 1558 | <script src="app/services/AdminService.js?v=1.0.0"></script> |
1559 | 1559 | <script src="app/controllers/TileViewListController.js?v=1.0.0"></script> |
1560 | 1560 | <script src="app/controllers/MyPictureController.js?v=1.0.0"></script> |
1561 | - | |
1561 | + <script src="app/controllers/MyAnimationController.js?v=1.0.0"></script> | |
1562 | 1562 | <script src="app/services/ModuleService.js?v=1.0.0"></script> |
1563 | 1563 | <script src="../app/filters/AIAFilter.js?v=1.0.0"></script> |
1564 | 1564 | <script src="app/services/DataService.js?v=1.0.0"></script> | ... | ... |
400-SOURCECODE/AIAHTML5.Web/libs/jquery/jquery_plugin/jsPanel/jspanel/jquery.jspanel.js
... | ... | @@ -897,11 +897,13 @@ var jsPanel = { |
897 | 897 | } |
898 | 898 | else |
899 | 899 | { |
900 | + var ht=parseInt(panel.parent().outerHeight()) - parseInt(panel.option.maximizedMargin.top) - parseInt(panel.option.maximizedMargin.bottom) - 65; | |
900 | 901 | panel.css({ |
901 | 902 | top: parseInt(70),//panel.option.maximizedMargin.top), |
902 | 903 | left:currentController == 'CIController' ? 15 : parseInt(panel.option.maximizedMargin.left), |
903 | 904 | width: parseInt(panel.parent().outerWidth(), 10) - parseInt(panel.option.maximizedMargin.left) - parseInt(panel.option.maximizedMargin.right), |
904 | - height: parseInt(panel.parent().outerHeight()) - parseInt(panel.option.maximizedMargin.top) - parseInt(panel.option.maximizedMargin.bottom) - 65 | |
905 | + //height: parseInt(panel.parent().outerHeight()) - parseInt(panel.option.maximizedMargin.top) - parseInt(panel.option.maximizedMargin.bottom) - 65 | |
906 | + height: currentController == 'MyAnimationController' ? 510 : ht | |
905 | 907 | }); |
906 | 908 | |
907 | 909 | ... | ... |