Commit dcab32ad88599c111bed42508680d1976d9b9795
1 parent
88b46c70
Refactor Annotation Code
Showing
2 changed files
with
304 additions
and
577 deletions
400-SOURCECODE/AIAHTML5.API/Web.config
... | ... | @@ -39,7 +39,7 @@ |
39 | 39 | <add key="EnableSSL" value="false" /> |
40 | 40 | <add key="Site_Url" value ="//52.2.38.120"/> |
41 | 41 | <add key ="HostAddress" value="10.100.12.13" /> |
42 | - <add key="isUserAuthenticated" value="false"/> | |
42 | + <add key="isUserAuthenticated" value="true"/> | |
43 | 43 | <add key="AdminSupport" value="amrita.vishnoi@ebix.com,nikita.kulshreshtha@ebix.com"/> |
44 | 44 | </appSettings> |
45 | 45 | <system.web> | ... | ... |
400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
... | ... | @@ -3112,41 +3112,27 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
3112 | 3112 | |
3113 | 3113 | |
3114 | 3114 | $scope.createDynamicSpeechBubble = function (event, x, y, isAnnotationForTBox) { |
3115 | - | |
3116 | - | |
3117 | 3115 | if (isAnnotationForTBox == true) { |
3118 | 3116 | //1. In transparency box we shows two annotation at a time, so we need to decide the max length of annotation in btween two annotation because based on that |
3119 | 3117 | // we decide the size of speech bubble |
3120 | 3118 | $scope.longestAnnotation = $scope.MultiLanguageAnnationArray.reduce(function (firstAnnotation, seconAnnotation) { return firstAnnotation.length > seconAnnotation.length ? firstAnnotation : seconAnnotation; }); |
3121 | - | |
3122 | 3119 | //2. |
3123 | 3120 | if (event.ctrlKey) { |
3124 | - | |
3125 | 3121 | console.log('ctrl pressed'); |
3126 | - | |
3127 | 3122 | $scope.multiAnnotationIsON = true; |
3128 | - | |
3129 | 3123 | //2.1 create unique speech bubbles |
3130 | 3124 | $scope.speechBubbleCounter = $scope.speechBubbleCounter + 1; |
3131 | 3125 | var id = "speechBubble" + $scope.speechBubbleCounter; |
3132 | - | |
3133 | 3126 | //2.2 Get clicked locationa and find if it is already clicked earlier too on same location |
3134 | 3127 | var pointClicked = parseInt(x) + parseInt(y); |
3135 | - | |
3136 | 3128 | var isClickedOnSamePoint = $("#canvasDiv").find("div[id=" + pointClicked + "]").length; |
3137 | - | |
3138 | 3129 | console.log('isClickedOnSamePoint: ' + isClickedOnSamePoint); |
3139 | - | |
3140 | 3130 | // if user has not clciked on smae point then create speech bubble otherwise not |
3141 | 3131 | if (isClickedOnSamePoint == 0) { |
3142 | 3132 | console.log('not clicked on same point') |
3143 | 3133 | $scope.createSpeechBubbleBasedOnAnnotationLength(pointClicked, x, y, id); |
3144 | - | |
3145 | 3134 | $scope.speechbubbleList.push({ xaxis: x, yaxis: y, ids: id }); |
3146 | - | |
3147 | 3135 | } |
3148 | - | |
3149 | - | |
3150 | 3136 | $('.appendDragg').draggable({ |
3151 | 3137 | drag: function (evt) { |
3152 | 3138 | $(this).prev('div').css("display", "none"); |
... | ... | @@ -3154,384 +3140,59 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
3154 | 3140 | var sub_id1 = $(this).attr('id'); |
3155 | 3141 | var verticalScrollPosition = canvasDiv.scrollTop; |
3156 | 3142 | var horizontlScrollPosition = canvasDiv.scrollLeft; |
3157 | - | |
3158 | 3143 | if ($scope.speechbubbleList != null || $scope.speechbubbleList != undefined) { |
3159 | 3144 | for (var m = 0; m <= $scope.speechbubbleList.length - 1; m++) { |
3160 | 3145 | if ($scope.speechbubbleList[m].ids == sub_id1) { |
3161 | - | |
3162 | 3146 | $scope.angle1($scope.speechbubbleList[m].xaxis, $scope.speechbubbleList[m].yaxis, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top, bor_id); |
3163 | 3147 | break; |
3164 | - | |
3165 | 3148 | } |
3166 | 3149 | } |
3167 | 3150 | } |
3168 | - | |
3169 | 3151 | }, |
3170 | 3152 | }); |
3171 | - | |
3172 | - | |
3173 | - | |
3174 | 3153 | $('.dynCross').on('click', function (evt) { |
3175 | 3154 | //$(this).parent().parent().parent().css('display', 'none'); |
3176 | 3155 | $(this).parent().parent().parent().remove(); |
3177 | - | |
3178 | 3156 | }); |
3179 | - | |
3180 | 3157 | } |
3181 | - | |
3182 | - | |
3183 | 3158 | else { |
3184 | 3159 | $scope.multiAnnotationIsON = false; |
3185 | - | |
3186 | - //$(".com").css("display", "none"); | |
3187 | - //$("#bord").css({ "width": "0px", "display": "none" }); | |
3188 | - | |
3189 | 3160 | //history maintained issue |
3190 | 3161 | if ($rootScope.isAnnotaionToolBarDrawingModeActive == false) { |
3191 | 3162 | $("#sppeachBubble").remove(); |
3192 | 3163 | $("#dot").remove(); |
3193 | 3164 | } |
3194 | - | |
3195 | - | |
3196 | - | |
3197 | 3165 | $(".com").remove(); |
3198 | 3166 | $("#bord").remove(); |
3199 | - | |
3200 | - var sppechBubbleDotHTML = '<div id="dot" style="position:absolute;height:15px;width:35px;display:none;z-index:10000;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>' | |
3201 | - + '<div id="sppeachBubble" style="height:auto!important;z-index:10000;margin-left:25px;border:1px solid #000;display:none;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;">' | |
3202 | - + '<span style="position:absolute;right:-3px;top:-4px;color:#ffffff;cursor:pointer;">' | |
3203 | - + '<img class="crossDiv_temp" style="width:18px" src=' + $rootScope.path + '></span></div>' | |
3204 | - | |
3205 | - + '<div style="position:absolute;border:1px solid #000;display:none;z-index:9000;" id="bord">' | |
3206 | - + '</div>'; | |
3207 | - | |
3208 | - //Issue #7286 :Undefined annotation should not appear | |
3209 | - for (var i = 0; i <= $scope.MultiLanguageAnnationArray.length - 1; i++) { | |
3210 | - var MultipleLanguage = $scope.MultiLanguageAnnationArray[i]; | |
3211 | - } | |
3212 | - | |
3213 | - if (MultipleLanguage == undefined) { | |
3214 | - console.log("No text is found"); | |
3215 | - } else { | |
3216 | - $('#canvasDiv').append(sppechBubbleDotHTML); | |
3217 | - | |
3218 | - if ($scope.MultiLanguageAnnationArray.length > 0) { | |
3219 | - for (var i = 0; i <= $scope.MultiLanguageAnnationArray.length - 1; i++) { | |
3220 | - var MultipleLanguage = $scope.MultiLanguageAnnationArray[i]; | |
3221 | - $("#sppeachBubble").append("<p style='margin-bottom:2px;'>" + MultipleLanguage + "</p>"); | |
3222 | - } | |
3223 | - } | |
3224 | - else { | |
3225 | - console.log('MultiLanguageAnnationArray.length is :' + $scope.MultiLanguageAnnationArray.length) | |
3226 | - } | |
3227 | - if ($scope.longestAnnotation != null || $scope.longestAnnotation != undefined) { | |
3228 | - if ($scope.longestAnnotation.length <= 10) { | |
3229 | - | |
3230 | - | |
3231 | - $("#sppeachBubble").css("width", "100px"); | |
3232 | - | |
3233 | - } | |
3234 | - | |
3235 | - else if ($scope.longestAnnotation.length > 10 && $scope.longestAnnotation.length <= 17) { | |
3236 | - | |
3237 | - | |
3238 | - | |
3239 | - $("#sppeachBubble").css("width", "140px"); | |
3240 | - | |
3241 | - } | |
3242 | - else if ($scope.longestAnnotation.length > 17 && $scope.longestAnnotation.length <= 26) { | |
3243 | - | |
3244 | - | |
3245 | - $("#sppeachBubble").css("width", "195px"); | |
3246 | - | |
3247 | - } | |
3248 | - else if ($scope.longestAnnotation.length > 26 && $scope.longestAnnotation.length <= 34) { | |
3249 | - | |
3250 | - $("#sppeachBubble").css("width", "248px"); | |
3251 | - | |
3252 | - } | |
3253 | - else if ($scope.longestAnnotation.length > 34 && $scope.longestAnnotation.length <= 44) { | |
3254 | - | |
3255 | - | |
3256 | - $("#sppeachBubble").css("width", "300px"); | |
3257 | - } | |
3258 | - | |
3259 | - else if ($scope.longestAnnotation.length > 44 && $scope.longestAnnotation.length <= 54) { | |
3260 | - | |
3261 | - $("#sppeachBubble").css("width", "370px"); | |
3262 | - | |
3263 | - } | |
3264 | - | |
3265 | - else if ($scope.longestAnnotation.length > 54 && $scope.longestAnnotation.length <= 69) { | |
3266 | - | |
3267 | - | |
3268 | - $("#sppeachBubble").css("width", "450px"); | |
3269 | - | |
3270 | - } | |
3271 | - | |
3272 | - else if ($scope.longestAnnotation.length > 69 && $scope.longestAnnotation.length <= 75) { | |
3273 | - | |
3274 | - | |
3275 | - $("#sppeachBubble").css("width", "510px"); | |
3276 | - | |
3277 | - } | |
3278 | - | |
3279 | - else { | |
3280 | - | |
3281 | - | |
3282 | - $("#sppeachBubble").css("width", ($scope.longestAnnotation.length) + "%"); | |
3283 | - | |
3284 | - | |
3285 | - } | |
3286 | - | |
3287 | - } | |
3288 | - } | |
3289 | - var Globe = []; | |
3290 | - Globe.push({ currentX: x, currentY: y }); | |
3291 | - | |
3292 | - document.getElementById('dot').style.display = 'block'; | |
3293 | - document.getElementById('dot').style.left = ((Globe[0].currentX) - 10) + 'px'; | |
3294 | - document.getElementById('dot').style.top = ((Globe[0].currentY) + 10) + 'px'; | |
3295 | - document.getElementById('sppeachBubble').style.display = 'block'; | |
3296 | - document.getElementById('sppeachBubble').style.left = (Globe[0].currentX) + 'px'; | |
3297 | - document.getElementById('sppeachBubble').style.top = (Globe[0].currentY) + 'px'; | |
3298 | - | |
3299 | - | |
3167 | + $scope.createSpeechBubbleBasedOnAnnotationLengthwithoutCtrl(x, y); | |
3300 | 3168 | //history maintained issue |
3301 | 3169 | if ($rootScope.isAnnotaionToolBarDrawingModeActive == false) { document.getElementById('sppeachBubble').style.zIndex = "60000"; } |
3302 | - | |
3303 | - | |
3304 | - | |
3305 | - | |
3306 | 3170 | $('#sppeachBubble').draggable( |
3307 | - { | |
3308 | - drag: function (evt) { | |
3309 | - | |
3310 | - //$("#dot").css("display", "none"); | |
3171 | + { | |
3172 | + drag: function (evt) { | |
3311 | 3173 | $("#dot").css("visibility", "hidden"); |
3312 | 3174 | var verticalScrollPosition = canvasDiv.scrollTop; |
3313 | 3175 | var horizontlScrollPosition = canvasDiv.scrollLeft; |
3314 | 3176 | $scope.angle(x, y, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top, true); |
3315 | - | |
3316 | - | |
3317 | - }, | |
3318 | - }); | |
3319 | - | |
3320 | - | |
3177 | + }, | |
3178 | + }); | |
3321 | 3179 | $('.crossDiv_temp').on('click', function (evt) { |
3322 | - //$('#sppeachBubble').css('display', 'none'); | |
3323 | - | |
3324 | - //$("#bord").css("display", "none"); | |
3325 | - //$("#dot").css("display", "none"); | |
3326 | 3180 | $('#sppeachBubble').remove(); |
3327 | - | |
3328 | 3181 | $("#bord").remove(); |
3329 | 3182 | $("#dot").remove(); |
3330 | - | |
3331 | 3183 | }); |
3332 | - | |
3333 | 3184 | } |
3334 | 3185 | } |
3335 | - | |
3336 | 3186 | else { |
3337 | - | |
3338 | - // alert("false"); | |
3339 | 3187 | $scope.longest_annotationT1 = $scope.annotationTextArrayT1.reduce(function (a, b) { return a.length > b.length ? a : b; }); |
3340 | 3188 | $scope.longest_annotationT2 = $scope.annotationTextArrayT2.reduce(function (a, b) { return a.length > b.length ? a : b; }); |
3341 | - | |
3342 | 3189 | if (event.ctrlKey) { |
3343 | - | |
3344 | - // $scope.multiAnnotationIsON = true; | |
3345 | - | |
3346 | 3190 | $scope.j = $scope.j + 1; |
3347 | - | |
3348 | 3191 | var sub_id_annotation = "black_annotation" + $scope.j; |
3349 | - // alert(sub_id_annotation); | |
3350 | 3192 | var pointClicked_annotation = parseInt(x) + parseInt(y); |
3351 | 3193 | var Exists_annotation = $("#canvasDiv").find("div[id=" + pointClicked_annotation + "]").length; |
3352 | - // alert(Exists_annotation); | |
3353 | - // alert(pointClicked_annotation); | |
3354 | - var sppechBubbleHTML_annotation = "<div id ='" + pointClicked_annotation + "' class='com_anno'><div style='z-index:59000;position:absolute;border-top:2px solid #000;transform:rotate(40deg);-moz-transform:rotate(40deg);-o-transform:rotate(40deg);-ms-transform:rotate(40deg);-webkit-transform:rotate(40deg);height:15px;width:35px;left:" + (x - 10) + "px;top:" + (y + 10) + "px;'' id='bubble" + $scope.j + "'></div><div data=" + $scope.j + " id=" + sub_id_annotation + " class='appendDragg_annotation' style='z-index:60000;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;left:" + x + "px;top:" + y + "px;'><div style='z-index:7000;position:absolute;right:-3px;top:-4px;color:#ffffff;cursor:pointer;'><img id=" + $scope.j + " class='dynCross_anno' style='width:18px' src=" + $rootScope.path + "></div></div><div style='position:absolute;border:1px solid #000;display:none;z-index:59000;' id='bord_annotation" + $scope.j + "'></div></div>"; | |
3355 | - if ($scope.longest_annotationT1.length > $scope.longest_annotationT2.length) { | |
3356 | - if (Exists_annotation == 0) { | |
3357 | - $("#canvasDiv").append(sppechBubbleHTML_annotation); | |
3358 | - | |
3359 | - for (var l = 0; l <= $scope.annotationTextArrayT1.length - 1; l++) { | |
3360 | - var MultipleLang_annotation_T1 = $scope.annotationTextArrayT1[l]; | |
3361 | - // alert(MultipleLang_annotation_T1); | |
3362 | - // alert(sub_id_annotation); | |
3363 | - $("#" + sub_id_annotation).append("<p style='margin-bottom:2px;'>" + MultipleLang_annotation_T1 + "</p>"); | |
3364 | - } | |
3365 | - | |
3366 | - $("#" + sub_id_annotation).append("<p style='border-bottom:1px solid black;margin-bottom:0;'></p>"); | |
3367 | - | |
3368 | - for (var k = 0; k <= $scope.annotationTextArrayT2.length - 1; k++) { | |
3369 | - // alert(MultipleLang_annotation_T2); | |
3370 | - var MultipleLang_annotation_T2 = $scope.annotationTextArrayT2[k]; | |
3371 | - $("#" + sub_id_annotation).append("<p style='margin-bottom:2px;'>" + MultipleLang_annotation_T2 + "</p>"); | |
3372 | - } | |
3373 | - | |
3374 | - | |
3375 | - | |
3376 | - if ($scope.longest_annotationT1.length <= 10) { | |
3377 | - | |
3378 | - | |
3379 | - $("#" + sub_id_annotation).css("width", "100px"); | |
3380 | - | |
3381 | - | |
3382 | - } | |
3383 | - | |
3384 | - else if ($scope.longest_annotationT1.length > 10 && $scope.longest_annotationT1.length <= 17) { | |
3385 | - | |
3386 | - | |
3387 | - $("#" + sub_id_annotation).css("width", "140px"); | |
3388 | - | |
3389 | - | |
3390 | - } | |
3391 | - | |
3392 | - else if ($scope.longest_annotationT1.length > 17 && $scope.longest_annotationT1.length <= 26) { | |
3393 | - | |
3394 | - | |
3395 | - | |
3396 | - $("#" + sub_id_annotation).css("width", "195px"); | |
3397 | - | |
3398 | - } | |
3399 | - else if ($scope.longest_annotationT1.length > 26 && $scope.longest_annotationT1.length <= 34) { | |
3400 | - | |
3401 | - | |
3402 | - | |
3403 | - $("#" + sub_id_annotation).css("width", "248px"); | |
3404 | - } | |
3405 | - else if ($scope.longest_annotationT1.length > 34 && $scope.longest_annotationT1.length <= 44) { | |
3406 | - | |
3407 | - | |
3408 | - | |
3409 | - $("#" + sub_id_annotation).css("width", "300px"); | |
3410 | - } | |
3411 | - | |
3412 | - else if ($scope.longest_annotationT1.length > 44 && $scope.longest_annotationT1.length <= 54) { | |
3413 | - | |
3414 | - | |
3415 | - | |
3416 | - $("#" + sub_id_annotation).css("width", "370px"); | |
3417 | - } | |
3418 | - else if ($scope.longest_annotationT1.length > 54 && $scope.longest_annotationT1.length <= 69) { | |
3419 | - | |
3420 | - | |
3421 | - | |
3422 | - $("#" + sub_id_annotation).css("width", "450px"); | |
3423 | - } | |
3424 | - else if ($scope.longest_annotationT1.length > 69 && $scope.longest_annotationT1.length <= 75) { | |
3425 | - | |
3426 | - | |
3427 | - $("#" + sub_id_annotation).css("width", "510px"); | |
3428 | - | |
3429 | - } | |
3430 | - else { | |
3431 | - | |
3432 | - | |
3433 | - $("#" + sub_id_annotation).css("width", ($scope.longest_annotationT1.length) + "%"); | |
3434 | - } | |
3435 | - } | |
3436 | - else { | |
3437 | - | |
3438 | - $("#canvasDiv").find("div[id=" + pointClicked_annotation + "]").css("display", "block"); | |
3439 | - | |
3440 | - } | |
3441 | - | |
3442 | - } | |
3443 | - else { | |
3444 | - | |
3445 | - if (Exists_annotation == 0) { | |
3446 | - | |
3447 | - | |
3448 | - | |
3449 | - $("#canvasDiv").append(sppechBubbleHTML_annotation); | |
3450 | - | |
3451 | - for (var l = 0; l <= $scope.annotationTextArrayT1.length - 1; l++) { | |
3452 | - var MultipleLang_annotation_T1 = $scope.annotationTextArrayT1[l]; | |
3453 | - // alert(MultipleLang_annotation_T1); | |
3454 | - $("#" + sub_id_annotation).append("<p style='margin-bottom:2px;'>" + MultipleLang_annotation_T1 + "</p>"); | |
3455 | - } | |
3456 | - | |
3457 | - $("#" + sub_id_annotation).append("<p style='border-bottom:1px dotted white;margin-bottom:0;'></p>"); | |
3458 | - | |
3459 | - for (var k = 0; k <= $scope.annotationTextArrayT2.length - 1; k++) { | |
3460 | - var MultipleLang_annotation_T2 = $scope.annotationTextArrayT2[k]; | |
3461 | - // alert(MultipleLang_annotation_T2); | |
3462 | - $("#" + sub_id_annotation).append("<p style='margin-bottom:2px;'>" + MultipleLang_annotation_T2 + "</p>"); | |
3463 | - } | |
3464 | - | |
3465 | - if ($scope.longest_annotationT2.length <= 10) { | |
3466 | - | |
3467 | - | |
3468 | - $("#" + sub_id_annotation).css("width", "100px"); | |
3469 | - | |
3470 | - | |
3471 | - } | |
3472 | - | |
3473 | - else if ($scope.longest_annotationT2.length > 10 && $scope.longest_annotationT2.length <= 17) { | |
3474 | - | |
3475 | - | |
3476 | - $("#" + sub_id_annotation).css("width", "140px"); | |
3477 | - | |
3478 | - | |
3479 | - } | |
3480 | - | |
3481 | - else if ($scope.longest_annotationT2.length > 17 && $scope.longest_annotationT2.length <= 26) { | |
3482 | - | |
3483 | - | |
3484 | - | |
3485 | - $("#" + sub_id_annotation).css("width", "195px"); | |
3486 | - | |
3487 | - } | |
3488 | - else if ($scope.longest_annotationT2.length > 26 && $scope.longest_annotationT2.length <= 34) { | |
3489 | - | |
3490 | - | |
3491 | - | |
3492 | - $("#" + sub_id_annotation).css("width", "248px"); | |
3493 | - } | |
3494 | - else if ($scope.longest_annotationT2.length > 34 && $scope.longest_annotationT2.length <= 44) { | |
3495 | - | |
3496 | - | |
3497 | - | |
3498 | - $("#" + sub_id_annotation).css("width", "300px"); | |
3499 | - } | |
3500 | - | |
3501 | - else if ($scope.longest_annotationT2.length > 44 && $scope.longest_annotationT2.length <= 54) { | |
3502 | - | |
3503 | - | |
3504 | - | |
3505 | - $("#" + sub_id_annotation).css("width", "370px"); | |
3506 | - } | |
3507 | - else if ($scope.longest_annotationT2.length > 54 && $scope.longest_annotationT2.length <= 69) { | |
3508 | - | |
3509 | - | |
3510 | - | |
3511 | - $("#" + sub_id_annotation).css("width", "450px"); | |
3512 | - } | |
3513 | - else if ($scope.longest_annotationT2.length > 69 && $scope.longest_annotationT2.length <= 75) { | |
3514 | - | |
3515 | - | |
3516 | - $("#" + sub_id_annotation).css("width", "510px"); | |
3517 | - | |
3518 | - } | |
3519 | - else { | |
3520 | - | |
3521 | - | |
3522 | - $("#" + sub_id_annotation).css("width", ($scope.longest_annotationT2.length) + "%"); | |
3523 | - } | |
3524 | - } | |
3525 | - else { | |
3526 | - | |
3527 | - $("#canvasDiv").find("div[id=" + pointClicked_annotation + "]").css("display", "block"); | |
3528 | - | |
3529 | - } | |
3530 | - | |
3531 | - } | |
3532 | - | |
3194 | + $scope.createSpeechBubbleBasedOnTransparencyWithCtrl(pointClicked_annotation, Exists_annotation, x, y, sub_id_annotation); | |
3533 | 3195 | $scope.speachBubbleArrayAnnotation.push({ xaxis: x, yaxis: y, ids: sub_id_annotation }); |
3534 | - | |
3535 | 3196 | $('.appendDragg_annotation').draggable({ |
3536 | 3197 | drag: function (evt) { |
3537 | 3198 | $(this).prev('div').css("display", "none"); |
... | ... | @@ -3539,264 +3200,48 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
3539 | 3200 | var sub_id1_anno = $(this).attr('id'); |
3540 | 3201 | var verticalScrollPosition = canvasDiv.scrollTop; |
3541 | 3202 | var horizontlScrollPosition = canvasDiv.scrollLeft; |
3542 | - | |
3543 | 3203 | if ($scope.speachBubbleArrayAnnotation != null || $scope.speachBubbleArrayAnnotation != undefined) { |
3544 | 3204 | for (var m = 0; m <= $scope.speachBubbleArrayAnnotation.length - 1; m++) { |
3545 | 3205 | if ($scope.speachBubbleArrayAnnotation[m].ids == sub_id1_anno) { |
3546 | - | |
3547 | 3206 | $scope.angle1($scope.speachBubbleArrayAnnotation[m].xaxis, $scope.speachBubbleArrayAnnotation[m].yaxis, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top, bor_id_anno); |
3548 | 3207 | break; |
3549 | - | |
3550 | 3208 | } |
3551 | 3209 | } |
3552 | 3210 | } |
3553 | - | |
3554 | 3211 | }, |
3555 | 3212 | }); |
3556 | - | |
3557 | - | |
3558 | - | |
3559 | 3213 | $('.dynCross_anno').on('click', function (evt) { |
3560 | - //$(this).parent().parent().parent().css('display', 'none'); | |
3561 | 3214 | $(this).parent().parent().parent().remove(); |
3562 | - // $("#bord").css("display", "none"); | |
3563 | - // $("#dot").css("display", "none"); | |
3564 | - | |
3565 | - | |
3566 | 3215 | }); |
3567 | - | |
3568 | - | |
3569 | - | |
3570 | 3216 | } |
3571 | - | |
3572 | 3217 | else { |
3573 | - | |
3574 | 3218 | $scope.multiAnnotationIsON = false; |
3575 | - | |
3576 | 3219 | $(".com_annotation").css("display", "none"); |
3577 | 3220 | $("#bord_annotation").css({ "width": "0px", "display": "none" }); |
3578 | 3221 | $('.dynCross_anno').parent().parent().parent().remove(); |
3579 | - var sppechBubbleDotHTML_annotation = '<div id="dot_annotation" style="position:absolute;height:15px;width:35px;display:none;z-index:59000;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>' | |
3580 | - + '<div id="sppeachBubble_annotation" style="height:auto!important;z-index:60000;margin-left:25px;border:1px solid #000;display:none;padding:5px 10px;position:absolute;color:#fff;text-align:left;font-size:12px;background-color:#19100e;font-weight:bold;border-radius:5px;-moz-border-radius:5px;-webkit-border-radius:5px;-o-border-radius:5px;-ms-border-radius:5px;font-weight:bold;">' | |
3581 | - + '<span style="position:absolute;right:-3px;top:-4px;color:#ffffff;cursor:pointer;">' | |
3582 | - + '<img class="crossDiv_temp_annotation" style="width:18px" src=' + $rootScope.path + '></span></div>' | |
3583 | - | |
3584 | - + '<div style="position:absolute;border:1px solid #000;display:none;z-index:59000;" id="bord_annotation">' | |
3585 | - + '</div>'; | |
3586 | - | |
3587 | - | |
3588 | - | |
3589 | - if ($scope.longest_annotationT1.length > $scope.longest_annotationT2.length) { | |
3590 | - | |
3591 | - $("#sppeachBubble_annotation p").remove(); | |
3592 | - $('#canvasDiv').append(sppechBubbleDotHTML_annotation); | |
3593 | - for (var l = 0; l <= $scope.annotationTextArrayT1.length - 1; l++) { | |
3594 | - var MultipleLang_annotation_T1 = $scope.annotationTextArrayT1[l]; | |
3595 | - $("#sppeachBubble_annotation").append("<p style='margin-bottom:2px;'>" + MultipleLang_annotation_T1 + "</p>"); | |
3596 | - } | |
3597 | - | |
3598 | - $("#sppeachBubble_annotation").append("<p style='border-bottom:1px dotted white;margin-bottom:0;'></p>"); | |
3599 | - | |
3600 | - for (var k = 0; k <= $scope.annotationTextArrayT2.length - 1; k++) { | |
3601 | - var MultipleLang_annotation_T2 = $scope.annotationTextArrayT2[k]; | |
3602 | - $("#sppeachBubble_annotation").append("<p style='margin-bottom:2px;'>" + MultipleLang_annotation_T2 + "</p>"); | |
3603 | - } | |
3604 | - | |
3605 | - if ($scope.longest_annotationT1.length <= 10) { | |
3606 | - | |
3607 | - | |
3608 | - $("#sppeachBubble_annotation").css("width", "100px"); | |
3609 | - | |
3610 | - | |
3611 | - } | |
3612 | - | |
3613 | - else if ($scope.longest_annotationT1.length > 10 && $scope.longest_annotationT1.length <= 17) { | |
3614 | - | |
3615 | - | |
3616 | - $("#sppeachBubble_annotation").css("width", "140px"); | |
3617 | - | |
3618 | - | |
3619 | - } | |
3620 | - | |
3621 | - else if ($scope.longest_annotationT1.length > 17 && $scope.longest_annotationT1.length <= 26) { | |
3622 | - | |
3623 | - | |
3624 | - | |
3625 | - $("#sppeachBubble_annotation").css("width", "195px"); | |
3626 | - | |
3627 | - } | |
3628 | - else if ($scope.longest_annotationT1.length > 26 && $scope.longest_annotationT1.length <= 34) { | |
3629 | - | |
3630 | - | |
3631 | - | |
3632 | - $("#sppeachBubble_annotation").css("width", "248px"); | |
3633 | - } | |
3634 | - else if ($scope.longest_annotationT1.length > 34 && $scope.longest_annotationT1.length <= 44) { | |
3635 | - | |
3636 | - | |
3637 | - | |
3638 | - $("#sppeachBubble_annotation").css("width", "300px"); | |
3639 | - } | |
3640 | - | |
3641 | - else if ($scope.longest_annotationT1.length > 44 && $scope.longest_annotationT1.length <= 54) { | |
3642 | - | |
3643 | - | |
3644 | - | |
3645 | - $("#sppeachBubble_annotation").css("width", "370px"); | |
3646 | - } | |
3647 | - else if ($scope.longest_annotationT1.length > 54 && $scope.longest_annotationT1.length <= 69) { | |
3648 | - | |
3649 | - | |
3650 | - | |
3651 | - $("#sppeachBubble_annotation").css("width", "450px"); | |
3652 | - } | |
3653 | - else if ($scope.longest_annotationT1.length > 69 && $scope.longest_annotationT1.length <= 75) { | |
3654 | - | |
3655 | - | |
3656 | - $("#sppeachBubble_annotation").css("width", "510px"); | |
3657 | - | |
3658 | - } | |
3659 | - else { | |
3660 | - | |
3661 | - | |
3662 | - $("#sppeachBubble_annotation").css("width", ($scope.longest_annotationT1.length) + "%"); | |
3663 | - } | |
3664 | - } | |
3665 | - | |
3666 | - | |
3667 | - else { | |
3668 | - $("#sppeachBubble_annotation p").remove(); | |
3669 | - $('#canvasDiv').append(sppechBubbleDotHTML_annotation); | |
3670 | - for (var l = 0; l <= $scope.annotationTextArrayT1.length - 1; l++) { | |
3671 | - var MultipleLang_annotation_T1 = $scope.annotationTextArrayT1[l]; | |
3672 | - $("#sppeachBubble_annotation").append("<p style='margin-bottom:2px;'>" + MultipleLang_annotation_T1 + "</p>"); | |
3673 | - } | |
3674 | - | |
3675 | - $("#sppeachBubble_annotation").append("<p style='border-bottom:1px dotted white;margin-bottom:0;'></p>"); | |
3676 | - | |
3677 | - for (var k = 0; k <= $scope.annotationTextArrayT2.length - 1; k++) { | |
3678 | - var MultipleLang_annotation_T2 = $scope.annotationTextArrayT2[k]; | |
3679 | - $("#sppeachBubble_annotation").append("<p style='margin-bottom:2px;'>" + MultipleLang_annotation_T2 + "</p>"); | |
3680 | - } | |
3681 | - | |
3682 | - if ($scope.longest_annotationT2.length <= 10) { | |
3683 | - | |
3684 | - | |
3685 | - $("#sppeachBubble_annotation").css("width", "100px"); | |
3686 | - | |
3687 | - | |
3688 | - } | |
3689 | - | |
3690 | - else if ($scope.longest_annotationT2.length > 10 && $scope.longest_annotationT2.length <= 17) { | |
3691 | - | |
3692 | - | |
3693 | - $("#sppeachBubble_annotation").css("width", "140px"); | |
3694 | - | |
3695 | - | |
3696 | - } | |
3697 | - | |
3698 | - else if ($scope.longest_annotationT2.length > 17 && $scope.longest_annotationT2.length <= 26) { | |
3699 | - | |
3700 | - | |
3701 | - | |
3702 | - $("#sppeachBubble_annotation").css("width", "195px"); | |
3703 | - | |
3704 | - } | |
3705 | - else if ($scope.longest_annotationT2.length > 26 && $scope.longest_annotationT2.length <= 34) { | |
3706 | - | |
3707 | - | |
3708 | - | |
3709 | - $("#sppeachBubble_annotation").css("width", "248px"); | |
3710 | - } | |
3711 | - else if ($scope.longest_annotationT2.length > 34 && $scope.longest_annotationT2.length <= 44) { | |
3712 | - | |
3713 | - | |
3714 | - | |
3715 | - $("#sppeachBubble_annotation").css("width", "300px"); | |
3716 | - } | |
3717 | - | |
3718 | - else if ($scope.longest_annotationT2.length > 44 && $scope.longest_annotationT2.length <= 54) { | |
3719 | - | |
3720 | - | |
3721 | - | |
3722 | - $("#sppeachBubble_annotation").css("width", "370px"); | |
3723 | - } | |
3724 | - else if ($scope.longest_annotationT2.length > 54 && $scope.longest_annotationT2.length <= 69) { | |
3725 | - | |
3726 | - | |
3727 | - | |
3728 | - $("#sppeachBubble_annotation").css("width", "450px"); | |
3729 | - } | |
3730 | - else if ($scope.longest_annotationT2.length > 69 && $scope.longest_annotationT2.length <= 75) { | |
3731 | - | |
3732 | - | |
3733 | - $("#sppeachBubble_annotation").css("width", "510px"); | |
3734 | - | |
3735 | - } | |
3736 | - else { | |
3737 | - | |
3738 | - | |
3739 | - $("#sppeachBubble_annotation").css("width", ($scope.longest_annotationT2.length) + "%"); | |
3740 | - } | |
3741 | - var Globe = []; | |
3742 | - Globe.push({ currentX: x, currentY: y }); | |
3743 | - | |
3744 | - document.getElementById('dot_annotation').style.display = 'block'; | |
3745 | - document.getElementById('dot_annotation').style.left = ((Globe[0].currentX) - 10) + 'px'; | |
3746 | - document.getElementById('dot_annotation').style.top = ((Globe[0].currentY) + 10) + 'px'; | |
3747 | - document.getElementById('sppeachBubble_annotation').style.display = 'block'; | |
3748 | - document.getElementById('sppeachBubble_annotation').style.left = (Globe[0].currentX) + 'px'; | |
3749 | - document.getElementById('sppeachBubble_annotation').style.top = (Globe[0].currentY) + 'px'; | |
3750 | - | |
3751 | - $('#sppeachBubble_annotation').draggable( | |
3752 | - { | |
3753 | - drag: function (evt) { | |
3754 | - | |
3755 | - //$("#dot_annotation").css("display", "none"); | |
3756 | - $("#dot_annotation").remove(); | |
3757 | - | |
3758 | - var verticalScrollPosition = canvasDiv.scrollTop; | |
3759 | - var horizontlScrollPosition = canvasDiv.scrollLeft; | |
3760 | - $scope.angle(x, y, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top, false); | |
3761 | - | |
3762 | - | |
3763 | - }, | |
3764 | - }); | |
3765 | - | |
3766 | - | |
3767 | - $('.crossDiv_temp_annotation').on('click', function (evt) { | |
3768 | - //$('#sppeachBubble_annotation').css('display', 'none'); | |
3769 | - | |
3770 | - //$("#bord_annotation").css("display", "none"); | |
3771 | - //$("#dot_annotation").css("display", "none"); | |
3772 | - | |
3773 | - | |
3774 | - $('#sppeachBubble_annotation').remove(); | |
3775 | - | |
3776 | - $("#bord_annotation").remove(); | |
3777 | - $("#dot_annotation").remove(); | |
3778 | - | |
3779 | - }); | |
3780 | - } | |
3781 | - | |
3782 | - | |
3783 | - | |
3222 | + $scope.createSpeechBubbleBasedOnTransparencyWithoutCtrl(x, y); | |
3223 | + $('#sppeachBubble_annotation').draggable( | |
3224 | + { | |
3225 | + drag: function (evt) { | |
3226 | + $("#dot_annotation").remove(); | |
3227 | + var verticalScrollPosition = canvasDiv.scrollTop; | |
3228 | + var horizontlScrollPosition = canvasDiv.scrollLeft; | |
3229 | + $scope.angle(x, y, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top, false); | |
3230 | + }, | |
3231 | + }); | |
3232 | + $('.crossDiv_temp_annotation').on('click', function (evt) { | |
3233 | + $('#sppeachBubble_annotation').remove(); | |
3234 | + $("#bord_annotation").remove(); | |
3235 | + $("#dot_annotation").remove(); | |
3236 | + }); | |
3784 | 3237 | } |
3785 | - | |
3786 | - | |
3787 | 3238 | } |
3788 | - | |
3789 | - | |
3790 | 3239 | if (document.getElementById("btnStrutureBox").name == "showAnnotationStructure") { |
3791 | 3240 | $scope.showAnnotation() |
3792 | - | |
3793 | 3241 | } |
3794 | 3242 | else { |
3795 | 3243 | $scope.hideAnnotation() |
3796 | - | |
3797 | - | |
3798 | 3244 | } |
3799 | - | |
3800 | 3245 | if ($rootScope.isTBCompleted == true) { |
3801 | 3246 | $('#sppeachBubble').remove(); |
3802 | 3247 | $('#dot').remove(); |
... | ... | @@ -3883,6 +3328,288 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
3883 | 3328 | } |
3884 | 3329 | } |
3885 | 3330 | } |
3331 | + $scope.createSpeechBubbleBasedOnAnnotationLengthwithoutCtrl = function (x, y) { | |
3332 | + | |
3333 | + | |
3334 | + | |
3335 | + var sppechBubbleDotHTML = '<div id="dot" style="position:absolute;height:15px;width:35px;display:none;z-index:10000;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>' | |
3336 | + + '<div id="sppeachBubble" style="height:auto!important;z-index:10000;margin-left:25px;border:1px solid #000;display:none;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;">' | |
3337 | + + '<span style="position:absolute;right:-3px;top:-4px;color:#ffffff;cursor:pointer;">' | |
3338 | + + '<img class="crossDiv_temp" style="width:18px" src=' + $rootScope.path + '></span></div>' | |
3339 | + | |
3340 | + + '<div style="position:absolute;border:1px solid #000;display:none;z-index:9000;" id="bord">' | |
3341 | + + '</div>'; | |
3342 | + | |
3343 | + //Issue #7286 :Undefined annotation should not appear | |
3344 | + for (var i = 0; i <= $scope.MultiLanguageAnnationArray.length - 1; i++) { | |
3345 | + var MultipleLanguage = $scope.MultiLanguageAnnationArray[i]; | |
3346 | + } | |
3347 | + | |
3348 | + if (MultipleLanguage == undefined) { | |
3349 | + console.log("No text is found"); | |
3350 | + } else { | |
3351 | + $('#canvasDiv').append(sppechBubbleDotHTML); | |
3352 | + | |
3353 | + if ($scope.MultiLanguageAnnationArray.length > 0) { | |
3354 | + for (var i = 0; i <= $scope.MultiLanguageAnnationArray.length - 1; i++) { | |
3355 | + var MultipleLanguage = $scope.MultiLanguageAnnationArray[i]; | |
3356 | + $("#sppeachBubble").append("<p style='margin-bottom:2px;'>" + MultipleLanguage + "</p>"); | |
3357 | + } | |
3358 | + } | |
3359 | + else { | |
3360 | + console.log('MultiLanguageAnnationArray.length is :' + $scope.MultiLanguageAnnationArray.length) | |
3361 | + } | |
3362 | + if ($scope.longestAnnotation != null || $scope.longestAnnotation != undefined) { | |
3363 | + if ($scope.longestAnnotation.length <= 10) { | |
3364 | + | |
3365 | + | |
3366 | + $("#sppeachBubble").css("width", "100px"); | |
3367 | + | |
3368 | + } | |
3369 | + | |
3370 | + else if ($scope.longestAnnotation.length > 10 && $scope.longestAnnotation.length <= 17) { | |
3371 | + | |
3372 | + | |
3373 | + | |
3374 | + $("#sppeachBubble").css("width", "140px"); | |
3375 | + | |
3376 | + } | |
3377 | + else if ($scope.longestAnnotation.length > 17 && $scope.longestAnnotation.length <= 26) { | |
3378 | + | |
3379 | + | |
3380 | + $("#sppeachBubble").css("width", "195px"); | |
3381 | + | |
3382 | + } | |
3383 | + else if ($scope.longestAnnotation.length > 26 && $scope.longestAnnotation.length <= 34) { | |
3384 | + | |
3385 | + $("#sppeachBubble").css("width", "248px"); | |
3386 | + | |
3387 | + } | |
3388 | + else if ($scope.longestAnnotation.length > 34 && $scope.longestAnnotation.length <= 44) { | |
3389 | + | |
3390 | + | |
3391 | + $("#sppeachBubble").css("width", "300px"); | |
3392 | + } | |
3393 | + | |
3394 | + else if ($scope.longestAnnotation.length > 44 && $scope.longestAnnotation.length <= 54) { | |
3395 | + | |
3396 | + $("#sppeachBubble").css("width", "370px"); | |
3397 | + } | |
3398 | + | |
3399 | + else if ($scope.longestAnnotation.length > 54 && $scope.longestAnnotation.length <= 69) { | |
3400 | + $("#sppeachBubble").css("width", "450px"); | |
3401 | + } | |
3402 | + else if ($scope.longestAnnotation.length > 69 && $scope.longestAnnotation.length <= 75) { | |
3403 | + $("#sppeachBubble").css("width", "510px"); | |
3404 | + } | |
3405 | + else { | |
3406 | + $("#sppeachBubble").css("width", ($scope.longestAnnotation.length) + "%"); | |
3407 | + } | |
3408 | + } | |
3409 | + } | |
3410 | + var Globe = []; | |
3411 | + Globe.push({ currentX: x, currentY: y }); | |
3412 | + document.getElementById('dot').style.display = 'block'; | |
3413 | + document.getElementById('dot').style.left = ((Globe[0].currentX) - 10) + 'px'; | |
3414 | + document.getElementById('dot').style.top = ((Globe[0].currentY) + 10) + 'px'; | |
3415 | + document.getElementById('sppeachBubble').style.display = 'block'; | |
3416 | + document.getElementById('sppeachBubble').style.left = (Globe[0].currentX) + 'px'; | |
3417 | + document.getElementById('sppeachBubble').style.top = (Globe[0].currentY) + 'px'; | |
3418 | + | |
3419 | + | |
3420 | + | |
3421 | + } | |
3422 | + $scope.createSpeechBubbleBasedOnTransparencyWithCtrl = function (pointClicked_annotation, Exists_annotation, x, y, sub_id_annotation) { | |
3423 | + var sppechBubbleHTML_annotation = "<div id ='" + pointClicked_annotation + "' class='com_anno'><div style='z-index:59000;position:absolute;border-top:2px solid #000;transform:rotate(40deg);-moz-transform:rotate(40deg);-o-transform:rotate(40deg);-ms-transform:rotate(40deg);-webkit-transform:rotate(40deg);height:15px;width:35px;left:" + (x - 10) + "px;top:" + (y + 10) + "px;'' id='bubble" + $scope.j + "'></div><div data=" + $scope.j + " id=" + sub_id_annotation + " class='appendDragg_annotation' style='z-index:60000;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;left:" + x + "px;top:" + y + "px;'><div style='z-index:7000;position:absolute;right:-3px;top:-4px;color:#ffffff;cursor:pointer;'><img id=" + $scope.j + " class='dynCross_anno' style='width:18px' src=" + $rootScope.path + "></div></div><div style='position:absolute;border:1px solid #000;display:none;z-index:59000;' id='bord_annotation" + $scope.j + "'></div></div>"; | |
3424 | + if ($scope.longest_annotationT1.length > $scope.longest_annotationT2.length) { | |
3425 | + if (Exists_annotation == 0) { | |
3426 | + $("#canvasDiv").append(sppechBubbleHTML_annotation); | |
3427 | + for (var l = 0; l <= $scope.annotationTextArrayT1.length - 1; l++) { | |
3428 | + var MultipleLang_annotation_T1 = $scope.annotationTextArrayT1[l]; | |
3429 | + $("#" + sub_id_annotation).append("<p style='margin-bottom:2px;'>" + MultipleLang_annotation_T1 + "</p>"); | |
3430 | + } | |
3431 | + $("#" + sub_id_annotation).append("<p style='border-bottom:1px solid black;margin-bottom:0;'></p>"); | |
3432 | + for (var k = 0; k <= $scope.annotationTextArrayT2.length - 1; k++) { | |
3433 | + var MultipleLang_annotation_T2 = $scope.annotationTextArrayT2[k]; | |
3434 | + $("#" + sub_id_annotation).append("<p style='margin-bottom:2px;'>" + MultipleLang_annotation_T2 + "</p>"); | |
3435 | + } | |
3436 | + if ($scope.longest_annotationT1.length <= 10) { | |
3437 | + $("#" + sub_id_annotation).css("width", "100px"); | |
3438 | + } | |
3439 | + else if ($scope.longest_annotationT1.length > 10 && $scope.longest_annotationT1.length <= 17) { | |
3440 | + $("#" + sub_id_annotation).css("width", "140px"); | |
3441 | + } | |
3442 | + else if ($scope.longest_annotationT1.length > 17 && $scope.longest_annotationT1.length <= 26) { | |
3443 | + $("#" + sub_id_annotation).css("width", "195px"); | |
3444 | + } | |
3445 | + else if ($scope.longest_annotationT1.length > 26 && $scope.longest_annotationT1.length <= 34) { | |
3446 | + $("#" + sub_id_annotation).css("width", "248px"); | |
3447 | + } | |
3448 | + else if ($scope.longest_annotationT1.length > 34 && $scope.longest_annotationT1.length <= 44) { | |
3449 | + $("#" + sub_id_annotation).css("width", "300px"); | |
3450 | + } | |
3451 | + else if ($scope.longest_annotationT1.length > 44 && $scope.longest_annotationT1.length <= 54) { | |
3452 | + $("#" + sub_id_annotation).css("width", "370px"); | |
3453 | + } | |
3454 | + else if ($scope.longest_annotationT1.length > 54 && $scope.longest_annotationT1.length <= 69) { | |
3455 | + $("#" + sub_id_annotation).css("width", "450px"); | |
3456 | + } | |
3457 | + else if ($scope.longest_annotationT1.length > 69 && $scope.longest_annotationT1.length <= 75) { | |
3458 | + $("#" + sub_id_annotation).css("width", "510px"); | |
3459 | + } | |
3460 | + else { | |
3461 | + $("#" + sub_id_annotation).css("width", ($scope.longest_annotationT1.length) + "%"); | |
3462 | + } | |
3463 | + } | |
3464 | + else { | |
3465 | + $("#canvasDiv").find("div[id=" + pointClicked_annotation + "]").css("display", "block"); | |
3466 | + } | |
3467 | + } | |
3468 | + else { | |
3469 | + if (Exists_annotation == 0) { | |
3470 | + $("#canvasDiv").append(sppechBubbleHTML_annotation); | |
3471 | + for (var l = 0; l <= $scope.annotationTextArrayT1.length - 1; l++) { | |
3472 | + var MultipleLang_annotation_T1 = $scope.annotationTextArrayT1[l]; | |
3473 | + $("#" + sub_id_annotation).append("<p style='margin-bottom:2px;'>" + MultipleLang_annotation_T1 + "</p>"); | |
3474 | + } | |
3475 | + | |
3476 | + $("#" + sub_id_annotation).append("<p style='border-bottom:1px dotted white;margin-bottom:0;'></p>"); | |
3477 | + for (var k = 0; k <= $scope.annotationTextArrayT2.length - 1; k++) { | |
3478 | + var MultipleLang_annotation_T2 = $scope.annotationTextArrayT2[k]; | |
3479 | + $("#" + sub_id_annotation).append("<p style='margin-bottom:2px;'>" + MultipleLang_annotation_T2 + "</p>"); | |
3480 | + } | |
3481 | + if ($scope.longest_annotationT2.length <= 10) { | |
3482 | + $("#" + sub_id_annotation).css("width", "100px"); | |
3483 | + } | |
3484 | + else if ($scope.longest_annotationT2.length > 10 && $scope.longest_annotationT2.length <= 17) { | |
3485 | + $("#" + sub_id_annotation).css("width", "140px"); | |
3486 | + } | |
3487 | + else if ($scope.longest_annotationT2.length > 17 && $scope.longest_annotationT2.length <= 26) { | |
3488 | + $("#" + sub_id_annotation).css("width", "195px"); | |
3489 | + } | |
3490 | + else if ($scope.longest_annotationT2.length > 26 && $scope.longest_annotationT2.length <= 34) { | |
3491 | + $("#" + sub_id_annotation).css("width", "248px"); | |
3492 | + } | |
3493 | + else if ($scope.longest_annotationT2.length > 34 && $scope.longest_annotationT2.length <= 44) { | |
3494 | + $("#" + sub_id_annotation).css("width", "300px"); | |
3495 | + } | |
3496 | + else if ($scope.longest_annotationT2.length > 44 && $scope.longest_annotationT2.length <= 54) { | |
3497 | + $("#" + sub_id_annotation).css("width", "370px"); | |
3498 | + } | |
3499 | + else if ($scope.longest_annotationT2.length > 54 && $scope.longest_annotationT2.length <= 69) { | |
3500 | + $("#" + sub_id_annotation).css("width", "450px"); | |
3501 | + } | |
3502 | + else if ($scope.longest_annotationT2.length > 69 && $scope.longest_annotationT2.length <= 75) { | |
3503 | + $("#" + sub_id_annotation).css("width", "510px"); | |
3504 | + } | |
3505 | + else { | |
3506 | + $("#" + sub_id_annotation).css("width", ($scope.longest_annotationT2.length) + "%"); | |
3507 | + } | |
3508 | + } | |
3509 | + else { | |
3510 | + $("#canvasDiv").find("div[id=" + pointClicked_annotation + "]").css("display", "block"); | |
3511 | + } | |
3512 | + } | |
3513 | + } | |
3514 | + $scope.createSpeechBubbleBasedOnTransparencyWithoutCtrl = function (x, y) { | |
3515 | + | |
3516 | + var sppechBubbleDotHTML_annotation = '<div id="dot_annotation" style="position:absolute;height:15px;width:35px;display:none;z-index:59000;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>' | |
3517 | + + '<div id="sppeachBubble_annotation" style="height:auto!important;z-index:60000;margin-left:25px;border:1px solid #000;display:none;padding:5px 10px;position:absolute;color:#fff;text-align:left;font-size:12px;background-color:#19100e;font-weight:bold;border-radius:5px;-moz-border-radius:5px;-webkit-border-radius:5px;-o-border-radius:5px;-ms-border-radius:5px;font-weight:bold;">' | |
3518 | + + '<span style="position:absolute;right:-3px;top:-4px;color:#ffffff;cursor:pointer;">' | |
3519 | + + '<img class="crossDiv_temp_annotation" style="width:18px" src=' + $rootScope.path + '></span></div>' | |
3520 | + | |
3521 | + + '<div style="position:absolute;border:1px solid #000;display:none;z-index:59000;" id="bord_annotation">' | |
3522 | + + '</div>'; | |
3523 | + if ($scope.longest_annotationT1.length > $scope.longest_annotationT2.length) { | |
3524 | + $("#sppeachBubble_annotation p").remove(); | |
3525 | + $('#canvasDiv').append(sppechBubbleDotHTML_annotation); | |
3526 | + for (var l = 0; l <= $scope.annotationTextArrayT1.length - 1; l++) { | |
3527 | + var MultipleLang_annotation_T1 = $scope.annotationTextArrayT1[l]; | |
3528 | + $("#sppeachBubble_annotation").append("<p style='margin-bottom:2px;'>" + MultipleLang_annotation_T1 + "</p>"); | |
3529 | + } | |
3530 | + $("#sppeachBubble_annotation").append("<p style='border-bottom:1px dotted white;margin-bottom:0;'></p>"); | |
3531 | + for (var k = 0; k <= $scope.annotationTextArrayT2.length - 1; k++) { | |
3532 | + var MultipleLang_annotation_T2 = $scope.annotationTextArrayT2[k]; | |
3533 | + $("#sppeachBubble_annotation").append("<p style='margin-bottom:2px;'>" + MultipleLang_annotation_T2 + "</p>"); | |
3534 | + } | |
3535 | + if ($scope.longest_annotationT1.length <= 10) { | |
3536 | + $("#sppeachBubble_annotation").css("width", "100px"); | |
3537 | + } | |
3538 | + else if ($scope.longest_annotationT1.length > 10 && $scope.longest_annotationT1.length <= 17) { | |
3539 | + $("#sppeachBubble_annotation").css("width", "140px"); | |
3540 | + } | |
3541 | + else if ($scope.longest_annotationT1.length > 17 && $scope.longest_annotationT1.length <= 26) { | |
3542 | + $("#sppeachBubble_annotation").css("width", "195px"); | |
3543 | + } | |
3544 | + else if ($scope.longest_annotationT1.length > 26 && $scope.longest_annotationT1.length <= 34) { | |
3545 | + $("#sppeachBubble_annotation").css("width", "248px"); | |
3546 | + } | |
3547 | + else if ($scope.longest_annotationT1.length > 34 && $scope.longest_annotationT1.length <= 44) { | |
3548 | + $("#sppeachBubble_annotation").css("width", "300px"); | |
3549 | + } | |
3550 | + else if ($scope.longest_annotationT1.length > 44 && $scope.longest_annotationT1.length <= 54) { | |
3551 | + $("#sppeachBubble_annotation").css("width", "370px"); | |
3552 | + } | |
3553 | + else if ($scope.longest_annotationT1.length > 54 && $scope.longest_annotationT1.length <= 69) { | |
3554 | + $("#sppeachBubble_annotation").css("width", "450px"); | |
3555 | + } | |
3556 | + else if ($scope.longest_annotationT1.length > 69 && $scope.longest_annotationT1.length <= 75) { | |
3557 | + $("#sppeachBubble_annotation").css("width", "510px"); | |
3558 | + } | |
3559 | + else { | |
3560 | + $("#sppeachBubble_annotation").css("width", ($scope.longest_annotationT1.length) + "%"); | |
3561 | + } | |
3562 | + } | |
3563 | + else { | |
3564 | + $("#sppeachBubble_annotation p").remove(); | |
3565 | + $('#canvasDiv').append(sppechBubbleDotHTML_annotation); | |
3566 | + for (var l = 0; l <= $scope.annotationTextArrayT1.length - 1; l++) { | |
3567 | + var MultipleLang_annotation_T1 = $scope.annotationTextArrayT1[l]; | |
3568 | + $("#sppeachBubble_annotation").append("<p style='margin-bottom:2px;'>" + MultipleLang_annotation_T1 + "</p>"); | |
3569 | + } | |
3570 | + $("#sppeachBubble_annotation").append("<p style='border-bottom:1px dotted white;margin-bottom:0;'></p>"); | |
3571 | + for (var k = 0; k <= $scope.annotationTextArrayT2.length - 1; k++) { | |
3572 | + var MultipleLang_annotation_T2 = $scope.annotationTextArrayT2[k]; | |
3573 | + $("#sppeachBubble_annotation").append("<p style='margin-bottom:2px;'>" + MultipleLang_annotation_T2 + "</p>"); | |
3574 | + } | |
3575 | + if ($scope.longest_annotationT2.length <= 10) { | |
3576 | + $("#sppeachBubble_annotation").css("width", "100px"); | |
3577 | + } | |
3578 | + else if ($scope.longest_annotationT2.length > 10 && $scope.longest_annotationT2.length <= 17) { | |
3579 | + $("#sppeachBubble_annotation").css("width", "140px"); | |
3580 | + } | |
3581 | + else if ($scope.longest_annotationT2.length > 17 && $scope.longest_annotationT2.length <= 26) { | |
3582 | + $("#sppeachBubble_annotation").css("width", "195px"); | |
3583 | + } | |
3584 | + else if ($scope.longest_annotationT2.length > 26 && $scope.longest_annotationT2.length <= 34) { | |
3585 | + $("#sppeachBubble_annotation").css("width", "248px"); | |
3586 | + } | |
3587 | + else if ($scope.longest_annotationT2.length > 34 && $scope.longest_annotationT2.length <= 44) { | |
3588 | + $("#sppeachBubble_annotation").css("width", "300px"); | |
3589 | + } | |
3590 | + else if ($scope.longest_annotationT2.length > 44 && $scope.longest_annotationT2.length <= 54) { | |
3591 | + $("#sppeachBubble_annotation").css("width", "370px"); | |
3592 | + } | |
3593 | + else if ($scope.longest_annotationT2.length > 54 && $scope.longest_annotationT2.length <= 69) { | |
3594 | + $("#sppeachBubble_annotation").css("width", "450px"); | |
3595 | + } | |
3596 | + else if ($scope.longest_annotationT2.length > 69 && $scope.longest_annotationT2.length <= 75) { | |
3597 | + $("#sppeachBubble_annotation").css("width", "510px"); | |
3598 | + } | |
3599 | + else { | |
3600 | + $("#sppeachBubble_annotation").css("width", ($scope.longest_annotationT2.length) + "%"); | |
3601 | + } | |
3602 | + } | |
3603 | + var Globe = []; | |
3604 | + Globe.push({ currentX: x, currentY: y }); | |
3605 | + document.getElementById('dot_annotation').style.display = 'block'; | |
3606 | + document.getElementById('dot_annotation').style.left = ((Globe[0].currentX) - 10) + 'px'; | |
3607 | + document.getElementById('dot_annotation').style.top = ((Globe[0].currentY) + 10) + 'px'; | |
3608 | + document.getElementById('sppeachBubble_annotation').style.display = 'block'; | |
3609 | + document.getElementById('sppeachBubble_annotation').style.left = (Globe[0].currentX) + 'px'; | |
3610 | + document.getElementById('sppeachBubble_annotation').style.top = (Globe[0].currentY) + 'px'; | |
3611 | + | |
3612 | + } | |
3886 | 3613 | |
3887 | 3614 | $scope.angle1 = function (cx1, cy1, ex1, ey1, id, id2) { |
3888 | 3615 | ... | ... |