Commit 44e22bfa95435ec1e17f43b3f9d0233b2bb5e3c9
Commit Changes
Showing
3 changed files
with
98 additions
and
96 deletions
400-SOURCECODE/AIAHTML5.Web/Web.config
... | ... | @@ -21,7 +21,7 @@ |
21 | 21 | |
22 | 22 | </location> |
23 | 23 | <system.webServer> |
24 | - <!--<rewrite> | |
24 | + <rewrite> | |
25 | 25 | <rules> |
26 | 26 | <rule name="AngularJS Routes" stopProcessing="true"> |
27 | 27 | <match url=".*" /> |
... | ... | @@ -33,7 +33,7 @@ |
33 | 33 | <action type="Rewrite" url="/" /> |
34 | 34 | </rule> |
35 | 35 | </rules> |
36 | - </rewrite>--> | |
36 | + </rewrite> | |
37 | 37 | <staticContent> |
38 | 38 | |
39 | 39 | <remove fileExtension=".mp3" /> | ... | ... |
400-SOURCECODE/AIAHTML5.Web/app/controllers/LabExercController.js
... | ... | @@ -65,14 +65,12 @@ function ($scope, $rootScope, pages, log, $http, $timeout, DataService, $filter, |
65 | 65 | |
66 | 66 | //to get all lab exercise modules from json files |
67 | 67 | $scope.getLabExerciseModules = function () { |
68 | - //debugger; | |
68 | + | |
69 | 69 | $scope.LabExerciseModules1 = null; |
70 | 70 | var labExerciseModulePath = '~/../content/data/json/le/labexercise.json'; |
71 | 71 | |
72 | 72 | DataService.getAnotherJson(labExerciseModulePath).then( |
73 | 73 | function (result) { |
74 | - //debugger; | |
75 | - //alert(JSON.stringify(result)); | |
76 | 74 | $scope.LabExerciseModules1 = result; |
77 | 75 | }, |
78 | 76 | function (error) { |
... | ... | @@ -537,38 +535,13 @@ function ($scope, $rootScope, pages, log, $http, $timeout, DataService, $filter, |
537 | 535 | if ($scope.DraggedList != null) { |
538 | 536 | $.each($scope.DraggedList, function (inx1, value3) { |
539 | 537 | $scope.UserAttempt.push({ "BlankBoxName": id.split('-')[1], "OptionName": $scope.dragableId.split('-')[1] }); |
540 | - debugger; | |
541 | - | |
542 | 538 | if ($scope.DraggedList[inx1].DraggedAttr == $scope.draggableAttribute) { |
543 | 539 | // $scope.b = $scope.DraggedList[inx1].blockID; |
544 | 540 | $scope.DraggedList.splice(inx1, 1); |
545 | 541 | $('#' + $scope.draggableAttribute).css({ "display": "block", "color": "#000000!important" }); |
546 | 542 | $('#blockans-' + $scope.a.split('-')[1]).css("background-color", "transparent !important"); |
547 | - // alert('removed from dropbox= '+'blockans-' + $scope.b.split('-')[1]); | |
548 | - | |
549 | 543 | } |
550 | 544 | |
551 | - | |
552 | - | |
553 | - | |
554 | - //if ($scope.DraggedList[inx1].id == $scope.a.split('-')[1]) { | |
555 | - // $scope.b = $scope.DraggedList[inx1].blockID; | |
556 | - // $scope.DraggedList.splice(inx1, 1); | |
557 | - // $('#' + $scope.b).css({ "display": "block", "color": "#000000!important" }); | |
558 | - // $('#blockans-' + $scope.a.split('-')[1]).css("background-color", "transparent !important"); | |
559 | - | |
560 | - //} | |
561 | - | |
562 | - //else | |
563 | - //{ | |
564 | - // if ($scope.DraggedList[inx1].DraggedAttr == $scope.draggableAttribute) { | |
565 | - // $scope.b = $scope.DraggedList[inx1].blockID; | |
566 | - // $scope.DraggedList.splice(inx1, 1); | |
567 | - // $('#' + $scope.draggableAttribute).css({ "display": "block", "color": "#000000!important" }); | |
568 | - // $('#blockans-' + $scope.b.split('-')[1]).css("background-color", "transparent !important"); | |
569 | - // // alert('removed from dropbox= '+'blockans-' + $scope.b.split('-')[1]); | |
570 | - // } | |
571 | - //} | |
572 | 545 | }); |
573 | 546 | } |
574 | 547 | } |
... | ... | @@ -601,23 +574,11 @@ function ($scope, $rootScope, pages, log, $http, $timeout, DataService, $filter, |
601 | 574 | $.each(Options, function (inx, value2) { |
602 | 575 | if (Options[inx].BoxName == id.split('-')[1]) { |
603 | 576 | if ($scope.DraggedList != null) { |
604 | - //$.each($scope.DraggedList, function (inx1, value3) { | |
605 | - // if ($scope.DraggedList[inx1].Value == dataText) { | |
606 | - // $scope.DraggedList.splice(inx1, 1); | |
607 | - // } | |
608 | - //}); | |
609 | 577 | for (var i = 0; i <= $scope.DraggedList.length - 1; i++) { |
610 | - | |
611 | 578 | if ($scope.DraggedList[i].Value == undefined) { |
612 | 579 | i = 0; |
613 | 580 | continue; |
614 | 581 | } |
615 | - | |
616 | - debugger; | |
617 | - | |
618 | - //if ($scope.DraggedList[i].Value == dataText) { | |
619 | - // if ($scope.DraggedList[i].id == id.split('-')[1]) | |
620 | - | |
621 | 582 | if ($scope.DraggedList[i].DraggedAttr == $scope.draggableAttribute) |
622 | 583 | { |
623 | 584 | $scope.DraggedList.splice(i, 1); |
... | ... | @@ -1118,28 +1079,45 @@ function ($scope, $rootScope, pages, log, $http, $timeout, DataService, $filter, |
1118 | 1079 | for (var i = 0; i < lastQuestionAnswers.length; i++) { |
1119 | 1080 | var num = i + 1; |
1120 | 1081 | $scope.QustionAnsKeyValue.push({ blockbox: 'T' + num, text: lastQuestionAnswers[i] }); |
1082 | + | |
1121 | 1083 | if (isFromDB) { |
1122 | - | |
1084 | + | |
1123 | 1085 | if (lastQuestionAnswers[i] != "") { |
1124 | 1086 | var blocks = $("div[id*='block-']"); |
1125 | 1087 | for (var j = 0; j < blocks.length; j++) { |
1088 | + | |
1126 | 1089 | if ((blocks[j].innerHTML).toString() == lastQuestionAnswers[i]) { |
1127 | - debugger; | |
1128 | - alert((blocks[j].innerHTML).toString()); | |
1129 | - $('#' + blocks[j].id).css("display", "none"); | |
1130 | - break; | |
1090 | + if ($('#' + blocks[j].id).css('display').toLowerCase() == 'block') { | |
1091 | + $('#' + blocks[j].id).css("display", "none"); | |
1092 | + break; | |
1093 | + } | |
1094 | + | |
1131 | 1095 | }; |
1096 | + | |
1132 | 1097 | } |
1098 | + | |
1133 | 1099 | } |
1134 | 1100 | } |
1135 | 1101 | |
1136 | - else { | |
1137 | - var dragList = lastQuestionDetails[0].DragList; | |
1138 | - angular.forEach(dragList, function (v, k) { | |
1139 | - $('#' + v.blockID).css("display", "none"); | |
1140 | - }) | |
1141 | - } | |
1102 | + } | |
1103 | + if (lastQuestionDetails != undefined && lastQuestionDetails.length > 0 && !isFromDB) { | |
1104 | + var dragList = lastQuestionDetails[0].DragList; | |
1105 | + var blocks = $("div[id*='block-']"); | |
1106 | + angular.forEach(dragList, function (v, k) { | |
1107 | + | |
1108 | + for (var j = 0; j < blocks.length; j++) { | |
1142 | 1109 | |
1110 | + if ((blocks[j].innerHTML).toString() == v.Value) { | |
1111 | + if ($('#' + blocks[j].id).css('display').toLowerCase() == 'block') { | |
1112 | + $('#' + blocks[j].id).css("display", "none"); | |
1113 | + break; | |
1114 | + } | |
1115 | + | |
1116 | + }; | |
1117 | + | |
1118 | + } | |
1119 | + //$('#' + v.blockID).css("display", "none"); | |
1120 | + }) | |
1143 | 1121 | } |
1144 | 1122 | var labQuestionData = new jinqJs() |
1145 | 1123 | .from($scope.LabExData.LabExercise[0].Questions) |
... | ... | @@ -1158,7 +1136,7 @@ function ($scope, $rootScope, pages, log, $http, $timeout, DataService, $filter, |
1158 | 1136 | .where('OptionTitle == ' + value.text) |
1159 | 1137 | .select(); |
1160 | 1138 | |
1161 | - debugger; | |
1139 | + | |
1162 | 1140 | var blockId = 'block-' + OptionList[0].OptionNumber; |
1163 | 1141 | if (OptionList != undefined && OptionList.length > 1 && blockIds.indexOf(blockId) != -1) { |
1164 | 1142 | blockId = 'block-' + OptionList[1].OptionNumber; | ... | ... |
400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js
... | ... | @@ -96,19 +96,41 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou |
96 | 96 | |
97 | 97 | $scope.FilterByImage(1, $scope.query); |
98 | 98 | setTimeout(function () { |
99 | - if ($rootScope.getLocalStorageValue('AAGridViewHighlightThumbnail') !== null) { | |
100 | - $('#' + $rootScope.getLocalStorageValue("AAGridViewHighlightThumbnail")).find('.thumbnail').addClass('HightLightThumbnail'); | |
101 | - } | |
102 | - if ($rootScope.getLocalStorageValue('AAGridViewScroll') !== null && $location.url() == "/tile-view-list") { | |
103 | - $('html, body').animate({ scrollTop: $rootScope.getLocalStorageValue('AAGridViewScroll') }, 'slow'); | |
99 | + if ($('#grid-view').css("display") == "block") { | |
100 | + if ($rootScope.getLocalStorageValue('AAGridViewHighlightThumbnail') !== null) { | |
101 | + $('#' + $rootScope.getLocalStorageValue("AAGridViewHighlightThumbnail")).find('.thumbnail').addClass('HightLightThumbnail'); | |
102 | + } | |
103 | + if ($rootScope.getLocalStorageValue('AAGridViewScroll') !== null && $location.url() == "/tile-view-list") { | |
104 | + | |
105 | + $('html, body').animate({ scrollTop: $rootScope.getLocalStorageValue('AAGridViewScroll') }, 'slow'); | |
106 | + | |
107 | + } | |
108 | + } | |
109 | + if ($('#list-view').css("display") == "block") { | |
104 | 110 | |
105 | - } | |
106 | - $rootScope.isLoading = false; | |
107 | - $('#spinner').css('visibility', 'hidden'); | |
111 | + var AAListViewScroll = $rootScope.getLocalStorageValue("AAListViewScroll"); | |
112 | + if (typeof (AAListViewScroll) !== "undefined" && AAListViewScroll !== null && AAListViewScroll !== '' && $location.url() == "/tile-view-list") { | |
113 | + if (typeof InstallTrigger !== 'undefined') { | |
114 | + | |
115 | + $('#ListViewDiv').animate({ scrollTop: $rootScope.getLocalStorageValue('AAListViewScroll') }, 'slow'); | |
116 | + } | |
117 | + else { | |
118 | + | |
119 | + $('#ListViewDiv').animate({ scrollTop: $rootScope.getLocalStorageValue('AAListViewScroll') }, 'slow'); | |
120 | + } | |
121 | + $("#list-view table tbody tr").removeClass("active"); | |
122 | + $("#list-view table tbody #" + $rootScope.getLocalStorageValue("listViewSelectedID")).addClass("active"); | |
123 | + } | |
124 | + | |
125 | + } | |
126 | + | |
127 | + $rootScope.isLoading = false; | |
128 | + $('#spinner').css('visibility', 'hidden'); | |
108 | 129 | }, 100); |
109 | 130 | |
110 | 131 | |
111 | 132 | }, 100); |
133 | + | |
112 | 134 | //console.log(JSON.stringify(result, null, 4)); |
113 | 135 | }, |
114 | 136 | function (error) { |
... | ... | @@ -160,8 +182,10 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou |
160 | 182 | $rootScope.listArray.push({ "imageName": $rootScope.OpenItemImagePath, "text": moduleItemDataToBeSaved }); |
161 | 183 | //3. set opened module item ti |
162 | 184 | localStorage.setItem("currentViewTitle", $rootScope.OpenedTileData[6]); |
163 | - localStorage.setItem("AAGridViewScroll", $($window).scrollTop()); | |
164 | - localStorage.setItem("AAGridViewHighlightThumbnail", $(event.target).parent().parent().parent().attr('id')); | |
185 | + if ($('#grid-view').css("display") == "block") { | |
186 | + localStorage.setItem("AAGridViewScroll", $($window).scrollTop()); | |
187 | + localStorage.setItem("AAGridViewHighlightThumbnail", $(event.target).parent().parent().parent().attr('id')); | |
188 | + } | |
165 | 189 | |
166 | 190 | //3. Navigate to the Module-item-view |
167 | 191 | var u = $location.url(); |
... | ... | @@ -1519,7 +1543,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou |
1519 | 1543 | if ($rootScope.bodySystemTermArray[j].language == $rootScope.lexiconLanguageArray[0].id) { |
1520 | 1544 | $rootScope.duplicateListArray.push({ "title": $rootScope.bodySystemTermArray[j].text, "id": $rootScope.bodySystemTermArray[j].termNumbr }); |
1521 | 1545 | |
1522 | - $rootScope.sortedListArray.push({ "title": $rootScope.bodySystemTermArray[j].text, "id": $rootScope.bodySystemTermArray[j].termNumbr }); | |
1546 | + | |
1523 | 1547 | |
1524 | 1548 | // console.log($rootScope.bodySystemTermArray); |
1525 | 1549 | } |
... | ... | @@ -1527,38 +1551,38 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou |
1527 | 1551 | } |
1528 | 1552 | } |
1529 | 1553 | } |
1530 | - //var temp = []; | |
1531 | - //console.log($rootScope.duplicateListArray); | |
1532 | - //for (var i = 0; i <= $rootScope.duplicateListArray.length - 1; i++) { | |
1533 | - // var termID = $rootScope.duplicateListArray[i].id; | |
1534 | - // if ($.inArray(termID, temp) == -1) { | |
1535 | - // temp.push(termID); | |
1536 | - // console.log('1'+$rootScope.duplicateListArray[i].title + " " + $rootScope.duplicateListArray[i].id); | |
1537 | - // $rootScope.sortedListArray.push({ "title": $rootScope.duplicateListArray[i].title, "id": termID }); | |
1538 | - // console.log('3' + $rootScope.sortedListArray[i].title + " " + $rootScope.sortedListArray[i].id) | |
1539 | - // } | |
1540 | - //} | |
1541 | - //console.log('2'+$rootScope.sortedListArray); | |
1542 | - //for (var i = 0; i <= $rootScope.sortedListArray.length - 1; i++) { | |
1543 | - | |
1544 | - // for (j = i + 1; j <= $rootScope.sortedListArray.length - 1; j++) { | |
1554 | + var temp = []; | |
1555 | + console.log($rootScope.duplicateListArray); | |
1556 | + for (var i = 0; i <= $rootScope.duplicateListArray.length - 1; i++) { | |
1557 | + var termID = $rootScope.duplicateListArray[i].id; | |
1558 | + if ($.inArray(termID, temp) == -1) { | |
1559 | + temp.push(termID); | |
1560 | + console.log('1'+$rootScope.duplicateListArray[i].title + " " + $rootScope.duplicateListArray[i].id); | |
1561 | + $rootScope.sortedListArray.push({ "title": $rootScope.duplicateListArray[i].title, "id": termID }); | |
1562 | + console.log('3' + $rootScope.sortedListArray[i].title + " " + $rootScope.sortedListArray[i].id) | |
1563 | + } | |
1564 | + } | |
1565 | + console.log('2'+$rootScope.sortedListArray); | |
1566 | + for (var i = 0; i <= $rootScope.sortedListArray.length - 1; i++) { | |
1567 | + | |
1568 | + for (j = i + 1; j <= $rootScope.sortedListArray.length - 1; j++) { | |
1545 | 1569 | |
1546 | - // if ($rootScope.sortedListArray[i].title.substr(0, 1) > $rootScope.sortedListArray[j].title.substr(0, 1)) { | |
1547 | - | |
1548 | - // var termText = $rootScope.sortedListArray[i].title; | |
1549 | - // var termNumbr = $rootScope.sortedListArray[i].termNumbr; | |
1550 | - // var termLanguage = $rootScope.sortedListArray[i].language; | |
1551 | - | |
1552 | - // $rootScope.sortedListArray[i].title = $rootScope.sortedListArray[j].title; | |
1553 | - // $rootScope.sortedListArray[i].termNumbr = $rootScope.sortedListArray[j].termNumbr; | |
1554 | - // $rootScope.sortedListArray[i].language = $rootScope.sortedListArray[j].language; | |
1555 | - | |
1556 | - // $rootScope.sortedListArray[j].title = termText; | |
1557 | - // $rootScope.sortedListArray[j].termNumbr = termNumbr; | |
1558 | - // $rootScope.sortedListArray[j].language = termLanguage; | |
1559 | - // } | |
1560 | - // } | |
1561 | - //} | |
1570 | + if ($rootScope.sortedListArray[i].title.substr(0, 1) > $rootScope.sortedListArray[j].title.substr(0, 1)) { | |
1571 | + | |
1572 | + var termText = $rootScope.sortedListArray[i].title; | |
1573 | + var termNumbr = $rootScope.sortedListArray[i].id; | |
1574 | + var termLanguage = $rootScope.sortedListArray[i].language; | |
1575 | + | |
1576 | + $rootScope.sortedListArray[i].title = $rootScope.sortedListArray[j].title; | |
1577 | + $rootScope.sortedListArray[i].id = $rootScope.sortedListArray[j].id; | |
1578 | + $rootScope.sortedListArray[i].language = $rootScope.sortedListArray[j].language; | |
1579 | + | |
1580 | + $rootScope.sortedListArray[j].title = termText; | |
1581 | + $rootScope.sortedListArray[j].id = termNumbr; | |
1582 | + $rootScope.sortedListArray[j].language = termLanguage; | |
1583 | + } | |
1584 | + } | |
1585 | + } | |
1562 | 1586 | |
1563 | 1587 | for (var j = 0; j <= $rootScope.sortedListArray.length - 1; j++) { |
1564 | 1588 | var $selectedOptions = $('<option title= "' + $rootScope.sortedListArray[j].title + '" id= "' + $rootScope.sortedListArray[j].id + '" >' + $rootScope.sortedListArray[j].title + '</option>').appendTo("#termList"); | ... | ... |