Commit da33f8cf26e0b188ec03b0f51f985f3a245f4e8d

Authored by Sandeep Kumar
1 parent 78a7cb13

Fixed bugs of LabExcersies and AI Module

400-SOURCECODE/AIAHTML5.Web/app/controllers/AIController.js
... ... @@ -21,85 +21,11 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
21 21 localStorage.setItem("ImageCount", Count);
22 22 var searchByText = $rootScope.getLocalStorageValue("SearchText");
23 23 var searchTextByAlphabet = $rootScope.getLocalStorageValue("SearchByAlphabet");
24   - var SelectCurrTab = $rootScope.getLocalStorageValue("currentAITabView");
25   -
26   - //Commented by sandeep for fixed bugs related to ADAM Images
27   - //$timeout(function () {
28   - // $("#ListViewDiv").on('scroll', function () {
29   -
30   - // var searchByText = $rootScope.getLocalStorageValue("SearchText");
31   - // var searchTextByAlphabet = $rootScope.getLocalStorageValue("SearchByAlphabet");
32   - // var SelectCurrTab = $rootScope.getLocalStorageValue("currentAITabView");
33   - // if ($scope.query.SelectedDiv == 2) {
34   -
35   - // if ($(this).scrollTop() + $(this).innerHeight() >= $(this)[0].scrollHeight - 10) {
36   - // Count += 100;
37   - // //$(window).scrollTop(0);
38   - // var ImageCount = $rootScope.getLocalStorageValue("ImageCount");
39   - // if (typeof (searchByText) !== "undefined" && searchByText !== null && searchByText !== '') {
40   - // $scope.query.SearchText = searchByText;
41   - // }
42   - // else if (typeof (searchTextByAlphabet) !== "undefined" && searchTextByAlphabet !== null && searchTextByAlphabet !== '') {
43   - // $scope.query.SearchTextByAlphabet = searchTextByAlphabet;
44   - // }
45   - // else {
46   - // $scope.query.SearchTextByAlphabet = "";
47   - // }
48   -
49   - // if ($scope.query.SearchText == "" && $scope.query.SearchTextByAlphabet == "") {
50   -
51   - // $scope.LoadAIJsonData(Count);
52   - // $scope.loadAllAI(Count);
53   - // }
54   - // else if ($scope.query.SearchTextByAlphabet != "" || $scope.query.SearchText == "") {
55   - // $scope.ApplySearchByAlphabet($scope.query.SearchTextByAlphabet);
56   - // }
57   - // else {
58   - // $scope.ApplySearch($scope.query);
59   - // }
60   - // }
61   - // }
62   - // });
63   -
64   - //}, 10);
65   -
66   - //$(window).scroll(function () {
67   - // var searchByText = $rootScope.getLocalStorageValue("SearchText");
68   - // var searchTextByAlphabet = $rootScope.getLocalStorageValue("SearchByAlphabet");
69   - // var SelectCurrTab = $rootScope.getLocalStorageValue("currentAITabView");
70   - // if ($scope.query.SelectedDiv == 1) {
71   -
72   - // if ($(window).scrollTop() == $(document).height() - $(window).height()) {
73   - // Count += 100;
74   - // var ImageCount = $rootScope.getLocalStorageValue("ImageCount");
75   - // if (typeof (searchByText) !== "undefined" && searchByText !== null && searchByText !== '') {
76   - // $scope.query.SearchText = searchByText;
77   - // }
78   - // else if (typeof (searchTextByAlphabet) !== "undefined" && searchTextByAlphabet !== null && searchTextByAlphabet !== '') {
79   - // $scope.query.SearchTextByAlphabet = searchTextByAlphabet;
80   - // }
81   - // else {
82   - // $scope.query.SearchTextByAlphabet = "";
83   - // }
84   -
85   - // if ($scope.query.SearchText == "" && $scope.query.SearchTextByAlphabet == "") {
86   -
87   - // $scope.LoadAIJsonData(Count);
88   - // $scope.loadAllAI(Count);
89   - // }
90   - // else if ($scope.query.SearchTextByAlphabet != "" || $scope.query.SearchText == "") {
91   - // $scope.ApplySearchByAlphabet($scope.query.SearchTextByAlphabet);
92   - // }
93   - // else {
94   - // $scope.ApplySearch($scope.query);
95   - // }
96   - // }
97   - // }
98   - //});
  24 + var SelectCurrTab = $rootScope.getLocalStorageValue("currentAITabView");
99 25  
100   -
  26 + //Modified code by sandeep for fixed Bugs of ADAM Images
101 27 $scope.setActiveTab = function (tabToSet, inderectCall) {
102   - //Modified code by sandeep for fixed Bugs of ADAM Images
  28 +
103 29 $scope.activeTab = tabToSet;
104 30 localStorage.setItem("currentAITabView", "");
105 31 localStorage.setItem("currentAITabView", $scope.activeTab);
... ... @@ -139,14 +65,12 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
139 65 $scope.filterstring = false;
140 66 $scope.showItem(selectedImageId);
141 67 $scope.filterstring = true;
142   - }
143   - //$scope.ReloadListViewImageDiv(curSelectedRowId, ImageCount);
  68 + }
144 69 }
145 70 }
146   - else {
147   - //ReloadListViewImageDiv(curSelectedRowId, ImageCount);
148   - $scope.loadAllAI(ImageCount);
149   - if (inderectCall == true) {
  71 + else {
  72 + $scope.loadAllAI(ImageCount);
  73 + if (inderectCall == true) {
150 74 if (curSelectedRowId != "") {
151 75 $scope.filterstring = true;
152 76 $scope.showItem(curSelectedRowId);
... ... @@ -156,13 +80,11 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
156 80 if (selectedImageId != "") {
157 81 $scope.filterstring = false;
158 82 $scope.showItem(selectedImageId);
159   - }
160   - //$scope.ReloadListViewImageDiv(curSelectedRowId, ImageCount);
  83 + }
161 84 }
162 85 }
163 86 $scope.query.SelectedDiv = tabToSet;
164   - //Method call for set position for selected title Bug-57978
165   - //$scope.ReloadListViewImageDiv(curSelectedRowId, ImageCount);
  87 + //Method call for set position for selected title Bug-57978
166 88 $('#grid-view').css("display", "none");
167 89 $('#list-view').css("display", "block");
168 90 }
... ... @@ -190,58 +112,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
190 112 $scope.setImgPosition();
191 113 }, 100);
192 114  
193   - };
194   -
195   -
196   - //$scope.loadAIModuleById = function (moduleId) {
197   -
198   - // var ImageCount = $rootScope.getLocalStorageValue("ImageCount");
199   -
200   - // if ($rootScope.refreshcheck == null) {
201   - // $location.path('/');
202   - // }
203   -
204   - // // code that will be executed ...
205   - // // every time this view is loaded
206   -
207   - // //get current path
208   - // var currentURL = $location.path();
209   - // var selectedModuleName = '';
210   - // //set module title
211   - // angular.forEach($rootScope.userModules, function (value, key) {
212   - // if (value.slug === currentURL.replace('/', '')) {
213   - // selectedModuleName = value.name;
214   - // }
215   - // $rootScope.currentActiveModuleTitle = selectedModuleName;
216   - // })
217   -
218   - // $scope.LoadAIJsonData(ImageCount);
219   - // $scope.scroll();
220   - // //push the details of open module in array $rootScope.openModules
221   - // $rootScope.openModules.push({ "ModuleId": 13 });
222   -
223   - // //set the local storage
224   - // var curtab = $rootScope.getLocalStorageValue("currentAITabView");
225   - // var inderectCall = true;
226   - // if (curtab == 2) {
227   - // $scope.setActiveTab(2, inderectCall);
228   - // var curSelectedRowId = $rootScope.getLocalStorageValue("AISelectedRowId");
229   - // if (typeof (curSelectedRowId) !== "undefined" && curSelectedRowId !== null && curSelectedRowId !== '') {
230   - // $scope.reRunSearchOnLoad();
231   - // $scope.idSelected = curSelectedRowId;
232   - // $scope.ReloadListViewImageDiv($scope.idSelected, ImageCount);
233   - // }
234   - // else {
235   - // $scope.reRunSearchOnLoad()
236   - // $scope.idSelected = '';
237   - // }
238   - // }
239   - // else {
240   - // $scope.setActiveTab(1, inderectCall);
241   - // $scope.reRunSearchOnLoad();
242   -
243   - // }
244   - //}
  115 + };
245 116  
246 117 $scope.loadAIModuleById = function (moduleId) {
247 118  
... ... @@ -353,12 +224,11 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
353 224 $scope.selectedAIListViewData = new jinqJs()
354 225 .from($scope.IllustrationData.root.AIData)
355 226 .orderBy([{ field: '_Title', sort: 'asc' }])
356   - .select().slice(0, ImageCount);
  227 + //.select().slice(0, ImageCount);
  228 + .select(); //Fixed Bug-58419 by Sandeep
357 229  
358 230 //console.log($scope.selectedAIListViewData);
359 231  
360   -
361   -
362 232 $('#grid-view').empty();
363 233 var $e1 = $('<ul><li ng-repeat="value in selectedAIListViewData" class="col-sm-3 col-md-2"><div id="{{value._id}}" title = "{{value._Title}}" class="GridViewDataDivHeight" data-ng-click="OpenAdamImage($event)">'
364 234 + '<div class="thumbnail" >'
... ... @@ -382,7 +252,6 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
382 252 }, 10);
383 253 }
384 254  
385   -
386 255 },
387 256 function (error) {
388 257 // handle errors here
... ... @@ -612,6 +481,9 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
612 481 if (AIListViewScroll !== null && $location.url() == "/ADAM-images" && AIListViewScroll != "0") {
613 482 $('#ListViewDiv').animate({ scrollTop: $rootScope.getLocalStorageValue('AIListViewScrollPosition') }, 'slow');
614 483 }
  484 + //if (_currentImgId != "null" && _currentImgId != null) {
  485 + // $('html, body').animate({ scrollTop: _currentImgId }, 'slow');
  486 + //}
615 487 else if (aISelectedRowId != "null" && aISelectedRowId != null) {
616 488 $('html, body').animate({ scrollTop: $('#' + aISelectedRowId).position().top }, 100);
617 489 }
... ... @@ -827,30 +699,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
827 699 size: { width: $(window).outerWidth() - 30, height: $(window).outerHeight() - 125 },
828 700  
829 701 });
830   -
831   - //$('#canvasDiv img').load(function () {
832   -
833   - // $rootScope.isLoading = false;
834   - // $('#aiSpinner').css('visibility', 'hidden');
835   - // var canvas = document.getElementById("canvas");
836   - // var canvasPaint = document.getElementById("canvasPaint");
837   -
838   - // var imageheight = $("#aimage").height();
839   - // var canvasDivheight = $(window).outerHeight() - 150;
840   -
841   - // if (canvasDivheight > imageheight) {
842   - // canvas.height = canvasDivheight;
843   - // canvasPaint.height = canvasDivheight;
844   - // }
845   - // else {
846   - // canvas.height = imageheight;
847   - // canvasPaint.height = imageheight;
848   - // }
849   -
850   - // canvas.width = $(window).outerWidth() - 81;
851   - // canvasPaint.width = $(window).outerWidth() - 81;
852   -
853   - //});
  702 +
854 703 $('#canvasDiv img').load(function () {
855 704 $rootScope.isLoading = false;
856 705 $('#aiSpinner').css('visibility', 'hidden');
... ... @@ -932,7 +781,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
932 781  
933 782 //Set the scroll position of the tablebody to show selected row
934 783  
935   - $scope.setImgPosition();
  784 + //$scope.setImgPosition();
936 785  
937 786 $rootScope.isLoading = false;
938 787 $('#aiSpinner').css('visibility', 'hidden');
... ...
400-SOURCECODE/AIAHTML5.Web/app/controllers/LabExercController.js
... ... @@ -129,6 +129,17 @@ function ($scope, $rootScope, pages, log, $http, $timeout, DataService, $filter,
129 129 $scope.LabExerciseName = keywords.labexercise;
130 130 $scope.LabExerciseModules = null;
131 131 $scope.LabExerciseBoxes = null;
  132 +
  133 + if ($scope.quiznumber == 1) {
  134 + $("#btnBackward").css('pointer-events', 'none');
  135 + }
  136 + else if ($scope.quiznumber == $scope.TotalNumberofQuiz) {
  137 + $("#btnForward").css('pointer-events', 'none');
  138 + }
  139 + else {
  140 + $("#btnBackward").css('pointer-events', 'auto');
  141 + $("#btnForward").css('pointer-events', 'auto');
  142 + }
132 143  
133 144 //alert($scope.LabExerciseName)
134 145 var labExerciseModulePath = '~/../content/data/json/le/' + $scope.LabExerciseName + '.json';
... ... @@ -1384,12 +1395,12 @@ function ($scope, $rootScope, pages, log, $http, $timeout, DataService, $filter,
1384 1395  
1385 1396 // email validation code
1386 1397  
1387   - var senderEmails = $("#emailTo").val().split(", ");
  1398 + var senderEmails = $("#emailTo").val().split(",");
1388 1399 $scope.isSenderEmailValid = false;
1389 1400 for (var i = 0; i <= senderEmails.length - 1; i++) {
1390 1401  
1391   - var sEmail = senderEmails[i];
1392   - if ($.trim(sEmail).length == 0) {
  1402 + var sEmail = $.trim(senderEmails[i]);
  1403 + if (sEmail.length == 0) {
1393 1404 //alert('*Email To email address is empty');
1394 1405 $scope.isSenderEmailValid = false;
1395 1406 // event.preventDefault();
... ...
400-SOURCECODE/AIAHTML5.Web/app/views/LabExerc/lab-exercises-detail.html
... ... @@ -230,7 +230,9 @@
230 230  
231 231 <div class="col-sm-12" style=" margin-top: 20px; min-height:100px;" id="divoptions" droppable="true">
232 232 <!--<div class="col-sm-3 col-lg-3 ui-draggable" >-->
233   - <div draggable="true" ng-repeat="option in LabExerciseModules.Options" ng-style="{'width': '150px', 'height':'40px','font-size':'8px;','valign':'middle','text-align':'center', 'vertical-align:middle','background-color': '#808080','margin':'5px !important','float':'{{option.textalign}}'} " style="margin-bottom: 5px !important; width: 180px;" class="thumbnail caption col-sm-2 col-lg-3 ui-draggable marginR5 " id="block-{{option.OptionNumber}}">{{option.OptionTitle}}</div>
  233 + <!--<div draggable="true" ng-repeat="option in LabExerciseModules.Options" ng-style="{'width': '150px', 'height':'40px','font-size':'8px;','valign':'middle','text-align':'center', 'vertical-align:middle','background-color': '#808080','margin':'5px !important','float':'{{option.textalign}}'} " style="margin-bottom: 5px !important; width: 180px;" class="thumbnail caption col-sm-2 col-lg-3 ui-draggable marginR5 " id="block-{{option.OptionNumber}}">{{option.OptionTitle}}</div>-->
  234 + <div draggable="true" ng-repeat="option in LabExerciseModules.Options" style="margin-bottom: 5px !important; width: 180px; float: left" class="thumbnail caption col-sm-2 col-lg-3 ui-draggable marginR5 " id="block-{{option.OptionNumber}}">{{option.OptionTitle}}</div>
  235 +
234 236 </div>
235 237 </div>
236 238 </div>
... ... @@ -252,8 +254,8 @@
252 254 <button class="btn btn-sm btn-primary" id="resetBtn" ng-click="OnResetClick()">Reset</button>
253 255 </div>
254 256 <div class="btn-group">
255   - <button class="btn btn-sm btn-black" ng-click="prevQuiz()"><i class="fa fa-arrow-left"></i></button>
256   - <button class="btn btn-sm btn-black" ng-click="nextQuiz()"><i class="fa fa-arrow-right"></i></button>
  257 + <button id="btnBackward" class="btn btn-sm btn-black" ng-click="prevQuiz()"><i class="fa fa-arrow-left"></i></button>
  258 + <button id="btnForward" class="btn btn-sm btn-black" ng-click="nextQuiz()"><i class="fa fa-arrow-right"></i></button>
257 259 </div>
258 260 </div>
259 261 <div class="clearfix"></div>
... ...
400-SOURCECODE/AIAHTML5.Web/app/views/ai/ai-view.html
... ... @@ -71,7 +71,7 @@
71 71 </tr>
72 72 </tbody>
73 73 <tbody id="ListViewDiv" ng-if="filterstring" class="clstbody">
74   - <tr ng-click="showItem(item._id)" ng-class="{selected: item._id === idSelected}" ng-dblclick="OpenAdamImage($event)" ng-repeat="item in searchAIListViewData">
  74 + <tr id="{{item._id}}" ng-click="showItem(item._id)" ng-class="{selected: item._id === idSelected}" ng-dblclick="OpenAdamImage($event)" ng-repeat="item in searchAIListViewData">
75 75 <td width="20%">
76 76 {{item._Title}}
77 77 </td>
... ... @@ -84,7 +84,7 @@
84 84 <div class="row well">
85 85 <div title="{{SelectedAITitle}}" class="col-sm-3 col-lg-2 no-padding">
86 86 <div class="thumbnail no-margin">
87   - <img id="{{SelectedAIId}}" src="{{SelectedAIthumbImage}}" alt="" title="{{SelectedAITitle}}" data-ng-click="OpenAdamImage($event)">
  87 + <img id="{{SelectedAIId}}" src="{{SelectedAIthumbImage}}" alt="" title="{{SelectedAITitle}}" data-ng-click="OpenAdamImage($event)">
88 88 </div>
89 89 </div>
90 90 <div class="col-sm-9 col-lg-9" style="padding-left:10px;">
... ...