From 9fbbbfd222b185f53dee3f7e5143ace63bec821d Mon Sep 17 00:00:00 2001 From: nikita Date: Tue, 28 Nov 2017 12:30:28 +0530 Subject: [PATCH] there was issue in auto merge. 1. Curly brace was missing. 2. some line was missing. 3. Mukul's code lines was missing for 2 fixes. --- 400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js | 12888 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 1 file changed, 6442 insertions(+), 6446 deletions(-) diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js index 25ce3fd..a9c4870 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js @@ -4,2260 +4,2267 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$log", "$location", "$timeout", "DA", "Modules", "$routeParams", "DataService","TermService","AIAConstants", function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Modules, $routeParam, DataService, TermService, AIAConstants) { + + $scope.genderId = ""; + $scope.BodyViewData; + $scope.selectedGenderBodyViewData; + $scope.imagePath = ""; + $rootScope.BodyRegionData; + $rootScope.BodyRegionCordinatesData; + $rootScope.isTransparencyActivated = false; + $scope.isTransparencyBtnClicked = false; + $rootScope.BodyLayerData; + $rootScope.VocabTermData; + + //for modesty image layers + $scope.lowerlayerNumberForModesty; + $scope.HigherlayerNumberForModesty; + $scope.layerInfoForModesty; + + $scope.VocabTermTxt; + $scope.CommonData + $rootScope.TermNumberData = null; + $rootScope.BodySystemData + $scope.bodyViewId = 0; + $rootScope.bgartData; + $scope.drawnBodyRegions; + //view specific constants + $rootScope.voId; + $scope.layerNumber; + $scope.daCounter = 1; + $scope.bagartDetails; + $scope.transNumber = 100; + + $rootScope.modestyCanvasZindex = 12100; + $rootScope.isTBoxModestyVisible = false; + //for transarency scale + $scope.TBDrawStartX; + $scope.TBDrawStartY; + $scope.isTBDrawnOnBodyRegion; + $rootScope.path = "~/../content/images/speeachBubbleClose.png"; + $rootScope.isHighLight = false; + $rootScope.coloredImageCanvasList = []; + $rootScope.coloredImageMRCanvasList = []; + $rootScope.ColoredCanvasData = []; + $rootScope.grayImageDataList = []; + + $rootScope.rawGrayImageDataList = []; + + $rootScope.grayImageMRDataList = []; + $rootScope.updatedGrayDataList = []; + $rootScope.updatedGrayMRDataList = []; + $scope.isEligibleForHighlight = false; + $scope.doHighlightOrExtract = false; + $scope.isClickedOnBodyForHighlight; + $scope.isEligibleForHighlightBodyByTermList = false; + + // $scope.AnteriorView = "active"; + + $rootScope.zoomInOut = 75; + $scope.speechBubbleCounter = 0; + $scope.j = 0; + $scope.speechbubbleList = []; + $scope.speachBubbleArrayAnnotation = []; + $rootScope.multiAnnotationIsON = false; + $scope.previousGrayImageDataVar; + $scope.previousGrayCanvas; + $rootScope.updatedImageDataList = []; + $rootScope.updatedImageMRDataList = []; + + $scope.previousSelectedTermList = []; + $scope.runningWorkers = []; + $scope.runningSearchWorkers = []; + $scope.runningBodyViewWorkers = []; + + // This variable is used for unhighlight previously highlighted body portion, if multiAnnotation is false. + $scope.machedIcolorInBodyRegion = []; + + $rootScope.MaskCanvasData = []; + + //extract + $rootScope.isExtract = false; + $rootScope.UIWrapperZIndex = 12000; + + $rootScope.whiteImageDataList = []; + $rootScope.whiteImageMRDataList = []; + $rootScope.previousHighlightList = []; - $scope.genderId = ""; - $scope.BodyViewData; - $scope.selectedGenderBodyViewData; - $scope.imagePath = ""; - $rootScope.BodyRegionData; - $rootScope.BodyRegionCordinatesData; - $rootScope.isTransparencyActivated = false; - $scope.isTransparencyBtnClicked = false; - $rootScope.BodyLayerData; - $rootScope.VocabTermData; - - //for modesty image layers - $scope.lowerlayerNumberForModesty; - $scope.HigherlayerNumberForModesty; - $scope.layerInfoForModesty; - - $scope.VocabTermTxt; - $scope.CommonData - $rootScope.TermNumberData = null; - $rootScope.BodySystemData - $scope.bodyViewId = 0; - $rootScope.bgartData; - $scope.drawnBodyRegions; - //view specific constants - $rootScope.voId; - $scope.layerNumber; - $scope.daCounter = 1; - $scope.bagartDetails; - $scope.transNumber = 100; - - $rootScope.modestyCanvasZindex = 12100; - $rootScope.isTBoxModestyVisible = false; - //for transarency scale - $scope.TBDrawStartX; - $scope.TBDrawStartY; - $scope.isTBDrawnOnBodyRegion; - $rootScope.path = "~/../content/images/speeachBubbleClose.png"; - $rootScope.isHighLight = false; - $rootScope.coloredImageCanvasList = []; - $rootScope.coloredImageMRCanvasList = []; - $rootScope.ColoredCanvasData = []; - $rootScope.grayImageDataList = []; - - $rootScope.rawGrayImageDataList = []; - - $rootScope.grayImageMRDataList = []; - $rootScope.updatedGrayDataList = []; - $rootScope.updatedGrayMRDataList = []; - $scope.isEligibleForHighlight = false; - $scope.doHighlightOrExtract = false; - $scope.isClickedOnBodyForHighlight; - $scope.isEligibleForHighlightBodyByTermList = false; - - // $scope.AnteriorView = "active"; - - $rootScope.zoomInOut = 75; - $scope.speechBubbleCounter = 0; - $scope.j = 0; - $scope.speechbubbleList = []; - $scope.speachBubbleArrayAnnotation = []; - $rootScope.multiAnnotationIsON = false; - $scope.previousGrayImageDataVar; - $scope.previousGrayCanvas; - $rootScope.updatedImageDataList = []; - $rootScope.updatedImageMRDataList = []; - - $scope.previousSelectedTermList = []; - $scope.runningWorkers = []; - $scope.runningSearchWorkers = []; - $scope.runningBodyViewWorkers = []; - - // This variable is used for unhighlight previously highlighted body portion, if multiAnnotation is false. - $scope.machedIcolorInBodyRegion = []; - - $rootScope.MaskCanvasData = []; - - //extract - $rootScope.isExtract = false; - $rootScope.UIWrapperZIndex = 12000; - - $rootScope.whiteImageDataList = []; - $rootScope.whiteImageMRDataList = []; - $rootScope.previousHighlightList = []; - - $rootScope.isViewChange = false; - $rootScope.isGenderChnage = false; - - // to do it is setting but not using. need to check - $rootScope.updatedWhiteImageDataList = []; - $rootScope.updatedWhiteImageMRDataList = []; - - //normal mode - $rootScope.isNormalMode = true; - $rootScope.isZoomed = false; - - //navigator man functionality - $scope.navigatorImage; - $rootScope.NavigatorData; - $scope.navimgsrc; - - $scope.dragdivleft; - $scope.dragdivtop = 0; - - $rootScope.systemNumber = 0; - - $scope.IsSearchVisible = false; - $scope.shapesize = 1; - + $rootScope.isViewChange = false; + $rootScope.isGenderChnage = false; - //array for bodyviewid correspoing to male female(used for gender change) - $scope.correspondingBodyViewIds = { - '1': '5', - '2': '6', - '3': '7', - '4': '8', - '9': '11', - '10': '12', - - '5': '1', - '6': '2', - '7': '3', - '8': '4', - '11': '9', - '12': '10', - - } - - $scope.bodyViews = { - 'Anterior': '1', - 'Lateral': '2', - 'Medial': '3', - 'Posterior': '4', - 'Lateral Arm': '5', - 'Medial Arm': '6' - } - - $scope.isBodylayerdataLoaded = false; - $scope.isBodyRegionDataLoaded = false; - //currentTitleFromJson shows the current BodyView Title - $scope.currentTitleFromJson; - $scope.showTabButton = false; - $scope.IsVisible = function () { - $scope.scroll(); - - } - - - $scope.scroll = function () { - // $window.scrollTo(0, 0); - $("html,body").scrollTop(0); - //alert("scroll"); - } - - - $scope.switchGender = function () { - - var retrievedObject = $rootScope.getLocalStorageValue('currentViewTitle'); - - if (retrievedObject == "Male Anterior") { - $scope.male = "active"; - $scope.female = ""; - } - else if (retrievedObject == "Female Anterior") { - $scope.male = ""; - $scope.female = "active"; - } - } + // to do it is setting but not using. need to check + $rootScope.updatedWhiteImageDataList = []; + $rootScope.updatedWhiteImageMRDataList = []; - //get the DA body view list based on selected gender - //get the DA body view list based on selected gender - $scope.getDAViewList = function ($event) { + //normal mode + $rootScope.isNormalMode = true; + $rootScope.isZoomed = false; + //navigator man functionality + $scope.navigatorImage; + $rootScope.NavigatorData; + $scope.navimgsrc; - if ($('#MainImage') != null) { - $('#MainImage').remove(); - } - // $rootScope.currentActiveModuleTitle = Modules[0].Name; - $("#bodyViewList").empty(); - //for default load - if ($event == null || $event == undefined) { - //if (($rootScope.getLocalStorageValue("genderId") != "")||($rootScope.getLocalStorageValue("genderId")!="null")) { - // $scope.genderId = $rootScope.getLocalStorageValue("genderId"); - //} - var selectedGender = $rootScope.getLocalStorageValue("genderId"); - if ((selectedGender == null)) { - $scope.genderId = "Male"; - } - else - $scope.genderId = $rootScope.getLocalStorageValue("genderId"); + $scope.dragdivleft; + $scope.dragdivtop = 0; + + $rootScope.systemNumber = 0; + + $scope.IsSearchVisible = false; + $scope.shapesize = 1; + + + //array for bodyviewid correspoing to male female(used for gender change) + $scope.correspondingBodyViewIds = { + '1': '5', + '2': '6', + '3': '7', + '4': '8', + '9': '11', + '10': '12', + + '5': '1', + '6': '2', + '7': '3', + '8': '4', + '11': '9', + '12': '10', + + } + + $scope.bodyViews = { + 'Anterior': '1', + 'Lateral': '2', + 'Medial': '3', + 'Posterior': '4', + 'Lateral Arm': '5', + 'Medial Arm': '6' + } + + $scope.isBodylayerdataLoaded = false; + $scope.isBodyRegionDataLoaded = false; + //currentTitleFromJson shows the current BodyView Title + $scope.currentTitleFromJson; + $scope.showTabButton = false; + + $scope.IsVisible = function () { + $scope.scroll(); } - else { - $scope.genderId = $event.currentTarget.id; + + + $scope.scroll = function () { + // $window.scrollTo(0, 0); + $("html,body").scrollTop(0); + //alert("scroll"); } - localStorage.setItem("genderId", $scope.genderId); - var selectedGender = $rootScope.getLocalStorageValue("genderId"); + $scope.switchGender = function () { + + var retrievedObject = $rootScope.getLocalStorageValue('currentViewTitle'); - if (selectedGender != null) { - if (selectedGender == "Male") { - $('#Male').addClass('active'); - $('#Female').removeClass("active"); + if (retrievedObject == "Male Anterior") { + $scope.male = "active"; + $scope.female = ""; } - else { - $('#Female').addClass('active'); - $('#Male').removeClass("active"); + else if (retrievedObject == "Female Anterior") { + $scope.male = ""; + $scope.female = "active"; } - } - $scope.selectedGenderBodyViewData = new jinqJs() - .from($scope.BodyViewData.BodyViews.view) - .where('_gender == ' + $scope.genderId) - .select(); - - if ($scope.selectedGenderBodyViewData != null || $scope.selectedGenderBodyViewData != undefined) { - angular.forEach($scope.selectedGenderBodyViewData, function (value, key) { + //get the DA body view list based on selected gender + //get the DA body view list based on selected gender + $scope.getDAViewList = function ($event) { - var userEthnicity; - var userModestysettings; - var curentEthnicity = $rootScope.getLocalStorageValue("globalEthnicity"); - if (typeof (curentEthnicity) !== "undefined" && curentEthnicity !== null) { - userEthnicity = curentEthnicity; - } - else { - userEthnicity = $rootScope.globalSetting.ethnicity; + if ($('#MainImage') != null) { + $('#MainImage').remove(); + } + // $rootScope.currentActiveModuleTitle = Modules[0].Name; + $("#bodyViewList").empty(); + //for default load + if ($event == null || $event == undefined) { + //if (($rootScope.getLocalStorageValue("genderId") != "")||($rootScope.getLocalStorageValue("genderId")!="null")) { + // $scope.genderId = $rootScope.getLocalStorageValue("genderId"); + //} + var selectedGender = $rootScope.getLocalStorageValue("genderId"); + if ((selectedGender == null)) { + $scope.genderId = "Male"; } + else + $scope.genderId = $rootScope.getLocalStorageValue("genderId"); - var curentmodesty = $rootScope.getLocalStorageValue("globalModesty"); - if (typeof (curentmodesty) !== "undefined" && curentmodesty !== null) { - userModestysettings = curentmodesty; - } - else { - userModestysettings = $rootScope.globalSetting.modesty; - } + } + else { + $scope.genderId = $event.currentTarget.id; + } + localStorage.setItem("genderId", $scope.genderId); + var selectedGender = $rootScope.getLocalStorageValue("genderId"); - //var userSelectedSkintone = 'W'; - //$scope.userModestySetting = 'Y' - var thumbnailImage; - if ((value._id == 1) || (value._id == 3) || (value._id == 5) || (value._id == 6) || (value._id == 7) || (value._id == 11)) - thumbnailImage = ((value._thumbnailImage).replace('.jpg', '_' + userEthnicity + userModestysettings)) + '.jpg'; + if (selectedGender != null) { + if (selectedGender == "Male") { + $('#Male').addClass('active'); + $('#Female').removeClass("active"); + } else { - thumbnailImage = ((value._thumbnailImage).replace('.jpg', '_' + userEthnicity)) + '.jpg'; - + $('#Female').addClass('active'); + $('#Male').removeClass("active"); } - $scope.imagePath = "~/../content/images/DA/" + $rootScope.zoomInOut + "/body-views/" + value._id + '/skintone/' + userEthnicity + '/' + thumbnailImage; + } + $scope.selectedGenderBodyViewData = new jinqJs() + .from($scope.BodyViewData.BodyViews.view) + .where('_gender == ' + $scope.genderId) + .select(); - var $el = $('
' - + '' - + '

' + value._title + '

').appendTo('#bodyViewList'); + if ($scope.selectedGenderBodyViewData != null || $scope.selectedGenderBodyViewData != undefined) { + angular.forEach($scope.selectedGenderBodyViewData, function (value, key) { - $compile($el)($scope); - $(".sidebar").mCustomScrollbar({ - autoHideScrollbar: true, - //theme:"rounded" - }); + var userEthnicity; + var userModestysettings; + var curentEthnicity = $rootScope.getLocalStorageValue("globalEthnicity"); + if (typeof (curentEthnicity) !== "undefined" && curentEthnicity !== null) { + userEthnicity = curentEthnicity; + } + else { + userEthnicity = $rootScope.globalSetting.ethnicity; + } - }); - } + var curentmodesty = $rootScope.getLocalStorageValue("globalModesty"); + if (typeof (curentmodesty) !== "undefined" && curentmodesty !== null) { + userModestysettings = curentmodesty; + } + else { + userModestysettings = $rootScope.globalSetting.modesty; + } - }; - $scope.DisableUI = function () { - var daImagePanelConetent = document.getElementsByClassName("jsPanel-content"); - for (var i = 0; i < daImagePanelConetent.length; i++) { - daImagePanelConetent[i].style.pointerEvents = "none"; - daImagePanelConetent[i].style.opacity = "0.5"; - - } - //to disbale layer change slider - $('.ui-slider').slider('disable'); - } - $scope.EnableUI = function () { + //var userSelectedSkintone = 'W'; + //$scope.userModestySetting = 'Y' + var thumbnailImage; + if ((value._id == 1) || (value._id == 3) || (value._id == 5) || (value._id == 6) || (value._id == 7) || (value._id == 11)) + thumbnailImage = ((value._thumbnailImage).replace('.jpg', '_' + userEthnicity + userModestysettings)) + '.jpg'; + else { + thumbnailImage = ((value._thumbnailImage).replace('.jpg', '_' + userEthnicity)) + '.jpg'; - var daImagePanelConetent = document.getElementsByClassName("jsPanel-content"); - for (var i = 0; i < daImagePanelConetent.length; i++) { - daImagePanelConetent[i].style.pointerEvents = "auto"; - daImagePanelConetent[i].style.opacity = "1"; - } - //to enable layer change slider - $('.ui-slider').slider('enable'); + } - } + $scope.imagePath = "~/../content/images/DA/" + $rootScope.zoomInOut + "/body-views/" + value._id + '/skintone/' + userEthnicity + '/' + thumbnailImage; - $scope.openView = function ($event) { - $scope.DisableUI(); - $rootScope.disableAnnotationTB = false; - $rootScope.MenuModuleName = "DA"; - $rootScope.isLoading = true; - $('#spinner').css('visibility', 'visible'); + var $el = $('
' + + '' + + '

' + value._title + '

').appendTo('#bodyViewList'); - $rootScope.currentBodyViewId = $event.currentTarget.id; - $rootScope.ViewTitle = $event.currentTarget.textContent; - localStorage.setItem("currentViewTitleFromJson", $event.currentTarget.textContent); - localStorage.setItem("currentViewTitle", $event.currentTarget.textContent); - localStorage.setItem("currentBodyViewId", $event.currentTarget.id); + $compile($el)($scope); + $(".sidebar").mCustomScrollbar({ + autoHideScrollbar: true, + //theme:"rounded" + }); - var u = $location.url(); - $location.url('/da-body-view'); + }); + } - var view_list = angular.element($event.currentTarget); - var view_list_male_female = view_list.attr('title'); + }; - if (($event.currentTarget.textContent == "Female Anterior" || $event.currentTarget.textContent == "Male Anterior")) { - $rootScope.AnteriorView = "active"; - $rootScope.LateralView = ""; - $rootScope.MedialView = ""; - $rootScope.PosteriorView = ""; - $rootScope.LateralArmView = ""; - $rootScope.MedialArmView = ""; + $scope.DisableUI = function () { + var daImagePanelConetent = document.getElementsByClassName("jsPanel-content"); + for (var i = 0; i < daImagePanelConetent.length; i++) { + daImagePanelConetent[i].style.pointerEvents = "none"; + daImagePanelConetent[i].style.opacity = "0.5"; + + } + //to disbale layer change slider + $('.ui-slider').slider('disable'); } - if (($event.currentTarget.textContent == "Female Lateral" || $event.currentTarget.textContent == "Male Lateral")) { - $rootScope.AnteriorView = ""; - $rootScope.LateralView = "active"; - $rootScope.MedialView = ""; - $rootScope.PosteriorView = ""; - $rootScope.LateralArmView = ""; - $rootScope.MedialArmView = ""; + $scope.EnableUI = function () { - } - if (($event.currentTarget.textContent == "Female Medial" || $event.currentTarget.textContent == "Male Medial")) { - $rootScope.AnteriorView = ""; - $rootScope.LateralView = ""; - $rootScope.MedialView = "active"; - $rootScope.PosteriorView = ""; - $rootScope.LateralArmView = ""; - $rootScope.MedialArmView = ""; - + var daImagePanelConetent = document.getElementsByClassName("jsPanel-content"); + for (var i = 0; i < daImagePanelConetent.length; i++) { + daImagePanelConetent[i].style.pointerEvents = "auto"; + daImagePanelConetent[i].style.opacity = "1"; + } + //to enable layer change slider + $('.ui-slider').slider('enable'); } - if (($event.currentTarget.textContent == "Female Posterior" || $event.currentTarget.textContent == "Male Posterior")) { - $rootScope.AnteriorView = ""; - $rootScope.LateralView = ""; - $rootScope.MedialView = ""; - $rootScope.PosteriorView = "active"; - $rootScope.LateralArmView = ""; - $rootScope.MedialArmView = ""; - } - if (($event.currentTarget.textContent == "Female Lateral Arm" || $event.currentTarget.textContent == "Male Lateral Arm")) { - $rootScope.AnteriorView = ""; - $rootScope.LateralView = ""; - $rootScope.MedialView = ""; - $rootScope.PosteriorView = ""; - $rootScope.LateralArmView = "active"; - $rootScope.MedialArmView = ""; + $scope.openView = function ($event) { + $scope.DisableUI(); + $rootScope.disableAnnotationTB = false; + $rootScope.MenuModuleName = "DA"; + $rootScope.isLoading = true; + $('#spinner').css('visibility', 'visible'); - } - if (($event.currentTarget.textContent == "Female Medial Arm" || $event.currentTarget.textContent == "Male Medial Arm")) { - $rootScope.AnteriorView = ""; - $rootScope.LateralView = ""; - $rootScope.MedialView = ""; - $rootScope.PosteriorView = ""; - $rootScope.LateralArmView = ""; - $rootScope.MedialArmView = "active"; + $rootScope.currentBodyViewId = $event.currentTarget.id; + $rootScope.ViewTitle = $event.currentTarget.textContent; + localStorage.setItem("currentViewTitleFromJson", $event.currentTarget.textContent); + localStorage.setItem("currentViewTitle", $event.currentTarget.textContent); + localStorage.setItem("currentBodyViewId", $event.currentTarget.id); - } + var u = $location.url(); + $location.url('/da-body-view'); - //$rootScope.Normal = "LeftButtonsDefaultState"; + var view_list = angular.element($event.currentTarget); + var view_list_male_female = view_list.attr('title'); - if (view_list_male_female == "Male") { + if (($event.currentTarget.textContent == "Female Anterior" || $event.currentTarget.textContent == "Male Anterior")) { + $rootScope.AnteriorView = "active"; + $rootScope.LateralView = ""; + $rootScope.MedialView = ""; + $rootScope.PosteriorView = ""; + $rootScope.LateralArmView = ""; + $rootScope.MedialArmView = ""; + } + if (($event.currentTarget.textContent == "Female Lateral" || $event.currentTarget.textContent == "Male Lateral")) { + $rootScope.AnteriorView = ""; + $rootScope.LateralView = "active"; + $rootScope.MedialView = ""; + $rootScope.PosteriorView = ""; + $rootScope.LateralArmView = ""; + $rootScope.MedialArmView = ""; - $rootScope.male = "active"; - $rootScope.female = ""; - } - else { - $rootScope.male = ""; - $rootScope.female = "active"; - } + } + if (($event.currentTarget.textContent == "Female Medial" || $event.currentTarget.textContent == "Male Medial")) { + $rootScope.AnteriorView = ""; + $rootScope.LateralView = ""; + $rootScope.MedialView = "active"; + $rootScope.PosteriorView = ""; + $rootScope.LateralArmView = ""; + $rootScope.MedialArmView = ""; - } + } + if (($event.currentTarget.textContent == "Female Posterior" || $event.currentTarget.textContent == "Male Posterior")) { + $rootScope.AnteriorView = ""; + $rootScope.LateralView = ""; + $rootScope.MedialView = ""; + $rootScope.PosteriorView = "active"; + $rootScope.LateralArmView = ""; + $rootScope.MedialArmView = ""; + } + if (($event.currentTarget.textContent == "Female Lateral Arm" || $event.currentTarget.textContent == "Male Lateral Arm")) { + $rootScope.AnteriorView = ""; + $rootScope.LateralView = ""; + $rootScope.MedialView = ""; + $rootScope.PosteriorView = ""; + $rootScope.LateralArmView = "active"; + $rootScope.MedialArmView = ""; - //load json data for body view - $scope.loadDissectibleAnatomyData = function () { - if ($rootScope.refreshcheck == null) { - $location.path('/'); - } - //get current path - var currentURL = $location.path(); - var selectedModuleName = ''; - angular.forEach($rootScope.userModules, function (value, key) { - if (value.slug === currentURL.replace('/', '')) { - selectedModuleName = value.name; - $rootScope.currentActiveModuleTitle = selectedModuleName; } - }) + if (($event.currentTarget.textContent == "Female Medial Arm" || $event.currentTarget.textContent == "Male Medial Arm")) { + $rootScope.AnteriorView = ""; + $rootScope.LateralView = ""; + $rootScope.MedialView = ""; + $rootScope.PosteriorView = ""; + $rootScope.LateralArmView = ""; + $rootScope.MedialArmView = "active"; - $rootScope.ClearIframe(); + } - //load common data - var commondataJsonPath = '~/../content/data/json/da/da_dat_common.json'; + //$rootScope.Normal = "LeftButtonsDefaultState"; - DataService.getAnotherJson(commondataJsonPath) - .then( - function (result) { + if (view_list_male_female == "Male") { - $rootScope.CommonData = result; - $http({ method: 'GET', url: '~/../content/data/json/da/da_dat_contentlist.json' }).success(function (data) { + $rootScope.male = "active"; + $rootScope.female = ""; + } + else { - $scope.BodyViewData = data; + $rootScope.male = ""; + $rootScope.female = "active"; + } - $scope.getDAViewList(); - }) - .error(function (data, status, headers, config) { - console.log(data); - }); + } - }, - function (error) { - console.log(error.statusText) - } - ) - //load body-views data + //load json data for body view + $scope.loadDissectibleAnatomyData = function () { + if ($rootScope.refreshcheck == null) { + $location.path('/'); + } + //get current path + var currentURL = $location.path(); + var selectedModuleName = ''; + angular.forEach($rootScope.userModules, function (value, key) { + if (value.slug === currentURL.replace('/', '')) { + selectedModuleName = value.name; + $rootScope.currentActiveModuleTitle = selectedModuleName; + } + }) - // $('#daLoaderLabel').css('visibility', 'hidden') - $rootScope.isLoading = false; + $rootScope.ClearIframe(); + //load common data + var commondataJsonPath = '~/../content/data/json/da/da_dat_common.json'; - //push the details of open module in array $rootScope.openModules - $rootScope.openModules.push({ "ModuleId": 1 }); + DataService.getAnotherJson(commondataJsonPath) + .then( + function (result) { + $rootScope.CommonData = result; + $http({ method: 'GET', url: '~/../content/data/json/da/da_dat_contentlist.json' }).success(function (data) { - } + $scope.BodyViewData = data; + $scope.getDAViewList(); - //da-body-views functions + }) + .error(function (data, status, headers, config) { + console.log(data); + }); - $scope.openBodyView = function () { - //Check if browser 'REFRESHED' or 'RELOADED' - if ($rootScope.CommonData != null) { - //0. we will initially append container to load body - //check if localstorage has any settings - var curentEthnicity = $rootScope.getLocalStorageValue("globalEthnicity"); - if (typeof (curentEthnicity) !== "undefined" && curentEthnicity !== null) { - $rootScope.globalSetting.ethnicity = curentEthnicity; + }, + function (error) { + console.log(error.statusText) } + ) + //load body-views data - var curentmodesty = $rootScope.getLocalStorageValue("globalModesty"); - if (typeof (curentmodesty) !== "undefined" && curentmodesty !== null) { - $rootScope.globalSetting.modesty = curentmodesty - } - //0.1 + // $('#daLoaderLabel').css('visibility', 'hidden') + $rootScope.isLoading = false; - var currentBodyViewId = $rootScope.getLocalStorageValue("currentBodyViewId"); - if (currentBodyViewId == null || currentBodyViewId == undefined) { - // document.location = '/'; - document.location = '/'; - $rootScope.isVisibleLogin = true; - } - else { - $rootScope.isVisibleLogin = false; - $rootScope.loadSearchData(); + //push the details of open module in array $rootScope.openModules + $rootScope.openModules.push({ "ModuleId": 1 }); - 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(); - } - } + } - // 0.2 getting corresponding body view title - //var counter = 1; - var tittle = $rootScope.getLocalStorageValue("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) { + //da-body-views functions - // if (value.bodyView == tittle) { - // tittle = $rootScope.getLocalStorageValue("currentViewTitleFromJson") + counter++; - // $rootScope.currentActiveViewTitle = tittle; - // localStorage.setItem("currentViewTitle", tittle); - // } + $scope.openBodyView = function () { + //Check if browser 'REFRESHED' or 'RELOADED' + if ($rootScope.CommonData != null) { + //0. we will initially append container to load body - // }); - //} - //else { - // localStorage.setItem("currentViewTitle", tittle); - //} + //check if localstorage has any settings + var curentEthnicity = $rootScope.getLocalStorageValue("globalEthnicity"); + if (typeof (curentEthnicity) !== "undefined" && curentEthnicity !== null) { + $rootScope.globalSetting.ethnicity = curentEthnicity; + } + + var curentmodesty = $rootScope.getLocalStorageValue("globalModesty"); + if (typeof (curentmodesty) !== "undefined" && curentmodesty !== null) { + $rootScope.globalSetting.modesty = curentmodesty + } - //0.3 + //0.1 - $.jsPanel({ - id: 'daImagePanel', - selector: '.daBodyView', - theme: 'success', - currentController: 'DAController', - parentSlug: 'da-view-list', - ajax: { - url: 'app/views/da/da-view.html' - }, - title: $rootScope.getLocalStorageValue("currentViewTitle"), + var currentBodyViewId = $rootScope.getLocalStorageValue("currentBodyViewId"); + if (currentBodyViewId == null || currentBodyViewId == undefined) { + // document.location = '/'; + document.location = '/'; + $rootScope.isVisibleLogin = true; - position: { - top: 70, - left: 1, - }, + } + else { + $rootScope.isVisibleLogin = false; - size: { width: $(window).outerWidth() - 10, height: $(window).outerHeight() - 110 }, + $rootScope.loadSearchData(); - }); + console.log('currentBodyViewId pickjed from localStorage: ' + currentBodyViewId); - console.log('jsPanel loaded daImagePanel exist= ' + document.getElementById('daImagePanel')) - //0.1 - $rootScope.currentSlug = 'da-body-view'; + 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 - $rootScope.openViews.push( - { - "module": $rootScope.currentActiveModuleTitle, "bodyView": tittle, "state": 'max', "BodyViewId": $rootScope.currentBodyViewId, - "slug": $rootScope.currentSlug - } - ); + // 0.2 getting corresponding body view title + //var counter = 1; + var tittle = $rootScope.getLocalStorageValue("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 = $rootScope.getLocalStorageValue("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: $rootScope.getLocalStorageValue("currentViewTitle"), + + position: { + top: 70, + left: 1, + }, + + 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'; + + //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", (parseInt($(window).outerHeight())-62-20)); + //0.4 added some stylesheets + $('#daBodyview').css("height", (parseInt($(window).outerHeight())-62-20)); - $('#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.loadSearchData(); + //$rootScope.loadSearchData(); - $scope.currentTitleFromJson = $rootScope.getLocalStorageValue("currentViewTitle"); + $scope.currentTitleFromJson = $rootScope.getLocalStorageValue("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 = $rootScope.getLocalStorageValue("currentBodyViewId"); - } - //$('#daBodyview').css("height", $(window).outerHeight()); + //2. load bodyRegion data + $rootScope.isLoading = true; + $rootScope.voId = $rootScope.getLocalStorageValue("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); + }, 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. - - $location.path('/'); + 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. - /*relaoding unavailable data for resolving refesh issue*/ - /* console.log('Reloading json data for body view => BROWSER REFRESH ISSUE...'); - $scope.loadDissectibleAnatomyData(); + $location.path('/'); - if ((typeof($rootScope.MenuModuleName) == "undefined") || $rootScope.MenuModuleName == null) { - $rootScope.MenuModuleName = "DA"; - }*/ + /*relaoding unavailable data for resolving refesh issue*/ + /* console.log('Reloading json data for body view => BROWSER REFRESH ISSUE...'); + $scope.loadDissectibleAnatomyData(); + + if ((typeof($rootScope.MenuModuleName) == "undefined") || $rootScope.MenuModuleName == null) { + $rootScope.MenuModuleName = "DA"; + }*/ + } } - } - angular.element(document).ready(function (e) { + angular.element(document).ready(function (e) { - $(document).on("click", "#daImagePanel .jsPanel-hdr .jsPanel-hdr-r .jsPanel-btn-close .jsglyph-remove", function () { - $rootScope.selectedBodySystemName = 'All'; - $rootScope.selectedBodySystemId = 0; - $rootScope.searchSelectedText = ''; - }); - $("#layerChangeSlider").slider({ - orientation: "vertical", - range: "max", - min: 0, - value: 0, - slide: function (event, ui) - { - var layerNum; - var daViewScope = angular.element(document.getElementById("daView")).scope(); - layerNum = parseInt(daViewScope.totalLayers) //- parseInt(scope.layerNumber); - var sliderVal = layerNum - ui.value; - $("#txtlayerNumber").val(sliderVal); - }, - - stop: function (event, ui) { + $(document).on("click", "#daImagePanel .jsPanel-hdr .jsPanel-hdr-r .jsPanel-btn-close .jsglyph-remove", function () { + $rootScope.selectedBodySystemName = 'All'; + $rootScope.selectedBodySystemId = 0; + $rootScope.searchSelectedText = ''; + }); + $("#layerChangeSlider").slider({ + orientation: "vertical", + range: "max", + min: 0, + value: 0, + slide: function (event, ui) + { + var layerNum; + var daViewScope = angular.element(document.getElementById("daView")).scope(); + layerNum = parseInt(daViewScope.totalLayers) //- parseInt(scope.layerNumber); + var sliderVal = layerNum - ui.value; + $("#txtlayerNumber").val(sliderVal); + }, + + stop: function (event, ui) { - var la; - var rootScope = angular.element(document.getElementById("bo")).scope(); - rootScope.$apply(function () { - rootScope.isLoading = true; - }) - var scope = angular.element(document.getElementById("daView")).scope(); - scope.$apply(function () { - if (scope.isTransparencyActivated) { - rootScope.isLoading = false; - } - la = parseInt(scope.totalLayers) //- parseInt(scope.layerNumber); - var slideVal = la - ui.value; - $("#txtlayerNumber").val(slideVal); - scope.layerNumber = slideVal; - scope.LayerChange(); - $("#annotationpaintbrushsize").removeClass("activebtncolor"); - $("#annotationpainteraser").removeClass("activebtncolor"); - }); - }, + var la; + var rootScope = angular.element(document.getElementById("bo")).scope(); + rootScope.$apply(function () { + rootScope.isLoading = true; + }) + var scope = angular.element(document.getElementById("daView")).scope(); + scope.$apply(function () { + if (scope.isTransparencyActivated) { + rootScope.isLoading = false; + } + la = parseInt(scope.totalLayers) //- parseInt(scope.layerNumber); + var slideVal = la - ui.value; + $("#txtlayerNumber").val(slideVal); + scope.layerNumber = slideVal; + scope.LayerChange(); + $("#annotationpaintbrushsize").removeClass("activebtncolor"); + $("#annotationpainteraser").removeClass("activebtncolor"); + }); + }, - }); + }); - $("#daImagePanel").resize(function () { - $("#canvasDiv").scrollLeft($rootScope.CanvasDivLeftPosition); - $("#canvasDiv").scrollTop($rootScope.CanvasDivTopPosition); - }); + $("#daImagePanel").resize(function () { + $("#canvasDiv").scrollLeft($rootScope.CanvasDivLeftPosition); + $("#canvasDiv").scrollTop($rootScope.CanvasDivTopPosition); + }); - $(document).on("mouseover", "#termList option", function (e) { - $('#termList option[selected="selected"]').attr("selected", false); - $(this).attr("selected", true); - }); + $(document).on("mouseover", "#termList option", function (e) { + $('#termList option[selected="selected"]').attr("selected", false); + $(this).attr("selected", true); + }); - $(document).keypress(function (e) { - if ($('#termList option[selected="selected"]').attr("id") == "undefined") { - return false; - } - else { - var originator = e.keyCode || e.which; - // alert($('#termList option[selected="selected"]').attr("id")); - if ($('#termList option[selected="selected"]').attr("id")) { - if (e.keyCode == 13) { - onListManagerTermSelection($('#termList option[selected="selected"]').attr("id")); + $(document).keypress(function (e) { + if ($('#termList option[selected="selected"]').attr("id") == "undefined") { + return false; + } + else { + var originator = e.keyCode || e.which; + // alert($('#termList option[selected="selected"]').attr("id")); + if ($('#termList option[selected="selected"]').attr("id")) { + if (e.keyCode == 13) { + onListManagerTermSelection($('#termList option[selected="selected"]').attr("id")); + } } } - } - }); + }); - }) - // $rootScope.languageArray = []; - $rootScope.loadSearchData = function () { - var primaryLexiconIndex; - var languageArray = []; - $rootScope.vocabTermDataArray = []; - var languageArray = $rootScope.lexiconLanguageArray; + }) + // $rootScope.languageArray = []; + $rootScope.loadSearchData = function () { + var primaryLexiconIndex; + var languageArray = []; + $rootScope.vocabTermDataArray = []; + var languageArray = $rootScope.lexiconLanguageArray; - console.log(languageArray.length); - console.log('loadSearchDataForBodyView'); + console.log(languageArray.length); + console.log('loadSearchDataForBodyView'); - var currentBodyViewId = $rootScope.getLocalStorageValue("currentBodyViewId"); + var currentBodyViewId = $rootScope.getLocalStorageValue("currentBodyViewId"); - for (var i = 0; i <= languageArray.length - 1; i++) { - var searchWorker = new Worker('search-wp.js'); + for (var i = 0; i <= languageArray.length - 1; i++) { + var searchWorker = new Worker('search-wp.js'); - //push workers in array to further used the refernece to delete the workers - $scope.runningSearchWorkers.push({ 'workerName': searchWorker }) + //push workers in array to further used the refernece to delete the workers + $scope.runningSearchWorkers.push({ 'workerName': searchWorker }) - //console.log('for bodyRegionId = ' + bodyRegionId + ', time: ' + new Date().toTimeString().replace(/.*(\d{2}:\d{2}:\d{2}).*/, "$1")) + //console.log('for bodyRegionId = ' + bodyRegionId + ', time: ' + new Date().toTimeString().replace(/.*(\d{2}:\d{2}:\d{2}).*/, "$1")) - searchWorker.postMessage({ + searchWorker.postMessage({ - 'currentBodyViewId': currentBodyViewId, - 'languageName': languageArray[i].language, - 'languageID': languageArray[i].id - }) + 'currentBodyViewId': currentBodyViewId, + 'languageName': languageArray[i].language, + 'languageID': languageArray[i].id + }) - searchWorker.onmessage = function (e) { + searchWorker.onmessage = function (e) { - //console.log('callback searchWorker , time: ' + new Date().toTimeString().replace(/.*(\d{2}:\d{2}:\d{2}).*/, "$1")); - $rootScope.TermNumberData = e.data.TermNumberData; - console.log("$rootScope.TermNumberData = " + $rootScope.TermNumberData.length); - $rootScope.VocabTermData = e.data.VocabTermData,//same - $scope.vocabTermTxt = e.data.vocabTermTxt, - $scope.vocabLanguage = e.data.language, - $rootScope.vocabTermDataArray.push({ "language": $scope.vocabLanguage, "VocabTermData": $rootScope.VocabTermData, "vocabTermTxt": $scope.vocabTermTxt }); + //console.log('callback searchWorker , time: ' + new Date().toTimeString().replace(/.*(\d{2}:\d{2}:\d{2}).*/, "$1")); + $rootScope.TermNumberData = e.data.TermNumberData; + console.log("$rootScope.TermNumberData = " + $rootScope.TermNumberData.length); + $rootScope.VocabTermData = e.data.VocabTermData,//same + $scope.vocabTermTxt = e.data.vocabTermTxt, + $scope.vocabLanguage = e.data.language, + $rootScope.vocabTermDataArray.push({ "language": $scope.vocabLanguage, "VocabTermData": $rootScope.VocabTermData, "vocabTermTxt": $scope.vocabTermTxt }); - for (var i = 0; i <= $rootScope.lexiconLanguageArray.length - 1; i++) { + 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'); + $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); + // console.log("Language= " + $rootScope.lexiconLanguageArray[i].language + ", vocabTermTxt= " + $rootScope.vocabTermDataArray[i].vocabTermTxt[0]._TermText); - } + } - if ($rootScope.vocabTermDataArray.length == $rootScope.lexiconLanguageArray.length) { - $("#setting-spinner").css("display", "none"); + if ($rootScope.vocabTermDataArray.length == $rootScope.lexiconLanguageArray.length) { + $("#setting-spinner").css("display", "none"); - for (var i = 0; i <= $rootScope.vocabTermDataArray.length - 1; i++) { - if ($rootScope.vocabTermDataArray[i].language == $rootScope.lexiconLanguageArray[0].language) { - primaryLexiconIndex = i; + for (var i = 0; i <= $rootScope.vocabTermDataArray.length - 1; i++) { + if ($rootScope.vocabTermDataArray[i].language == $rootScope.lexiconLanguageArray[0].language) { + primaryLexiconIndex = i; + } + } + //alert(primaryLexiconIndex); + if ($rootScope.isListManagerMenuSelected) { + $scope.loadListManger(); + } } - } - //alert(primaryLexiconIndex); - if ($rootScope.isListManagerMenuSelected) { - $scope.loadListManger(); - } - } - console.log('JlinqActivity , time: ' + new Date().toTimeString().replace(/.*(\d{2}:\d{2}:\d{2}).*/, "$1")); + console.log('JlinqActivity , time: ' + new Date().toTimeString().replace(/.*(\d{2}:\d{2}:\d{2}).*/, "$1")); - if ($scope.runningSearchWorkers != null || $scope.runningSearchWorkers != undefined) { + if ($scope.runningSearchWorkers != null || $scope.runningSearchWorkers != undefined) { - var workerCount = $scope.runningSearchWorkers.length; - if (workerCount > 0) { - for (var i = workerCount - 1; i >= 0; i--) { + var workerCount = $scope.runningSearchWorkers.length; + if (workerCount > 0) { + for (var i = workerCount - 1; i >= 0; i--) { - var runningWorker = $scope.runningSearchWorkers[i].workerName; - runningWorker.terminate(); - $scope.runningSearchWorkers.splice(i, 1); - // workerCount--; + var runningWorker = $scope.runningSearchWorkers[i].workerName; + runningWorker.terminate(); + $scope.runningSearchWorkers.splice(i, 1); + // workerCount--; + } } } } - } - //console.log("s" + $rootScope.vocabTermDataArray); - //call watch on '$scope.VocabTermTxt and compile
  • and append to '; - $('#searchListDiv').append(termListFilterHtml); } - } -}] + -); + }]) function OnGenderChange(event) { -- libgit2 0.21.4