Commit 546e7b6324f462468ce3ca1ebf5d2ec04e5e0832
1 parent
3f39e1dc
commit after merging develop branch DAController code.
Showing
1 changed file
with
107 additions
and
45 deletions
400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
... | ... | @@ -97,7 +97,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
97 | 97 | |
98 | 98 | |
99 | 99 | $scope.IsSearchVisible = false; |
100 | - | |
100 | + $scope.shapesize = 1; | |
101 | 101 | $scope.dragdivposition = { |
102 | 102 | "left": $scope.dragdivleft, |
103 | 103 | "top": $scope.dragdivtop |
... | ... | @@ -224,9 +224,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
224 | 224 | userEthnicity = $rootScope.globalSetting.ethnicity; |
225 | 225 | } |
226 | 226 | |
227 | - var curentmodesty = localStorage.getItem("globalmodesty"); | |
227 | + var curentmodesty = localStorage.getItem("globalModesty"); | |
228 | 228 | if (typeof (curentmodesty) !== "undefined" && curentmodesty !== null) { |
229 | - userModestysettings = curentmodesty | |
229 | + userModestysettings = curentmodesty; | |
230 | 230 | } |
231 | 231 | else { |
232 | 232 | userModestysettings = $rootScope.globalSetting.modesty; |
... | ... | @@ -355,7 +355,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
355 | 355 | $rootScope.globalSetting.ethnicity = curentEthnicity; |
356 | 356 | } |
357 | 357 | |
358 | - var curentmodesty = localStorage.getItem("globalmodesty"); | |
358 | + var curentmodesty = localStorage.getItem("globalModesty"); | |
359 | 359 | if (typeof (curentmodesty) !== "undefined" && curentmodesty !== null) { |
360 | 360 | $rootScope.globalSetting.modesty = curentmodesty |
361 | 361 | } |
... | ... | @@ -1434,11 +1434,11 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
1434 | 1434 | $rootScope.isLoading = true; |
1435 | 1435 | $('#spinner').css('visibility', 'visible'); |
1436 | 1436 | //$timeout(function () { |
1437 | - // console.log('inside start of flipped. $scope.ColoredImageSRC.length= ' + $scope.ColoredImageSRC.length) | |
1437 | + console.log('inside start of flipped. $scope.ColoredImageSRC.length= ' + $scope.ColoredImageSRC.length) | |
1438 | 1438 | $rootScope.isHighLight = true; |
1439 | - //console.log('just before highLightBody call'); | |
1439 | + console.log('just before highLightBody call'); | |
1440 | 1440 | $scope.highLightBody(); |
1441 | - //console.log('just after highLightBody call'); | |
1441 | + console.log('just after highLightBody call'); | |
1442 | 1442 | //}, 500); |
1443 | 1443 | } |
1444 | 1444 | } |
... | ... | @@ -1679,7 +1679,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
1679 | 1679 | |
1680 | 1680 | $scope.MultiLanguageAnnationArray.push(annotationText); |
1681 | 1681 | |
1682 | - // console.log('2. annotationText: ' + annotationText + ' , length: ' + $scope.MultiLanguageAnnationArray.length); | |
1682 | + console.log('2. annotationText: ' + annotationText + ' , length: ' + $scope.MultiLanguageAnnationArray.length); | |
1683 | 1683 | |
1684 | 1684 | $scope.createDynamicSpeechBubble(evt, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top, true); |
1685 | 1685 | |
... | ... | @@ -1691,7 +1691,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
1691 | 1691 | $scope.MultiLanguageAnnationArray = []; |
1692 | 1692 | $scope.MultiLanguageAnnationArray.push(annotationText); |
1693 | 1693 | |
1694 | - //console.log('3. annotationText: ' + annotationText + ' , length: ' + $scope.MultiLanguageAnnationArray.length); | |
1694 | + console.log('3. annotationText: ' + annotationText + ' , length: ' + $scope.MultiLanguageAnnationArray.length); | |
1695 | 1695 | $scope.createDynamicSpeechBubble(evt, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top, true); |
1696 | 1696 | } |
1697 | 1697 | |
... | ... | @@ -1805,11 +1805,11 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
1805 | 1805 | $rootScope.isLoading = true; |
1806 | 1806 | $('#spinner').css('visibility', 'visible'); |
1807 | 1807 | //$timeout(function () { |
1808 | - // console.log('inside start of non flipped. $scope.ColoredImageSRC.length= ' + $scope.ColoredImageSRC.length) | |
1808 | + console.log('inside start of non flipped. $scope.ColoredImageSRC.length= ' + $scope.ColoredImageSRC.length) | |
1809 | 1809 | $rootScope.isHighLight = true; |
1810 | - //console.log('just before highLightBody call'); | |
1810 | + console.log('just before highLightBody call'); | |
1811 | 1811 | $scope.highLightBody(); |
1812 | - //console.log('just after highLightBody call'); | |
1812 | + console.log('just after highLightBody call'); | |
1813 | 1813 | //}, 500); |
1814 | 1814 | } |
1815 | 1815 | } |
... | ... | @@ -1957,7 +1957,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
1957 | 1957 | //push workers in array to further used the refernece to delete the workers |
1958 | 1958 | $scope.runningWorkers.push({ 'workerName': worker }) |
1959 | 1959 | |
1960 | - //console.log('for BRID = ' + bodyRegionId + ', coloredImageDataVar: ' + coloredImageDataVar + ', maskData= ' + maskData + ', white= ' + white) | |
1960 | + console.log('for BRID = ' + bodyRegionId + ', coloredImageDataVar: ' + coloredImageDataVar + ', maskData= ' + maskData + ', white= ' + white) | |
1961 | 1961 | |
1962 | 1962 | if (coloredImageDataVar != null && maskData != null && white != null) { |
1963 | 1963 | worker.postMessage({ |
... | ... | @@ -2004,7 +2004,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
2004 | 2004 | var canavsWidth = parseInt(grayCanvas.width); |
2005 | 2005 | var canavsHeight = parseInt(grayCanvas.height); |
2006 | 2006 | |
2007 | - //console.log('canavsWidth= ' + canavsWidth + ', canavsHeight= ' + canavsHeight) | |
2007 | + console.log('canavsWidth= ' + canavsWidth + ', canavsHeight= ' + canavsHeight) | |
2008 | 2008 | |
2009 | 2009 | var imgData = grayCanvasContext.getImageData(0, 0, canavsWidth, canavsHeight); |
2010 | 2010 | var data = imgData.data; |
... | ... | @@ -5376,13 +5376,19 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
5376 | 5376 | //1. |
5377 | 5377 | localStorage.setItem("genderId", 'Male'); |
5378 | 5378 | |
5379 | - //2. | |
5380 | - $scope.loadSelectedBodyView(currentBodyViewId); | |
5379 | + //2 first update the currentbodyviewid in local storage | |
5380 | + localStorage.setItem("currentBodyViewId", currentBodyViewId); | |
5381 | 5381 | |
5382 | 5382 | //3. |
5383 | + $scope.loadSelectedBodyView(currentBodyViewId); | |
5384 | + | |
5385 | + //4. | |
5383 | 5386 | $scope.loadSelectedBodyViewNavigator(currentBodyViewId); |
5384 | 5387 | |
5388 | + //5. change the search terms as per the selected bodyview | |
5389 | + $scope.loadSearchDataForBodyView(); | |
5385 | 5390 | |
5391 | + //6. | |
5386 | 5392 | $('#daImagePanel')[0].childNodes[0].childNodes[0].innerHTML = localStorage.getItem("currentViewTitle").replace('Female', 'Male'); |
5387 | 5393 | |
5388 | 5394 | localStorage.setItem("currentViewTitle", localStorage.getItem("currentViewTitle").replace('Female', 'Male')); |
... | ... | @@ -5394,15 +5400,22 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
5394 | 5400 | |
5395 | 5401 | else if ((event.currentTarget.attributes[1].value == 'Female') && (localStorage.getItem("genderId") == 'Male')) { |
5396 | 5402 | |
5403 | + //1. | |
5397 | 5404 | localStorage.setItem("genderId", 'Female'); |
5398 | 5405 | |
5399 | - //1. | |
5406 | + //2. first update the currentbodyviewid in local storage | |
5407 | + localStorage.setItem("currentBodyViewId", currentBodyViewId); | |
5408 | + | |
5409 | + //3. | |
5400 | 5410 | $scope.loadSelectedBodyView(currentBodyViewId); |
5401 | 5411 | |
5402 | - //2. | |
5412 | + //4. | |
5403 | 5413 | $scope.loadSelectedBodyViewNavigator(currentBodyViewId); |
5404 | 5414 | |
5405 | - //3. | |
5415 | + //5. change the search terms as per the selected bodyview | |
5416 | + $scope.loadSearchDataForBodyView(); | |
5417 | + | |
5418 | + //6. | |
5406 | 5419 | $('#daImagePanel')[0].childNodes[0].childNodes[0].innerHTML = localStorage.getItem("currentViewTitle").replace('Male', 'Female'); |
5407 | 5420 | |
5408 | 5421 | localStorage.setItem("currentViewTitle", localStorage.getItem("currentViewTitle").replace('Male', 'Female')); |
... | ... | @@ -5538,13 +5551,19 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
5538 | 5551 | $rootScope.voId = selectedViewId; |
5539 | 5552 | $rootScope.isLoading = true; |
5540 | 5553 | |
5541 | - //1. Load selected body view | |
5554 | + //1. first update the currentbodyviewid in local storage | |
5555 | + localStorage.setItem("currentBodyViewId", $rootScope.voId); | |
5556 | + | |
5557 | + //2. Load selected body view | |
5542 | 5558 | $scope.loadSelectedBodyView($rootScope.voId); |
5543 | 5559 | |
5544 | - //2. load corresponding navigator man | |
5560 | + //3. load corresponding navigator man | |
5545 | 5561 | $scope.loadSelectedBodyViewNavigator($rootScope.voId); |
5546 | 5562 | |
5547 | - //3.Change the popup title next to search | |
5563 | + //4. change the search terms as per the selected bodyview | |
5564 | + $scope.loadSearchDataForBodyView(); | |
5565 | + | |
5566 | + //5.Change the popup title next to search | |
5548 | 5567 | $scope.currentTitleFromJson = localStorage.getItem("currentViewTitle"); |
5549 | 5568 | |
5550 | 5569 | }; |
... | ... | @@ -5662,35 +5681,35 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
5662 | 5681 | //console.log('reloadDABodyViewEvent'); |
5663 | 5682 | |
5664 | 5683 | $scope.layerNumber = parseInt($('#txtlayerNumber').val()); |
5665 | - $scope.ReloadBodyViewId = data.reloadDABodyViewId; | |
5684 | + //$scope.ReloadBodyViewId = data.reloadDABodyViewId; | |
5666 | 5685 | // $scope.layerNumber = 0; |
5667 | 5686 | // debugger; |
5668 | 5687 | |
5669 | - // console.log('reloadDABodyViewEvent ' + $scope.ReloadBodyViewId); | |
5688 | + //console.log('reloadDABodyViewEvent ' + $scope.ReloadBodyViewId); | |
5670 | 5689 | |
5671 | - if ($rootScope.isSettingEventAlredayDispachted == true) { | |
5690 | + //if ($rootScope.isSettingEventAlredayDispachted == true) { | |
5672 | 5691 | |
5673 | - $scope.loadSelectedBodyView($scope.ReloadBodyViewId); | |
5692 | + $scope.loadSelectedBodyView(data.reloadDABodyViewId); | |
5674 | 5693 | |
5675 | - $scope.loadSelectedBodyViewNavigator($scope.ReloadBodyViewId); | |
5694 | + $scope.loadSelectedBodyViewNavigator(data.reloadDABodyViewId); | |
5676 | 5695 | |
5677 | - $scope.currentTitleFromJson = localStorage.getItem("currentViewTitle"); | |
5696 | + $scope.currentTitleFromJson = localStorage.getItem("currentViewTitle"); | |
5678 | 5697 | |
5679 | - $rootScope.isSettingEventAlredayDispachted = false; | |
5680 | - } | |
5698 | + //$rootScope.isSettingEventAlredayDispachted = false; | |
5699 | + //} | |
5681 | 5700 | |
5682 | 5701 | }) |
5683 | 5702 | |
5684 | 5703 | $scope.loadSelectedBodyViewNavigator = function (currentBodyViewId) { |
5685 | 5704 | |
5686 | - $rootScope.voId = currentBodyViewId; | |
5705 | + //$rootScope.voId = currentBodyViewId; | |
5687 | 5706 | |
5688 | - $scope.skinTone = $rootScope.globalSetting.ethnicity; | |
5707 | + //$scope.skinTone = $rootScope.globalSetting.ethnicity; | |
5689 | 5708 | |
5690 | 5709 | if ($scope.NavigatorData != null || $scope.NavigatorData != undefined) { |
5691 | 5710 | var navdtlOrient = new jinqJs() |
5692 | 5711 | .from($scope.NavigatorData.Navigtor.ViewOrientation) |
5693 | - .where("_ViewOrientationId == " + $scope.voId) | |
5712 | + .where("_ViewOrientationId == " + currentBodyViewId) | |
5694 | 5713 | .select(); |
5695 | 5714 | |
5696 | 5715 | |
... | ... | @@ -5698,7 +5717,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
5698 | 5717 | |
5699 | 5718 | var navOrientationdata = new jinqJs() |
5700 | 5719 | .from(navdtlOrient[0].ImageInfo) |
5701 | - .where("_Ethnicity == " + $scope.skinTone) | |
5720 | + .where("_Ethnicity == " + $rootScope.globalSetting.ethnicity) | |
5702 | 5721 | .select(); |
5703 | 5722 | |
5704 | 5723 | if (navOrientationdata != null || navOrientationdata != undefined) { |
... | ... | @@ -5719,7 +5738,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
5719 | 5738 | |
5720 | 5739 | } |
5721 | 5740 | |
5722 | - $scope.navimgsrc = "~/../content/images/DA/ethnicity/body-views/" + $scope.voId + '/' + $scope.skinTone + '/navigator_images/' + navImageModesty; | |
5741 | + $scope.navimgsrc = "~/../content/images/DA/ethnicity/body-views/" + $scope.voId + '/' + $rootScope.globalSetting.ethnicity + '/navigator_images/' + navImageModesty; | |
5723 | 5742 | } |
5724 | 5743 | } |
5725 | 5744 | |
... | ... | @@ -5819,7 +5838,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
5819 | 5838 | var canvasElement = document.getElementById("canvas"); |
5820 | 5839 | var ctx = canvasElement.getContext("2d"); |
5821 | 5840 | |
5822 | - | |
5841 | + var canvasElement1 = document.getElementById("canvasPaint"); | |
5842 | + var ctx1 = canvasElement1.getContext("2d"); | |
5823 | 5843 | |
5824 | 5844 | /* if ($rootScope.shapeType == "FreeStylePaint") { |
5825 | 5845 | var canvasPaint_zIndex = $('#canvasPaint').css("z-index"); |
... | ... | @@ -5840,6 +5860,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
5840 | 5860 | case "cursor": |
5841 | 5861 | // ctx.clearRect(0, 0, 2277, 3248); |
5842 | 5862 | ctx.beginPath(); |
5863 | + ctx1.beginPath(); | |
5843 | 5864 | |
5844 | 5865 | |
5845 | 5866 | break; |
... | ... | @@ -5983,7 +6004,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
5983 | 6004 | break; |
5984 | 6005 | |
5985 | 6006 | case "Circle": |
5986 | - // alert($rootScope.shapestyleFillColor); | |
6007 | + // alert($rootScope.shapestyleborderWidth); | |
5987 | 6008 | $rootScope.resetCircle = $rootScope.ObjectIndex++; |
5988 | 6009 | $('#canvas').addLayer({ |
5989 | 6010 | layer: true, |
... | ... | @@ -6351,7 +6372,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
6351 | 6372 | $rootScope.textArea = $("#text_area").val(); |
6352 | 6373 | $("#canvas").removeLayer('TextArea_' + $rootScope.resetText).drawLayers(); |
6353 | 6374 | $("#canvas").removeLayer("TextRect_" + $rootScope.resetTextRect).drawLayers(); |
6354 | - // alert($rootScope.fontColor); | |
6375 | + | |
6355 | 6376 | $('#canvas').drawText({ |
6356 | 6377 | layer: true, |
6357 | 6378 | draggable: true, |
... | ... | @@ -6369,6 +6390,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
6369 | 6390 | maxWidth: $scope.x - $scope.offsetX1, |
6370 | 6391 | maxHeight: $scope.y - $scope.offsetY1, |
6371 | 6392 | |
6393 | + | |
6372 | 6394 | click: function (layer) { |
6373 | 6395 | |
6374 | 6396 | |
... | ... | @@ -6479,7 +6501,28 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
6479 | 6501 | |
6480 | 6502 | } |
6481 | 6503 | $scope.OnPaintBrushCanvasMouseDown = function (event) { |
6504 | + switch ($rootScope.shapeType) { | |
6505 | + | |
6506 | + case "FreeStylePaint": | |
6482 | 6507 | |
6508 | + debugger; | |
6509 | + $('#canvasPaint').sketch({ defaultSize: 1 }); | |
6510 | + //if ($("#amount-2").val() == '') { | |
6511 | + // $('#canvasPaint').sketch({ defaultSize: $scope.shapesize }); | |
6512 | + //} | |
6513 | + //else { | |
6514 | + | |
6515 | + // var a = $("#amount-2").val(); | |
6516 | + // $scope.shapesize = parseInt(a); | |
6517 | + // // alert(JSON.stringify({ defaultSize: $scope.shapesize })); | |
6518 | + // $('#canvasPaint').sketch({ defaultSize: $scope.shapesize }); | |
6519 | + | |
6520 | + //} | |
6521 | + | |
6522 | + | |
6523 | + break; | |
6524 | + | |
6525 | + } | |
6483 | 6526 | } |
6484 | 6527 | $scope.OnPaintBrushCanvasMouseUp = function (event) { |
6485 | 6528 | |
... | ... | @@ -6487,18 +6530,36 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
6487 | 6530 | // var canvasElement1 = document.getElementById("canvasPaint"); |
6488 | 6531 | // var ctx1 = canvasElement1.getContext("2d"); |
6489 | 6532 | |
6490 | - switch ($rootScope.shapeType) { | |
6491 | - case "FreeStylePaint": | |
6533 | + //switch($rootScope.shapeType) | |
6534 | + //{ | |
6492 | 6535 | |
6493 | - $('#canvasPaint').sketch({ defaultSize: 1 }); | |
6536 | + // case "FreeStylePaint": | |
6494 | 6537 | |
6495 | - break; | |
6538 | + // debugger; | |
6496 | 6539 | |
6540 | + // if ($("#amount-2").val() == '') | |
6541 | + // { | |
6542 | + // $('#canvasPaint').sketch({ defaultSize: $scope.shapesize }); | |
6543 | + // } | |
6544 | + // else | |
6545 | + // { | |
6497 | 6546 | |
6498 | - } | |
6547 | + // var a = $("#amount-2").val(); | |
6548 | + // $scope.shapesize = parseInt(a); | |
6549 | + // alert(JSON.stringify({ defaultSize: $scope.shapesize })); | |
6550 | + // $('#canvasPaint').sketch({ defaultSize: $scope.shapesize }); | |
6551 | + | |
6552 | + // } | |
6553 | + | |
6554 | + | |
6555 | + // break; | |
6556 | + | |
6557 | + //} | |
6499 | 6558 | |
6500 | 6559 | } |
6501 | 6560 | |
6561 | + | |
6562 | + | |
6502 | 6563 | $(document).keydown(function (event) { |
6503 | 6564 | |
6504 | 6565 | |
... | ... | @@ -6854,6 +6915,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
6854 | 6915 | |
6855 | 6916 | $('#bodySystems').empty(); |
6856 | 6917 | |
6918 | + | |
6857 | 6919 | var $all = $('<option ng-click=refreshTermListOnSystemSelection($event) id="0" selected="">All</option>').appendTo('#bodySystems'); |
6858 | 6920 | $compile($all)($scope); |
6859 | 6921 | |
... | ... | @@ -6879,6 +6941,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
6879 | 6941 | //confirm that this is DA module which is last open |
6880 | 6942 | if (currentOpenModuleId == 1) { |
6881 | 6943 | |
6944 | + | |
6882 | 6945 | $('#termList').empty(); |
6883 | 6946 | $scope.loadListManger(); |
6884 | 6947 | |
... | ... | @@ -7072,11 +7135,10 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
7072 | 7135 | $scope.flushCanvas(); |
7073 | 7136 | |
7074 | 7137 | |
7138 | + | |
7075 | 7139 | //9. |
7076 | 7140 | $timeout(function () { |
7077 | 7141 | $rootScope.isHighLight = false; |
7078 | - | |
7079 | - //removing speechbubble | |
7080 | 7142 | $('#sppeachBubble').css('display', 'none'); |
7081 | 7143 | $("#dot").css("display", "none"); |
7082 | 7144 | ... | ... |