Commit 3f39e1dcd786d73eebc8721e67445ece5e38aedb

Authored by Nikita Kulshreshtha
1 parent 04a17755

copied DAController code from git from BrowserCrashIssue

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   - $scope.shapesize = 1;
  100 +
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,19 +5376,13 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
5376 5376 //1.
5377 5377 localStorage.setItem("genderId", 'Male');
5378 5378  
5379   - //2 first update the currentbodyviewid in local storage
5380   - localStorage.setItem("currentBodyViewId", currentBodyViewId);
5381   -
5382   - //3.
  5379 + //2.
5383 5380 $scope.loadSelectedBodyView(currentBodyViewId);
5384 5381  
5385   - //4.
  5382 + //3.
5386 5383 $scope.loadSelectedBodyViewNavigator(currentBodyViewId);
5387 5384  
5388   - //5. change the search terms as per the selected bodyview
5389   - $scope.loadSearchDataForBodyView();
5390 5385  
5391   - //6.
5392 5386 $('#daImagePanel')[0].childNodes[0].childNodes[0].innerHTML = localStorage.getItem("currentViewTitle").replace('Female', 'Male');
5393 5387  
5394 5388 localStorage.setItem("currentViewTitle", localStorage.getItem("currentViewTitle").replace('Female', 'Male'));
... ... @@ -5400,22 +5394,15 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
5400 5394  
5401 5395 else if ((event.currentTarget.attributes[1].value == 'Female') && (localStorage.getItem("genderId") == 'Male')) {
5402 5396  
5403   - //1.
5404 5397 localStorage.setItem("genderId", 'Female');
5405 5398  
5406   - //2. first update the currentbodyviewid in local storage
5407   - localStorage.setItem("currentBodyViewId", currentBodyViewId);
5408   -
5409   - //3.
  5399 + //1.
5410 5400 $scope.loadSelectedBodyView(currentBodyViewId);
5411 5401  
5412   - //4.
  5402 + //2.
5413 5403 $scope.loadSelectedBodyViewNavigator(currentBodyViewId);
5414 5404  
5415   - //5. change the search terms as per the selected bodyview
5416   - $scope.loadSearchDataForBodyView();
5417   -
5418   - //6.
  5405 + //3.
5419 5406 $('#daImagePanel')[0].childNodes[0].childNodes[0].innerHTML = localStorage.getItem("currentViewTitle").replace('Male', 'Female');
5420 5407  
5421 5408 localStorage.setItem("currentViewTitle", localStorage.getItem("currentViewTitle").replace('Male', 'Female'));
... ... @@ -5551,19 +5538,13 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
5551 5538 $rootScope.voId = selectedViewId;
5552 5539 $rootScope.isLoading = true;
5553 5540  
5554   - //1. first update the currentbodyviewid in local storage
5555   - localStorage.setItem("currentBodyViewId", $rootScope.voId);
5556   -
5557   - //2. Load selected body view
  5541 + //1. Load selected body view
5558 5542 $scope.loadSelectedBodyView($rootScope.voId);
5559 5543  
5560   - //3. load corresponding navigator man
  5544 + //2. load corresponding navigator man
5561 5545 $scope.loadSelectedBodyViewNavigator($rootScope.voId);
5562 5546  
5563   - //4. change the search terms as per the selected bodyview
5564   - $scope.loadSearchDataForBodyView();
5565   -
5566   - //5.Change the popup title next to search
  5547 + //3.Change the popup title next to search
5567 5548 $scope.currentTitleFromJson = localStorage.getItem("currentViewTitle");
5568 5549  
5569 5550 };
... ... @@ -5681,35 +5662,35 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
5681 5662 //console.log('reloadDABodyViewEvent');
5682 5663  
5683 5664 $scope.layerNumber = parseInt($('#txtlayerNumber').val());
5684   - //$scope.ReloadBodyViewId = data.reloadDABodyViewId;
  5665 + $scope.ReloadBodyViewId = data.reloadDABodyViewId;
5685 5666 // $scope.layerNumber = 0;
5686 5667 // debugger;
5687 5668  
5688   - //console.log('reloadDABodyViewEvent ' + $scope.ReloadBodyViewId);
  5669 + // console.log('reloadDABodyViewEvent ' + $scope.ReloadBodyViewId);
5689 5670  
5690   - //if ($rootScope.isSettingEventAlredayDispachted == true) {
  5671 + if ($rootScope.isSettingEventAlredayDispachted == true) {
5691 5672  
5692   - $scope.loadSelectedBodyView(data.reloadDABodyViewId);
  5673 + $scope.loadSelectedBodyView($scope.ReloadBodyViewId);
5693 5674  
5694   - $scope.loadSelectedBodyViewNavigator(data.reloadDABodyViewId);
  5675 + $scope.loadSelectedBodyViewNavigator($scope.ReloadBodyViewId);
5695 5676  
5696 5677 $scope.currentTitleFromJson = localStorage.getItem("currentViewTitle");
5697 5678  
5698   - //$rootScope.isSettingEventAlredayDispachted = false;
5699   - //}
  5679 + $rootScope.isSettingEventAlredayDispachted = false;
  5680 + }
5700 5681  
5701 5682 })
5702 5683  
5703 5684 $scope.loadSelectedBodyViewNavigator = function (currentBodyViewId) {
5704 5685  
5705   - //$rootScope.voId = currentBodyViewId;
  5686 + $rootScope.voId = currentBodyViewId;
5706 5687  
5707   - //$scope.skinTone = $rootScope.globalSetting.ethnicity;
  5688 + $scope.skinTone = $rootScope.globalSetting.ethnicity;
5708 5689  
5709 5690 if ($scope.NavigatorData != null || $scope.NavigatorData != undefined) {
5710 5691 var navdtlOrient = new jinqJs()
5711 5692 .from($scope.NavigatorData.Navigtor.ViewOrientation)
5712   - .where("_ViewOrientationId == " + currentBodyViewId)
  5693 + .where("_ViewOrientationId == " + $scope.voId)
5713 5694 .select();
5714 5695  
5715 5696  
... ... @@ -5717,7 +5698,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
5717 5698  
5718 5699 var navOrientationdata = new jinqJs()
5719 5700 .from(navdtlOrient[0].ImageInfo)
5720   - .where("_Ethnicity == " + $rootScope.globalSetting.ethnicity)
  5701 + .where("_Ethnicity == " + $scope.skinTone)
5721 5702 .select();
5722 5703  
5723 5704 if (navOrientationdata != null || navOrientationdata != undefined) {
... ... @@ -5738,7 +5719,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
5738 5719  
5739 5720 }
5740 5721  
5741   - $scope.navimgsrc = "~/../content/images/DA/ethnicity/body-views/" + $scope.voId + '/' + $rootScope.globalSetting.ethnicity + '/navigator_images/' + navImageModesty;
  5722 + $scope.navimgsrc = "~/../content/images/DA/ethnicity/body-views/" + $scope.voId + '/' + $scope.skinTone + '/navigator_images/' + navImageModesty;
5742 5723 }
5743 5724 }
5744 5725  
... ... @@ -5838,8 +5819,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
5838 5819 var canvasElement = document.getElementById("canvas");
5839 5820 var ctx = canvasElement.getContext("2d");
5840 5821  
5841   - var canvasElement1 = document.getElementById("canvasPaint");
5842   - var ctx1 = canvasElement1.getContext("2d");
  5822 +
5843 5823  
5844 5824 /* if ($rootScope.shapeType == "FreeStylePaint") {
5845 5825 var canvasPaint_zIndex = $('#canvasPaint').css("z-index");
... ... @@ -5860,7 +5840,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
5860 5840 case "cursor":
5861 5841 // ctx.clearRect(0, 0, 2277, 3248);
5862 5842 ctx.beginPath();
5863   - ctx1.beginPath();
5864 5843  
5865 5844  
5866 5845 break;
... ... @@ -6004,7 +5983,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
6004 5983 break;
6005 5984  
6006 5985 case "Circle":
6007   - // alert($rootScope.shapestyleborderWidth);
  5986 + // alert($rootScope.shapestyleFillColor);
6008 5987 $rootScope.resetCircle = $rootScope.ObjectIndex++;
6009 5988 $('#canvas').addLayer({
6010 5989 layer: true,
... ... @@ -6372,7 +6351,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
6372 6351 $rootScope.textArea = $("#text_area").val();
6373 6352 $("#canvas").removeLayer('TextArea_' + $rootScope.resetText).drawLayers();
6374 6353 $("#canvas").removeLayer("TextRect_" + $rootScope.resetTextRect).drawLayers();
6375   -
  6354 + // alert($rootScope.fontColor);
6376 6355 $('#canvas').drawText({
6377 6356 layer: true,
6378 6357 draggable: true,
... ... @@ -6390,7 +6369,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
6390 6369 maxWidth: $scope.x - $scope.offsetX1,
6391 6370 maxHeight: $scope.y - $scope.offsetY1,
6392 6371  
6393   -
6394 6372 click: function (layer) {
6395 6373  
6396 6374  
... ... @@ -6501,28 +6479,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
6501 6479  
6502 6480 }
6503 6481 $scope.OnPaintBrushCanvasMouseDown = function (event) {
6504   - switch ($rootScope.shapeType) {
6505   -
6506   - case "FreeStylePaint":
6507 6482  
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   - }
6526 6483 }
6527 6484 $scope.OnPaintBrushCanvasMouseUp = function (event) {
6528 6485  
... ... @@ -6530,36 +6487,18 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
6530 6487 // var canvasElement1 = document.getElementById("canvasPaint");
6531 6488 // var ctx1 = canvasElement1.getContext("2d");
6532 6489  
6533   - //switch($rootScope.shapeType)
6534   - //{
6535   -
6536   - // case "FreeStylePaint":
6537   -
6538   - // debugger;
6539   -
6540   - // if ($("#amount-2").val() == '')
6541   - // {
6542   - // $('#canvasPaint').sketch({ defaultSize: $scope.shapesize });
6543   - // }
6544   - // else
6545   - // {
6546   -
6547   - // var a = $("#amount-2").val();
6548   - // $scope.shapesize = parseInt(a);
6549   - // alert(JSON.stringify({ defaultSize: $scope.shapesize }));
6550   - // $('#canvasPaint').sketch({ defaultSize: $scope.shapesize });
  6490 + switch ($rootScope.shapeType) {
  6491 + case "FreeStylePaint":
6551 6492  
6552   - // }
  6493 + $('#canvasPaint').sketch({ defaultSize: 1 });
6553 6494  
  6495 + break;
6554 6496  
6555   - // break;
6556 6497  
6557   - //}
  6498 + }
6558 6499  
6559 6500 }
6560 6501  
6561   -
6562   -
6563 6502 $(document).keydown(function (event) {
6564 6503  
6565 6504  
... ... @@ -6914,7 +6853,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
6914 6853 var systemList = $rootScope.CommonData.DACommonData.BodySystems.Item;
6915 6854  
6916 6855 $('#bodySystems').empty();
6917   -
6918 6856  
6919 6857 var $all = $('<option ng-click=refreshTermListOnSystemSelection($event) id="0" selected="">All</option>').appendTo('#bodySystems');
6920 6858 $compile($all)($scope);
... ... @@ -6941,7 +6879,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
6941 6879 //confirm that this is DA module which is last open
6942 6880 if (currentOpenModuleId == 1) {
6943 6881  
6944   -
6945 6882 $('#termList').empty();
6946 6883 $scope.loadListManger();
6947 6884  
... ... @@ -7135,10 +7072,11 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
7135 7072 $scope.flushCanvas();
7136 7073  
7137 7074  
7138   -
7139 7075 //9.
7140 7076 $timeout(function () {
7141 7077 $rootScope.isHighLight = false;
  7078 +
  7079 + //removing speechbubble
7142 7080 $('#sppeachBubble').css('display', 'none');
7143 7081 $("#dot").css("display", "none");
7144 7082  
... ...