diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/CAController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/CAController.js index 57e9750..3133993 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/CAController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/CAController.js @@ -658,7 +658,6 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout $rootScope.disableAnnotationTBFn(); $rootScope.MenuModuleName = "CA"; - //alert($rootScope.MenuModuleName); $rootScope.currentBodyViewId = $event.currentTarget.id; if ($event.currentTarget.textContent !== null && typeof ($event.currentTarget.textContent) !== "undefined") { var selectedTileData = []; diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/CurrBuildController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/CurrBuildController.js index 3c2ba13..7e7a4a9 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/CurrBuildController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/CurrBuildController.js @@ -20,9 +20,7 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ $scope.scroll(); } $scope.scroll = function () { - // $window.scrollTo(0, 0); - $("html,body").scrollTop(0); - //alert("scroll"); + $("html,body").scrollTop(0); } $rootScope.closeEditorModel = function () { @@ -282,62 +280,112 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ $(fileupload).val('');//old file path fileupload.onchange = function () { - + var extension=''; var fileId, file, objFileRead; if (typeof window.FileReader !== 'function') { - alert("The file API isn't supported on this browser yet."); + $rootScope.errorMessage = "The file API isn't supported on this browser yet."; + $("#messageModal").modal('show'); return; } fileId = document.getElementById('openCBJsonFile'); if (!fileId) { - alert("File couldn't find the element."); + $rootScope.errorMessage = "File couldn't find the element."; + $("#messageModal").modal('show'); } else if (!fileId.files) { - alert("This browser doesn't seem to support the `files` property of file inputs."); + $rootScope.errorMessage = "This browser doesn't seem to support the `files` property of file inputs."; + $("#messageModal").modal('show'); } else if (!fileId.files[0]) { - alert("Please select a file before clicking 'Load'"); + $rootScope.errorMessage = "Please select a file before clicking 'Load'."; + $("#messageModal").modal('show'); } - else { + else + { file = fileId.files[0]; - var extension = file.name.split(".")[1]; - if (file.type == "application/json" && extension == "json") { - $location.url('/curriculum-builder'); - $timeout(function () { + extension = file.name.split(".")[1]; + if ((file.type == "application/json" && extension == "json")||extension == "sldshw") { objFileRead = new FileReader(); - objFileRead.onload = receivedFile; - objFileRead.readAsText(file); - }, 300); + objFileRead.onload = ReceivedFile; + objFileRead.readAsText(file); } else { - alert("This Curriculum is not supported format!.Please try again"); + $rootScope.errorMessage = "This Curriculum file is not supported! Please try again."; + $("#messageModal").modal('show'); } } + function ReceivedFile(file) { + if(extension == "json") + { + $location.url('/curriculum-builder'); + var jsonData = JSON.parse(file.target.result); + $timeout(function () { + $scope.jsonReceivedFile(jsonData) + }, 300); + + } + else + { + // convert xml to json object + var x2js = new X2JS(); + var curriculumobject = x2js.xml_str2json(file.target.result); + var isIncompatible= $scope.checkCompatibility(curriculumobject); + if(isIncompatible) + { + $("#btnConvertOpen").removeAttr("style"); + $("#btnImportOpen").css({"display":"none"}) ; + $("#btnConvertDownLoad").css({"display":"none"}) ; + $rootScope.confirmMessage = "This curriculum is not completely converted to new format. Please contact ADAM or recreate it .\nDo you still want to open it?"; + $timeout(function () { + $rootScope.newCurriculumObject=curriculumobject; + $("#cbMessageModal").modal('show'); + }, 200); + + } + else + { + $location.url('/curriculum-builder'); + $timeout(function () { + $rootScope.isnewcurriculum = true; + $scope.jsonReceivedFile(curriculumobject) ; + }, 300); + } + + } + + } - function receivedFile(e) { - var jsonData = JSON.parse(e.target.result); - localStorage.setItem("cbJsonDataObject", JSON.stringify(jsonData)); - $rootScope.cbJsonData = ""; - $rootScope.cbDynamicJsonData = ""; - $rootScope.cbJsonData = JSON.parse(e.target.result); - $rootScope.cbDynamicJsonData = JSON.parse(e.target.result); - $rootScope.cbTreeFirstLabel = $rootScope.cbJsonData.slideshow.presentation.structure._label; - $rootScope.AutherName = ""; - $rootScope.summary = ""; + }; - $rootScope.getCBsummary(); - - $rootScope.FileTitle = $rootScope.cbTreeFirstLabel; + } + $rootScope.ConvertOpen = function () { + $location.url('/curriculum-builder'); + $timeout(function () { + $rootScope.isnewcurriculum = true; + $scope.jsonReceivedFile($rootScope.newCurriculumObject) ; + }, 300); + } + + $scope.jsonReceivedFile = function (jsonData) { + localStorage.setItem("cbJsonDataObject", JSON.stringify(jsonData)); + $rootScope.cbJsonData = ""; + $rootScope.cbDynamicJsonData = ""; + $rootScope.cbJsonData = jsonData; + $rootScope.cbDynamicJsonData = jsonData; + $rootScope.cbTreeFirstLabel = $rootScope.cbJsonData.slideshow.presentation.structure._label; + $rootScope.AutherName = ""; + $rootScope.summary = ""; - $timeout(function () { - $('#modal-CurBuilder').css("display", "block"); - $("#CurBuilderbackground").css("display", "block"); - }, 200); + $rootScope.getCBsummary(); + + $rootScope.FileTitle = $rootScope.cbTreeFirstLabel; - } - }; + $timeout(function () { + $('#modal-CurBuilder').css("display", "block"); + $("#CurBuilderbackground").css("display", "block"); + }, 200); } @@ -385,20 +433,25 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ var myfileName=''; var fileId, file, objFileRead; if (typeof window.FileReader !== 'function') { - alert("The file API isn't supported on this browser yet."); + $rootScope.errorMessage = "The file API isn't supported on this browser yet."; + $("#messageModal").modal('show'); return; } fileId = document.getElementById('xmltojsonfile'); if (!fileId) { - alert("File couldn't find the element."); + $rootScope.errorMessage = "File couldn't find the element."; + $("#messageModal").modal('show'); } else if (!fileId.files) { - alert("This browser doesn't seem to support the `files` property of file inputs."); + $rootScope.errorMessage = "This browser doesn't seem to support the `files` property of file inputs."; + $("#messageModal").modal('show'); } else if (!fileId.files[0]) { - alert("Please select a file before clicking 'Load'"); + $rootScope.errorMessage = "Please select a file before clicking 'Load'."; + $("#messageModal").modal('show'); } - else { + else + { file = fileId.files[0]; myfileName=file.name.split(".")[0]; var extension = file.name.split(".")[1]; @@ -408,39 +461,97 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ objFileRead.onload = convertfile; objFileRead.readAsText(file); }, 300); - } else { - alert("Selected file is not in valid format!"); + } + else + { + $rootScope.errorMessage = "This Curriculum file is not supported! Please try again."; + $("#messageModal").modal('show'); } } - function convertfile(e) { + function convertfile(file) { var x2js = new X2JS(); - var curriculumobject = x2js.xml_str2json(e.target.result); - - //add extension - myfileName += '.json'; - - var blob = new Blob([angular.toJson(curriculumobject, true)], { type: 'text/json' }); - - if (window.navigator && window.navigator.msSaveOrOpenBlob) { - window.navigator.msSaveOrOpenBlob(blob, myfileName); + var curriculumobject = x2js.xml_str2json(file.target.result); + var isIncompatible= $scope.checkCompatibility(curriculumobject); + if(isIncompatible) + { + $("#btnConvertDownLoad").removeAttr("style"); + $("#btnImportOpen").css({"display":"none"}) ; + $("#btnConvertOpen").css({"display":"none"}) ; + $rootScope.newCurriculumObject=curriculumobject; + $rootScope.convertedfileName=myfileName; + $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?"; + $timeout(function () { + $("#cbMessageModal").modal('show'); + }, 200); } - else { - document.execCommand("SaveAs", true, myfileName); - - var event = document.createEvent('MouseEvents'), - saveElement = document.createElement('a'); - saveElement.download = myfileName; - saveElement.href = window.URL.createObjectURL(blob); - saveElement.dataset.downloadurl = ['text/json', saveElement.download, saveElement.href].join(':'); - event.initEvent('click', true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null); - saveElement.dispatchEvent(event); - + else + { + $scope.convertDownLoad(curriculumobject,myfileName); } } + + } + } + $rootScope.ConvertSave = function () { + + $scope.convertDownLoad($rootScope.newCurriculumObject, $rootScope.convertedfileName); + } + + $scope.convertDownLoad = function (curriculumobject,myfileName) { + var blob = new Blob([angular.toJson(curriculumobject, true)], { type: 'text/json' }); + + if (window.navigator && window.navigator.msSaveOrOpenBlob) { + window.navigator.msSaveOrOpenBlob(blob, myfileName); + } + else + { + document.execCommand("SaveAs", true, myfileName); + + var event = document.createEvent('MouseEvents'), + saveElement = document.createElement('a'); + saveElement.download = myfileName; + saveElement.href = window.URL.createObjectURL(blob); + saveElement.dataset.downloadurl = ['text/json', saveElement.download, saveElement.href].join(':'); + event.initEvent('click', true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null); + saveElement.dispatchEvent(event); + + } + + } + $scope.checkCompatibility = function (curriculumobject) { + var isIncompatible=false; + var cbcontent = curriculumobject.slideshow.content.element; + for (var i = 0; i < cbcontent.length; i++) { + var windowsData = cbcontent[i].windows; + if(windowsData=="")continue + var allwindowData = windowsData.window; + if(!Array.isArray(allwindowData)) + { + allwindowData=[]; + allwindowData.push(windowsData.window); + } + if (allwindowData != undefined) { + for (var j = 0; j < allwindowData.length; j++) { + windowData = JSON.parse(allwindowData[j]); + var annotation= windowData.annotationData; + if(annotation!="" && annotation!=undefined) + { + var shapeStates = 'shapeStates'; + var paintCanvasState = 'paintCanvasState'; + if (!annotation.hasOwnProperty(shapeStates) || !annotation.hasOwnProperty(paintCanvasState)) + { + isIncompatible=true; + } + + } + } + } + } + return isIncompatible; } $rootScope.CreateNewCurriculum = function () { @@ -1107,7 +1218,8 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ if (password.trim() == "") { - alert("Password field is empty.please try again!"); + $rootScope.errorMessage = "Password field is empty.please try again!"; + $("#messageModal").modal('show'); return; } @@ -1117,12 +1229,12 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ traverseTreeSelectedSingleObj($rootScope.structureObjForSaveCB, nodeid); if ($scope.selectedNodeSingleObj._isBranch == "false") { if (password != $scope.selectedNodeSingleObj._password) { - alert("Password is not matched.please try again!"); + $rootScope.errorMessage = "Password is not matched.please try again!"; + $("#messageModal").modal('show'); return false; } else { - alert("Slide successfully unlocked."); $scope.selectedNodeSingleObj._password = ""; $scope.selectedNodeSingleObj._isLocked = "false"; $scope.isSlideLock="false"; @@ -1307,47 +1419,85 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ $(fileupload).val('');//old file path fileupload.onchange = function () { - + var extension=''; var fileId, file, objFileRead; if (typeof window.FileReader !== 'function') { - alert("The file API isn't supported on this browser yet."); + $rootScope.errorMessage = "The file API isn't supported on this browser yet."; + $("#messageModal").modal('show'); return; } fileId = document.getElementById('openCBJsonFile'); if (!fileId) { - alert("File couldn't find the element."); + $rootScope.errorMessage = "File couldn't find the element."; + $("#messageModal").modal('show'); } else if (!fileId.files) { - alert("This browser doesn't seem to support the `files` property of file inputs."); + $rootScope.errorMessage = "This browser doesn't seem to support the `files` property of file inputs."; + $("#messageModal").modal('show'); } else if (!fileId.files[0]) { - alert("Please select a file before clicking 'Load'"); + $rootScope.errorMessage = "Please select a file before clicking 'Load'."; + $("#messageModal").modal('show'); } else { file = fileId.files[0]; - var extension = file.name.split(".")[1]; - if (file.type == "application/json" && extension == "json") { + extension = file.name.split(".")[1]; + if ((file.type == "application/json" && extension == "json")||extension == "sldshw") { $timeout(function () { objFileRead = new FileReader(); objFileRead.onload = CbFileData; - objFileRead.readAsText(file); + objFileRead.readAsText(file,extension); }, 300); - } else { - alert("This Curriculum not in supported format"); + } + else + { + $rootScope.errorMessage = "This Curriculum file is not supported! Please try again."; + $("#messageModal").modal('show'); + } } - function CbFileData(e) { - //$scope.CBEnableUI(); - var importdata = JSON.parse(e.target.result); - $rootScope.ImportCurriculum(importdata); + function CbFileData(file) { + if(extension == "json") + { var importdata = JSON.parse(file.target.result); + $rootScope.ImportCurriculum(importdata); + } + else + { + // convert xml to json object + var x2js = new X2JS(); + var curriculumobject = x2js.xml_str2json(file.target.result); + var isIncompatible= $scope.checkCompatibility(curriculumobject); + if(isIncompatible) + { + $("#btnImportOpen").removeAttr("style"); + $("#btnConvertDownLoad").css({"display":"none"}) ; + $("#btnConvertOpen").css({"display":"none"}) ; + $rootScope.newCurriculumObject=curriculumobject; + $rootScope.confirmMessage = "This curriculum is not completely converted to new format. Please contact ADAM or recreate it .\nDo you still want to import it?"; + $timeout(function () { + $("#cbMessageModal").modal('show'); + }, 200); + } + else + { + $rootScope.isnewcurriculum = true; + $rootScope.ImportCurriculum(curriculumobject); + } + + } } + }; } - + $rootScope.importOpen = function () { + $rootScope.isnewcurriculum = true; + $rootScope.ImportCurriculum($rootScope.newCurriculumObject); + } + $rootScope.ImportCurriculum = function (importdata) { var cbCurrentId = document.getElementById('cbSelect').value; if ($rootScope.structureObjForSaveCB.length == 0) { @@ -1449,7 +1599,8 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ var strFromParent=$scope.selectedNodeSingleObj['structure']; if(strFromParent.length<=0) { - alert("Add slide in this section to export this curriculum"); + $rootScope.errorMessage = "Please add slide first to export this section."; + $("#messageModal").modal('show'); return; } $("#filename").val(""); @@ -1464,7 +1615,8 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ var filename = document.getElementById("filename").value; if (filename == "" ||filename == " ") { - alert("Curriculum name is empty!"); + $rootScope.errorMessage = "Curriculum name is empty!"; + $("#messageModal").modal('show'); return; } $scope.CBDisableUI(); @@ -1582,7 +1734,6 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ $('#uploading-curriculum').css("display", "none"); $("#filename").val(""); $rootScope.errorMessage = AIAConstants.SAVE_ANIMATION_ERROR+"\n"+error.ExceptionMessage;; - $("#messageModal").css('zIndex', 80000000000); $("#messageModal").modal('show'); }, function(progress){ @@ -1603,12 +1754,12 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ filename += '.json'; if(downloadtype=="exportcb") { - var blob = new Blob([angular.toJson($rootScope.dynamicUpdatedJsonForExportCB, true)], { type: 'text/text' }); + var blob = new Blob([angular.toJson($rootScope.dynamicUpdatedJsonForExportCB, true)], { type: 'text/json' }); } else { $rootScope.UnsaveCurriculum = false; - var blob = new Blob([angular.toJson($rootScope.dynamicUpdatedJsonForSaveCB, true)], { type: 'text/text' }); + var blob = new Blob([angular.toJson($rootScope.dynamicUpdatedJsonForSaveCB, true)], { type: 'text/json' }); } if (window.navigator && window.navigator.msSaveOrOpenBlob) { @@ -2007,7 +2158,6 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ .delete().at("_id == " + currentid).select(); $rootScope.contentNotesForSaveCB = remaingNotesForCB; - //alert("After" + JSON.stringify($rootScope.stru)); console.log($rootScope.structureObjForSaveCB); console.log($rootScope.contentNotesForSaveCB); } @@ -2052,7 +2202,8 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ var filename = document.getElementById("filename").value; if (filename == "" ||filename == " ") { - alert("Curriculum name is empty!"); + $rootScope.errorMessage = "Curriculum name is empty!"; + $("#messageModal").modal('show'); return; } $scope.CBDisableUI(); @@ -2238,7 +2389,6 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ .from(content) .where("_id == " + id) .select(); - // console.log('contenctForSelectedSlide' + contenctForSelectedSlide[0].notes) var windowsInSelectedSlide = contenctForSelectedSlide[0].windows; var allwindowData = windowsInSelectedSlide.window; @@ -2270,7 +2420,9 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ var paintCanvasState = 'paintCanvasState'; if (!annotation.hasOwnProperty(shapeStates) || !annotation.hasOwnProperty(paintCanvasState)) { - alert('This slide has old annotations.Please use Annotation Tool to draw annotations again.') + $rootScope.UnsaveCurriculum = true; + $rootScope.errorMessage = 'This slide has some legacy version annotations and also not compatible with new format. Please contact ADAM or recreate it.'; + $("#messageModal").modal('show'); windowData.annotationData=""; } diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js index f509e31..ceb706c 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js @@ -248,7 +248,6 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $scope.scroll = function () { // $window.scrollTo(0, 0); $("html,body").scrollTop(0); - //alert("scroll"); } $scope.setActiveview=function(windowviewid,viewtypename) { @@ -1339,7 +1338,6 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l // } // , stop: function (event, ui) { - //alert('trans changed') var targetid = event.target.id; var len= (targetid).split("_").length; var windviewid = (targetid).split("_")[len-1]; @@ -1721,7 +1719,8 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l } bodyViewWorker.onerror = function (e) { - alert('Error: Line ' + e.lineno + ' in ' + e.filename + ': ' + e.message); + $rootScope.message = 'Error: Line ' + e.lineno + ' in ' + e.filename + ': ' + e.message; + $("#daMessageModal").modal('show'); }; } @@ -2921,13 +2920,10 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l FlipedImgCanvas.addEventListener('mousedown', function (evt) { - //alert('mousedown') }, false); FlipedImgCanvas.addEventListener('mouseup', function (evt) { - //alert('mouseup') - }, false); @@ -3208,7 +3204,6 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l var maskCanvasContext = maskCanvas.getContext("2d"); var mousePos = $scope.getMousePos(evt.pageX,evt.pageY,windowviewid); - // alert(mousePos.x + ',' + mousePos.y); var canvasDiv = document.getElementById('canvasDivDA_' + windowviewid); //changing for mac os now @@ -3990,7 +3985,8 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l }; worker.onerror = function (e) { - alert('Error: Line ' + e.lineno + ' in ' + e.filename + ': ' + e.message); + $rootScope.message = 'Error: Line ' + e.lineno + ' in ' + e.filename + ': ' + e.message; + $("#daMessageModal").modal('show'); }; } } @@ -4282,7 +4278,8 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l } }; worker.onerror = function (e) { - alert('Error: Line ' + e.lineno + ' in ' + e.filename + ': ' + e.message); + $rootScope.message = 'Error: Line ' + e.lineno + ' in ' + e.filename + ': ' + e.message; + $("#daMessageModal").modal('show'); }; } @@ -6280,7 +6277,6 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $scope.DrawTransparencyBox = function (windowviewid) { var newDimes = null; if ( $scope.GetwindowStoreData(windowviewid, 'isTransparencyActivated') && $scope.GetwindowStoreData(windowviewid, 'isZoomed') == true) { - // alert("ZOOM"); newDimes = $scope.scaleTransparencyBox(windowviewid); $scope.TransparencyBoxStartX = newDimes.scaledX1; @@ -8019,7 +8015,6 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l var tCanvasWidthAftrSplit = tCanvasWidth.split("p"); var tCanvasHeight = $(".ui-wrapper").css("height"); var tCanvasHeightAftrSplit = tCanvasHeight.split("p"); - // alert("modesty"); var tCanvasTotalWidth = parseInt(tCanvasLeftAftrSplit[0]) + parseInt(tCanvasWidthAftrSplit[0]); var tCanvasTotalHeight = parseInt(tCanvasTopAftrSplit[0]) + parseInt(tCanvasHeightAftrSplit[0]); var mousePos = $scope.getMousePos(evt.pageX,evt.pageY,windowviewid); @@ -8628,7 +8623,6 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l } function positionTooltip(event, x, y) { - // alert('positionTooltip') x = 100, y = 200, @@ -8651,7 +8645,6 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l function positionTooltip(event, x, y) { - // alert('positionTooltip') x = 100, y = 200, diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js index 7fb7742..da63468 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js @@ -3,10 +3,6 @@ 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", function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, DataService, AuthenticationService, ConfigurationService, LoginConstants, UserModules, LoginMessageConstants, AdminService, $http, AdminConstants, UserTypeConstants, AIAConstants, ModuleService,$window,Idle, Keepalive) { - //$scope.pageToOpen = { - // name: 'MainMenu' - //}; - $rootScope.MULTI_VIEW_ID = 401; $rootScope.pageToOpen = 'app/widget/MainMenu.html'; $rootScope.currentBodyViewId; @@ -106,22 +102,27 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data }, 300); $(fileupload).val('');//old file path + fileupload.onchange = function (e) { var fileId, file, objFileRead; if (typeof window.FileReader !== 'function') { - alert("The file API isn't supported on this browser yet."); + $rootScope.errorMessage = "The file API isn't supported on this browser yet."; + $("#messageModal").modal('show'); return; } fileId = document.getElementById('myPictureFile'); if (!fileId) { - alert("File couldn't find the element."); + $rootScope.errorMessage = "File couldn't find the element."; + $("#messageModal").modal('show'); } else if (!fileId.files) { - alert("This browser doesn't seem to support the `files` property of file inputs."); + $rootScope.errorMessage = "This browser doesn't seem to support the `files` property of file inputs."; + $("#messageModal").modal('show'); } else if (!fileId.files[0]) { - alert("Please select a file before clicking 'Load'"); + $rootScope.errorMessage = "Please select a file before clicking 'Load'."; + $("#messageModal").modal('show'); } else { file = fileId.files[0]; @@ -148,7 +149,8 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data } else { - alert("Please select a file format type jpg/jpeg or png"); + $rootScope.errorMessage = "Please select a file format type jpg/jpeg or png."; + $("#messageModal").modal('show'); } } @@ -179,18 +181,22 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data var fileId, file, objFileRead; if (typeof window.FileReader !== 'function') { - alert("The file API isn't supported on this browser yet."); + $rootScope.errorMessage = "The file API isn't supported on this browser yet."; + $("#messageModal").modal('show'); return; } fileId = document.getElementById('myAnimationFile'); if (!fileId) { - alert("File couldn't find the element."); + $rootScope.errorMessage = "File couldn't find the element."; + $("#messageModal").modal('show'); } else if (!fileId.files) { - alert("This browser doesn't seem to support the `files` property of file inputs."); + $rootScope.errorMessage = "This browser doesn't seem to support the `files` property of file inputs."; + $("#messageModal").modal('show'); } else if (!fileId.files[0]) { - alert("Please select a file before clicking 'Load'"); + $rootScope.errorMessage = "Please select a file before clicking 'Load'."; + $("#messageModal").modal('show'); } else { file = fileId.files[0]; @@ -218,12 +224,14 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data } else { - alert("This Animation video size not allow more than 10MB.Please try again"); + $rootScope.errorMessage = "This Animation video size not allow more than 10MB.Please try again."; + $("#messageModal").modal('show'); } } else { - alert("This Animation video is not in supported format mp4.Please try again"); + $rootScope.errorMessage = "This Animation video is not in supported format.Please try again."; + $("#messageModal").modal('show'); } } @@ -822,7 +830,6 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data $rootScope.errorMessage = ""; if (userInfo.username == "" || userInfo.username == null || userInfo.username == undefined || userInfo.password == "" || userInfo.password == null || userInfo.password == undefined) { - // alert(LoginMessageConstants.USER_CREDENTIALS_MISSING); $rootScope.errorMessage = LoginMessageConstants.USER_CREDENTIALS_MISSING; $("#messageModal").modal('show'); } @@ -837,7 +844,6 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data if (result == LoginConstants.USER_NOT_FOUND) { $rootScope.LoginEnableUI(); $rootScope.isVisibleLogin = true; - // alert(LoginMessageConstants.USER_OR_PASSWORD_INCORRECT); $rootScope.errorMessage = LoginMessageConstants.INVALID_USER; $("#messageModal").modal('show'); } @@ -1148,7 +1154,6 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data function (error) { console.log(' Error in authentication = ' + error.statusText); - // alert(LoginMessageConstants.ERROR_IN_FECTHING_DETAILS); $rootScope.LoginEnableUI(); $rootScope.isVisibleLogin = true; $rootScope.errorMessage = error; @@ -1564,7 +1569,6 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data function (error) { console.log(' Error in authentication = ' + error.statusText); - // alert(LoginMessageConstants.ERROR_IN_FECTHING_DETAILS); $rootScope.LoginEnableUI(); $rootScope.isVisibleLogin = true; $rootScope.errorMessage = error; @@ -1711,13 +1715,11 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data $rootScope.$on('IdleStart', function() { // this event fire when idle time finish and time out start // config set in AIA.js -:IdleProvider.idle(1*30);; - //alert('start'); }); $rootScope.$on('IdleEnd', function() { // this event fires by user activity during timeout period // it reset idle time and timeout // config set in AIA.js -:IdleProvider.interrupt('keydown wheel mousedown touchstart touchmove scroll'); - // alert('end'); }); $rootScope.$on('IdleTimeout', function() { // 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 .then(function (result) { if (result == LoginConstants.USER_NOT_FOUND) { removeEmailPopUp(); - // alert(LoginMessageConstants.INCORRECT_EMAIL_ID); $rootScope.errorMessage = LoginMessageConstants.INCORRECT_EMAIL_ID; $("#messageModal").modal('show'); } else if (result == LoginConstants.MAIL_NOT_SENT) { removeEmailPopUp(); - // alert(LoginMessageConstants.MAIL_NOT_SENT); $rootScope.errorMessage = LoginMessageConstants.MAIL_NOT_SENT; $("#messageModal").modal('show'); } @@ -1872,7 +1872,6 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data } else message = LoginMessageConstants.USERID_SENT_IN_EMAIL - //alert(message); $rootScope.errorMessage = message; $("#messageModal").modal('show'); @@ -1884,20 +1883,17 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data function (error) { console.log(' Error in authentication = ' + error.statusText); removeEmailPopUp(); - // alert(LoginConstants.ERROR_IN_FECTHING_DETAILS); $rootScope.errorMessage = error; $("#messageModal").modal('show'); }); } else { - // alert(LoginMessageConstants.INCORRECT_EMAIL_ID); removeEmailPopUp(); $rootScope.errorMessage = LoginMessageConstants.INCORRECT_EMAIL_ID; $("#messageModal").modal('show'); } } else { - //alert(LoginMessageConstants.BLANK_EMAIL_ID); removeEmailPopUp(); $rootScope.errorMessage = LoginMessageConstants.BLANK_EMAIL_ID; $("#messageModal").modal('show'); @@ -1939,13 +1935,11 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data .then( function (result) { if (result == LoginConstants.USER_NOT_FOUND) { - // alert(LoginMessageConstants.USER_OR_PASSWORD_INCORRECT); $rootScope.errorMessage = LoginMessageConstants.USER_NOT_FOUND; $("#messageModal").modal('show'); } else if (result == LoginConstants.EXCEPTION_OCCURED) { - // alert(LoginMessageConstants.ERROR_IN_FECTHING_DETAILS); $rootScope.errorMessage = LoginConstants.ERROR_IN_FECTHING_DETAILS; $("#messageModal").modal('show'); @@ -1957,7 +1951,6 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data else { //if ((result.IsAcknowledged == true) && (result.IsModifiedCountAvailable == true)) { if (result == LoginMessageConstants.PASSWORD_UPDATE_SUCCESS) { - // alert(LoginMessageConstants.PASSWORD_RESET_MESSAGE); $rootScope.errorMessage = LoginMessageConstants.PASSWORD_RESET_MESSAGE; $("#messageModal").modal('show'); $rootScope.isVisibleLogin = true; @@ -1975,7 +1968,6 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data }, function (error) { console.log(' Error in authentication = ' + error.statusText); - // alert(LoginMessageConstants.ERROR_IN_FECTHING_DETAILS); $rootScope.errorMessage = error; $("#messageModal").modal('show'); @@ -2006,8 +1998,8 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data .then( function (result) { if (result == LoginMessageConstants.USER_UNBLOCK_SUCCESS) { - $rootScope.errorMessage = LoginMessageConstants.USER_UNBLOCK_SUCCESS_MESSAGE; - $("#messageModal").modal('show'); + $rootScope.sucessMessage = LoginMessageConstants.USER_UNBLOCK_SUCCESS_MESSAGE; + $("#successMessageModal").modal('show'); $rootScope.isVisibleLogin = true; $location.url("/"); } @@ -2134,7 +2126,6 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data }); var $inlinehex = $('#inlinecolorhex h3 small'); - //alert($inlinehex); $('#inlinecolors').minicolors({ inline: true, theme: 'bootstrap', @@ -2168,7 +2159,6 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data }); }); var $inlinehex = $('#inlinecolorhex h3 small'); - //alert($inlinehex); $('#inlinecolors').minicolors({ inline: true, theme: 'bootstrap', @@ -3231,7 +3221,6 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data // Dissectible Anatomy > Settings should be disable if Annotation is Open. $rootScope.ShowSettingWindow = function () { if ($(".annotationTollbar").css("display") == "block") { - // alert("already open"); $('#modal-settings').css("display", "none"); $("#modelsettingsbackground").css("display", "none"); } @@ -4236,8 +4225,6 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data document.getElementById('modeleditstyle').style.display = "block"; $("#borderWidthCanvasElement").val($rootScope.shapestyleborderWidth).change(); - // alert(document.getElementById('outlinedivId').style.border); - // alert(document.getElementById('imgOpacity').style.backgroundColor); $('#editstylebackgroundcolor .minicolors >.minicolors-swatch > .minicolors-swatch-color').css("background-color", document.getElementById('imgOpacity').style.backgroundColor); $('#outlineColor .minicolors >.minicolors-swatch > .minicolors-swatch-color').css("background-color", document.getElementById('outlinedivId').style.border); @@ -7004,24 +6991,25 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data function (result) { var k= result; if(result==1){ - $rootScope.errorMessage = AIAConstants.SETTINGS_SAVED ; $('#modal-settings').css("display", "none"); $("#modelsettingsbackground").css("display", "none"); //hide saveSettingsMessageModal $("#saveSettingsMessageModal").modal('hide'); + $rootScope.sucessMessage = AIAConstants.SETTINGS_SAVED + $("#successMessageModal").modal('show'); } - else{ + else + { $rootScope.errorMessage =AIAConstants.SETTING_SAVE_ERROR; + $("#messageModal").modal('show'); } - $("#messageModal").css('zIndex', 80000000000); - $("#messageModal").modal('show'); + }), function (error) { console.log(' Error in Saving settings = ' + error.statusText); - // alert(LoginMessageConstants.ERROR_IN_FECTHING_DETAILS); $rootScope.isVisibleLogin = true; $rootScope.errorMessage = error; $("#messageModal").modal('show'); @@ -7104,7 +7092,6 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data else if (languageDifference == 0) { if ($rootScope.lexiconPrimaryLanguage == $("#primarylaxican").val()) { - // alert("same name"); } else { $rootScope.lexiconLanguageArray[0].id = $rootScope.primaryLangID; @@ -7867,8 +7854,8 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data AdminService.SendAdminAccessRequestMail(userInfo) .then(function (result) { if (result == AdminConstants.MAIL_SENT) { - $rootScope.errorMessage = AdminConstants.MAIL_SENT_SUCCESS_MESSAGE; - $("#messageModal").modal('show'); + $rootScope.sucessMessage =AdminConstants.MAIL_SENT_SUCCESS_MESSAGE + $("#successMessageModal").modal('show'); } $("#adminModal").fadeOut(); $("#adminModal").modal('hide'); diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/LabExercController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/LabExercController.js index afbde24..5c0a84e 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/LabExercController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/LabExercController.js @@ -180,7 +180,6 @@ function ($scope, $rootScope, pages, log, $http, $timeout, DataService, $filter, $scope.scroll = function () { // $window.scrollTo(0, 0); $("html,body").scrollTop(0); - //alert("scroll"); } // $rootScope.currentActiveModuleTitle = pages[8].Name; @@ -1457,7 +1456,6 @@ function ($scope, $rootScope, pages, log, $http, $timeout, DataService, $filter, var labExerciseModulePath = '~/../content/data/json/le/' + keywords + '.json'; DataService.getAnotherJson(labExerciseModulePath).then( function (result) { - //alert(result) $.each(result.LabExercise, function (index, value) { if (result.LabExercise[index].Slug == keywords) { $.each(result.LabExercise[index].Questions, function (index1, value1) { @@ -1559,16 +1557,18 @@ function ($scope, $rootScope, pages, log, $http, $timeout, DataService, $filter, $scope.EnableUI(); $scope.SetLEwindowStoreData(windowviewid, 'isLabExChanged', false); //saved successfully.variable name is not correct but errorMessage represnts message - $rootScope.errorMessage = result; - $("#messageModal").modal('show'); - $('#messageModal').css('z-index', '12000001'); + if (!$rootScope.isCallFromOtherModule) { + $rootScope.sucessMessage = result; + $("#successMessageModal").modal('show'); + $('#successMessageModal').css('z-index', '12000001'); + } + }, function (error) { $scope.EnableUI(); console.log(' Error in saving lab exercise = ' + error.statusText); - // alert(LoginMessageConstants.ERROR_IN_FECTHING_DETAILS); $rootScope.isVisibleLogin = true; $rootScope.errorMessage = error; $("#messageModal").modal('show'); @@ -2200,7 +2200,6 @@ function ($scope, $rootScope, pages, log, $http, $timeout, DataService, $filter, else { $rootScope.closeLabExEmailModel("", windowviewid); var message = LoginConstants.MAIL_NOT_SENT - //alert(message); $rootScope.errorMessage = message; $("#messageModal").modal('show'); $('#messageModal').css('z-index', '12000001'); @@ -2209,7 +2208,6 @@ function ($scope, $rootScope, pages, log, $http, $timeout, DataService, $filter, }, function (error) { var message = LoginConstants.MAIL_NOT_SENT - //alert(message); $rootScope.errorMessage = message; $("#messageModal").modal('show'); $('#messageModal').css('z-index', '12000001'); @@ -2312,7 +2310,6 @@ AIA.directive('imageonload', function () { $('#imgdiv_' + windowviewid).css('width', this.naturalWidth + "px"); }); element.bind('error', function () { - //alert('image could not be loaded'); }); } }; diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/LinkController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/LinkController.js index 3fff875..50544d7 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/LinkController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/LinkController.js @@ -105,7 +105,6 @@ function ($scope, $rootScope, log, $location, pages, $routeParams, $window,$inte $scope.scroll = function () { // $window.scrollTo(0, 0); $("html,body").scrollTop(0); - //alert("scroll"); } }] diff --git a/400-SOURCECODE/AIAHTML5.Web/app/widget/TopMenu.html b/400-SOURCECODE/AIAHTML5.Web/app/widget/TopMenu.html index 54f5a6d..80ed79f 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/widget/TopMenu.html +++ b/400-SOURCECODE/AIAHTML5.Web/app/widget/TopMenu.html @@ -86,7 +86,7 @@ - + diff --git a/400-SOURCECODE/AIAHTML5.Web/index.aspx b/400-SOURCECODE/AIAHTML5.Web/index.aspx index c66c200..7f98785 100644 --- a/400-SOURCECODE/AIAHTML5.Web/index.aspx +++ b/400-SOURCECODE/AIAHTML5.Web/index.aspx @@ -1047,30 +1047,23 @@ -