Commit 42145e34975ef44095a0eb4e3931c83b81b4c1d7
1 parent
d5e33f9c
Mearge to AA Module
Showing
1 changed file
with
136 additions
and
106 deletions
400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js
... | ... | @@ -1039,6 +1039,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou |
1039 | 1039 | "ly": $scope.aaOpenInOtherModules.selectedCallouts[i].ly, |
1040 | 1040 | "hx": $scope.aaOpenInOtherModules.selectedCallouts[i].hx, |
1041 | 1041 | "lx": $scope.aaOpenInOtherModules.selectedCallouts[i].lx, |
1042 | + "pinId": undefined | |
1042 | 1043 | }); |
1043 | 1044 | |
1044 | 1045 | } |
... | ... | @@ -1102,39 +1103,87 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou |
1102 | 1103 | |
1103 | 1104 | var clickedPins=$scope.GetAAwindowStoreData(windowviewid,'clickedPins'); |
1104 | 1105 | var aaPinData = $scope.GetAAwindowStoreData(windowviewid,'aaPinData'); |
1105 | - var CBselectedpinCordinate = $scope.GetAAwindowStoreData(windowviewid,'CBselectedpinCordinate'); | |
1106 | + var CBselectedpinCordinate = $scope.GetAAwindowStoreData(windowviewid, 'CBselectedpinCordinate'); | |
1106 | 1107 | |
1107 | - angular.forEach(clickedPins, function (value, key) { | |
1108 | + if (CBselectedpinCordinate.length >0) | |
1109 | + { | |
1110 | + var pinId = CBselectedpinCordinate[0].pinId; | |
1108 | 1111 | |
1109 | - if (aaPinData != null && aaPinData.length > 0) { | |
1110 | - | |
1111 | - var pinData = new jinqJs() | |
1112 | - .from(aaPinData) | |
1113 | - .where("_PinId == " + value.id) | |
1114 | - .select(); | |
1115 | - | |
1112 | + if (pinId == undefined) | |
1113 | + { | |
1114 | + angular.forEach(clickedPins, function (value, key) { | |
1116 | 1115 | |
1117 | - var headX = (parseInt(pinData[0]._HeadX)); | |
1118 | - var headY = (parseInt(pinData[0]._HeadY)); | |
1119 | - var pinId = (parseInt(pinData[0]._PinId)); | |
1116 | + if (aaPinData != null && aaPinData.length > 0) { | |
1120 | 1117 | |
1121 | - // match pin data by hx and hy CB cordinate to show annotation | |
1122 | - var matchdata=new jinqJs() | |
1123 | - .from(CBselectedpinCordinate) | |
1124 | - .where("hx == " + headX,"hy == " + headY) | |
1125 | - .select(); | |
1126 | - | |
1127 | - if(matchdata.length>0) | |
1128 | - { | |
1129 | - $scope.MultiLanguageAnnationArray = []; | |
1130 | - | |
1131 | - $scope.GetAnnotationBasedOnActualTermNo(pinData[0]._TermId,windowviewid); | |
1132 | - | |
1133 | - $scope.createSpeechBubble(parseInt(headX) + 10, parseInt(headY) + 10,matchdata[0].lx,matchdata[0].ly, pinId, false, false, false,windowviewid); | |
1134 | - } | |
1118 | + var pinData = new jinqJs() | |
1119 | + .from(aaPinData) | |
1120 | + .where("_PinId == " + value.id) | |
1121 | + .select(); | |
1122 | + | |
1123 | + | |
1124 | + var headX = (parseInt(pinData[0]._HeadX)); | |
1125 | + var headY = (parseInt(pinData[0]._HeadY)); | |
1126 | + var pinId = (parseInt(pinData[0]._PinId)); | |
1127 | + | |
1128 | + // match pin data by hx and hy CB cordinate to show annotation | |
1129 | + var matchdata = new jinqJs() | |
1130 | + .from(CBselectedpinCordinate) | |
1131 | + .where("hx == " + headX, "hy == " + headY) | |
1132 | + .select(); | |
1133 | + | |
1134 | + if (matchdata.length > 0) { | |
1135 | + | |
1136 | + var updatedata = new jinqJs() | |
1137 | + .from(CBselectedpinCordinate) | |
1138 | + .update(function (coll, index) { coll[index].pinId = pinId; }) | |
1139 | + .at("hx == " + headX, "hy == " + headY); | |
1140 | + | |
1141 | + $scope.MultiLanguageAnnationArray = []; | |
1142 | + | |
1143 | + $scope.GetAnnotationBasedOnActualTermNo(pinData[0]._TermId, windowviewid); | |
1144 | + | |
1145 | + $scope.createSpeechBubble(parseInt(headX) + 10, parseInt(headY) + 10, matchdata[0].lx, matchdata[0].ly, pinId, false, false, false, windowviewid); | |
1146 | + } | |
1147 | + } | |
1148 | + | |
1149 | + }); | |
1135 | 1150 | } |
1151 | + else { | |
1152 | + | |
1153 | + angular.forEach(clickedPins, function (value, key) { | |
1154 | + | |
1155 | + if (aaPinData != null && aaPinData.length > 0) { | |
1156 | + | |
1157 | + var pinData = new jinqJs() | |
1158 | + .from(aaPinData) | |
1159 | + .where("_PinId == " + value.id) | |
1160 | + .select(); | |
1161 | + | |
1162 | + | |
1163 | + var headX = (parseInt(pinData[0]._HeadX)); | |
1164 | + var headY = (parseInt(pinData[0]._HeadY)); | |
1165 | + var pinId = (parseInt(pinData[0]._PinId)); | |
1166 | + | |
1167 | + // match pin data by hx and hy CB cordinate to show annotation | |
1168 | + var matchdata = new jinqJs() | |
1169 | + .from(CBselectedpinCordinate) | |
1170 | + .where("pinId == " + pinId) | |
1171 | + .select(); | |
1136 | 1172 | |
1137 | - }); | |
1173 | + if (matchdata.length > 0) { | |
1174 | + $scope.MultiLanguageAnnationArray = []; | |
1175 | + | |
1176 | + $scope.GetAnnotationBasedOnActualTermNo(pinData[0]._TermId, windowviewid); | |
1177 | + | |
1178 | + $scope.createSpeechBubble(parseInt(headX) + 10, parseInt(headY) + 10, matchdata[0].lx, matchdata[0].ly, pinId, false, false, false, windowviewid); | |
1179 | + } | |
1180 | + } | |
1181 | + | |
1182 | + }); | |
1183 | + } | |
1184 | + | |
1185 | + } | |
1186 | + | |
1138 | 1187 | |
1139 | 1188 | $scope.SetAAwindowStoreData(windowviewid,'isShowBodyWithCBPinData',false); |
1140 | 1189 | $rootScope.AAWindowLoadComplete=true; |
... | ... | @@ -1792,15 +1841,20 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou |
1792 | 1841 | } |
1793 | 1842 | |
1794 | 1843 | //Save Cordinate for show annotation as per Pin |
1795 | - var CBselectedpinCordinate = $scope.GetAAwindowStoreData(windowviewid, 'CBselectedpinCordinate'); | |
1796 | - CBselectedpinCordinate.push( | |
1797 | - { | |
1798 | - "hy": headY, | |
1799 | - "ly": headY, | |
1800 | - "hx": headX, | |
1801 | - "lx": headX, | |
1802 | - "pinId": value._PinId | |
1803 | - }); | |
1844 | + | |
1845 | + if ($rootScope.isCallFromOtherModule) { | |
1846 | + | |
1847 | + var CBselectedpinCordinate = $scope.GetAAwindowStoreData(windowviewid, 'CBselectedpinCordinate'); | |
1848 | + CBselectedpinCordinate.push( | |
1849 | + { | |
1850 | + "hy": headY, | |
1851 | + "ly": headY+10, | |
1852 | + "hx": headX, | |
1853 | + "lx": headX+30, | |
1854 | + "pinId": value._PinId | |
1855 | + }); | |
1856 | + } | |
1857 | + | |
1804 | 1858 | }) |
1805 | 1859 | |
1806 | 1860 | } |
... | ... | @@ -1976,7 +2030,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou |
1976 | 2030 | var isShowBodyWithCBPinData=$scope.GetAAwindowStoreData(windowviewid,'isShowBodyWithCBPinData'); |
1977 | 2031 | |
1978 | 2032 | var speechBubbleHTML = '<div id="speechBubbleLine' + PinId +'_'+windowviewid+ '" style="position:absolute;height:15px;width:35px;display:none;z-index:13000;border-top:2px solid #000;transform:rotate(40deg);-moz-transform:rotate(40deg);-o-transform:rotate(40deg);-ms-transform:rotate(40deg);-webkit-transform:rotate(40deg);"></div>' |
1979 | - + '<div id="speechBubble' + PinId +'_'+windowviewid+ '" class="common-drag" style="height:auto!important;z-index:13000;margin-left:25px;border:1px solid #000;padding:5px 10px;position:absolute;color:#fff;text-align:left;font-size:12px;background-color:#19100e;border-radius:5px;-moz-border-radius:5px;-webkit-border-radius:5px;-o-border-radius:5px;-ms-border-radius:5px;font-weight:bold;">' | |
2033 | + + '<div id="speechBubble' + PinId +'_'+windowviewid+ '" class="common-drag" style="height:auto!important;z-index:13000;margin-left:0px;border:1px solid #000;padding:5px 10px;position:absolute;color:#fff;text-align:left;font-size:12px;background-color:#19100e;border-radius:5px;-moz-border-radius:5px;-webkit-border-radius:5px;-o-border-radius:5px;-ms-border-radius:5px;font-weight:bold;">' | |
1980 | 2034 | + '<span style="position:absolute;right:-3px;top:-4px;color:#ffffff;cursor:pointer;">' |
1981 | 2035 | + '<img id="closeBtn' + PinId +'_'+windowviewid+ '" class="crossDiv_temp" style="width:18px" src=' + $rootScope.closeBtnImgPath + '></span></div>' |
1982 | 2036 | |
... | ... | @@ -2009,51 +2063,6 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou |
2009 | 2063 | if ($scope.longestAnnotation != null || $scope.longestAnnotation != undefined) { |
2010 | 2064 | $("#"+speechbubbleDivId).css("min-width", "auto"); |
2011 | 2065 | $("#"+speechbubbleDivId).css("white-space", "nowrap"); |
2012 | - // if ($scope.longestAnnotation.length <= 10) { | |
2013 | - | |
2014 | - | |
2015 | - // $("#"+speechbubbleDivId).css("width", "100px"); | |
2016 | - | |
2017 | - // } | |
2018 | - | |
2019 | - // else if ($scope.longestAnnotation.length > 10 && $scope.longestAnnotation.length <= 17) { | |
2020 | - | |
2021 | - | |
2022 | - | |
2023 | - // $("#"+speechbubbleDivId).css("width", "140px"); | |
2024 | - | |
2025 | - // } | |
2026 | - // else if ($scope.longestAnnotation.length > 17 && $scope.longestAnnotation.length <= 26) { | |
2027 | - | |
2028 | - | |
2029 | - // $("#"+speechbubbleDivId).css("width", "195px"); | |
2030 | - | |
2031 | - // } | |
2032 | - // else if ($scope.longestAnnotation.length > 26 && $scope.longestAnnotation.length <= 34) { | |
2033 | - | |
2034 | - // $("#"+speechbubbleDivId).css("width", "248px"); | |
2035 | - | |
2036 | - // } | |
2037 | - // else if ($scope.longestAnnotation.length > 34 && $scope.longestAnnotation.length <= 44) { | |
2038 | - | |
2039 | - | |
2040 | - // $("#"+speechbubbleDivId).css("width", "300px"); | |
2041 | - // } | |
2042 | - | |
2043 | - // else if ($scope.longestAnnotation.length > 44 && $scope.longestAnnotation.length <= 54) { | |
2044 | - | |
2045 | - // $("#"+speechbubbleDivId).css("width", "370px"); | |
2046 | - // } | |
2047 | - | |
2048 | - // else if ($scope.longestAnnotation.length > 54 && $scope.longestAnnotation.length <= 69) { | |
2049 | - // $("#"+speechbubbleDivId).css("width", "450px"); | |
2050 | - // } | |
2051 | - // else if ($scope.longestAnnotation.length > 69 && $scope.longestAnnotation.length <= 75) { | |
2052 | - // $("#"+speechbubbleDivId).css("width", "510px"); | |
2053 | - // } | |
2054 | - // else { | |
2055 | - // $("#"+speechbubbleDivId).css("width", ($scope.longestAnnotation.length) + "%"); | |
2056 | - // } | |
2057 | 2066 | } |
2058 | 2067 | } |
2059 | 2068 | var speechBubbleDims = []; |
... | ... | @@ -2080,7 +2089,8 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou |
2080 | 2089 | "speechBuubleId": speechbubbleDivId, |
2081 | 2090 | "speechBubbleLineId": speechBubbleLineDivId, |
2082 | 2091 | "currentX": x, |
2083 | - "currentY": y | |
2092 | + "currentY": y, | |
2093 | + "pinId": PinId | |
2084 | 2094 | }); |
2085 | 2095 | } |
2086 | 2096 | |
... | ... | @@ -2092,7 +2102,8 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou |
2092 | 2102 | "speechBuubleId": speechbubbleDivId, |
2093 | 2103 | "speechBubbleLineId": speechBubbleLineDivId, |
2094 | 2104 | "currentX": x, |
2095 | - "currentY": y | |
2105 | + "currentY": y, | |
2106 | + "pinId": PinId | |
2096 | 2107 | }); |
2097 | 2108 | } |
2098 | 2109 | |
... | ... | @@ -2107,7 +2118,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou |
2107 | 2118 | document.getElementById(speechBubbleLineDivId).style.top = ((speechBubbleDims[0].currentY)) + 'px'; |
2108 | 2119 | } |
2109 | 2120 | document.getElementById(speechbubbleDivId).style.display = 'block'; |
2110 | - document.getElementById(speechbubbleDivId).style.left = (speechBubbleDims[0].currentX - 4) + 'px'; | |
2121 | + document.getElementById(speechbubbleDivId).style.left = (speechBubbleDims[0].currentX +20) + 'px'; | |
2111 | 2122 | document.getElementById(speechbubbleDivId).style.top = (speechBubbleDims[0].currentY) + 'px'; |
2112 | 2123 | |
2113 | 2124 | if (isShowBodyWithCBPinData == true) { |
... | ... | @@ -2130,7 +2141,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou |
2130 | 2141 | if (speechBubbleDimaensions[i].speechBuubleId == speechbubbleDivId) { |
2131 | 2142 | speechBubbleDimaensions[i].speechBubbleLineId =speechBubbleDraggedLineID; |
2132 | 2143 | |
2133 | - $scope.angle(speechBubbleDraggedLineID, speechBubbleDimaensions[i].currentX, speechBubbleDimaensions[i].currentY, bulleleft+20 , bulletop+20 , true,windowviewid); | |
2144 | + $scope.angle(speechBubbleDraggedLineID, speechBubbleDimaensions[i].currentX, speechBubbleDimaensions[i].currentY, bulleleft + 20, bulletop + 20, true,windowviewid); | |
2134 | 2145 | } |
2135 | 2146 | } |
2136 | 2147 | |
... | ... | @@ -2158,16 +2169,38 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou |
2158 | 2169 | $("#speechBubbleLine" + sppechBubbleId).css("display", "none"); |
2159 | 2170 | |
2160 | 2171 | var speechBubbleDimaensions=$scope.GetAAwindowStoreData(windowviewid,'speechBubbleDimaensions'); |
2161 | - | |
2172 | + | |
2162 | 2173 | for (var i = 0; i <= speechBubbleDimaensions.length - 1; i++) { |
2163 | 2174 | if (speechBubbleDimaensions[i].speechBuubleId == clickedSpeechBubbleId) { |
2164 | 2175 | speechBubbleDimaensions[i].speechBubbleLineId =speechBubbleDraggedLineID; |
2165 | 2176 | |
2166 | - $scope.angle(speechBubbleDraggedLineID, speechBubbleDimaensions[i].currentX, speechBubbleDimaensions[i].currentY, evt.pageX + horizontlScrollPosition - $('#canvasAADiv_'+windowviewid).offset().left, evt.pageY + verticalScrollPosition - $('#canvasAADiv_'+windowviewid).offset().top, true,windowviewid); | |
2177 | + $scope.angle(speechBubbleDraggedLineID, speechBubbleDimaensions[i].currentX, speechBubbleDimaensions[i].currentY, evt.pageX + horizontlScrollPosition - $('#canvasAADiv_' + windowviewid).offset().left, evt.pageY + verticalScrollPosition - $('#canvasAADiv_' + windowviewid).offset().top, true, windowviewid); | |
2167 | 2178 | } |
2168 | - } | |
2179 | + } | |
2169 | 2180 | |
2170 | 2181 | }, |
2182 | + stop: function (evt) { | |
2183 | + | |
2184 | + var clickedSpeechBubbleId = $(this).attr("id"); | |
2185 | + var len = (clickedSpeechBubbleId).split("_").length; | |
2186 | + var windowviewid = (clickedSpeechBubbleId).split("_")[len - 1]; | |
2187 | + var sppechBubbleId = $(this).attr("id").substring(12); | |
2188 | + var PinId = sppechBubbleId.split("_")[0]; | |
2189 | + | |
2190 | + if ($rootScope.isCallFromOtherModule) { | |
2191 | + $timeout(function () { | |
2192 | + var CBselectedpinCordinate = $scope.GetAAwindowStoreData(windowviewid, 'CBselectedpinCordinate'); | |
2193 | + var BubleObj = document.getElementById(clickedSpeechBubbleId); | |
2194 | + var CBselectedpinCordinate = new jinqJs() | |
2195 | + .from(CBselectedpinCordinate) | |
2196 | + .update(function (coll, index) { coll[index].lx = BubleObj.offsetLeft; coll[index].ly = BubleObj.offsetTop; }) | |
2197 | + .at("pinId == " + PinId); | |
2198 | + | |
2199 | + }, 100); | |
2200 | + | |
2201 | + } | |
2202 | + } | |
2203 | + | |
2171 | 2204 | }); |
2172 | 2205 | |
2173 | 2206 | $('.crossDiv_temp').on('click', function (evt) { |
... | ... | @@ -2180,22 +2213,18 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou |
2180 | 2213 | var pinId = imgDivId.substring(8, imgDivId.length); |
2181 | 2214 | $('#speechBubble' + pinId+'_'+windowviewid).remove(); |
2182 | 2215 | $("#speechBubbleDraggedLine" + pinId+'_'+windowviewid).remove(); |
2183 | - $("#speechBubbleLine" + pinId+'_'+windowviewid).remove(); | |
2184 | - | |
2185 | - //make all pin heads grey | |
2186 | - // var pinHeadName = 'PinArc_' + pinId; | |
2187 | - // var radial = $('#aaDetailViewCanvas_'+windowviewid).createGradient({ | |
2188 | - // x1: 50, y1: 50, | |
2189 | - // x2: 50, y2: 50, | |
2190 | - // r1: 10, r2: 30, | |
2191 | - // c1: 'rgba(100, 50, 0,0)', | |
2192 | - // c2: 'rgb(216, 216, 216)' | |
2193 | - // }); | |
2194 | - | |
2195 | - | |
2196 | - // $('#aaDetailViewCanvas_'+windowviewid).setLayer(pinHeadName, { | |
2197 | - // fillStyle: radial, | |
2198 | - // }).drawLayers(); | |
2216 | + $("#speechBubbleLine" + pinId + '_' + windowviewid).remove(); | |
2217 | + | |
2218 | + if ($rootScope.isCallFromOtherModule) { | |
2219 | + var CBselectedpinCordinate = []; | |
2220 | + CBselectedpinCordinate = $scope.GetAAwindowStoreData(windowviewid, 'CBselectedpinCordinate'); | |
2221 | + CBselectedpinCordinate = new jinqJs() | |
2222 | + .from(CBselectedpinCordinate) | |
2223 | + .delete().at("pinId == " + pinId).select(); | |
2224 | + | |
2225 | + $scope.SetAAwindowStoreData(windowviewid, 'CBselectedpinCordinate', CBselectedpinCordinate); | |
2226 | + } | |
2227 | + | |
2199 | 2228 | }); |
2200 | 2229 | |
2201 | 2230 | //make the head green |
... | ... | @@ -2263,7 +2292,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou |
2263 | 2292 | else { |
2264 | 2293 | $("#bord_annotation").css({ 'display': 'block', 'width': d + 'px', 'top': e + 'px', 'left': f + 'px', 'transform': 'rotate(' + theta + 'deg)', '-moz-transform': 'rotate(' + theta + 'deg)', '-webkit-transform': 'rotate(' + theta + 'deg)', 'transform-origin': '0% 0%' }); |
2265 | 2294 | } |
2266 | - | |
2295 | + | |
2267 | 2296 | } |
2268 | 2297 | |
2269 | 2298 | |
... | ... | @@ -2311,6 +2340,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou |
2311 | 2340 | if (clickedPin.event.ctrlKey == false) { |
2312 | 2341 | $scope.SetAAwindowStoreData(windowviewid, 'clickedPins', []); |
2313 | 2342 | $scope.SetAAwindowStoreData(windowviewid, 'selectedPins', []); |
2343 | + $scope.SetAAwindowStoreData(windowviewid, 'CBselectedpinCordinate', []); | |
2314 | 2344 | } |
2315 | 2345 | var pinID = (clickedPin.name).substring(7, (clickedPin.name).length); |
2316 | 2346 | var aaPinData = $scope.GetAAwindowStoreData(windowviewid,'aaPinData'); | ... | ... |