Commit 8a2d116f739599bff5f0dc649129abec602d88c5

Authored by Sandeep Kumar
1 parent c8e711ce

CI Module Changes for Save CB

400-SOURCECODE/AIAHTML5.Web/app/controllers/CIController.js
... ... @@ -65,7 +65,13 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
65 65 'currentSlug': '',
66 66 'imageId': '',
67 67 'imageName': '',
68   - 'isTextVisible': true
  68 + 'isTextVisible': true,
  69 + 'top': 0,
  70 + 'left': 0,
  71 + 'width': 0,
  72 + 'height': 0,
  73 + 'minimised': false,
  74 + 'maximised': false
69 75 });
70 76  
71 77 }
... ... @@ -92,7 +98,13 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
92 98 'currentSlug': '',
93 99 'imageId': '',
94 100 'imageName': '',
95   - 'isTextVisible': true
  101 + 'isTextVisible': true,
  102 + 'top': 0,
  103 + 'left': 0,
  104 + 'width': 0,
  105 + 'height': 0,
  106 + 'minimised': false,
  107 + 'maximised': false
96 108 });
97 109  
98 110 }
... ... @@ -713,7 +725,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
713 725 $scope.openBodyView(null);
714 726 }
715 727 }
716   -
  728 +
717 729 $scope.openBodyView = function (ciModuleData) {
718 730  
719 731 if ($rootScope.isCallFromOtherModule == true) {
... ... @@ -848,6 +860,10 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
848 860  
849 861 });
850 862  
  863 + $scope.SetCIwindowStoreData(windowviewid, 'top', $scope.jsPanelTop);
  864 + $scope.SetCIwindowStoreData(windowviewid, 'left', $scope.jsPanelLeft);
  865 + $scope.SetCIwindowStoreData(windowviewid, 'width', $scope.jsPanelWidth);
  866 + $scope.SetCIwindowStoreData(windowviewid, 'height', $scope.jsPanelHeight);
851 867  
852 868 $scope.SetCIwindowStoreData(windowviewid, 'currentSlug', 'clinical-illustrations-detail');
853 869  
... ... @@ -897,11 +913,11 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
897 913 }
898 914 else {
899 915 $("#btnTxtOnOff_" + windowviewid).text("Text On"); $("#sid_" + windowviewid).css("visibility", "hidden");
900   -
901 916 }
902 917  
903 918 });
904 919  
  920 + $scope.PanelActivity();
905 921 }
906 922  
907 923 $scope.$on('annotationToolEvent', function (event, data) {
... ... @@ -990,9 +1006,81 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
990 1006 isVisible = true;
991 1007 $scope.SetCIwindowStoreData(windowviewid, 'isTextVisible', isVisible);
992 1008 }
993   - $rootScope.saveCIWindowActivity("textVisible", isVisible);
  1009 + //$rootScope.saveCIWindowActivity("textVisible", isVisible);
  1010 + }
  1011 +
  1012 + //Created method by Sandeep for Save JSPanel Activity on the CB module
  1013 + $scope.PanelActivity = function () {
  1014 + $("#" + $scope.jsPanelID).resizable({
  1015 + resize: function (event, ui) {
  1016 + var len = (event.currentTarget.id).split("_").length;
  1017 + var windowviewid = (event.currentTarget.id).split("_")[len - 1];
  1018 + //$scope.jsPanelWidth = ui.size.width;
  1019 + //$scope.jsPanelHeight = ui.size.height;
  1020 + $scope.SetCIwindowStoreData(windowviewid, 'width', ui.size.width);
  1021 + $scope.SetCIwindowStoreData(windowviewid, 'height', ui.size.height);
  1022 + //console.log($rootScope.jsPanelWidth, $rootScope.jsPanelHeight);
  1023 + }
  1024 + });
  1025 +
  1026 + $("#" + $scope.jsPanelID).mousemove(function (event) {
  1027 + var len = (event.currentTarget.id).split("_").length;
  1028 + var windowviewid = (event.currentTarget.id).split("_")[len - 1];
  1029 + var offSet = $(this).offset();
  1030 + $scope.SetCIwindowStoreData(windowviewid, 'top', offSet.top);
  1031 + $scope.SetCIwindowStoreData(windowviewid, 'left', offSet.left);
  1032 + $scope.SetCIwindowStoreData(windowviewid, 'width', event.currentTarget.offsetWidth);
  1033 + $scope.SetCIwindowStoreData(windowviewid, 'height', event.currentTarget.offsetHeight);
  1034 +
  1035 + console.log(offSet.top, offSet.left, event.currentTarget.offsetWidth, event.currentTarget.offsetHeight)
  1036 + });
  1037 +
  1038 + $(document).on("click", "#" + $scope.jsPanelID + " .jsPanel-hdr .jsPanel-hdr-r .jsPanel-btn-close .jsglyph-remove", function () {
  1039 + var len = ($scope.jsPanelID).split("_").length;
  1040 + var windowviewid = ($scope.jsPanelID).split("_")[len - 1];
  1041 + $(".tools").css("z-index", "15000");
  1042 + });
  1043 +
  1044 + $(document).on("click", "#" + $scope.jsPanelID + " .jsPanel-hdr .jsPanel-hdr-r .jsPanel-btn-max .jsglyph-maximize", function () {
  1045 + var len = ($scope.jsPanelID).split("_").length;
  1046 + var windowviewid = ($scope.jsPanelID).split("_")[len - 1];
  1047 + $scope.SetCIwindowStoreData(windowviewid, 'maximised', true);
  1048 + $scope.SetCIwindowStoreData(windowviewid, 'minimised', false);
  1049 +
  1050 + });
  1051 +
  1052 + $(document).on("click", "#" + $scope.jsPanelID + " .jsPanel-hdr .jsPanel-hdr-r .jsPanel-btn-min #minSpan", function () {
  1053 + var len = ($scope.jsPanelID).split("_").length;
  1054 + var windowviewid = ($scope.jsPanelID).split("_")[len - 1];
  1055 + $scope.SetCIwindowStoreData(windowviewid, 'maximised', false);
  1056 + $scope.SetCIwindowStoreData(windowviewid, 'minimised', true);
  1057 +
  1058 + });
  1059 +
  1060 + $(document).on("click", "#" + $scope.jsPanelID + " .jsPanel-hdr .jsPanel-hdr-r .jsPanel-btn-norm .jsglyph-normalize", function () {
  1061 + var len = ($scope.jsPanelID).split("_").length;
  1062 + var windowviewid = ($scope.jsPanelID).split("_")[len - 1];
  1063 + $scope.SetCIwindowStoreData(windowviewid, 'maximised', false);
  1064 + $scope.SetCIwindowStoreData(windowviewid, 'minimised', false);
  1065 +
  1066 + });
  1067 +
994 1068 }
995 1069  
  1070 + //$("#ciImagePanel_410 .ui-draggable-handle .jsPanel-btn-close").click(function () {
  1071 + // $(this).toggleClass('btn-plus');
  1072 + // $("#ciImagePanel_410 .ui-draggable-handle .jsPanel-content jsPanel-theme-success").slideToggle();
  1073 + //});
  1074 +
  1075 + //$("#" + $scope.jsPanelID + " .ui-draggable-handle .jsPanel-btn-min").click(function () {
  1076 + // $(this).toggleClass('btn-plus');
  1077 + // $("#ciImagePanel_410 .ui-draggable-handle .jsPanel-content jsPanel-theme-success").slideToggle();
  1078 + //});
  1079 +
  1080 +
  1081 +
  1082 +
  1083 +
996 1084  
997 1085 }]
998 1086 );
... ...
400-SOURCECODE/AIAHTML5.Web/app/controllers/CurrBuildController.js
... ... @@ -719,7 +719,7 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $
719 719 $rootScope.updatedContentFromEditor(currentCb_id);//Calling for Update Note for Save CB
720 720  
721 721 if (isActive) {
722   - $scope.updateWindowsContentForSaveCBTest(currentCb_id);// Calling for Update Window content for Save Cb
  722 + $scope.updateWindowsContentForSaveCB(currentCb_id);// Calling for Update Window content for Save Cb
723 723 }
724 724 isActive = true;
725 725 traverseTreeSelectedSingleObj($rootScope.stru, nodeid);
... ... @@ -2205,13 +2205,13 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $
2205 2205 $scope.windowDataforCB = JSON.parse(selectedSlideContent[0].windows.window)
2206 2206 $scope.setWinDataToArray.push($scope.windowDataforCB);
2207 2207 }
2208   - $rootScope.updateWindowsContentForSaveCB(currentId);
  2208 + $rootScope.updateWindowsContentForSaveCB_Old(currentId);
2209 2209 }
2210 2210 }
2211 2211  
2212 2212 $scope.updatedWindowListForSaveCB = [];
2213 2213  
2214   - $rootScope.updateWindowsContentForSaveCB = function (currentId) {
  2214 + $rootScope.updateWindowsContentForSaveCB_Old = function (currentId) {
2215 2215 var isAA = true; var isCI = true; var isDA = true;
2216 2216 for (var j = 0; j < $scope.setWinDataToArray.length; j++) {
2217 2217  
... ... @@ -2255,6 +2255,59 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $
2255 2255 $scope.updatedWindowListForSaveCB = [];
2256 2256 console.log($scope.selectedKey.windows.window);
2257 2257 }
  2258 +
  2259 + $scope.saveCIWindowActivity_Old = function (keyName, value) {
  2260 + for (var i = 0; i < $scope.setWinDataToArray.length; i++) {
  2261 + $scope.setWinDataToArray[i][keyName] = value;
  2262 + var current_id;
  2263 + if (($rootScope.getLocalStorageValue("cbSelectId")) != '') {
  2264 + current_id = $rootScope.getLocalStorageValue("cbSelectId");
  2265 + }
  2266 + else {
  2267 + current_id = document.getElementById('cbSelect').value;
  2268 + }
  2269 + findKeyForChange($rootScope.contentNotesForSaveCB, current_id);
  2270 + //var modifiedWindowObj = JSON.parse($scope.selectedKey.windows.window);
  2271 + //modifiedWindowObj.textVisible = value;
  2272 + //$scope.selectedKey.windows.window = modifiedWindowObj;
  2273 + $scope.selectedKey.windows.window = "";
  2274 + if (keyName != "") {
  2275 + $scope.selectedKey.windows.window = JSON.stringify($scope.setWinDataToArray[i]);
  2276 + }
  2277 + }
  2278 + console.log($rootScope.contentNotesForSaveCB);
  2279 +
  2280 + //$scope.windowDataforCB = {
  2281 + //slideId: currentId,//SlideNo,
  2282 + //currentWindowId: windowId,
  2283 + //mType: windowData.mType,
  2284 + //containsCapturedContent: windowData.containsCapturedContent,
  2285 +
  2286 + //textVisible: checkVisiblity//windowData.textVisible,
  2287 + //anatomyTitle: windowData.currentViewTitle,
  2288 + //horizontalScroll: windowData.scrollPosition.horizontal + 'px',
  2289 + //verticalScroll: windowData.scrollPosition.vertical + 'px',
  2290 + //imageId: windowData.imageId,//N
  2291 + //maximised: windowData.maximised,//Not Found
  2292 + //minimised: windowData.minimised,//Not Found
  2293 + //id: windowData.id,
  2294 + //size: windowData.size,
  2295 + //position: windowData.position,
  2296 + //position: {
  2297 + // top: $rootScope.jsPanelTop,
  2298 + // left: $rootScope.jsPanelLeft,
  2299 + //},
  2300 +
  2301 + //size: {
  2302 + // width: $rootScope.jsPanelWidth,
  2303 + // height: $rootScope.jsPanelHeight
  2304 + //},
  2305 + //contextMenu: windowData.contextMenu,
  2306 + //annotationData: windowData.annotationData
  2307 +
  2308 + //};
  2309 +
  2310 + }
2258 2311  
2259 2312 function findKeyForChange(o, keyname) {
2260 2313 var i;
... ... @@ -2283,20 +2336,20 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $
2283 2336 annotationData: "",//$rootScope.CIWindowData[i]
2284 2337 contextMenu: { lockResize: false, hideTitleBar: false },
2285 2338 position: {
2286   - top: $rootScope.jsPanelTop,
2287   - left: $rootScope.jsPanelLeft,
  2339 + top: $rootScope.CIWindowData[i].top,
  2340 + left: $rootScope.CIWindowData[i].left,
2288 2341 },
2289 2342 size: {
2290   - width: $rootScope.jsPanelWidth,
2291   - height: $rootScope.jsPanelHeight
  2343 + height: $rootScope.CIWindowData[i].height,
  2344 + width: $rootScope.CIWindowData[i].width
2292 2345 },
2293 2346 textVisible: $rootScope.CIWindowData[i].isTextVisible,
2294 2347 imageId: $rootScope.CIWindowData[i].imageId,
2295   - minimised: false,//$rootScope.CIWindowData[i]
  2348 + minimised: $rootScope.CIWindowData[i].minimised,
2296 2349 windowTitle: $rootScope.CIWindowData[i].currentViewTitle,
2297   - maximised: false,//$rootScope.CIWindowData[i]
  2350 + maximised: $rootScope.CIWindowData[i].maximised,
2298 2351 mType: $rootScope.CIWindowData[i].moduleName,
2299   - id: 0,//$rootScope.CIWindowData[i].id,
  2352 + id: $rootScope.CIWindowData[i].imageId,//$rootScope.CIWindowData[i].id,
2300 2353 scrollPosition: {
2301 2354 vertical: 0,
2302 2355 horizontal: 0
... ... @@ -2349,60 +2402,7 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $
2349 2402 }
2350 2403 }
2351 2404  
2352   - $scope.saveCIWindowActivityTest = function (keyName, value) {
2353   - for (var i = 0; i < $scope.setWinDataToArray.length; i++) {
2354   - $scope.setWinDataToArray[i][keyName] = value;
2355   - var current_id;
2356   - if (($rootScope.getLocalStorageValue("cbSelectId")) != '') {
2357   - current_id = $rootScope.getLocalStorageValue("cbSelectId");
2358   - }
2359   - else {
2360   - current_id = document.getElementById('cbSelect').value;
2361   - }
2362   - findKeyForChange($rootScope.contentNotesForSaveCB, current_id);
2363   - //var modifiedWindowObj = JSON.parse($scope.selectedKey.windows.window);
2364   - //modifiedWindowObj.textVisible = value;
2365   - //$scope.selectedKey.windows.window = modifiedWindowObj;
2366   - $scope.selectedKey.windows.window = "";
2367   - if (keyName != "") {
2368   - $scope.selectedKey.windows.window = JSON.stringify($scope.setWinDataToArray[i]);
2369   - }
2370   - }
2371   - console.log($rootScope.contentNotesForSaveCB);
2372   -
2373   - //$scope.windowDataforCB = {
2374   - //slideId: currentId,//SlideNo,
2375   - //currentWindowId: windowId,
2376   - //mType: windowData.mType,
2377   - //containsCapturedContent: windowData.containsCapturedContent,
2378   -
2379   - //textVisible: checkVisiblity//windowData.textVisible,
2380   - //anatomyTitle: windowData.currentViewTitle,
2381   - //horizontalScroll: windowData.scrollPosition.horizontal + 'px',
2382   - //verticalScroll: windowData.scrollPosition.vertical + 'px',
2383   - //imageId: windowData.imageId,//N
2384   - //maximised: windowData.maximised,//Not Found
2385   - //minimised: windowData.minimised,//Not Found
2386   - //id: windowData.id,
2387   - //size: windowData.size,
2388   - //position: windowData.position,
2389   - //position: {
2390   - // top: $rootScope.jsPanelTop,
2391   - // left: $rootScope.jsPanelLeft,
2392   - //},
2393   -
2394   - //size: {
2395   - // width: $rootScope.jsPanelWidth,
2396   - // height: $rootScope.jsPanelHeight
2397   - //},
2398   - //contextMenu: windowData.contextMenu,
2399   - //annotationData: windowData.annotationData
2400   -
2401   - //};
2402   -
2403   - }
2404   -
2405   - $scope.updateWindowsContentForSaveCBTest = function (currentId) {
  2405 + $scope.updateWindowsContentForSaveCB = function (currentId) {
2406 2406  
2407 2407 //$scope.saveDAWindowActivity();
2408 2408 //$scope.saveAAWindowActivity(currentId);
... ...