From 6b2b2e64bf7c5bb3f7bdd0100ad9c838e9f80783 Mon Sep 17 00:00:00 2001 From: nikita Date: Fri, 21 Apr 2017 16:56:07 +0530 Subject: [PATCH] set default transparency to 100 --- 400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js | 404 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 400-SOURCECODE/AIAHTML5.Web/app/views/da/da-view.html | 5 +++-- 2 files changed, 199 insertions(+), 210 deletions(-) diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js index 4ca7d0f..b01a0bd 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js @@ -32,7 +32,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $scope.layerNumber; $scope.daCounter = 1; $scope.bagartDetails; - $scope.transNumber = 50; + $scope.transNumber = 100; $rootScope.modestyCanvasZindex = 12100; $rootScope.isModestyCanvasVisible = false; @@ -430,148 +430,147 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $scope.openBodyView = function () { //Check if browser 'REFRESHED' or 'RELOADED' if ($rootScope.CommonData != null) { - //0. we will initially append container to load body + //0. we will initially append container to load body - //check if localstorage has any settings - var curentEthnicity = localStorage.getItem("globalEthnicity"); - if (typeof (curentEthnicity) !== "undefined" && curentEthnicity !== null) { - $rootScope.globalSetting.ethnicity = curentEthnicity; - } - - var curentmodesty = localStorage.getItem("globalModesty"); - if (typeof (curentmodesty) !== "undefined" && curentmodesty !== null) { - $rootScope.globalSetting.modesty = curentmodesty - } - - //0.1 - - var currentBodyViewId = localStorage.getItem("currentBodyViewId"); - if (currentBodyViewId == null || currentBodyViewId == undefined) { - // document.location = '/'; - document.location = '/'; - $rootScope.isVisibleLogin = true; - - } - else { - $rootScope.isVisibleLogin = false; - $rootScope.loadSearchDataForBodyView(); - - console.log('currentBodyViewId pickjed from localStorage: ' + currentBodyViewId); + //check if localstorage has any settings + var curentEthnicity = localStorage.getItem("globalEthnicity"); + if (typeof (curentEthnicity) !== "undefined" && curentEthnicity !== null) { + $rootScope.globalSetting.ethnicity = curentEthnicity; + } - var openViews; - if ($rootScope.openViews != null || $rootScope.openViews != undefined) { - if ($rootScope.openViews.length > 0) { - openViews = new jinqJs() - .from($rootScope.openViews) - .where("BodyViewId == " + currentBodyViewId) - .select(); - } + var curentmodesty = localStorage.getItem("globalModesty"); + if (typeof (curentmodesty) !== "undefined" && curentmodesty !== null) { + $rootScope.globalSetting.modesty = curentmodesty } - // 0.2 getting corresponding body view title - //var counter = 1; - var tittle = localStorage.getItem("currentViewTitleFromJson"); - localStorage.setItem("currentViewTitle", tittle); + //0.1 - //WILL BE USED WHEN MULTI VIEWOPEN FUNCTIONALITY IS IMPELMNETD - //if (openViews != null && openViews != undefined) { - // angular.forEach(openViews, function (value, key) { + var currentBodyViewId = localStorage.getItem("currentBodyViewId"); + if (currentBodyViewId == null || currentBodyViewId == undefined) { + // document.location = '/'; + document.location = '/'; + $rootScope.isVisibleLogin = true; - // if (value.bodyView == tittle) { - // tittle = localStorage.getItem("currentViewTitleFromJson") + counter++; - // $rootScope.currentActiveViewTitle = tittle; - // localStorage.setItem("currentViewTitle", tittle); - // } + } + else { + $rootScope.isVisibleLogin = false; + $rootScope.loadSearchDataForBodyView(); - // }); - //} - //else { - // localStorage.setItem("currentViewTitle", tittle); - //} + console.log('currentBodyViewId pickjed from localStorage: ' + currentBodyViewId); - //0.3 + var openViews; + if ($rootScope.openViews != null || $rootScope.openViews != undefined) { + if ($rootScope.openViews.length > 0) { + openViews = new jinqJs() + .from($rootScope.openViews) + .where("BodyViewId == " + currentBodyViewId) + .select(); + } + } - $.jsPanel({ - id: 'daImagePanel', - selector: '.daBodyView', - theme: 'success', - currentController: 'DAController', - parentSlug: 'da-view-list', - ajax: { - url: 'app/views/da/da-view.html' - }, - title: localStorage.getItem("currentViewTitle"), + // 0.2 getting corresponding body view title + //var counter = 1; + var tittle = localStorage.getItem("currentViewTitleFromJson"); + localStorage.setItem("currentViewTitle", tittle); + + //WILL BE USED WHEN MULTI VIEWOPEN FUNCTIONALITY IS IMPELMNETD + //if (openViews != null && openViews != undefined) { + // angular.forEach(openViews, function (value, key) { + + // if (value.bodyView == tittle) { + // tittle = localStorage.getItem("currentViewTitleFromJson") + counter++; + // $rootScope.currentActiveViewTitle = tittle; + // localStorage.setItem("currentViewTitle", tittle); + // } + + // }); + //} + //else { + // localStorage.setItem("currentViewTitle", tittle); + //} + + //0.3 + + $.jsPanel({ + id: 'daImagePanel', + selector: '.daBodyView', + theme: 'success', + currentController: 'DAController', + parentSlug: 'da-view-list', + ajax: { + url: 'app/views/da/da-view.html' + }, + title: localStorage.getItem("currentViewTitle"), - position: { - top: 70, - left: 1, - }, + position: { + top: 70, + left: 1, + }, - size: { width: $(window).outerWidth() - 10, height: $(window).outerHeight() - 110 }, + size: { width: $(window).outerWidth() - 10, height: $(window).outerHeight() - 110 }, - }); + }); - console.log('jsPanel loaded daImagePanel exist= ' + document.getElementById('daImagePanel')) - //0.1 - $rootScope.currentSlug = 'da-body-view'; + console.log('jsPanel loaded daImagePanel exist= ' + document.getElementById('daImagePanel')) + //0.1 + $rootScope.currentSlug = 'da-body-view'; - //0.2 - $rootScope.openViews.push( - { - "module": $rootScope.currentActiveModuleTitle, "bodyView": tittle, "state": 'max', "BodyViewId": $rootScope.currentBodyViewId, - "slug": $rootScope.currentSlug - } - ); + //0.2 + $rootScope.openViews.push( + { + "module": $rootScope.currentActiveModuleTitle, "bodyView": tittle, "state": 'max', "BodyViewId": $rootScope.currentBodyViewId, + "slug": $rootScope.currentSlug + } + ); - //0.3 - var daBodyviewElement = angular.element(document.getElementById("daBodyview")); + //0.3 + var daBodyviewElement = angular.element(document.getElementById("daBodyview")); - $timeout(function () { - $compile(daBodyviewElement.contents())($scope); + $timeout(function () { + $compile(daBodyviewElement.contents())($scope); - console.log('html is compiled' + document.getElementById('daView')) - if (document.getElementById('daView') != null) { + console.log('html is compiled' + document.getElementById('daView')) + if (document.getElementById('daView') != null) { - //0.4 added some stylesheets - $('#daBodyview').css("height", $(window).outerHeight()); + //0.4 added some stylesheets + $('#daBodyview').css("height", $(window).outerHeight()); - $('#daBodyview').css("width", $(window).outerWidth()); + $('#daBodyview').css("width", $(window).outerWidth()); - //1. load navigator man first - console.log('before LoadBodyViewNavigatorImage call') - $scope.LoadBodyViewNavigatorImage(); + //1. load navigator man first + console.log('before LoadBodyViewNavigatorImage call') + $scope.LoadBodyViewNavigatorImage(); - //$rootScope.loadSearchDataForBodyView(); + //$rootScope.loadSearchDataForBodyView(); - $scope.currentTitleFromJson = localStorage.getItem("currentViewTitle"); + $scope.currentTitleFromJson = localStorage.getItem("currentViewTitle"); - $scope.layerNumber = 0; + $scope.layerNumber = 0; - //2. + //2. - console.log('currentBodyViewId just before sending: ' + currentBodyViewId); - $scope.loadBodyViewData(currentBodyViewId); + console.log('currentBodyViewId just before sending: ' + currentBodyViewId); + $scope.loadBodyViewData(currentBodyViewId); - //2. load bodyRegion data - $rootScope.isLoading = true; - $rootScope.voId = localStorage.getItem("currentBodyViewId"); - } - $('#daBodyview').css("height", $(window).outerHeight()); + //2. load bodyRegion data + $rootScope.isLoading = true; + $rootScope.voId = localStorage.getItem("currentBodyViewId"); + } + $('#daBodyview').css("height", $(window).outerHeight()); - $('#daBodyview').css("width", $(window).outerWidth()); + $('#daBodyview').css("width", $(window).outerWidth()); - if ($('#daImagePanel').offset().top == 0) - $('#daImagePanel').css("top", '70px'); + if ($('#daImagePanel').offset().top == 0) + $('#daImagePanel').css("top", '70px'); - if ($('#daImagePanel').offset().left == 0) - $('#daImagePanel').css("left", '1px'); + if ($('#daImagePanel').offset().left == 0) + $('#daImagePanel').css("left", '1px'); - }, 350); - } - } - else - { + }, 350); + } + } + else { //for now we are redirecting user to index page on page refresh because on refresh we lost the rootscope data and some of application //features stopped working which were depenedent of rootscope data like List manager, annotation toolbar, settings, usermodule list, etc. @@ -586,7 +585,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo }*/ - } + } } angular.element(document).ready(function (e) { @@ -656,11 +655,11 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo }) // $rootScope.languageArray = []; $rootScope.loadSearchDataForBodyView = function () { - + var languageArray = []; $rootScope.vocabTermDataArray = []; var languageArray = $rootScope.lexiconLanguageArray; - + console.log(languageArray.length); console.log('loadSearchDataForBodyView'); @@ -691,14 +690,14 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $rootScope.vocabTermDataArray.push({ "language": $scope.vocabLanguage, "VocabTermData": $rootScope.VocabTermData, "vocabTermTxt": $scope.vocabTermTxt }); for (var i = 0; i <= $rootScope.lexiconLanguageArray.length - 1; i++) { - + $rootScope.vocabTermDataArray[i].vocabTermTxt = new jinqJs() .from($rootScope.vocabTermDataArray[i].vocabTermTxt) .distinct('_TermText', '_ActualTermNumber') .orderBy([{ field: '_TermText', sort: 'asc' }]) .select('_ActualTermNumber', '_TermText', '_cdId'); - + console.log("Language= " + $rootScope.lexiconLanguageArray[i].language + ", vocabTermTxt= " + $rootScope.vocabTermDataArray[i].vocabTermTxt[0]._TermText); } @@ -1591,7 +1590,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo if ($rootScope.multiAnnotationIsON == true) { // $scope.createDynamicSpeechBubble(evt, annotationText, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top); - + $scope.MultiLanguageAnnationArray = []; for (var i = 0; i <= $rootScope.annotationText.length - 1; i++) { @@ -1611,7 +1610,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo // $scope.createDynamicSpeechBubble(evt, annotationText, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top); - // alert(annotationText); + // alert(annotationText); $scope.MultiLanguageAnnationArray = []; for (var i = 0; i <= $rootScope.annotationText.length - 1; i++) { @@ -1622,7 +1621,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $scope.createDynamicSpeechBubble(evt, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top, true); } else { - // alert(annotationText); + // alert(annotationText); // $scope.createDynamicSpeechBubble(evt, annotationText, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top); $scope.MultiLanguageAnnationArray = []; for (var i = 0; i <= $rootScope.annotationText.length - 1; i++) { @@ -1983,7 +1982,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo if ($rootScope.multiAnnotationIsON == true) { // $scope.createDynamicSpeechBubble(evt, annotationText, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top); - // alert(annotationText); + // alert(annotationText); $scope.MultiLanguageAnnationArray = []; for (var i = 0; i <= $rootScope.annotationText.length - 1; i++) { @@ -2010,7 +2009,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo // $scope.createDynamicSpeechBubble(evt, annotationText, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top); - + for (var i = 0; i <= $rootScope.annotationText.length - 1; i++) { $scope.MultiLanguageAnnationArray.push($rootScope.annotationText[i]); @@ -2830,12 +2829,12 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo } } } - + return annotation; } $scope.GetAnnotationBasedOnActualTermNo = function (actualTermNo, language) { - + var Annotation; $scope.ActualTermNo = actualTermNo; for (var j = 0; j <= $rootScope.vocabTermDataArray.length - 1; j++) { @@ -2852,7 +2851,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo for (var z = 0; z <= $scope.matchedActualTermData.length; z++) { //send actual term no to get the term text. Annotation = $scope.matchedActualTermData[0]._TermText; - // alert("Annotation : " + Annotation); + // alert("Annotation : " + Annotation); break; }; } @@ -2943,7 +2942,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $.each(BodyRegionDictionary, function (index, value) { - + if (value.bodyRegionId == '3') { var BR_SixTBData = new jinqJs() @@ -2967,7 +2966,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo // alert(' $.each(BodyRegionDictionary3. bodyRegionRight: ' + bodyRegionRight + ', bodyRegionBottom: ' + bodyRegionBottom) if (TransparencyBoxStartX <= bodyRegionRight && value.X <= transparencyBoxRight && TransparencyBoxStartY <= bodyRegionBottom && value.Y <= transparencyBoxBottom) { //var transNumber = parseInt(document.getElementById("txtTransparencyChange").value); - + $scope.layerNumber = parseInt(txtlayerNumber.value); if (value.bodyRegionId == '3' && $scope.canThirdBRDrawn == true) { @@ -2993,7 +2992,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo //draw 3rd BR $timeout(function () { $scope.loadTransparencyImage(value.bodyRegionId, value.Height, value.Width, value.X, value.Y, value.IsMirror, $scope.TransparencyBoxStartX, TransparencyEndX, $scope.TransparencyBoxStartY, TransparencyBoxEndY, $scope, true, false, false); - },200); + }, 200); } else { @@ -3582,7 +3581,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo + ''; $("#sppeachBubble_annotation").css("height", "auto"); - // alert($("#sppeachBubble_annotation").css("height")); + // alert($("#sppeachBubble_annotation").css("height")); if ($scope.longest_annotationT1.length > $scope.longest_annotationT2.length) { $("#sppeachBubble_annotation p").remove(); $('#canvasDiv').append(sppechBubbleDotHTML_annotation); @@ -4128,7 +4127,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $('#transparencyScale').css('left', $scope.TBDrawStartX + 130) $('#transparencyScale').css('visibility', 'visible') $('#transparencyScale').css("z-index", "100000") //Dated:16-07-2016 Issue#4962:Transparency box should be on top. - + $("#tbSlider .ui-slider-range-min").css("width", "100%"); + $("#tbSlider .ui-slider-handle").css("left", "100%"); } } @@ -4223,7 +4223,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo } $scope.loadTransparencyImage = function (bodyRegionId, Height, Width, X, Y, IsMirror, TransparencyBoxStartX, TransparencyEndX, TransparencyBoxStartY, TransparencyBoxEndY, scope, isLayerChanged, isTransparencyChanged, isResized) { - $scope.IncludedBodyRegions.push({ 'BRID': bodyRegionId }); + var transparencyCanvas = document.getElementById('transparencyCanvas'); @@ -4461,7 +4461,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo var contxModestyTemp = document.getElementById(modestyTempCanvasId).getContext('2d'); var tbTempCanvas = document.getElementById(tempCanvasID) contxModestyTemp.drawImage(tbTempCanvas, XforCopyImage, YforCopyImage, WidthforCopyImage, HeightforCopyImage, XforTransImage, YforTransImage, WidthforTransImage, HeightforTransImage); - $scope.transparencyDrawnRegions.push({ 'BRID': bodyRegionId }); + } } else { @@ -4470,13 +4470,12 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo var contx = document.getElementById('tempCanvas').getContext('2d'); var tbTempCanvas = document.getElementById(tempCanvasID) contx.drawImage(tbTempCanvas, XforCopyImage, YforCopyImage, WidthforCopyImage, HeightforCopyImage, XforTransImage, YforTransImage, WidthforTransImage, HeightforTransImage); - $scope.transparencyDrawnRegions.push({ 'BRID': bodyRegionId }); } } - if ($scope.transparencyDrawnRegions.length == $scope.IncludedBodyRegions.length) { - $scope.DrawOnTBWithSelectedTransparency(tempCanvasID, XforCopyImage, YforCopyImage, WidthforCopyImage, HeightforCopyImage, XforTransImage, YforTransImage, WidthforTransImage, HeightforTransImage, Height, Width, bodyRegionId); - } + + $scope.DrawOnTBWithSelectedTransparency(tempCanvasID, XforCopyImage, YforCopyImage, WidthforCopyImage, HeightforCopyImage, XforTransImage, YforTransImage, WidthforTransImage, HeightforTransImage, Height, Width, bodyRegionId, isLayerChanged, isResized); + } @@ -4512,9 +4511,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo //set modesty image visiblility true/false as per layer // if(bodyRegionId.match('modestyImg3')) - var BRID=''; - if (bodyRegionId.match('modestyImg') && document.getElementById('modestyTransCanavs_' + bodyRegionId)!=null) { - BRID = bodyRegionId[bodyRegionId.length - 1]; + var BRID = ''; + if (bodyRegionId.match('modestyImg') && document.getElementById('modestyTransCanavs_' + bodyRegionId) != null) { + BRID = bodyRegionId[bodyRegionId.length - 1]; } else if ((bodyRegionId == '2' || bodyRegionId == '3') && document.getElementById('modestyTransCanavs_modestyImg' + bodyRegionId) != null) { BRID = bodyRegionId; @@ -4742,30 +4741,20 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo } - $scope.DrawOnTBWithSelectedTransparency = function (tempCanvasID, XforCopyImage, YforCopyImage, WidthforCopyImage, HeightforCopyImage, XforTransImage, YforTransImage, WidthforTransImage, HeightforTransImage, Height, Width, bodyRegionId) { + $scope.DrawOnTBWithSelectedTransparency = function (tempCanvasID, XforCopyImage, YforCopyImage, WidthforCopyImage, HeightforCopyImage, XforTransImage, YforTransImage, WidthforTransImage, HeightforTransImage, Height, Width, bodyRegionId, isLayerChanged, isResized) { var transNumber = $scope.transNumber;//txtTransparencyChange.value; //this changes the transparency when transparency is already activated and user resizes or chage the layer - var tempCtx = document.getElementById('tempCanvas').getContext('2d'); - - - - var transC = document.getElementById('transparencyCanvas'); - var ctx = transC.getContext('2d'); - var height = parseInt(((transC.style.height).toString()).replace('px', '')); - var width = parseInt(((transC.style.width).toString()).replace('px', '')); + var tempCtx = document.getElementById(tempCanvasID).getContext('2d'); - var tempCanavsImageData = tempCtx.getImageData(0, 0, width, height); + var imageD = tempCtx.getImageData(0, 0, Width, Height); + var imageData = imageD.data; + var length = imageData.length; - + // set every fourth value to the desired number of transparency - ctx.putImageData(tempCanavsImageData, 0, 0); - // set every fourth value to the desired number of transparency - var transCanvasImgData = ctx.getImageData(0, 0, width, height); - var imageData = transCanvasImgData.data; - var length = imageData.length; for (var i = 3; i < length; i += 4) { if ($scope.voId == "9" || $scope.voId == "11") { @@ -4777,75 +4766,75 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo } } else { - - imageData[i] = ((255) * (parseInt(transNumber))) / 100; + + imageData[i] = ((255) * (parseInt(transNumber))) / 100; } - + } - - ctx.putImageData(transCanvasImgData, 0, 0); + tempCtx.putImageData(imageD, 0, 0); - // $scope.widthOfImage = WidthforTransImage; - // $scope.heightOfImage = HeightforTransImage; - // $scope.xOfImage = XforTransImage; - // $scope.yOfImage = YforTransImage; - // var ctx = transparencyCanvas.getContext('2d'); + $scope.widthOfImage = WidthforTransImage; + $scope.heightOfImage = HeightforTransImage; + $scope.xOfImage = XforTransImage; + $scope.yOfImage = YforTransImage; + var ctx = transparencyCanvas.getContext('2d'); - // var tmpCanvasContext = document.getElementById(tempCanvasID);//.getContext('2d'); + var tmpCanvasContext = document.getElementById(tempCanvasID);//.getContext('2d'); - // var ctx; - // if ($rootScope.isModestyOn == true && (bodyRegionId.match('modestyImg'))) { - // var modestyTransCanvasId = 'modestyTransCanavs_' + bodyRegionId - // ctx = document.getElementById(modestyTransCanvasId).getContext('2d'); - // } - // else - // ctx = transparencyCanvas.getContext('2d'); - // // var ctx = transparencyCanvas.getContext('2d'); - // ctx.drawImage(tmpCanvasContext, XforCopyImage, YforCopyImage, WidthforCopyImage, HeightforCopyImage, XforTransImage, YforTransImage, WidthforTransImage, HeightforTransImage) + var ctx; + if ($rootScope.isModestyOn == true && (bodyRegionId.match('modestyImg'))) { + var modestyTransCanvasId = 'modestyTransCanavs_' + bodyRegionId + ctx = document.getElementById(modestyTransCanvasId).getContext('2d'); + } + else + ctx = transparencyCanvas.getContext('2d'); + // var ctx = transparencyCanvas.getContext('2d'); + ctx.drawImage(tmpCanvasContext, XforCopyImage, YforCopyImage, WidthforCopyImage, HeightforCopyImage, XforTransImage, YforTransImage, WidthforTransImage, HeightforTransImage) - // if ($rootScope.isModestyOn == true && (bodyRegionId.match('modestyImg'))) { - // var imageD1 = ctx.getImageData(0, 0, Width, Height); - // var imageData1 = imageD1.data; - // var length1 = imageData1.length; + if ($rootScope.isModestyOn == true && (bodyRegionId.match('modestyImg'))) { + var imageD1 = ctx.getImageData(0, 0, Width, Height); + var imageData1 = imageD1.data; + var length1 = imageData1.length; - // // set every fourth value to the desired number of transparency - // for (var i = 0; i < imageData1.length; i += 4) { - // if (imageData1[i] == imageData1[i + 1] && imageData1[i + 1] == imageData1[i + 2] && imageData1[i + 2] === 0) { - // imageData1[i + 3] = 0; - // } - // } - + // set every fourth value to the desired number of transparency + for (var i = 0; i < imageData1.length; i += 4) { + if (imageData1[i] == imageData1[i + 1] && imageData1[i + 1] == imageData1[i + 2] && imageData1[i + 2] === 0) { + imageData1[i + 3] = 0; + } - // ctx.putImageData(imageD1, 0, 0); + } - // } + + ctx.putImageData(imageD1, 0, 0); + + } - // // $scope.transparencyDrawnRegions.push(bodyRegionId); - //// $scope.transparencyDrawnRegions.push({ 'BRID': bodyRegionId }); + // $scope.transparencyDrawnRegions.push(bodyRegionId); + $scope.transparencyDrawnRegions.push({ 'BRID': bodyRegionId }); - // $rootScope.isLoading = false; - // $('#spinner').css('visibility', 'hidden'); + $rootScope.isLoading = false; + $('#spinner').css('visibility', 'hidden'); - // if ($scope.transparencyDrawnRegions.length == $scope.IncludedBodyRegions.length) { + if ($scope.transparencyDrawnRegions.length == $scope.IncludedBodyRegions.length) { - // transparencyCanvas.style.visibility = 'visible'; - // $('.rectangle').remove(); + transparencyCanvas.style.visibility = 'visible'; + $('.rectangle').remove(); - // } + } } @@ -5018,7 +5007,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo // var maskCanvasId = "imageCanvas" + $rootScope.BRId + "_mci"; - // alert(annotationText); + // alert(annotationText); $scope.MultiLanguageAnnationArray = []; for (var i = 0; i <= $rootScope.annotationText.length - 1; i++) { @@ -5092,7 +5081,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo } } - + if (tCanvasHeight != $scope.transparencyCanvasHeight || tCanvasWidth != $scope.transparencyCanvasWidth) { @@ -5119,7 +5108,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $scope.transparencyCanvasHeight = tCanvasHeight; $scope.transparencyCanvasWidth = tCanvasWidth; - + //create temp cavas to retain the original anavs data for use in transparency change as //if u use original canvas data for transprency change then at 0 transparency all data will become transparent and if u increase transparency with this data then the canavs will be blank if (document.getElementById('tempCanvas') != null) { @@ -5204,7 +5193,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo //draw 3rd BR $timeout(function () { $scope.loadTransparencyImage(value.bodyRegionId, value.Height, value.Width, value.X, value.Y, value.IsMirror, $scope.TransparencyBoxStartX, $scope.TransparencyEndX, $scope.TransparencyBoxStartY, $scope.TransparencyBoxEndY, $scope, false, false, true); - },200); + }, 200); } else { //draw mirror arm @@ -5260,7 +5249,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo } }) } - + } @@ -5440,7 +5429,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $scope.annotationTextArrayT2.push($rootScope.annotationTextForTrans2[i]); } //$scope.annotationTextArrayT1.push(annotations.annotationT1); - // $scope.annotationTextArrayT2.push(annotations.annotationT2); + // $scope.annotationTextArrayT2.push(annotations.annotationT2); $scope.createDynamicSpeechBubble(evt, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top, false); } @@ -5692,8 +5681,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo for (var i = 0; i <= $rootScope.annotationText.length - 1; i++) { $rootScope.annotationTextForTrans1.push($rootScope.annotationText[i]); } - - + + //get annotation for trans canavs var RedTrans; var GreenTrans; @@ -5728,7 +5717,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo for (var i = 0; i <= $rootScope.annotationText.length - 1; i++) { $rootScope.annotationTextForTrans2.push($rootScope.annotationText[i]); } - + return { annotationT1: annotationText1, annotationT2: annotationText2 @@ -5895,8 +5884,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo //$("canvas[name*='transparencyTempCanvas']").nextUntil($("canvas[name*='transparencyTempCanvas']")) //.remove(); $scope.layerNumber = $scope.currentLayerNumber; - $scope.transNumber = 50; - $(".slider").slider({ value: 50 }) + $scope.transNumber = 100; + $(".slider").slider({ value: 100 }) } @@ -8731,4 +8720,3 @@ function onListManagerTermSelection(id, isTermListOptionClicked) { } - diff --git a/400-SOURCECODE/AIAHTML5.Web/app/views/da/da-view.html b/400-SOURCECODE/AIAHTML5.Web/app/views/da/da-view.html index 3af5eb4..8de0f42 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/views/da/da-view.html +++ b/400-SOURCECODE/AIAHTML5.Web/app/views/da/da-view.html @@ -368,7 +368,7 @@
-
+
@@ -385,11 +385,12 @@