Commit a88d474224d7f7b48af33288cffea42a4e4266fa

Authored by Amrita Vishnoi
2 parents 3e8dfdef 1c327929

merged manually against Merge Request #754

400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
... ... @@ -1465,7 +1465,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
1465 1465 $scope.isLayerChange = false;
1466 1466 }
1467 1467  
1468   - if (evt.ctrlKey) {
  1468 + if (evt.ctrlKey || evt.metaKey) {
1469 1469 $rootScope.multiAnnotationIsON = true;
1470 1470  
1471 1471 //document.getElementById("btnZoom").setAttribute('disabled', 'disabled');
... ... @@ -1881,7 +1881,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
1881 1881 $scope.isLayerChange = false;
1882 1882 }
1883 1883  
1884   - if (evt.ctrlKey) {
  1884 + if (evt.ctrlKey || evt.metaKey) {
1885 1885 $rootScope.multiAnnotationIsON = true;
1886 1886  
1887 1887 //$("#btnZoom").addClass('disabled');
... ... @@ -3616,7 +3616,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
3616 3616 // we decide the size of speech bubble
3617 3617 //2.
3618 3618  
3619   - if (event.ctrlKey) {
  3619 + if (event.ctrlKey || event.metaKey) {
3620 3620 console.log('ctrl pressed');
3621 3621 $scope.multiAnnotationIsON = true;
3622 3622 //2.1 create unique speech bubbles
... ... @@ -3685,7 +3685,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
3685 3685 else {
3686 3686 $scope.longest_annotationT1 = $scope.annotationTextArrayT1.reduce(function (a, b) { return a.length > b.length ? a : b; });
3687 3687 $scope.longest_annotationT2 = $scope.annotationTextArrayT2.reduce(function (a, b) { return a.length > b.length ? a : b; });
3688   - if (event.ctrlKey) {
  3688 + if (event.ctrlKey || event.metaKey) {
3689 3689 $scope.j = $scope.j + 1;
3690 3690 var sub_id_annotation = "black_annotation" + $scope.j;
3691 3691 var pointClicked_annotation = parseInt(x) + parseInt(y);
... ... @@ -4545,8 +4545,10 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
4545 4545 })
4546 4546  
4547 4547 //for modesty
4548   - if ($rootScope.isModestyOn == true && $scope.modestyImageInfo.length > 0) {
4549   - $.each($scope.modestyImageInfo, function (index, value) {
  4548 + //if ($rootScope.isModestyOn == true && $scope.modestyImageInfo.length > 0) {
  4549 + if ($scope.modestyImageInfo.length > 0) {
  4550 +
  4551 + $.each($scope.modestyImageInfo, function (index, value) {
4550 4552  
4551 4553 var tBoxDimesions = $scope.getTBoxDimesions($scope.TransparencyBoxStartX, TransparencyEndX, $scope.TransparencyBoxStartY, TransparencyBoxEndY, value.x, value.y, value.Height, value.Width);
4552 4554  
... ... @@ -4680,7 +4682,6 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
4680 4682  
4681 4683 $scope.loadTransparencyImage = function (bodyRegionId, Height, Width, X, Y, IsMirror, TransparencyBoxStartX, TransparencyEndX, TransparencyBoxStartY, TransparencyBoxEndY, scope, isLayerChanged, isTransparencyChanged, isResized) {
4682 4684  
4683   -
4684 4685 var transparencyCanvas = document.getElementById('transparencyCanvas');
4685 4686  
4686 4687 TransparencyBoxStartX = parseInt((transparencyCanvas.style.left).replace('px', ''));
... ... @@ -4700,6 +4701,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
4700 4701 var HeightforTransImage = TBImageDimensions.HeightforTransImageTB;
4701 4702 var YforTransImage = TBImageDimensions.YforTransImageTB;
4702 4703  
  4704 +
4703 4705 //0. get current layer number
4704 4706 if (isResized) {
4705 4707 //do nothing
... ... @@ -4735,7 +4737,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
4735 4737 var tranparencyImgSrc;
4736 4738 var tranparencyMaskImgSrc;
4737 4739  
4738   - if ($rootScope.isModestyOn == true && (bodyRegionId.match('modestyImg'))) {
  4740 + if ((bodyRegionId.match('modestyImg'))) {
4739 4741 var modestyBodyRegionData = new jinqJs()
4740 4742 .from($scope.modestyImageInfo)
4741 4743 .where('bodyRegionId == ' + bodyRegionId)
... ... @@ -4785,8 +4787,9 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
4785 4787 transparencyTempcanavsMask.id = 'transparencyTempCanvasMask_MR' + bodyRegionId + '_mci';
4786 4788 }
4787 4789 else {
4788   - if ($rootScope.isModestyOn == true && (bodyRegionId.match('modestyImg'))) {
4789   - transparencyTempCanvas.id = 'transparencyTempCanvas_' + bodyRegionId;
  4790 + if ((bodyRegionId.match('modestyImg'))) {
  4791 +
  4792 + transparencyTempCanvas.id = 'transparencyTempCanvas_' + bodyRegionId;
4790 4793  
4791 4794 }
4792 4795 else {
... ... @@ -4806,7 +4809,8 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
4806 4809 document.getElementById('canvasDiv').appendChild(transparencyTempCanvas);
4807 4810  
4808 4811 //create temp mask canvas
4809   - if ($rootScope.isModestyOn == true && (bodyRegionId.match('modestyImg'))) { }
  4812 + if ((bodyRegionId.match('modestyImg'))) { }
  4813 +
4810 4814 else {
4811 4815 transparencyTempcanavsMask.height = Height;
4812 4816 transparencyTempcanavsMask.width = Width;
... ... @@ -4819,10 +4823,11 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
4819 4823 }
4820 4824  
4821 4825 //for modesty canvas
4822   - if ($rootScope.isModestyOn == true && (bodyRegionId.match('modestyImg'))) {
  4826 + if ((bodyRegionId.match('modestyImg'))) {
4823 4827  
4824 4828 var modestyTransTempCanvasId = 'tempCanvasModesty_' + bodyRegionId;
4825 4829 var modestyTransCanvasId = 'modestyTransCanavs_' + bodyRegionId;
  4830 +
4826 4831 if (document.getElementById(modestyTransTempCanvasId) != null) {
4827 4832 document.getElementById(modestyTransTempCanvasId).parentNode.removeChild(document.getElementById(modestyTransTempCanvasId));
4828 4833 }
... ... @@ -4837,7 +4842,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
4837 4842 tempCanvasModesty.style.top = 10 + 'px';
4838 4843 tempCanvasModesty.style.backgroundColor = "transparent";
4839 4844 tempCanvasModesty.style.visibility = 'hidden';
4840   - tempCanvasModesty.style.border = "black 1px solid";
  4845 + // tempCanvasModesty.style.border = "black 1px solid";
4841 4846 document.getElementById('canvasDiv').appendChild(tempCanvasModesty);
4842 4847 }
4843 4848 if (document.getElementById(modestyTransCanvasId) != null) {
... ... @@ -4845,16 +4850,21 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
4845 4850 }
4846 4851  
4847 4852 if (document.getElementById(modestyTransCanvasId) == null || document.getElementById(modestyTransCanvasId) == undefined) {
4848   - $rootScope.isTBoxModestyVisible = true;
  4853 +
4849 4854 var canvasModesty = document.createElement('canvas');
4850 4855 canvasModesty.id = modestyTransCanvasId;
  4856 + canvasModesty.className = 'transModestyImg'
4851 4857 canvasModesty.height = Height;
4852 4858 canvasModesty.width = Width;
4853 4859 canvasModesty.style.position = "absolute";
4854 4860 canvasModesty.style.left = X + 'px';
4855 4861 canvasModesty.style.top = Y + 'px';
4856   - canvasModesty.style.visibility = 'visible';
4857   - if ($rootScope.voId == "11") {
  4862 + if ($rootScope.isModestyOn == true) {
  4863 + canvasModesty.style.visibility = 'visible';
  4864 + $rootScope.isTBoxModestyVisible = true;
  4865 + }
  4866 + else
  4867 + canvasModesty.style.visibility = 'hidden';
4858 4868  
4859 4869 canvasModesty.style.zIndex = 11000;
4860 4870 }
... ... @@ -4875,8 +4885,9 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
4875 4885 tempCanvasID = 'transparencyTempCanvas_MR_' + bodyRegionId;
4876 4886 }
4877 4887 else {
4878   - if ($rootScope.isModestyOn == true && (bodyRegionId.match('modestyImg'))) {
4879   - tempCanvasID = 'transparencyTempCanvas_' + bodyRegionId;//bodyRegionId;
  4888 + if ((bodyRegionId.match('modestyImg'))) {
  4889 +
  4890 + tempCanvasID = 'transparencyTempCanvas_' + bodyRegionId;//bodyRegionId;
4880 4891 }
4881 4892 else
4882 4893 tempCanvasID = 'transparencyTempCanvas_' + bodyRegionId;
... ... @@ -4916,7 +4927,8 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
4916 4927 if ($rootScope.isHighLight != true) {
4917 4928  
4918 4929  
4919   - if ($rootScope.isModestyOn == true && (bodyRegionId.match('modestyImg'))) {
  4930 + if ((bodyRegionId.match('modestyImg'))) {
  4931 +
4920 4932 var modestyTempCanvasId = 'tempCanvasModesty_' + bodyRegionId;
4921 4933 if (document.getElementById(modestyTempCanvasId) != undefined || document.getElementById(modestyTempCanvasId) != null) {
4922 4934 var contxModestyTemp = document.getElementById(modestyTempCanvasId).getContext('2d');
... ... @@ -4971,7 +4983,6 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
4971 4983 }
4972 4984  
4973 4985 //set modesty image visiblility true/false as per layer
4974   - // if(bodyRegionId.match('modestyImg3'))
4975 4986 var BRID = '';
4976 4987 if (bodyRegionId.match('modestyImg') && document.getElementById('modestyTransCanavs_' + bodyRegionId) != null) {
4977 4988 BRID = bodyRegionId[bodyRegionId.length - 1];
... ... @@ -4997,7 +5008,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
4997 5008  
4998 5009 var modestyCanavs = document.getElementById(modestyTransCanvases[j].id);
4999 5010  
5000   - if ((parseInt(lowerlayerNumberForModesty) <= parseInt($scope.layerNumber)) && (HigherlayerNumberForModesty) > parseInt($scope.layerNumber)) {
  5011 + if ($rootScope.isModestyOn == true && (parseInt(lowerlayerNumberForModesty) <= parseInt($scope.layerNumber)) && (HigherlayerNumberForModesty) > parseInt($scope.layerNumber)) {
5001 5012  
5002 5013 modestyCanavs.style.visibility = 'visible';
5003 5014 }
... ... @@ -5034,7 +5045,8 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
5034 5045 XforCopyImage = 0;
5035 5046 WidthforCopyImage = Width;
5036 5047 WidthforTransImage = Width;
5037   - if ($rootScope.isModestyOn == true && (bodyRegionId.match('modestyImg'))) {
  5048 +
  5049 + if ((bodyRegionId.match('modestyImg'))) {
5038 5050 XforTransImage = 0;
5039 5051 }
5040 5052 else
... ... @@ -5048,7 +5060,7 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
5048 5060  
5049 5061 WidthforTransImage = parseInt(TransparencyEndX) - parseInt(X);
5050 5062  
5051   - if ($rootScope.isModestyOn == true && (bodyRegionId.match('modestyImg'))) {
  5063 + if ((bodyRegionId.match('modestyImg'))) {
5052 5064 XforTransImage = 0;
5053 5065 }
5054 5066 else
... ... @@ -5061,7 +5073,7 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
5061 5073 WidthforCopyImage = parseInt(X) + parseInt(Width) - parseInt(TransparencyBoxStartX);
5062 5074 WidthforTransImage = parseInt(X) + parseInt(Width) - parseInt(TransparencyBoxStartX);
5063 5075  
5064   - if ($rootScope.isModestyOn == true && (bodyRegionId.match('modestyImg'))) {
  5076 + if ((bodyRegionId.match('modestyImg'))) {
5065 5077  
5066 5078 XforTransImage = parseInt(TransparencyBoxStartX) - parseInt(X);
5067 5079 }
... ... @@ -5072,7 +5084,7 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
5072 5084 XforCopyImage = parseInt(TransparencyBoxStartX) - parseInt(X);//parseInt(X) + parseInt(Width) - parseInt(scope.TransparencyBoxStartX)// scope.TransparencyBoxStartX ;
5073 5085 WidthforCopyImage = parseInt(TransparencyEndX) - parseInt(TransparencyBoxStartX);
5074 5086 WidthforTransImage = parseInt(TransparencyEndX) - parseInt(TransparencyBoxStartX);
5075   - if ($rootScope.isModestyOn == true && (bodyRegionId.match('modestyImg'))) {
  5087 + if ((bodyRegionId.match('modestyImg'))) {
5076 5088  
5077 5089 XforTransImage = parseInt(TransparencyBoxStartX) - parseInt(X);
5078 5090 }
... ... @@ -5089,7 +5101,8 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
5089 5101 HeightforCopyImage = Height;
5090 5102  
5091 5103 HeightforTransImage = Height;
5092   - if ($rootScope.isModestyOn == true && (bodyRegionId.match('modestyImg'))) {
  5104 +
  5105 + if ((bodyRegionId.match('modestyImg'))) {
5093 5106 YforTransImage = 0;
5094 5107 }
5095 5108 else
... ... @@ -5102,7 +5115,7 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
5102 5115  
5103 5116 HeightforTransImage = (parseInt(TransparencyBoxEndY)) - parseInt(Y)// - parseInt(scope.TransparencyBoxStartY));
5104 5117  
5105   - if ($rootScope.isModestyOn == true && (bodyRegionId.match('modestyImg'))) {
  5118 + if ((bodyRegionId.match('modestyImg'))) {
5106 5119 YforTransImage = 0;
5107 5120 }
5108 5121 else
... ... @@ -5114,8 +5127,9 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
5114 5127 YforCopyImage = parseInt(TransparencyBoxStartY) - parseInt(Y);
5115 5128 HeightforCopyImage = parseInt(Y) + parseInt(Height) - parseInt(TransparencyBoxStartY);
5116 5129 HeightforTransImage = parseInt(Y) + parseInt(Height) - parseInt(TransparencyBoxStartY);
5117   - if ($rootScope.isModestyOn == true && (bodyRegionId.match('modestyImg'))) {
5118   - YforTransImage = parseInt(TransparencyBoxStartY) - parseInt(Y);
  5130 +
  5131 + if ((bodyRegionId.match('modestyImg'))) {
  5132 + YforTransImage = parseInt(TransparencyBoxStartY) - parseInt(Y);
5119 5133  
5120 5134 }
5121 5135 else
... ... @@ -5127,7 +5141,8 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
5127 5141 YforCopyImage = parseInt(TransparencyBoxStartY) - parseInt(Y);
5128 5142 HeightforCopyImage = parseInt(TransparencyBoxEndY) - parseInt(TransparencyBoxStartY);
5129 5143 HeightforTransImage = parseInt(TransparencyBoxEndY) - parseInt(TransparencyBoxStartY);
5130   - if ($rootScope.isModestyOn == true && (bodyRegionId.match('modestyImg'))) {
  5144 +
  5145 + if ((bodyRegionId.match('modestyImg'))) {
5131 5146 YforTransImage = parseInt(TransparencyBoxStartY) - parseInt(Y);
5132 5147  
5133 5148 }
... ... @@ -5204,6 +5219,8 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
5204 5219  
5205 5220 $scope.DrawOnTBWithSelectedTransparency = function (tempCanvasID, XforCopyImage, YforCopyImage, WidthforCopyImage, HeightforCopyImage, XforTransImage, YforTransImage, WidthforTransImage, HeightforTransImage, Height, Width, bodyRegionId, isLayerChanged, isResized) {
5206 5221  
  5222 +
  5223 +
5207 5224 var transNumber = $scope.transNumber;//txtTransparencyChange.value;
5208 5225 //this changes the transparency when transparency is already activated and user resizes or chage the layer
5209 5226  
... ... @@ -5250,7 +5267,8 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
5250 5267  
5251 5268  
5252 5269 var ctx;
5253   - if ($rootScope.isModestyOn == true && (bodyRegionId.match('modestyImg'))) {
  5270 + if ((bodyRegionId.match('modestyImg'))) {
  5271 +
5254 5272 var modestyTransCanvasId = 'modestyTransCanavs_' + bodyRegionId
5255 5273 ctx = document.getElementById(modestyTransCanvasId).getContext('2d');
5256 5274 }
... ... @@ -5261,7 +5279,7 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
5261 5279 ctx.drawImage(tmpCanvasContext, XforCopyImage, YforCopyImage, WidthforCopyImage, HeightforCopyImage, XforTransImage, YforTransImage, WidthforTransImage, HeightforTransImage)
5262 5280  
5263 5281  
5264   - if ($rootScope.isModestyOn == true && (bodyRegionId.match('modestyImg'))) {
  5282 + if ((bodyRegionId.match('modestyImg'))) {
5265 5283  
5266 5284 var imageD1 = ctx.getImageData(0, 0, Width, Height);
5267 5285 var imageData1 = imageD1.data;
... ... @@ -5276,8 +5294,11 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
5276 5294  
5277 5295 }
5278 5296  
5279   -
5280 5297 ctx.putImageData(imageD1, 0, 0);
  5298 + if ($rootScope.isModestyOn)
  5299 + document.getElementById('modestyTransCanavs_' + bodyRegionId).style.visibility = 'visible';
  5300 + else
  5301 + document.getElementById('modestyTransCanavs_' + bodyRegionId).style.visibility = 'hidden';
5281 5302  
5282 5303 }
5283 5304  
... ...
400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js
... ... @@ -4180,6 +4180,16 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic
4180 4180 $('.modestyImg').css('visibility', 'hidden');
4181 4181 }
4182 4182 }
  4183 +
  4184 + if ($('.transModestyImg') != null) {
  4185 + if (($rootScope.globalSetting.modesty == 'Y')) {
  4186 + $('.transModestyImg').css('visibility', 'visible');
  4187 + }
  4188 +
  4189 + else {
  4190 + $('.transModestyImg').css('visibility', 'hidden');
  4191 + }
  4192 + }
4183 4193 $rootScope.changeNavigatorModesty();
4184 4194 }
4185 4195  
... ...