Commit 3dfccf1f1d22b5b23bb227b8a910c1e4824e4b50

Authored by Birendra
1 parent 855166ba

added modal popup for all aia error

400-SOURCECODE/AIAHTML5.Web/app/controllers/CAController.js
... ... @@ -658,7 +658,6 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
658 658  
659 659 $rootScope.disableAnnotationTBFn();
660 660 $rootScope.MenuModuleName = "CA";
661   - //alert($rootScope.MenuModuleName);
662 661 $rootScope.currentBodyViewId = $event.currentTarget.id;
663 662 if ($event.currentTarget.textContent !== null && typeof ($event.currentTarget.textContent) !== "undefined") {
664 663 var selectedTileData = [];
... ...
400-SOURCECODE/AIAHTML5.Web/app/controllers/CurrBuildController.js
... ... @@ -20,9 +20,7 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $
20 20 $scope.scroll();
21 21 }
22 22 $scope.scroll = function () {
23   - // $window.scrollTo(0, 0);
24   - $("html,body").scrollTop(0);
25   - //alert("scroll");
  23 + $("html,body").scrollTop(0);
26 24 }
27 25  
28 26 $rootScope.closeEditorModel = function () {
... ... @@ -282,62 +280,112 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $
282 280  
283 281 $(fileupload).val('');//old file path
284 282 fileupload.onchange = function () {
285   -
  283 + var extension='';
286 284 var fileId, file, objFileRead;
287 285 if (typeof window.FileReader !== 'function') {
288   - alert("The file API isn't supported on this browser yet.");
  286 + $rootScope.errorMessage = "The file API isn't supported on this browser yet.";
  287 + $("#messageModal").modal('show');
289 288 return;
290 289 }
291 290 fileId = document.getElementById('openCBJsonFile');
292 291 if (!fileId) {
293   - alert("File couldn't find the element.");
  292 + $rootScope.errorMessage = "File couldn't find the element.";
  293 + $("#messageModal").modal('show');
294 294 }
295 295 else if (!fileId.files) {
296   - alert("This browser doesn't seem to support the `files` property of file inputs.");
  296 + $rootScope.errorMessage = "This browser doesn't seem to support the `files` property of file inputs.";
  297 + $("#messageModal").modal('show');
297 298 }
298 299 else if (!fileId.files[0]) {
299   - alert("Please select a file before clicking 'Load'");
  300 + $rootScope.errorMessage = "Please select a file before clicking 'Load'.";
  301 + $("#messageModal").modal('show');
300 302 }
301   - else {
  303 + else
  304 + {
302 305 file = fileId.files[0];
303   - var extension = file.name.split(".")[1];
304   - if (file.type == "application/json" && extension == "json") {
305   - $location.url('/curriculum-builder');
306   - $timeout(function () {
  306 + extension = file.name.split(".")[1];
  307 + if ((file.type == "application/json" && extension == "json")||extension == "sldshw") {
307 308 objFileRead = new FileReader();
308   - objFileRead.onload = receivedFile;
309   - objFileRead.readAsText(file);
310   - }, 300);
  309 + objFileRead.onload = ReceivedFile;
  310 + objFileRead.readAsText(file);
311 311 }
312 312 else
313 313 {
314   - alert("This Curriculum is not supported format!.Please try again");
  314 + $rootScope.errorMessage = "This Curriculum file is not supported! Please try again.";
  315 + $("#messageModal").modal('show');
315 316 }
316 317  
317 318 }
  319 + function ReceivedFile(file) {
  320 + if(extension == "json")
  321 + {
  322 + $location.url('/curriculum-builder');
  323 + var jsonData = JSON.parse(file.target.result);
  324 + $timeout(function () {
  325 + $scope.jsonReceivedFile(jsonData)
  326 + }, 300);
  327 +
  328 + }
  329 + else
  330 + {
  331 + // convert xml to json object
  332 + var x2js = new X2JS();
  333 + var curriculumobject = x2js.xml_str2json(file.target.result);
  334 + var isIncompatible= $scope.checkCompatibility(curriculumobject);
  335 + if(isIncompatible)
  336 + {
  337 + $("#btnConvertOpen").removeAttr("style");
  338 + $("#btnImportOpen").css({"display":"none"}) ;
  339 + $("#btnConvertDownLoad").css({"display":"none"}) ;
  340 + $rootScope.confirmMessage = "This curriculum is not completely converted to new format. Please contact ADAM or recreate it .\nDo you still want to open it?";
  341 + $timeout(function () {
  342 + $rootScope.newCurriculumObject=curriculumobject;
  343 + $("#cbMessageModal").modal('show');
  344 + }, 200);
  345 +
  346 + }
  347 + else
  348 + {
  349 + $location.url('/curriculum-builder');
  350 + $timeout(function () {
  351 + $rootScope.isnewcurriculum = true;
  352 + $scope.jsonReceivedFile(curriculumobject) ;
  353 + }, 300);
  354 + }
  355 +
  356 + }
  357 +
  358 + }
318 359  
319   - function receivedFile(e) {
320   - var jsonData = JSON.parse(e.target.result);
321   - localStorage.setItem("cbJsonDataObject", JSON.stringify(jsonData));
322   - $rootScope.cbJsonData = "";
323   - $rootScope.cbDynamicJsonData = "";
324   - $rootScope.cbJsonData = JSON.parse(e.target.result);
325   - $rootScope.cbDynamicJsonData = JSON.parse(e.target.result);
326   - $rootScope.cbTreeFirstLabel = $rootScope.cbJsonData.slideshow.presentation.structure._label;
327   - $rootScope.AutherName = "";
328   - $rootScope.summary = "";
  360 + };
329 361  
330   - $rootScope.getCBsummary();
331   -
332   - $rootScope.FileTitle = $rootScope.cbTreeFirstLabel;
  362 + }
  363 + $rootScope.ConvertOpen = function () {
  364 + $location.url('/curriculum-builder');
  365 + $timeout(function () {
  366 + $rootScope.isnewcurriculum = true;
  367 + $scope.jsonReceivedFile($rootScope.newCurriculumObject) ;
  368 + }, 300);
  369 + }
  370 +
  371 + $scope.jsonReceivedFile = function (jsonData) {
  372 + localStorage.setItem("cbJsonDataObject", JSON.stringify(jsonData));
  373 + $rootScope.cbJsonData = "";
  374 + $rootScope.cbDynamicJsonData = "";
  375 + $rootScope.cbJsonData = jsonData;
  376 + $rootScope.cbDynamicJsonData = jsonData;
  377 + $rootScope.cbTreeFirstLabel = $rootScope.cbJsonData.slideshow.presentation.structure._label;
  378 + $rootScope.AutherName = "";
  379 + $rootScope.summary = "";
333 380  
334   - $timeout(function () {
335   - $('#modal-CurBuilder').css("display", "block");
336   - $("#CurBuilderbackground").css("display", "block");
337   - }, 200);
  381 + $rootScope.getCBsummary();
  382 +
  383 + $rootScope.FileTitle = $rootScope.cbTreeFirstLabel;
338 384  
339   - }
340   - };
  385 + $timeout(function () {
  386 + $('#modal-CurBuilder').css("display", "block");
  387 + $("#CurBuilderbackground").css("display", "block");
  388 + }, 200);
341 389  
342 390 }
343 391  
... ... @@ -385,20 +433,25 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $
385 433 var myfileName='';
386 434 var fileId, file, objFileRead;
387 435 if (typeof window.FileReader !== 'function') {
388   - alert("The file API isn't supported on this browser yet.");
  436 + $rootScope.errorMessage = "The file API isn't supported on this browser yet.";
  437 + $("#messageModal").modal('show');
389 438 return;
390 439 }
391 440 fileId = document.getElementById('xmltojsonfile');
392 441 if (!fileId) {
393   - alert("File couldn't find the element.");
  442 + $rootScope.errorMessage = "File couldn't find the element.";
  443 + $("#messageModal").modal('show');
394 444 }
395 445 else if (!fileId.files) {
396   - alert("This browser doesn't seem to support the `files` property of file inputs.");
  446 + $rootScope.errorMessage = "This browser doesn't seem to support the `files` property of file inputs.";
  447 + $("#messageModal").modal('show');
397 448 }
398 449 else if (!fileId.files[0]) {
399   - alert("Please select a file before clicking 'Load'");
  450 + $rootScope.errorMessage = "Please select a file before clicking 'Load'.";
  451 + $("#messageModal").modal('show');
400 452 }
401   - else {
  453 + else
  454 + {
402 455 file = fileId.files[0];
403 456 myfileName=file.name.split(".")[0];
404 457 var extension = file.name.split(".")[1];
... ... @@ -408,39 +461,97 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $
408 461 objFileRead.onload = convertfile;
409 462 objFileRead.readAsText(file);
410 463 }, 300);
411   - } else {
412   - alert("Selected file is not in valid format!");
  464 + }
  465 + else
  466 + {
  467 + $rootScope.errorMessage = "This Curriculum file is not supported! Please try again.";
  468 + $("#messageModal").modal('show');
413 469 }
414 470  
415 471 }
416 472  
417   - function convertfile(e) {
  473 + function convertfile(file) {
418 474 var x2js = new X2JS();
419   - var curriculumobject = x2js.xml_str2json(e.target.result);
420   -
421   - //add extension
422   - myfileName += '.json';
423   -
424   - var blob = new Blob([angular.toJson(curriculumobject, true)], { type: 'text/json' });
425   -
426   - if (window.navigator && window.navigator.msSaveOrOpenBlob) {
427   - window.navigator.msSaveOrOpenBlob(blob, myfileName);
  475 + var curriculumobject = x2js.xml_str2json(file.target.result);
  476 + var isIncompatible= $scope.checkCompatibility(curriculumobject);
  477 + if(isIncompatible)
  478 + {
  479 + $("#btnConvertDownLoad").removeAttr("style");
  480 + $("#btnImportOpen").css({"display":"none"}) ;
  481 + $("#btnConvertOpen").css({"display":"none"}) ;
  482 + $rootScope.newCurriculumObject=curriculumobject;
  483 + $rootScope.convertedfileName=myfileName;
  484 + $rootScope.confirmMessage = "This curriculum is not completely converted to new format. Please contact ADAM or recreate it .\nDo you still want to save in new format?";
  485 + $timeout(function () {
  486 + $("#cbMessageModal").modal('show');
  487 + }, 200);
428 488 }
429   - else {
430   - document.execCommand("SaveAs", true, myfileName);
431   -
432   - var event = document.createEvent('MouseEvents'),
433   - saveElement = document.createElement('a');
434   - saveElement.download = myfileName;
435   - saveElement.href = window.URL.createObjectURL(blob);
436   - saveElement.dataset.downloadurl = ['text/json', saveElement.download, saveElement.href].join(':');
437   - event.initEvent('click', true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
438   - saveElement.dispatchEvent(event);
439   -
  489 + else
  490 + {
  491 + $scope.convertDownLoad(curriculumobject,myfileName);
440 492 }
441 493  
442 494 }
  495 +
  496 + }
  497 + }
  498 + $rootScope.ConvertSave = function () {
  499 +
  500 + $scope.convertDownLoad($rootScope.newCurriculumObject, $rootScope.convertedfileName);
  501 + }
  502 +
  503 + $scope.convertDownLoad = function (curriculumobject,myfileName) {
  504 + var blob = new Blob([angular.toJson(curriculumobject, true)], { type: 'text/json' });
  505 +
  506 + if (window.navigator && window.navigator.msSaveOrOpenBlob) {
  507 + window.navigator.msSaveOrOpenBlob(blob, myfileName);
  508 + }
  509 + else
  510 + {
  511 + document.execCommand("SaveAs", true, myfileName);
  512 +
  513 + var event = document.createEvent('MouseEvents'),
  514 + saveElement = document.createElement('a');
  515 + saveElement.download = myfileName;
  516 + saveElement.href = window.URL.createObjectURL(blob);
  517 + saveElement.dataset.downloadurl = ['text/json', saveElement.download, saveElement.href].join(':');
  518 + event.initEvent('click', true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
  519 + saveElement.dispatchEvent(event);
  520 +
  521 + }
  522 +
  523 + }
  524 + $scope.checkCompatibility = function (curriculumobject) {
  525 + var isIncompatible=false;
  526 + var cbcontent = curriculumobject.slideshow.content.element;
  527 + for (var i = 0; i < cbcontent.length; i++) {
  528 + var windowsData = cbcontent[i].windows;
  529 + if(windowsData=="")continue
  530 + var allwindowData = windowsData.window;
  531 + if(!Array.isArray(allwindowData))
  532 + {
  533 + allwindowData=[];
  534 + allwindowData.push(windowsData.window);
  535 + }
  536 + if (allwindowData != undefined) {
  537 + for (var j = 0; j < allwindowData.length; j++) {
  538 + windowData = JSON.parse(allwindowData[j]);
  539 + var annotation= windowData.annotationData;
  540 + if(annotation!="" && annotation!=undefined)
  541 + {
  542 + var shapeStates = 'shapeStates';
  543 + var paintCanvasState = 'paintCanvasState';
  544 + if (!annotation.hasOwnProperty(shapeStates) || !annotation.hasOwnProperty(paintCanvasState))
  545 + {
  546 + isIncompatible=true;
  547 + }
  548 +
  549 + }
  550 + }
  551 + }
  552 +
443 553 }
  554 + return isIncompatible;
444 555 }
445 556  
446 557 $rootScope.CreateNewCurriculum = function () {
... ... @@ -1107,7 +1218,8 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $
1107 1218  
1108 1219 if (password.trim() == "")
1109 1220 {
1110   - alert("Password field is empty.please try again!");
  1221 + $rootScope.errorMessage = "Password field is empty.please try again!";
  1222 + $("#messageModal").modal('show');
1111 1223 return;
1112 1224 }
1113 1225  
... ... @@ -1117,12 +1229,12 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $
1117 1229 traverseTreeSelectedSingleObj($rootScope.structureObjForSaveCB, nodeid);
1118 1230 if ($scope.selectedNodeSingleObj._isBranch == "false") {
1119 1231 if (password != $scope.selectedNodeSingleObj._password) {
1120   - alert("Password is not matched.please try again!");
  1232 + $rootScope.errorMessage = "Password is not matched.please try again!";
  1233 + $("#messageModal").modal('show');
1121 1234 return false;
1122 1235 }
1123 1236 else
1124 1237 {
1125   - alert("Slide successfully unlocked.");
1126 1238 $scope.selectedNodeSingleObj._password = "";
1127 1239 $scope.selectedNodeSingleObj._isLocked = "false";
1128 1240 $scope.isSlideLock="false";
... ... @@ -1307,47 +1419,85 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $
1307 1419  
1308 1420 $(fileupload).val('');//old file path
1309 1421 fileupload.onchange = function () {
1310   -
  1422 + var extension='';
1311 1423 var fileId, file, objFileRead;
1312 1424 if (typeof window.FileReader !== 'function') {
1313   - alert("The file API isn't supported on this browser yet.");
  1425 + $rootScope.errorMessage = "The file API isn't supported on this browser yet.";
  1426 + $("#messageModal").modal('show');
1314 1427 return;
1315 1428 }
1316 1429 fileId = document.getElementById('openCBJsonFile');
1317 1430 if (!fileId) {
1318   - alert("File couldn't find the element.");
  1431 + $rootScope.errorMessage = "File couldn't find the element.";
  1432 + $("#messageModal").modal('show');
1319 1433 }
1320 1434 else if (!fileId.files) {
1321   - alert("This browser doesn't seem to support the `files` property of file inputs.");
  1435 + $rootScope.errorMessage = "This browser doesn't seem to support the `files` property of file inputs.";
  1436 + $("#messageModal").modal('show');
1322 1437 }
1323 1438 else if (!fileId.files[0]) {
1324   - alert("Please select a file before clicking 'Load'");
  1439 + $rootScope.errorMessage = "Please select a file before clicking 'Load'.";
  1440 + $("#messageModal").modal('show');
1325 1441 }
1326 1442 else {
1327 1443 file = fileId.files[0];
1328   - var extension = file.name.split(".")[1];
1329   - if (file.type == "application/json" && extension == "json") {
  1444 + extension = file.name.split(".")[1];
  1445 + if ((file.type == "application/json" && extension == "json")||extension == "sldshw") {
1330 1446 $timeout(function () {
1331 1447 objFileRead = new FileReader();
1332 1448 objFileRead.onload = CbFileData;
1333   - objFileRead.readAsText(file);
  1449 + objFileRead.readAsText(file,extension);
1334 1450 }, 300);
1335   - } else {
1336   - alert("This Curriculum not in supported format");
  1451 + }
  1452 + else
  1453 + {
  1454 + $rootScope.errorMessage = "This Curriculum file is not supported! Please try again.";
  1455 + $("#messageModal").modal('show');
  1456 +
1337 1457 }
1338 1458  
1339 1459 }
1340 1460  
1341   - function CbFileData(e) {
1342   - //$scope.CBEnableUI();
1343   - var importdata = JSON.parse(e.target.result);
1344   - $rootScope.ImportCurriculum(importdata);
  1461 + function CbFileData(file) {
  1462 + if(extension == "json")
  1463 + { var importdata = JSON.parse(file.target.result);
  1464 + $rootScope.ImportCurriculum(importdata);
  1465 + }
  1466 + else
  1467 + {
  1468 + // convert xml to json object
  1469 + var x2js = new X2JS();
  1470 + var curriculumobject = x2js.xml_str2json(file.target.result);
  1471 + var isIncompatible= $scope.checkCompatibility(curriculumobject);
  1472 + if(isIncompatible)
  1473 + {
  1474 + $("#btnImportOpen").removeAttr("style");
  1475 + $("#btnConvertDownLoad").css({"display":"none"}) ;
  1476 + $("#btnConvertOpen").css({"display":"none"}) ;
  1477 + $rootScope.newCurriculumObject=curriculumobject;
  1478 + $rootScope.confirmMessage = "This curriculum is not completely converted to new format. Please contact ADAM or recreate it .\nDo you still want to import it?";
  1479 + $timeout(function () {
  1480 + $("#cbMessageModal").modal('show');
  1481 + }, 200);
  1482 + }
  1483 + else
  1484 + {
  1485 + $rootScope.isnewcurriculum = true;
  1486 + $rootScope.ImportCurriculum(curriculumobject);
  1487 + }
  1488 +
  1489 + }
1345 1490  
1346 1491 }
  1492 +
1347 1493 };
1348 1494  
1349 1495 }
1350   -
  1496 + $rootScope.importOpen = function () {
  1497 + $rootScope.isnewcurriculum = true;
  1498 + $rootScope.ImportCurriculum($rootScope.newCurriculumObject);
  1499 + }
  1500 +
1351 1501 $rootScope.ImportCurriculum = function (importdata) {
1352 1502 var cbCurrentId = document.getElementById('cbSelect').value;
1353 1503 if ($rootScope.structureObjForSaveCB.length == 0) {
... ... @@ -1449,7 +1599,8 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $
1449 1599 var strFromParent=$scope.selectedNodeSingleObj['structure'];
1450 1600 if(strFromParent.length<=0)
1451 1601 {
1452   - alert("Add slide in this section to export this curriculum");
  1602 + $rootScope.errorMessage = "Please add slide first to export this section.";
  1603 + $("#messageModal").modal('show');
1453 1604 return;
1454 1605 }
1455 1606 $("#filename").val("");
... ... @@ -1464,7 +1615,8 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $
1464 1615 var filename = document.getElementById("filename").value;
1465 1616 if (filename == "" ||filename == " ")
1466 1617 {
1467   - alert("Curriculum name is empty!");
  1618 + $rootScope.errorMessage = "Curriculum name is empty!";
  1619 + $("#messageModal").modal('show');
1468 1620 return;
1469 1621 }
1470 1622 $scope.CBDisableUI();
... ... @@ -1582,7 +1734,6 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $
1582 1734 $('#uploading-curriculum').css("display", "none");
1583 1735 $("#filename").val("");
1584 1736 $rootScope.errorMessage = AIAConstants.SAVE_ANIMATION_ERROR+"\n"+error.ExceptionMessage;;
1585   - $("#messageModal").css('zIndex', 80000000000);
1586 1737 $("#messageModal").modal('show');
1587 1738 },
1588 1739 function(progress){
... ... @@ -1603,12 +1754,12 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $
1603 1754 filename += '.json';
1604 1755 if(downloadtype=="exportcb")
1605 1756 {
1606   - var blob = new Blob([angular.toJson($rootScope.dynamicUpdatedJsonForExportCB, true)], { type: 'text/text' });
  1757 + var blob = new Blob([angular.toJson($rootScope.dynamicUpdatedJsonForExportCB, true)], { type: 'text/json' });
1607 1758 }
1608 1759 else
1609 1760 {
1610 1761 $rootScope.UnsaveCurriculum = false;
1611   - var blob = new Blob([angular.toJson($rootScope.dynamicUpdatedJsonForSaveCB, true)], { type: 'text/text' });
  1762 + var blob = new Blob([angular.toJson($rootScope.dynamicUpdatedJsonForSaveCB, true)], { type: 'text/json' });
1612 1763 }
1613 1764  
1614 1765 if (window.navigator && window.navigator.msSaveOrOpenBlob) {
... ... @@ -2007,7 +2158,6 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $
2007 2158 .delete().at("_id == " + currentid).select();
2008 2159 $rootScope.contentNotesForSaveCB = remaingNotesForCB;
2009 2160  
2010   - //alert("After" + JSON.stringify($rootScope.stru));
2011 2161 console.log($rootScope.structureObjForSaveCB);
2012 2162 console.log($rootScope.contentNotesForSaveCB);
2013 2163 }
... ... @@ -2052,7 +2202,8 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $
2052 2202 var filename = document.getElementById("filename").value;
2053 2203 if (filename == "" ||filename == " ")
2054 2204 {
2055   - alert("Curriculum name is empty!");
  2205 + $rootScope.errorMessage = "Curriculum name is empty!";
  2206 + $("#messageModal").modal('show');
2056 2207 return;
2057 2208 }
2058 2209 $scope.CBDisableUI();
... ... @@ -2238,7 +2389,6 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $
2238 2389 .from(content)
2239 2390 .where("_id == " + id)
2240 2391 .select();
2241   - // console.log('contenctForSelectedSlide' + contenctForSelectedSlide[0].notes)
2242 2392 var windowsInSelectedSlide = contenctForSelectedSlide[0].windows;
2243 2393  
2244 2394 var allwindowData = windowsInSelectedSlide.window;
... ... @@ -2270,7 +2420,9 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $
2270 2420 var paintCanvasState = 'paintCanvasState';
2271 2421 if (!annotation.hasOwnProperty(shapeStates) || !annotation.hasOwnProperty(paintCanvasState))
2272 2422 {
2273   - alert('This slide has old annotations.Please use Annotation Tool to draw annotations again.')
  2423 + $rootScope.UnsaveCurriculum = true;
  2424 + $rootScope.errorMessage = 'This slide has some legacy version annotations and also not compatible with new format. Please contact ADAM or recreate it.';
  2425 + $("#messageModal").modal('show');
2274 2426 windowData.annotationData="";
2275 2427 }
2276 2428  
... ...
400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
... ... @@ -248,7 +248,6 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
248 248 $scope.scroll = function () {
249 249 // $window.scrollTo(0, 0);
250 250 $("html,body").scrollTop(0);
251   - //alert("scroll");
252 251 }
253 252  
254 253 $scope.setActiveview=function(windowviewid,viewtypename) {
... ... @@ -1339,7 +1338,6 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
1339 1338 // }
1340 1339 // ,
1341 1340 stop: function (event, ui) {
1342   - //alert('trans changed')
1343 1341 var targetid = event.target.id;
1344 1342 var len= (targetid).split("_").length;
1345 1343 var windviewid = (targetid).split("_")[len-1];
... ... @@ -1721,7 +1719,8 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
1721 1719 }
1722 1720  
1723 1721 bodyViewWorker.onerror = function (e) {
1724   - alert('Error: Line ' + e.lineno + ' in ' + e.filename + ': ' + e.message);
  1722 + $rootScope.message = 'Error: Line ' + e.lineno + ' in ' + e.filename + ': ' + e.message;
  1723 + $("#daMessageModal").modal('show');
1725 1724 };
1726 1725 }
1727 1726  
... ... @@ -2921,13 +2920,10 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
2921 2920  
2922 2921 FlipedImgCanvas.addEventListener('mousedown', function (evt) {
2923 2922  
2924   - //alert('mousedown')
2925 2923 }, false);
2926 2924  
2927 2925  
2928 2926 FlipedImgCanvas.addEventListener('mouseup', function (evt) {
2929   - //alert('mouseup')
2930   -
2931 2927  
2932 2928 }, false);
2933 2929  
... ... @@ -3208,7 +3204,6 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
3208 3204 var maskCanvasContext = maskCanvas.getContext("2d");
3209 3205  
3210 3206 var mousePos = $scope.getMousePos(evt.pageX,evt.pageY,windowviewid);
3211   - // alert(mousePos.x + ',' + mousePos.y);
3212 3207  
3213 3208 var canvasDiv = document.getElementById('canvasDivDA_' + windowviewid);
3214 3209 //changing for mac os now
... ... @@ -3990,7 +3985,8 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
3990 3985  
3991 3986 };
3992 3987 worker.onerror = function (e) {
3993   - alert('Error: Line ' + e.lineno + ' in ' + e.filename + ': ' + e.message);
  3988 + $rootScope.message = 'Error: Line ' + e.lineno + ' in ' + e.filename + ': ' + e.message;
  3989 + $("#daMessageModal").modal('show');
3994 3990 };
3995 3991 }
3996 3992 }
... ... @@ -4282,7 +4278,8 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
4282 4278 }
4283 4279 };
4284 4280 worker.onerror = function (e) {
4285   - alert('Error: Line ' + e.lineno + ' in ' + e.filename + ': ' + e.message);
  4281 + $rootScope.message = 'Error: Line ' + e.lineno + ' in ' + e.filename + ': ' + e.message;
  4282 + $("#daMessageModal").modal('show');
4286 4283 };
4287 4284  
4288 4285 }
... ... @@ -6280,7 +6277,6 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
6280 6277 $scope.DrawTransparencyBox = function (windowviewid) {
6281 6278 var newDimes = null;
6282 6279 if ( $scope.GetwindowStoreData(windowviewid, 'isTransparencyActivated') && $scope.GetwindowStoreData(windowviewid, 'isZoomed') == true) {
6283   - // alert("ZOOM");
6284 6280 newDimes = $scope.scaleTransparencyBox(windowviewid);
6285 6281  
6286 6282 $scope.TransparencyBoxStartX = newDimes.scaledX1;
... ... @@ -8019,7 +8015,6 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
8019 8015 var tCanvasWidthAftrSplit = tCanvasWidth.split("p");
8020 8016 var tCanvasHeight = $(".ui-wrapper").css("height");
8021 8017 var tCanvasHeightAftrSplit = tCanvasHeight.split("p");
8022   - // alert("modesty");
8023 8018 var tCanvasTotalWidth = parseInt(tCanvasLeftAftrSplit[0]) + parseInt(tCanvasWidthAftrSplit[0]);
8024 8019 var tCanvasTotalHeight = parseInt(tCanvasTopAftrSplit[0]) + parseInt(tCanvasHeightAftrSplit[0]);
8025 8020 var mousePos = $scope.getMousePos(evt.pageX,evt.pageY,windowviewid);
... ... @@ -8628,7 +8623,6 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
8628 8623 }
8629 8624  
8630 8625 function positionTooltip(event, x, y) {
8631   - // alert('positionTooltip')
8632 8626 x = 100,
8633 8627 y = 200,
8634 8628  
... ... @@ -8651,7 +8645,6 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
8651 8645  
8652 8646  
8653 8647 function positionTooltip(event, x, y) {
8654   - // alert('positionTooltip')
8655 8648 x = 100,
8656 8649 y = 200,
8657 8650  
... ...
400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js
... ... @@ -3,10 +3,6 @@
3 3 AIA.controller("HomeController", ["$rootScope", "$scope", "Modules", "$log", "$location", "$compile", "$timeout", "DataService", "AuthenticationService", "ConfigurationService", "LoginConstants", "UserModules", "LoginMessageConstants", "AdminService", "$http", "AdminConstants", "UserTypeConstants", "AIAConstants","ModuleService","$window","Idle", "Keepalive",
4 4 function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, DataService, AuthenticationService, ConfigurationService, LoginConstants, UserModules, LoginMessageConstants, AdminService, $http, AdminConstants, UserTypeConstants, AIAConstants, ModuleService,$window,Idle, Keepalive) {
5 5  
6   - //$scope.pageToOpen = {
7   - // name: 'MainMenu'
8   - //};
9   -
10 6 $rootScope.MULTI_VIEW_ID = 401;
11 7 $rootScope.pageToOpen = 'app/widget/MainMenu.html';
12 8 $rootScope.currentBodyViewId;
... ... @@ -106,22 +102,27 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data
106 102 }, 300);
107 103  
108 104 $(fileupload).val('');//old file path
  105 +
109 106 fileupload.onchange = function (e) {
110 107  
111 108 var fileId, file, objFileRead;
112 109 if (typeof window.FileReader !== 'function') {
113   - alert("The file API isn't supported on this browser yet.");
  110 + $rootScope.errorMessage = "The file API isn't supported on this browser yet.";
  111 + $("#messageModal").modal('show');
114 112 return;
115 113 }
116 114 fileId = document.getElementById('myPictureFile');
117 115 if (!fileId) {
118   - alert("File couldn't find the element.");
  116 + $rootScope.errorMessage = "File couldn't find the element.";
  117 + $("#messageModal").modal('show');
119 118 }
120 119 else if (!fileId.files) {
121   - alert("This browser doesn't seem to support the `files` property of file inputs.");
  120 + $rootScope.errorMessage = "This browser doesn't seem to support the `files` property of file inputs.";
  121 + $("#messageModal").modal('show');
122 122 }
123 123 else if (!fileId.files[0]) {
124   - alert("Please select a file before clicking 'Load'");
  124 + $rootScope.errorMessage = "Please select a file before clicking 'Load'.";
  125 + $("#messageModal").modal('show');
125 126 }
126 127 else {
127 128 file = fileId.files[0];
... ... @@ -148,7 +149,8 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data
148 149 }
149 150 else
150 151 {
151   - alert("Please select a file format type jpg/jpeg or png");
  152 + $rootScope.errorMessage = "Please select a file format type jpg/jpeg or png.";
  153 + $("#messageModal").modal('show');
152 154 }
153 155  
154 156 }
... ... @@ -179,18 +181,22 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data
179 181  
180 182 var fileId, file, objFileRead;
181 183 if (typeof window.FileReader !== 'function') {
182   - alert("The file API isn't supported on this browser yet.");
  184 + $rootScope.errorMessage = "The file API isn't supported on this browser yet.";
  185 + $("#messageModal").modal('show');
183 186 return;
184 187 }
185 188 fileId = document.getElementById('myAnimationFile');
186 189 if (!fileId) {
187   - alert("File couldn't find the element.");
  190 + $rootScope.errorMessage = "File couldn't find the element.";
  191 + $("#messageModal").modal('show');
188 192 }
189 193 else if (!fileId.files) {
190   - alert("This browser doesn't seem to support the `files` property of file inputs.");
  194 + $rootScope.errorMessage = "This browser doesn't seem to support the `files` property of file inputs.";
  195 + $("#messageModal").modal('show');
191 196 }
192 197 else if (!fileId.files[0]) {
193   - alert("Please select a file before clicking 'Load'");
  198 + $rootScope.errorMessage = "Please select a file before clicking 'Load'.";
  199 + $("#messageModal").modal('show');
194 200 }
195 201 else {
196 202 file = fileId.files[0];
... ... @@ -218,12 +224,14 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data
218 224 }
219 225 else
220 226 {
221   - alert("This Animation video size not allow more than 10MB.Please try again");
  227 + $rootScope.errorMessage = "This Animation video size not allow more than 10MB.Please try again.";
  228 + $("#messageModal").modal('show');
222 229 }
223 230 }
224 231 else
225 232 {
226   - alert("This Animation video is not in supported format mp4.Please try again");
  233 + $rootScope.errorMessage = "This Animation video is not in supported format.Please try again.";
  234 + $("#messageModal").modal('show');
227 235 }
228 236  
229 237 }
... ... @@ -822,7 +830,6 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data
822 830 $rootScope.errorMessage = "";
823 831 if (userInfo.username == "" || userInfo.username == null || userInfo.username == undefined || userInfo.password == "" || userInfo.password == null || userInfo.password == undefined) {
824 832  
825   - // alert(LoginMessageConstants.USER_CREDENTIALS_MISSING);
826 833 $rootScope.errorMessage = LoginMessageConstants.USER_CREDENTIALS_MISSING;
827 834 $("#messageModal").modal('show');
828 835 }
... ... @@ -837,7 +844,6 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data
837 844 if (result == LoginConstants.USER_NOT_FOUND) {
838 845 $rootScope.LoginEnableUI();
839 846 $rootScope.isVisibleLogin = true;
840   - // alert(LoginMessageConstants.USER_OR_PASSWORD_INCORRECT);
841 847 $rootScope.errorMessage = LoginMessageConstants.INVALID_USER;
842 848 $("#messageModal").modal('show');
843 849 }
... ... @@ -1148,7 +1154,6 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data
1148 1154  
1149 1155 function (error) {
1150 1156 console.log(' Error in authentication = ' + error.statusText);
1151   - // alert(LoginMessageConstants.ERROR_IN_FECTHING_DETAILS);
1152 1157 $rootScope.LoginEnableUI();
1153 1158 $rootScope.isVisibleLogin = true;
1154 1159 $rootScope.errorMessage = error;
... ... @@ -1564,7 +1569,6 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data
1564 1569 function (error) {
1565 1570  
1566 1571 console.log(' Error in authentication = ' + error.statusText);
1567   - // alert(LoginMessageConstants.ERROR_IN_FECTHING_DETAILS);
1568 1572 $rootScope.LoginEnableUI();
1569 1573 $rootScope.isVisibleLogin = true;
1570 1574 $rootScope.errorMessage = error;
... ... @@ -1711,13 +1715,11 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data
1711 1715 $rootScope.$on('IdleStart', function() {
1712 1716 // this event fire when idle time finish and time out start
1713 1717 // config set in AIA.js -:IdleProvider.idle(1*30);;
1714   - //alert('start');
1715 1718 });
1716 1719 $rootScope.$on('IdleEnd', function() {
1717 1720 // this event fires by user activity during timeout period
1718 1721 // it reset idle time and timeout
1719 1722 // config set in AIA.js -:IdleProvider.interrupt('keydown wheel mousedown touchstart touchmove scroll');
1720   - // alert('end');
1721 1723 });
1722 1724 $rootScope.$on('IdleTimeout', function() {
1723 1725 // this event fire when idle time finished and time out also finished
... ... @@ -1849,13 +1851,11 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data
1849 1851 .then(function (result) {
1850 1852 if (result == LoginConstants.USER_NOT_FOUND) {
1851 1853 removeEmailPopUp();
1852   - // alert(LoginMessageConstants.INCORRECT_EMAIL_ID);
1853 1854 $rootScope.errorMessage = LoginMessageConstants.INCORRECT_EMAIL_ID;
1854 1855 $("#messageModal").modal('show');
1855 1856 }
1856 1857 else if (result == LoginConstants.MAIL_NOT_SENT) {
1857 1858 removeEmailPopUp();
1858   - // alert(LoginMessageConstants.MAIL_NOT_SENT);
1859 1859 $rootScope.errorMessage = LoginMessageConstants.MAIL_NOT_SENT;
1860 1860 $("#messageModal").modal('show');
1861 1861 }
... ... @@ -1872,7 +1872,6 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data
1872 1872 }
1873 1873 else
1874 1874 message = LoginMessageConstants.USERID_SENT_IN_EMAIL
1875   - //alert(message);
1876 1875 $rootScope.errorMessage = message;
1877 1876 $("#messageModal").modal('show');
1878 1877  
... ... @@ -1884,20 +1883,17 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data
1884 1883 function (error) {
1885 1884 console.log(' Error in authentication = ' + error.statusText);
1886 1885 removeEmailPopUp();
1887   - // alert(LoginConstants.ERROR_IN_FECTHING_DETAILS);
1888 1886 $rootScope.errorMessage = error;
1889 1887 $("#messageModal").modal('show');
1890 1888 });
1891 1889 }
1892 1890 else {
1893   - // alert(LoginMessageConstants.INCORRECT_EMAIL_ID);
1894 1891 removeEmailPopUp();
1895 1892 $rootScope.errorMessage = LoginMessageConstants.INCORRECT_EMAIL_ID;
1896 1893 $("#messageModal").modal('show');
1897 1894 }
1898 1895 }
1899 1896 else {
1900   - //alert(LoginMessageConstants.BLANK_EMAIL_ID);
1901 1897 removeEmailPopUp();
1902 1898 $rootScope.errorMessage = LoginMessageConstants.BLANK_EMAIL_ID;
1903 1899 $("#messageModal").modal('show');
... ... @@ -1939,13 +1935,11 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data
1939 1935 .then(
1940 1936 function (result) {
1941 1937 if (result == LoginConstants.USER_NOT_FOUND) {
1942   - // alert(LoginMessageConstants.USER_OR_PASSWORD_INCORRECT);
1943 1938 $rootScope.errorMessage = LoginMessageConstants.USER_NOT_FOUND;
1944 1939 $("#messageModal").modal('show');
1945 1940  
1946 1941 }
1947 1942 else if (result == LoginConstants.EXCEPTION_OCCURED) {
1948   - // alert(LoginMessageConstants.ERROR_IN_FECTHING_DETAILS);
1949 1943 $rootScope.errorMessage = LoginConstants.ERROR_IN_FECTHING_DETAILS;
1950 1944 $("#messageModal").modal('show');
1951 1945  
... ... @@ -1957,7 +1951,6 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data
1957 1951 else {
1958 1952 //if ((result.IsAcknowledged == true) && (result.IsModifiedCountAvailable == true)) {
1959 1953 if (result == LoginMessageConstants.PASSWORD_UPDATE_SUCCESS) {
1960   - // alert(LoginMessageConstants.PASSWORD_RESET_MESSAGE);
1961 1954 $rootScope.errorMessage = LoginMessageConstants.PASSWORD_RESET_MESSAGE;
1962 1955 $("#messageModal").modal('show');
1963 1956 $rootScope.isVisibleLogin = true;
... ... @@ -1975,7 +1968,6 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data
1975 1968 },
1976 1969 function (error) {
1977 1970 console.log(' Error in authentication = ' + error.statusText);
1978   - // alert(LoginMessageConstants.ERROR_IN_FECTHING_DETAILS);
1979 1971 $rootScope.errorMessage = error;
1980 1972 $("#messageModal").modal('show');
1981 1973  
... ... @@ -2006,8 +1998,8 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data
2006 1998 .then(
2007 1999 function (result) {
2008 2000 if (result == LoginMessageConstants.USER_UNBLOCK_SUCCESS) {
2009   - $rootScope.errorMessage = LoginMessageConstants.USER_UNBLOCK_SUCCESS_MESSAGE;
2010   - $("#messageModal").modal('show');
  2001 + $rootScope.sucessMessage = LoginMessageConstants.USER_UNBLOCK_SUCCESS_MESSAGE;
  2002 + $("#successMessageModal").modal('show');
2011 2003 $rootScope.isVisibleLogin = true;
2012 2004 $location.url("/");
2013 2005 }
... ... @@ -2134,7 +2126,6 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data
2134 2126 });
2135 2127  
2136 2128 var $inlinehex = $('#inlinecolorhex h3 small');
2137   - //alert($inlinehex);
2138 2129 $('#inlinecolors').minicolors({
2139 2130 inline: true,
2140 2131 theme: 'bootstrap',
... ... @@ -2168,7 +2159,6 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data
2168 2159 });
2169 2160 });
2170 2161 var $inlinehex = $('#inlinecolorhex h3 small');
2171   - //alert($inlinehex);
2172 2162 $('#inlinecolors').minicolors({
2173 2163 inline: true,
2174 2164 theme: 'bootstrap',
... ... @@ -3231,7 +3221,6 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data
3231 3221 // Dissectible Anatomy > Settings should be disable if Annotation is Open.
3232 3222 $rootScope.ShowSettingWindow = function () {
3233 3223 if ($(".annotationTollbar").css("display") == "block") {
3234   - // alert("already open");
3235 3224 $('#modal-settings').css("display", "none");
3236 3225 $("#modelsettingsbackground").css("display", "none");
3237 3226 }
... ... @@ -4236,8 +4225,6 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data
4236 4225 document.getElementById('modeleditstyle').style.display = "block";
4237 4226 $("#borderWidthCanvasElement").val($rootScope.shapestyleborderWidth).change();
4238 4227  
4239   - // alert(document.getElementById('outlinedivId').style.border);
4240   - // alert(document.getElementById('imgOpacity').style.backgroundColor);
4241 4228 $('#editstylebackgroundcolor .minicolors >.minicolors-swatch > .minicolors-swatch-color').css("background-color", document.getElementById('imgOpacity').style.backgroundColor);
4242 4229 $('#outlineColor .minicolors >.minicolors-swatch > .minicolors-swatch-color').css("background-color", document.getElementById('outlinedivId').style.border);
4243 4230  
... ... @@ -7004,24 +6991,25 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data
7004 6991 function (result) {
7005 6992 var k= result;
7006 6993 if(result==1){
7007   - $rootScope.errorMessage = AIAConstants.SETTINGS_SAVED ;
7008 6994 $('#modal-settings').css("display", "none");
7009 6995 $("#modelsettingsbackground").css("display", "none");
7010 6996 //hide saveSettingsMessageModal
7011 6997 $("#saveSettingsMessageModal").modal('hide');
  6998 + $rootScope.sucessMessage = AIAConstants.SETTINGS_SAVED
  6999 + $("#successMessageModal").modal('show');
7012 7000  
7013 7001 }
7014   - else{
  7002 + else
  7003 + {
7015 7004 $rootScope.errorMessage =AIAConstants.SETTING_SAVE_ERROR;
  7005 + $("#messageModal").modal('show');
7016 7006  
7017 7007 }
7018   - $("#messageModal").css('zIndex', 80000000000);
7019   - $("#messageModal").modal('show');
  7008 +
7020 7009  
7021 7010 }),
7022 7011 function (error) {
7023 7012 console.log(' Error in Saving settings = ' + error.statusText);
7024   - // alert(LoginMessageConstants.ERROR_IN_FECTHING_DETAILS);
7025 7013 $rootScope.isVisibleLogin = true;
7026 7014 $rootScope.errorMessage = error;
7027 7015 $("#messageModal").modal('show');
... ... @@ -7104,7 +7092,6 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data
7104 7092  
7105 7093 else if (languageDifference == 0) {
7106 7094 if ($rootScope.lexiconPrimaryLanguage == $("#primarylaxican").val()) {
7107   - // alert("same name");
7108 7095 }
7109 7096 else {
7110 7097 $rootScope.lexiconLanguageArray[0].id = $rootScope.primaryLangID;
... ... @@ -7867,8 +7854,8 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data
7867 7854 AdminService.SendAdminAccessRequestMail(userInfo)
7868 7855 .then(function (result) {
7869 7856 if (result == AdminConstants.MAIL_SENT) {
7870   - $rootScope.errorMessage = AdminConstants.MAIL_SENT_SUCCESS_MESSAGE;
7871   - $("#messageModal").modal('show');
  7857 + $rootScope.sucessMessage =AdminConstants.MAIL_SENT_SUCCESS_MESSAGE
  7858 + $("#successMessageModal").modal('show');
7872 7859 }
7873 7860 $("#adminModal").fadeOut();
7874 7861 $("#adminModal").modal('hide');
... ...
400-SOURCECODE/AIAHTML5.Web/app/controllers/LabExercController.js
... ... @@ -180,7 +180,6 @@ function ($scope, $rootScope, pages, log, $http, $timeout, DataService, $filter,
180 180 $scope.scroll = function () {
181 181 // $window.scrollTo(0, 0);
182 182 $("html,body").scrollTop(0);
183   - //alert("scroll");
184 183 }
185 184 // $rootScope.currentActiveModuleTitle = pages[8].Name;
186 185  
... ... @@ -1457,7 +1456,6 @@ function ($scope, $rootScope, pages, log, $http, $timeout, DataService, $filter,
1457 1456 var labExerciseModulePath = '~/../content/data/json/le/' + keywords + '.json';
1458 1457 DataService.getAnotherJson(labExerciseModulePath).then(
1459 1458 function (result) {
1460   - //alert(result)
1461 1459 $.each(result.LabExercise, function (index, value) {
1462 1460 if (result.LabExercise[index].Slug == keywords) {
1463 1461 $.each(result.LabExercise[index].Questions, function (index1, value1) {
... ... @@ -1559,16 +1557,18 @@ function ($scope, $rootScope, pages, log, $http, $timeout, DataService, $filter,
1559 1557 $scope.EnableUI();
1560 1558 $scope.SetLEwindowStoreData(windowviewid, 'isLabExChanged', false);
1561 1559 //saved successfully.variable name is not correct but errorMessage represnts message
1562   - $rootScope.errorMessage = result;
1563   - $("#messageModal").modal('show');
1564   - $('#messageModal').css('z-index', '12000001');
  1560 + if (!$rootScope.isCallFromOtherModule) {
  1561 + $rootScope.sucessMessage = result;
  1562 + $("#successMessageModal").modal('show');
  1563 + $('#successMessageModal').css('z-index', '12000001');
  1564 + }
  1565 +
1565 1566 },
1566 1567 function (error) {
1567 1568  
1568 1569 $scope.EnableUI();
1569 1570  
1570 1571 console.log(' Error in saving lab exercise = ' + error.statusText);
1571   - // alert(LoginMessageConstants.ERROR_IN_FECTHING_DETAILS);
1572 1572 $rootScope.isVisibleLogin = true;
1573 1573 $rootScope.errorMessage = error;
1574 1574 $("#messageModal").modal('show');
... ... @@ -2200,7 +2200,6 @@ function ($scope, $rootScope, pages, log, $http, $timeout, DataService, $filter,
2200 2200 else {
2201 2201 $rootScope.closeLabExEmailModel("", windowviewid);
2202 2202 var message = LoginConstants.MAIL_NOT_SENT
2203   - //alert(message);
2204 2203 $rootScope.errorMessage = message;
2205 2204 $("#messageModal").modal('show');
2206 2205 $('#messageModal').css('z-index', '12000001');
... ... @@ -2209,7 +2208,6 @@ function ($scope, $rootScope, pages, log, $http, $timeout, DataService, $filter,
2209 2208 },
2210 2209 function (error) {
2211 2210 var message = LoginConstants.MAIL_NOT_SENT
2212   - //alert(message);
2213 2211 $rootScope.errorMessage = message;
2214 2212 $("#messageModal").modal('show');
2215 2213 $('#messageModal').css('z-index', '12000001');
... ... @@ -2312,7 +2310,6 @@ AIA.directive(&#39;imageonload&#39;, function () {
2312 2310 $('#imgdiv_' + windowviewid).css('width', this.naturalWidth + "px");
2313 2311 });
2314 2312 element.bind('error', function () {
2315   - //alert('image could not be loaded');
2316 2313 });
2317 2314 }
2318 2315 };
... ...
400-SOURCECODE/AIAHTML5.Web/app/controllers/LinkController.js
... ... @@ -105,7 +105,6 @@ function ($scope, $rootScope, log, $location, pages, $routeParams, $window,$inte
105 105 $scope.scroll = function () {
106 106 // $window.scrollTo(0, 0);
107 107 $("html,body").scrollTop(0);
108   - //alert("scroll");
109 108 }
110 109 }]
111 110  
... ...
400-SOURCECODE/AIAHTML5.Web/app/widget/TopMenu.html
... ... @@ -86,7 +86,7 @@
86 86 </div>
87 87  
88 88 <input type="file" id="xmltojsonfile" accept=".sldshw" style="display: none" />
89   - <input type="file" id="openCBJsonFile" accept=".json" style="display: none" />
  89 + <input type="file" id="openCBJsonFile" accept=".json,.sldshw" style="display: none" />
90 90 <input type="file" id="myPictureFile" accept="image/png, image/jpeg" style="display: none" />
91 91 <input type="file" id="myAnimationFile" accept=".mp4" style="display: none" />
92 92 <!-- <input type="file" id="myAnimationFile" accept="video/mp4,video/x-m4v,video/*" style="display: none" /> -->
... ...
400-SOURCECODE/AIAHTML5.Web/index.aspx
... ... @@ -1047,30 +1047,23 @@
1047 1047  
1048 1048  
1049 1049 <!--DA Body System not found modal-->
1050   - <div class="modal fade notfoundSystem" id="daMessageModal" role="dialog" aria-labelledby="myModalLabel"
1051   - style="z-index: 1200002; top:10%">
1052   -
1053   - <div class="modal-dialog modal-sm">
1054   -
1055   - <div class="modal-content">
1056   -
1057   - <div class="modal-header">
1058   -
1059   - <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
1060   -
  1050 + <div class=" fade ui-draggable in notfoundSystem" data-keyboard="false" data-backdrop="static" id="daMessageModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" style="padding-left: 17px; display: none; z-index: 1200002; position: fixed; top: 0; overflow-x: hidden; overflow-y: auto; width:100% ;height:100%">
  1051 + <div class="modal-dialog" role="document" style="width:500px">
  1052 + <div class="modal-content">
  1053 + <div class="modal-header ui-draggable-handle " style="background-color: #ec6798; border-color: #007ab3;cursor:default; padding:5px">
  1054 + <button type="button" class="close" data-dismiss="modal" aria-label="Close" style="font-size: 30px;"><span aria-hidden="true">&times;</span></button>
  1055 + <h4 style="color:#fff; float: left;">Error Message</h4>
  1056 + </div>
  1057 +
  1058 + <div class="modal-body" style=" height: 160px; overflow-x: auto;">
  1059 + <div class="panel-body">
  1060 + <div style="font-size: 15px;float: left;" data-ng-bind="message"></div>
1061 1061 </div>
1062   -
1063   - <div class="modal-title"></div>
1064   -
1065   - <div class="modal-header"><p data-ng-bind="message" style="font-size:15px;"></p></div>
1066   -
1067   - <div class="modal-footer"> <button type="button" class="btn btn-primary btn-sm" data-dismiss="modal">OK</button></div>
1068   -
1069 1062 </div>
1070   -
  1063 + <div class="modal-footer ui-draggable-handle" style="background-color: #f1e8e8;"> <button type="button" class="btn btn-primary btn" data-dismiss="modal">OK</button></div>
1071 1064 </div>
1072   -
1073   - </div>
  1065 + </div>
  1066 + </div>
1074 1067  
1075 1068 <!-- Update Setting confirm modal-->
1076 1069 <div class="modal fade notfoundSystem" id="saveSettingsMessageModal" role="dialog" aria-labelledby="myModalLabel"
... ... @@ -1384,20 +1377,64 @@
1384 1377 </table>
1385 1378 </div>
1386 1379  
1387   - <div class="modal fade" id="messageModal" role="dialog">
1388   - <div class="modal-dialog">
1389   -
  1380 + <!--Convert Curriculum-->
  1381 + <div class=" fade ui-draggable in" data-keyboard="false" data-backdrop="static" id="cbMessageModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" style="padding-left: 17px; display: none; z-index: 1200002; position: fixed; top: 0; overflow-x: hidden; overflow-y: auto; width:100% ;height:100%">
  1382 + <div class="modal-dialog" role="document" style="width:500px">
1390 1383 <div class="modal-content">
1391   - <div class="modal-header">
1392   - <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">ร—</span></button>
  1384 + <div class="modal-header ui-draggable-handle " style="background-color: #ec6798; border-color: #007ab3;cursor:default; padding:5px">
  1385 + <button type="button" class="close" data-dismiss="modal" aria-label="Close" style="font-size: 30px;"><span aria-hidden="true">&times;</span></button>
  1386 + <h4 style="color:#fff; float: left;">AIA Message</h4>
  1387 + </div>
  1388 + <div class="modal-body" style=" height: 160px; overflow-x: auto;">
  1389 + <div class="panel-body">
  1390 + <div style="font-size: 15px;float: left;text-align: left;white-space: pre-wrap;" data-ng-bind="confirmMessage"></div>
  1391 + </div>
  1392 + </div>
  1393 + <div class="modal-footer ui-draggable-handle" style="background-color: #f1e8e8;">
  1394 + <button type="button" id="btnConvertDownLoad" class="btn btn-primary" data-dismiss="modal" ng-click="ConvertSave()">Download</button>
  1395 + <button type="button" id="btnConvertOpen" class="btn btn-primary" data-dismiss="modal" ng-click="ConvertOpen()">Open</button>
  1396 + <button type="button" id="btnImportOpen" class="btn btn-primary" data-dismiss="modal" ng-click="importOpen()">Import</button>
  1397 + <button type="button" class="btn btn-primary" data-dismiss="modal">No</button>
1393 1398 </div>
1394   - <div class="modal-title"></div>
1395   - <div class="modal-body">{{errorMessage}}</div>
1396   - <div class="modal-footer"> <button type="button" class="btn btn-primary" data-dismiss="modal">OK</button></div>
1397 1399 </div>
1398 1400 </div>
1399   - </div>
  1401 + </div>
1400 1402  
  1403 + <!--AIA ERROR MESSAGE-->
  1404 + <div class=" fade ui-draggable in" data-keyboard="false" data-backdrop="static" id="messageModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" style="padding-left: 17px; display: none; z-index: 1200002; position: fixed; top: 0; overflow-x: hidden; overflow-y: auto; width:100% ;height:100%">
  1405 + <div class="modal-dialog" role="document" style="width:500px">
  1406 + <div class="modal-content">
  1407 + <div class="modal-header ui-draggable-handle " style="background-color: #ec6798; border-color: #007ab3;cursor:default; padding:5px">
  1408 + <button type="button" class="close" data-dismiss="modal" aria-label="Close" style="font-size: 30px;"><span aria-hidden="true">&times;</span></button>
  1409 + <h4 style="color:#fff; float: left;">AIA Message</h4>
  1410 + </div>
  1411 + <div class="modal-body" style=" height: 160px; overflow-x: auto;">
  1412 + <div class="panel-body">
  1413 + <div style="font-size: 15px;float: left;text-align: left;" data-ng-bind="errorMessage"></div>
  1414 + </div>
  1415 + </div>
  1416 + <div class="modal-footer ui-draggable-handle" style="background-color: #f1e8e8;">
  1417 + <button type="button" class="btn btn-primary btn" data-dismiss="modal" style="float:right;">OK</button></div>
  1418 + </div>
  1419 + </div>
  1420 + </div>
  1421 + <!--AIA SUCCESS MESSAGE-->
  1422 + <div class=" fade ui-draggable in" data-keyboard="false" data-backdrop="static" id="successMessageModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" style="padding-left: 17px; display: none; z-index: 1200002; position: fixed; top: 0; overflow-x: hidden; overflow-y: auto; width:100% ;height:100%">
  1423 + <div class="modal-dialog" role="document" style="width:500px">
  1424 + <div class="modal-content">
  1425 + <div class="modal-header ui-draggable-handle " style="background-color: #0095da; border-color: #007ab3;cursor:default; padding:5px">
  1426 + <button type="button" class="close" data-dismiss="modal" aria-label="Close" style="font-size: 30px;"><span aria-hidden="true">&times;</span></button>
  1427 + <h4 style="color:#fff; float: left;">AIA Success Message</h4>
  1428 + </div>
  1429 + <div class="modal-body" style=" height: 160px; overflow-x: auto;">
  1430 + <div class="panel-body">
  1431 + <div style="font-size: 15px;float: left;" data-ng-bind="sucessMessage"></div>
  1432 + </div>
  1433 + </div>
  1434 + <div class="modal-footer ui-draggable-handle" style="background-color: #f1e8e8;"> <button type="button" class="btn btn-primary btn" data-dismiss="modal" style="float:right;">OK</button></div>
  1435 + </div>
  1436 + </div>
  1437 + </div>
1401 1438  
1402 1439  
1403 1440 <!--Admin Form (Under Process)-->
... ...
400-SOURCECODE/Admin/src/app/components/LicenseEntity/addlicense.component.ts
... ... @@ -63,7 +63,7 @@ export class AddLicense implements OnInit {
63 63 this.editionLoginsText = '';
64 64 this.insertUpdateLicenseFrm = this.fb.group({
65 65 licenseId: [0],
66   - accountNumber: ['', [Validators.required,this.noWhitespaceValidator]],
  66 + accountNumber: ['', [Validators.required,this.ClearWhitespaceValidator]],
67 67 accountTypeId: [0, Validators.min(1)],
68 68 productId: [''],
69 69 licenseeFirstName: ['', [Validators.required,this.noWhitespaceValidator]],
... ... @@ -76,7 +76,7 @@ export class AddLicense implements OnInit {
76 76 stateId: [0, Validators.min(1)],
77 77 countryId: [0, Validators.min(1)],
78 78 zip: ['', [Validators.required,this.noWhitespaceValidator]],
79   - emailId: ['', [Validators.required,this.noWhitespaceValidator]],
  79 + emailId: ['', [Validators.required,this.ClearWhitespaceValidator]],
80 80 phone: ['', [Validators.required, Validators.pattern('^([0-9]{3})-([0-9]{3})-([0-9]{4})$'),this.noWhitespaceValidator]],
81 81 editionLoginArr: this.fb.array([]),
82 82 editionLogins: [''],
... ... @@ -88,8 +88,8 @@ export class AddLicense implements OnInit {
88 88 masterSiteUrl: ['a', [Validators.required,this.noWhitespaceValidator]],
89 89 siteUrlFrom: [''],
90 90 siteUrlTo: [''],
91   - login: ['a', [Validators.required, Validators.minLength(8),this.noWhitespaceValidator]],
92   - password: ['a', [Validators.required, Validators.minLength(8),this.noWhitespaceValidator]],
  91 + login: ['a', [Validators.required, Validators.minLength(8),this.ClearWhitespaceValidator]],
  92 + password: ['a', [Validators.required, Validators.minLength(8),this.ClearWhitespaceValidator]],
93 93 securityQuestionId: [0, Validators.min(1)],
94 94 answer: ['a', [Validators.required,this.noWhitespaceValidator]],
95 95 testLicenseEditionId: [1],
... ... @@ -134,8 +134,37 @@ export class AddLicense implements OnInit {
134 134 });
135 135 }, error => this.error = <any>error);
136 136 }
  137 + public ClearWhitespaceValidator(control: FormControl) {
  138 + // clear white space
  139 + //****Birendra *****/
  140 + var isValid=false;
  141 + if(control.value!=null)
  142 + {
  143 + var inputvalue=control.value;
  144 + var controlLen=inputvalue.length;
  145 + if(controlLen==undefined)//undefined for integer value
  146 + {
  147 + isValid=true;
  148 + }
  149 + else if(controlLen!=0)
  150 + {
  151 + const isWhitespace = controlLen!=inputvalue.trim().length;
  152 + isValid = !isWhitespace;
  153 + if(!isValid)
  154 + {
  155 + control.setValue(inputvalue.trim());
  156 +
  157 + }
  158 +
  159 + }
  160 + }
  161 + // can use also on page of input control
  162 + //
  163 + return isValid ? null: { 'whitespace': true };
  164 +
  165 + }
137 166 public noWhitespaceValidator(control: FormControl) {
138   - // new validation for intial whaite space
  167 + // new validation for intial white space
139 168 //****Birendra *****/
140 169 var isValid=false;
141 170 if(control.value!=null)
... ...
400-SOURCECODE/Admin/src/app/components/UserEntity/adduser.component.ts
... ... @@ -60,12 +60,12 @@ export class AddUser implements OnInit, AfterViewInit {
60 60 //this.userservice.GetUserById(this.UserId);
61 61 this.adduserFrm = this.fb.group({
62 62 id: [''],
63   - UserName: ['', [Validators.required, Validators.minLength(8),this.noWhitespaceValidator]],
64   - Password: ['', [Validators.required, Validators.minLength(8),this.noWhitespaceValidator]],
65   - ConfirmPassword: ['', [Validators.required,this.noWhitespaceValidator]],
  63 + UserName: ['', [Validators.required, Validators.minLength(8),this.ClearWhitespaceValidator]],
  64 + Password: ['', [Validators.required, Validators.minLength(8),this.ClearWhitespaceValidator]],
  65 + ConfirmPassword: ['', [Validators.required,this.ClearWhitespaceValidator]],
66 66 FirstName: ['', [Validators.required,this.noWhitespaceValidator]],
67 67 LastName: ['', [Validators.required,this.noWhitespaceValidator]],
68   - EmailId: ['', [Validators.required,this.noWhitespaceValidator]],
  68 + EmailId: ['', [Validators.required,this.ClearWhitespaceValidator]],
69 69 AccountNumberId: ['', Validators.required],
70 70 UserTypeId: ['', Validators.required],
71 71 ProductEditionId: ['', Validators.required]
... ... @@ -92,6 +92,35 @@ export class AddUser implements OnInit, AfterViewInit {
92 92 redirect() {
93 93 this.router.navigate(['/']);
94 94 }
  95 + public ClearWhitespaceValidator(control: FormControl) {
  96 + // new validation for intial whaite space
  97 + //****Birendra *****/
  98 + var isValid=false;
  99 + if(control.value!=null)
  100 + {
  101 + var inputvalue=control.value;
  102 + var controlLen=inputvalue.length;
  103 + if(controlLen==undefined)//undefined for integer value
  104 + {
  105 + isValid=true;
  106 + }
  107 + else if(controlLen!=0)
  108 + {
  109 + const isWhitespace = controlLen!=inputvalue.trim().length;
  110 + isValid = !isWhitespace;
  111 + if(!isValid)
  112 + {
  113 + control.setValue(inputvalue.trim());
  114 +
  115 + }
  116 +
  117 + }
  118 + }
  119 + // can use also on page of input control
  120 + //
  121 + return isValid ? null: { 'whitespace': true };
  122 +
  123 + }
95 124 public noWhitespaceValidator(control: FormControl) {
96 125 // new validation for intial whaite space
97 126 //****Birendra *****/
... ...