diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js index c2fe829..255fccf 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; - } + //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 - } + var curentmodesty = localStorage.getItem("globalModesty"); + if (typeof (curentmodesty) !== "undefined" && curentmodesty !== null) { + $rootScope.globalSetting.modesty = curentmodesty + } - //0.1 + //0.1 - var currentBodyViewId = localStorage.getItem("currentBodyViewId"); - if (currentBodyViewId == null || currentBodyViewId == undefined) { - // document.location = '/'; - document.location = '/'; - $rootScope.isVisibleLogin = true; + var currentBodyViewId = localStorage.getItem("currentBodyViewId"); + if (currentBodyViewId == null || currentBodyViewId == undefined) { + // document.location = '/'; + document.location = '/'; + $rootScope.isVisibleLogin = true; - } - else { - $rootScope.isVisibleLogin = false; - $rootScope.loadSearchDataForBodyView(); + } + else { + $rootScope.isVisibleLogin = false; + $rootScope.loadSearchDataForBodyView(); - console.log('currentBodyViewId pickjed from localStorage: ' + currentBodyViewId); + console.log('currentBodyViewId pickjed from localStorage: ' + currentBodyViewId); - 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 openViews; + if ($rootScope.openViews != null || $rootScope.openViews != undefined) { + if ($rootScope.openViews.length > 0) { + openViews = new jinqJs() + .from($rootScope.openViews) + .where("BodyViewId == " + currentBodyViewId) + .select(); + } } - } - // 0.2 getting corresponding body view title - //var counter = 1; - var tittle = localStorage.getItem("currentViewTitleFromJson"); - localStorage.setItem("currentViewTitle", tittle); + // 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) { + //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); - // } + // if (value.bodyView == tittle) { + // tittle = localStorage.getItem("currentViewTitleFromJson") + counter++; + // $rootScope.currentActiveViewTitle = tittle; + // localStorage.setItem("currentViewTitle", tittle); + // } - // }); - //} - //else { - // localStorage.setItem("currentViewTitle", tittle); - //} + // }); + //} + //else { + // localStorage.setItem("currentViewTitle", tittle); + //} - //0.3 + //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"), + $.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) { @@ -653,11 +652,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'); @@ -688,14 +687,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); } @@ -1588,7 +1587,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++) { @@ -1608,7 +1607,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++) { @@ -1619,7 +1618,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++) { @@ -1992,7 +1991,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++) { @@ -2019,7 +2018,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]); @@ -2860,12 +2859,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++) { @@ -2882,7 +2881,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; }; } @@ -2973,7 +2972,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() @@ -2997,7 +2996,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) { @@ -3023,7 +3022,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 { @@ -3612,7 +3611,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); @@ -4158,7 +4157,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%"); } } @@ -4504,7 +4504,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo } } - $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); } @@ -4541,9 +4541,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; @@ -4771,7 +4771,7 @@ 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 @@ -4782,8 +4782,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo var imageData = imageD.data; var length = imageData.length; - // set every fourth value to the desired number of transparency + + for (var i = 3; i < length; i += 4) { if ($scope.voId == "9" || $scope.voId == "11") { @@ -4795,13 +4796,13 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo } } else { - - imageData[i] = ((255) * (parseInt(transNumber))) / 100; + + imageData[i] = ((255) * (parseInt(transNumber))) / 100; } - + } - + tempCtx.putImageData(imageD, 0, 0); @@ -4843,7 +4844,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo } } - + ctx.putImageData(imageD1, 0, 0); @@ -5036,7 +5037,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++) { @@ -5110,7 +5111,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo } } - + if (tCanvasHeight != $scope.transparencyCanvasHeight || tCanvasWidth != $scope.transparencyCanvasWidth) { @@ -5137,7 +5138,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) { @@ -5222,7 +5223,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 @@ -5278,7 +5279,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo } }) } - + } @@ -5458,7 +5459,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); } @@ -5710,8 +5711,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; @@ -5746,7 +5747,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 @@ -5913,8 +5914,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 }) } @@ -8782,4 +8783,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 @@