diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js index 36325f6..e3e317c 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js @@ -624,6 +624,8 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l } } + // we are loading most of alll data used in DA by this function so that at the time of any functionality delay in data laod will not happened. + $scope.loadDAView = function (currentBodyViewId) { @@ -645,6 +647,8 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l console.log('currentBodyViewId just before sending: ' + currentBodyViewId); $scope.loadBodyViewData(currentBodyViewId); + + $scope.GetBodySystemData(currentBodyViewId); //2. load bodyRegion data $rootScope.isLoading = true; $rootScope.voId = $rootScope.getLocalStorageValue("currentBodyViewId"); @@ -3023,17 +3027,27 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $scope.DisableUI(); $('.ui-slider').slider('disable'); + + if ($scope.isTransparencyActivated) { + + $scope.layerNumber = $rootScope.currentLayerNumber; + } + else { + $scope.layerNumber = $('#txtlayerNumber').val(); + $rootScope.currentLayerNumber = $scope.layerNumber; + } + $("#btnTranparency").attr('disabled', 'disabled'); - $rootScope.currentLayerNumber = $scope.layerNumber; + - $scope.layerNumber = $('#txtlayerNumber').val(); + $rootScope.isLoading = true; $('#spinner').css('visibility', 'visible'); if ($rootScope.isHighLight == true) { - $rootScope.isHighLight = false; + // $rootScope.isHighLight = false; $scope.CloseTransparencyBox(); } @@ -3041,11 +3055,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $scope.highlightedBR = []; - - var matchedTermListPath = '~/../content/data/json/da/body-views/1/BodySystem_' + $rootScope.systemNumber + '.json'; var grayImageDataVar = null; - - // DataService.getJson(matchedTermListPath) TermService.getTermData($scope.layerNumber, $rootScope.voId, $rootScope.systemNumber, $rootScope.zoomInOut) .then( @@ -3059,7 +3069,6 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l //remove existing data and draw fresh data $scope.removeCurrentHighlightedBodySystem(); - $scope.message = AIAConstants.NO_BODY_SYSTEM_AVAILABLE; $("#daMessageModal").modal('show'); @@ -3292,7 +3301,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l }); - // } + } @@ -7964,6 +7973,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l //5. change the search terms as per the selected bodyview $rootScope.loadSearchData(); + $scope.GetBodySystemData(currentBodyViewId); //6. $('#daImagePanel')[0].childNodes[0].childNodes[0].innerHTML = $rootScope.getLocalStorageValue("currentViewTitle").replace('Female', 'Male'); @@ -7996,6 +8006,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l //5. change the search terms as per the selected bodyview $rootScope.loadSearchData(); + $scope.GetBodySystemData(currentBodyViewId); //6. $('#daImagePanel')[0].childNodes[0].childNodes[0].innerHTML = $rootScope.getLocalStorageValue("currentViewTitle").replace('Male', 'Female'); @@ -8241,6 +8252,8 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l //4. change the search terms as per the selected bodyview $rootScope.loadSearchData(); + $scope.GetBodySystemData($rootScope.voId); + //5.Change the popup title next to search $scope.currentTitleFromJson = $rootScope.getLocalStorageValue("currentViewTitle"); @@ -8402,6 +8415,10 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l // $scope.loadSelectedBodyView(data.reloadDABodyViewId); $scope.loadNavigatorForSelectedBodyView(data.reloadDABodyViewId); + + if($scope.layerNumber!= 0) { + $scope.EnableUI(); + } } // $scope.currentTitleFromJson = $rootScope.getLocalStorageValue("currentViewTitle"); @@ -8487,7 +8504,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l //body highlight options functinality $scope.LoadBodySystemData = function (event) { - event.stopPropagation(); + event.stopPropagation(); $("#structureDropdown").toggle(); $("#genderChangeId").css("display", "none"); $("#viewID").css("display", "none"); @@ -8507,6 +8524,24 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l systemListHtml = systemListHtml + ''; $('#bodySystem').append(systemListHtml); + + // var bodySystemDataPath = '~/../content/data/json/da/body-views/' + currentBodyViewId + '/da_dat_body_system_term_' + currentBodyViewId + '.json'; + // DataService.getJson(bodySystemDataPath) + //.then( + // function (result) { + + // $rootScope.BodySystemData = result; + + // }, + // function (error) { + // console.log(error.statusText) + // } + // ) + + } + + $scope.GetBodySystemData = function (currentBodyViewId) { + //var currentBodyViewId = $rootScope.voId; var bodySystemDataPath = '~/../content/data/json/da/body-views/' + currentBodyViewId + '/da_dat_body_system_term_' + currentBodyViewId + '.json'; DataService.getJson(bodySystemDataPath) .then( @@ -8519,7 +8554,6 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l console.log(error.statusText) } ) - } angular.element(document).click(function () { @@ -8547,11 +8581,14 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $rootScope.systemNumber = event.currentTarget.id; + if ($rootScope.systemNumber == 0) { console.log("inside HighlightBodyByBodySystem ..came inside current structure"); //clear highlighted system $scope.removeCurrentHighlightedBodySystem(); + $rootScope.isHighlightBodyByBodySystem = false; + $scope.isbodySystemHighlight = false; $scope.EnableUI(); } diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/LabExercController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/LabExercController.js index 6d81b4a..1efe17c 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/LabExercController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/LabExercController.js @@ -65,14 +65,12 @@ function ($scope, $rootScope, pages, log, $http, $timeout, DataService, $filter, //to get all lab exercise modules from json files $scope.getLabExerciseModules = function () { - //debugger; + $scope.LabExerciseModules1 = null; var labExerciseModulePath = '~/../content/data/json/le/labexercise.json'; DataService.getAnotherJson(labExerciseModulePath).then( function (result) { - //debugger; - //alert(JSON.stringify(result)); $scope.LabExerciseModules1 = result; }, function (error) { @@ -176,7 +174,7 @@ function ($scope, $rootScope, pages, log, $http, $timeout, DataService, $filter, $scope.Imagepath = keywords.labexercise + "/" + result.LabExercise[index].Questions[index1].ImagePath; } - if ($scope.Title == "Complete the statements below.") { + if ($("#textblock").css("display") == "block") { $("#imgdiv").css("position", "static"); $("#imgdiv").find("div").each(function () { var answerDiv = $(this).attr("id").split("-"); @@ -450,11 +448,20 @@ function ($scope, $rootScope, pages, log, $http, $timeout, DataService, $filter, $scope.dragableId = $(this).attr("Id"); $scope.a = $scope.dragableId; - + console.log($scope.dragableId); $scope.dragableText = $("#" + $scope.dragableId).text(); - // alert($("#" + $scope.dragableId).text()); - + + if ($scope.dragableId.split('-')[0] != 'block') { + $scope.draggableAttribute = $("#" + $scope.dragableId).attr("draggedattr"); + // $("#" + $scope.dragableId).removeAttr("draggedattr"); + } + else + { + + $scope.draggableAttribute = ''; + } + //if user drag already selected answer from one blankbox to another than it gets id of blank box so need to get answer if ($scope.dragableId.indexOf('T') != -1) { var optionText = document.getElementById($scope.dragableId).innerHTML; @@ -498,8 +505,8 @@ function ($scope, $rootScope, pages, log, $http, $timeout, DataService, $filter, var x = $("#droppable").offset(); var id = $(this).attr("id"); - - + + var keywords = $location.search(); if ($.browser.msie) { @@ -528,13 +535,13 @@ function ($scope, $rootScope, pages, log, $http, $timeout, DataService, $filter, if ($scope.DraggedList != null) { $.each($scope.DraggedList, function (inx1, value3) { $scope.UserAttempt.push({ "BlankBoxName": id.split('-')[1], "OptionName": $scope.dragableId.split('-')[1] }); - if ($scope.DraggedList[inx1].id == $scope.a.split('-')[1]) { - $scope.b = $scope.DraggedList[inx1].blockID; - $scope.DraggedList.splice(inx1, 1); - $('#' + $scope.b).css({ "display": "block", "color": "#000000!important" }); - $('#blockans-' + $scope.b.split('-')[1]).css("background-color", "transparent !important"); - // alert('removed from dropbox= '+'blockans-' + $scope.b.split('-')[1]); - } + if ($scope.DraggedList[inx1].DraggedAttr == $scope.draggableAttribute) { + // $scope.b = $scope.DraggedList[inx1].blockID; + $scope.DraggedList.splice(inx1, 1); + $('#' + $scope.draggableAttribute).css({ "display": "block", "color": "#000000!important" }); + $('#blockans-' + $scope.a.split('-')[1]).css("background-color", "transparent !important"); + } + }); } } @@ -567,21 +574,13 @@ function ($scope, $rootScope, pages, log, $http, $timeout, DataService, $filter, $.each(Options, function (inx, value2) { if (Options[inx].BoxName == id.split('-')[1]) { if ($scope.DraggedList != null) { - //$.each($scope.DraggedList, function (inx1, value3) { - // if ($scope.DraggedList[inx1].Value == dataText) { - // $scope.DraggedList.splice(inx1, 1); - // } - //}); for (var i = 0; i <= $scope.DraggedList.length - 1; i++) { - if ($scope.DraggedList[i].Value == undefined) { i = 0; continue; } - - - //if ($scope.DraggedList[i].Value == dataText) { - if ($scope.DraggedList[i].id == id.split('-')[1]) { + if ($scope.DraggedList[i].DraggedAttr == $scope.draggableAttribute) + { $scope.DraggedList.splice(i, 1); } } @@ -589,10 +588,29 @@ function ($scope, $rootScope, pages, log, $http, $timeout, DataService, $filter, // $scope.UserAttempt.push({ "BlankBoxName": id.split('-')[1], "OptionName": $scope.dragableId.split('-')[1] }); //$scope.UserAttempt.push({ balnkBox: +$scope.dragableId.split('-')[1] }); $scope.UserAttempt.push({ "BlankBoxName": id.split('-')[1], "OptionName": $scope.dragableId.split('-')[1] }); - $scope.DraggedList.push({ "blockID": $scope.dragableId, "id": id.split('-')[1], "optionName": id.split('-')[1], "Value": dataText, "topcoord": Options[inx].topcoord, "leftcoord": Options[inx].leftcoord }); + if ($scope.dragableId.split('-')[0] == 'block') { + $scope.DraggedList.push({ "DraggedAttr": $scope.dragableId, "blockID": $scope.dragableId, "id": id.split('-')[1], "optionName": id.split('-')[1], "Value": dataText, "topcoord": Options[inx].topcoord, "leftcoord": Options[inx].leftcoord }); + } + else + { + $scope.DraggedList.push({ "DraggedAttr": $scope.draggableAttribute, "blockID": $scope.dragableId, "id": id.split('-')[1], "optionName": id.split('-')[1], "Value": dataText, "topcoord": Options[inx].topcoord, "leftcoord": Options[inx].leftcoord }); + } $('#' + $scope.dragableId).css("display", "none"); $('#blockans-' + Options[inx].OptionNumber).css("background-color", "transparent !important"); + if ($scope.dragableId.split('-')[0] == 'block') { + $timeout(function () { + $('#blockans-' + id.split('-')[1]).attr("draggedAttr", $scope.dragableId); + }, 350); + } + else + { + $timeout(function () { + $('#blockans-' + id.split('-')[1]).attr("draggedAttr", $scope.draggableAttribute); + }, 350); + } + console.log($scope.DraggedList); $scope.a = $scope.dragableId; + } }); } @@ -616,7 +634,7 @@ function ($scope, $rootScope, pages, log, $http, $timeout, DataService, $filter, //alert(JSON.stringify($scope.UserAttempt)); $timeout(function () { - if ($scope.Title == "Complete the statements below.") { + if ($("#textblock").css("display") == "block") { $("#imgdiv").css("position", "static"); $("#imgdiv").find("div").each(function () { var answerDiv = $(this).attr("id").split("-"); @@ -759,6 +777,8 @@ function ($scope, $rootScope, pages, log, $http, $timeout, DataService, $filter, $("#messageModal").modal('show'); } ) + + }; $scope.usersCorrectQuestData = []; @@ -1071,21 +1091,33 @@ function ($scope, $rootScope, pages, log, $http, $timeout, DataService, $filter, $('#' + blocks[j].id).css("display", "none"); break; } - + }; - + } } } - else { - var dragList = lastQuestionDetails[0].DragList; - angular.forEach(dragList, function (v, k) { - $('#' + v.blockID).css("display", "none"); - }) - } + } + if (lastQuestionDetails != undefined && lastQuestionDetails.length > 0 && !isFromDB) { + var dragList = lastQuestionDetails[0].DragList; + var blocks = $("div[id*='block-']"); + angular.forEach(dragList, function (v, k) { + + for (var j = 0; j < blocks.length; j++) { + + if ((blocks[j].innerHTML).toString() == v.Value) { + if ($('#' + blocks[j].id).css('display').toLowerCase() == 'block') { + $('#' + blocks[j].id).css("display", "none"); + break; + } + + }; + } + //$('#' + v.blockID).css("display", "none"); + }) } var labQuestionData = new jinqJs() .from($scope.LabExData.LabExercise[0].Questions) @@ -1104,13 +1136,14 @@ function ($scope, $rootScope, pages, log, $http, $timeout, DataService, $filter, .where('OptionTitle == ' + value.text) .select(); - + var blockId = 'block-' + OptionList[0].OptionNumber; if (OptionList != undefined && OptionList.length > 1 && blockIds.indexOf(blockId) != -1) { blockId = 'block-' + OptionList[1].OptionNumber; } blockIds.push(blockId); - $scope.DraggedList.push({ "blockID": blockId, "id": value.blockbox, "optionName": value.blockbox, "Value": value.text, "topcoord": questionOptionBox[0].topcoord, "leftcoord": questionOptionBox[0].leftcoord }); + console.log($scope.draggedIDArray); + $scope.DraggedList.push({ "DraggedAttr": blockId, "blockID": blockId, "id": value.blockbox, "optionName": value.blockbox, "Value": value.text, "topcoord": questionOptionBox[0].topcoord, "leftcoord": questionOptionBox[0].leftcoord }); // $scope.DraggedList.push({ "id": value.blockbox, "optionName": value.blockbox, "Value": value.text, "topcoord": questionOptionBox[0].topcoord, "leftcoord": questionOptionBox[0].leftcoord }); @@ -1120,7 +1153,7 @@ function ($scope, $rootScope, pages, log, $http, $timeout, DataService, $filter, $timeout(function () { - if ($scope.Title == "Complete the statements below.") { + if ($("#textblock").css("display") == "block") { $("#imgdiv").css("position", "static"); $("#imgdiv").find("div").each(function () { var answerDiv = $(this).attr("id").split("-"); diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js index 9b57bab..76d2775 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js @@ -96,19 +96,41 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou $scope.FilterByImage(1, $scope.query); setTimeout(function () { - if ($rootScope.getLocalStorageValue('AAGridViewHighlightThumbnail') !== null) { - $('#' + $rootScope.getLocalStorageValue("AAGridViewHighlightThumbnail")).find('.thumbnail').addClass('HightLightThumbnail'); - } - if ($rootScope.getLocalStorageValue('AAGridViewScroll') !== null && $location.url() == "/tile-view-list") { - $('html, body').animate({ scrollTop: $rootScope.getLocalStorageValue('AAGridViewScroll') }, 'slow'); + if ($('#grid-view').css("display") == "block") { + if ($rootScope.getLocalStorageValue('AAGridViewHighlightThumbnail') !== null) { + $('#' + $rootScope.getLocalStorageValue("AAGridViewHighlightThumbnail")).find('.thumbnail').addClass('HightLightThumbnail'); + } + if ($rootScope.getLocalStorageValue('AAGridViewScroll') !== null && $location.url() == "/tile-view-list") { + + $('html, body').animate({ scrollTop: $rootScope.getLocalStorageValue('AAGridViewScroll') }, 'slow'); + + } + } + if ($('#list-view').css("display") == "block") { - } - $rootScope.isLoading = false; - $('#spinner').css('visibility', 'hidden'); + var AAListViewScroll = $rootScope.getLocalStorageValue("AAListViewScroll"); + if (typeof (AAListViewScroll) !== "undefined" && AAListViewScroll !== null && AAListViewScroll !== '' && $location.url() == "/tile-view-list") { + if (typeof InstallTrigger !== 'undefined') { + + $('#ListViewDiv').animate({ scrollTop: $rootScope.getLocalStorageValue('AAListViewScroll') }, 'slow'); + } + else { + + $('#ListViewDiv').animate({ scrollTop: $rootScope.getLocalStorageValue('AAListViewScroll') }, 'slow'); + } + $("#list-view table tbody tr").removeClass("active"); + $("#list-view table tbody #" + $rootScope.getLocalStorageValue("listViewSelectedID")).addClass("active"); + } + + } + + $rootScope.isLoading = false; + $('#spinner').css('visibility', 'hidden'); }, 100); }, 100); + //console.log(JSON.stringify(result, null, 4)); }, function (error) { @@ -160,8 +182,10 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou $rootScope.listArray.push({ "imageName": $rootScope.OpenItemImagePath, "text": moduleItemDataToBeSaved }); //3. set opened module item ti localStorage.setItem("currentViewTitle", $rootScope.OpenedTileData[6]); - localStorage.setItem("AAGridViewScroll", $($window).scrollTop()); - localStorage.setItem("AAGridViewHighlightThumbnail", $(event.target).parent().parent().parent().attr('id')); + if ($('#grid-view').css("display") == "block") { + localStorage.setItem("AAGridViewScroll", $($window).scrollTop()); + localStorage.setItem("AAGridViewHighlightThumbnail", $(event.target).parent().parent().parent().attr('id')); + } //3. Navigate to the Module-item-view var u = $location.url(); diff --git a/400-SOURCECODE/AIAHTML5.Web/app/views/LabExerc/lab-exercises-detail.html b/400-SOURCECODE/AIAHTML5.Web/app/views/LabExerc/lab-exercises-detail.html index 709b3b2..47d7366 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/views/LabExerc/lab-exercises-detail.html +++ b/400-SOURCECODE/AIAHTML5.Web/app/views/LabExerc/lab-exercises-detail.html @@ -52,7 +52,7 @@
{{optionbox.Answervalue}}
-
{{ans.Value}}
+
{{ans.Value}}
diff --git a/400-SOURCECODE/AIAHTML5.Web/app/views/Link/Link-view.html b/400-SOURCECODE/AIAHTML5.Web/app/views/Link/Link-view.html index 6f49a84..22cf3ec 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/views/Link/Link-view.html +++ b/400-SOURCECODE/AIAHTML5.Web/app/views/Link/Link-view.html @@ -3,7 +3,7 @@
- + 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 5514e64..f5a2cdf 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/views/da/da-view.html +++ b/400-SOURCECODE/AIAHTML5.Web/app/views/da/da-view.html @@ -168,8 +168,8 @@
Highlight Options