diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/CommonController.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/CommonController.cs index 3b4ef5d..3e87f6a 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/CommonController.cs +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/CommonController.cs @@ -90,12 +90,12 @@ namespace AIAHTML5.ADMIN.API.Controllers public IHttpActionResult GetDiscountCode() { dbContext.Configuration.ProxyCreationEnabled = false; - List lstDiscountCode1 = new List(); + List lstDiscountCode1 = new List(); string sStartDate = DateTime.MinValue.ToShortDateString(); string sEndDate = DateTime.MaxValue.ToShortDateString(); var spRecordCount = new System.Data.Objects.ObjectParameter("recordCount", 0); - var lstDiscountCode = dbContext.usp_GetDiscountCodes("", "", "", 1, 1, spRecordCount).ToList(); - lstDiscountCode1 = lstDiscountCode.Select(l => new DiscountCodeModel { Id = l.Id, DiscountCode = l.DiscountCode }).ToList(); + var lstDiscountCode = dbContext.usp_GetDiscountCodes("", "", "","Id","asc", 1, 1, spRecordCount).ToList(); + lstDiscountCode1 = lstDiscountCode.Select(l => new usp_GetDiscountCodes_Result { Id = l.Id, DiscountCode = l.DiscountCode }).ToList(); return Ok(lstDiscountCode1); } diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/DiscountCodeController.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/DiscountCodeController.cs index 23e14af..29a90cb 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/DiscountCodeController.cs +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/DiscountCodeController.cs @@ -25,13 +25,13 @@ namespace AIAHTML5.ADMIN.API.Controllers [Route("GetDiscountCodes")] [HttpGet] - public HttpResponseMessage GetDiscountCodes(string discountCode, DateTime startDate, DateTime endDate, int pageNo, int pageLength) + public HttpResponseMessage GetDiscountCodes(string discountCode, DateTime startDate, DateTime endDate, string sortColumn, string sortOrder, int pageNo, int pageLength) { - List DiscountCodeList = new List(); + List DiscountCodeList; int recordCount = 0; try { - DiscountCodeList = DiscountCodeModel.GetDiscountCodes(dbContext, discountCode, startDate, endDate, pageNo, pageLength, out recordCount); + DiscountCodeList = DiscountCodeModel.GetDiscountCodes(dbContext, discountCode, startDate, endDate, sortColumn, sortOrder, pageNo, pageLength, out recordCount); return Request.CreateResponse(HttpStatusCode.OK, new { DiscountCodeList = DiscountCodeList, RecordCount = recordCount }); } catch (Exception ex) diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/LicenseController.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/LicenseController.cs index 1745af0..e451ffe 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/LicenseController.cs +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/LicenseController.cs @@ -43,14 +43,14 @@ namespace AIAHTML5.ADMIN.API.Controllers [HttpGet] public HttpResponseMessage GetLicenses(string accountNumber, string licenseeFirstName, string licenseeLastName, byte licenseTypeId, string institutionName, int stateId, int countryId, string emailId, DateTime subscriptionStartDate, DateTime subscriptionEndDate, - bool isActive, int pageNo, int pageLength) + bool isActive, string sortColumn, string sortOrder, int pageNo, int pageLength) { - List LicenseList = new List(); + List LicenseList; int recordCount = 0; try { LicenseList = LicenseModel.GetLicenses(dbContext, accountNumber, licenseeFirstName, licenseeLastName, licenseTypeId, institutionName, - stateId, countryId, emailId, subscriptionStartDate, subscriptionEndDate, isActive, pageNo, pageLength, out recordCount); + stateId, countryId, emailId, subscriptionStartDate, subscriptionEndDate, isActive, sortColumn, sortOrder, pageNo, pageLength, out recordCount); return Request.CreateResponse(HttpStatusCode.OK, new { LicenseList = LicenseList, RecordCount = recordCount }); } catch (Exception ex) @@ -236,13 +236,13 @@ namespace AIAHTML5.ADMIN.API.Controllers [Route("LicenseSites")] [HttpGet] - public HttpResponseMessage GetLicenseSites(string AccountNo, int pageNo, int pageLength) + public HttpResponseMessage GetLicenseSites(string AccountNo, string sortColumn, string sortOrder, int pageNo, int pageLength) { - List LicenseSiteList = new List(); + List LicenseSiteList; int recordCount = 0; try { - LicenseSiteList = LicenseModel.GetLicenseSites(dbContext, AccountNo, pageNo, pageLength, out recordCount); + LicenseSiteList = LicenseModel.GetLicenseSites(dbContext, AccountNo, sortColumn, sortOrder, pageNo, pageLength, out recordCount); return Request.CreateResponse(HttpStatusCode.OK, new { LicenseSiteList = LicenseSiteList, RecordCount = recordCount }); } catch (Exception ex) diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/ReportController.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/ReportController.cs index 6c1f3e4..c62cb2a 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/ReportController.cs +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/ReportController.cs @@ -22,21 +22,21 @@ namespace AIAHTML5.ADMIN.API.Controllers AIADatabaseV5Entities dbContext = new AIADatabaseV5Entities(); [Route("GetUsageReport")] [HttpGet] - public IHttpActionResult GetUsageReport(string sFromDate, string sToDate, string sAccoutNumber, string sZip, int iState, int iCountry, int pageNo, int pageLength) + public IHttpActionResult GetUsageReport(string sFromDate, string sToDate, string sAccoutNumber, string sZip, int iState, int iCountry, string sortColumn, string sortOrder, int pageNo, int pageLength) { var spRecordCount = new System.Data.Objects.ObjectParameter("recordCount", 0); - var lstUsageReport = dbContext.usp_GetUsageReport(sFromDate, sToDate, sAccoutNumber, sZip, iState, iCountry, pageNo, pageLength, spRecordCount).ToList(); + var lstUsageReport = dbContext.usp_GetUsageReport(sFromDate, sToDate, sAccoutNumber, sZip, iState, iCountry, sortColumn, sortOrder, pageNo, pageLength, spRecordCount).ToList(); return Ok(new { UserUsage = lstUsageReport, RecordCount = spRecordCount.Value }); //return Ok(lstUsageReport); } [Route("GetCustomerSummeryReport")] [HttpGet] - public IHttpActionResult GetCustomerSummeryReport(string sAccoutNumber, string sLicenseeFullName, Nullable iStartPrice, Nullable iEndPrice, int iLicenseType, int iAccountType, string sZip, int iState, int iCountry, int pageNo, int pageLength) + public IHttpActionResult GetCustomerSummeryReport(string sAccoutNumber, string sLicenseeFullName, Nullable iStartPrice, Nullable iEndPrice, int iLicenseType, int iAccountType, string sZip, int iState, int iCountry, string sortColumn, string sortOrder, int pageNo, int pageLength) { var spRecordCount = new System.Data.Objects.ObjectParameter("recordCount", 0); - var lstCustomerSummeryReport = dbContext.usp_GetCustomerSummary(sAccoutNumber, sLicenseeFullName, iStartPrice, iEndPrice, (byte)iLicenseType, (byte)iAccountType, sZip, iState, iCountry, pageNo, pageLength, spRecordCount).ToList(); + var lstCustomerSummeryReport = dbContext.usp_GetCustomerSummary(sAccoutNumber, sLicenseeFullName, iStartPrice, iEndPrice, (byte)iLicenseType, (byte)iAccountType, sZip, iState, iCountry, sortColumn, sortOrder, pageNo, pageLength, spRecordCount).ToList(); return Ok(new { CustomerSummery = lstCustomerSummeryReport, RecordCount = spRecordCount.Value }); //return Ok(lstCustomerSummeryReport); } @@ -44,39 +44,39 @@ namespace AIAHTML5.ADMIN.API.Controllers [Route("GetExpiringSubscriptionReport")] [HttpGet] - public IHttpActionResult GetExpiringSubscriptionReport(string sFromDate, string sToDate, decimal iStartPrice, decimal iEndPrice, int iLicenseTypeId, int iAccountTypeId, string sZip, int iStateId, int iCountryId, int pageNo, int pageLength) + public IHttpActionResult GetExpiringSubscriptionReport(string sFromDate, string sToDate, decimal iStartPrice, decimal iEndPrice, int iLicenseTypeId, int iAccountTypeId, string sZip, int iStateId, int iCountryId, string sortColumn, string sortOrder, int pageNo, int pageLength) { var spRecordCount = new System.Data.Objects.ObjectParameter("recordCount", 0); - var lstExpiringSubscriptionReport = dbContext.usp_GetExpiringLicenses(sFromDate, sToDate, iStartPrice, iEndPrice, (byte)iLicenseTypeId, (byte)iAccountTypeId, sZip, iStateId, iCountryId, pageNo, pageLength, spRecordCount).ToList(); + var lstExpiringSubscriptionReport = dbContext.usp_GetExpiringLicenses(sFromDate, sToDate, iStartPrice, iEndPrice, (byte)iLicenseTypeId, (byte)iAccountTypeId, sZip, iStateId, iCountryId, sortColumn, sortOrder, pageNo, pageLength, spRecordCount).ToList(); return Ok(new { ExpiringSubscription = lstExpiringSubscriptionReport, RecordCount = spRecordCount.Value }); } [Route("GetSubscriptionReport")] [HttpGet] - public IHttpActionResult GetSubscriptionReport(string sFromDate, string sToDate, decimal icStartPrice, decimal icEndPrice, int iLicenseTypeId, int iAccountTypeId, string sZip, int iStateId, int iCountryId, int pageNo, int pageLength) + public IHttpActionResult GetSubscriptionReport(string sFromDate, string sToDate, decimal icStartPrice, decimal icEndPrice, int iLicenseTypeId, int iAccountTypeId, string sZip, int iStateId, int iCountryId, string sortColumn, string sortOrder, int pageNo, int pageLength) { var spRecordCount = new System.Data.Objects.ObjectParameter("recordCount", 0); - var lstExpiringSubscriptionReport = dbContext.usp_GetSubscribedLicenses(sFromDate, sToDate, icStartPrice, icEndPrice, (byte)iLicenseTypeId, (byte)iAccountTypeId, sZip, iStateId, iCountryId, pageNo, pageLength, spRecordCount).ToList(); + var lstExpiringSubscriptionReport = dbContext.usp_GetSubscribedLicenses(sFromDate, sToDate, icStartPrice, icEndPrice, (byte)iLicenseTypeId, (byte)iAccountTypeId, sZip, iStateId, iCountryId, sortColumn, sortOrder, pageNo, pageLength, spRecordCount).ToList(); return Ok(new { Subscription = lstExpiringSubscriptionReport, RecordCount = spRecordCount.Value }); } [Route("GetSubscriptionCancellationReport")] [HttpGet] - public IHttpActionResult GetSubscriptionCancellationReport(string sFromDate, string sToDate, decimal icStartPrice, decimal icEndPrice, int iLicenseTypeId, int iAccountTypeId, string sZip, int iStateId, int iCountryId, int pageNo, int pageLength) + public IHttpActionResult GetSubscriptionCancellationReport(string sFromDate, string sToDate, decimal icStartPrice, decimal icEndPrice, int iLicenseTypeId, int iAccountTypeId, string sZip, int iStateId, int iCountryId, string sortColumn, string sortOrder, int pageNo, int pageLength) { var spRecordCount = new System.Data.Objects.ObjectParameter("recordCount", 0); - var lstExpiringSubscriptionReport = dbContext.usp_GetCancelledLicenses(sFromDate, sToDate, icStartPrice, icEndPrice, (byte)iLicenseTypeId, (byte)iAccountTypeId, sZip, iStateId, iCountryId, pageNo, pageLength, spRecordCount).ToList(); + var lstExpiringSubscriptionReport = dbContext.usp_GetCancelledLicenses(sFromDate, sToDate, icStartPrice, icEndPrice, (byte)iLicenseTypeId, (byte)iAccountTypeId, sZip, iStateId, iCountryId, sortColumn, sortOrder, pageNo, pageLength, spRecordCount).ToList(); return Ok(new { SubscriptionCancel = lstExpiringSubscriptionReport, RecordCount = spRecordCount.Value }); } [Route("GetNetAdSummaryReport")] [HttpGet] - public IHttpActionResult GetNetAdSummaryReport(string sFromDate, string sToDate, decimal iStartPrice, decimal iEndPrice, int iLicenseTypeId, int pageNo, int pageLength) + public IHttpActionResult GetNetAdSummaryReport(string sFromDate, string sToDate, decimal iStartPrice, decimal iEndPrice, int iLicenseTypeId,string sortColumn, string sortOrder, int pageNo, int pageLength) { try { var spRecordCount = new System.Data.Objects.ObjectParameter("recordCount", 0); - var lstNetAdSummaryReport = dbContext.usp_GetNetAdSummaryReport(sFromDate, sToDate, iStartPrice, iEndPrice, (byte)iLicenseTypeId, pageNo, pageLength, spRecordCount).ToList(); + var lstNetAdSummaryReport = dbContext.usp_GetNetAdSummaryReport(sFromDate, sToDate, iStartPrice, iEndPrice, (byte)iLicenseTypeId, sortColumn, sortOrder, pageNo, pageLength, spRecordCount).ToList(); return Ok(new { NetAdSubscriptionList = lstNetAdSummaryReport, RecordCount = spRecordCount.Value }); } catch (Exception ex) @@ -88,12 +88,12 @@ namespace AIAHTML5.ADMIN.API.Controllers [Route("GetSiteLicenseUsageReport")] [HttpGet] - public IHttpActionResult GetSiteLicenseUsageReport(string sFromDate, string sToDate, string sAccountNumber, int iEdition, int pageNo, int pageLength) + public IHttpActionResult GetSiteLicenseUsageReport(string sFromDate, string sToDate, string sAccountNumber, int iEdition, int iloginTypeId, string sortColumn, string sortOrder, int pageNo, int pageLength) { try { var spRecordCount = new System.Data.Objects.ObjectParameter("recordCount", 0); - var lstSiteLicenseUsageReport = dbContext.usp_GetSiteLicenseUsageReports(sFromDate, sToDate, sAccountNumber, (byte)iEdition, pageNo, pageLength, spRecordCount).ToList(); + var lstSiteLicenseUsageReport = dbContext.usp_GetSiteLicenseUsageReports(sFromDate, sToDate, sAccountNumber, (byte)iEdition, (byte)iloginTypeId, sortColumn, sortOrder, pageNo, pageLength, spRecordCount).ToList(); return Ok(new { SiteLicenseUsageList = lstSiteLicenseUsageReport, RecordCount = spRecordCount.Value }); } catch (Exception ex) @@ -104,12 +104,12 @@ namespace AIAHTML5.ADMIN.API.Controllers [Route("GetDiscountReport")] [HttpGet] - public IHttpActionResult GetDiscountReport(string sFromDate, string sToDate, int iDiscountCode, string sAccountNumber, int pageNo, int pageLength) + public IHttpActionResult GetDiscountReport(string sFromDate, string sToDate, int iDiscountCode, string sAccountNumber, string sortColumn, string sortOrder, int pageNo, int pageLength) { try { var spRecordCount = new System.Data.Objects.ObjectParameter("recordCount", 0); - var lstDiscountReport = dbContext.usp_GetDiscountReport(sFromDate, sToDate, iDiscountCode, sAccountNumber, pageNo, pageLength, spRecordCount).ToList(); + var lstDiscountReport = dbContext.usp_GetDiscountReport(sFromDate, sToDate, iDiscountCode, sAccountNumber, sortColumn, sortOrder, pageNo, pageLength, spRecordCount).ToList(); return Ok(new { DiscountReportList = lstDiscountReport, RecordCount = spRecordCount.Value }); } catch (Exception ex) @@ -121,13 +121,13 @@ namespace AIAHTML5.ADMIN.API.Controllers [Route("GetImageExportReport")] [HttpGet] - public IHttpActionResult GetImageExportReport(string sFromDate, string sToDate, string sAccountNumber, int pageNo, int pageLength) + public IHttpActionResult GetImageExportReport(string sFromDate, string sToDate, string sAccountNumber, string sortColumn, string sortOrder, int pageNo, int pageLength) { try { if (sAccountNumber == null) sAccountNumber = string.Empty; var spRecordCount = new System.Data.Objects.ObjectParameter("recordCount", 0); - var lstImageExportReport = dbContext.usp_GetExportedImageDetails(sFromDate, sToDate, sAccountNumber, pageNo, pageLength, spRecordCount).ToList(); + var lstImageExportReport = dbContext.usp_GetExportedImageDetails(sFromDate, sToDate, sAccountNumber, sortColumn, sortOrder, pageNo, pageLength, spRecordCount).ToList(); return Ok(new { ImageExportList = lstImageExportReport, RecordCount = spRecordCount.Value }); } catch (Exception ex) diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/SubscriptionPriceController.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/SubscriptionPriceController.cs index 8ffa76d..136a422 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/SubscriptionPriceController.cs +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/SubscriptionPriceController.cs @@ -25,13 +25,13 @@ namespace AIAHTML5.ADMIN.API.Controllers [Route("GetSubscriptionPrices")] [HttpGet] - public HttpResponseMessage GetSubscriptionPrices(int editionId, int pageNo, int pageLength) + public HttpResponseMessage GetSubscriptionPrices(int editionId, string sortColumn, string sortOrder, int pageNo, int pageLength) { - List SubscriptionPriceList = new List(); + List SubscriptionPriceList; int recordCount = 0; try { - SubscriptionPriceList = SubscriptionPriceModel.GetSubscriptionPrices(dbContext, editionId, pageNo, pageLength, out recordCount); + SubscriptionPriceList = SubscriptionPriceModel.GetSubscriptionPrices(dbContext, editionId, sortColumn, sortOrder, pageNo, pageLength, out recordCount); return Request.CreateResponse(HttpStatusCode.OK, new { SubscriptionPriceList = SubscriptionPriceList, RecordCount = recordCount }); } catch (Exception ex) diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/UserController.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/UserController.cs index b811649..c34c366 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/UserController.cs +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/UserController.cs @@ -186,7 +186,7 @@ namespace AIAHTML5.ADMIN.API.Controllers [Route("Users")] [HttpGet] - public IHttpActionResult UserList(string firstname, string lastname, string emailid, string accountnumber, string usertypeid, string accounttypeid, string userLoginStatus, + public IHttpActionResult UserList(string firstname, string lastname, string emailid, string accountnumber, string usertypeid, string accounttypeid, string userLoginStatus, string sortColumn, string sortOrder, int pageNo, int pageLength, int iLoginUserType,string loggedIn="") { try @@ -198,16 +198,16 @@ namespace AIAHTML5.ADMIN.API.Controllers dbContext.Configuration.ProxyCreationEnabled = false; //var spStatus = new System.Data.Objects.ObjectParameter("Status", 0); var spRecordCount = new System.Data.Objects.ObjectParameter("recordCount", 0); - //recordCount = (int)spRecordCount.Value; - List Users = dbContext.usp_GetUsersList(firstname, lastname, emailid, accountnumber, UserTypeId, AccountTypeId, iLoginUserType, loginStatus, pageNo, pageLength, spRecordCount).ToList(); + recordCount = (int)spRecordCount.Value; + List Users = dbContext.usp_GetUsersList(firstname, lastname, emailid, accountnumber, UserTypeId, AccountTypeId, iLoginUserType, loginStatus, sortColumn, sortOrder, pageNo, pageLength, spRecordCount).ToList(); if (!string.IsNullOrEmpty(loggedIn)) - { + { if (Users.Where(s => s.LoginId == loggedIn).Count() > 0) - { + { Users = Users.Where(s => s.LoginId != loggedIn).ToList(); spRecordCount.Value = (int)spRecordCount.Value - 1; } - + } return Ok(new { UserList = Users, RecordCount = spRecordCount.Value }); } diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/UserGroupController.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/UserGroupController.cs index 0f804ed..64968a4 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/UserGroupController.cs +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/UserGroupController.cs @@ -24,13 +24,13 @@ namespace AIAHTML5.ADMIN.API.Controllers [Route("LicenseUserGroups")] [HttpGet] - public HttpResponseMessage GetLicenseUserGroups(int? LicenseId, int pageNo, int pageLength) + public HttpResponseMessage GetLicenseUserGroups(int? LicenseId, string sortColumn, string sortOrder, int pageNo, int pageLength) { - List UserGroupList = new List(); + List UserGroupList; int recordCount = 0; try { - UserGroupList = UserGroupModel.GetLicenseUserGroups(dbContext, LicenseId, pageNo, pageLength, out recordCount); + UserGroupList = UserGroupModel.GetLicenseUserGroups(dbContext, LicenseId, sortColumn, sortOrder,pageNo, pageLength, out recordCount); return Request.CreateResponse(HttpStatusCode.OK, new { UserGroupList = UserGroupList, RecordCount = recordCount }); } catch (Exception ex) @@ -42,13 +42,13 @@ namespace AIAHTML5.ADMIN.API.Controllers [Route("LicenseUserGroupUsers")] [HttpGet] - public HttpResponseMessage GetLicenseUserGroupUsers(int? LicenseId, int UserGroupId, bool AllUsers, int pageNo, int pageLength) + public HttpResponseMessage GetLicenseUserGroupUsers(int? LicenseId, int UserGroupId, bool AllUsers, string sortColumn, string sortOrder, int pageNo, int pageLength) { - List UserList = new List(); + List UserList ; int recordCount = 0; try { - UserList = UserGroupModel.GetLicenseUserGroupUsers(dbContext, LicenseId, UserGroupId, AllUsers, pageNo, pageLength, out recordCount); + UserList = UserGroupModel.GetLicenseUserGroupUsers(dbContext, LicenseId, UserGroupId, AllUsers, sortColumn, sortOrder, pageNo, pageLength, out recordCount); return Request.CreateResponse(HttpStatusCode.OK, new { UserList = UserList, RecordCount = recordCount }); } catch (Exception ex) diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.Context.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.Context.cs index 3a68d29..005c9f6 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.Context.cs +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.Context.cs @@ -3095,7 +3095,7 @@ namespace AIAHTML5.ADMIN.API.Entity return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_GetLicenses", sStartDateParameter, sEndDateParameter, sAccoutNumberParameter, sLicenseeFirstNameParameter, sLicenseeLastNameParameter, iLicenseTypeIdParameter, sInstituteNameParameter, sEmailParameter, iStateIdParameter, iCountryIdParameter, bisActiveParameter, pageNoParameter, pageLengthParameter, recordCount); } - public virtual ObjectResult usp_GetlicensesList(string sStartDate, string sEndDate, string sAccoutNumber, string sLicenseeFirstName, string sLicenseeLastName, Nullable iLicenseTypeId, string sInstituteName, string sEmail, Nullable iStateId, Nullable iCountryId, Nullable bisActive, Nullable pageNo, Nullable pageLength, ObjectParameter recordCount) + public virtual ObjectResult usp_GetlicensesList(string sStartDate, string sEndDate, string sAccoutNumber, string sLicenseeFirstName, string sLicenseeLastName, Nullable iLicenseTypeId, string sInstituteName, string sEmail, Nullable iStateId, Nullable iCountryId, Nullable bisActive, string sortColumn, string sortOrder, Nullable pageNo, Nullable pageLength, ObjectParameter recordCount) { var sStartDateParameter = sStartDate != null ? new ObjectParameter("sStartDate", sStartDate) : @@ -3141,6 +3141,14 @@ namespace AIAHTML5.ADMIN.API.Entity new ObjectParameter("bisActive", bisActive) : new ObjectParameter("bisActive", typeof(bool)); + var sortColumnParameter = sortColumn != null ? + new ObjectParameter("sortColumn", sortColumn) : + new ObjectParameter("sortColumn", typeof(string)); + + var sortOrderParameter = sortOrder != null ? + new ObjectParameter("sortOrder", sortOrder) : + new ObjectParameter("sortOrder", typeof(string)); + var pageNoParameter = pageNo.HasValue ? new ObjectParameter("pageNo", pageNo) : new ObjectParameter("pageNo", typeof(int)); @@ -3149,7 +3157,7 @@ namespace AIAHTML5.ADMIN.API.Entity new ObjectParameter("pageLength", pageLength) : new ObjectParameter("pageLength", typeof(int)); - return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_GetlicensesList", sStartDateParameter, sEndDateParameter, sAccoutNumberParameter, sLicenseeFirstNameParameter, sLicenseeLastNameParameter, iLicenseTypeIdParameter, sInstituteNameParameter, sEmailParameter, iStateIdParameter, iCountryIdParameter, bisActiveParameter, pageNoParameter, pageLengthParameter, recordCount); + return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_GetlicensesList", sStartDateParameter, sEndDateParameter, sAccoutNumberParameter, sLicenseeFirstNameParameter, sLicenseeLastNameParameter, iLicenseTypeIdParameter, sInstituteNameParameter, sEmailParameter, iStateIdParameter, iCountryIdParameter, bisActiveParameter, sortColumnParameter, sortOrderParameter, pageNoParameter, pageLengthParameter, recordCount); } public virtual ObjectResult usp_GetLicenseTypes() @@ -3157,12 +3165,20 @@ namespace AIAHTML5.ADMIN.API.Entity return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_GetLicenseTypes"); } - public virtual ObjectResult usp_GetLicenseUserGroups(Nullable licenseId, Nullable pageNo, Nullable pageLength, ObjectParameter recordCount) + public virtual ObjectResult usp_GetLicenseUserGroups(Nullable licenseId, string sortColumn, string sortOrder, Nullable pageNo, Nullable pageLength, ObjectParameter recordCount) { var licenseIdParameter = licenseId.HasValue ? new ObjectParameter("LicenseId", licenseId) : new ObjectParameter("LicenseId", typeof(int)); + var sortColumnParameter = sortColumn != null ? + new ObjectParameter("sortColumn", sortColumn) : + new ObjectParameter("sortColumn", typeof(string)); + + var sortOrderParameter = sortOrder != null ? + new ObjectParameter("sortOrder", sortOrder) : + new ObjectParameter("sortOrder", typeof(string)); + var pageNoParameter = pageNo.HasValue ? new ObjectParameter("pageNo", pageNo) : new ObjectParameter("pageNo", typeof(int)); @@ -3171,7 +3187,7 @@ namespace AIAHTML5.ADMIN.API.Entity new ObjectParameter("pageLength", pageLength) : new ObjectParameter("pageLength", typeof(int)); - return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_GetLicenseUserGroups", licenseIdParameter, pageNoParameter, pageLengthParameter, recordCount); + return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_GetLicenseUserGroups", licenseIdParameter, sortColumnParameter, sortOrderParameter, pageNoParameter, pageLengthParameter, recordCount); } public virtual ObjectResult usp_GetManageRights(Nullable userId, string roleName) @@ -3218,12 +3234,20 @@ namespace AIAHTML5.ADMIN.API.Entity return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_GetSiteById", siteIdParameter); } - public virtual ObjectResult usp_GetSubscriptionPlans(Nullable iEditionId, Nullable pageNo, Nullable pageLength, ObjectParameter recordCount) + public virtual ObjectResult usp_GetSubscriptionPlans(Nullable iEditionId, string sortColumn, string sortOrder, Nullable pageNo, Nullable pageLength, ObjectParameter recordCount) { var iEditionIdParameter = iEditionId.HasValue ? new ObjectParameter("iEditionId", iEditionId) : new ObjectParameter("iEditionId", typeof(byte)); + var sortColumnParameter = sortColumn != null ? + new ObjectParameter("sortColumn", sortColumn) : + new ObjectParameter("sortColumn", typeof(string)); + + var sortOrderParameter = sortOrder != null ? + new ObjectParameter("sortOrder", sortOrder) : + new ObjectParameter("sortOrder", typeof(string)); + var pageNoParameter = pageNo.HasValue ? new ObjectParameter("pageNo", pageNo) : new ObjectParameter("pageNo", typeof(int)); @@ -3232,7 +3256,7 @@ namespace AIAHTML5.ADMIN.API.Entity new ObjectParameter("pageLength", pageLength) : new ObjectParameter("pageLength", typeof(int)); - return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_GetSubscriptionPlans", iEditionIdParameter, pageNoParameter, pageLengthParameter, recordCount); + return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_GetSubscriptionPlans", iEditionIdParameter, sortColumnParameter, sortOrderParameter, pageNoParameter, pageLengthParameter, recordCount); } public virtual ObjectResult usp_GetUserType(Nullable id) @@ -3638,7 +3662,7 @@ namespace AIAHTML5.ADMIN.API.Entity return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("uspInsertBulkRow"); } - public virtual ObjectResult usp_GetLicenseUserGroupUsers(Nullable licenseId, Nullable groupId, Nullable allUsers, Nullable pageNo, Nullable pageLength, ObjectParameter recordCount) + public virtual ObjectResult usp_GetLicenseUserGroupUsers(Nullable licenseId, Nullable groupId, Nullable allUsers, string sortColumn, string sortOrder, Nullable pageNo, Nullable pageLength, ObjectParameter recordCount) { var licenseIdParameter = licenseId.HasValue ? new ObjectParameter("licenseId", licenseId) : @@ -3652,6 +3676,14 @@ namespace AIAHTML5.ADMIN.API.Entity new ObjectParameter("allUsers", allUsers) : new ObjectParameter("allUsers", typeof(bool)); + var sortColumnParameter = sortColumn != null ? + new ObjectParameter("sortColumn", sortColumn) : + new ObjectParameter("sortColumn", typeof(string)); + + var sortOrderParameter = sortOrder != null ? + new ObjectParameter("sortOrder", sortOrder) : + new ObjectParameter("sortOrder", typeof(string)); + var pageNoParameter = pageNo.HasValue ? new ObjectParameter("pageNo", pageNo) : new ObjectParameter("pageNo", typeof(int)); @@ -3660,7 +3692,7 @@ namespace AIAHTML5.ADMIN.API.Entity new ObjectParameter("pageLength", pageLength) : new ObjectParameter("pageLength", typeof(int)); - return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_GetLicenseUserGroupUsers", licenseIdParameter, groupIdParameter, allUsersParameter, pageNoParameter, pageLengthParameter, recordCount); + return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_GetLicenseUserGroupUsers", licenseIdParameter, groupIdParameter, allUsersParameter, sortColumnParameter, sortOrderParameter, pageNoParameter, pageLengthParameter, recordCount); } public virtual ObjectResult usp_InsertResellerLicenseAccount(string sLicenseeFname, string sLicenseeLname, Nullable iLicenseTypeId, Nullable iAccountTypeId, string sInstitutionName, string sAddress1, string sAddress2, string sCity, string sZip, Nullable iStateId, Nullable iCountryId, string sPhone, string sEmailId, Nullable iTotalLogins, string sStartDate, string sEndDate, string sEditionList, Nullable iTotalPrice, Nullable iCreatorId, string sProductKey, Nullable iNoofImages) @@ -3783,12 +3815,20 @@ namespace AIAHTML5.ADMIN.API.Entity return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_GetSiteAccountAdmin", accountNumberParameter); } - public virtual ObjectResult usp_GetSiteAccountSites(string strAccountNumber, Nullable pageNo, Nullable pageLength, ObjectParameter recordCount) + public virtual ObjectResult usp_GetSiteAccountSites(string strAccountNumber, string sortColumn, string sortOrder, Nullable pageNo, Nullable pageLength, ObjectParameter recordCount) { var strAccountNumberParameter = strAccountNumber != null ? new ObjectParameter("strAccountNumber", strAccountNumber) : new ObjectParameter("strAccountNumber", typeof(string)); + var sortColumnParameter = sortColumn != null ? + new ObjectParameter("sortColumn", sortColumn) : + new ObjectParameter("sortColumn", typeof(string)); + + var sortOrderParameter = sortOrder != null ? + new ObjectParameter("sortOrder", sortOrder) : + new ObjectParameter("sortOrder", typeof(string)); + var pageNoParameter = pageNo.HasValue ? new ObjectParameter("pageNo", pageNo) : new ObjectParameter("pageNo", typeof(int)); @@ -3797,7 +3837,7 @@ namespace AIAHTML5.ADMIN.API.Entity new ObjectParameter("pageLength", pageLength) : new ObjectParameter("pageLength", typeof(int)); - return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_GetSiteAccountSites", strAccountNumberParameter, pageNoParameter, pageLengthParameter, recordCount); + return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_GetSiteAccountSites", strAccountNumberParameter, sortColumnParameter, sortOrderParameter, pageNoParameter, pageLengthParameter, recordCount); } public virtual ObjectResult usp_DeleteLicense(Nullable iLicenseId) @@ -3851,7 +3891,7 @@ namespace AIAHTML5.ADMIN.API.Entity return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_GetBlockedUserByAccNoAndType", iUserTypeIdParameter, iLicenseIdParameter); } - public virtual ObjectResult usp_GetCancelledLicenses(string sFromDate, string sToDate, Nullable iStartPrice, Nullable iEndPrice, Nullable iLicenseTypeId, Nullable iAccountTypeId, string sZip, Nullable iStateId, Nullable iCountryId, Nullable pageNo, Nullable pageLength, ObjectParameter recordCount) + public virtual ObjectResult usp_GetCancelledLicenses(string sFromDate, string sToDate, Nullable iStartPrice, Nullable iEndPrice, Nullable iLicenseTypeId, Nullable iAccountTypeId, string sZip, Nullable iStateId, Nullable iCountryId, string sortColumn, string sortOrder, Nullable pageNo, Nullable pageLength, ObjectParameter recordCount) { var sFromDateParameter = sFromDate != null ? new ObjectParameter("sFromDate", sFromDate) : @@ -3889,6 +3929,14 @@ namespace AIAHTML5.ADMIN.API.Entity new ObjectParameter("iCountryId", iCountryId) : new ObjectParameter("iCountryId", typeof(int)); + var sortColumnParameter = sortColumn != null ? + new ObjectParameter("sortColumn", sortColumn) : + new ObjectParameter("sortColumn", typeof(string)); + + var sortOrderParameter = sortOrder != null ? + new ObjectParameter("sortOrder", sortOrder) : + new ObjectParameter("sortOrder", typeof(string)); + var pageNoParameter = pageNo.HasValue ? new ObjectParameter("pageNo", pageNo) : new ObjectParameter("pageNo", typeof(int)); @@ -3897,10 +3945,10 @@ namespace AIAHTML5.ADMIN.API.Entity new ObjectParameter("pageLength", pageLength) : new ObjectParameter("pageLength", typeof(int)); - return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_GetCancelledLicenses", sFromDateParameter, sToDateParameter, iStartPriceParameter, iEndPriceParameter, iLicenseTypeIdParameter, iAccountTypeIdParameter, sZipParameter, iStateIdParameter, iCountryIdParameter, pageNoParameter, pageLengthParameter, recordCount); + return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_GetCancelledLicenses", sFromDateParameter, sToDateParameter, iStartPriceParameter, iEndPriceParameter, iLicenseTypeIdParameter, iAccountTypeIdParameter, sZipParameter, iStateIdParameter, iCountryIdParameter, sortColumnParameter, sortOrderParameter, pageNoParameter, pageLengthParameter, recordCount); } - public virtual ObjectResult usp_GetCustomerSummary(string sAccoutNumber, string sLicenseeFullName, Nullable iStartPrice, Nullable iEndPrice, Nullable iLicenseType, Nullable iAccountType, string sZip, Nullable iState, Nullable iCountry, Nullable pageNo, Nullable pageLength, ObjectParameter recordCount) + public virtual ObjectResult usp_GetCustomerSummary(string sAccoutNumber, string sLicenseeFullName, Nullable iStartPrice, Nullable iEndPrice, Nullable iLicenseType, Nullable iAccountType, string sZip, Nullable iState, Nullable iCountry, string sortColumn, string sortOrder, Nullable pageNo, Nullable pageLength, ObjectParameter recordCount) { var sAccoutNumberParameter = sAccoutNumber != null ? new ObjectParameter("sAccoutNumber", sAccoutNumber) : @@ -3938,6 +3986,14 @@ namespace AIAHTML5.ADMIN.API.Entity new ObjectParameter("iCountry", iCountry) : new ObjectParameter("iCountry", typeof(int)); + var sortColumnParameter = sortColumn != null ? + new ObjectParameter("sortColumn", sortColumn) : + new ObjectParameter("sortColumn", typeof(string)); + + var sortOrderParameter = sortOrder != null ? + new ObjectParameter("sortOrder", sortOrder) : + new ObjectParameter("sortOrder", typeof(string)); + var pageNoParameter = pageNo.HasValue ? new ObjectParameter("pageNo", pageNo) : new ObjectParameter("pageNo", typeof(int)); @@ -3946,10 +4002,10 @@ namespace AIAHTML5.ADMIN.API.Entity new ObjectParameter("pageLength", pageLength) : new ObjectParameter("pageLength", typeof(int)); - return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_GetCustomerSummary", sAccoutNumberParameter, sLicenseeFullNameParameter, iStartPriceParameter, iEndPriceParameter, iLicenseTypeParameter, iAccountTypeParameter, sZipParameter, iStateParameter, iCountryParameter, pageNoParameter, pageLengthParameter, recordCount); + return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_GetCustomerSummary", sAccoutNumberParameter, sLicenseeFullNameParameter, iStartPriceParameter, iEndPriceParameter, iLicenseTypeParameter, iAccountTypeParameter, sZipParameter, iStateParameter, iCountryParameter, sortColumnParameter, sortOrderParameter, pageNoParameter, pageLengthParameter, recordCount); } - public virtual ObjectResult usp_GetDiscountCodes(string sDiscountCode, string sStartDate, string sEndDate, Nullable pageNo, Nullable pageLength, ObjectParameter recordCount) + public virtual ObjectResult usp_GetDiscountCodes(string sDiscountCode, string sStartDate, string sEndDate, string sortColumn, string sortOrder, Nullable pageNo, Nullable pageLength, ObjectParameter recordCount) { var sDiscountCodeParameter = sDiscountCode != null ? new ObjectParameter("sDiscountCode", sDiscountCode) : @@ -3963,6 +4019,14 @@ namespace AIAHTML5.ADMIN.API.Entity new ObjectParameter("sEndDate", sEndDate) : new ObjectParameter("sEndDate", typeof(string)); + var sortColumnParameter = sortColumn != null ? + new ObjectParameter("sortColumn", sortColumn) : + new ObjectParameter("sortColumn", typeof(string)); + + var sortOrderParameter = sortOrder != null ? + new ObjectParameter("sortOrder", sortOrder) : + new ObjectParameter("sortOrder", typeof(string)); + var pageNoParameter = pageNo.HasValue ? new ObjectParameter("pageNo", pageNo) : new ObjectParameter("pageNo", typeof(int)); @@ -3971,10 +4035,10 @@ namespace AIAHTML5.ADMIN.API.Entity new ObjectParameter("pageLength", pageLength) : new ObjectParameter("pageLength", typeof(int)); - return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_GetDiscountCodes", sDiscountCodeParameter, sStartDateParameter, sEndDateParameter, pageNoParameter, pageLengthParameter, recordCount); + return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_GetDiscountCodes", sDiscountCodeParameter, sStartDateParameter, sEndDateParameter, sortColumnParameter, sortOrderParameter, pageNoParameter, pageLengthParameter, recordCount); } - public virtual ObjectResult usp_GetDiscountReport(string sStartDate, string sEndDate, Nullable intDiscountID, string sAccoutNumber, Nullable pageNo, Nullable pageLength, ObjectParameter recordCount) + public virtual ObjectResult usp_GetDiscountReport(string sStartDate, string sEndDate, Nullable intDiscountID, string sAccoutNumber, string sortColumn, string sortOrder, Nullable pageNo, Nullable pageLength, ObjectParameter recordCount) { var sStartDateParameter = sStartDate != null ? new ObjectParameter("sStartDate", sStartDate) : @@ -3992,6 +4056,14 @@ namespace AIAHTML5.ADMIN.API.Entity new ObjectParameter("sAccoutNumber", sAccoutNumber) : new ObjectParameter("sAccoutNumber", typeof(string)); + var sortColumnParameter = sortColumn != null ? + new ObjectParameter("sortColumn", sortColumn) : + new ObjectParameter("sortColumn", typeof(string)); + + var sortOrderParameter = sortOrder != null ? + new ObjectParameter("sortOrder", sortOrder) : + new ObjectParameter("sortOrder", typeof(string)); + var pageNoParameter = pageNo.HasValue ? new ObjectParameter("pageNo", pageNo) : new ObjectParameter("pageNo", typeof(int)); @@ -4000,10 +4072,10 @@ namespace AIAHTML5.ADMIN.API.Entity new ObjectParameter("pageLength", pageLength) : new ObjectParameter("pageLength", typeof(int)); - return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_GetDiscountReport", sStartDateParameter, sEndDateParameter, intDiscountIDParameter, sAccoutNumberParameter, pageNoParameter, pageLengthParameter, recordCount); + return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_GetDiscountReport", sStartDateParameter, sEndDateParameter, intDiscountIDParameter, sAccoutNumberParameter, sortColumnParameter, sortOrderParameter, pageNoParameter, pageLengthParameter, recordCount); } - public virtual ObjectResult usp_GetExpiringLicenses(string sFromDate, string sToDate, Nullable iStartPrice, Nullable iEndPrice, Nullable iLicenseTypeId, Nullable iAccountTypeId, string sZip, Nullable iStateId, Nullable iCountryId, Nullable pageNo, Nullable pageLength, ObjectParameter recordCount) + public virtual ObjectResult usp_GetExpiringLicenses(string sFromDate, string sToDate, Nullable iStartPrice, Nullable iEndPrice, Nullable iLicenseTypeId, Nullable iAccountTypeId, string sZip, Nullable iStateId, Nullable iCountryId, string sortColumn, string sortOrder, Nullable pageNo, Nullable pageLength, ObjectParameter recordCount) { var sFromDateParameter = sFromDate != null ? new ObjectParameter("sFromDate", sFromDate) : @@ -4041,6 +4113,14 @@ namespace AIAHTML5.ADMIN.API.Entity new ObjectParameter("iCountryId", iCountryId) : new ObjectParameter("iCountryId", typeof(int)); + var sortColumnParameter = sortColumn != null ? + new ObjectParameter("sortColumn", sortColumn) : + new ObjectParameter("sortColumn", typeof(string)); + + var sortOrderParameter = sortOrder != null ? + new ObjectParameter("sortOrder", sortOrder) : + new ObjectParameter("sortOrder", typeof(string)); + var pageNoParameter = pageNo.HasValue ? new ObjectParameter("pageNo", pageNo) : new ObjectParameter("pageNo", typeof(int)); @@ -4049,10 +4129,10 @@ namespace AIAHTML5.ADMIN.API.Entity new ObjectParameter("pageLength", pageLength) : new ObjectParameter("pageLength", typeof(int)); - return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_GetExpiringLicenses", sFromDateParameter, sToDateParameter, iStartPriceParameter, iEndPriceParameter, iLicenseTypeIdParameter, iAccountTypeIdParameter, sZipParameter, iStateIdParameter, iCountryIdParameter, pageNoParameter, pageLengthParameter, recordCount); + return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_GetExpiringLicenses", sFromDateParameter, sToDateParameter, iStartPriceParameter, iEndPriceParameter, iLicenseTypeIdParameter, iAccountTypeIdParameter, sZipParameter, iStateIdParameter, iCountryIdParameter, sortColumnParameter, sortOrderParameter, pageNoParameter, pageLengthParameter, recordCount); } - public virtual ObjectResult usp_GetExportedImageDetails(string sStartDate, string sEndDate, string sAccoutNumber, Nullable pageNo, Nullable pageLength, ObjectParameter recordCount) + public virtual ObjectResult usp_GetExportedImageDetails(string sStartDate, string sEndDate, string sAccoutNumber, string sortColumn, string sortOrder, Nullable pageNo, Nullable pageLength, ObjectParameter recordCount) { var sStartDateParameter = sStartDate != null ? new ObjectParameter("sStartDate", sStartDate) : @@ -4066,6 +4146,14 @@ namespace AIAHTML5.ADMIN.API.Entity new ObjectParameter("sAccoutNumber", sAccoutNumber) : new ObjectParameter("sAccoutNumber", typeof(string)); + var sortColumnParameter = sortColumn != null ? + new ObjectParameter("sortColumn", sortColumn) : + new ObjectParameter("sortColumn", typeof(string)); + + var sortOrderParameter = sortOrder != null ? + new ObjectParameter("sortOrder", sortOrder) : + new ObjectParameter("sortOrder", typeof(string)); + var pageNoParameter = pageNo.HasValue ? new ObjectParameter("pageNo", pageNo) : new ObjectParameter("pageNo", typeof(int)); @@ -4074,7 +4162,7 @@ namespace AIAHTML5.ADMIN.API.Entity new ObjectParameter("pageLength", pageLength) : new ObjectParameter("pageLength", typeof(int)); - return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_GetExportedImageDetails", sStartDateParameter, sEndDateParameter, sAccoutNumberParameter, pageNoParameter, pageLengthParameter, recordCount); + return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_GetExportedImageDetails", sStartDateParameter, sEndDateParameter, sAccoutNumberParameter, sortColumnParameter, sortOrderParameter, pageNoParameter, pageLengthParameter, recordCount); } public virtual ObjectResult> usp_GetIncorrectLoginAttempt(Nullable iUserId) @@ -4126,7 +4214,7 @@ namespace AIAHTML5.ADMIN.API.Entity return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_GetModuleStatusByLicenseId", iLicenseIdParameter); } - public virtual ObjectResult usp_GetNetAdSummaryReport(string sFromDate, string sToDate, Nullable iStartPrice, Nullable iEndPrice, Nullable iLicenseTypeId, Nullable pageNo, Nullable pageLength, ObjectParameter recordCount) + public virtual ObjectResult usp_GetNetAdSummaryReport(string sFromDate, string sToDate, Nullable iStartPrice, Nullable iEndPrice, Nullable iLicenseTypeId, string sortColumn, string sortOrder, Nullable pageNo, Nullable pageLength, ObjectParameter recordCount) { var sFromDateParameter = sFromDate != null ? new ObjectParameter("sFromDate", sFromDate) : @@ -4148,6 +4236,14 @@ namespace AIAHTML5.ADMIN.API.Entity new ObjectParameter("iLicenseTypeId", iLicenseTypeId) : new ObjectParameter("iLicenseTypeId", typeof(byte)); + var sortColumnParameter = sortColumn != null ? + new ObjectParameter("sortColumn", sortColumn) : + new ObjectParameter("sortColumn", typeof(string)); + + var sortOrderParameter = sortOrder != null ? + new ObjectParameter("sortOrder", sortOrder) : + new ObjectParameter("sortOrder", typeof(string)); + var pageNoParameter = pageNo.HasValue ? new ObjectParameter("pageNo", pageNo) : new ObjectParameter("pageNo", typeof(int)); @@ -4156,7 +4252,7 @@ namespace AIAHTML5.ADMIN.API.Entity new ObjectParameter("pageLength", pageLength) : new ObjectParameter("pageLength", typeof(int)); - return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_GetNetAdSummaryReport", sFromDateParameter, sToDateParameter, iStartPriceParameter, iEndPriceParameter, iLicenseTypeIdParameter, pageNoParameter, pageLengthParameter, recordCount); + return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_GetNetAdSummaryReport", sFromDateParameter, sToDateParameter, iStartPriceParameter, iEndPriceParameter, iLicenseTypeIdParameter, sortColumnParameter, sortOrderParameter, pageNoParameter, pageLengthParameter, recordCount); } public virtual ObjectResult usp_GetSearchUser(string sFirstName, string sLastName, string sEmailId, string sAccoutNumber, Nullable iUserTypeId, Nullable iAccountTypeId, Nullable iLoginUserType, Nullable pageNo, Nullable pageLength, ObjectParameter recordCount) @@ -4259,7 +4355,7 @@ namespace AIAHTML5.ADMIN.API.Entity return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_GetSiteLicenseUsageReport", sFromDateParameter, sToDateParameter, sAccoutNumberParameter, iEditionIdParameter, pageNoParameter, pageLengthParameter, recordCount); } - public virtual ObjectResult usp_GetSiteLicenseUsageReports(string sFromDate, string sToDate, string sAccoutNumber, Nullable iEditionId, Nullable pageNo, Nullable pageLength, ObjectParameter recordCount) + public virtual ObjectResult usp_GetSiteLicenseUsageReports(string sFromDate, string sToDate, string sAccoutNumber, Nullable iEditionId, Nullable iloginTypeId, string sortColumn, string sortOrder, Nullable pageNo, Nullable pageLength, ObjectParameter recordCount) { var sFromDateParameter = sFromDate != null ? new ObjectParameter("sFromDate", sFromDate) : @@ -4277,6 +4373,18 @@ namespace AIAHTML5.ADMIN.API.Entity new ObjectParameter("iEditionId", iEditionId) : new ObjectParameter("iEditionId", typeof(byte)); + var iloginTypeIdParameter = iloginTypeId.HasValue ? + new ObjectParameter("iloginTypeId", iloginTypeId) : + new ObjectParameter("iloginTypeId", typeof(byte)); + + var sortColumnParameter = sortColumn != null ? + new ObjectParameter("sortColumn", sortColumn) : + new ObjectParameter("sortColumn", typeof(string)); + + var sortOrderParameter = sortOrder != null ? + new ObjectParameter("sortOrder", sortOrder) : + new ObjectParameter("sortOrder", typeof(string)); + var pageNoParameter = pageNo.HasValue ? new ObjectParameter("pageNo", pageNo) : new ObjectParameter("pageNo", typeof(int)); @@ -4285,10 +4393,10 @@ namespace AIAHTML5.ADMIN.API.Entity new ObjectParameter("pageLength", pageLength) : new ObjectParameter("pageLength", typeof(int)); - return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_GetSiteLicenseUsageReports", sFromDateParameter, sToDateParameter, sAccoutNumberParameter, iEditionIdParameter, pageNoParameter, pageLengthParameter, recordCount); + return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_GetSiteLicenseUsageReports", sFromDateParameter, sToDateParameter, sAccoutNumberParameter, iEditionIdParameter, iloginTypeIdParameter, sortColumnParameter, sortOrderParameter, pageNoParameter, pageLengthParameter, recordCount); } - public virtual ObjectResult usp_GetSubscribedLicenses(string sFromDate, string sToDate, Nullable iStartPrice, Nullable iEndPrice, Nullable iLicenseTypeId, Nullable iAccountTypeId, string sZip, Nullable iStateId, Nullable iCountryId, Nullable pageNo, Nullable pageLength, ObjectParameter recordCount) + public virtual ObjectResult usp_GetSubscribedLicenses(string sFromDate, string sToDate, Nullable iStartPrice, Nullable iEndPrice, Nullable iLicenseTypeId, Nullable iAccountTypeId, string sZip, Nullable iStateId, Nullable iCountryId, string sortColumn, string sortOrder, Nullable pageNo, Nullable pageLength, ObjectParameter recordCount) { var sFromDateParameter = sFromDate != null ? new ObjectParameter("sFromDate", sFromDate) : @@ -4326,6 +4434,14 @@ namespace AIAHTML5.ADMIN.API.Entity new ObjectParameter("iCountryId", iCountryId) : new ObjectParameter("iCountryId", typeof(int)); + var sortColumnParameter = sortColumn != null ? + new ObjectParameter("sortColumn", sortColumn) : + new ObjectParameter("sortColumn", typeof(string)); + + var sortOrderParameter = sortOrder != null ? + new ObjectParameter("sortOrder", sortOrder) : + new ObjectParameter("sortOrder", typeof(string)); + var pageNoParameter = pageNo.HasValue ? new ObjectParameter("pageNo", pageNo) : new ObjectParameter("pageNo", typeof(int)); @@ -4334,10 +4450,10 @@ namespace AIAHTML5.ADMIN.API.Entity new ObjectParameter("pageLength", pageLength) : new ObjectParameter("pageLength", typeof(int)); - return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_GetSubscribedLicenses", sFromDateParameter, sToDateParameter, iStartPriceParameter, iEndPriceParameter, iLicenseTypeIdParameter, iAccountTypeIdParameter, sZipParameter, iStateIdParameter, iCountryIdParameter, pageNoParameter, pageLengthParameter, recordCount); + return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_GetSubscribedLicenses", sFromDateParameter, sToDateParameter, iStartPriceParameter, iEndPriceParameter, iLicenseTypeIdParameter, iAccountTypeIdParameter, sZipParameter, iStateIdParameter, iCountryIdParameter, sortColumnParameter, sortOrderParameter, pageNoParameter, pageLengthParameter, recordCount); } - public virtual ObjectResult usp_GetUsageReport(string sFromDate, string sToDate, string sAccoutNumber, string sZip, Nullable iState, Nullable iCountry, Nullable pageNo, Nullable pageLength, ObjectParameter recordCount) + public virtual ObjectResult usp_GetUsageReport(string sFromDate, string sToDate, string sAccoutNumber, string sZip, Nullable iState, Nullable iCountry, string sortColumn, string sortOrder, Nullable pageNo, Nullable pageLength, ObjectParameter recordCount) { var sFromDateParameter = sFromDate != null ? new ObjectParameter("sFromDate", sFromDate) : @@ -4363,6 +4479,14 @@ namespace AIAHTML5.ADMIN.API.Entity new ObjectParameter("iCountry", iCountry) : new ObjectParameter("iCountry", typeof(int)); + var sortColumnParameter = sortColumn != null ? + new ObjectParameter("sortColumn", sortColumn) : + new ObjectParameter("sortColumn", typeof(string)); + + var sortOrderParameter = sortOrder != null ? + new ObjectParameter("sortOrder", sortOrder) : + new ObjectParameter("sortOrder", typeof(string)); + var pageNoParameter = pageNo.HasValue ? new ObjectParameter("pageNo", pageNo) : new ObjectParameter("pageNo", typeof(int)); @@ -4371,7 +4495,7 @@ namespace AIAHTML5.ADMIN.API.Entity new ObjectParameter("pageLength", pageLength) : new ObjectParameter("pageLength", typeof(int)); - return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_GetUsageReport", sFromDateParameter, sToDateParameter, sAccoutNumberParameter, sZipParameter, iStateParameter, iCountryParameter, pageNoParameter, pageLengthParameter, recordCount); + return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_GetUsageReport", sFromDateParameter, sToDateParameter, sAccoutNumberParameter, sZipParameter, iStateParameter, iCountryParameter, sortColumnParameter, sortOrderParameter, pageNoParameter, pageLengthParameter, recordCount); } public virtual ObjectResult usp_GetUserList(string sFirstName, string sLastName, string sEmailId, string sAccoutNumber, Nullable iUserTypeId, Nullable iAccountTypeId, Nullable iLoginUserType, Nullable pageNo, Nullable pageLength, ObjectParameter recordCount) @@ -4415,7 +4539,7 @@ namespace AIAHTML5.ADMIN.API.Entity return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_GetUserList", sFirstNameParameter, sLastNameParameter, sEmailIdParameter, sAccoutNumberParameter, iUserTypeIdParameter, iAccountTypeIdParameter, iLoginUserTypeParameter, pageNoParameter, pageLengthParameter, recordCount); } - public virtual ObjectResult usp_GetUsersList(string sFirstName, string sLastName, string sEmailId, string sAccoutNumber, Nullable iUserTypeId, Nullable iAccountTypeId, Nullable iLoginUserType, Nullable iLoginStatus, Nullable pageNo, Nullable pageLength, ObjectParameter recordCount) + public virtual ObjectResult usp_GetUsersList(string sFirstName, string sLastName, string sEmailId, string sAccoutNumber, Nullable iUserTypeId, Nullable iAccountTypeId, Nullable iLoginUserType, Nullable iLoginStatus, string sortColumn, string sortOrder, Nullable pageNo, Nullable pageLength, ObjectParameter recordCount) { var sFirstNameParameter = sFirstName != null ? new ObjectParameter("sFirstName", sFirstName) : @@ -4449,6 +4573,14 @@ namespace AIAHTML5.ADMIN.API.Entity new ObjectParameter("iLoginStatus", iLoginStatus) : new ObjectParameter("iLoginStatus", typeof(bool)); + var sortColumnParameter = sortColumn != null ? + new ObjectParameter("sortColumn", sortColumn) : + new ObjectParameter("sortColumn", typeof(string)); + + var sortOrderParameter = sortOrder != null ? + new ObjectParameter("sortOrder", sortOrder) : + new ObjectParameter("sortOrder", typeof(string)); + var pageNoParameter = pageNo.HasValue ? new ObjectParameter("pageNo", pageNo) : new ObjectParameter("pageNo", typeof(int)); @@ -4457,7 +4589,7 @@ namespace AIAHTML5.ADMIN.API.Entity new ObjectParameter("pageLength", pageLength) : new ObjectParameter("pageLength", typeof(int)); - return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_GetUsersList", sFirstNameParameter, sLastNameParameter, sEmailIdParameter, sAccoutNumberParameter, iUserTypeIdParameter, iAccountTypeIdParameter, iLoginUserTypeParameter, iLoginStatusParameter, pageNoParameter, pageLengthParameter, recordCount); + return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_GetUsersList", sFirstNameParameter, sLastNameParameter, sEmailIdParameter, sAccoutNumberParameter, iUserTypeIdParameter, iAccountTypeIdParameter, iLoginUserTypeParameter, iLoginStatusParameter, sortColumnParameter, sortOrderParameter, pageNoParameter, pageLengthParameter, recordCount); } public virtual ObjectResult usp_GetUserTyeByAccountNumber(Nullable iUserTypeId, Nullable iLicenseId) diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.edmx b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.edmx index 4fed988..1295ad2 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.edmx +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.edmx @@ -644,10 +644,6 @@ - - - - @@ -980,6 +976,8 @@ + + @@ -994,6 +992,8 @@ + + @@ -1002,6 +1002,8 @@ + + @@ -1011,6 +1013,8 @@ + + @@ -1026,6 +1030,8 @@ + + @@ -1034,6 +1040,8 @@ + + @@ -1082,6 +1090,8 @@ + + @@ -1089,6 +1099,8 @@ + + @@ -1097,6 +1109,8 @@ + + @@ -1118,6 +1132,8 @@ + + @@ -1150,6 +1166,8 @@ + + @@ -1177,6 +1195,9 @@ + + + @@ -1191,12 +1212,16 @@ + + + + @@ -1208,6 +1233,8 @@ + + @@ -1233,6 +1260,8 @@ + + @@ -2459,6 +2488,8 @@ + + @@ -2466,6 +2497,8 @@ + + @@ -2486,6 +2519,8 @@ + + @@ -2625,6 +2660,8 @@ + + @@ -2666,6 +2703,8 @@ + + @@ -2694,6 +2733,8 @@ + + @@ -2708,6 +2749,8 @@ + + @@ -2716,6 +2759,8 @@ + + @@ -2725,6 +2770,8 @@ + + @@ -2739,6 +2786,8 @@ + + @@ -2747,6 +2796,8 @@ + + @@ -2773,6 +2824,8 @@ + + @@ -2813,6 +2866,9 @@ + + + @@ -2827,6 +2883,8 @@ + + @@ -2838,6 +2896,8 @@ + + @@ -2863,6 +2923,8 @@ + + @@ -3905,26 +3967,25 @@ - - - - - - - + + + + + + + - + - - - - - - - - + + + + + + + + - @@ -3939,7 +4000,6 @@ - @@ -3983,12 +4043,12 @@ - - - + + + @@ -4055,14 +4115,13 @@ - - - + + @@ -4089,18 +4148,16 @@ - - - - - + + - - - - + + + + + @@ -4132,81 +4189,75 @@ - - + - - - + + + - - + - - - + - - - + + + + + - + - - - + + + - - - - - - + + + + + - - + - - - + + + - + - - - - - - - - - - + + + + + + + + @@ -4249,11 +4300,10 @@ - - + @@ -4292,65 +4342,61 @@ - - - + + - - + + - + - - + - - - + + + - + - - - + + - + - + - - + - - + + - - - + + + - + @@ -5528,7 +5574,6 @@ - @@ -5747,7 +5792,6 @@ - @@ -5770,7 +5814,6 @@ - @@ -5834,12 +5877,12 @@ - - + + @@ -5918,14 +5961,13 @@ - - + @@ -5966,18 +6008,16 @@ - - - - - - - + + + + + @@ -6038,7 +6078,6 @@ - @@ -6056,15 +6095,12 @@ - - - @@ -6073,7 +6109,9 @@ - + + + @@ -6084,14 +6122,13 @@ - + - @@ -6104,7 +6141,6 @@ - @@ -6123,8 +6159,6 @@ - - @@ -6193,7 +6227,6 @@ - @@ -6253,7 +6286,6 @@ - @@ -6267,7 +6299,6 @@ - @@ -6285,7 +6316,6 @@ - @@ -6306,7 +6336,6 @@ - diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetCancelledLicenses_Result.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetCancelledLicenses_Result.cs index 082f426..c9d9885 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetCancelledLicenses_Result.cs +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetCancelledLicenses_Result.cs @@ -13,16 +13,15 @@ namespace AIAHTML5.ADMIN.API.Entity public partial class usp_GetCancelledLicenses_Result { - public Nullable Serial_No { get; set; } public string AccountNumber { get; set; } public string LicenseeName { get; set; } public string LicenseType { get; set; } public string InstitutionName { get; set; } public string AccountType { get; set; } public string Edition { get; set; } - public string StartDate { get; set; } - public string EndDate { get; set; } - public string LicenseCreationDate { get; set; } + public Nullable StartDate { get; set; } + public Nullable EndDate { get; set; } + public Nullable LicenseCreationDate { get; set; } public Nullable SubscriptionPrice { get; set; } public Nullable CardNumber { get; set; } } diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetCustomerSummary_Result.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetCustomerSummary_Result.cs index 93416fc..4c626fc 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetCustomerSummary_Result.cs +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetCustomerSummary_Result.cs @@ -13,22 +13,21 @@ namespace AIAHTML5.ADMIN.API.Entity public partial class usp_GetCustomerSummary_Result { - public Nullable Serial_No { get; set; } public string AccountNumber { get; set; } public string LicenseeName { get; set; } public string LicenseType { get; set; } public string AccountType { get; set; } public string Edition { get; set; } public string Email { get; set; } - public string StartDate { get; set; } - public string EndDate { get; set; } public string LicenseStatus { get; set; } public Nullable Price { get; set; } public string LicenseZip { get; set; } public string LicenseState { get; set; } public string LicenseCountry { get; set; } public string InstitutionName { get; set; } - public string LicenseCreationDate { get; set; } - public int CardNumber { get; set; } + public Nullable LicenseCreationDate { get; set; } + public Nullable CardNumber { get; set; } + public Nullable StartDate { get; set; } + public Nullable EndDate { get; set; } } } diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetDiscountCodes_Result.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetDiscountCodes_Result.cs index 36b4aa7..0198a94 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetDiscountCodes_Result.cs +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetDiscountCodes_Result.cs @@ -16,8 +16,8 @@ namespace AIAHTML5.ADMIN.API.Entity public int Id { get; set; } public string DiscountCode { get; set; } public decimal Percentage { get; set; } - public string StartDate { get; set; } - public string EndDate { get; set; } - public string Status { get; set; } + public System.DateTime StartDate { get; set; } + public System.DateTime EndDate { get; set; } + public bool IsActive { get; set; } } } diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetDiscountReport_Result.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetDiscountReport_Result.cs index 795e3e7..37d055c 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetDiscountReport_Result.cs +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetDiscountReport_Result.cs @@ -13,11 +13,10 @@ namespace AIAHTML5.ADMIN.API.Entity public partial class usp_GetDiscountReport_Result { - public Nullable RowNum { get; set; } public string DiscountCode { get; set; } - public decimal Percentage { get; set; } - public string StartDate { get; set; } - public string EndDate { get; set; } + public Nullable Percentage { get; set; } + public Nullable StartDate { get; set; } + public Nullable EndDate { get; set; } public string DiscountStatus { get; set; } public Nullable TotalLicenses { get; set; } } diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetExpiringLicenses_Result.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetExpiringLicenses_Result.cs index b6b09c5..443740a 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetExpiringLicenses_Result.cs +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetExpiringLicenses_Result.cs @@ -13,18 +13,17 @@ namespace AIAHTML5.ADMIN.API.Entity public partial class usp_GetExpiringLicenses_Result { - public Nullable Serial_No { get; set; } public string AccountNumber { get; set; } public string LicenseeName { get; set; } public string LicenseType { get; set; } public string InstitutionName { get; set; } public string Edition { get; set; } - public string StartDate { get; set; } - public string EndDate { get; set; } - public string LicenseCreationDate { get; set; } + public Nullable StartDate { get; set; } + public Nullable EndDate { get; set; } + public Nullable LicenseCreationDate { get; set; } public Nullable SubscriptionPrice { get; set; } public string AccountType { get; set; } public Nullable DaysRemaining { get; set; } - public int CardNumber { get; set; } + public Nullable CardNumber { get; set; } } } diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetExportedImageDetails_Result.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetExportedImageDetails_Result.cs index 380c81c..9b29604 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetExportedImageDetails_Result.cs +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetExportedImageDetails_Result.cs @@ -13,15 +13,13 @@ namespace AIAHTML5.ADMIN.API.Entity public partial class usp_GetExportedImageDetails_Result { - public Nullable RowNum { get; set; } - public int LicenseId { get; set; } - public string ExportedDate { get; set; } + public System.DateTime ExportedDate { get; set; } public string ImageName { get; set; } public string AccountNumber { get; set; } public string OriginalFileName { get; set; } public string Title { get; set; } public string ModuleName { get; set; } - public int ExportLimit { get; set; } + public Nullable ExportLimit { get; set; } public string UserName { get; set; } public Nullable imageCount { get; set; } } diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetLicenseUserGroupUsers_Result.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetLicenseUserGroupUsers_Result.cs index f129818..a4aa96d 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetLicenseUserGroupUsers_Result.cs +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetLicenseUserGroupUsers_Result.cs @@ -13,13 +13,12 @@ namespace AIAHTML5.ADMIN.API.Entity public partial class usp_GetLicenseUserGroupUsers_Result { - public Nullable RowNo { get; set; } public int Id { get; set; } public string FirstName { get; set; } public string LastName { get; set; } public string LoginId { get; set; } public string EmailId { get; set; } - public string Title { get; set; } - public int InGroup { get; set; } + public bool InGroup { get; set; } + public string ProductEdition { get; set; } } } diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetLicenseUserGroups_Result.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetLicenseUserGroups_Result.cs index 8269798..4e88bff 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetLicenseUserGroups_Result.cs +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetLicenseUserGroups_Result.cs @@ -20,6 +20,5 @@ namespace AIAHTML5.ADMIN.API.Entity public Nullable ModifiedDate { get; set; } public bool IsActive { get; set; } public Nullable TotalUsers { get; set; } - public Nullable RowNo { get; set; } } } diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetNetAdSummaryReport_Result.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetNetAdSummaryReport_Result.cs index 13bcb56..4b2f295 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetNetAdSummaryReport_Result.cs +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetNetAdSummaryReport_Result.cs @@ -13,7 +13,6 @@ namespace AIAHTML5.ADMIN.API.Entity public partial class usp_GetNetAdSummaryReport_Result { - public Nullable Serial_No { get; set; } public string LicenseType { get; set; } public string AccountType { get; set; } public string InstitutionName { get; set; } diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetSiteAccountSites_Result.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetSiteAccountSites_Result.cs index 8510c4b..a98b3b7 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetSiteAccountSites_Result.cs +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetSiteAccountSites_Result.cs @@ -14,16 +14,14 @@ namespace AIAHTML5.ADMIN.API.Entity public partial class usp_GetSiteAccountSites_Result { public int Id { get; set; } - public string SiteIp { get; set; } public string Title { get; set; } - public string SiteIPTo { get; set; } - public string SiteMasterIPTo { get; set; } - public string CreationDate { get; set; } - public string ModifiedDate { get; set; } + public Nullable CreationDate { get; set; } + public Nullable ModifiedDate { get; set; } public string InstituteName { get; set; } public string Department { get; set; } - public int UserId { get; set; } - public string FirstName { get; set; } - public string EmailId { get; set; } + public string Ip { get; set; } + public string SiteIpTo { get; set; } + public string SiteUserFirstName { get; set; } + public string SiteUserEmailId { get; set; } } } diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetSiteLicenseUsageReports_Result.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetSiteLicenseUsageReports_Result.cs index f189ac0..7eddf8f 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetSiteLicenseUsageReports_Result.cs +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetSiteLicenseUsageReports_Result.cs @@ -13,13 +13,12 @@ namespace AIAHTML5.ADMIN.API.Entity public partial class usp_GetSiteLicenseUsageReports_Result { - public Nullable Serial_No { get; set; } public string AccountNumber { get; set; } public string EditionTitle { get; set; } public string ReferalUrl { get; set; } public string InstitutionName { get; set; } - public string LicenseCreationDate { get; set; } + public Nullable LicenseCreationDate { get; set; } public Nullable TotalLogins { get; set; } - public string LastLogin { get; set; } + public Nullable LastLogin { get; set; } } } diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetSubscribedLicenses_Result.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetSubscribedLicenses_Result.cs index 9864887..43742bf 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetSubscribedLicenses_Result.cs +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetSubscribedLicenses_Result.cs @@ -13,17 +13,16 @@ namespace AIAHTML5.ADMIN.API.Entity public partial class usp_GetSubscribedLicenses_Result { - public Nullable Serial_No { get; set; } public string AccountNumber { get; set; } public string LicenseeName { get; set; } public string LicenseType { get; set; } public string InstitutionName { get; set; } public string AccountType { get; set; } public string Edition { get; set; } - public string StartDate { get; set; } - public string EndDate { get; set; } - public string LicenseCreationDate { get; set; } + public Nullable StartDate { get; set; } + public Nullable EndDate { get; set; } + public Nullable LicenseCreationDate { get; set; } public Nullable SubscriptionPrice { get; set; } - public int CardNumber { get; set; } + public Nullable CardNumber { get; set; } } } diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetSubscriptionPlans_Result.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetSubscriptionPlans_Result.cs index 6bc11dd..e41c7eb 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetSubscriptionPlans_Result.cs +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetSubscriptionPlans_Result.cs @@ -13,11 +13,11 @@ namespace AIAHTML5.ADMIN.API.Entity public partial class usp_GetSubscriptionPlans_Result { - public Nullable price { get; set; } - public string title { get; set; } - public short Id { get; set; } + public int Id { get; set; } public byte EditionId { get; set; } public byte Duration { get; set; } public bool IsActive { get; set; } + public string Title { get; set; } + public Nullable Price { get; set; } } } diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetUsageReport_Result.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetUsageReport_Result.cs index ec4b6a5..93612db 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetUsageReport_Result.cs +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetUsageReport_Result.cs @@ -13,19 +13,18 @@ namespace AIAHTML5.ADMIN.API.Entity public partial class usp_GetUsageReport_Result { - public Nullable Serial_No { get; set; } public string LoginId { get; set; } public string FirstName { get; set; } public string LastName { get; set; } public string AccountNumber { get; set; } - public int CardNumber { get; set; } + public Nullable CardNumber { get; set; } public string UserType { get; set; } - public string LicenseCreationDate { get; set; } + public Nullable LicenseCreationDate { get; set; } public string LicenseZip { get; set; } public string LicenseState { get; set; } public string LicenseCountry { get; set; } public string InstitutionName { get; set; } public Nullable TotalLogins { get; set; } - public string LastLogin { get; set; } + public Nullable LastLogin { get; set; } } } diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetUsersList_Result.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetUsersList_Result.cs index 46f0615..a525c5a 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetUsersList_Result.cs +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetUsersList_Result.cs @@ -13,23 +13,22 @@ namespace AIAHTML5.ADMIN.API.Entity public partial class usp_GetUsersList_Result { - public Nullable RowNum { get; set; } - public Nullable Id { get; set; } + public int Id { get; set; } public string FirstName { get; set; } public string LastName { get; set; } public string LoginId { get; set; } public string EmailId { get; set; } public string UserTypeTitle { get; set; } public string Password { get; set; } - public Nullable CreationDate { get; set; } - public Nullable ModifiedDate { get; set; } + public System.DateTime CreationDate { get; set; } + public System.DateTime ModifiedDate { get; set; } public string AccountNumber { get; set; } public string AccountTypeTitle { get; set; } public string EditionType { get; set; } public string UserStatus { get; set; } - public Nullable UserTypeId { get; set; } - public Nullable EditionTypeId { get; set; } - public Nullable LoginStatus { get; set; } + public int UserTypeId { get; set; } + public int EditionTypeId { get; set; } + public bool LoginStatus { get; set; } public string TotalLogin { get; set; } public string LicenseStatus { get; set; } } diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetlicensesList_Result.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetlicensesList_Result.cs index 4c646af..e039b57 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetlicensesList_Result.cs +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetlicensesList_Result.cs @@ -26,13 +26,12 @@ namespace AIAHTML5.ADMIN.API.Entity public string ClientAdmin { get; set; } public string LicenseeName { get; set; } public string ContactAddress { get; set; } - public string EntryDate { get; set; } + public Nullable EntryDate { get; set; } public string LicenseStatus { get; set; } - public string ModifyDate { get; set; } - public string StartDate { get; set; } - public string RenewDate { get; set; } - public string EndDate { get; set; } + public Nullable ModifyDate { get; set; } + public Nullable StartDate { get; set; } + public Nullable RenewDate { get; set; } + public Nullable EndDate { get; set; } public Nullable NoofImages { get; set; } - public Nullable RowNo { get; set; } } } diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Models/DiscountCodeModel.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/Models/DiscountCodeModel.cs index 179be65..1ea92bd 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Models/DiscountCodeModel.cs +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Models/DiscountCodeModel.cs @@ -15,29 +15,15 @@ namespace AIAHTML5.ADMIN.API.Models public bool IsActive { get; set; } public decimal Percentage { get; set; } - public static List GetDiscountCodes(AIADatabaseV5Entities dbContext, string discountCode, DateTime startDate, DateTime endDate, int pageNo, int pageLength, out int recordCount) + public static List GetDiscountCodes(AIADatabaseV5Entities dbContext, string discountCode, DateTime startDate, DateTime endDate, string sortColumn, string sortOrder, int pageNo, int pageLength, out int recordCount) { - List DiscountCodeList = new List(); - DiscountCodeModel DiscountCodeObj = new DiscountCodeModel(); + List DiscountCodeList = new List(); var spRecordCount = new System.Data.Objects.ObjectParameter("recordCount", 0); recordCount = 0; try { - var result = dbContext.usp_GetDiscountCodes(discountCode, startDate.ToString("MM/dd/yyyy"), endDate.ToString("MM/dd/yyyy"), pageNo, pageLength, spRecordCount).ToList(); - if (result.Count > 0) - { - foreach (var item in result) - { - DiscountCodeObj = new DiscountCodeModel(); - DiscountCodeObj.Id = item.Id; - DiscountCodeObj.DiscountCode = item.DiscountCode; - DiscountCodeObj.StartDate = DateTime.ParseExact(item.StartDate, "MM/dd/yyyy", System.Globalization.CultureInfo.CurrentCulture); - DiscountCodeObj.EndDate = DateTime.ParseExact(item.EndDate, "MM/dd/yyyy", System.Globalization.CultureInfo.CurrentCulture); - DiscountCodeObj.Percentage = item.Percentage; - DiscountCodeObj.IsActive = (item.Status == "Active" ? true : false); - DiscountCodeList.Add(DiscountCodeObj); - } - } + DiscountCodeList = dbContext.usp_GetDiscountCodes(discountCode, startDate.ToString("MM/dd/yyyy"), endDate.ToString("MM/dd/yyyy"), sortColumn, sortOrder, pageNo, pageLength, spRecordCount).ToList(); + recordCount = (int)spRecordCount.Value; } catch (Exception ex) { } diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Models/LicenseModel.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/Models/LicenseModel.cs index ec8b34a..39014ec 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Models/LicenseModel.cs +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Models/LicenseModel.cs @@ -47,6 +47,7 @@ namespace AIAHTML5.ADMIN.API.Models public int? TotalLogins { get; set; } public string EditionLogins { get; set; } public decimal Price { get; set; } + public int? SiteUserId { get; set; } public string LoginId { get; set; } public string Password { get; set; } public byte? SecurityQuestionId { get; set; } @@ -59,50 +60,23 @@ namespace AIAHTML5.ADMIN.API.Models public byte? TestLicenseEditionId { get; set; } public bool IsRenew { get; set; } - public static List GetLicenses(AIADatabaseV5Entities dbContext, string accountNumber, string licenseeFirstName, + public static List GetLicenses(AIADatabaseV5Entities dbContext, string accountNumber, string licenseeFirstName, string licenseeLastName, byte licenseTypeId, string institutionName, int stateId, int countryId, string emailId, - DateTime subscriptionStartDate, DateTime subscriptionEndDate, bool isActive, int pageNo, int pageLength, out int recordCount) + DateTime subscriptionStartDate, DateTime subscriptionEndDate, bool isActive, string sortColumn, string sortOrder, int pageNo, int pageLength, out int recordCount) { - List LicenseList = new List(); - LicenseModel LicenseObj = new LicenseModel(); + List LicenseList=new List(); var spRecordCount = new System.Data.Objects.ObjectParameter("recordCount", 0); recordCount = 0; try { - var result = dbContext.usp_GetlicensesList( + LicenseList = dbContext.usp_GetlicensesList( (subscriptionStartDate > DateTime.MinValue ? subscriptionStartDate.ToShortDateString() : "01/01/01"), (subscriptionEndDate > DateTime.MinValue ? subscriptionEndDate.ToShortDateString() : "01/01/01"), (accountNumber == null ? "" : accountNumber), (licenseeFirstName == null ? "" : licenseeFirstName), (licenseeLastName == null ? "" : licenseeLastName), licenseTypeId, (institutionName == null ? "" : institutionName), - (emailId == null ? "" : emailId), stateId, countryId, isActive, pageNo, pageLength, spRecordCount).ToList(); - if (result.Count > 0) + (emailId == null ? "" : emailId), stateId, countryId, isActive, sortColumn, sortOrder, pageNo, pageLength, spRecordCount).ToList(); + if (LicenseList.Count > 0) { - foreach (var item in result) - { - LicenseObj = new LicenseModel(); - LicenseObj.LicenseId = item.LicenseId; - LicenseObj.AccountNumber = item.AccountNumber; - LicenseObj.AccountTypeName = item.AccountType; - LicenseObj.LicenseeName = item.LicenseeName; - LicenseObj.LicenseState = item.LicenseState; - LicenseObj.LicenseCountry = item.LicenseCountry; - LicenseObj.Address = item.ContactAddress; - LicenseObj.InstitutionName = item.InstitutionName; - LicenseObj.LicenseTypeName = item.LicenseType; - LicenseObj.EmailId = item.EmailId; - LicenseObj.NoOfImages = item.NoofImages; - LicenseObj.ClientAdmin = item.ClientAdmin; - LicenseObj.CardNumber = item.CardNumber; - LicenseObj.ProductKey = item.ProductKey; - LicenseObj.SubscriptionStartDate = DateTime.ParseExact(item.StartDate, "MM/dd/yyyy", System.Globalization.CultureInfo.CurrentCulture); - LicenseObj.SubscriptionEndDate = DateTime.ParseExact(item.EndDate, "MM/dd/yyyy", System.Globalization.CultureInfo.CurrentCulture); - LicenseObj.EntryDate = DateTime.ParseExact(item.EntryDate, "MM/dd/yyyy", System.Globalization.CultureInfo.CurrentCulture); - LicenseObj.RenewDate = DateTime.ParseExact((item.RenewDate == "" ? "01/01/0001" : item.RenewDate), "MM/dd/yyyy", System.Globalization.CultureInfo.CurrentCulture); - LicenseObj.ModifyDate = DateTime.ParseExact((item.ModifyDate == "" ? "01/01/0001" : item.ModifyDate), "MM/dd/yyyy", System.Globalization.CultureInfo.CurrentCulture); - LicenseObj.IsActive = (item.LicenseStatus == "Active" ? true : false); - LicenseObj.LicStatus = item.LicenseStatus; - LicenseList.Add(LicenseObj); - } recordCount = (int)spRecordCount.Value; } } @@ -162,6 +136,7 @@ namespace AIAHTML5.ADMIN.API.Models LicenseObj.MasterSiteUrl = result[0].SiteUrl; LicenseObj.SiteUrlTo = result[0].SitToUrl; LicenseObj.SiteUrlFrom = result[0].SiteMasterUrl; + LicenseObj.SiteUserId = result[0].UserId; LicenseObj.LoginId = result[0].Login; LicenseObj.Password = result[0].Password; LicenseObj.SecurityQuestionId = (byte?)result[0].SecurityQuestionId; @@ -177,38 +152,16 @@ namespace AIAHTML5.ADMIN.API.Models return LicenseObj; } - public static List GetLicenseSites(AIADatabaseV5Entities dbContext, string AccountNo, int pageNo, int pageLength, out int recordCount) + public static List GetLicenseSites(AIADatabaseV5Entities dbContext, string AccountNo, string sortColumn, string sortOrder, int pageNo, int pageLength, out int recordCount) { - List LicenseSiteList = new List(); - SiteModel SiteModelObj = new SiteModel(); + List LicenseSiteList = new List(); + var spRecordCount = new System.Data.Objects.ObjectParameter("recordCount", 0); recordCount = 0; try { - var result = dbContext.usp_GetSiteAccountSites(AccountNo, pageNo, pageLength, spRecordCount).ToList(); - if (result.Count > 0) - { - foreach (var item in result) - { - SiteModelObj = new SiteModel(); - SiteModelObj.Id = item.Id; - SiteModelObj.Ip = item.SiteIp; - SiteModelObj.SiteIpTo = item.SiteIPTo; - SiteModelObj.MasterIpTo = item.SiteMasterIPTo; - SiteModelObj.InstituteName = item.InstituteName; - SiteModelObj.Department = item.Department; - SiteModelObj.SiteUserId = item.UserId; - SiteModelObj.SiteUserEmailId = item.EmailId; - SiteModelObj.SiteUserFirstName = item.FirstName; - SiteModelObj.Title = item.Title; - SiteModelObj.CreationDate = DateTime.ParseExact(item.CreationDate, "MM/dd/yyyy", System.Globalization.CultureInfo.CurrentCulture); - if (!string.IsNullOrEmpty(item.ModifiedDate)) - { - SiteModelObj.ModifiedDate = DateTime.ParseExact(item.ModifiedDate, "MM/dd/yyyy", System.Globalization.CultureInfo.CurrentCulture); - } - LicenseSiteList.Add(SiteModelObj); - } - } + LicenseSiteList = dbContext.usp_GetSiteAccountSites(AccountNo, sortColumn, sortOrder, pageNo, pageLength, spRecordCount).ToList(); + recordCount = (int)spRecordCount.Value; } catch (Exception ex) { } diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Models/SubscriptionPriceModel.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/Models/SubscriptionPriceModel.cs index d58129f..b115353 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Models/SubscriptionPriceModel.cs +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Models/SubscriptionPriceModel.cs @@ -15,29 +15,15 @@ namespace AIAHTML5.ADMIN.API.Models public int EditionId { get; set; } public bool IsActive { get; set; } - public static List GetSubscriptionPrices(AIADatabaseV5Entities dbContext, int editionId, int pageNo, int pageLength, out int recordCount) + public static List GetSubscriptionPrices(AIADatabaseV5Entities dbContext, int editionId, string sortColumn, string sortOrder, int pageNo, int pageLength, out int recordCount) { - List SubscriptionPriceList = new List(); - SubscriptionPriceModel SubscriptionPriceObj = new SubscriptionPriceModel(); + List SubscriptionPriceList = new List(); var spRecordCount = new System.Data.Objects.ObjectParameter("recordCount", 0); recordCount = 0; try { - var result = dbContext.usp_GetSubscriptionPlans((byte?)editionId, pageNo, pageLength, spRecordCount).ToList(); - if (result.Count > 0) - { - foreach (var item in result) - { - SubscriptionPriceObj = new SubscriptionPriceModel(); - SubscriptionPriceObj.Id = item.Id; - SubscriptionPriceObj.Title = item.title; - SubscriptionPriceObj.Price = item.price.Value; - SubscriptionPriceObj.Duration = item.Duration; - SubscriptionPriceObj.EditionId = item.EditionId; - SubscriptionPriceObj.IsActive = item.IsActive; - SubscriptionPriceList.Add(SubscriptionPriceObj); - } - } + SubscriptionPriceList = dbContext.usp_GetSubscriptionPlans((byte?)editionId, sortColumn, sortOrder, pageNo, pageLength, spRecordCount).ToList(); + recordCount = (int)spRecordCount.Value; } catch (Exception ex) { } diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Models/UserGroupModel.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/Models/UserGroupModel.cs index e0a646f..a383de3 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Models/UserGroupModel.cs +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Models/UserGroupModel.cs @@ -16,54 +16,31 @@ namespace AIAHTML5.ADMIN.API.Models public bool? IsActive { get; set; } public int? TotalUsers { get; set; } - public static List GetLicenseUserGroups(AIADatabaseV5Entities dbContext, int? LicenseId, int pageNo, int pageLength, out int recordCount) + public static List GetLicenseUserGroups(AIADatabaseV5Entities dbContext, int? LicenseId, string sortColumn, string sortOrder, int pageNo, int pageLength, out int recordCount) { - List UserGroupList = new List(); - UserGroupModel UserGroupObj = new UserGroupModel(); + List UserGroupList = new List(); + var spRecordCount = new System.Data.Objects.ObjectParameter("recordCount", 0); recordCount = 0; try { - var result = dbContext.usp_GetLicenseUserGroups(LicenseId, pageNo, pageLength, spRecordCount).ToList(); - foreach (var item in result) - { - UserGroupObj = new UserGroupModel(); - UserGroupObj.Id = item.Id; - UserGroupObj.LicenseId = item.LicenseId; - UserGroupObj.Title = item.Title; - UserGroupObj.IsActive = item.IsActive; - UserGroupObj.ModifiedDate = item.ModifiedDate; - UserGroupObj.CreationDate = item.CreationDate; - UserGroupObj.TotalUsers = item.TotalUsers; - UserGroupList.Add(UserGroupObj); - } + UserGroupList = dbContext.usp_GetLicenseUserGroups(LicenseId, sortColumn, sortOrder, pageNo, pageLength, spRecordCount).ToList(); + recordCount = (int)spRecordCount.Value; } catch (Exception ex) { } return UserGroupList; } - public static List GetLicenseUserGroupUsers(AIADatabaseV5Entities dbContext, int? LicenseId, int UserGroupId, bool AllUsers, int pageNo, int pageLength, out int recordCount) + public static List GetLicenseUserGroupUsers(AIADatabaseV5Entities dbContext, int? LicenseId, int UserGroupId, bool AllUsers, string sortColumn, string sortOrder, int pageNo, int pageLength, out int recordCount) { - List UserList = new List(); + List UserList = new List(); UserModel UserModelObj = new UserModel(); var spRecordCount = new System.Data.Objects.ObjectParameter("recordCount", 0); recordCount = 0; try { - var result = dbContext.usp_GetLicenseUserGroupUsers(LicenseId, UserGroupId, AllUsers, pageNo, pageLength, spRecordCount).ToList(); - foreach (var item in result) - { - UserModelObj = new UserModel(); - UserModelObj.Id = item.Id; - UserModelObj.FirstName = item.FirstName; - UserModelObj.LastName = item.LastName; - UserModelObj.LoginId = item.LoginId; - UserModelObj.EmailId = item.EmailId; - UserModelObj.ProductEdition = item.Title; - UserModelObj.InGroup = item.InGroup; - UserList.Add(UserModelObj); - } + UserList = dbContext.usp_GetLicenseUserGroupUsers(LicenseId, UserGroupId, AllUsers, sortColumn, sortOrder,pageNo, pageLength, spRecordCount).ToList(); recordCount = (int)spRecordCount.Value; } catch (Exception ex) { } diff --git a/400-SOURCECODE/AIAHTML5.API/Controllers/AuthenticateController.cs b/400-SOURCECODE/AIAHTML5.API/Controllers/AuthenticateController.cs index e33f313..4748f95 100644 --- a/400-SOURCECODE/AIAHTML5.API/Controllers/AuthenticateController.cs +++ b/400-SOURCECODE/AIAHTML5.API/Controllers/AuthenticateController.cs @@ -494,7 +494,7 @@ namespace AIAHTML5.API.Controllers } [HttpPost] - [Route("api/ByPassLoginToOpenModule")] + [Route("api/ByPassLoginToOpenModule")]//now using UrlLoginController public HttpResponseMessage ByPassLoginToOpenModule([FromBody]JObject sitedetail) { // note:created new UrlLoginController for bypass login diff --git a/400-SOURCECODE/AIAHTML5.API/Models/DBModel.cs b/400-SOURCECODE/AIAHTML5.API/Models/DBModel.cs index 4b5a14e..f7aceb7 100644 --- a/400-SOURCECODE/AIAHTML5.API/Models/DBModel.cs +++ b/400-SOURCECODE/AIAHTML5.API/Models/DBModel.cs @@ -1427,7 +1427,7 @@ namespace AIAHTML5.API.Models return dt; } - internal int InsertSiteLoginDetails(String strAcccountNumber, String strUrlReferer, string strEdition) + internal int InsertSiteLoginDetails(String strAcccountNumber, String strUrlReferer, string strEdition,int loginTypeId) { int result = 0; SqlConnection conn = null; @@ -1443,6 +1443,7 @@ namespace AIAHTML5.API.Models cmd.Parameters.AddWithValue("@nvReferalUrl", strUrlReferer); cmd.Parameters.AddWithValue("@nvEdition", strEdition); cmd.Parameters.AddWithValue("@nvHttpReferer", null); + cmd.Parameters.AddWithValue("@nvLoginTypeId", loginTypeId); result = cmd.ExecuteNonQuery(); } catch (SqlException ex) diff --git a/400-SOURCECODE/AIAHTML5.API/Models/Users.cs b/400-SOURCECODE/AIAHTML5.API/Models/Users.cs index 5ac9e20..c5827c5 100644 --- a/400-SOURCECODE/AIAHTML5.API/Models/Users.cs +++ b/400-SOURCECODE/AIAHTML5.API/Models/Users.cs @@ -677,6 +677,9 @@ namespace AIAHTML5.API.Models } + // add editon number for provide CA link + userInfo.StudentEdition = GetStudentEdition(userInfo.LicenseId); + // get edition features details userInfo.objEditionFeatures = objDBModel.GetEditionFeatures((Byte)intEditionId); @@ -688,8 +691,9 @@ namespace AIAHTML5.API.Models // get exported image detail userInfo.UserExportImageDetail = getExportedImageDetail(userInfo.LicenseId); - // insert login details - objDBModel.InsertSiteLoginDetails(strAcccountNumber, strSiteIP, strEdition); + // insert login details + //pass 1 for Site login + objDBModel.InsertSiteLoginDetails(strAcccountNumber, strSiteIP, strEdition,1); } @@ -746,6 +750,8 @@ namespace AIAHTML5.API.Models string expirationDate = null; bool isLicenseExpired = false; + DBModel objDBModel = new DBModel(); + // validate license start date string startDate = null; bool isSubscriptionNotStart = false; @@ -819,10 +825,14 @@ namespace AIAHTML5.API.Models userInfo.userSelectedSkintone = null; userInfo.userLexicon = null; - // get only CA module + // get only CA module - userInfo.Modules = getModuleListBySlug(licId,slug); - + userInfo.Modules = getModuleListBySlug(licId,slug); + + // insert site url login details in sitelicense table UserLoginLog + //pass 2 for CA login + objDBModel.InsertSiteLoginDetails(strAcccountNumber, "", intEditionId.ToString(),2); + } diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/3dAController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/3dAController.js index 49e1557..309f360 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/3dAController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/3dAController.js @@ -79,14 +79,15 @@ function ($scope, $rootScope, pages, log, $http, DataService, $filter, $location } } - $scope.DisableUI = function () { - - var caImagePanelConetent = document.getElementsByClassName("jsPanel-content"); - for (var i = 0; i < caImagePanelConetent.length; i++) { - caImagePanelConetent[i].style.pointerEvents = "none"; - caImagePanelConetent[i].style.opacity = "0.7"; + $scope.Disable3DUI = function (windowviewid) { + var modulePanel = $("#ThreeDImagePanel_"+windowviewid).find(" .jsPanel-content"); + if(modulePanel.length>0) + { + modulePanel[0].style.pointerEvents="none"; + modulePanel[0].style.opacity="0.7"; } + $rootScope.isLoading = true; $('#spinner').css('visibility', 'visible'); @@ -95,14 +96,14 @@ function ($scope, $rootScope, pages, log, $http, DataService, $filter, $location $('#HomeContainerDiv').css('opacity', '0.7'); } - $scope.EnableUI = function () { + $scope.Enable3DUI = function (windowviewid) { - var caImagePanelConetent = document.getElementsByClassName("jsPanel-content"); - for (var i = 0; i < caImagePanelConetent.length; i++) { - caImagePanelConetent[i].style.pointerEvents = "auto"; - caImagePanelConetent[i].style.opacity = "1"; + var modulePanel = $("#ThreeDImagePanel_"+windowviewid).find(" .jsPanel-content"); + if(modulePanel.length>0) + { + modulePanel[0].style.pointerEvents="auto"; + modulePanel[0].style.opacity="1"; } - $rootScope.isLoading = false; $('#spinner').css('visibility', 'hidden'); // CB module enable all @@ -145,7 +146,7 @@ function ($scope, $rootScope, pages, log, $http, DataService, $filter, $location $scope.initialize3DWindowData($rootScope.MULTI_VIEW_ID, true, undefined); - $scope.DisableUI(); + $scope.Disable3DUI($rootScope.MULTI_VIEW_ID); if ($rootScope.refreshcheck == null) { $location.path('/'); @@ -207,10 +208,10 @@ function ($scope, $rootScope, pages, log, $http, DataService, $filter, $location }); - $timeout(function () { $scope.EnableUI(); }, 200); + $timeout(function () { $scope.Enable3DUI(windowviewid); }, 200); }, function (error) { - $scope.EnableUI(); + $scope.Enable3DUI(windowviewid); // handle errors here console.log(' $scope.threeDAnatomyData = ' + error.statusText); } @@ -275,7 +276,7 @@ function ($scope, $rootScope, pages, log, $http, DataService, $filter, $location if ($rootScope.isCallFromOtherModule) { $scope.ThreeDModuleData = ModuleService.getModuleData("THREE_D_ANATOMY"); if($scope.ThreeDModuleData.length<1) return; - $scope.DisableUI(); + $scope.Disable3DUI(); $scope.readyToLoad = true; $rootScope.ThreeDWindowLoadComplete = false; $scope.wincount = 1; @@ -313,20 +314,19 @@ function ($scope, $rootScope, pages, log, $http, DataService, $filter, $location } else { - $scope.DisableUI(); $scope.Open3DModelBody(null); } } $scope.Open3DModelBody = function (ThreeDModuleData) { - $scope.DisableUI(); - if ($rootScope.isCallFromOtherModule == true) { $scope.ThreeDOpenInOtherModules = ThreeDModuleData; $rootScope.MULTI_VIEW_ID += 1; var windowviewid = $rootScope.MULTI_VIEW_ID; + $scope.Disable3DUI(windowviewid); + $scope.initialize3DWindowData(windowviewid, false, $scope.ThreeDOpenInOtherModules.currentWindowId); var moduleName = $scope.ThreeDOpenInOtherModules.mType; @@ -381,7 +381,9 @@ function ($scope, $rootScope, pages, log, $http, DataService, $filter, $location ); } - else { + else + { + $scope.Disable3DUI($rootScope.MULTI_VIEW_ID); $scope.Set3DwindowStoreData($rootScope.MULTI_VIEW_ID, 'parentSlugName', '3d-anatomy-list'); $scope.load3DAnimation($rootScope.MULTI_VIEW_ID); } @@ -504,16 +506,19 @@ function ($scope, $rootScope, pages, log, $http, DataService, $filter, $location $rootScope.resetMenuOptionOnClick(pnlName); }, resizable: { + minWidth: 600, + minHeight: 500, stop: function (event, ui) { var pnlName=event.currentTarget.id; var len = (pnlName).split("_").length; var windowviewid = (pnlName).split("_")[len - 1]; + var canvasDIvHeight = $('#ThreeDImagePanel_' + windowviewid+ " .jsPanel-content").height(); $scope.Set3DwindowStoreData(windowviewid, 'width', ui.size.width); - $scope.Set3DwindowStoreData(windowviewid, 'height', ui.size.height); + $scope.Set3DwindowStoreData(windowviewid, 'height', canvasDIvHeight); $scope.Set3DwindowStoreData(windowviewid, 'y', ui.position.top); $scope.Set3DwindowStoreData(windowviewid, 'x', ui.position.left); $rootScope.UnsaveCurriculum = true; - var canvasDIvHeight = $('#ThreeDImagePanel_' + windowviewid+ " .jsPanel-content").height(); + $('#thContentDiv_'+ windowviewid ).css("height",canvasDIvHeight); $rootScope.resetMenuOptionOnClick(pnlName); } @@ -575,14 +580,14 @@ function ($scope, $rootScope, pages, log, $http, DataService, $filter, $location } $scope.AnimationOnLoad = function (windowviewid) { - $scope.EnableUI(); - + if ($rootScope.isCallFromOtherModule) { $rootScope.ThreeDWindowLoadComplete = true; } $scope.JsPanelMouseEnter(windowviewid); + $scope.Enable3DUI(windowviewid); } diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/AIController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/AIController.js index 1baeabb..889375d 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/AIController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/AIController.js @@ -80,6 +80,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout 'maximised': true, 'minmaxAutoEvent':true, 'annotationData':{shapeStates:[],paintCanvasState:[]}, + 'imgLeft': 0, }; return windata; } @@ -151,14 +152,15 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout } } - $scope.DisableUI = function () { - - var aiImagePanelConetent = document.getElementsByClassName("jsPanel-content"); - for (var i = 0; i < aiImagePanelConetent.length; i++) { - aiImagePanelConetent[i].style.pointerEvents = "none"; - aiImagePanelConetent[i].style.opacity = "0.7"; + $scope.DisableAIUI = function (windowviewid) { + var modulePanel = $("#aiImagePanel_"+windowviewid).find(" .jsPanel-content"); + if(modulePanel.length>0) + { + modulePanel[0].style.pointerEvents="none"; + modulePanel[0].style.opacity="0.7"; } + $rootScope.isLoading = true; $('#spinner').css('visibility', 'visible'); @@ -168,12 +170,13 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout } - $scope.EnableUI = function () { + $scope.EnableAIUI = function (windowviewid) { - var aiImagePanelConetent = document.getElementsByClassName("jsPanel-content"); - for (var i = 0; i < aiImagePanelConetent.length; i++) { - aiImagePanelConetent[i].style.pointerEvents = "auto"; - aiImagePanelConetent[i].style.opacity = "1"; + var modulePanel = $("#aiImagePanel_"+windowviewid).find(" .jsPanel-content"); + if(modulePanel.length>0) + { + modulePanel[0].style.pointerEvents="auto"; + modulePanel[0].style.opacity="1"; } $rootScope.isLoading = false; @@ -222,7 +225,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout $scope.setActiveTab = function (tabToSet, inderectCall, windowviewid) { if (windowviewid == undefined) windowviewid = $rootScope.MULTI_VIEW_ID; - $scope.DisableUI(); + $scope.DisableAIUI(windowviewid); if(tabToSet=="" ||tabToSet==undefined) { @@ -333,7 +336,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout $rootScope.isCallFromOtherModule = undefined; $rootScope.MULTI_VIEW_ID += 1; - $scope.DisableUI(); + $scope.DisableAIUI($rootScope.MULTI_VIEW_ID); // store exist module in module service var ExistData = ModuleService.getModuleData("ADAM_IMAGES"); @@ -476,7 +479,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout }, function (error) { - $scope.EnableUI(); + $scope.EnableAIUI(windowviewid); // handle errors here console.log(' $scope.IllustrationData = ' + error.statusText); } @@ -517,7 +520,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout }, 100); $timeout(function () { - $scope.EnableUI(); + $scope.EnableAIUI(windowviewid); $rootScope.ResetGridListLength(); }, 500); @@ -525,25 +528,14 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout $rootScope.ResetGridListLength=function() - { - var $ua = navigator.userAgent; - - if (($ua.match(/(iPod|iPhone|iPad|android)/i))) { - - var srchHeight=$('.breadcrumb').height(); - var gridheight=screen.height-srchHeight-132; - var listheight=screen.height-srchHeight-356; - $('#grid-view').css({"height":gridheight,"overflow":"auto"}); - $('#ListViewDiv').css({"height":listheight,"overflow":"auto"}); - } - else - { - var srchHeight=$('.breadcrumb').height(); - var gridheight=screen.height-srchHeight-281; - var listheight=screen.height-srchHeight-504; - $('#grid-view').css({"height":gridheight,"overflow":"auto"}); - $('#ListViewDiv').css({"height":listheight,"overflow":"auto"}); - } + { + var innerheight =$(window).innerHeight(); + + var srchHeight=$('.breadcrumb').height(); + var gridheight=innerheight-srchHeight-140; + var listheight=innerheight-srchHeight-365; + $('#grid-view').css({"height":gridheight,"overflow":"auto","min-height":"160px"}); + $('#ListViewDiv').css({"height":listheight,"overflow":"auto","min-height":"100px"}); } $scope.IsVisible = function () { $scope.scroll(); @@ -655,7 +647,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout $scope.filterstring = false; $scope.currentPage = 1; - $scope.DisableUI(); + $scope.DisableAIUI(windowviewid); $scope.loadAllAI(ImageCount, windowviewid); } @@ -665,7 +657,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout $scope.currentPage = 1; windowviewid = $rootScope.MULTI_VIEW_ID; } - $scope.DisableUI(); + $scope.DisableAIUI(windowviewid); var currentSearchtext = $rootScope.getLocalStorageValue("SearchText"); //localStorage.setItem("SearchText", ''); @@ -684,7 +676,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout if ($scope.query.SearchText == "undefined" || ($scope.query.SearchText == null || $scope.query.SearchText == "")) { $('#errorMessage').text(AIAConstants.PLEASE_ENTER_SEARCH_TEXT); $("#messageModal").modal('show'); - $scope.EnableUI(); + $scope.EnableAIUI(windowviewid); return false; } } @@ -781,7 +773,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout } $timeout(function () { - $scope.EnableUI(); + $scope.EnableAIUI(windowviewid); $rootScope.ResetGridListLength(); }, 500); @@ -833,7 +825,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout $('#txtSerachInput').val(""); $scope.idSelected = ''; $scope.hiderow = false; - $scope.DisableUI(); + $scope.DisableAIUI(windowviewid); $('ul li span').removeAttr("style"); $('#' + $rootScope.SearchTextByAlphabet).css({ "color": "white", "background-color": "#1B92D0" }); $scope.filterstring = true; @@ -925,7 +917,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout } $timeout(function () { - $scope.EnableUI(); + $scope.EnableAIUI(windowviewid); $rootScope.ResetGridListLength(); }, 500); } @@ -1014,7 +1006,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout if ($rootScope.isCallFromOtherModule) { $scope.AIModuleData = ModuleService.getModuleData("ADAM_IMAGES"); if($scope.AIModuleData.length<1) return; - $scope.DisableUI(); + $scope.DisableAIUI(); $scope.readyToLoad = true; $rootScope.AIWindowLoadComplete = false; $scope.wincount = 1; @@ -1053,7 +1045,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout } else { - $scope.DisableUI(); + $scope.DisableAIUI(); $scope.OpenAdamImageView(null); } } @@ -1082,6 +1074,8 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout var imageId = $scope.aiOpenInOtherModules.id; $scope.SetAIwindowStoreData(windowviewid, 'imageId', imageId); + var imgLeft = $scope.aiOpenInOtherModules.imgLeft!=undefined?$scope.aiOpenInOtherModules.imgLeft:0; + $scope.SetAIwindowStoreData(windowviewid, 'imgLeft', imgLeft); var selectedTileData = []; selectedTileData = new jinqJs() @@ -1184,7 +1178,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout content: '
'+ '
'+ '
'+ - '
' + + '
' + '' + '
'+ '
', @@ -1215,46 +1209,77 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout var pnlName=panel[0].id; var len = (pnlName).split("_").length; var windowviewid = (pnlName).split("_")[len - 1]; + + $scope.SetAIwindowStoreData(windowviewid, 'maximised',true); + $scope.SetAIwindowStoreData(windowviewid, 'minimised',false); + var canvasDIvHeight = $('#aiImagePanel_' + windowviewid+ " .jsPanel-content").height()-5; + var canvasDIvWidth = $('#aiImagePanel_' + windowviewid+ " .jsPanel-content").width(); + var canvasDiv='canvasDivAI_' + windowviewid; + var canvasDraw='canvasAI_' + windowviewid; + var canvasPaint='canvasPaintAI_' + windowviewid; + var imgName='aimage_' + windowviewid; var isAutoCalled = $scope.GetAIwindowStoreData(windowviewid, 'minmaxAutoEvent'); if(!isAutoCalled) { $rootScope.UnsaveCurriculum = true; - } - $scope.SetAIwindowStoreData(windowviewid, 'maximised',true); - $scope.SetAIwindowStoreData(windowviewid, 'minimised',false); - var canvasDIvHeight = $('#aiImagePanel_' + windowviewid+ " .jsPanel-content").height(); - $('#canvasDivAI_' + windowviewid).css('height', canvasDIvHeight-5); - $rootScope.resetMenuOptionOnClick(pnlName); + var oldleft= $rootScope.GetAIwindowData(windowviewid, 'imgLeft'); + var annotationData=$rootScope.GetAIwindowData(windowviewid,'annotationData'); + $rootScope.setIMGPanelCordinate(windowviewid,pnlName,canvasDiv,canvasDraw,canvasPaint,imgName,oldleft,canvasDIvHeight,canvasDIvWidth,annotationData); + var img = document.getElementById(imgName); + $rootScope.SetAIwindowData(windowviewid, 'imgLeft',img.offsetLeft); + } }, onnormalized:function (panel) { var pnlName=panel[0].id; var len = (pnlName).split("_").length; var windowviewid = (pnlName).split("_")[len - 1]; + + $scope.SetAIwindowStoreData(windowviewid, 'minimised',false); + $scope.SetAIwindowStoreData(windowviewid, 'maximised',false); + var canvasDIvHeight = $('#aiImagePanel_' + windowviewid+ " .jsPanel-content").height()-5; + var canvasDIvWidth = $('#aiImagePanel_' + windowviewid+ " .jsPanel-content").width(); + var canvasDiv='canvasDivAI_' + windowviewid; + var canvasDraw='canvasAI_' + windowviewid; + var canvasPaint='canvasPaintAI_' + windowviewid; + var imgName='aimage_' + windowviewid; var isAutoCalled = $scope.GetAIwindowStoreData(windowviewid, 'minmaxAutoEvent'); if(!isAutoCalled) { $rootScope.UnsaveCurriculum = true; - } - $scope.SetAIwindowStoreData(windowviewid, 'minimised',false); - $scope.SetAIwindowStoreData(windowviewid, 'maximised',false); - var canvasDIvHeight = $('#aiImagePanel_' + windowviewid+ " .jsPanel-content").height(); - $('#canvasDivAI_' + windowviewid).css('height', canvasDIvHeight-5); - $rootScope.resetMenuOptionOnClick(pnlName); + var oldleft= $rootScope.GetAIwindowData(windowviewid, 'imgLeft'); + var annotationData=$rootScope.GetAIwindowData(windowviewid,'annotationData'); + $rootScope.setIMGPanelCordinate(windowviewid,pnlName,canvasDiv,canvasDraw,canvasPaint,imgName,oldleft,canvasDIvHeight,canvasDIvWidth,annotationData); + var img = document.getElementById(imgName); + $rootScope.SetAIwindowData(windowviewid, 'imgLeft',img.offsetLeft); + } }, resizable: { + minWidth: 600, + minHeight: 500, stop: function (event, ui) { var pnlName=event.currentTarget.id; var len = (pnlName).split("_").length; var windowviewid = (pnlName).split("_")[len - 1]; + $rootScope.UnsaveCurriculum = true; + var canvasDIvHeight = $('#aiImagePanel_' + windowviewid+ " .jsPanel-content").height(); + var canvasDIvWidth = $('#aiImagePanel_' + windowviewid+ " .jsPanel-content").width(); $scope.SetAIwindowStoreData(windowviewid, 'width', ui.size.width); - $scope.SetAIwindowStoreData(windowviewid, 'height', ui.size.height); + $scope.SetAIwindowStoreData(windowviewid, 'height', canvasDIvHeight); $scope.SetAIwindowStoreData(windowviewid, 'y', ui.position.top); $scope.SetAIwindowStoreData(windowviewid, 'x', ui.position.left); - $rootScope.UnsaveCurriculum = true; - var canvasDIvHeight = $('#aiImagePanel_' + windowviewid+ " .jsPanel-content").height(); - $('#canvasDivAI_' + windowviewid).css('height', canvasDIvHeight-5); - $rootScope.resetMenuOptionOnClick(pnlName); + + var canvasDiv='canvasDivAI_' + windowviewid; + var canvasDraw='canvasAI_' + windowviewid; + var canvasPaint='canvasPaintAI_' + windowviewid; + var imgName='aimage_' + windowviewid; + var oldleft= $rootScope.GetAIwindowData(windowviewid, 'imgLeft'); + var annotationData=$rootScope.GetAIwindowData(windowviewid,'annotationData'); + + $rootScope.setIMGPanelCordinate(windowviewid,pnlName,canvasDiv,canvasDraw,canvasPaint,imgName,oldleft,canvasDIvHeight-5,canvasDIvWidth,annotationData); + var img = document.getElementById(imgName); + $rootScope.SetAIwindowData(windowviewid, 'imgLeft',img.offsetLeft); + } }, @@ -1297,36 +1322,26 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout $timeout(function () { $('.jsPanel-content .jsPanel-theme-success').css('overflow-y', 'auto !important') - var canvasDIvHeight = $('#aiImagePanel_' + windowviewid+ " .jsPanel-content").height(); - - $('#canvasDivAI_' + windowviewid).css('height', canvasDIvHeight-5); - - - var canvas = document.getElementById("canvasAI_" + windowviewid); - var canvasPaint = document.getElementById("canvasPaintAI_" + windowviewid); - - var $ua = navigator.userAgent; - if (($ua.match(/(iPod|iPhone|iPad|android)/i))) { - canvas.width = screen.width-20; - canvasPaint.width = screen.width-20; - canvas.height = screen.height-130; - canvasPaint.height = screen.height-130; - } - else - { - canvas.height = screen.height-280; - canvasPaint.height = screen.height-280; - canvas.width = screen.width-40; - canvasPaint.width = screen.width-40; - } - + var canvasDIvHeight = $('#aiImagePanel_' + windowviewid+ " .jsPanel-content").height()-5; + var canvasDIvWidth = $('#aiImagePanel_' + windowviewid+ " .jsPanel-content").width(); + $scope.SetAIwindowStoreData(windowviewid, 'currentSlug', 'adam-images-detail'); + var openedImage = document.getElementById('aimage_' + windowviewid ); openedImage.src = selectedAIImage; openedImage.onload = function () { - if (!$rootScope.isCallFromOtherModule) { - $("#aimage_"+windowviewid).css("left", (screen.width-this.width-70)/2 + "px"); - } + var pnlName='aiImagePanel_' + windowviewid; + var canvasDiv='canvasDivAI_' + windowviewid; + var canvasDraw='canvasAI_' + windowviewid; + var canvasPaint='canvasPaintAI_' + windowviewid; + var imgName='aimage_' + windowviewid; + + var demoData= {shapeStates:[],paintCanvasState:""}; + var oldleft= $rootScope.GetAIwindowData(windowviewid, 'imgLeft'); + $rootScope.setIMGPanelCordinate(windowviewid,pnlName,canvasDiv,canvasDraw,canvasPaint,imgName,oldleft,canvasDIvHeight,canvasDIvWidth,demoData); + var img = document.getElementById(imgName); + $rootScope.SetAIwindowData(windowviewid, 'imgLeft',img.offsetLeft); + $("#aimage_"+windowviewid).css("visibility","visible"); $scope.JsPanelclick(windowviewid); @@ -1338,14 +1353,22 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout { if(annotationData.shapeStates.length>0||annotationData.paintCanvasState.length>0) { + var modifiedData=$rootScope.resetAnnotationData(imgName,oldleft,annotationData); + if(modifiedData!="" && modifiedData!=undefined) + { + if(modifiedData.shapeStates.length>0||modifiedData.paintCanvasState.length>0) + { + annotationData=modifiedData; + } + } //first draw shape and then store in object - $rootScope.LoadCBSavedAnnotation("canvasAI_"+windowviewid,"canvasPaintAI_"+windowviewid,annotationData); + $rootScope.LoadCBSavedAnnotation(canvasDraw,canvasPaint,annotationData); } } } - $scope.EnableUI(); + $scope.EnableAIUI(windowviewid); $rootScope.AIWindowLoadComplete = true; }; @@ -1356,6 +1379,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout } } + $rootScope.aiAnnotationToolEvent = function (windowviewid) { $('#editstylebackgroundcolor .minicolors >.minicolors-swatch > .minicolors-swatch-color').css("background-color", "rgb(255,255,255)") diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/AODController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/AODController.js index a1139a5..d752229 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/AODController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/AODController.js @@ -64,14 +64,15 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout } } - $scope.DisableUI = function () { - - var aniImagePanelConetent = document.getElementsByClassName("jsPanel-content"); - for (var i = 0; i < aniImagePanelConetent.length; i++) { - aniImagePanelConetent[i].style.pointerEvents = "none"; - aniImagePanelConetent[i].style.opacity = "0.7"; + $scope.DisableAODUI = function (windowviewid) { + var modulePanel = $("#aodImagePanel_"+windowviewid).find(" .jsPanel-content"); + if(modulePanel.length>0) + { + modulePanel[0].style.pointerEvents="none"; + modulePanel[0].style.opacity="0.7"; } + $rootScope.isLoading = true; $('#spinner').css('visibility', 'visible'); @@ -80,12 +81,13 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout $('#HomeContainerDiv').css('opacity', '0.7'); } - $scope.EnableUI = function () { + $scope.EnableAODUI = function (windowviewid) { - var aniImagePanelConetent = document.getElementsByClassName("jsPanel-content"); - for (var i = 0; i < aniImagePanelConetent.length; i++) { - aniImagePanelConetent[i].style.pointerEvents = "auto"; - aniImagePanelConetent[i].style.opacity = "1"; + var modulePanel = $("#aodImagePanel_"+windowviewid).find(" .jsPanel-content"); + if(modulePanel.length>0) + { + modulePanel[0].style.pointerEvents="auto"; + modulePanel[0].style.opacity="1"; } $rootScope.isLoading = false; @@ -150,7 +152,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout $scope.initializeAODWindowData($rootScope.MULTI_VIEW_ID, true, undefined); - $scope.DisableUI(); + $scope.DisableAODUI($rootScope.MULTI_VIEW_ID); if ($rootScope.refreshcheck == null) { $location.path('/'); @@ -187,12 +189,12 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout { $('#errorMessage').text(AIAConstants.NO_COURSE_FOUND_MESSAGE); $("#messageModal").modal('show'); - $scope.EnableUI(); + $scope.EnableAODUI(windowviewid); } }, function (error) { - $scope.EnableUI(); + $scope.EnableAODUI(windowviewid); }) }; @@ -232,28 +234,17 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout $timeout(function () { - $scope.EnableUI(); + $scope.EnableAODUI(windowviewid); $rootScope.ResetGridListLength(); }, 400); } $rootScope.ResetGridListLength=function() { - var $ua = navigator.userAgent; - - if (($ua.match(/(iPod|iPhone|iPad|android)/i))) { - - var gridheight=screen.height-107; - $('#grid-view').css({"height":gridheight,"overflow":"auto"}); - - } - else - { - var gridheight=screen.height-252; - $('#grid-view').css({"height":gridheight,"overflow":"auto"}); - - } + var innerheight =$(window).innerHeight(); + var gridheight=innerheight-115; + $('#grid-view').css({"height":gridheight,"overflow":"auto","min-height":"200px"}); } $scope.openView = function ($event) { @@ -295,7 +286,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout } $scope.loadAdamVideo = function (windowviewid) { - $scope.DisableUI(); + $scope.DisableAODUI(windowviewid); $scope.jsPanelID = 'aodImagePanel' + '_' + windowviewid; var tittle = $scope.GetAODwindowStoreData(windowviewid, 'currentViewTitle'); @@ -393,8 +384,8 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout $scope.MyAODvideoOnLoad = function (windowviewid) { - $scope.EnableUI(); - $scope.JsPanelMouseEnter(windowviewid); + $scope.JsPanelMouseEnter(windowviewid); + $scope.EnableAODUI(windowviewid); } $scope.JsPanelMouseEnter = function (windowviewid) { diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/CAController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/CAController.js index 6b212bc..bf421db 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/CAController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/CAController.js @@ -126,14 +126,15 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout } } - $scope.DisableUI = function () { - - var caImagePanelConetent = document.getElementsByClassName("jsPanel-content"); - for (var i = 0; i < caImagePanelConetent.length; i++) { - caImagePanelConetent[i].style.pointerEvents = "none"; - caImagePanelConetent[i].style.opacity = "0.7"; + $scope.DisableCAUI = function (windowviewid) { + var modulePanel = $("#caImagePanel_"+windowviewid).find(" .jsPanel-content"); + if(modulePanel.length>0) + { + modulePanel[0].style.pointerEvents="none"; + modulePanel[0].style.opacity="0.7"; } + $rootScope.isLoading = true; $('#spinner').css('visibility', 'visible'); @@ -142,12 +143,13 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout $('#HomeContainerDiv').css('opacity', '0.7'); } - $scope.EnableUI = function () { + $scope.EnableCAUI = function (windowviewid) { - var caImagePanelConetent = document.getElementsByClassName("jsPanel-content"); - for (var i = 0; i < caImagePanelConetent.length; i++) { - caImagePanelConetent[i].style.pointerEvents = "auto"; - caImagePanelConetent[i].style.opacity = "1"; + var modulePanel = $("#caImagePanel_"+windowviewid).find(" .jsPanel-content"); + if(modulePanel.length>0) + { + modulePanel[0].style.pointerEvents="auto"; + modulePanel[0].style.opacity="1"; } $rootScope.isLoading = false; @@ -227,7 +229,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout } }, function (error) { - $scope.EnableUI(); + $scope.EnableCAUI(); // handle errors here console.log(' $scope.AnimationData = ' + error.statusText); }); @@ -277,7 +279,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout $scope.initializeCAWindowData($rootScope.MULTI_VIEW_ID, true, undefined); - $scope.DisableUI(); + $scope.DisableCAUI($rootScope.MULTI_VIEW_ID); if ($rootScope.refreshcheck == null) { $location.path('/'); @@ -390,7 +392,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout promise.then( function (result) { - if($rootScope.userData.Id>1 && $rootScope.userData.LicenseInfo!= null && $rootScope.userData.EditionId<=2 && $rootScope.userData.StudentEdition!= null && $rootScope.userData.StudentEdition.length>0) + if($rootScope.userData.LicenseInfo!= null && $rootScope.userData.EditionId<=2 && $rootScope.userData.StudentEdition!= null && $rootScope.userData.StudentEdition.length>0) { $scope.islinkActive = true; var AnimationData = new jinqJs() @@ -419,7 +421,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout }, function (error) { - $scope.EnableUI(); + $scope.EnableCAUI(windowviewid); // handle errors here console.log(' $scope.AnimationData = ' + error.statusText); }); @@ -435,7 +437,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout angular.forEach($scope.selectedCAListViewData, function (value, key) { var imagePath = "~/../content/images/ca/thumbnails/" + value._ThumbnailImage; - if($rootScope.userData.Id>1 && $rootScope.userData.LicenseInfo!= null && $rootScope.userData.EditionId<=2 && $rootScope.userData.StudentEdition!= null && $rootScope.userData.StudentEdition.length>0) + if($rootScope.userData.LicenseInfo!= null && $rootScope.userData.EditionId<=2 && $rootScope.userData.StudentEdition!= null && $rootScope.userData.StudentEdition.length>0) { var $el = $('
' +'
' @@ -485,7 +487,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout $timeout(function () { - $scope.EnableUI(); + $scope.EnableCAUI(windowviewid); $rootScope.ResetGridListLength(); }, 400); @@ -549,7 +551,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout if (windowviewid == undefined) // call from also home controller list manager windowviewid = $rootScope.MULTI_VIEW_ID; - $scope.DisableUI(); + $scope.DisableCAUI(windowviewid); query.selectedbodyregion = ""; query.selectedbodysystem = ""; @@ -583,11 +585,11 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout } - $scope.ApplySearch = function (query, windowviewid) { - $scope.DisableUI(); + $scope.ApplySearch = function (query, windowviewid) { if (windowviewid == undefined) { windowviewid = $rootScope.MULTI_VIEW_ID; } + $scope.DisableCAUI(windowviewid); setTimeout(function(){ $scope.FilterSearch(query, windowviewid) @@ -676,7 +678,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout if (selectimg === true && count >= filtercount) { var imagePath = "~/../content/images/ca/thumbnails/" + value._ThumbnailImage; - if($rootScope.userData.Id>1 && $rootScope.userData.LicenseInfo!= null && $rootScope.userData.EditionId<=2 && $rootScope.userData.StudentEdition!= null && $rootScope.userData.StudentEdition.length>0) + if($rootScope.userData.LicenseInfo!= null && $rootScope.userData.EditionId<=2 && $rootScope.userData.StudentEdition!= null && $rootScope.userData.StudentEdition.length>0) { var $el = $('
' +'
' @@ -743,31 +745,20 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout } $timeout(function () { - $scope.EnableUI(); + $scope.EnableCAUI(windowviewid); $rootScope.ResetGridListLength(); }, 500); } $rootScope.ResetGridListLength=function() { - var $ua = navigator.userAgent; - - if (($ua.match(/(iPod|iPhone|iPad|android)/i))) { + var innerheight =$(window).innerHeight(); - var srchHeight=$('.breadcrumb').height(); - var gridheight=screen.height-srchHeight-128; - var listheight=screen.height-srchHeight-352; - $('#grid-view').css({"height":gridheight,"overflow":"auto"}); - $('#ListViewDiv').css({"height":listheight,"overflow":"auto"}); - } - else - { - var srchHeight=$('.breadcrumb').height(); - var gridheight=screen.height-srchHeight-276; - var listheight=screen.height-srchHeight-500; - $('#grid-view').css({"height":gridheight,"overflow":"auto"}); - $('#ListViewDiv').css({"height":listheight,"overflow":"auto"}); - } + var srchHeight=$('.breadcrumb').height(); + var gridheight=innerheight-srchHeight-135; + var listheight=innerheight-srchHeight-358; + $('#grid-view').css({"height":gridheight,"overflow":"auto","min-height":"160px"}); + $('#ListViewDiv').css({"height":listheight,"overflow":"auto","min-height":"100px"}); } $scope.scroll = function () { $("html,body").scrollTop(0); @@ -857,7 +848,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout if ($rootScope.isCallFromOtherModule) { $scope.CAModuleData = ModuleService.getModuleData("CLINICAL_ANIMATIONS"); if($scope.CAModuleData.length<1) return; - $scope.DisableUI(); + $scope.DisableCAUI(); $scope.readyToLoad = true; $rootScope.CAWindowLoadComplete = false; $scope.wincount = 1; @@ -895,7 +886,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout } else { - $scope.DisableUI(); + $scope.DisableCAUI(); $scope.openBodyView(null); } } @@ -990,7 +981,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout $location.path('/'); } - $scope.DisableUI(); + $scope.DisableCAUI(windowviewid); // $scope.jsPanelID = 'caVideoPanel' + '_' + windowviewid; //changes to find the id by partail match @@ -1062,7 +1053,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout theme: 'success', currentController: 'CAController', parentSlug: $scope.GetCAwindowStoreData(windowviewid, 'parentSlugName'), - content: '' + + content: '' + '

' + clickedCASummary + '

', + ' Here we are

' + clickedCASummary + '

', + title: tittle, position: { @@ -1132,7 +1124,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout theme: 'success', currentController: 'CAController', parentSlug: $scope.GetCAwindowStoreData(windowviewid, 'parentSlugName'), - content: '' + + content: '' + '

' + clickedCASummary + '

', + ' Here we are

' + clickedCASummary + '

', title: tittle, position: { @@ -1184,7 +1176,8 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout $scope.SetCAwindowStoreData(windowviewid, 'maximised',true); $scope.SetCAwindowStoreData(windowviewid, 'minimised',false); var canvasDIvHeight = $('#caImagePanel_' + windowviewid+ " .jsPanel-content").height(); - $('#playerinlineVideo_'+ windowviewid ).css("height",canvasDIvHeight-120 ); + var summaryHeight = $('#summary_'+ windowviewid).height()+10; + $('#playerinlineVideo_'+ windowviewid ).css("height",canvasDIvHeight-summaryHeight ); $rootScope.resetMenuOptionOnClick(pnlName); var $ua = navigator.userAgent; if (($ua.match(/(iPod|iPhone|iPad|android)/i))) { @@ -1193,11 +1186,11 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout { $("#caImagePanel_"+windowviewid).css('height',canvasDIvHeight+30-150); $('#caImagePanel_' + windowviewid+ " .jsPanel-content").css('height',canvasDIvHeight-150); - $('#playerinlineVideo_'+ windowviewid ).css("height",canvasDIvHeight-150-120 ); + $('#playerinlineVideo_'+ windowviewid ).css("height",canvasDIvHeight-150-summaryHeight ); } else if(aodheight<1024) { - $('#playerinlineVideo_'+ windowviewid ).css("height",canvasDIvHeight-120 ); + $('#playerinlineVideo_'+ windowviewid ).css("height",canvasDIvHeight-summaryHeight ); } } }, @@ -1213,21 +1206,25 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout $scope.SetCAwindowStoreData(windowviewid, 'minimised',false); $scope.SetCAwindowStoreData(windowviewid, 'maximised',false); var canvasDIvHeight = $('#caImagePanel_' + windowviewid+ " .jsPanel-content").height(); - $('#playerinlineVideo_'+ windowviewid ).css("height",canvasDIvHeight-120 ); + var summaryHeight = $('#summary_'+ windowviewid).height()+10; + $('#playerinlineVideo_'+ windowviewid ).css("height",canvasDIvHeight-summaryHeight ); $rootScope.resetMenuOptionOnClick(pnlName); }, resizable: { + minWidth: 600, + minHeight: 500, stop: function (event, ui) { var pnlName=event.currentTarget.id; var len = (pnlName).split("_").length; var windowviewid = (pnlName).split("_")[len - 1]; + var canvasDIvHeight = $('#caImagePanel_' + windowviewid+ " .jsPanel-content").height(); $scope.SetCAwindowStoreData(windowviewid, 'width', ui.size.width); - $scope.SetCAwindowStoreData(windowviewid, 'height', ui.size.height); + $scope.SetCAwindowStoreData(windowviewid, 'height', canvasDIvHeight); $scope.SetCAwindowStoreData(windowviewid, 'y', ui.position.top); $scope.SetCAwindowStoreData(windowviewid, 'x', ui.position.left); $rootScope.UnsaveCurriculum = true; - var canvasDIvHeight = $('#caImagePanel_' + windowviewid+ " .jsPanel-content").height(); - $('#playerinlineVideo_'+ windowviewid ).css("height",canvasDIvHeight-120 ); + var summaryHeight = $('#summary_'+ windowviewid).height()+10; + $('#playerinlineVideo_'+ windowviewid ).css("height",canvasDIvHeight-summaryHeight ); $rootScope.resetMenuOptionOnClick(pnlName); } @@ -1245,28 +1242,27 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout } }); } - - var isMaximize = $scope.GetCAwindowStoreData(windowviewid, 'maximised'); - var isMinimize = $scope.GetCAwindowStoreData(windowviewid, 'minimised'); - if (isMaximize) { - $scope.jsPanelCA.maximize(); - } - else if (isMinimize) { - $scope.jsPanelCA.minimize(); - } - else { - $scope.jsPanelCA.normalize(); - } - $rootScope.AllPanelObject(windowviewid,$scope.jsPanelCA); - - $("#caImagePanel_"+windowviewid).css('overflow','hidden'); - // set false after initial call of min,max or normal - $scope.SetCAwindowStoreData(windowviewid, 'minmaxAutoEvent', false); - $scope.SetCAwindowStoreData(windowviewid, 'y', $scope.jsPanelTop); - $scope.SetCAwindowStoreData(windowviewid, 'x', $scope.jsPanelLeft); - $scope.SetCAwindowStoreData(windowviewid, 'width', $scope.jsPanelWidth); - $scope.SetCAwindowStoreData(windowviewid, 'height', $scope.jsPanelHeight); + var isMaximize = $scope.GetCAwindowStoreData(windowviewid, 'maximised'); + var isMinimize = $scope.GetCAwindowStoreData(windowviewid, 'minimised'); + if (isMaximize) { + $scope.jsPanelCA.maximize(); + } + else if (isMinimize) { + $scope.jsPanelCA.minimize(); + } + else { + $scope.jsPanelCA.normalize(); + } + $rootScope.AllPanelObject(windowviewid,$scope.jsPanelCA); + + $("#caImagePanel_"+windowviewid).css('overflow','hidden'); + // set false after initial call of min,max or normal + $scope.SetCAwindowStoreData(windowviewid, 'minmaxAutoEvent', false); + $scope.SetCAwindowStoreData(windowviewid, 'y', $scope.jsPanelTop); + $scope.SetCAwindowStoreData(windowviewid, 'x', $scope.jsPanelLeft); + $scope.SetCAwindowStoreData(windowviewid, 'width', $scope.jsPanelWidth); + $scope.SetCAwindowStoreData(windowviewid, 'height', $scope.jsPanelHeight); $scope.SetCAwindowStoreData(windowviewid, 'currentSlug', 'clinical-animations-detail'); $('html, body').animate({ scrollTop: 0 }); @@ -1278,28 +1274,9 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout var canvasDIvHeight = $('#caImagePanel_' + windowviewid+ " .jsPanel-content").height(); - $('#playerinlineVideo_'+ windowviewid ).css("height",canvasDIvHeight-120 ); - - var videoHeight = $('#playerinlineVideo_'+ windowviewid ).height(); - - var textH = $('.video-subtitle').height(); - textH = textH + 40; - var blackBorderHeight = canvasDIvHeight - (videoHeight + textH); - - if ($('.jsPanel-content').length > 0) { - $('.video-subtitle').css('margin-bottom', blackBorderHeight); - $('#divplayerinlineVideo_'+ windowviewid ).css('background', '#fff'); - //Android > Clinical Animations > The animation does not fit to the screen in the Landscape mode. - var $ua = navigator.userAgent; - if (($ua.match(/(iPod|iPhone|iPad|android)/i))) { $('.jsPanel-content').css("width", "100%"); } - } - - if(screen.height<=640) - { - $('#btnTxtOnOff_' + windowviewid).css("top", "-15px"); - } - + var summaryHeight = $('#summary_'+ windowviewid).height(); + $('#playerinlineVideo_'+ windowviewid ).css("height",canvasDIvHeight-summaryHeight); } //Calling methode for save Js Panel Activity for SaveCB @@ -1308,7 +1285,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout $scope.videoOnLoad = function (windowviewid) { - $scope.EnableUI(); + $scope.EnableCAUI(windowviewid); if ($rootScope.isCallFromOtherModule) { //$scope.JsPanelclick(windowviewid); @@ -1318,16 +1295,22 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout $scope.JsPanelclick(windowviewid); var isTextVisible = $scope.GetCAwindowStoreData(windowviewid, 'isTextVisible'); + var canvasDIvHeight = $('#caImagePanel_' + windowviewid+ " .jsPanel-content").height(); + if(isTextVisible) { - $("#btnTxtOnOff_" + windowviewid).text("Text Off"); - $("#sid_" + windowviewid).css("visibility", "visible"); + $("#sid_" + windowviewid).css("display", "block"); + $("#btnTxtOnOff_" + windowviewid).text("Text Off"); + $('#summary_'+ windowviewid ).css("height","125px"); + $('#playerinlineVideo_'+ windowviewid ).css("height",canvasDIvHeight-125 ); } else { + $("#sid_" + windowviewid).css("display", "none"); $("#btnTxtOnOff_" + windowviewid).text("Text On"); - $("#sid_" + windowviewid).css("visibility", "hidden"); - + $('#summary_'+ windowviewid ).css("height","40px"); + $('#playerinlineVideo_'+ windowviewid ).css("height",canvasDIvHeight-40 ); + } } @@ -1399,11 +1382,19 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout $scope.GetTextVisiblity = function (windowviewid, btnTextValue) { var isVisible; + var canvasDIvHeight = $('#caImagePanel_' + windowviewid+ " .jsPanel-content").height(); if (btnTextValue == "Text On") { isVisible = false; + $("#sid_" + windowviewid).css("display", "none"); + $('#summary_'+ windowviewid ).css("height","40px"); + $('#playerinlineVideo_'+ windowviewid ).css("height",canvasDIvHeight-40 ); $scope.SetCAwindowStoreData(windowviewid, 'isTextVisible', isVisible); - } else { + } else + { isVisible = true; + $("#sid_" + windowviewid).css("display", "block"); + $('#summary_'+ windowviewid ).css("height","125px"); + $('#playerinlineVideo_'+ windowviewid ).css("height",canvasDIvHeight-125 ); $scope.SetCAwindowStoreData(windowviewid, 'isTextVisible', isVisible); } } diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/CIController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/CIController.js index 89cf809..8a55286 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/CIController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/CIController.js @@ -76,6 +76,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout 'maximised': true, 'minmaxAutoEvent':true, 'annotationData':{shapeStates:[],paintCanvasState:[]}, + 'imgLeft': 0, }; return windata; @@ -148,14 +149,15 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout } } - $scope.DisableUI = function () { - - var ciImagePanelConetent = document.getElementsByClassName("jsPanel-content"); - for (var i = 0; i < ciImagePanelConetent.length; i++) { - ciImagePanelConetent[i].style.pointerEvents = "none"; - ciImagePanelConetent[i].style.opacity = "0.7"; + $scope.DisableCIUI = function (windowviewid) { + var modulePanel = $("#ciImagePanel_"+windowviewid).find(" .jsPanel-content"); + if(modulePanel.length>0) + { + modulePanel[0].style.pointerEvents="none"; + modulePanel[0].style.opacity="0.7"; } + $rootScope.isLoading = true; $('#spinner').css('visibility', 'visible'); @@ -164,12 +166,13 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout $('#HomeContainerDiv').css('opacity', '0.7'); } - $scope.EnableUI = function () { + $scope.EnableCIUI = function (windowviewid) { - var ciImagePanelConetent = document.getElementsByClassName("jsPanel-content"); - for (var i = 0; i < ciImagePanelConetent.length; i++) { - ciImagePanelConetent[i].style.pointerEvents = "auto"; - ciImagePanelConetent[i].style.opacity = "1"; + var modulePanel = $("#ciImagePanel_"+windowviewid).find(" .jsPanel-content"); + if(modulePanel.length>0) + { + modulePanel[0].style.pointerEvents="auto"; + modulePanel[0].style.opacity="1"; } $rootScope.isLoading = false; @@ -214,7 +217,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout $scope.initializeCIWindowData($rootScope.MULTI_VIEW_ID, true, undefined); - $scope.DisableUI(); + $scope.DisableCIUI($rootScope.MULTI_VIEW_ID); if ($rootScope.refreshcheck == null) { $location.path('/'); @@ -359,7 +362,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout }, function (error) { - $scope.EnableUI(); + $scope.EnableCIUI(windowviewid); // handle errors here console.log(' $scope.IllustrationData = ' + error.statusText); } @@ -395,7 +398,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout $timeout(function () { - $scope.EnableUI(); + $scope.EnableCIUI(windowviewid); $rootScope.ResetGridListLength(); }, 400); @@ -459,7 +462,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout if (windowviewid == undefined) // call from also home controller list manager windowviewid = $rootScope.MULTI_VIEW_ID; - $scope.DisableUI(); + $scope.DisableCIUI(windowviewid); query.selectedbodyregion = ""; query.selectedbodysystem = ""; @@ -493,10 +496,11 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout } $scope.ApplySearch = function (query, windowviewid) { - $scope.DisableUI(); + if (windowviewid == undefined) { windowviewid = $rootScope.MULTI_VIEW_ID; } + $scope.DisableCIUI(windowviewid); setTimeout(function(){ $scope.FilterSearch(query, windowviewid) @@ -686,31 +690,20 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout } $timeout(function () { - $scope.EnableUI(); + $scope.EnableCIUI(windowviewid); $rootScope.ResetGridListLength(); }, 400); } $rootScope.ResetGridListLength=function() { - var $ua = navigator.userAgent; - - if (($ua.match(/(iPod|iPhone|iPad|android)/i))) { + var innerheight =$(window).innerHeight(); - var srchHeight=$('.breadcrumb').height(); - var gridheight=screen.height-srchHeight-128; - var listheight=screen.height-srchHeight-352; - $('#grid-view').css({"height":gridheight,"overflow":"auto"}); - $('#ListViewDiv').css({"height":listheight,"overflow":"auto"}); - } - else - { - var srchHeight=$('.breadcrumb').height(); - var gridheight=screen.height-srchHeight-276; - var listheight=screen.height-srchHeight-500; - $('#grid-view').css({"height":gridheight,"overflow":"auto"}); - $('#ListViewDiv').css({"height":listheight,"overflow":"auto"}); - } + var srchHeight=$('.breadcrumb').height(); + var gridheight=innerheight-srchHeight-135; + var listheight=innerheight-srchHeight-358; + $('#grid-view').css({"height":gridheight,"overflow":"auto","min-height":"160px"}); + $('#ListViewDiv').css({"height":listheight,"overflow":"auto","min-height":"100px"}); } $scope.scroll = function () { @@ -792,7 +785,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout if ($rootScope.isCallFromOtherModule) { $scope.CIModuleData = ModuleService.getModuleData("CLINICAL_ILLUSTRATIONS"); if($scope.CIModuleData.length<1) return; - $scope.DisableUI(); + $scope.DisableCIUI(); $scope.readyToLoad = true; $rootScope.CIWindowLoadComplete = false; $scope.wincount = 1; @@ -830,7 +823,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout } else { - $scope.DisableUI(); + $scope.DisableCIUI(); $scope.openBodyView(null); } } @@ -859,6 +852,8 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout var imageId = $scope.ciOpenInOtherModules.id; $scope.SetCIwindowStoreData(windowviewid, 'imageId', imageId); + var imgLeft = $scope.ciOpenInOtherModules.imgLeft!=undefined?$scope.ciOpenInOtherModules.imgLeft:0; + $scope.SetCIwindowStoreData(windowviewid, 'imgLeft', imgLeft); var selectedTileData = []; selectedTileData = new jinqJs() @@ -971,9 +966,15 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout '
' + //'
' + '' + - '
' + + '
' + '

' + selectedImageCISummary + '

' + - '
' + + '
' + '
'+ '
', title: tittle, @@ -1001,58 +1002,80 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout onmaximized:function (panel) { var pnlName=panel[0].id; var len = (pnlName).split("_").length; - var windowviewid = (pnlName).split("_")[len - 1]; - var isAutoCalled = $scope.GetCIwindowStoreData(windowviewid, 'minmaxAutoEvent'); - if(!isAutoCalled) - { - $rootScope.UnsaveCurriculum = true; - } + var windowviewid = (pnlName).split("_")[len - 1]; $scope.SetCIwindowStoreData(windowviewid, 'maximised',true); $scope.SetCIwindowStoreData(windowviewid, 'minimised',false); - var canvasDIvHeight = $('#ciImagePanel_' + windowviewid+ " .jsPanel-content").height(); - $('#canvasDivCI_' + windowviewid).css('height', canvasDIvHeight); - $rootScope.resetMenuOptionOnClick(pnlName); + var canvasDIvHeight = $('#ciImagePanel_' + windowviewid+ " .jsPanel-content").height()-5; + var canvasDIvWidth = $('#ciImagePanel_' + windowviewid+ " .jsPanel-content").width(); + var canvasDiv='canvasDivCI_' + windowviewid; + var canvasDraw='canvasCI_' + windowviewid; + var canvasPaint='canvasPaintCI_' + windowviewid; + var imgName='ciimage_' + windowviewid; + var isAutoCalled = $scope.GetCIwindowStoreData(windowviewid, 'minmaxAutoEvent'); + if(!isAutoCalled) + { + $rootScope.UnsaveCurriculum = true; + var oldleft= $rootScope.GetCIwindowData(windowviewid, 'imgLeft'); + var annotationData=$rootScope.GetCIwindowData(windowviewid,'annotationData'); + $rootScope.setIMGPanelCordinate(windowviewid,pnlName,canvasDiv,canvasDraw,canvasPaint,imgName,oldleft,canvasDIvHeight,canvasDIvWidth,annotationData); + var img = document.getElementById(imgName); + $rootScope.SetCIwindowData(windowviewid, 'imgLeft',img.offsetLeft); + } + }, onnormalized:function (panel) { var pnlName=panel[0].id; var len = (pnlName).split("_").length; var windowviewid = (pnlName).split("_")[len - 1]; + $scope.SetCIwindowStoreData(windowviewid, 'minimised',false); + $scope.SetCIwindowStoreData(windowviewid, 'maximised',false); + var canvasDIvHeight = $('#ciImagePanel_' + windowviewid+ " .jsPanel-content").height()-5; + var canvasDIvWidth = $('#ciImagePanel_' + windowviewid+ " .jsPanel-content").width(); + var canvasDiv='canvasDivCI_' + windowviewid; + var canvasDraw='canvasCI_' + windowviewid; + var canvasPaint='canvasPaintCI_' + windowviewid; + var imgName='ciimage_' + windowviewid; + var isAutoCalled = $scope.GetCIwindowStoreData(windowviewid, 'minmaxAutoEvent'); if(!isAutoCalled) { - $rootScope.UnsaveCurriculum = true; + $rootScope.UnsaveCurriculum = true; + var oldleft= $rootScope.GetCIwindowData(windowviewid, 'imgLeft'); + var annotationData=$rootScope.GetCIwindowData(windowviewid,'annotationData'); + $rootScope.setIMGPanelCordinate(windowviewid,pnlName,canvasDiv,canvasDraw,canvasPaint,imgName,oldleft,canvasDIvHeight,canvasDIvWidth,annotationData); + var img = document.getElementById(imgName); + $rootScope.SetCIwindowData(windowviewid, 'imgLeft',img.offsetLeft); } - $scope.SetCIwindowStoreData(windowviewid, 'minimised',false); - $scope.SetCIwindowStoreData(windowviewid, 'maximised',false); - var canvasDIvHeight = $('#ciImagePanel_' + windowviewid+ " .jsPanel-content").height(); - $('#canvasDivCI_' + windowviewid).css('height', canvasDIvHeight); - $rootScope.resetMenuOptionOnClick(pnlName); + }, resizable: { + minWidth: 600, + minHeight: 500, stop: function (event, ui) { var pnlName=event.currentTarget.id; var len = (pnlName).split("_").length; var windowviewid = (pnlName).split("_")[len - 1]; + var canvasDIvHeight = $('#ciImagePanel_' + windowviewid+ " .jsPanel-content").height(); + var canvasDIvWidth = $('#ciImagePanel_' + windowviewid+ " .jsPanel-content").width(); $scope.SetCIwindowStoreData(windowviewid, 'width', ui.size.width); - $scope.SetCIwindowStoreData(windowviewid, 'height', ui.size.height); + $scope.SetCIwindowStoreData(windowviewid, 'height', canvasDIvHeight); $scope.SetCIwindowStoreData(windowviewid, 'y', ui.position.top); $scope.SetCIwindowStoreData(windowviewid, 'x', ui.position.left); $rootScope.UnsaveCurriculum = true; - var canvasDIvHeight = $('#ciImagePanel_' + windowviewid+ " .jsPanel-content").height(); - //annotation lost after resize paint canvas - // var canvasDIvWidth = $('#ciImagePanel_' + windowviewid+ " .jsPanel-content").width()-50; - // var canvas = document.getElementById("canvasCI_" + windowviewid); - // var canvasPaint = document.getElementById("canvasPaintCI_" + windowviewid); - //canvas.height = canvasDIvHeight-200; - // canvasPaint.height = canvasDIvHeight-200; - // canvas.width = canvasDIvWidth; - // canvasPaint.width = canvasDIvWidth; - - $('#canvasDivCI_' + windowviewid).css('height', canvasDIvHeight); - $rootScope.resetMenuOptionOnClick(pnlName); - + + var canvasDiv='canvasDivCI_' + windowviewid; + var canvasDraw='canvasCI_' + windowviewid; + var canvasPaint='canvasPaintCI_' + windowviewid; + var imgName='ciimage_' + windowviewid; + var oldleft= $rootScope.GetCIwindowData(windowviewid, 'imgLeft'); + var annotationData=$rootScope.GetCIwindowData(windowviewid,'annotationData'); + + $rootScope.setIMGPanelCordinate(windowviewid,pnlName,canvasDiv,canvasDraw,canvasPaint,imgName,oldleft,canvasDIvHeight-5,canvasDIvWidth,annotationData); + var img = document.getElementById(imgName); + $rootScope.SetCIwindowData(windowviewid, 'imgLeft',img.offsetLeft); + } }, @@ -1094,74 +1117,44 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout $scope.SetCIwindowStoreData(windowviewid, 'currentSlug', 'clinical-illustrations-detail'); - var $ua = navigator.userAgent; - if (($ua.match(/(iPod|iPhone|iPad|android)/i))) { - $('#summary_' + windowviewid).css("top", screen.height-270); - } - else - { - $('#summary_' + windowviewid).css("top", screen.height-420); - } + $timeout(function () { - var canvasDIvHeight = $('#ciImagePanel_' + windowviewid+ " .jsPanel-content").height(); - - $('#canvasDivCI_' + windowviewid).css('height', canvasDIvHeight); + var canvasDIvHeight = $('#ciImagePanel_' + windowviewid+ " .jsPanel-content").height()-5; + var canvasDIvWidth = $('#ciImagePanel_' + windowviewid+ " .jsPanel-content").width(); - if (!$rootScope.isCallFromOtherModule) { - $('#CIView').css("height", $(window).innerHeight()-100); - $('#CIView').css("width",$(window).innerWidth()-100); - } - - var canvas = document.getElementById("canvasCI_" + windowviewid); - var canvasPaint = document.getElementById("canvasPaintCI_" + windowviewid); - - var $ua = navigator.userAgent; - if (($ua.match(/(iPod|iPhone|iPad|android)/i))) { - canvas.width = screen.width-20; - canvasPaint.width = screen.width-20; - canvas.height = screen.height-270; - canvasPaint.height = screen.height-270; - } - else - { - canvas.width = screen.width-40; - canvasPaint.width = screen.width-40; - canvas.height = screen.height-400; - canvasPaint.height = screen.height-400; - } - if(screen.height<400) - { - $('#summary_' + windowviewid).css("bottom", "-220px"); - } - var openedImage = document.getElementById('ciimage_' + windowviewid ); openedImage.src = selectedCIImage; openedImage.onload = function () { - if (!$rootScope.isCallFromOtherModule) { - $("#ciimage_"+windowviewid).css("left", (screen.width-this.width-70)/2 + "px"); - } + var pnlName='ciImagePanel_' + windowviewid; + var canvasDiv='canvasDivCI_' + windowviewid; + var canvasDraw='canvasCI_' + windowviewid; + var canvasPaint='canvasPaintCI_' + windowviewid; + var imgName='ciimage_' + windowviewid; + + var demoData= {shapeStates:[],paintCanvasState:""}; + var oldleft= $rootScope.GetCIwindowData(windowviewid, 'imgLeft'); + $rootScope.setIMGPanelCordinate(windowviewid,pnlName,canvasDiv,canvasDraw,canvasPaint,imgName,oldleft,canvasDIvHeight,canvasDIvWidth,demoData); + var img = document.getElementById(imgName); + $rootScope.SetCIwindowData(windowviewid, 'imgLeft',img.offsetLeft); + $("#ciimage_"+windowviewid).css("visibility","visible"); - var canvasZIndex = $("#canvasCI_" + windowviewid).css("z-index"); - var canvasPaintZIndex = $("#canvasPaintCI_" + windowviewid).css("z-index"); - - if (parseInt(canvasZIndex) < parseInt(canvasPaintZIndex)) { - canvasPaintZIndex = parseInt(canvasPaintZIndex) + 1; - $('#summary_' + windowviewid).css("z-index", canvasPaintZIndex); - } - else { - canvasZIndex = parseInt(canvasZIndex) + 1; - $('#summary_' + windowviewid).css("z-index", canvasZIndex); - } - + + $rootScope.SetPaintZindexforCISummary(windowviewid); $scope.JsPanelclick(windowviewid); var isTextVisible = $scope.GetCIwindowStoreData(windowviewid, 'isTextVisible'); if (isTextVisible) { - $("#btnTxtOnOff_" + windowviewid).text("Text Off"); $("#sid_" + windowviewid).css("visibility", "visible"); + $("#btnTxtOnOff_" + windowviewid).text("Text Off"); + $("#sid_" + windowviewid).css("display", "block"); + // $('#summary_' + windowviewid).css({"width": "100%","left":"0px"}); } - else { - $("#btnTxtOnOff_" + windowviewid).text("Text On"); $("#sid_" + windowviewid).css("visibility", "hidden"); + else + { + $("#btnTxtOnOff_" + windowviewid).text("Text On"); + $("#sid_" + windowviewid).css("display", "none"); + // var canvasWidth = $('#ciImagePanel_' + windowviewid+ " .jsPanel-content").width()-107; + // $('#summary_' + windowviewid).css({"width": "87px","left":canvasWidth+'px'}); } if ($rootScope.isCallFromOtherModule) { var annotationData= $scope.ciOpenInOtherModules.annotationData; @@ -1169,14 +1162,23 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout if(annotationData!="" && annotationData!=undefined) { if(annotationData.shapeStates.length>0||annotationData.paintCanvasState.length>0) - { + { + var modifiedData=$rootScope.resetAnnotationData(imgName,oldleft,annotationData); + if(modifiedData!="" && modifiedData!=undefined) + { + if(modifiedData.shapeStates.length>0||modifiedData.paintCanvasState.length>0) + { + annotationData=modifiedData; + } + } //first draw shape and then store in object - $rootScope.LoadCBSavedAnnotation("canvasCI_"+windowviewid,"canvasPaintCI_"+windowviewid,annotationData); + $rootScope.LoadCBSavedAnnotation(canvasDraw,canvasPaint,annotationData); + } } } - $scope.EnableUI(); + $scope.EnableCIUI(windowviewid); $rootScope.CIWindowLoadComplete = true; }; @@ -1268,11 +1270,20 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout var isVisible; if (btnTextValue == "Text On") { isVisible = false; + $('#sid_' + windowviewid).css("display","none"); + // var canvasWidth =$('#ciImagePanel_' + windowviewid + ' .jsPanel-content').width()-107; + // $('#summary_' + windowviewid).css({"width": "87px","left":canvasWidth+"px"}); $scope.SetCIwindowStoreData(windowviewid, 'isTextVisible', isVisible); - } else { + } + else + { isVisible = true; + $('#sid_' + windowviewid).css("display","block"); + // $('#summary_' + windowviewid).css({"width": "100%","left":"0px"}); $scope.SetCIwindowStoreData(windowviewid, 'isTextVisible', isVisible); } + + $rootScope.SetPaintZindexforCISummary(windowviewid); } $scope.RemoveJSPanel = function (panelid) { diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/CurrBuildController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/CurrBuildController.js index 5fd8a8d..beb8ecd 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/CurrBuildController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/CurrBuildController.js @@ -16,6 +16,7 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ $rootScope.closeAfterSaveCurriculum = false; $rootScope.UnsaveCurriculum = $rootScope.isnewcurriculum == true? true:false; $scope.SectionContentForExportCB=[]; + $rootScope.firstSelectedNodeId = null; $scope.IsVisible = function () { $scope.scroll(); } @@ -29,18 +30,6 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ } angular.element(document).ready(function (e) { - - var $ua = navigator.userAgent; - if (($ua.match(/(iPod|iPhone|iPad|android)/i))) { - $("#treecontent").css('height',screen.height-130); - $("#cbdivarea").css('height',screen.height-60); - } - else - { - $("#treecontent").css('height',screen.height-270); - $("#cbdivarea").css('height',screen.height-200); - } - $('#sidebar-wrapper').unbind('click'); $("#sidebar-wrapper").on('click', function (event) { @@ -79,6 +68,18 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ }); + $rootScope.ResetCBHeight=function() + { + var innerheight =$(window).innerHeight(); + $("#treecontent").css('height',innerheight-125); + $("#cbdivarea").css('height',innerheight-57); + + } + $rootScope.ResetCBListHeight=function() + { + var innerheight =$(window).innerHeight(); + $("#cblist").css('height',innerheight-110); + } $scope.CBDisableUI = function () { $rootScope.isLoading = true; @@ -155,13 +156,14 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ } - $rootScope.firstSelectedNodeId = null; + //load json data $scope.loadCurriculumBuiderData = function () { if ($rootScope.refreshcheck == null) { $location.path('/'); - } + } + $rootScope.ResetCBListHeight(); //get current path var currentURL = $location.path(); var selectedModuleName = ''; @@ -700,7 +702,7 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ $scope.openCBJsPanel = function () { $scope.CBDisableUI(); $rootScope.isnewcurriculum = false; - + $rootScope.ResetCBHeight(); $('#jstree').empty(); var $e1 = $('
  • ' + '{{cbTreeFirstLabel}}' @@ -720,7 +722,7 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ $scope.openCBEditorPanel = function () { var jsContentURL = 'app/views/CBuild/curriculum-builder-TinyMCEjspanel.html'; - $.jsPanel({ + $scope.jsPanelCB = $.jsPanel({ id: 'CBTinyMCEPanel', selector: '.CBBodyView', theme: 'success', @@ -738,20 +740,34 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ draggable: "disabled", controls: { buttons: 'closeonly' }, size: { width: 820, height: 450 }, + onnormalized:function (panel) { + var canvasDIvHeight = $("#CBTinyMCEPanel .jsPanel-content").height(); + $("#cbEditorRightSideBar").css('height',canvasDIvHeight-35); + $(".tox-tinymce").css('height',canvasDIvHeight-52); + }, + resizable: { + minWidth: 610, + minHeight: 400, + start:function(event, ui) + { + $("#CBTextArea_ifr").css("display", "block"); + }, + stop: function (event, ui) { + var canvasDIvHeight = $("#CBTinyMCEPanel .jsPanel-content").height(); + $("#cbEditorRightSideBar").css('height',canvasDIvHeight-35); + $(".tox-tinymce").css('height',canvasDIvHeight-52); + + } + }, }); + $timeout(function () { - $rootScope.resetMenuOptionOnClick("CBTinyMCEPanel"); - $("#CBTinyMCEPanel").resize(function(){ - $("#CBTextArea_ifr").css("display", "block"); - }); - - // $('#CBTinyMCEPanel').draggable({ containment: '#cbdivarea', scroll: false }); - + $scope.jsPanelCB.normalize(); + $rootScope.resetMenuOptionOnClick("CBTinyMCEPanel"); }, 200); - } $scope.myeditorclick = function () { @@ -783,7 +799,7 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ } - $scope.openTinyMCE = function (nodeid) { + $scope.openTinyMCE = function (nodeid) { if ($scope.Currentselectednodeid == undefined || $scope.Currentselectednodeid != nodeid) { $scope.CBDisableUI(); console.log("instance create for id : " + nodeid); @@ -2992,6 +3008,7 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ }, textVisible: $rootScope.CIWindowData[i].isTextVisible, imageId: $rootScope.CIWindowData[i].imageId, + imgLeft:$rootScope.CIWindowData[i].imgLeft, minimised: $rootScope.CIWindowData[i].minimised, windowTitle: $rootScope.CIWindowData[i].currentViewTitle, maximised: $rootScope.CIWindowData[i].maximised, @@ -3096,6 +3113,7 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ width: $rootScope.PICWindowData[i].width }, imageId: $rootScope.PICWindowData[i].imageId, + imgLeft:$rootScope.PICWindowData[i].imgLeft, minimised: $rootScope.PICWindowData[i].minimised, windowTitle: $rootScope.PICWindowData[i].currentViewTitle, maximised: $rootScope.PICWindowData[i].maximised, @@ -3188,6 +3206,7 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ height: $rootScope.AAWindowData[i].height }, id: $rootScope.AAWindowData[i].id, + imgLeft:$rootScope.AAWindowData[i].imgLeft, showSelectedPins: $rootScope.AAWindowData[i].isShowSelectedPins, hideCallOuts: false,//N showAllPins: $rootScope.AAWindowData[i].isShowAllPins, @@ -3243,7 +3262,6 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ height: $rootScope.DaWindowData[i].height }, id: $rootScope.DaWindowData[i].voId, - imageId: $rootScope.DaWindowData[i].imageId, position: { y: $rootScope.DaWindowData[i].y, diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js index d16df54..205b537 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js @@ -150,7 +150,9 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l 'totalstructure': 0, 'totalstructureLm': 0, 'intervalObject': null, - 'isannotationReload': false + 'isannotationReload': false, + 'isCanvasReset': false, + 'keyctrl': false, }; return windata; @@ -408,20 +410,18 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l }; - $scope.DisableUI = function () { + $scope.DisableDAUI = function (windowviewid) { //enable daBodyViewDiv which was disabled on thumbnail click so need not bother where to enable //as jspanel disable/enable is working for all features document.getElementById('daBodyview').style.pointerEvents = "auto"; document.getElementById('daBodyview').style.opacity = "1"; - - - var daImagePanelConetent = document.getElementsByClassName("jsPanel-content"); - for (var i = 0; i < daImagePanelConetent.length; i++) { - daImagePanelConetent[i].style.pointerEvents = "none"; - daImagePanelConetent[i].style.opacity = "0.7"; - + var modulePanel = $("#daImagePanel_"+windowviewid).find(" .jsPanel-content"); + if(modulePanel.length>0) + { + modulePanel[0].style.pointerEvents="none"; + modulePanel[0].style.opacity="0.7"; } $rootScope.isLoading = true; $('#spinner').css('visibility', 'visible'); @@ -431,25 +431,26 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $('#HomeContainerDiv').css('opacity', '0.7'); } - $scope.EnableUI = function () { + $scope.EnableDAUI = function (windowviewid) { document.getElementById('index').style.pointerEvents = "auto"; document.getElementById('index').style.opacity = "1"; - var daImagePanelConetent = document.getElementsByClassName("jsPanel-content"); - for (var i = 0; i < daImagePanelConetent.length; i++) { - var dapanal=daImagePanelConetent[i].parentElement; - var panelpointevent = $("#"+ dapanal.id).css('pointer-events'); + var modulePanel = $("#daImagePanel_"+windowviewid).find(" .jsPanel-content"); + if(modulePanel.length>0) + { + var panelpointevent = $("#daImagePanel_"+windowviewid).css('pointer-events'); if(panelpointevent=="none") { //using for slide lock in cb - daImagePanelConetent[i].style.pointerEvents = "none"; + modulePanel[0].style.pointerEvents="none"; } else { - daImagePanelConetent[i].style.pointerEvents = "auto"; + modulePanel[0].style.pointerEvents="auto"; } - daImagePanelConetent[i].style.opacity = "1"; + + modulePanel[0].style.opacity="1"; } $rootScope.isLoading = false; @@ -530,7 +531,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l } else { - $scope.EnableUI(); + $scope.EnableDAUI($rootScope.MULTI_VIEW_ID); $rootScope.disableAnnotationTB = false; $rootScope.MenuModuleName = "DA"; $scope.SetwindowStoreData($rootScope.MULTI_VIEW_ID,'currentViewTitle',$event.currentTarget.textContent); @@ -658,7 +659,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l } ) - $scope.EnableUI(); + $scope.EnableDAUI(windowviewid); //push the details of open module in array $rootScope.openModules $rootScope.openModules.push({ "ModuleId": 1 }); } @@ -670,7 +671,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $scope.DAModuleData = ModuleService.getModuleData("DISSECTIBLE_ANATOMY"); if($scope.DAModuleData.length<1) return; $scope.ScopeVariablesDeclare(); - $scope.DisableUI(); + $scope.DisableDAUI(); $scope.readyToLoad=true; $rootScope.DAWindowLoadComplete = false; $scope.wincount=1; @@ -714,7 +715,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l } else { $scope.ScopeVariablesDeclare(); - $scope.DisableUI(); + $scope.DisableDAUI(); $scope.openBodyView(null); } @@ -992,17 +993,14 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l var pnlName=panel[0].id; var len = (pnlName).split("_").length; var windowviewid = (pnlName).split("_")[len - 1]; - var isAutoCalled = $scope.GetwindowStoreData(windowviewid, 'minmaxAutoEvent'); - if(!isAutoCalled) - { - $rootScope.UnsaveCurriculum = true; - } + $scope.SetwindowStoreData(windowviewid, 'maximised',true); $scope.SetwindowStoreData(windowviewid, 'minimised',false); - var canvasDIvHeight = $('#daImagePanel_' + windowviewid+ " .jsPanel-content").height()-50; - - $('#canvasDivDA_' + windowviewid).css('height', canvasDIvHeight); - $rootScope.resetMenuOptionOnClick(pnlName); + var extraheight=$('#dastickeyarea').height()+5; + var extrawidth=$('.tools').width()+15; + var canvasDIvHeight = $('#daImagePanel_' + windowviewid+ " .jsPanel-content").height()-extraheight; + var canvasDIvWidth = $('#daImagePanel_' + windowviewid+ " .jsPanel-content").width()-extrawidth; + $('#da-input_'+windowviewid).removeClass(); var dawidth=$(window).outerWidth() - 20; if(dawidth<800) @@ -1010,44 +1008,80 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l else{ $('#da-input_'+windowviewid).addClass('input-group col-sm-6 col-xs-7 col-md-7 pull-left'); } + + var canvasDiv='canvasDivDA_' + windowviewid; + var canvasDraw='canvasDA_' + windowviewid; + var canvasPaint='canvasPaintDA_' + windowviewid; + + var isAutoCalled = $scope.GetwindowStoreData(windowviewid, 'minmaxAutoEvent'); + if(!isAutoCalled) + { + $rootScope.UnsaveCurriculum = true; + var bodyVid=$rootScope.GetDAwindowData(windowviewid,'voId'); + var annotationData=$rootScope.GetDAwindowData(windowviewid,'annotationData'); + $rootScope.setAADAPanelCordinate(windowviewid,bodyVid,pnlName,canvasDiv,canvasDraw,canvasPaint,canvasDIvHeight,canvasDIvWidth,annotationData); + } + }, onnormalized:function (panel) { var pnlName=panel[0].id; var len = (pnlName).split("_").length; var windowviewid = (pnlName).split("_")[len - 1]; + + $scope.SetwindowStoreData(windowviewid, 'minimised',false); + $scope.SetwindowStoreData(windowviewid, 'maximised',false); + var extraheight=$('#dastickeyarea').height()+5; + var extrawidth=$('.tools').width()+15; + var canvasDIvHeight = $('#daImagePanel_' + windowviewid+ " .jsPanel-content").height()-extraheight; + var canvasDIvWidth = $('#daImagePanel_' + windowviewid+ " .jsPanel-content").width()-extrawidth; + + var canvasDiv='canvasDivDA_' + windowviewid; + var canvasDraw='canvasDA_' + windowviewid; + var canvasPaint='canvasPaintDA_' + windowviewid; + var isAutoCalled = $scope.GetwindowStoreData(windowviewid, 'minmaxAutoEvent'); if(!isAutoCalled) { - $rootScope.UnsaveCurriculum = true; + $rootScope.UnsaveCurriculum = true; + var bodyVid=$rootScope.GetDAwindowData(windowviewid,'voId'); + var annotationData=$rootScope.GetDAwindowData(windowviewid,'annotationData'); + $rootScope.setAADAPanelCordinate(windowviewid,bodyVid,pnlName,canvasDiv,canvasDraw,canvasPaint,canvasDIvHeight,canvasDIvWidth,annotationData); } - $scope.SetwindowStoreData(windowviewid, 'minimised',false); - $scope.SetwindowStoreData(windowviewid, 'maximised',false); - var canvasDIvHeight = $('#daImagePanel_' + windowviewid+ " .jsPanel-content").height()-50; - - $('#canvasDivDA_' + windowviewid).css('height', canvasDIvHeight); - $rootScope.resetMenuOptionOnClick(pnlName); }, resizable: { + minWidth: 600, + minHeight: 500, stop: function (event, ui) { var pnlName=event.currentTarget.id; var len = (pnlName).split("_").length; var windowviewid = (pnlName).split("_")[len - 1]; + var extraheight=$('#dastickeyarea').height()+5; + var extrawidth=$('.tools').width()+15; + var canvasDIvHeight = $('#daImagePanel_' + windowviewid+ " .jsPanel-content").height(); + var canvasDIvWidth = $('#daImagePanel_' + windowviewid+ " .jsPanel-content").width()-extrawidth; + $scope.SetwindowStoreData(windowviewid, 'width', ui.size.width); - $scope.SetwindowStoreData(windowviewid, 'height', ui.size.height); + $scope.SetwindowStoreData(windowviewid, 'height', canvasDIvHeight); $scope.SetwindowStoreData(windowviewid, 'y', ui.position.top); $scope.SetwindowStoreData(windowviewid, 'x', ui.position.left); $rootScope.UnsaveCurriculum = true; - var canvasDIvHeight = $('#daImagePanel_' + windowviewid+ " .jsPanel-content").height()-50; - - $('#canvasDivDA_' + windowviewid).css('height', canvasDIvHeight); + $('#da-input_'+windowviewid).removeClass(); if(ui.size.width<700) $('#da-input_'+windowviewid).addClass('input-group col-sm-6 col-xs-7 col-md-5 pull-left'); else{ $('#da-input_'+windowviewid).addClass('input-group col-sm-6 col-xs-7 col-md-7 pull-left'); } - $rootScope.resetMenuOptionOnClick(pnlName); + + var canvasDiv='canvasDivDA_' + windowviewid; + var canvasDraw='canvasDA_' + windowviewid; + var canvasPaint='canvasPaintDA_' + windowviewid; + + var bodyVid=$rootScope.GetDAwindowData(windowviewid,'voId'); + var annotationData=$rootScope.GetDAwindowData(windowviewid,'annotationData'); + $rootScope.setAADAPanelCordinate(windowviewid,bodyVid,pnlName,canvasDiv,canvasDraw,canvasPaint,canvasDIvHeight-extraheight,canvasDIvWidth,annotationData); + } }, @@ -1150,7 +1184,9 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l var bodySystemListObj = document.getElementById("structureDropdownDA_" + windowviewid); var len = bodySystemListObj!=null?(bodySystemListObj.id).split("_").length:0; if (len>1) { - $scope.stopIntervalLoader(timeintval); + $scope.stopIntervalLoader(timeintval); + // set search for language input + $scope.langSearchLoad(windowviewid); //wait until DOM element load of DA $scope.daViewLoader(windowviewid); } @@ -1203,7 +1239,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l } // we are loading most of alll data used in DA by this function so that at the time of any functionality delay in data laod will not happened. $scope.loadView = function (windowviewid) { - $scope.DisableUI(); + $scope.DisableDAUI(windowviewid); var bodyViewId=$scope.GetwindowStoreData(windowviewid,'voId'); if (document.getElementById('daViewDA_'+windowviewid) != null) { $scope.loadDAView(bodyViewId, windowviewid); @@ -1222,12 +1258,6 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $scope.loadDAView = function (currentBodyViewId, windowviewid) { - //0.4 added some stylesheets - if (!$rootScope.isCallFromOtherModule) { - $('#daBodyview').css("height", (parseInt($(window).outerHeight()) - 82)); - $('#daBodyview').css("width", $(window).outerWidth()); - } - $scope.SetwindowStoreData(windowviewid,'voId',currentBodyViewId); //1. load navigator man first console.log('before LoadBodyViewNavigatorImage call') @@ -1349,8 +1379,6 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l } }); - // set search for language input - $scope.langSearchLoad(windowviewid); } @@ -1360,18 +1388,18 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $('#searchlangaugeDiv_'+windowviewid).css("display","none"); var languageArray = $rootScope.lexiconLanguageArray; - $("#btnDATermSearch_"+windowviewid).parent().css("margin-right", "10px"); + // $("#btnDATermSearch_"+windowviewid).parent().css("margin-right", "10px"); if(languageArray.length>1) { - $("#btnDATermSearch_"+windowviewid).parent().css("margin-right", "-10px"); + // $("#btnDATermSearch_"+windowviewid).parent().css("margin-right", "-10px"); $('#searchlangaugeDiv_'+windowviewid).css("display","block"); var option=''; for (var i = 0; i <= languageArray.length - 1; i++) { option=option+''; } var $all = $('#searchlangaugeDiv_'+windowviewid).append( - '
    '+ + '
    '+ ''+ @@ -1453,13 +1481,13 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l var la; var rootScope = angular.element(document.getElementById("bo")).scope(); rootScope.$apply(function () { - $scope.DisableUI(); + $scope.DisableDAUI(windviewid); }) var scope = angular.element(document.getElementsByClassName("daBodyView")).scope(); scope.$apply(function () { if ($scope.GetwindowStoreData(windviewid,'isTransparencyActivated')) { - $scope.EnableUI(); + $scope.EnableDAUI(windviewid); } la =$scope.GetwindowStoreData(windviewid,'totalLayers'); var slideVal = la - ui.value; @@ -1591,6 +1619,8 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $("#btnStrutureBox").attr("id", "btnStrutureBox_" + windowviewid); $scope.btnStrutureBoxID = "btnStrutureBox_" + windowviewid; + $("#multiannotation").attr("id", "multiannotation_" + windowviewid); + $("#typedTermName").attr("id", "typedTermName_" + windowviewid); $scope.typedTermNameID = "typedTermName_" + windowviewid; @@ -1770,7 +1800,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l } } - $scope.EnableUI(); + $scope.EnableDAUI(e.data.winId); } @@ -1960,7 +1990,8 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $scope.SetwindowStoreData(windowviewid,'viewOrientationId',$scope.GetwindowStoreData(windowviewid,'voId')); $scope.setViewOrientationId(windowviewid); - + $scope.SetwindowStoreData(windowviewid, 'isCanvasReset',true); + //Birendra Load term data For curriculum builder //*********************************************************************// if ($rootScope.isCallFromOtherModule) { @@ -1983,7 +2014,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l // Function to call CB term data $scope.loadDAonCBSlideChange = function (windowviewid) { - $scope.DisableUI(); + $scope.DisableDAUI(windowviewid); $scope.SetwindowStoreData(windowviewid,'isHighlightBodyByBodySystem',false); $scope.SetwindowStoreData(windowviewid,'isbodySystemHighlight',false); @@ -2144,7 +2175,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l //DA > Annotation's Line should not displayed. $('#bord_'+windowviewid).css("display", "none"); - $scope.DisableUI(); + $scope.DisableDAUI(windowviewid); //redraw body of respective layer var viewOrientationId = $scope.GetwindowStoreData(windowviewid, 'viewOrientationId'); @@ -2187,7 +2218,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l //calculate coordinates for body region images $scope.CalculateImageCordinates = function (viewOrientationId,windowviewid) { - $scope.DisableUI(); + $scope.DisableDAUI(windowviewid); // $scope.layerInfoForModesty = []; $scope.SetwindowStoreData(windowviewid,'layerInfoForModesty',[]); @@ -2209,13 +2240,24 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l //set height of canvas div and left tool bar as per window size $scope.BodyRegionCordinatesData = []; // create an empty array $scope.SetwindowStoreData(windowviewid,'BodyRegionCordinatesData',[]); - $('#daBodyview').css('width', '100%'); - - var canvasDIvHeight = $('#daImagePanel_' + windowviewid+ " .jsPanel-content").height()-50; - + + var extraheight=$('#dastickeyarea').height()+5; + var extrawidth=$('.tools').width()+15; + var canvasDIvHeight = $('#daImagePanel_' + windowviewid+ " .jsPanel-content").height()-extraheight; + var canvasDIvWidth = $('#daImagePanel_' + windowviewid+ " .jsPanel-content").width()-extrawidth; $('#canvasDivDA_' + windowviewid).css('height', canvasDIvHeight); - $('#leftToolBarDA_' + windowviewid).css('height', $('#daImagePanel_' + windowviewid).outerHeight()) + $('#leftToolBarDA_' + windowviewid).css('height', $('#daImagePanel_' + windowviewid).outerHeight()); + + if ($("#canvasDivDA_" + windowviewid).find("canvas[id*='canvasPaintDA']").length == 0) { + var canvasPaintID = "canvasPaintDA_" + windowviewid; + var canvasID = "canvasDA_" + windowviewid; + + //register touch end and touchmove event for touch devices + var ATBarHtml = $("#canvasDivDA_" + windowviewid).append(''); + $compile(ATBarHtml)($scope); + } + //calculate image coordinates and draw image var BodyRegionData=$scope.GetwindowStoreData(windowviewid,'BodyRegionData'); var bodyRegionCoordinates = new jinqJs() @@ -2223,7 +2265,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l .where('_ViewOrientationId == ' + viewOrientationId) .select(); - console.log('viewOrientationId= ' + viewOrientationId + ', $scope.bodyRegionCoordinates length= ' + bodyRegionCoordinates.length) + //console.log('viewOrientationId= ' + viewOrientationId + ', $scope.bodyRegionCoordinates length= ' + bodyRegionCoordinates.length) var bgartData=$scope.GetwindowStoreData(windowviewid,'bgartData'); var bagartDetail = new jinqJs() @@ -2249,55 +2291,10 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l } - $scope.ColoredImageSRC = []; - $scope.SetwindowStoreData(windowviewid,'ColoredImageSRC',[]); - + $scope.ColoredImageSRC = []; + $scope.SetwindowStoreData(windowviewid,'ColoredImageSRC',[]); $scope.SetwindowStoreData(windowviewid,'updatedGrayDataList',[]); $scope.SetwindowStoreData(windowviewid,'updatedGrayMRDataList',[]); - - //history code - - if ($("#canvasDivDA_" + windowviewid).find("canvas[id*='canvasPaintDA']").length == 0) { - var canvasPaintID = "canvasPaintDA_" + windowviewid; - var canvasID = "canvasDA_" + windowviewid; - - //register touch end and touchmove event for touch devices - var ATBarHtml = $("#canvasDivDA_" + windowviewid).append(''); - $compile(ATBarHtml)($scope); - - } - var isCBAnnotationActive= $scope.GetwindowStoreData(windowviewid, 'isCBAnnotationActive'); - - // isCBAnnotationActive activate one time when annotation come from Saved CB - if ($rootScope.isCallFromOtherModule && isCBAnnotationActive) { - var annotationData= $scope.GetwindowStoreData(windowviewid, 'annotationData'); - //clean object .it will assign again from home controller - $scope.SetwindowStoreData(windowviewid, 'annotationData', {shapeStates:[],paintCanvasState:[]}); - // load annotation - if(annotationData!="" && annotationData!=undefined) - { - if(annotationData.shapeStates.length>0||annotationData.paintCanvasState.length>0) - { - //first draw shape and then store in object - //delay 3 second if annotation draw with TBox - if ($scope.GetwindowStoreData(windowviewid, 'isTransparent') == true) { - setTimeout(function(){ - $rootScope.LoadCBSavedAnnotation("canvasDA_"+windowviewid,"canvasPaintDA_"+windowviewid,annotationData); - },3000) - } - else - { - setTimeout(function(){ - $rootScope.LoadCBSavedAnnotation("canvasDA_"+windowviewid,"canvasPaintDA_"+windowviewid,annotationData); - },1000) - - } - - - } - } - $scope.SetwindowStoreData(windowviewid, 'isCBAnnotationActive',false); - } $('#zoomValueDA_' + windowviewid).attr('value', $scope.GetwindowStoreData(windowviewid,'zoomInOut')); @@ -2505,7 +2502,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $('#canvasDivDA_' + windowviewid).scrollTop(50); - $scope.EnableUI(); + $scope.EnableDAUI(windowviewid); //Dated:16-07-2016 Issue #4957 :While selecting the Zoom-in\Zoom-out button scroll should be go on top. // #4976 :While changing gender male to female scroll bar is going on top. var canvasDiv = document.getElementById('canvasDivDA_' + windowviewid); @@ -2538,39 +2535,64 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $('#draggable_' + windowviewid).css('width', dragdivw); $('#draggable_' + windowviewid).css('height', dragdivh); $('#draggable_' + windowviewid).css("left", dragdivleft); - $('#draggable_' + windowviewid).css("top", dragdivtop); - - var canvas = document.getElementById("canvasDA_" + windowviewid); - var canvasPaint = document.getElementById("canvasPaintDA_" + windowviewid); - if(viewOrientationId!=1 && viewOrientationId!=4) - { - if(viewOrientationId==5) - { - //lateral arm - canvas.height = 1500; - canvasPaint.height =1500; - - } - else if(viewOrientationId==6) - { - //medial arm - canvas.height = 1400; - canvasPaint.height = 1400; - - } - var $ua = navigator.userAgent; - if (($ua.match(/(iPod|iPhone|iPad|android)/i))) { - canvas.width = screen.width-145; - canvasPaint.width = screen.width-145; + $scope.SetwindowStoreData(windowviewid,'ColoredImageSRC',[]); + + var timeintval = null; + timeintval = $interval(function () { + var imageSrc = $scope.GetwindowStoreData(windowviewid, 'ColoredImageSRC'); + if (imageSrc.length>0) { + $scope.stopIntervalDA(); + var pnlName='daImagePanel_' + windowviewid; + var canvasDiv='canvasDivDA_' + windowviewid; + var canvasDraw='canvasDA_' + windowviewid; + var canvasPaint='canvasPaintDA_' + windowviewid; + var bodyVid=$rootScope.GetDAwindowData(windowviewid,'voId'); + var demoData= {shapeStates:[],paintCanvasState:[]}; + var isCanvasReset = $scope.GetwindowStoreData(windowviewid, 'isCanvasReset'); + + if(isCanvasReset) + { + //call also while paint and draw canvas removed + //reset width height of canvas + $rootScope.setAADAPanelCordinate(windowviewid,bodyVid,pnlName,canvasDiv,canvasDraw,canvasPaint,canvasDIvHeight,canvasDIvWidth,demoData); + $scope.SetwindowStoreData(windowviewid, 'isCanvasReset',false); + } + + var isCBAnnotationActive= $scope.GetwindowStoreData(windowviewid, 'isCBAnnotationActive'); + + // isCBAnnotationActive activate one time when annotation come from Saved CB + if ($rootScope.isCallFromOtherModule && isCBAnnotationActive) { + var annotationData= $scope.GetwindowStoreData(windowviewid, 'annotationData'); + //clean object .it will assign again from home controller + $scope.SetwindowStoreData(windowviewid, 'annotationData', {shapeStates:[],paintCanvasState:[]}); + // load annotation + if(annotationData!="" && annotationData!=undefined) + { + if(annotationData.shapeStates.length>0||annotationData.paintCanvasState.length>0) + { + //first draw shape and then store in object + setTimeout(function(){ + $rootScope.LoadCBSavedAnnotation(canvasDraw,canvasPaint,annotationData); + },100) + } + } + $scope.SetwindowStoreData(windowviewid, 'isCBAnnotationActive',false); + } + } else { - canvas.width = screen.width-165; - canvasPaint.width = screen.width-165; + console.log("loading images on canvas...."); } + }, 100); - } + $scope.stopIntervalDA = function () { + if (angular.isDefined(timeintval)) { + $interval.cancel(timeintval); + timeintval = undefined; + } + }; } @@ -2781,7 +2803,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l var touchdragging = false; $scope.DrawMirroredImage = function (h, w, x, y, src, bodyRegionId, isMaskImage, windowviewid) { - $scope.DisableUI(); + $scope.DisableDAUI(windowviewid); var FlipedImgCanvas = document.createElement('canvas'); FlipedImgCanvas.height = h; @@ -2965,7 +2987,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l } - $scope.DisableUI(); + $scope.DisableDAUI(windowviewid); var isHighLight=$scope.GetwindowStoreData(windowviewid,'isHighLight'); var isGenderChnage = $scope.GetwindowStoreData(windowviewid,'isGenderChnage'); @@ -2980,14 +3002,14 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l } else if ($scope.GetwindowStoreData(windowviewid, 'isExtract') == true) { - $scope.DisableUI(); + $scope.DisableDAUI(windowviewid); $scope.highLightBody(windowviewid); } else if (isHighLight == true || (isListManagerSelected == true) || ((isGenderChnage == true) && (isHighLight == true)) || ((isViewChange == true) && (isHighLight == true)) || isHighlightBodyByBodySystem == true) { $scope.SetwindowStoreData(windowviewid, 'isHighLight', true); - $scope.DisableUI(); + $scope.DisableDAUI(windowviewid); $scope.highLightBody(windowviewid); if ($scope.GetwindowStoreData(windowviewid, 'isTransparent') == true && isLexiconReload==false) { $scope.CalculateDimensionsAndDrawTBox(windowviewid); @@ -3003,7 +3025,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l } //This block is executed when normal body is created and no further process like highlight,extract, etc - $scope.EnableUI(); + $scope.EnableDAUI(windowviewid); } } @@ -3049,8 +3071,9 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $('#typedTermName_' + windowviewid).val(''); $("#typedTermName_" + windowviewid).attr("name", '0'); //birendra + var iskeyctrlActive= $scope.GetwindowStoreData(windowviewid, 'keyctrl');//for iPad // for mac os Command key use for multi selection - if (evt.ctrlKey || evt.metaKey) { + if (evt.ctrlKey || evt.metaKey || iskeyctrlActive) { $scope.SetwindowStoreData(windowviewid,'multiAnnotationIsON',true); } else @@ -3251,7 +3274,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l } $scope.DrawImage = function (h, w, x, y, src, bodyRegionId, isMaskImage, windowviewid) { - $scope.DisableUI(); + $scope.DisableDAUI(windowviewid); var imgCanvas = document.createElement('canvas'); @@ -3463,7 +3486,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l } - $scope.DisableUI(); + $scope.DisableDAUI(windowviewid); var isHighLight=$scope.GetwindowStoreData(windowviewid,'isHighLight'); var isGenderChnage = $scope.GetwindowStoreData(windowviewid,'isGenderChnage'); @@ -3478,7 +3501,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l } else if (isExtract == true) { - $scope.DisableUI(); + $scope.DisableDAUI(windowviewid); $scope.highLightBody(windowviewid); } @@ -3487,7 +3510,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $scope.SetwindowStoreData(windowviewid,'isHighLight',true); - $scope.DisableUI(); + $scope.DisableDAUI(windowviewid); $scope.highLightBody(windowviewid); if ($scope.GetwindowStoreData(windowviewid, 'isTransparent') == true && isLexiconReload==false) { @@ -3504,7 +3527,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $scope.ShowCBDataBodyView(windowviewid); } //This block is executed when normal body is created and no further process like highlight,extract, etc - $scope.EnableUI(); + $scope.EnableDAUI(windowviewid); } } @@ -3548,8 +3571,9 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $('#typedTermName_' + windowviewid).val(''); $("#typedTermName_" + windowviewid).attr("name", '0'); //birendra + var iskeyctrlActive= $scope.GetwindowStoreData(windowviewid, 'keyctrl');//for iPad // for mac os Command key use for multi selection - if (evt.ctrlKey || evt.metaKey) { + if (evt.ctrlKey || evt.metaKey ||iskeyctrlActive) { $scope.SetwindowStoreData(windowviewid,'multiAnnotationIsON',true); console.log('CTRL ON') @@ -4096,7 +4120,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $scope.SetwindowStoreData(windowviewid, 'CanvasDivLeftPosition', $("#canvasDivDA_" + windowviewid).scrollLeft()); } - $scope.EnableUI(); + $scope.EnableDAUI(windowviewid); ReturnMasData=[]; ExtractMasData=[]; @@ -4264,7 +4288,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l }); } else { - $scope.EnableUI(); + $scope.EnableDAUI(windowviewid); } worker.onmessage = function (e) { @@ -4345,11 +4369,11 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $('#canvasDivDA_' + windowviewid).scrollLeft($scope.imageHorizontlScrollPosition); } - $scope.EnableUI(); + $scope.EnableDAUI(windowviewid); } else if (isHighlightBodyByBodySystem == true || isListManagerSelected == true) { - $scope.EnableUI(); + $scope.EnableDAUI(windowviewid); } else { @@ -4373,7 +4397,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l } } - $scope.EnableUI(); + $scope.EnableDAUI(windowviewid); // terminate extract and term-number worker instances if ($scope.runningWorkers != null || $scope.runningWorkers != undefined) { @@ -4404,7 +4428,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l termSelectedName = "Skin"; } if (document.getElementById('txtLayerNumberDA_'+windowviewid).value == "Skin" || termSelectedName == "Skin") { - $scope.EnableUI(); + $scope.EnableDAUI(windowviewid); } }, 100); @@ -4416,7 +4440,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $scope.isScrolledToHighlightedBR = false; //disable the background till the system gets highlighted. - $scope.DisableUI(); + $scope.DisableDAUI(windowviewid); $("#layerChangeSliderDA_" + windowviewid + '.vert_slider').slider('disable'); @@ -4452,7 +4476,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $scope.removeCurrentHighlightedBodySystem(windowviewid); $("#layerChangeSliderDA_" + windowviewid + '.vert_slider').slider('enable'); - $scope.EnableUI(); + $scope.EnableDAUI(windowviewid); $rootScope.message = AIAConstants.NO_BODY_SYSTEM_AVAILABLE; @@ -4658,13 +4682,13 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l } } else { - $scope.EnableUI(); + $scope.EnableDAUI(windowviewid); $("#layerChangeSliderDA_" + windowviewid + '.vert_slider').slider('enable'); } }); $("#layerChangeSliderDA_" + windowviewid + '.vert_slider').slider('enable'); - $scope.EnableUI(); + $scope.EnableDAUI(windowviewid); } } @@ -4672,7 +4696,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l function (error) { console.log(' Error in getting term data = ' + error); $("#layerChangeSliderDA_" + windowviewid + '.vert_slider').slider('enable'); - $scope.EnableUI(); + $scope.EnableDAUI(windowviewid); //remove existing data and draw fresh data $scope.removeCurrentHighlightedBodySystem(windowviewid); @@ -4730,7 +4754,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $timeout(function () { $scope.HighlightBodyByTermList(multiTermList,windowviewid); }, 50); } else { - $scope.EnableUI(); + $scope.EnableDAUI(windowviewid); } } @@ -4849,7 +4873,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l //layer change function $scope.LayerChange = function (windowviewid) { - $scope.DisableUI(); + $scope.DisableDAUI(windowviewid); $rootScope.CloseListManager(); $scope.isLayerChange = true; @@ -4987,7 +5011,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l } else { - $scope.EnableUI(); + $scope.EnableDAUI(windowviewid); } }) @@ -5006,21 +5030,26 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $scope.SetwindowStoreData(windowviewid,'currentLayerNumber',parseInt($('#txtLayerNumberDA_' + windowviewid).val())); } - $scope.DisableUI(); + $scope.DisableDAUI(windowviewid); var canDiv = document.getElementById('canvasDivDA_' + windowviewid); if($rootScope.globalSetting.onLayerChange) { + $('#canvasDA_' + windowviewid).removeLayers();//remove all old shape + //var sktch = $("#canvasPaintDA_" + windowviewid).sketch(); + $("#canvasPaintDA_" + windowviewid).sketch().actions = [];//remove old paint data + var canDivChildCount = canDiv.childElementCount; if (canDivChildCount > 0) { canDiv.innerHTML = ''; } - - //canvas is clear in search term,layer change,viewchange here. so annotationdata should also clear - $scope.SetwindowStoreData(windowviewid, 'annotationData', {shapeStates:[],paintCanvasState:[]}); - + $scope.SetwindowStoreData(windowviewid, 'isCanvasReset',true); + //canvas is clear in search term,layer change,viewchange here. so annotationdata should also clear + $scope.SetwindowStoreData(windowviewid, 'annotationData', {shapeStates:[],paintCanvasState:[]}); + } else { + $scope.SetwindowStoreData(windowviewid, 'isCanvasReset',false); //remove all canvas except pait and drawing $('#'+'canvasDivDA_' + windowviewid+' canvas').not('#canvasDA_'+windowviewid).not('#canvasPaintDA_'+windowviewid).remove(); } @@ -5118,7 +5147,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l } - $scope.EnableUI(); + $scope.EnableDAUI(windowviewid); } $('layerChangeSlider').slider().on('slideStop', function (ev) { @@ -5140,6 +5169,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $scope.createDynamicSpeechBubble = function (event, x, y, isAnnotationNotForTBox, tipx, tipy,windowviewid, termNumber) { var termNumber=parseInt(termNumber); + var iskeyctrlActive= $scope.GetwindowStoreData(windowviewid, 'keyctrl');//for iPad if (isAnnotationNotForTBox == true) { if ($scope.MultiLanguageAnnationArray.length > 1) { $scope.longestAnnotation = $scope.MultiLanguageAnnationArray.reduce(function (firstAnnotation, seconAnnotation) { return firstAnnotation.length > seconAnnotation.length ? firstAnnotation : seconAnnotation; }); @@ -5151,8 +5181,8 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l //1. In transparency box we shows two annotation at a time, so we need to decide the max length of annotation in btween two annotation because based on that // we decide the size of speech bubble //2. - - if (event.ctrlKey || event.metaKey || event == "CBAnnotation") { + + if (event.ctrlKey || event.metaKey || event == "CBAnnotation" || iskeyctrlActive) { console.log('ctrl pressed'); $scope.SetwindowStoreData(windowviewid,'multiAnnotationIsON',true); //2.1 create unique speech bubbles @@ -5429,7 +5459,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l else { $scope.longest_annotationT1 = $scope.annotationTextArrayT1.reduce(function (a, b) { return a.length > b.length ? a : b; }); $scope.longest_annotationT2 = $scope.annotationTextArrayT2.reduce(function (a, b) { return a.length > b.length ? a : b; }); - if (event.ctrlKey || event.metaKey || event == "CBAnnotation") { + if (event.ctrlKey || event.metaKey || event == "CBAnnotation" ||iskeyctrlActive) { $scope.SetwindowStoreData(windowviewid, 'multiAnnotationIsON', true); @@ -6385,7 +6415,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l } else { - $scope.DisableUI(); + $scope.DisableDAUI(windowviewid); $('#btnTranparency_' + windowviewid).removeClass('btn-black'); $('#btnTranparency_' + windowviewid).addClass('tButtonActive'); @@ -6453,23 +6483,15 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $('#btnIdentify_' + windowviewid).addClass('btn-primary'); // clear canvas before drawing transparency box - if ($rootScope.isAnnotationWindowOpen == true) { - // $('#canvasDA_' + windowviewid).removeLayers(); - var paintCanvasObj = document.getElementById("canvasPaintDA_" + windowviewid); - if (paintCanvasObj != null) { - var ctx = paintCanvasObj.getContext("2d"); - ctx.clearRect(0, 0, paintCanvasObj.width, paintCanvasObj.height); - } - var CanvasObj = document.getElementById("canvasDA_" + windowviewid); - if (CanvasObj != null) { - var ctx1 = CanvasObj.getContext("2d"); - ctx1.clearRect(0, 0,CanvasObj.width, CanvasObj.height); - } - $scope.SetwindowStoreData(windowviewid, 'isCBAnnotationActive',false); - $scope.SetwindowStoreData(windowviewid, 'annotationData', {shapeStates:[],paintCanvasState:[]}); + $('#canvasDA_' + windowviewid).removeLayers();//remove all old shape + //var sktch = $("#canvasPaintDA_" + windowviewid).sketch(); + $("#canvasPaintDA_" + windowviewid).sketch().actions = [];//remove old paint data - var sktch = $("#canvasPaintDA_" + windowviewid).sketch(); - $("#canvasPaintDA_" + windowviewid).sketch().actions = []; + $scope.SetwindowStoreData(windowviewid, 'isCBAnnotationActive',false); + $scope.SetwindowStoreData(windowviewid, 'annotationData', {shapeStates:[],paintCanvasState:[]}); + + if ($rootScope.isAnnotationWindowOpen == true) { + $("#annotationpaintbrushsize").removeClass("activebtncolor"); $("#annotationpainteraser").removeClass("activebtncolor"); if ($("#DrawMode").hasClass("annotationtoolbartab")) { @@ -6529,13 +6551,10 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l if (drawCanvasZindex > paintCanvasZindex) { $(".ui-wrapper").css("z-index", drawCanvasZindex); $scope.SetwindowStoreData(windowviewid, 'UIWrapperZIndex', drawCanvasZindex); - $('#canvasPaintDA_' + windowviewid).css("z-index", drawCanvasZindex+2); } else { $(".ui-wrapper").css("z-index", paintCanvasZindex); - $scope.SetwindowStoreData(windowviewid, 'UIWrapperZIndex', paintCanvasZindex); - $('#canvasPaintDA_' + windowviewid).css("z-index", paintCanvasZindex+2); - + $scope.SetwindowStoreData(windowviewid, 'UIWrapperZIndex', paintCanvasZindex); } } @@ -6728,7 +6747,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l else { //when user draw TB outside body than no bodyRegion //is covred and nothing is drawn so the function is not called in which we are enabling UI - $scope.EnableUI(); + $scope.EnableDAUI(windowviewid); } }) @@ -6821,6 +6840,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l } } + //curriculum on slide load $scope.CalculateDimensionsAndDrawTBox = function (windowviewid) { $scope.SetwindowStoreData(windowviewid, 'isTransparent', true); $scope.SetwindowStoreData(windowviewid, 'isTBDrawnOnBodyRegion', false); @@ -7004,7 +7024,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l else { //when user draw TB outside body than no bodyRegion //is covred and nothing is drawn so the function is not called in which we are enabling UI - $scope.EnableUI(); + $scope.EnableDAUI(windowviewid); } }) @@ -7065,17 +7085,6 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l // clear canvas before drawing transparency box if ($rootScope.isAnnotationWindowOpen == true) { - //$('#canvasDA_' + windowviewid).removeLayers(); - var paintCanvasObj = document.getElementById("canvasPaintDA_" + windowviewid); - if (paintCanvasObj != null) { - var ctx = paintCanvasObj.getContext("2d"); - ctx.clearRect(0, 0, paintCanvasObj.width, paintCanvasObj.height); - } - var CanvasObj = document.getElementById("canvasDA_" + windowviewid); - if (CanvasObj != null) { - var ctx1 = CanvasObj.getContext("2d"); - ctx1.clearRect(0, 0, CanvasObj.width, CanvasObj.height); - } $("#annotationpaintbrushsize").removeClass("activebtncolor"); $("#annotationpainteraser").removeClass("activebtncolor"); if ($("#DrawMode").hasClass("annotationtoolbartab")) { @@ -7119,7 +7128,6 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $scope.SetwindowStoreData(windowviewid, 'UIWrapperZIndex', paintCanvasZindex); $('#canvasPaintDA_' + windowviewid).css("z-index", paintCanvasZindex+2); } - //$rootScope.switchToTransparencycanvas("daImagePanel_"+windowviewid); } } else @@ -7830,7 +7838,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l } $scope.SetwindowStoreData(windowviewid, 'isTransparencyActivated', true); - $scope.EnableUI(); + $scope.EnableDAUI(windowviewid); $scope.SetwindowStoreData(windowviewid, 'isZoomed',false); } @@ -8150,8 +8158,8 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l var windowviewid = (evt.currentTarget.id).split("_")[len-1]; var pixelData; var pixelDataTrans; - - if (evt.ctrlKey || evt.metaKey) { + var iskeyctrlActive= $scope.GetwindowStoreData(windowviewid, 'keyctrl');//for iPad + if (evt.ctrlKey || evt.metaKey || iskeyctrlActive) { $scope.SetwindowStoreData(windowviewid, 'multiAnnotationIsON', true); } else @@ -8372,7 +8380,8 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $rootScope.UnsaveCurriculum = true; var len= (evt.target.id).split("_").length; var windowviewid = (evt.target.id).split("_")[len-1]; - if (evt.ctrlKey || evt.metaKey) { + var iskeyctrlActive= $scope.GetwindowStoreData(windowviewid, 'keyctrl');//for iPad + if (evt.ctrlKey || evt.metaKey ||iskeyctrlActive) { $scope.SetwindowStoreData(windowviewid, 'multiAnnotationIsON', true); } else @@ -9044,25 +9053,12 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $scope.removeAllTermTpClose(windowviewid); // clear canvas on closing of transparency box - if ($rootScope.isAnnotationWindowOpen == true) { - $('#canvasDA_'+windowviewid).removeLayers(); - var paintCanvasObj = document.getElementById('canvasPaintDA_'+windowviewid); - if (paintCanvasObj != null) { - var ctx = paintCanvasObj.getContext("2d"); - ctx.clearRect(0, 0, paintCanvasObj.width, paintCanvasObj.height); - - var CanvasObj = document.getElementById("canvasDA_" + windowviewid); - if (CanvasObj != null) { - var ctx1 = CanvasObj.getContext("2d"); - ctx1.clearRect(0, 0, CanvasObj.width, CanvasObj.height); - } - $scope.SetwindowStoreData(windowviewid, 'isCBAnnotationActive',false); - $scope.SetwindowStoreData(windowviewid, 'annotationData', {shapeStates:[],paintCanvasState:[]}); - - var sktch = $('#canvasPaintDA_'+windowviewid).sketch(); - $('#canvasPaintDA_'+windowviewid).sketch().actions = []; - } - } + + $('#canvasDA_' + windowviewid).removeLayers();//remove all old shape + // var sktch = $("#canvasPaintDA_" + windowviewid).sketch(); + $("#canvasPaintDA_" + windowviewid).sketch().actions = [];//remove old paint data + $scope.SetwindowStoreData(windowviewid, 'isCBAnnotationActive',false); + $scope.SetwindowStoreData(windowviewid, 'annotationData', {shapeStates:[],paintCanvasState:[]}); var tBox = document.getElementById('transparencyCanvas_' + windowviewid); if (tBox != null) { @@ -9143,6 +9139,10 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l } + $scope.removeannotationShape = function (ClickByButton,windowviewid){ + + } + function positionTooltip(event, x, y) { x = 100, y = 200, @@ -9213,10 +9213,10 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l } $scope.enableZoom = function (event) { - $scope.DisableUI(); $rootScope.UnsaveCurriculum = true; var len = (event.currentTarget.id).split("_").length; - var windowviewid = (event.currentTarget.id).split("_")[len-1]; + var windowviewid = (event.currentTarget.id).split("_")[len-1]; + $scope.DisableDAUI(windowviewid); $("#OnIdentify").removeClass("annotationtoolbartab"); $("#DrawMode").removeClass("annotationtoolbartab"); $('.btnCursor').removeClass('activebtncolor'); @@ -9265,14 +9265,21 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $scope.SetwindowStoreData(windowviewid,'zoomInOut',25); $('#zoomValueDA_' + windowviewid).attr('value', $scope.GetwindowStoreData(windowviewid,'zoomInOut')); } + $('#canvasDA_' + windowviewid).removeLayers();//remove all old shape + //var sktch = $("#canvasPaintDA_" + windowviewid).sketch(); + $("#canvasPaintDA_" + windowviewid).sketch().actions = [];//remove old paint data var canDiv = document.getElementById('canvasDivDA_' + windowviewid); var canDivChildCount = canDiv.childElementCount; if (canDivChildCount > 0) { canDiv.innerHTML = ''; } + + $scope.SetwindowStoreData(windowviewid, 'isCanvasReset',true); + $scope.SetwindowStoreData(windowviewid, 'isCBAnnotationActive',false); + $scope.SetwindowStoreData(windowviewid, 'annotationData', {shapeStates:[],paintCanvasState:[]}); var viewOrientationId = $scope.GetwindowStoreData(windowviewid, 'viewOrientationId'); - $scope.CalculateImageCordinates(viewOrientationId,windowviewid); + $scope.CalculateImageCordinates(viewOrientationId,windowviewid); if ($scope.GetwindowStoreData(windowviewid,'zoomInOut') == 25) { @@ -9288,7 +9295,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l } $scope.flushCanvas = function (windowviewid) { - $scope.DisableUI(); + $scope.DisableDAUI(windowviewid); var viewOrientationId=$scope.GetwindowStoreData(windowviewid,'viewOrientationId'); var endIndex = 0; var startIndex = 0; @@ -9365,7 +9372,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $scope.SetwindowStoreData(windowviewid, 'mode', "HIGHLIGHT"); $scope.SetwindowStoreData(windowviewid, 'isHighlightlBtnClicked', true); - $scope.DisableUI(); + $scope.DisableDAUI(windowviewid); $('#btnTranparency_' + windowviewid).removeAttr('disabled', 'disabled'); @@ -9429,7 +9436,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $('#canvasDivDA_' + windowviewid).scrollTop(CanvasDivTopPosition); $('#canvasDivDA_' + windowviewid).scrollLeft(CanvasDivLeftPosition); - $scope.EnableUI(); + $scope.EnableDAUI(windowviewid); } $scope.enableNormalMode = function (windowviewid) { @@ -9523,9 +9530,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $scope.enableExtract = function (isCalledFromButton,windowviewid) { $scope.SetwindowStoreData(windowviewid, 'mode', "EXTRACT"); - $scope.DisableUI(); - - console.log('isCalledFromButton= ' + isCalledFromButton); + $scope.DisableDAUI(windowviewid); var CanvasDivLeftPosition = $scope.GetwindowStoreData(windowviewid, 'CanvasDivLeftPosition'); var CanvasDivTopPosition = $scope.GetwindowStoreData(windowviewid, 'CanvasDivTopPosition'); @@ -9608,7 +9613,27 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l } } - $scope.EnableUI(); + $scope.EnableDAUI(windowviewid); + } + + $scope.MultipleAnnotation = function (event) { + var len= (event.currentTarget.id).split("_").length; + var windowviewid = (event.currentTarget.id).split("_")[len-1]; + + //set true to false or vice versa + var iskeyctrlActive= $scope.GetwindowStoreData(windowviewid, 'keyctrl'); + $("#multiannotation_" + windowviewid).toggleClass("disableMultiAnnotationText"); + + if(iskeyctrlActive) + { + $("#multiannotation_"+windowviewid ).attr('title', 'Active Multiple Structure'); + } + else + { + $("#multiannotation_"+windowviewid ).attr('title', 'Disable Multiple Structure'); + } + + $scope.SetwindowStoreData(windowviewid, 'keyctrl', !iskeyctrlActive); } $scope.enableShowHideStructureBox = function (event) { @@ -9618,19 +9643,23 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l var windowviewid = (event.currentTarget.id).split("_")[len-1]; $scope.SetwindowStoreData(windowviewid,'isListManagerSelected',false); + $("#btnStrutureBox_" + windowviewid).toggleClass("disableHideShowStructure"); $rootScope.CloseListManager(); var btnStrutureBoxname = document.getElementById("btnStrutureBox_" + windowviewid).name; if (btnStrutureBoxname == "showAnnotationStructure") { - $("#btnStrutureBox_" + windowviewid).addClass("disableHideShowStructure"); + $("#btnStrutureBox_"+windowviewid ).attr('title', 'Show Structure Name Boxes'); + $("#btnStrutureBox_"+windowviewid +" i").removeClass("far fa-comment-alt-times").addClass("far fa-comment-alt"); + $("#btnStrutureBox_"+windowviewid ).attr('name', 'hideAnnotationStructure'); + $scope.hideAnnotation(windowviewid); - document.getElementById("btnStrutureBox_" + windowviewid).name = "hideAnnotationStructure"; $scope.SetwindowStoreData(windowviewid, 'showHideAnnotations', 'hideAnnotationStructure'); } else { - $("#btnStrutureBox_" + windowviewid).removeClass("disableHideShowStructure"); + $("#btnStrutureBox_"+windowviewid ).attr('title', 'Hide Structure Name Boxes'); + $("#btnStrutureBox_"+windowviewid +" i").removeClass("far fa-comment-alt").addClass("far fa-comment-alt-times"); + $("#btnStrutureBox_"+windowviewid ).attr('name', 'showAnnotationStructure'); $scope.showAnnotation(windowviewid); - document.getElementById("btnStrutureBox_" + windowviewid).name = "showAnnotationStructure"; $scope.SetwindowStoreData(windowviewid, 'showHideAnnotations', 'showAnnotationStructure'); } } @@ -9770,7 +9799,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l if (colorMode != undefined || colorMode != null) { - $scope.DisableUI(); + $scope.DisableDAUI(windowviewid); var zeroPoint = new Point(); DAData.applyFilter(DAData, DAData.rect, zeroPoint, colorMode); @@ -9876,13 +9905,13 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l var isListManagerAlreadySelected = $scope.GetwindowStoreData(windowviewid, 'isListManagerAlreadySelected'); var isLexiconReload= $scope.GetwindowStoreData(windowviewid, 'isannotationReload'); if (((isHighlightBodyByBodySystem == true)) || (isbodySystemHighlight == true && isHighLight == true)) { - $scope.DisableUI(); + $scope.DisableDAUI(windowviewid); $timeout(function () { $scope.HighlightBodyByTermListForBodySystem(null, windowviewid) }, 100); } else if (($rootScope.isCallFromOtherModule == true)||isLexiconReload==true || (isListManagerSelected == true) || (previousHighlightList != null && previousHighlightList.length > 0) && (isGenderChnage == true || isViewChange == true) || isListManagerAlreadySelected == true) { $timeout(function () { - $scope.DisableUI(); + $scope.DisableDAUI(windowviewid); if (AllTerms != undefined && AllTerms.length > 0) { $scope.HighlightBodyByTermList(AllTerms, windowviewid); } @@ -9900,7 +9929,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $scope.createTermListByPreviousTermsAndHighlight(windowviewid); } - $scope.EnableUI(); + $scope.EnableDAUI(windowviewid); } }, 500); @@ -9912,7 +9941,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l //for highlight when highlight button is clicked the ui got disabled, //now highlight is completed so enalbe UI - $scope.EnableUI(); + $scope.EnableDAUI(windowviewid); } @@ -9931,7 +9960,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l console.log('1. $rootScope.isExtract=true and previousHighlightList != null') $timeout(function () { - $scope.DisableUI(); + $scope.DisableDAUI(windowviewid); $scope.HighlightBodyOnExtract(windowviewid) }, 50); } @@ -9939,7 +9968,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l console.log('1. $rootScope.isExtract=true and $rootScope.isListManagerSelected == true') $timeout(function () { - $scope.DisableUI(); + $scope.DisableDAUI(windowviewid); $scope.HighlightBodyOnExtract(windowviewid) }, 50); @@ -9948,7 +9977,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $scope.HighlightBodyByTermListForBodySystem(null, windowviewid); } else { - $scope.EnableUI(); + $scope.EnableDAUI(windowviewid); } } } @@ -10024,7 +10053,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l console.log('colorMode inside else = ' + colorMode); if (colorMode != undefined || colorMode != null) { - $scope.DisableUI(); + $scope.DisableDAUI(windowviewid); var zeroPoint = new Point(); DAData.applyFilter(DAData, DAData.rect, zeroPoint, colorMode); @@ -10092,7 +10121,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l console.log('2. $rootScope.isExtract=true and previousHighlightList != null, previousHighlightList.length= ' + previousHighlightList.length) $timeout(function () { - $scope.DisableUI(); + $scope.DisableDAUI(windowviewid); $scope.HighlightBodyOnExtract(windowviewid) }, 50); @@ -10100,7 +10129,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l else if (isListManagerSelected == true) { console.log('2. $rootScope.isExtract=true and $rootScope.isListManagerSelected == true') $timeout(function () { - $scope.DisableUI(); + $scope.DisableDAUI(windowviewid); $scope.HighlightBodyOnExtract(windowviewid) }, 50); @@ -10110,12 +10139,12 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l } else if ($rootScope.isCallFromOtherModule && AllTerms.length > 0) { $timeout(function () { - $scope.DisableUI(); + $scope.DisableDAUI(windowviewid); $scope.HighlightBodyOnExtract(windowviewid) }, 50); } else { - $scope.EnableUI(); + $scope.EnableDAUI(windowviewid); } } @@ -10226,7 +10255,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l return; } - $scope.DisableUI(); + $scope.DisableDAUI(windowviewid); $rootScope.UnsaveCurriculum = true; var canvasDiv = document.getElementById("canvasDivDA_" + windowviewid); $scope.imageVerticalScrollPosition = canvasDiv.scrollTop; @@ -10256,11 +10285,17 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $rootScope.CloseListManager(); + $('#canvasDA_' + windowviewid).removeLayers();//remove all old shape + //var sktch = $("#canvasPaintDA_" + windowviewid).sketch(); + $("#canvasPaintDA_" + windowviewid).sketch().actions = [];//remove old paint data + var canDiv = document.getElementById('canvasDivDA_' + windowviewid); var canDivChildCount = canDiv.childElementCount; if (canDivChildCount > 0) { canDiv.innerHTML = ''; } + + $scope.SetwindowStoreData(windowviewid, 'isCanvasReset',true); //canvas is clear in search term,layer change,viewchange here. so annotationData should also clear $scope.SetwindowStoreData(windowviewid, 'isCBAnnotationActive',false); $scope.SetwindowStoreData(windowviewid, 'annotationData', {shapeStates:[],paintCanvasState:[]}); @@ -10293,7 +10328,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l //2 first update the currentbodyviewid in local storage localStorage.setItem("currentBodyViewId", currentBodyViewId); - $scope.DisableUI(); + $scope.DisableDAUI(windowviewid); //3. update gender local storage if (!$rootScope.isCallFromOtherModule) { localStorage.setItem("currentGenderValue", 'Male'); @@ -10330,7 +10365,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l //2. first update the currentbodyviewid in local storage localStorage.setItem("currentBodyViewId", currentBodyViewId); - $scope.DisableUI(); + $scope.DisableDAUI(windowviewid); //3. update gender local storage if (!$rootScope.isCallFromOtherModule) { @@ -10377,7 +10412,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l } $scope.loadBodyViewChangedBySetting = function (windowviewid, isLexiconChange) { - $scope.DisableUI(); + $scope.DisableDAUI(windowviewid); $scope.LoadImageToExport(windowviewid); var viewOrientationId=$scope.GetwindowStoreData(windowviewid,'viewOrientationId'); var timeintval=$scope.GetwindowStoreData(windowviewid,'intervalObject'); @@ -10395,7 +10430,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l if (vocabTermDataArray!=null) { var intval=$scope.GetwindowStoreData(panid,'intervalObject'); $scope.stopVocab(intval); - $scope.langSearchLoad(windowviewid); + $scope.langSearchLoad(panid); //loading da for selected panel $scope.CalculateImageCordinates(viewOrientationId, panid); @@ -10405,13 +10440,13 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l var winid = (selectedPanel).split("_")[1]; if(winid==panid) { - $scope.DisableUI(); + $scope.DisableDAUI(panid); $rootScope.dalistManagerEvent(panid); } } if ($scope.GetwindowStoreData(panid,'isSearchClicked')) { - $scope.DisableUI(); + $scope.DisableDAUI(panid); if ($('#searchTermListUl_' + panid).html() != "") { $('#searchTermListUl_' + panid).empty(); } @@ -10453,12 +10488,12 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $scope.loadSelectedBodyView(currentBodyViewId,windowviewid); $timeout(function () { if ($rootScope.isListManagerMenuSelected) { - $scope.DisableUI(); + $scope.DisableDAUI(windowviewid); $rootScope.dalistManagerEvent(windowviewid) } if ($scope.GetwindowStoreData(windowviewid,'isSearchClicked')) { - $scope.DisableUI(); + $scope.DisableDAUI(windowviewid); if ($('#searchTermListUl_' + windowviewid).html() != "") { $('#searchTermListUl_' + windowviewid).empty(); } @@ -10569,7 +10604,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $scope.SetwindowStoreData(windowviewid,'previousHighlightList',[]); } $rootScope.UnsaveCurriculum = true; - $scope.DisableUI(); + $scope.DisableDAUI(windowviewid); $scope.SetwindowStoreData(windowviewid,'isViewChange',true); var canvasDiv = document.getElementById("canvasDivDA_" + windowviewid); @@ -10619,12 +10654,18 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $("#btnHighLight_" + windowviewid).addClass("btn-primary"); } + $('#canvasDA_' + windowviewid).removeLayers();//remove all old shape + //var sktch = $("#canvasPaintDA_" + windowviewid).sketch(); + $("#canvasPaintDA_" + windowviewid).sketch().actions = [];//remove old paint data + //remove existing body view var canDiv = document.getElementById("canvasDivDA_" + windowviewid); var canDivChildCount = canDiv.childElementCount; if (canDivChildCount > 0) { canDiv.innerHTML = ''; } + + $scope.SetwindowStoreData(windowviewid, 'isCanvasReset',true); //canvas is clear in search term,layer change,viewchange here. so annotationData should also clear $scope.SetwindowStoreData(windowviewid, 'isCBAnnotationActive',false); $scope.SetwindowStoreData(windowviewid, 'annotationData', {shapeStates:[],paintCanvasState:[]}); @@ -10641,7 +10682,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l } else $scope.SetwindowStoreData(windowviewid,'voId',selectedViewId); - $scope.DisableUI(); + $scope.DisableDAUI(windowviewid); var bodyVid= $scope.GetwindowStoreData(windowviewid,'voId') @@ -10672,7 +10713,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l selectedViewId = $scope.correspondingBodyViewIds[selectedViewId]; if ($scope.GetwindowStoreData(windowviewid,'voId') != selectedViewId) { $scope.SetwindowStoreData(windowviewid,'voId',selectedViewId); - $scope.DisableUI(); + $scope.DisableDAUI(windowviewid); var bodyVid=$scope.GetwindowStoreData(windowviewid,'voId'); //1. @@ -10722,7 +10763,6 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l //Reload DA controller Body View after setting Change $rootScope.reloadDABodyViewEvent = function (bodyViewId,isLexiconChange, windowviewid) { - //console.log('reloadDABodyViewEvent'); $scope.SetwindowStoreData(windowviewid,'isGlobalSettingChanged',true); if ($rootScope.isSettingEventAlredayDispachted == true) { $rootScope.isSettingEventAlredayDispachted = false; // define at home controller @@ -10854,7 +10894,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l var viewOrientationId=$scope.GetwindowStoreData(windowviewid,'viewOrientationId'); $scope.SetwindowStoreData(windowviewid,'isExtract',false); $("#structureDropdownDA_" + windowviewid).toggle(); - $scope.DisableUI(); + $scope.DisableDAUI(windowviewid); $scope.SetwindowStoreData(windowviewid,'isListManagerSelected',false); $rootScope.CloseListManager(); @@ -10868,7 +10908,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $scope.removeCurrentHighlightedBodySystem(windowviewid); $scope.SetwindowStoreData(windowviewid,'isHighlightBodyByBodySystem',false); $scope.SetwindowStoreData(windowviewid,'isbodySystemHighlight',false); - $scope.EnableUI(); + $scope.EnableDAUI(windowviewid); } else { @@ -10906,7 +10946,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l } var isHighlightBodyByBodySystem=$scope.GetwindowStoreData(windowviewid,'isHighlightBodyByBodySystem'); if (($scope.isAlreadyHighlighted == true && isHighlightBodyByBodySystem == true)) { - $scope.DisableUI(); + $scope.DisableDAUI(windowviewid); $timeout(function () { $scope.HighlightBodyByTermListForBodySystem(null, windowviewid) }, 100); } } @@ -11153,7 +11193,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l //event remove it fire multiple time $rootScope.dalistManagerEvent = function (windowviewid) { - $scope.DisableUI(); + $scope.DisableDAUI(windowviewid); $('#bodySystems').empty(); $("#bodySystems").css("display", "block"); $("#AABodySystems").css("display", "none"); @@ -11199,14 +11239,10 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l // primar language var lanName=languageArray[0].language; $scope.loadListManger(windowviewid,lanName,totalstructure); - - $rootScope.islistManagerEventAlredayDispachted = false; - $scope.EnableUI(); - } $rootScope.changeLanguageLmEvent = function (windowviewid) { - $scope.DisableUI(); + $scope.DisableDAUI(windowviewid); $('#termList').empty(); var totalstructure=0; $scope.SetwindowStoreData(windowviewid,'totalstructure',0); @@ -11246,7 +11282,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l } $rootScope.LoadMoreLmEvent = function (windowviewid) { - $scope.DisableUI(); + $scope.DisableDAUI(windowviewid); var langId = $("#selectLanguageLm option:selected").val(); var totalstructure = $scope.GetwindowStoreData(windowviewid, 'totalstructureLm'); @@ -11326,15 +11362,14 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $('#btlLoadMoreLm').attr('disabled', 'disabled'); } - $scope.EnableUI(); - + $scope.EnableDAUI(windowviewid); } $rootScope.refreshTermListOnSystemSelection = function (selectedBodysystemId) { var windowviewid = (selectedBodysystemId).split("_")[1]; var bodysystemId = (selectedBodysystemId).split("_")[0]; - $scope.DisableUI(); + $scope.DisableDAUI(windowviewid); $("#bodySystems").find("option:not(:disabled)").css({ "background-color": "#ffffff", "color": "#000000" }); $("#bodySystems").find("option[id=" + selectedBodysystemId + "]").css({ "background-color": "#3399FF", "color": "#ffffff" }); @@ -11462,7 +11497,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l } } - $scope.EnableUI(); + $scope.EnableDAUI(windowviewid); } @@ -11490,10 +11525,10 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l // Terms search in the Search list should be disable in the List Manager and Vice-Versa. var prevId=$scope.GetwindowStoreData(windowviewid,'prevId'); if (prevId == actualTermNumber) { - $scope.EnableUI(); + $scope.EnableDAUI(windowviewid); } else { - $scope.DisableUI(); + $scope.DisableDAUI(windowviewid); // clear previousHighlightList and Terms and false multiAnnotation $scope.SetwindowStoreData(windowviewid, 'fullTermlist', []); @@ -11633,13 +11668,18 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $('#layerChangeSliderDA_' + windowviewid).slider("option", "value", sliderVal); + $('#canvasDA_' + windowviewid).removeLayers();//remove all old shape + //var sktch = $("#canvasPaintDA_" + windowviewid).sketch(); + $("#canvasPaintDA_" + windowviewid).sketch().actions = [];//remove old paint data + //remove existing body view var canDiv = document.getElementById('canvasDivDA_' + windowviewid); var canDivChildCount = canDiv.childElementCount; if (canDivChildCount > 0) { canDiv.innerHTML = ''; } - + + $scope.SetwindowStoreData(windowviewid, 'isCanvasReset',true); //9. //canvas is clear in search term,layer change,viewchange here. so annotationData should also clear $scope.SetwindowStoreData(windowviewid, 'isCBAnnotationActive',false); @@ -11656,7 +11696,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $('#dot_'+windowviewid).css("display", "none"); //DA > Annotation's Line should not displayed. $('#bord_'+windowviewid).css("display", "none"); - $scope.EnableUI(); + $scope.EnableDAUI(windowviewid); //redraw body of respective layer var viewOrientationId = $scope.GetwindowStoreData(windowviewid, 'viewOrientationId'); @@ -11789,7 +11829,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $scope.SetwindowStoreData(windowviewid,'CanvasDivLeftPosition',$('#canvasDivDA_' + windowviewid).scrollLeft()); $scope.SetwindowStoreData(windowviewid,'CanvasDivTopPosition',$('#canvasDivDA_' + windowviewid).scrollTop()); - $scope.EnableUI(); + $scope.EnableDAUI(windowviewid); } $scope.scaleValue = function (nValue, nNewZoom, nExistingZoom) { @@ -11905,7 +11945,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l var oldtimestamp = $scope.GetwindowStoreData(windowviewid, 'SearchTimeStampValue'); - if ((newtimestamp - oldtimestamp) > 500) { + if ((newtimestamp - oldtimestamp) > 100) { $scope.SetwindowStoreData(windowviewid, 'SearchTimeStampValue', newtimestamp); $scope.showFilteredTerms(windowviewid); @@ -12047,7 +12087,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l var len= (event.currentTarget.id).split("_").length; var windowviewid = (event.currentTarget.id).split("_")[len-1]; - $scope.DisableUI(); + $scope.DisableDAUI(windowviewid); $('#searchedTermListPopUp_' + windowviewid).css({ 'background': '#fff', 'border-radius': '3px', @@ -12131,9 +12171,10 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l } $scope.changeLanguageList = function (event) { - $scope.DisableUI(); var len= (event.currentTarget.id).split("_").length; var windowviewid = (event.currentTarget.id).split("_")[len-1]; + + $scope.DisableDAUI(windowviewid); if ($('#searchTermListUl_' + windowviewid).html() != "") { $('#searchTermListUl_' + windowviewid).empty(); } @@ -12168,9 +12209,10 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l } $scope.LoadMore = function (event) { - $scope.DisableUI(); var len= (event.currentTarget.id).split("_").length; var windowviewid = (event.currentTarget.id).split("_")[len-1]; + + $scope.DisableDAUI(windowviewid); var totalstructure = $scope.GetwindowStoreData(windowviewid, 'totalstructure'); setTimeout(function () { @@ -12250,7 +12292,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l }); } - $scope.EnableUI(); + $scope.EnableDAUI(windowviewid); } @@ -12346,6 +12388,14 @@ function enableShowHideStructureBox(event) { }); } +function keyControlDAActive(event) { + console.log('OnBodySystem chnaged is called outside '); + var scope = angular.element(document.getElementsByClassName("daBodyView")).scope(); + scope.$apply(function () { + scope.MultipleAnnotation(event); + }); +} + function OnSearch(event) { console.log('Show Search is called outside '); @@ -12445,9 +12495,9 @@ function onDrawingCanvasTouchMove(event) { function OnZoom(event) { var scope = angular.element(document.getElementsByClassName("daBodyView")).scope(); - scope.DisableUI(); var len= (event.currentTarget.id).split("_").length; var windowviewid = (event.currentTarget.id).split("_")[len-1]; + scope.DisableDAUI(windowviewid); if ($(".btn-annotation").hasClass("activebtncolor")) //Bug #14928 $(".btn-annotation").removeClass("activebtncolor"); diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js index ac82c70..5a037b5 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js @@ -41,7 +41,6 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data $rootScope.isModestyOn; $rootScope.isModestyOff; - $rootScope.SetSettingActiveTab; $("#annotationButton").addClass("disableMenuoption"); $("#Menuoptionid").addClass("disableMenuoption"); $rootScope.menuLabExer; @@ -299,18 +298,9 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data parentslag = "lab-exercise-view"; openNewlink = "lab-exercises"; } - var newpanelWidth=0; - var newpanelHeight=0; - var newpanelLeft=0; - var $ua = navigator.userAgent; - if (($ua.match(/(iPod|iPhone|iPad|android)/i))) { - newpanelWidth=screen.width; - newpanelHeight=screen.height; - } - else{ - newpanelWidth=screen.width-10; - newpanelHeight=screen.height-185; - } + var innerWidth =$(window).innerWidth()-10; + var innerheight =$(window).innerHeight()-40; + $.jsPanel({ id: 'dvOpenResourcePanel', selector: '#dvOpenResoucePanel', @@ -318,7 +308,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data currentController: 'HomeController', parentSlug: parentslag, content: '
    ' + - '', + '', title: "", position: { top: 1, @@ -328,8 +318,20 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data draggable: "disabled", size: { - width: newpanelWidth, - height: newpanelHeight + width: innerWidth, + height: innerheight + }, + resizable: { + minWidth: 770, + minHeight: 770, + start:function(event, ui) + { + $("#OpenModuleInCB").css("display", "block"); + }, + stop: function (event, ui) { + // var canvasDIvHeight = $("#CBTinyMCEPanel .jsPanel-content").height(); + + } }, }); @@ -367,9 +369,6 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data $(head).append(css); // $(head).append(storefunc); - var canvasDIvHeight = $("#dvOpenResourcePanel .jsPanel-content").height(); - $('#OpenModuleInCB').css('height', canvasDIvHeight); - $timeout(function () { console.log('frame content loding delayed......'); $scope.loadopenresourceContent(head, iframe); @@ -386,7 +385,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data { $timeout(function () { sessionStorage.setItem('isModuleOpenByOpenResource', 'true'); - sessionStorage.removeItem('ExitsCBFileDetail'); + sessionStorage.removeItem('ExitsCBFileDetail'); // OpenDefaultModule(iframe); }, 500); @@ -690,7 +689,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data $rootScope.isLoading = false; $rootScope.isLoginLoading = false; - + //unblock user if (url.indexOf('?unb:') != -1) { @@ -709,86 +708,104 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data //get user is already loggedin or not $scope.currentUserDetails = $rootScope.getLocalStorageValue('loggedInUserDetails'); - if ($scope.currentUserDetails != undefined) { + var siteUserParamDetail = JSON.parse($rootScope.getLocalStorageValue('siteUserParamDetail')); + if(siteUserParamDetail!=undefined && siteUserParamDetail!=null && $scope.currentUserDetails != undefined) + { $rootScope.isVisibleLogin = false; $location.url('/'); - var loggedInUser = JSON.parse($scope.currentUserDetails); - if(loggedInUser.mType!=undefined) - { - $rootScope.isCAlink=true; - $('.navbar-fixed-top').css('display','none'); - } - - ConfigurationService.getCofigValue() - .then( - function (configresult) { - $rootScope.current_year = configresult.current_year; - $rootScope.aiaIdleTime = configresult.idleTime; - $rootScope.aiaIdleTimeOut = configresult.idelTimeOut; - $rootScope.aiaPingInterval = configresult.pingInterval; - $rootScope.aiaAnimationPath = configresult.serverPath; - $rootScope.MaxOneFileSize = configresult.fileSize; - $rootScope.aodDomainName = configresult.aodSiteUrl; - - //incase site user login userid is 0 so then using license id - //logout site user while reload url without parameter - var userId=loggedInUser.Id==0?loggedInUser.LicenseId:loggedInUser.Id; - - //licenseId would be zero for admin/gernal admin - var isadminType=loggedInUser.LicenseId==0?true:false; - if(loggedInUser.mType!=undefined) - { - $scope.checkuserstatus = { - userId: userId, - tagName: loggedInUser.mType.toLowerCase()=='ca'?'logout':'update', - SessionId:loggedInUser.SessionId, - isSiteUser:loggedInUser.isSiteUser, - isAdmin:isadminType - } - } - else - { - $scope.checkuserstatus = { - userId: userId, - tagName: loggedInUser.Id==0?'logout':'update', - SessionId:loggedInUser.SessionId, - isSiteUser:loggedInUser.isSiteUser, - isAdmin:isadminType - } - - } - - - // this case found when browser closed by user after login. after long time (after 20 min) open site again - // loggedInUserDetails contain user detail so user auto login but it is logout by - // 1.by agent job 2. or by admin section from db - // so check user session again before auto login - AuthenticationService.ManageUserLoginStatus($scope.checkuserstatus) - .then( - function (loginStatus) { - if(loginStatus!=null) + $rootScope.isCallFromSite = true; + $rootScope.isCAlink=true; + $rootScope.LoginDisableUI(); + $rootScope.siteUrlInfo.siteIP = siteUserParamDetail.siteIP; + $rootScope.siteUrlInfo.accountNumber = siteUserParamDetail.accountNumber; + $rootScope.siteUrlInfo.edition = siteUserParamDetail.edition; + $rootScope.siteUrlInfo.urlReferer = siteUserParamDetail.urlReferer; + $rootScope.siteUrlInfo.remoteIPAddress = siteUserParamDetail.remoteIPAddress; + var sitedetail=$rootScope.siteUrlInfo; + $rootScope.ReloadClientSiteUser(sitedetail); + } + else + { + if ($scope.currentUserDetails != undefined) { + $rootScope.isVisibleLogin = false; + $location.url('/'); + var loggedInUser = JSON.parse($scope.currentUserDetails); + if(loggedInUser.mType!=undefined) + { + $rootScope.isCAlink=true; + $('.navbar-fixed-top').css('display','none'); + } + + ConfigurationService.getCofigValue() + .then( + function (configresult) { + $rootScope.current_year = configresult.current_year; + $rootScope.aiaIdleTime = configresult.idleTime; + $rootScope.aiaIdleTimeOut = configresult.idelTimeOut; + $rootScope.aiaPingInterval = configresult.pingInterval; + $rootScope.aiaAnimationPath = configresult.serverPath; + $rootScope.MaxOneFileSize = configresult.fileSize; + $rootScope.aodDomainName = configresult.aodSiteUrl; + + //incase site user login userid is 0 so then using license id + //logout site user while reload url without parameter + var userId=loggedInUser.Id==0?loggedInUser.LicenseId:loggedInUser.Id; + + //licenseId would be zero for admin/gernal admin + var isadminType=loggedInUser.LicenseId==0?true:false; + if(loggedInUser.mType!=undefined) { - if(loginStatus=='False') - { - $rootScope.LogoutUserSession(); + $scope.checkuserstatus = { + userId: userId, + tagName: loggedInUser.mType.toLowerCase()=='ca'?'logout':'update', + SessionId:loggedInUser.SessionId, + isSiteUser:loggedInUser.isSiteUser, + isAdmin:isadminType } - else - { - AuthenticateAlreadyLoggedInUser(); + } + else + { + $scope.checkuserstatus = { + userId: userId, + tagName: loggedInUser.Id==0?'logout':'update', + SessionId:loggedInUser.SessionId, + isSiteUser:loggedInUser.isSiteUser, + isAdmin:isadminType } + } - - }), - function (error) { - console.log(' Error in user login status = ' + error.statusText); - $('#errorMessage').text(error); - $("#messageModal").modal('show'); - } - - }); - + + + // this case found when browser closed by user after login. after long time (after 20 min) open site again + // loggedInUserDetails contain user detail so user auto login but it is logout by + // 1.by agent job 2. or by admin section from db + // so check user session again before auto login + AuthenticationService.ManageUserLoginStatus($scope.checkuserstatus) + .then( + function (loginStatus) { + if(loginStatus!=null) + { + if(loginStatus=='False') + { + $rootScope.LogoutUserSession(); + } + else + { + AuthenticateAlreadyLoggedInUser(); + } + } + + }), + function (error) { + console.log(' Error in user login status = ' + error.statusText); + $('#errorMessage').text(error); + $("#messageModal").modal('show'); + } + + }); + } } - + var isRememberChecked = $rootScope.getLocalStorageValue('isRememberMeChecked'); if ($rootScope.getLocalStorageValue('isRememberMeChecked') != "" && sessionStorage.getItem("loginSession") == null) { @@ -802,7 +819,8 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data } } } - else { + else + { $rootScope.isVisibleLogin = true; @@ -813,6 +831,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data if ($scope.currentUserDetails == undefined) { $rootScope.getConfigurationValues(); } + } $timeout(function () { @@ -1580,37 +1599,41 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data } else { - $scope.currentUserDetails = $rootScope.getLocalStorageValue('loggedInUserDetails'); var sitedetail=$rootScope.siteUrlInfo; - ConfigurationService.getCofigValue() - .then( - function (configresult) { - $rootScope.current_year = configresult.current_year; - $rootScope.aiaIdleTime = configresult.idleTime; - $rootScope.aiaIdleTimeOut = configresult.idelTimeOut; - $rootScope.aiaPingInterval = configresult.pingInterval; - $rootScope.aiaAnimationPath = configresult.serverPath; - $rootScope.MaxOneFileSize = configresult.fileSize; - $rootScope.aodDomainName = configresult.aodSiteUrl; - - var loggedInUser = JSON.parse($scope.currentUserDetails); - //check already login by account number bcz no login id for site login - //maintain user session by licenseid of site login - if(loggedInUser!==null && loggedInUser.AccountNumber==sitedetail.accountNumber) - { - //using old session id - sitedetail.SessionId = loggedInUser.SessionId; - $rootScope.AuthenticateClientSiteUser(sitedetail); - } - else - { - //using new sessionid - $rootScope.AuthenticateClientSiteUser(sitedetail); - } - }); + $rootScope.ReloadClientSiteUser(sitedetail); } } + $rootScope.ReloadClientSiteUser = function (sitedetail) { + $scope.currentUserDetails = $rootScope.getLocalStorageValue('loggedInUserDetails'); + ConfigurationService.getCofigValue() + .then( + function (configresult) { + $rootScope.current_year = configresult.current_year; + $rootScope.aiaIdleTime = configresult.idleTime; + $rootScope.aiaIdleTimeOut = configresult.idelTimeOut; + $rootScope.aiaPingInterval = configresult.pingInterval; + $rootScope.aiaAnimationPath = configresult.serverPath; + $rootScope.MaxOneFileSize = configresult.fileSize; + $rootScope.aodDomainName = configresult.aodSiteUrl; + + var loggedInUser = JSON.parse($scope.currentUserDetails); + //check already login by account number bcz no login id for site login + //maintain user session by licenseid of site login + if(loggedInUser!==null && loggedInUser.AccountNumber==sitedetail.accountNumber) + { + //using old session id + sitedetail.SessionId = loggedInUser.SessionId; + $rootScope.AuthenticateClientSiteUser(sitedetail); + } + else + { + //using new sessionid + $rootScope.AuthenticateClientSiteUser(sitedetail); + } + }); + } + $rootScope.AuthenticateClientSiteUser = function (siteInfo) { $rootScope.LoginDisableUI(); $rootScope.isCAlink=false; @@ -1815,6 +1838,8 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data $rootScope.userModules = result.Modules; localStorage.setItem('loggedInUserDetails', JSON.stringify(result)); + //using for open resource and reloading app + localStorage.setItem('siteUserParamDetail', JSON.stringify(siteInfo)); if (isCommingSoonModel == true) { @@ -1869,7 +1894,10 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data $rootScope.haveRoleAdmin = false; //2. - localStorage.setItem('loggedInUserDetails', JSON.stringify(result)); + localStorage.setItem('loggedInUserDetails', JSON.stringify(result)); + + //using for open resource and reloading app + localStorage.setItem('siteUserParamDetail', JSON.stringify(siteInfo)); //5. sessionStorage.setItem("loginSession", "true"); @@ -2239,6 +2267,8 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data $rootScope.LogoutUser = function () { $rootScope.isSessionTimeout=true; localStorage.removeItem('loggedInUserDetails'); + localStorage.removeItem('siteUserParamDetail'); + localStorage.clear(); $rootScope.CheckUserSession('logout'); @@ -2247,7 +2277,8 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data $rootScope.isSessionTimeout=true; localStorage.removeItem('loggedInUserDetails'); sessionStorage.removeItem('isModuleOpenByOpenResource'); - sessionStorage.removeItem('ExitsCBFileDetail'); + sessionStorage.removeItem('ExitsCBFileDetail'); + localStorage.removeItem('siteUserParamDetail'); localStorage.clear(); document.location = '/'; } @@ -2517,7 +2548,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data { for (var x = 0 ; x < $rootScope.AllPanelStoreObject.length; x++) { - if ($rootScope.AllPanelStoreObject[x].winid == windowviewid) { + if ($rootScope.AllPanelStoreObject[x].winid == windowviewid) { var obj=$rootScope.AllPanelStoreObject[x]['panelObject']; obj.maximize(); break; @@ -2528,13 +2559,31 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data { for (var x = 0 ; x < $rootScope.AllPanelStoreObject.length; x++) { - if ($rootScope.AllPanelStoreObject[x].winid == windowviewid) { + if ($rootScope.AllPanelStoreObject[x].winid == windowviewid) { var obj=$rootScope.AllPanelStoreObject[x]['panelObject']; obj.normalize(); break; } } } + $rootScope.openresourcePanelPosition=function() + { + if(document.getElementById("dvOpenResourcePanel") ) { + var innerWidth =$(window).innerWidth()-10; + var innerheight =$(window).innerHeight()-40; + + $("#OpenModuleInCB").css('height',innerheight); + $("#dvOpenResourcePanel .jsPanel-hdr .jsPanel-title").css('width','300px'); + + $("#dvOpenResourcePanel").css('height',innerheight); + $("#dvOpenResourcePanel").css('width',innerWidth); + + $("#dvOpenResourcePanel .jsPanel-content").css('height',innerheight); + $("#dvOpenResourcePanel .jsPanel-content").css('width',innerWidth); + + } + + } $(document).ready(function () { @@ -2542,36 +2591,52 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data if (($ua.match(/(iPod|iPhone|iPad|android)/i))) { $('#arragePannel .dropdown-content').css("display","block"); } - + $(window).unbind('resize'); window.addEventListener("resize", orientationchange); - function orientationchange() { - if($location.url()!= "/curriculum-builder-detail") { - var moduleImagePanel = $("div[id*='ImagePanel']"); + function orientationchange() { + clearTimeout(window.resizedFinished); + window.resizedFinished = setTimeout(function(){ + console.log('Resized finished.'); + $rootScope.openresourcePanelPosition(); + if($location.url()!= "/curriculum-builder-detail") { + var moduleImagePanel = $("div[id*='ImagePanel']"); - if (moduleImagePanel.length > 0) { - - for (var j = 0; j < moduleImagePanel.length; j++) { - var paneld=moduleImagePanel[j].id; - var len = (paneld).split("_").length; - var MultiWinId = (paneld).split("_")[len - 1]; + if (moduleImagePanel.length > 0) { + + for (var j = 0; j < moduleImagePanel.length; j++) { + var paneld=moduleImagePanel[j].id; + var len = (paneld).split("_").length; + var MultiWinId = (paneld).split("_")[len - 1]; - //first set to normal and then to set max mode while browser resize or iPad orientation change - $rootScope.orientationchangeToNormal(MultiWinId); - $rootScope.orientationchangeToMax(MultiWinId); - + //first set to normal and then to set max mode while browser resize or iPad orientation change + + $rootScope.minmaxPanelAutoEventTrue(MultiWinId,paneld); + $rootScope.orientationchangeToNormal(MultiWinId); + $rootScope.minmaxPanelAutoEventFalse(MultiWinId,paneld); + + $rootScope.orientationchangeToMax(MultiWinId); + + } } + + } + if(($location.url()== "/tile-view-list") ||($location.url()== "/clinical-illustrations")||($location.url()== "/clinical-animations")||($location.url()== "/ADAM-images")||($location.url()== "/ADAM-on-demand")) { + $rootScope.ResetGridListLength(); } - - } - if(($location.url()== "/tile-view-list") ||($location.url()== "/clinical-illustrations")||($location.url()== "/clinical-animations")||($location.url()== "/ADAM-images")||($location.url()== "/ADAM-on-demand")) { - $rootScope.ResetGridListLength(); - } - - }; - - + if($location.url()== "/curriculum-builder") + { + $rootScope.ResetCBListHeight(); + } + else if($location.url()== "/curriculum-builder-detail" ) + { + $rootScope.ResetCBHeight(); + } + + }, 300); + } + $(function () { var colpick = $('.demo').each(function () { @@ -2694,7 +2759,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data else if ($location.url() == "/module-item-view") { $("#annotationButton").removeClass("disableMenuoption"); $("#Menuoptionid").removeClass("disableMenuoption"); - $("#optiontSetting").addClass("disableSubMenu"); + // $("#optiontSetting").addClass("disableSubMenu"); $("#labExPdfOption").addClass("disableSubMenu"); $("#annotationToolBarOptions").removeClass("disableSubMenu"); $("#fileMenuAnchor").removeClass("disableFileMenu"); @@ -2853,16 +2918,11 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data $rootScope.getModuleScrollPosition = function () { $rootScope.refreshcheck = "check"; $('.mCSB_container ul li').click(function () { - $rootScope.scrollTopPosition = $(this).position().top; - }); setTimeout(function () { $(".sidebar").mCustomScrollbar("scrollTo", $rootScope.scrollTopPosition + "px"); - - - }, 300); } @@ -2883,8 +2943,11 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data for (var j = 0; j < moduleImagePanel.length; j++) { var paneld=moduleImagePanel[j].id; var len = (paneld).split("_").length; - var MultiWinId = (paneld).split("_")[len - 1]; + var MultiWinId = (paneld).split("_")[len - 1]; + + $rootScope.minmaxPanelAutoEventTrue(MultiWinId,paneld); $rootScope.orientationchangeToNormal(MultiWinId); + $rootScope.minmaxPanelAutoEventFalse(MultiWinId,paneld); if(j>0) { @@ -2943,7 +3006,9 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data var len = (paneld).split("_").length; var MultiWinId = (paneld).split("_")[len - 1]; + $rootScope.minmaxPanelAutoEventTrue(MultiWinId,paneld); $rootScope.orientationchangeToNormal(MultiWinId); + $rootScope.minmaxPanelAutoEventFalse(MultiWinId,paneld); //set max tiles 3 on screen width if(countnumber>1 && countnumber<4) @@ -2975,8 +3040,57 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data } } + } + + $rootScope.minmaxPanelAutoEventTrue = function (MultiWinId,paneld) + { + if(paneld.match("daImagePanel")) + { + $rootScope.SetDAwindowData(MultiWinId, 'minmaxAutoEvent', true); + } + else if(paneld.match("AAImagePanel")) + { + $rootScope.SetAAwindowData(MultiWinId, 'minmaxAutoEvent', true); + } + else if(paneld.match("ciImagePanel")) + { + $rootScope.SetCIwindowData(MultiWinId, 'minmaxAutoEvent', true); + } + else if(paneld.match("aiImagePanel")) + { + $rootScope.SetAIwindowData(MultiWinId, 'minmaxAutoEvent', true); + } + else if(paneld.match("picImagePanel")) + { + $rootScope.SetPICwindowData(MultiWinId, 'minmaxAutoEvent', true); + } + + } + $rootScope.minmaxPanelAutoEventFalse = function (MultiWinId,paneld) + { + if(paneld.match("daImagePanel")) + { + $rootScope.SetDAwindowData(MultiWinId, 'minmaxAutoEvent', false); + } + else if(paneld.match("AAImagePanel")) + { + $rootScope.SetAAwindowData(MultiWinId, 'minmaxAutoEvent', false); + } + else if(paneld.match("ciImagePanel")) + { + $rootScope.SetCIwindowData(MultiWinId, 'minmaxAutoEvent', false); + } + else if(paneld.match("aiImagePanel")) + { + $rootScope.SetAIwindowData(MultiWinId, 'minmaxAutoEvent', false); + } + else if(paneld.match("picImagePanel")) + { + $rootScope.SetPICwindowData(MultiWinId, 'minmaxAutoEvent', false); } + } + $scope.resetPanelPosition=function(MultiWinId,paneld,resetWidth,pTop,pLeft) { $rootScope.UnsaveCurriculum = true; @@ -2985,12 +3099,18 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data { $("#"+paneld).css('height','520'); $("#"+paneld+' .jsPanel-content').css('height','490'); - - $('#canvasDivDA_' + MultiWinId).css('height', '440'); + $rootScope.SetDAwindowData(MultiWinId,'width',resetWidth); $rootScope.SetDAwindowData(MultiWinId,'height',520); $rootScope.SetDAwindowData(MultiWinId,'y',pTop); $rootScope.SetDAwindowData(MultiWinId,'x',pLeft); + + var canvasDiv='canvasDivDA_' + MultiWinId; + var canvasDraw='canvasDA_' + MultiWinId; + var canvasPaint='canvasPaintDA_' + MultiWinId; + var bodyVid=$rootScope.GetDAwindowData(MultiWinId,'voId'); + var annotationData=$rootScope.GetDAwindowData(MultiWinId,'annotationData'); + $rootScope.setAADAPanelCordinate(MultiWinId,bodyVid,paneld,canvasDiv,canvasDraw,canvasPaint,440,resetWidth,annotationData); } else if(paneld.match("AAImagePanel")) @@ -2998,44 +3118,83 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data $("#"+paneld).css('height','520'); $("#"+paneld+' .jsPanel-content').css('height','490'); - $('#canvasAADiv_' + MultiWinId).css('height', '440'); $rootScope.SetAAwindowData(MultiWinId,'width',resetWidth); $rootScope.SetAAwindowData(MultiWinId,'height',520); $rootScope.SetAAwindowData(MultiWinId,'y',pTop); $rootScope.SetAAwindowData(MultiWinId,'x',pLeft); + var canvasDiv='canvasAADiv_' + MultiWinId; + var canvasDraw='canvasAA_' + MultiWinId; + var canvasPaint='canvasPaintAA_' + MultiWinId; + var annotationData=$rootScope.GetAAwindowData(MultiWinId,'annotationData'); + + $rootScope.setAADAPanelCordinate(MultiWinId,0,paneld,canvasDiv,canvasDraw,canvasPaint,440,resetWidth,annotationData); } else if(paneld.match("ciImagePanel")) { $("#"+paneld).css('height','520'); $("#"+paneld+' .jsPanel-content').css('height','490'); - - $('#canvasDivCI_' + MultiWinId).css('height', '490'); + $rootScope.SetCIwindowData(MultiWinId,'width',resetWidth); $rootScope.SetCIwindowData(MultiWinId,'height',520); $rootScope.SetCIwindowData(MultiWinId,'y',pTop); $rootScope.SetCIwindowData(MultiWinId,'x',pLeft); + + var canvasDiv='canvasDivCI_' + MultiWinId; + var canvasDraw='canvasCI_' + MultiWinId; + var canvasPaint='canvasPaintCI_' + MultiWinId; + var imgName='ciimage_' + MultiWinId; + var oldleft= $rootScope.GetCIwindowData(MultiWinId, 'imgLeft'); + var annotationData=$rootScope.GetCIwindowData(MultiWinId,'annotationData'); + + $rootScope.setIMGPanelCordinate(MultiWinId,paneld,canvasDiv,canvasDraw,canvasPaint,imgName,oldleft,485,resetWidth,annotationData); + var img = document.getElementById(imgName); + $rootScope.SetCIwindowData(MultiWinId, 'imgLeft',img.offsetLeft); + } else if(paneld.match("aiImagePanel")) { $("#"+paneld).css('height','520'); $("#"+paneld+' .jsPanel-content').css('height','490'); - - $('#canvasDivAI_' + MultiWinId).css('height', '485'); + $rootScope.SetAIwindowData(MultiWinId,'width',resetWidth); $rootScope.SetAIwindowData(MultiWinId,'height',520); $rootScope.SetAIwindowData(MultiWinId,'y',pTop); $rootScope.SetAIwindowData(MultiWinId,'x',pLeft); + + var canvasDiv='canvasDivAI_' + MultiWinId; + var canvasDraw='canvasAI_' + MultiWinId; + var canvasPaint='canvasPaintAI_' + MultiWinId; + var imgName='aimage_' + MultiWinId; + var oldleft= $rootScope.GetAIwindowData(MultiWinId, 'imgLeft'); + var annotationData=$rootScope.GetAIwindowData(MultiWinId,'annotationData'); + + $rootScope.setIMGPanelCordinate(MultiWinId,paneld,canvasDiv,canvasDraw,canvasPaint,imgName,oldleft,485,resetWidth,annotationData); + var img = document.getElementById(imgName); + $rootScope.SetAIwindowData(MultiWinId, 'imgLeft',img.offsetLeft); + } else if(paneld.match("picImagePanel")) { $("#"+paneld).css('height','520'); $("#"+paneld+' .jsPanel-content').css('height','490'); - $('#canvasDivPIC_' + MultiWinId).css('height', '485'); + //$('#canvasDivPIC_' + MultiWinId).css('height', '485'); $rootScope.SetPICwindowData(MultiWinId,'width',resetWidth); $rootScope.SetPICwindowData(MultiWinId,'height',520); $rootScope.SetPICwindowData(MultiWinId,'y',pTop); $rootScope.SetPICwindowData(MultiWinId,'x',pLeft); + + var canvasDiv='canvasDivPIC_' + MultiWinId; + var canvasDraw='canvasPIC_' + MultiWinId; + var canvasPaint='canvasPaintPIC_' + MultiWinId; + var imgName='mypic_' + MultiWinId; + var oldleft= $rootScope.GetPICwindowData(MultiWinId, 'imgLeft'); + var annotationData=$rootScope.GetPICwindowData(MultiWinId,'annotationData'); + + $rootScope.setIMGPanelCordinate(MultiWinId,paneld,canvasDiv,canvasDraw,canvasPaint,imgName,oldleft,485,resetWidth,annotationData); + var img = document.getElementById(imgName); + $rootScope.SetPICwindowData(MultiWinId, 'imgLeft',img.offsetLeft); + } else if(paneld.match("ThreeDImagePanel")) { @@ -3052,9 +3211,11 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data else if(paneld.match("caImagePanel")) { $("#"+paneld).css('height','520'); - $("#"+paneld+' .jsPanel-content').css('height','490'); - $('#playerinlineVideo_'+ MultiWinId ).css("height",370 ); - + $("#"+paneld+' .jsPanel-content').css('height','490'); + + var summaryHeight = $('#summary_'+ MultiWinId).height()+10; + $('#playerinlineVideo_'+ MultiWinId ).css("height",490-summaryHeight ); + $rootScope.SetCAwindowData(MultiWinId,'width',resetWidth); $rootScope.SetCAwindowData(MultiWinId,'height',520); $rootScope.SetCAwindowData(MultiWinId,'y',pTop); @@ -3077,8 +3238,8 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data { $("#"+paneld).css('height','520'); $("#"+paneld+' .jsPanel-content').css('height','490'); - $('#LabView_' + MultiWinId).css('height', 505); - $('#panelbodyDiv_' + MultiWinId).css("height",380); + $('#panelbodyDiv_' + MultiWinId).css("height",390); + $('#resultbodyDiv_' + MultiWinId).css("height",400); $rootScope.SetLabwindowData(MultiWinId,'width',resetWidth); $rootScope.SetLabwindowData(MultiWinId,'height',520); $rootScope.SetLabwindowData(MultiWinId,'y',pTop); @@ -3086,7 +3247,203 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data } - } + } + + $rootScope.setAADAPanelCordinate = function (MultiWinId,viewid,pnlName,canvasDiv,CanvasDrawId,canvasPaintId,canvasDIvHeight,canvasDIvWidth,annotationData) + { + $('#' + canvasDiv).css('height', canvasDIvHeight); + $rootScope.resetMenuOptionOnClick(pnlName); + + var canvas = document.getElementById(CanvasDrawId); + var canvasPaint = document.getElementById(canvasPaintId); + canvas.height = canvasDIvHeight-30; + canvasPaint.height = canvasDIvHeight-30; + canvas.width = canvasDIvWidth-20; + canvasPaint.width = canvasDIvWidth-20; + + if(pnlName.match("AAImagePanel")) + { + //keep image position always as it is! + var aaDetailCanvas = document.getElementById("aaDetailViewCanvas_"+MultiWinId); + if(aaDetailCanvas.height>canvasDIvHeight) + { + canvas.height = aaDetailCanvas.height; + canvasPaint.height = aaDetailCanvas.height; + } + if(aaDetailCanvas.width>canvasDIvWidth) + { + canvas.width = aaDetailCanvas.width; + canvasPaint.width = aaDetailCanvas.width; + } + } + else if(pnlName.match("daImagePanel")) + { + if(viewid=="1" ||viewid=="5") + { + var imageCanvas6MR = document.getElementById("imageCanvas6_MR_"+MultiWinId);//get width + var imageCanvas5MR = document.getElementById("imageCanvas5_MR_"+MultiWinId);//get height + var totalwidth=imageCanvas6MR.offsetLeft+imageCanvas6MR.width; + var totalHeight=imageCanvas5MR.offsetTop+imageCanvas5MR.height; + } + else if(viewid=="4" ||viewid=="8") + { + var imageCanvas6 = document.getElementById("imageCanvas6_"+MultiWinId);//get width + var imageCanvas5 = document.getElementById("imageCanvas5_"+MultiWinId);//get height + var totalwidth=imageCanvas6.offsetLeft+imageCanvas6.width; + var totalHeight=imageCanvas5.offsetTop+imageCanvas5.height; + } + else if(viewid=="2" ||viewid=="6"||viewid=="3" ||viewid=="7") + { + var imageCanvas2 = document.getElementById("imageCanvas2_"+MultiWinId);//get width + var imageCanvas5 = document.getElementById("imageCanvas5_"+MultiWinId);//get height + var totalwidth=imageCanvas2.offsetLeft+imageCanvas2.width+50; + var totalHeight=imageCanvas5.offsetTop+imageCanvas5.height; + } + else if(viewid=="9" ||viewid=="11") + { + var imageCanvas2 = document.getElementById("imageCanvas2_"+MultiWinId);//get width + var imageCanvas4 = document.getElementById("imageCanvas4_"+MultiWinId);//get height + var totalwidth=imageCanvas2.offsetLeft+imageCanvas2.width+50; + var totalHeight=imageCanvas4.offsetTop+imageCanvas4.height; + } + else if(viewid=="10" ||viewid=="12") + { + var imageCanvas6 = document.getElementById("imageCanvas6_"+MultiWinId);//get height and width + + var totalwidth=imageCanvas6.offsetLeft+imageCanvas6.width+50; + var totalHeight=imageCanvas6.offsetTop+imageCanvas6.height; + } + + + if(totalHeight>canvasDIvHeight) + { + canvas.height = totalHeight; + canvasPaint.height = totalHeight; + } + if(totalwidth>canvasDIvWidth) + { + canvas.width = totalwidth; + canvasPaint.width = totalwidth; + } + + } + + if(annotationData!="" && annotationData!=undefined) + { + if(annotationData.shapeStates.length>0||annotationData.paintCanvasState.length>0) + { + $('#' + CanvasDrawId).removeLayers();//remove all old shape + $("#" + canvasPaintId).sketch().actions = [];//remove old paint data first + //first draw shape and then store in object + $rootScope.ResizeCBSavedAnnotation(pnlName,CanvasDrawId,canvasPaintId,annotationData); + } + } + + } + + $rootScope.setIMGPanelCordinate = function (MultiWinId,pnlName,canvasDiv,CanvasDrawId,canvasPaintId,imgName,oldleft,canvasDIvHeight,canvasDIvWidth,annotationData) + { + $('#' + canvasDiv).css('height', canvasDIvHeight); + $rootScope.resetMenuOptionOnClick(pnlName); + var img = document.getElementById(imgName); + + var canvas = document.getElementById(CanvasDrawId); + var canvasPaint = document.getElementById(canvasPaintId); + canvas.height = canvasDIvHeight-30; + canvasPaint.height = canvasDIvHeight-30; + canvas.width = canvasDIvWidth-20; + canvasPaint.width = canvasDIvWidth-20; + + if((canvasDIvWidth-img.width)>0) + { + $("#"+imgName).css("left", (canvasDIvWidth-img.width)/2 + "px"); + } + else + { + //image in big size than screen + $("#"+imgName).css("left", 0 + "px"); + } + + if(img.height>canvasDIvHeight) + { + canvas.height = img.height; + canvasPaint.height = img.height; + } + if(img.width>canvasDIvWidth) + { + canvas.width = img.width; + canvasPaint.width = img.width; + } + if(pnlName.match("ciImagePanel")) + { + canvas.height = canvas.height-40; + canvasPaint.height = canvasPaint.height-40; + } + + if(annotationData!="" && annotationData!=undefined) + { + if(annotationData.shapeStates.length>0||annotationData.paintCanvasState.length>0) + { + var modifiedData= {shapeStates:[],paintCanvasState:[]}; + var modifiedData=$rootScope.resetAnnotationData(imgName,oldleft,annotationData); + if(modifiedData!="" && modifiedData!=undefined) + { + if(modifiedData.shapeStates.length>0||modifiedData.paintCanvasState.length>0) + { + $('#' + CanvasDrawId).removeLayers();//remove all old shape + $("#" + canvasPaintId).sketch().actions = [];//remove old paint data first + + //first draw shape and then store in object + $rootScope.ResizeCBSavedAnnotation(pnlName,CanvasDrawId,canvasPaintId,modifiedData); + } + } + + } + } + } + + $rootScope.resetAnnotationData = function (imgName,oldleft,annotationData) + { + // load annotation + var img = document.getElementById(imgName); + var newLeft=img.offsetLeft-oldleft; + if(img.offsetLeft>=0) + { + var shapeStates=annotationData.shapeStates; + var shapecount=shapeStates.length; + for(var shapeindx=0;shapeindx0) { - //if only one module left - if(slug=='clinical-animations' && $rootScope.userData.mType!=undefined) - { - if($rootScope.userData.mType.toLowerCase()=='ca') - { - $rootScope.siteUrlInfo.mType=null; - $rootScope.siteUrlInfo.id=null; - $rootScope.LogoutUser(); - } - - } - else - { - if(modulePanel.length==1) $location.url('/' + slug); - } + if (modulePanel != undefined && modulePanel.length>0) { + //if only one module left + if(modulePanel.length==1) $location.url('/' + slug); + + // if(slug=='clinical-animations' && $rootScope.userData.mType!=undefined) + // { + // if($rootScope.userData.mType.toLowerCase()=='ca') + // { + // $rootScope.siteUrlInfo.mType=null; + // $rootScope.siteUrlInfo.id=null; + // $rootScope.LogoutUser(); + // } + + // } + } } @@ -3605,6 +3962,30 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data // keep on top paint Canvas zindex on top $rootScope.SetPaintZindexforCI = function (MultiWinId) { + //scroll issue in iPad + var $ua = navigator.userAgent; + if (($ua.match(/(iPod|iPhone|iPad|android)/i))) { + + var drawCanvasZindex = parseInt($("#canvasCI_" + MultiWinId).css("z-index")); + var paintCanvasZindex = parseInt($("#canvasPaintCI_" + MultiWinId).css("z-index")); + + if (drawCanvasZindex > paintCanvasZindex) { + paintCanvasZindex = drawCanvasZindex + 1; + } + else + { + paintCanvasZindex = paintCanvasZindex + 1; + } + + $("#canvasPaintCI_" + MultiWinId).css("z-index", paintCanvasZindex); + $('#summary_' + MultiWinId).css("z-index", paintCanvasZindex+1); + + } + + } + + $rootScope.SetPaintZindexforCISummary = function (MultiWinId) + { var drawCanvasZindex = parseInt($("#canvasCI_" + MultiWinId).css("z-index")); var paintCanvasZindex = parseInt($("#canvasPaintCI_" + MultiWinId).css("z-index")); @@ -3615,13 +3996,6 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data { paintCanvasZindex = paintCanvasZindex + 1; } - - //scroll issue in iPad - var $ua = navigator.userAgent; - if (($ua.match(/(iPod|iPhone|iPad|android)/i))) { - $("#canvasPaintCI_" + MultiWinId).css("z-index", paintCanvasZindex); - } - $('#summary_' + MultiWinId).css("z-index", paintCanvasZindex+1); } @@ -3631,6 +4005,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data //clear sketch js event for paint and erase $.sketch = { tools: {}}; $rootScope.RemoveSelectedShape(); + $rootScope.isAnnotationWindowOpen = false; $rootScope.isAnnotatiomToolBarPopupActive = false; $rootScope.isAnnotatiomToolBarPopupClosed = true; $("#OnIdentify").removeClass("annotationtoolbartab"); @@ -3718,6 +4093,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data if(paneld.match("ciImagePanel")) { $rootScope.SetPaintZindexforCI(MultiWinId); + $rootScope.SetPaintZindexforCISummary(MultiWinId); } if(paneld.match("aiImagePanel")) @@ -3894,12 +4270,12 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data for (var index = 0 ; index < modulePanel.length; index++) { var paneld = modulePanel[index].id; if(paneld.match("daImagePanel")||paneld.match("AAImagePanel")||paneld.match("ciImagePanel")||paneld.match("aiImagePanel")||paneld.match("picImagePanel")) - { + { + var len = (paneld).split("_").length; + var MultiWinId = (paneld).split("_")[len - 1]; $rootScope.switchCanvas(paneld); if(paneld.match("AAImagePanel")) - { - var len = (paneld).split("_").length; - var MultiWinId = (paneld).split("_")[len - 1]; + { var canvasId="#canvasAA_" + MultiWinId; $rootScope.switchToAnnotationCanvas(paneld,MultiWinId); var aaPinDataArray=$rootScope.GetAAwindowData(MultiWinId,'aaPinData'); @@ -3928,7 +4304,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data } if(paneld.match("ciImagePanel")) { - $rootScope.SetPaintZindexforCI(MultiWinId); + $rootScope.SetPaintZindexforCISummary(MultiWinId); } // remove event listener @@ -3944,6 +4320,40 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data // Dissectible Anatomy > Settings should be disable if Annotation is Open. $rootScope.ShowSettingWindow = function () { + + $('#tabdissectible').removeAttr('disabled'); + var modulePanel = $("#HomeContainerDiv").find("div[id*='ImagePanel']"); + if (modulePanel != undefined && modulePanel.length>0) { + var isdapanel=false; + var isaapanel=false; + for (var index = 0 ; index < modulePanel.length; index++) { + var paneld = modulePanel[index].id; + if(paneld.match("daImagePanel")) + { + isdapanel=true; + } + else if(paneld.match("AAImagePanel")) + { + isaapanel=true; + } + } + + if(isdapanel && isaapanel) + { + $rootScope.SettingsTab = 2; + } + else if(isdapanel) + { + $rootScope.SettingsTab = 3; + } + else if(isaapanel) + { + $('#tabdissectible').attr('disabled', 'disabled'); + $rootScope.SettingsTab = 2; + } + + } + if ($("#annotationTollbar").css("display") == "block") { $('#modal-settings').css("display", "none"); $("#modelsettingsbackground").css("display", "none"); @@ -3954,7 +4364,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data $('#modal-settings').css("display", "block"); $("#modelsettingsbackground").css("display", "block"); } - + $rootScope.lexiconLanguageArrayLength = $rootScope.lexiconLanguageArray.length; $rootScope.lexiconPrimaryLanguage = $("#primarylaxican").val(); $rootScope.primaryLangID = $('#primarylaxican').attr("name"); @@ -4003,7 +4413,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data } if(paneld.match("ciImagePanel")) { - $rootScope.SetPaintZindexforCI(MultiWinId); + $rootScope.SetPaintZindexforCISummary(MultiWinId); } $scope.onDrawingCanvasOnModule(canvasElement); @@ -4076,7 +4486,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data } if(paneld.match("ciImagePanel")) { - $rootScope.SetPaintZindexforCI(MultiWinId); + $rootScope.SetPaintZindexforCISummary(MultiWinId); } @@ -4109,16 +4519,16 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data var paneld = modulePanel[index].id; if(paneld.match("daImagePanel")||paneld.match("AAImagePanel")||paneld.match("ciImagePanel")||paneld.match("aiImagePanel")||paneld.match("picImagePanel")) { + var len = (paneld).split("_").length; + var MultiWinId = (paneld).split("_")[len - 1]; $rootScope.switchCanvas(paneld); if(paneld.match("AAImagePanel")) - { - var len = (paneld).split("_").length; - var MultiWinId = (paneld).split("_")[len - 1]; + { $rootScope.switchToAnnotationCanvas(paneld,MultiWinId); } if(paneld.match("ciImagePanel")) { - $rootScope.SetPaintZindexforCI(MultiWinId); + $rootScope.SetPaintZindexforCISummary(MultiWinId); } // remove event listener @@ -4171,7 +4581,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data if(paneld.match("ciImagePanel")) { - $rootScope.SetPaintZindexforCI(MultiWinId); + $rootScope.SetPaintZindexforCISummary(MultiWinId); } $scope.onDrawingCanvasOnModule(canvasElement); @@ -4257,7 +4667,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data if(paneld.match("ciImagePanel")) { - $rootScope.SetPaintZindexforCI(MultiWinId); + $rootScope.SetPaintZindexforCISummary(MultiWinId); } // remove event listener $scope.removeOnDrawingCanvas(canvasElement); @@ -4294,7 +4704,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data $rootScope.switchCanvasToPaintCanvas(paneld); if(paneld.match("ciImagePanel")) { - $rootScope.SetPaintZindexforCI(MultiWinId); + $rootScope.SetPaintZindexforCISummary(MultiWinId); } $('#' + canvasPaintId).sketch(); @@ -4461,7 +4871,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data } if(paneld.match("ciImagePanel")) { - $rootScope.SetPaintZindexforCI(MultiWinId); + $rootScope.SetPaintZindexforCISummary(MultiWinId); } $scope.onDrawingCanvasOnModule(canvasElement); @@ -4511,7 +4921,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data } if(paneld.match("ciImagePanel")) { - $rootScope.SetPaintZindexforCI(MultiWinId); + $rootScope.SetPaintZindexforCISummary(MultiWinId); } $scope.onDrawingCanvasOnModule(canvasElement); @@ -4560,7 +4970,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data } if(paneld.match("ciImagePanel")) { - $rootScope.SetPaintZindexforCI(MultiWinId); + $rootScope.SetPaintZindexforCISummary(MultiWinId); } $scope.onDrawingCanvasOnModule(canvasElement); @@ -4608,7 +5018,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data } if(paneld.match("ciImagePanel")) { - $rootScope.SetPaintZindexforCI(MultiWinId); + $rootScope.SetPaintZindexforCISummary(MultiWinId); } $scope.onDrawingCanvasOnModule(canvasElement); @@ -4709,7 +5119,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data } if(paneld.match("ciImagePanel")) { - $rootScope.SetPaintZindexforCI(MultiWinId); + $rootScope.SetPaintZindexforCISummary(MultiWinId); } } } @@ -4911,6 +5321,61 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data //Edit Shape Style popup should open at it's default position $("#modeleditstyle").css({ "left": "40%", "right": "0", "top": "70px" }); } + + $rootScope.ResizeCBSavedAnnotation = function (paneld,canvasId,canvasPaintId,annotationData) { + var len = (paneld).split("_").length; + var MultiWinId = (paneld).split("_")[len - 1]; + + if(paneld.match("aiImagePanel")) + { + $rootScope.aiAnnotationToolEvent(MultiWinId); + } + else if(paneld.match("ciImagePanel")) + { + $rootScope.ciAnnotationToolEvent(MultiWinId); + } + else if(paneld.match("picImagePanel")) + { + $rootScope.picAnnotationToolEvent(MultiWinId); + } + + var shapeStates=annotationData.shapeStates; + var shapecount=shapeStates.length; + var paintCanvasState=annotationData.paintCanvasState; + + $timeout(function () { + + for(var shapeindx=0;shapeindx0) + { + //for paint brush + $rootScope.switchCanvasToPaintCanvas(paneld); + var drawingPoints=paintCanvasState + //auto save last cb paint + + $scope.PaintEraseEvent(); + $scope.savePaintAnnotation(canvasPaintId,drawingPoints); + $("#" + canvasPaintId).sketch({drawAction:drawingPoints}); + //clear sketch js event for paint and erase + $.sketch = { tools: {}}; + } + + $rootScope.CloseAnnotationTool(); + + }, 50); + + } $rootScope.LoadCBSavedAnnotation = function (canvasId,canvasPaintId,annotationData) { var modulePanel = $("#HomeContainerDiv").find("div[id*='ImagePanel']"); @@ -4945,43 +5410,45 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data } } - } - $timeout(function () { - var shapeStates=annotationData.shapeStates; - var paintCanvasState=annotationData.paintCanvasState; + var shapeStates=annotationData.shapeStates; + var shapecount=shapeStates.length; + var paintCanvasState=annotationData.paintCanvasState; + + $timeout(function () { + + for(var shapeindx=0;shapeindx0) + { + if (modulePanel != undefined && modulePanel.length>0) { + for (var index = 0 ; index < modulePanel.length; index++) { + var paneld = modulePanel[index].id; + if(paneld.match("daImagePanel")||paneld.match("AAImagePanel")||paneld.match("ciImagePanel")||paneld.match("aiImagePanel")||paneld.match("picImagePanel")) + { + //for paint brush + $rootScope.switchCanvasToPaintCanvas(paneld); - for(var shapeindx=0;shapeindx0) - { - if (modulePanel != undefined && modulePanel.length>0) { - for (var index = 0 ; index < modulePanel.length; index++) { - var paneld = modulePanel[index].id; - if(paneld.match("daImagePanel")||paneld.match("AAImagePanel")||paneld.match("ciImagePanel")||paneld.match("aiImagePanel")||paneld.match("picImagePanel")) - { - //for paint brush - $rootScope.switchCanvasToPaintCanvas(paneld); - + } } } + var drawingPoints=paintCanvasState ; + + //auto save last cb paint + $scope.PaintEraseEvent(); + $scope.savePaintAnnotation(canvasPaintId,drawingPoints); + $("#" + canvasPaintId).sketch({drawAction:drawingPoints}); + //clear sketch js event for paint and erase + $.sketch = { tools: {}}; } - var drawingPoints=paintCanvasState - //auto save last cb paint - $scope.PaintEraseEvent(); - $scope.savePaintAnnotation(canvasPaintId,drawingPoints); - $("#" + canvasPaintId).sketch({drawAction:drawingPoints}); - //clear sketch js event for paint and erase - $.sketch = { tools: {}}; - } - - $rootScope.CloseAnnotationTool(); - - }, 500); - + + $rootScope.CloseAnnotationTool(); + + }, 500); + } } $scope.savePaintAnnotation=function(canvasPaintId,drawingPoints) { @@ -5281,7 +5748,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data name: 'Line_' + LineNumber, layer: true, type: 'line', - draggable: true, + draggable: false, strokeStyle: shapestyleborderColor, strokeWidth: shapestyleborderWidth, rounded: true, @@ -5473,7 +5940,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data name: 'Rect_' + RectNumber, fillStyle: shapestyleFillColor, type: 'rectangle', - draggable: true, + draggable: false, strokeStyle: shapestyleborderColor, opacity: shapestyleOpacity, strokeWidth: shapestyleborderWidth, @@ -5688,7 +6155,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data name: 'Circle_' + CircleNumber, type: 'ellipse', opacity: shapestyleOpacity, - draggable: true, + draggable: false, strokeStyle: shapestyleborderColor, strokeWidth: shapestyleborderWidth, fillStyle: shapestyleFillColor, @@ -5895,7 +6362,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data layer: true, type:'Arrow', name: 'Arrow_' + ArrowNumber, - draggable: true, + draggable: false, strokeStyle: shapestyleborderColor, strokeWidth: shapestyleborderWidth, rounded: true, @@ -6091,8 +6558,8 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data }); $("#"+canvasId).drawLine({ panelCanvasId:canvasId, - draggable: true, layer: true, + draggable: false, type:'Pin', name: "Pin_" + PinNumber, groups: ["Pin_" + PinNumber], @@ -6111,6 +6578,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data mouseup: 'pointer' }, add: function (layer) { + layer.draggable = false; var drawingPoints={ "layerName": layer.name,//for internal use "shapeType":layer.type, @@ -6290,7 +6758,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data $("#" + layer.panelCanvasId).drawArc({ panelCanvasId:layer.panelCanvasId, layer: true, - draggable: true, + draggable: false, name: pinArcName, groups: [layer.groups], dragGroups: [layer.dragGroups], @@ -6413,10 +6881,10 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data } }, }).drawArc({ - draggable: true, panelCanvasId:canvasId, name: "ArcPin_" + PinNumber, layer: true, + draggable: false, groups: ["Pin_" + PinNumber], dragGroups: ["Pin_" + PinNumber], strokeStyle: 'grey', @@ -6829,7 +7297,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data groups: [rectDimension[0].groupName], dragGroups: [rectDimension[0].groupName], layer: true, - draggable: true, + draggable: false, type:'textArea', opacity: rectDimension[0].shapestyle.opacity, strokeStyle: rectDimension[0].shapestyle.color, @@ -6852,7 +7320,8 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data // Revert cursor on mouseup mouseup: 'pointer' }, - add: function (layer) { + add: function (layer) { + layer.draggable = false; var drawingPoints={ "layerName": layer.name,//for internal use "shapeType":layer.type, @@ -7337,7 +7806,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data }).drawText({ panelCanvasId:canvasId, layer: true, - draggable: true, + draggable: false, name: textDimension[0].name, groups: [rectDimension[0].groupName], dragGroups: [rectDimension[0].groupName], @@ -7361,7 +7830,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data mouseup: 'pointer' }, add: function (layer) { - layer.draggable = true; + layer.draggable = false; //remove temptext $("#" + canvasId).removeLayer('temptext').drawLayers(); }, @@ -8395,7 +8864,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data } else if(selectedPanel.match("AAImagePanel")) { - onSearchItemSelection($('#termList option[selected="selected"]').attr("id")); + onSearchItemSelection($('#termList option[selected="selected"]').attr("id"),true); } } @@ -8456,7 +8925,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data $("#langaugeDivLm").css("display", "none"); $rootScope.aalistManagerEvent(windowviewid); - $("#termList").attr("onclick", "if (typeof(this.selectedIndex) != 'undefined') onSearchItemSelection(this.options[this.selectedIndex].id)"); + $("#termList").attr("onclick", "if (typeof(this.selectedIndex) != 'undefined') onSearchItemSelection(this.options[this.selectedIndex].id,true)"); } var modulePanel = $("#HomeContainerDiv").find("div[id*='daImagePanel']"); if (modulePanel != undefined && modulePanel.length>0) { @@ -8525,6 +8994,11 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data { var windowviewid=selectedPanel.split('_')[1]; $rootScope.changeLanguageLmEvent(windowviewid); + } + else if(selectedPanel.match("AAImagePanel")) + { + var windowviewid=selectedPanel.split('_')[1]; + $rootScope.changeLanguageLmEventAA(windowviewid); } } @@ -8535,23 +9009,15 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data { var windowviewid=selectedPanel.split('_')[1]; $rootScope.LoadMoreLmEvent(windowviewid); - } - } - - - function fillListManagerTerms() { - - var len = $rootScope.openModules.length; - var openViewLen = $rootScope.openViews.length; - - var currentOpenModuleId = $rootScope.openModules[len - 1].ModuleId; - var currentOpenViewId = $rootScope.openViews[openViewLen - 1].BodyViewId; - if (currentOpenModuleId == 1) { - } - + else if(selectedPanel.match("AAImagePanel")) + { + var windowviewid=selectedPanel.split('_')[1]; + $rootScope.LoadMoreLmEventAA(windowviewid); + } } + //setrtings $rootScope.SetSettingActiveTab = function (tabToSet) { $rootScope.SettingsTab = tabToSet; @@ -8604,6 +9070,9 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data //4. $rootScope.setEthncitySettings($rootScope.globalSetting.ethnicity); + //disable appreance tab still no use of it + $('#tabappearance').attr('disabled', 'disabled'); + }; @@ -8880,7 +9349,8 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data isReloadingViewRequired = true; } - else if (setting.modesty != null && setting.modesty != $rootScope.globalSetting.modesty) { + else + { $rootScope.globalSetting.modesty = setting.modesty; localStorage.setItem("globalModesty", $rootScope.globalSetting.modesty); @@ -8895,6 +9365,8 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data { var len = (paneld).split("_").length; var MultiWinId = (paneld).split("_")[len - 1]; + var ModestyValue= $rootScope.GetDAwindowData(MultiWinId, 'ModestyValue'); + if (setting.modesty != null && setting.modesty != ModestyValue) { if ($('.modestyImg_' + MultiWinId) != null) { if (($rootScope.globalSetting.modesty == 'Y')) { @@ -8937,8 +9409,8 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data else { $('.transModestyImg_' + MultiWinId).css('visibility', 'hidden'); } - $rootScope.changeNavigatorModesty(MultiWinId); - + $rootScope.changeNavigatorModesty(MultiWinId); + } } } } @@ -8971,6 +9443,12 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data var currentOpenViewId=$rootScope.GetDAwindowData(MultiWinId,"voId"); $rootScope.reloadDABodyViewEvent(currentOpenViewId,isLexiconChange,MultiWinId); } + if(paneld.match("AAImagePanel")) + { + var len = (paneld).split("_").length; + var MultiWinId = (paneld).split("_")[len - 1]; + $rootScope.reloadAABodyViewEvent(isLexiconChange,MultiWinId); + } } } }; @@ -9562,7 +10040,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data $("#HomeContainerDiv").css({ "display": "block", "pointer-events": "auto", "opacity": "1" }); $('#dvOpenResourcePanel').remove(); - sessionStorage.removeItem('isModuleOpenByOpenResource'); + sessionStorage.removeItem('isModuleOpenByOpenResource'); $("#jsPanel-min-container").removeAttr("style"); if (document.location.pathname == "/curriculum-builder-detail") { if($('div.CBLeft-Sidebar').hasClass('active')) @@ -9999,7 +10477,7 @@ function closeIFrame() { } function AIAModuleOpenResourceInfo(windowData) { - sessionStorage.removeItem('isModuleOpenByOpenResource'); + sessionStorage.removeItem('isModuleOpenByOpenResource'); window.parent.closeIFrame(); $("#jsPanel-min-container").removeAttr("style"); diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/LabExercController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/LabExercController.js index 88aee81..ea1b814 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/LabExercController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/LabExercController.js @@ -103,14 +103,15 @@ function ($scope, $rootScope, pages, log, $http, $timeout, DataService, $filter, } } - $scope.DisableUI = function () { - - var leImagePanelConetent = document.getElementsByClassName("jsPanel-content"); - for (var i = 0; i < leImagePanelConetent.length; i++) { - leImagePanelConetent[i].style.pointerEvents = "none"; - leImagePanelConetent[i].style.opacity = "0.7"; + $scope.DisableLabUI = function (windowviewid) { + var modulePanel = $("#labImagePanel_"+windowviewid).find(" .jsPanel-content"); + if(modulePanel.length>0) + { + modulePanel[0].style.pointerEvents="none"; + modulePanel[0].style.opacity="0.7"; } + $rootScope.isLoading = true; $('#spinner').css('visibility', 'visible'); @@ -119,12 +120,12 @@ function ($scope, $rootScope, pages, log, $http, $timeout, DataService, $filter, $('#HomeContainerDiv').css('opacity', '0.7'); } - $scope.EnableUI = function () { - - var leImagePanelConetent = document.getElementsByClassName("jsPanel-content"); - for (var i = 0; i < leImagePanelConetent.length; i++) { - leImagePanelConetent[i].style.pointerEvents = "auto"; - leImagePanelConetent[i].style.opacity = "1"; + $scope.EnableLabUI = function (windowviewid) { + var modulePanel = $("#labImagePanel_"+windowviewid).find(" .jsPanel-content"); + if(modulePanel.length>0) + { + modulePanel[0].style.pointerEvents="auto"; + modulePanel[0].style.opacity="1"; } $rootScope.isLoading = false; @@ -167,7 +168,7 @@ function ($scope, $rootScope, pages, log, $http, $timeout, DataService, $filter, $scope.initializeLEWindowData($rootScope.MULTI_VIEW_ID, true, undefined); - $scope.DisableUI(); + $scope.DisableLabUI($rootScope.MULTI_VIEW_ID); //get current path var currentURL = $location.path(); @@ -204,10 +205,10 @@ function ($scope, $rootScope, pages, log, $http, $timeout, DataService, $filter, function (result) { $scope.LabExerciseModulesList = result; $scope.SetLEwindowStoreData(windowviewid, 'LabExerciseModulesList', result); - $scope.EnableUI(); + $scope.EnableLabUI(windowviewid); }, function (error) { - $scope.EnableUI(); + $scope.EnableLabUI(windowviewid); console.log(error.statusText) } ) @@ -255,7 +256,7 @@ function ($scope, $rootScope, pages, log, $http, $timeout, DataService, $filter, if ($rootScope.isCallFromOtherModule) { $scope.LEModuleData = ModuleService.getModuleData("LAB_EXERCISE"); if($scope.LEModuleData.length<1) return; - $scope.DisableUI(); + $scope.DisableLabUI(); $scope.readyToLoad = true; $rootScope.LEWindowLoadComplete = false; $scope.wincount = 1; @@ -293,7 +294,7 @@ function ($scope, $rootScope, pages, log, $http, $timeout, DataService, $filter, } else { - $scope.DisableUI(); + $scope.DisableLabUI(); $scope.InitializeLabExercise(null); } } @@ -428,9 +429,10 @@ function ($scope, $rootScope, pages, log, $http, $timeout, DataService, $filter, } $scope.SetLEwindowStoreData(windowviewid, 'maximised',true); $scope.SetLEwindowStoreData(windowviewid, 'minimised',false); - var canvasDIvHeight = parseInt($('#labImagePanel_' + windowviewid).outerHeight()) - 15; - $('#LabView_' + windowviewid).css('height', canvasDIvHeight); - $('#panelbodyDiv_' + windowviewid).css("height",canvasDIvHeight-125); + var canvasDIvHeight = $('#labImagePanel_' + windowviewid+ " .jsPanel-content").height(); + $('#panelbodyDiv_' + windowviewid).css("height",canvasDIvHeight-100); + $('#resultbodyDiv_' + windowviewid).css("height",canvasDIvHeight-90); + $rootScope.resetMenuOptionOnClick(pnlName); }, onnormalized:function (panel) { @@ -444,24 +446,27 @@ function ($scope, $rootScope, pages, log, $http, $timeout, DataService, $filter, } $scope.SetLEwindowStoreData(windowviewid, 'minimised',false); $scope.SetLEwindowStoreData(windowviewid, 'maximised',false); - var canvasDIvHeight = parseInt($('#labImagePanel_' + windowviewid).outerHeight()) - 15; - $('#LabView_' + windowviewid).css('height', canvasDIvHeight); - $('#panelbodyDiv_' + windowviewid).css("height",canvasDIvHeight-125); + var canvasDIvHeight = $('#labImagePanel_' + windowviewid+ " .jsPanel-content").height(); + $('#panelbodyDiv_' + windowviewid).css("height",canvasDIvHeight-100); + $('#resultbodyDiv_' + windowviewid).css("height",canvasDIvHeight-90); $rootScope.resetMenuOptionOnClick(pnlName); }, resizable: { + minWidth: 600, + minHeight: 500, stop: function (event, ui) { var pnlName=event.currentTarget.id; var len = (pnlName).split("_").length; var windowviewid = (pnlName).split("_")[len - 1]; + var canvasDIvHeight = $('#labImagePanel_' + windowviewid+ " .jsPanel-content").height(); $scope.SetLEwindowStoreData(windowviewid, 'width', ui.size.width); - $scope.SetLEwindowStoreData(windowviewid, 'height', ui.size.height); + $scope.SetLEwindowStoreData(windowviewid, 'height', canvasDIvHeight); $scope.SetLEwindowStoreData(windowviewid, 'y', ui.position.top); $scope.SetLEwindowStoreData(windowviewid, 'x', ui.position.left); $rootScope.UnsaveCurriculum = true; - var canvasDIvHeight = parseInt($('#labImagePanel_' + windowviewid).outerHeight()) - 15; - $('#LabView_' + windowviewid).css('height', canvasDIvHeight); - $('#panelbodyDiv_' + windowviewid).css("height",canvasDIvHeight-125); + + $('#panelbodyDiv_' + windowviewid).css("height",canvasDIvHeight-100); + $('#resultbodyDiv_' + windowviewid).css("height",canvasDIvHeight-90); $rootScope.resetMenuOptionOnClick(pnlName); } @@ -503,9 +508,18 @@ function ($scope, $rootScope, pages, log, $http, $timeout, DataService, $filter, // set false after initial call of min,max or normal $scope.SetLEwindowStoreData(windowviewid, 'minmaxAutoEvent', false); $scope.SetLEwindowStoreData(windowviewid, 'y', $scope.jsPanelTop); - $scope.SetLEwindowStoreData(windowviewid, 'x', $scope.jsPanelLeft); + $scope.SetLEwindowStoreData(windowviewid, 'x', $scope.jsPanelLeft) $scope.SetLEwindowStoreData(windowviewid, 'width', $scope.jsPanelWidth); $scope.SetLEwindowStoreData(windowviewid, 'height', $scope.jsPanelHeight); + + $scope.setControlsIDs(windowviewid); + $scope.createScopeVariable(windowviewid); + + $scope.labViewID = "LabView_" + windowviewid; + var labViewElement = angular.element(document.getElementById($scope.labViewID)); + + $compile(labViewElement.contents())($scope); + var labExerciseInfo = { userId: userloginid, @@ -514,52 +528,34 @@ function ($scope, $rootScope, pages, log, $http, $timeout, DataService, $filter, LabExerciseService.GetLabExercise(labExerciseInfo) .then( function (labResult) { - $scope.setControlsIDs(windowviewid); - $scope.createScopeVariable(windowviewid); - - $scope.labViewID = "LabView_" + windowviewid; - var labViewElement = angular.element(document.getElementById($scope.labViewID)); - - $compile(labViewElement.contents())($scope); - - if ($rootScope.isCallFromOtherModule) { - var canvasDIvHeight = parseInt($('#labImagePanel_' + windowviewid).outerHeight()) - 30; - } - else - { - var canvasDIvHeight = parseInt($('#labImagePanel_' + windowviewid).outerHeight())-15; - - $('#labBodyview').css("height", $(window).outerHeight() - 65); - - $('#labBodyview').css("width", $(window).outerWidth() - 15); - - } - - $('#LabView_' + windowviewid).css('height', canvasDIvHeight); - - $('#panelbodyDiv_' + windowviewid).css("height",canvasDIvHeight-125); - - - $scope.JsPanelclick(windowviewid); + + $timeout(function () { + var canvasDIvHeight = $('#labImagePanel_' + windowviewid+ " .jsPanel-content").height(); + $('#panelbodyDiv_' + windowviewid).css("height",canvasDIvHeight-100); + $('#resultbodyDiv_' + windowviewid).css("height",canvasDIvHeight-90); + $scope.JsPanelclick(windowviewid); - if (labResult != undefined && labResult.lastQuestion > 0 && labResult != AIAConstants.SAVED_LAB_EXERCISE_NOT_FOUND) { - - $scope.SetLEwindowStoreData(windowviewid, 'SavedLabExercise', labResult); + if (labResult != undefined && labResult.lastQuestion > 0 && labResult != AIAConstants.SAVED_LAB_EXERCISE_NOT_FOUND) { + + $scope.SetLEwindowStoreData(windowviewid, 'SavedLabExercise', labResult); + + $('#quizNo_' + windowviewid).text(labResult.lastQuestion); + $scope.SetLEwindowStoreData(windowviewid, 'quiznumber', labResult.lastQuestion); + // $scope.initialQuestioNo = labResult.lastQuestion; + $scope.SetLEwindowStoreData(windowviewid, 'initialQuestioNo', labResult.lastQuestion); + $scope.GetQuizByTopic(windowviewid); + } + else { + $scope.GetQuizByTopic(windowviewid); + } + $scope.DisableLabUI(windowviewid); - $('#quizNo_' + windowviewid).text(labResult.lastQuestion); - $scope.SetLEwindowStoreData(windowviewid, 'quiznumber', labResult.lastQuestion); - // $scope.initialQuestioNo = labResult.lastQuestion; - $scope.SetLEwindowStoreData(windowviewid, 'initialQuestioNo', labResult.lastQuestion); - $scope.GetQuizByTopic(windowviewid); - } - else { - $scope.GetQuizByTopic(windowviewid); - } - $scope.DisableUI(); + },300) }, function (error) { console.log('error in getting save ddata'); + $scope.DisableLabUI(windowviewid); } ) @@ -636,6 +632,8 @@ function ($scope, $rootScope, pages, log, $http, $timeout, DataService, $filter, $("#btnReportClose").attr("id", "btnReportClose_" + windowviewid); $("#panelbodyDiv").attr("id", "panelbodyDiv_" + windowviewid); + $("#resultbodyDiv").attr("id", "resultbodyDiv_" + windowviewid); + $("#LabExPageHeading").attr("id", "LabExPageHeading_" + windowviewid); $("#minlab").attr("id", "minlab_" + windowviewid); $("#minlabicon").attr("id", "minlabicon_" + windowviewid); @@ -708,7 +706,7 @@ function ($scope, $rootScope, pages, log, $http, $timeout, DataService, $filter, $scope.GetQuizByTopic = function (windowviewid) { - $scope.DisableUI(); + $scope.DisableLabUI(windowviewid); $('.jsPanel-content').css('font-size', '14px'); @@ -853,7 +851,7 @@ function ($scope, $rootScope, pages, log, $http, $timeout, DataService, $filter, $scope.SetLEwindowStoreData(windowviewid, 'isResetClicked', false); } } - $scope.EnableUI(); + $scope.EnableLabUI(windowviewid); if ($rootScope.isCallFromOtherModule) { $rootScope.LEWindowLoadComplete = true; } @@ -1580,7 +1578,7 @@ function ($scope, $rootScope, pages, log, $http, $timeout, DataService, $filter, $rootScope.UnsaveCurriculum = true; } - $scope.DisableUI(); + $scope.DisableLabUI(windowviewid); var quiznumber = $scope.GetLEwindowStoreData(windowviewid, 'quiznumber'); $scope.CreateLabExerciseDataToSave(windowviewid, quiznumber); @@ -1603,7 +1601,7 @@ function ($scope, $rootScope, pages, log, $http, $timeout, DataService, $filter, LabExerciseService.saveLabExerciseAttempt(labExerciseAttempt) .then( function (result) { - $scope.EnableUI(); + $scope.EnableLabUI(windowviewid); $scope.SetLEwindowStoreData(windowviewid, 'isLabExChanged', false); //saved successfully.variable name is not correct but errorMessage represnts message if (!$rootScope.isCallFromOtherModule) { @@ -1614,9 +1612,7 @@ function ($scope, $rootScope, pages, log, $http, $timeout, DataService, $filter, }, function (error) { - - $scope.EnableUI(); - + $scope.EnableLabUI(windowviewid); console.log(' Error in saving lab exercise = ' + error.statusText); $rootScope.isVisibleLogin = true; $('#errorMessage').text(error); @@ -2100,7 +2096,7 @@ function ($scope, $rootScope, pages, log, $http, $timeout, DataService, $filter, else { $("#imgdiv_" + windowviewid).css("position", "relative"); } - $scope.EnableUI(); + $scope.EnableLabUI(windowviewid); }, 500); } @@ -2123,7 +2119,7 @@ function ($scope, $rootScope, pages, log, $http, $timeout, DataService, $filter, $("#quizSubmitBtn_" + windowviewid).css("display", "none"); } - $scope.EnableUI(); + $scope.EnableLabUI(windowviewid); } $scope.SendLabEXMailToUser = function ($event) { diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/MyAnimationController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/MyAnimationController.js index d781155..9df39d6 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/MyAnimationController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/MyAnimationController.js @@ -80,13 +80,12 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout } } - $scope.DisableUI = function () { - - var aniImagePanelConetent = document.getElementsByClassName("jsPanel-content"); - for (var i = 0; i < aniImagePanelConetent.length; i++) { - aniImagePanelConetent[i].style.pointerEvents = "none"; - aniImagePanelConetent[i].style.opacity = "0.7"; - + $scope.DisableVideoUI = function (windowviewid) { + var modulePanel = $("#vidImagePanel_"+windowviewid).find(" .jsPanel-content"); + if(modulePanel.length>0) + { + modulePanel[0].style.pointerEvents="none"; + modulePanel[0].style.opacity="0.7"; } $rootScope.isLoading = true; $('#spinner').css('visibility', 'visible'); @@ -96,12 +95,12 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout $('#HomeContainerDiv').css('opacity', '0.7'); } - $scope.EnableUI = function () { - - var aniImagePanelConetent = document.getElementsByClassName("jsPanel-content"); - for (var i = 0; i < aniImagePanelConetent.length; i++) { - aniImagePanelConetent[i].style.pointerEvents = "auto"; - aniImagePanelConetent[i].style.opacity = "1"; + $scope.EnableVideoUI = function (windowviewid) { + var modulePanel = $("#vidImagePanel_"+windowviewid).find(" .jsPanel-content"); + if(modulePanel.length>0) + { + modulePanel[0].style.pointerEvents="auto"; + modulePanel[0].style.opacity="1"; } $rootScope.isLoading = false; @@ -159,7 +158,6 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout if ($rootScope.isCallFromOtherModule) { $scope.VideoModuleData = ModuleService.getModuleData("MY_ANIMATIONS"); if($scope.VideoModuleData.length<1) return; - $scope.DisableUI(); $scope.readyToLoad = true; $rootScope.VideoLoadComplete = false; $scope.wincount = 1; @@ -203,6 +201,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout $scope.VidOpenInOtherModules = vidModuleData; $rootScope.MULTI_VIEW_ID += 1; var windowviewid = $rootScope.MULTI_VIEW_ID; + $scope.DisableVideoUI(windowviewid); $scope.initializeVideoWindowData(windowviewid, false, $scope.VidOpenInOtherModules.currentWindowId); @@ -244,7 +243,6 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout } $scope.loadMyAnimation = function (windowviewid) { - $scope.DisableUI(); $scope.jsPanelID = 'vidImagePanel' + '_' + windowviewid; var tittle = $scope.GetVideowindowStoreData(windowviewid, 'currentViewTitle'); var animationSource = $scope.GetVideowindowStoreData(windowviewid, 'videoSource'); @@ -372,16 +370,19 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout $rootScope.resetMenuOptionOnClick(pnlName); }, resizable: { + minWidth: 600, + minHeight: 500, stop: function (event, ui) { var pnlName=event.currentTarget.id; var len = (pnlName).split("_").length; var windowviewid = (pnlName).split("_")[len - 1]; + var canvasDIvHeight = $('#vidImagePanel_' + windowviewid+ " .jsPanel-content").height(); $scope.SetVideowindowStoreData(windowviewid, 'width', ui.size.width); - $scope.SetVideowindowStoreData(windowviewid, 'height', ui.size.height); + $scope.SetVideowindowStoreData(windowviewid, 'height', canvasDIvHeight); $scope.SetVideowindowStoreData(windowviewid, 'y', ui.position.top); $scope.SetVideowindowStoreData(windowviewid, 'x', ui.position.left); $rootScope.UnsaveCurriculum = true; - var canvasDIvHeight = $('#vidImagePanel_' + windowviewid+ " .jsPanel-content").height(); + $('#playerinlineVideo_'+ windowviewid ).css("height",canvasDIvHeight); $rootScope.resetMenuOptionOnClick(pnlName); } @@ -434,23 +435,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout }); var canvasDIvHeight = $('#vidImagePanel_' + windowviewid+ " .jsPanel-content").height(); - $('#playerinlineVideo_'+ windowviewid ).css("height",canvasDIvHeight); - - var videoHeight = $('#divplayerinlineVideo_'+ windowviewid +' div').height(); - if (videoHeight <= 0) - videoHeight = 360; - var textH = $('.video-subtitle').height(); - textH = textH + 40; - var blackBorderHeight = canvasDIvHeight - (videoHeight + textH); - - if ($('.jsPanel-content').length > 0) { - $('.video-subtitle').css('margin-bottom', blackBorderHeight); - $('#divplayerinlineVideo_'+ windowviewid ).css('background', '#fff'); - //Android > Clinical Animations > The animation does not fit to the screen in the Landscape mode. - var $ua = navigator.userAgent; - if (($ua.match(/(iPod|iPhone|iPad|android)/i))) { $('.jsPanel-content').css("width", "100%"); } - } - + $('#playerinlineVideo_'+ windowviewid ).css("height",canvasDIvHeight); } //Calling methode for save Js Panel Activity for SaveCB @@ -459,11 +444,13 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout $scope.MyvideoOnLoad = function (windowviewid) { - $scope.EnableUI(); - if ($rootScope.isCallFromOtherModule) { - $rootScope.VideoLoadComplete = true; - } - $scope.JsPanelclick(windowviewid); + + if ($rootScope.isCallFromOtherModule) { + $rootScope.VideoLoadComplete = true; + } + $scope.JsPanelclick(windowviewid); + + $scope.EnableVideoUI(windowviewid); } diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/MyPictureController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/MyPictureController.js index 1c8b547..92faff6 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/MyPictureController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/MyPictureController.js @@ -21,6 +21,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout 'maximised': false, 'minmaxAutoEvent':true, 'annotationData':{shapeStates:[],paintCanvasState:[]}, + 'imgLeft': 0, }; return windata; @@ -93,14 +94,15 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout } } - $scope.DisableUI = function () { - - var myImagePanelConetent = document.getElementsByClassName("jsPanel-content"); - for (var i = 0; i < myImagePanelConetent.length; i++) { - myImagePanelConetent[i].style.pointerEvents = "none"; - myImagePanelConetent[i].style.opacity = "0.7"; + $scope.DisablePicUI = function (windowviewid) { + var modulePanel = $("#picImagePanel_"+windowviewid).find(" .jsPanel-content"); + if(modulePanel.length>0) + { + modulePanel[0].style.pointerEvents="none"; + modulePanel[0].style.opacity="0.7"; } + $rootScope.isLoading = true; $('#spinner').css('visibility', 'visible'); @@ -109,14 +111,14 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout $('#CBDetailPageDiv').css('opacity', '0.7'); } - $scope.EnableUI = function () { + $scope.EnablePicUI = function (windowviewid) { - var myImagePanelConetent = document.getElementsByClassName("jsPanel-content"); - for (var i = 0; i < myImagePanelConetent.length; i++) { - myImagePanelConetent[i].style.pointerEvents = "auto"; - myImagePanelConetent[i].style.opacity = "1"; + var modulePanel = $("#picImagePanel_"+windowviewid).find(" .jsPanel-content"); + if(modulePanel.length>0) + { + modulePanel[0].style.pointerEvents="auto"; + modulePanel[0].style.opacity="1"; } - $rootScope.isLoading = false; $('#spinner').css('visibility', 'hidden'); // CB module enable all @@ -163,7 +165,6 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout if ($rootScope.isCallFromOtherModule) { $scope.PicModuleData = ModuleService.getModuleData("MY_PICTURES"); if($scope.PicModuleData.length<1) return; - $scope.DisableUI(); $scope.readyToLoad = true; $rootScope.PicLoadComplete = false; $scope.wincount = 1; @@ -204,10 +205,10 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout } $scope.OpenPictureView = function (picModuleData) { - $scope.picOpenInOtherModules = picModuleData; $rootScope.MULTI_VIEW_ID += 1; var windowviewid = $rootScope.MULTI_VIEW_ID; + $scope.DisablePicUI(windowviewid); $scope.initializePICWindowData(windowviewid, false, $scope.picOpenInOtherModules.currentWindowId); @@ -217,6 +218,8 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout var imageId = $scope.picOpenInOtherModules.id; $scope.SetPICwindowStoreData(windowviewid, 'imageId', imageId); + var imgLeft = $scope.picOpenInOtherModules.imgLeft!=undefined?$scope.picOpenInOtherModules.imgLeft:0; + $scope.SetPICwindowStoreData(windowviewid, 'imgLeft', imgLeft); var imageSource=$scope.picOpenInOtherModules.imageSource; @@ -315,45 +318,81 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout var pnlName=panel[0].id; var len = (pnlName).split("_").length; var windowviewid = (pnlName).split("_")[len - 1]; - var isAutoCalled = $scope.GetPICwindowStoreData(windowviewid, 'minmaxAutoEvent'); - if(!isAutoCalled) - { - $rootScope.UnsaveCurriculum = true; - } + $scope.SetPICwindowStoreData(windowviewid, 'maximised',true); $scope.SetPICwindowStoreData(windowviewid, 'minimised',false); - var canvasDIvHeight = $('#picImagePanel_' + windowviewid+ " .jsPanel-content").height(); - $('#canvasDivPIC_' + windowviewid).css('height', canvasDIvHeight-5); - $rootScope.resetMenuOptionOnClick(pnlName); + var canvasDIvHeight = $('#picImagePanel_' + windowviewid+ " .jsPanel-content").height()-5; + var canvasDIvWidth = $('#picImagePanel_' + windowviewid+ " .jsPanel-content").width(); + var canvasDiv='canvasDivPIC_' + windowviewid; + var canvasDraw='canvasPIC_' + windowviewid; + var canvasPaint='canvasPaintPIC_' + windowviewid; + var imgName='mypic_' + windowviewid; + var isAutoCalled = $scope.GetPICwindowStoreData(windowviewid, 'minmaxAutoEvent'); + if(!isAutoCalled) + { + $rootScope.UnsaveCurriculum = true; + var oldleft= $rootScope.GetPICwindowData(windowviewid, 'imgLeft'); + var annotationData=$rootScope.GetPICwindowData(windowviewid,'annotationData'); + $rootScope.setIMGPanelCordinate(windowviewid,pnlName,canvasDiv,canvasDraw,canvasPaint,imgName,oldleft,canvasDIvHeight,canvasDIvWidth,annotationData); + var img = document.getElementById(imgName); + $rootScope.SetPICwindowData(windowviewid, 'imgLeft',img.offsetLeft); + } + }, onnormalized:function (panel) { var pnlName=panel[0].id; var len = (pnlName).split("_").length; var windowviewid = (pnlName).split("_")[len - 1]; - var isAutoCalled = $scope.GetPICwindowStoreData(windowviewid, 'minmaxAutoEvent'); - if(!isAutoCalled) - { - $rootScope.UnsaveCurriculum = true; - } + $scope.SetPICwindowStoreData(windowviewid, 'minimised',false); $scope.SetPICwindowStoreData(windowviewid, 'maximised',false); - var canvasDIvHeight = $('#picImagePanel_' + windowviewid+ " .jsPanel-content").height(); - $('#canvasDivPIC_' + windowviewid).css('height', canvasDIvHeight-5); - $rootScope.resetMenuOptionOnClick(pnlName); + var canvasDIvHeight = $('#picImagePanel_' + windowviewid+ " .jsPanel-content").height()-5; + var canvasDIvWidth = $('#picImagePanel_' + windowviewid+ " .jsPanel-content").width(); + var canvasDiv='canvasDivPIC_' + windowviewid; + var canvasDraw='canvasPIC_' + windowviewid; + var canvasPaint='canvasPaintPIC_' + windowviewid; + var imgName='mypic_' + windowviewid; + + var isAutoCalled = $scope.GetPICwindowStoreData(windowviewid, 'minmaxAutoEvent'); + if(!isAutoCalled) + { + $rootScope.UnsaveCurriculum = true; + var oldleft= $rootScope.GetPICwindowData(windowviewid, 'imgLeft'); + var annotationData=$rootScope.GetPICwindowData(windowviewid,'annotationData'); + $rootScope.setIMGPanelCordinate(windowviewid,pnlName,canvasDiv,canvasDraw,canvasPaint,imgName,oldleft,canvasDIvHeight,canvasDIvWidth,annotationData); + var img = document.getElementById(imgName); + $rootScope.SetPICwindowData(windowviewid, 'imgLeft',img.offsetLeft); + } }, resizable: { + minWidth: 600, + minHeight: 500, stop: function (event, ui) { var pnlName=event.currentTarget.id; var len = (pnlName).split("_").length; var windowviewid = (pnlName).split("_")[len - 1]; + $rootScope.UnsaveCurriculum = true; + + var canvasDIvHeight = $('#picImagePanel_' + windowviewid+ " .jsPanel-content").height(); + var canvasDIvWidth = $('#picImagePanel_' + windowviewid+ " .jsPanel-content").width(); + $scope.SetPICwindowStoreData(windowviewid, 'width', ui.size.width); - $scope.SetPICwindowStoreData(windowviewid, 'height', ui.size.height); + $scope.SetPICwindowStoreData(windowviewid, 'height',canvasDIvHeight); $scope.SetPICwindowStoreData(windowviewid, 'y', ui.position.top); $scope.SetPICwindowStoreData(windowviewid, 'x', ui.position.left); - $rootScope.UnsaveCurriculum = true; - var canvasDIvHeight = $('#picImagePanel_' + windowviewid+ " .jsPanel-content").height(); - $('#canvasDivPIC_' + windowviewid).css('height', canvasDIvHeight-5); - $rootScope.resetMenuOptionOnClick(pnlName); + + + var canvasDiv='canvasDivPIC_' + windowviewid; + var canvasDraw='canvasPIC_' + windowviewid; + var canvasPaint='canvasPaintPIC_' + windowviewid; + var imgName='mypic_' + windowviewid; + + var oldleft= $rootScope.GetPICwindowData(windowviewid, 'imgLeft'); + var annotationData=$rootScope.GetPICwindowData(windowviewid,'annotationData'); + $rootScope.setIMGPanelCordinate(windowviewid,pnlName,canvasDiv,canvasDraw,canvasPaint,imgName,oldleft,canvasDIvHeight-5,canvasDIvWidth,annotationData); + var img = document.getElementById(imgName); + $rootScope.SetPICwindowData(windowviewid, 'imgLeft',img.offsetLeft); + } }, @@ -397,50 +436,45 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout $('.jsPanel-content .jsPanel-theme-success').css('overflow-y', 'auto !important') - var canvasDIvHeight = $('#picImagePanel_' + windowviewid+ " .jsPanel-content").height(); + var canvasDIvHeight = $('#picImagePanel_' + windowviewid+ " .jsPanel-content").height()-5; + var canvasDIvWidth = $('#picImagePanel_' + windowviewid+ " .jsPanel-content").width(); - $('#canvasDivPIC_' + windowviewid).css('height', canvasDIvHeight-5); - var canvas = document.getElementById("canvasPIC_" + windowviewid); - var canvasPaint = document.getElementById("canvasPaintPIC_" + windowviewid); - - var $ua = navigator.userAgent; - if (($ua.match(/(iPod|iPhone|iPad|android)/i))) { - canvas.width = screen.width-20; - canvasPaint.width = screen.width-20; - canvas.height = screen.height-130; - canvasPaint.height = screen.height-130; - } - else - { - canvas.height = screen.height-280; - canvasPaint.height = screen.height-280; - canvas.width = screen.width-40; - canvasPaint.width = screen.width-40; - - } - var openedImage = document.getElementById('mypic_' + windowviewid ); openedImage.src = selectedpicture; openedImage.onload = function () { + var pnlName='picImagePanel_' + windowviewid; + var canvasDiv='canvasDivPIC_' + windowviewid; + var canvasDraw='canvasPIC_' + windowviewid; + var canvasPaint='canvasPaintPIC_' + windowviewid; + var imgName='mypic_' + windowviewid; + + var demoData= {shapeStates:[],paintCanvasState:""}; + var oldleft= $rootScope.GetPICwindowData(windowviewid, 'imgLeft'); + $rootScope.setIMGPanelCordinate(windowviewid,pnlName,canvasDiv,canvasDraw,canvasPaint,imgName,oldleft,canvasDIvHeight,canvasDIvWidth,demoData); + var img = document.getElementById(imgName); + $rootScope.SetPICwindowData(windowviewid, 'imgLeft',img.offsetLeft); + $scope.JsPanelclick(windowviewid); - //some time get big size image - if(this.height>780) - { - canvas.height = this.height; - canvasPaint.height = this.height; - } - + var annotationData= $scope.picOpenInOtherModules.annotationData; // load annotation if(annotationData!="" && annotationData!=undefined) { if(annotationData.shapeStates.length>0||annotationData.paintCanvasState.length>0) { + var modifiedData=$rootScope.resetAnnotationData(imgName,oldleft,annotationData); + if(modifiedData!="" && modifiedData!=undefined) + { + if(modifiedData.shapeStates.length>0||modifiedData.paintCanvasState.length>0) + { + annotationData=modifiedData; + } + } //first draw shape and then store in object - $rootScope.LoadCBSavedAnnotation("canvasPIC_"+windowviewid,"canvasPaintPIC_"+windowviewid,annotationData); + $rootScope.LoadCBSavedAnnotation(canvasDraw,canvasPaint,annotationData); } } - $scope.EnableUI(); + $scope.EnablePicUI(windowviewid); $rootScope.PicLoadComplete = true; } diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js index b03a88e..037f268 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js @@ -1,7 +1,7 @@ 'use strict'; -AIA.controller("TileViewListController", ["$scope", "$window", "$rootScope", "$compile", "$http", "$log", "$location", "$timeout", "DA", "Modules", "$routeParams", "BodyRegions", "BodySystems", "ViewOrientations", "ImageTypes", "DataService", "ModuleService","$interval", -function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeout, DA, Modules, $routeParam, BodyRegions, BodySystems, ViewOrientations, ImageTypes, DataService, ModuleService, $interval) { +AIA.controller("TileViewListController", ["$scope", "$window", "$rootScope", "$compile", "$http", "$log", "$location", "$timeout", "DA", "Modules", "$routeParams", "BodyRegions", "BodySystems", "ViewOrientations", "ImageTypes", "DataService", "ModuleService","$interval","$filter", +function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeout, DA, Modules, $routeParam, BodyRegions, BodySystems, ViewOrientations, ImageTypes, DataService, ModuleService, $interval, $filter) { $scope.AllBodyRegion = []; $scope.AllBodySystem = []; @@ -105,6 +105,11 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou 'navigatorImage':"", 'showHideAnnotations': 'showAnnotationText', 'annotationData':{shapeStates:[],paintCanvasState:[]}, + 'totalstructure': 0, + 'totalstructureLm': 0, + 'intervalObject': null, + 'SearchTimeStampValue': 0, + 'keyctrl': false, }; return windata; @@ -182,30 +187,33 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou } } - $scope.DisableUI = function () { - - var daImagePanelConetent = document.getElementsByClassName("jsPanel-content"); - for (var i = 0; i < daImagePanelConetent.length; i++) { - daImagePanelConetent[i].style.pointerEvents = "none"; - daImagePanelConetent[i].style.opacity = "0.7"; + $scope.DisableAAUI = function (windowviewid) { + var modulePanel = $("#AAImagePanel_"+windowviewid).find(" .jsPanel-content"); + if(modulePanel.length>0) + { + modulePanel[0].style.pointerEvents="none"; + modulePanel[0].style.opacity="0.7"; } + $rootScope.isLoading = true; $('#spinner').css('visibility', 'visible'); // CB module disable all $('#HomeContainerDiv').css('pointer-events', 'none'); $('#HomeContainerDiv').css('opacity', '0.7'); + } - $scope.EnableUI = function () { + $scope.EnableAAUI = function (windowviewid) { - var daImagePanelConetent = document.getElementsByClassName("jsPanel-content"); - for (var i = 0; i < daImagePanelConetent.length; i++) { - daImagePanelConetent[i].style.pointerEvents = "auto"; - daImagePanelConetent[i].style.opacity = "1"; + var modulePanel = $("#AAImagePanel_"+windowviewid).find(" .jsPanel-content"); + if(modulePanel.length>0) + { + modulePanel[0].style.pointerEvents="auto"; + modulePanel[0].style.opacity="1"; } - + $rootScope.isLoading = false; $('#spinner').css('visibility', 'hidden'); // CB module enable all @@ -213,11 +221,10 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou $('#HomeContainerDiv').css('opacity', '1'); } - $scope.loadForModuleById = function (moduleId) { - $scope.DisableUI(); - + $scope.loadForModuleById = function (moduleId) { $rootScope.isCallFromOtherModule = undefined; $rootScope.MULTI_VIEW_ID += 1 + $scope.DisableAAUI($rootScope.MULTI_VIEW_ID); // store exist module in module service var ExistData = ModuleService.getModuleData("ATLAS_ANATOMY"); @@ -422,7 +429,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou if ($rootScope.isCallFromOtherModule) { $scope.AAModuleData = ModuleService.getModuleData("ATLAS_ANATOMY"); if($scope.AAModuleData.length<1) return; - $scope.DisableUI(); + $scope.DisableAAUI(); $scope.readyToLoad=true; $rootScope.AAWindowLoadComplete = false; $scope.wincount=1; @@ -463,7 +470,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou } else { - $scope.DisableUI(); + $scope.DisableAAUI(); $scope.openModuleItem(null); } } @@ -517,7 +524,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou $scope.SetAAwindowStoreData(windowviewid, 'maximised', isMaximize); $scope.SetAAwindowStoreData(windowviewid, 'minimised', isMinimize); - + // note:: in few json like "articulation" imageId as same id // get wrong detail by imageId //solution: use id to get imageid from js list @@ -577,7 +584,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou $scope.loadAAIllustration = function (windowviewid) { //0.4 for Opening module item, load it into image - $scope.DisableUI(); + $scope.DisableAAUI(windowviewid); if ($rootScope.refreshcheck == null) { $location.path('/'); @@ -666,47 +673,77 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou var pnlName=panel[0].id; var len = (pnlName).split("_").length; var windowviewid = (pnlName).split("_")[len - 1]; - var isAutoCalled = $scope.GetAAwindowStoreData(windowviewid, 'minmaxAutoEvent'); - if(!isAutoCalled) - { - $rootScope.UnsaveCurriculum = true; - } + $scope.SetAAwindowStoreData(windowviewid, 'maximised',true); $scope.SetAAwindowStoreData(windowviewid, 'minimised',false); - var canvasDIvHeight = $('#AAImagePanel_' + windowviewid+ " .jsPanel-content").height()-50; - $('#canvasAADiv_' + windowviewid).css('height', canvasDIvHeight); - $rootScope.resetMenuOptionOnClick(pnlName); + + var extraheight=$('#aastickeyarea').height()+5; + var extrawidth=$('.tools').width()+15; + var canvasDIvHeight = $('#AAImagePanel_' + windowviewid+ " .jsPanel-content").height()-extraheight; + var canvasDIvWidth = $('#AAImagePanel_' + windowviewid+ " .jsPanel-content").width()-extrawidth; + var canvasDiv='canvasAADiv_' + windowviewid; + var canvasDraw='canvasAA_' + windowviewid; + var canvasPaint='canvasPaintAA_' + windowviewid; + + var isAutoCalled = $scope.GetAAwindowStoreData(windowviewid, 'minmaxAutoEvent'); + if(!isAutoCalled) + { + $rootScope.UnsaveCurriculum = true; + var annotationData=$rootScope.GetAAwindowData(windowviewid,'annotationData'); + $rootScope.setAADAPanelCordinate(windowviewid,0,pnlName,canvasDiv,canvasDraw,canvasPaint,canvasDIvHeight,canvasDIvWidth,annotationData); + } }, onnormalized:function (panel) { var pnlName=panel[0].id; var len = (pnlName).split("_").length; var windowviewid = (pnlName).split("_")[len - 1]; + + $scope.SetAAwindowStoreData(windowviewid, 'minimised',false); + $scope.SetAAwindowStoreData(windowviewid, 'maximised',false); + + var extraheight=$('#aastickeyarea').height()+5; + var extrawidth=$('.tools').width()+15; + var canvasDIvHeight = $('#AAImagePanel_' + windowviewid+ " .jsPanel-content").height()-extraheight; + var canvasDIvWidth = $('#AAImagePanel_' + windowviewid+ " .jsPanel-content").width()-extrawidth; + + var canvasDiv='canvasAADiv_' + windowviewid; + var canvasDraw='canvasAA_' + windowviewid; + var canvasPaint='canvasPaintAA_' + windowviewid; + var isAutoCalled = $scope.GetAAwindowStoreData(windowviewid, 'minmaxAutoEvent'); if(!isAutoCalled) { - $rootScope.UnsaveCurriculum = true; + $rootScope.UnsaveCurriculum = true; + var annotationData=$rootScope.GetAAwindowData(windowviewid,'annotationData'); + $rootScope.setAADAPanelCordinate(windowviewid,0,pnlName,canvasDiv,canvasDraw,canvasPaint,canvasDIvHeight,canvasDIvWidth,annotationData); } - $scope.SetAAwindowStoreData(windowviewid, 'minimised',false); - $scope.SetAAwindowStoreData(windowviewid, 'maximised',false); - var canvasDIvHeight = $('#AAImagePanel_' + windowviewid+ " .jsPanel-content").height()-50; - $('#canvasAADiv_' + windowviewid).css('height', canvasDIvHeight); - $rootScope.resetMenuOptionOnClick(pnlName); }, resizable: { + minWidth: 600, + minHeight: 500, stop: function (event, ui) { var pnlName=event.currentTarget.id; var len = (pnlName).split("_").length; var windowviewid = (pnlName).split("_")[len - 1]; + + var extraheight=$('#aastickeyarea').height()+5; + var extrawidth=$('.tools').width()+15; + var canvasDIvHeight = $('#AAImagePanel_' + windowviewid+ " .jsPanel-content").height(); + var canvasDIvWidth = $('#AAImagePanel_' + windowviewid+ " .jsPanel-content").width()-extrawidth; + $scope.SetAAwindowStoreData(windowviewid, 'width', ui.size.width); - $scope.SetAAwindowStoreData(windowviewid, 'height', ui.size.height); + $scope.SetAAwindowStoreData(windowviewid, 'height', canvasDIvHeight); $scope.SetAAwindowStoreData(windowviewid, 'y', ui.position.top); $scope.SetAAwindowStoreData(windowviewid, 'x', ui.position.left); $rootScope.UnsaveCurriculum = true; - var canvasDIvHeight = $('#AAImagePanel_' + windowviewid+ " .jsPanel-content").height()-50; - $('#canvasAADiv_' + windowviewid).css('height', canvasDIvHeight); - $rootScope.resetMenuOptionOnClick(pnlName); - } - + + var canvasDiv='canvasAADiv_' + windowviewid; + var canvasDraw='canvasAA_' + windowviewid; + var canvasPaint='canvasPaintAA_' + windowviewid; + + var annotationData=$rootScope.GetAAwindowData(windowviewid,'annotationData'); + $rootScope.setAADAPanelCordinate(windowviewid,0,pnlName,canvasDiv,canvasDraw,canvasPaint,canvasDIvHeight-extraheight,canvasDIvWidth,annotationData); + } }, draggable: { stop: function( event, ui ) { @@ -750,10 +787,10 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou $scope.SetAAwindowStoreData(windowviewid, 'height', $scope.jsPanelHeight); $timeout(function () { + $scope.setControlsIDs(windowviewid); if (document.getElementById('aaBodyView') != null) { $compile(aaViewElement.contents())($scope); - $scope.setControlsIDs(windowviewid); - + var timeintval = null; timeintval = $interval(function () { var bodySystemListObj = document.getElementById("bodySystemList_" + windowviewid); @@ -761,6 +798,8 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou if (len>1) { $scope.stopIntervalLoader(); //wait until DOM element load of AA + // set search for language input + $scope.langSearchLoad(windowviewid); $scope.loadAAModule(windowviewid); } else @@ -768,7 +807,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou $scope.setControlsIDs(windowviewid); console.log("waiting for loading module"); } - }, 200); + },100); $scope.stopIntervalLoader = function () { if (angular.isDefined(timeintval)) { $interval.cancel(timeintval); @@ -778,7 +817,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou } - }, 500); + }, 1000); } @@ -786,16 +825,10 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou $scope.loadAAModule = function (windowviewid) { - if (!$rootScope.isCallFromOtherModule) { - // $('#aaBodyView').css("height", $(window).outerHeight() - 65); - // $('#aaBodyView').css("width", $(window).outerWidth() - 15); - $('#aaBodyView').css("height", $(window).innerHeight()-100); - $('#aaBodyView').css("width",$(window).innerWidth()-100); - } - - var canvasDIvHeight = $('#AAImagePanel_' + windowviewid+ " .jsPanel-content").height()-50; - $('#canvasAADiv_' + windowviewid).css('height', canvasDIvHeight); - // $('.canvasDivClass').css("height", canvasDIvHeight); + var extraheight=$('#aastickeyarea').height()+5; + var extrawidth=$('.tools').width()+15; + var canvasDIvHeight = $('#AAImagePanel_' + windowviewid+ " .jsPanel-content").height()-extraheight; + var canvasDIvWidth = $('#AAImagePanel_' + windowviewid+ " .jsPanel-content").width()-extrawidth; $scope.convertToZoomValue(windowviewid); @@ -818,16 +851,26 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou //0.5 create canvas on the top of image. var canvas = document.createElement('canvas'); canvas.id = 'aaDetailViewCanvas_'+windowviewid; - canvas.className = '.aaCanvas' - canvas.height = screen.height<=768?screen.height: screen.height-300// parseInt(relativeHeight + 10); - canvas.width = screen.width<=1024?screen.width: screen.width-200//parseInt(relativeWidth + 10); + canvas.className = '.aaCanvas'; + canvas.height =parseInt(relativeHeight)+20; + canvas.width =parseInt(relativeWidth)+50; canvas.style.left = '0px'; canvas.style.top = '0px'; canvas.style.position = "absolute"; canvas.style.zIndex = 12002; $("#canvasAADiv_" + windowviewid).append(canvas); - - $timeout(function () { + + var pnlName='AAImagePanel_' + windowviewid; + var canvasDiv='canvasAADiv_' + windowviewid; + var canvasDraw='canvasAA_' + windowviewid; + var canvasPaint='canvasPaintAA_' + windowviewid; + + var demoData= {shapeStates:[],paintCanvasState:[]}; + $rootScope.setAADAPanelCordinate(windowviewid,0,pnlName,canvasDiv,canvasDraw,canvasPaint,canvasDIvHeight,canvasDIvWidth,demoData); + $scope.JsPanelclick(windowviewid); + + $timeout(function () { + $scope.loadAllPinFirstTime(windowviewid); //call time interval function until load pin data //load search/vocab data @@ -841,27 +884,24 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou $scope.stopIntervalAA(); $scope.showAllPins(windowviewid); $scope.Setslider(windowviewid); - //7. Highlight all system body list in left side - $scope.highlightBodySystemList(windowviewid); - $scope.loadbtnNavigator(windowviewid); - $scope.JsPanelclick(windowviewid); - - if ($rootScope.isCallFromOtherModule) { - $scope.loadAAonCBData(windowviewid); - - //$rootScope.ShowAnnotationWindow(); //show tool if need - var annotationData= $scope.aaOpenInOtherModules.annotationData; - // load annotation - if(annotationData!="" && annotationData!=undefined) + //7. Highlight all system body list in left side + $scope.highlightBodySystemList(windowviewid); + $scope.loadbtnNavigator(windowviewid); + + if ($rootScope.isCallFromOtherModule) { + $scope.loadAAonCBData(windowviewid); + + var annotationData= $scope.aaOpenInOtherModules.annotationData; + // load annotation + if(annotationData!="" && annotationData!=undefined) + { + if(annotationData.shapeStates.length>0||annotationData.paintCanvasState.length>0) { - if(annotationData.shapeStates.length>0||annotationData.paintCanvasState.length>0) - { - //first draw shape and then store in object - $rootScope.LoadCBSavedAnnotation("canvasAA_"+windowviewid,"canvasPaintAA_"+windowviewid,annotationData); - } - } + //first draw shape and then store in object + $rootScope.LoadCBSavedAnnotation(canvasDraw,canvasPaint,annotationData); + } } - + } } else { @@ -984,9 +1024,13 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou $("#navigatorBtn").attr("id", "navigatorBtn_" + windowviewid); $("#navigatorDiv").attr("id", "navigatorDiv_" + windowviewid); $("#comment-box").attr("id", "comment-box_" + windowviewid); + $("#multiannotation").attr("id", "multiannotation_" + windowviewid); $("#selectedTermName").attr("id", "selectedTermName_" + windowviewid); + $("#searchListDivAA").attr("id", "searchListDivAA_" + windowviewid); + $("#searchlangaugeDiv").attr("id", "searchlangaugeDiv_" + windowviewid); $("#termlistfilter").attr("id", "termlistfilter_" + windowviewid); $("#btnSearchAA").attr("id", "btnSearchAA_" + windowviewid); + $("#modItemImage").attr("id", "modItemImage_" + windowviewid); } @@ -1015,6 +1059,11 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou // $("#AAImagePanel_" + windowviewid).off("click"); $("#AAImagePanel_" + windowviewid).on('click', function (event) { + $timeout(function () { + $scope.IsSearchVisible=false; + + }, 200); + var pnlName=event.currentTarget.id; $rootScope.resetMenuOptionOnClick(pnlName); @@ -1024,8 +1073,86 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou $rootScope.StoreTitleName(currentViewTitle); $rootScope.StoreOrgImageName(imageName); }); + + //hide search data + $("#topMenuBar .dropdown-toggle").on('click', function (event) { + + $timeout(function () { + $scope.IsSearchVisible=false; + + }, 200); + }); + + //hide search data + $("#termlistfilter_"+windowviewid).scroll(function (event) { + + $("#termlistfilter_"+windowviewid).focus(); + $scope.IsSearchVisible=true; + }); + // register event for search list manager + $(document).on("mouseover", "#termlistfilter_"+windowviewid+ " option", function (e) { + $('#termlistfilter_'+windowviewid+ ' option[selected="selected"]').removeAttr("style"); + $('#termlistfilter_'+windowviewid+ ' option[selected="selected"]').attr("selected", false); + $(this).css("background-color", "#3399FF"); + + $(this).attr("selected", true); + $scope.IsSearchVisible=true; + + }); + + $('#termlistfilter_'+windowviewid).unbind('keyup'); + $('#termlistfilter_'+windowviewid).on('keyup', function (event) { + $('#termlistfilter_'+windowviewid+ ' option[selected="selected"]').removeAttr("style"); + $('#termlistfilter_'+windowviewid+ ' option[selected="selected"]').attr("selected", false); + $(this.selectedOptions[0]).attr("selected", true); + $scope.IsSearchVisible=true; + }); + + $('#termlistfilter_'+windowviewid).unbind('keypress'); + $('#termlistfilter_'+windowviewid).on('keypress', function (e) { + if ($('#termlistfilter_'+windowviewid+ ' option[selected="selected"]').attr("id") == "undefined") { + return false; + } + else { + if ($('#termlistfilter_'+windowviewid+ ' option[selected="selected"]').attr("id")) { + if (e.keyCode == 13) { + onSearchItemSelection($('#termlistfilter_'+windowviewid+ ' option[selected="selected"]').attr("id"),false); + } + } + } + }); } + + $scope.langSearchLoad= function(windowviewid) + { + $('#searchlangaugeDiv_'+windowviewid).empty(); + $('#searchlangaugeDiv_'+windowviewid).css("display","none"); + var languageArray = $rootScope.lexiconLanguageArray; + + $("#btnSearchAA_"+windowviewid).parent().css("margin-right", "10px"); + + if(languageArray.length>1) + { + $("#btnSearchAA_"+windowviewid).parent().css("margin-right", "-10px"); + $('#searchlangaugeDiv_'+windowviewid).css("display","block"); + var option=''; + for (var i = 0; i <= languageArray.length - 1; i++) { + option=option+''; + } + var $all = $('#searchlangaugeDiv_'+windowviewid).append( + '
    '+ + ''+ + '
    ' + ) + $compile($all)($scope); + + } + + $scope.changeSearchText(windowviewid) + } $scope.setPreClickBtnCss = function (windowviewid) { if ($scope.aaOpenInOtherModules.showAllPins != undefined && $scope.aaOpenInOtherModules.showAllPins) { @@ -1065,18 +1192,36 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou //get last zindex var zindex= $("#aaDetailViewCanvas_"+windowviewid).css("z-index"); $("#aaDetailViewCanvas_"+windowviewid).remove(); + //0.5 create canvas on the top of image so that I can draw a line over the canvas. var canvas = document.createElement('canvas'); canvas.id = "aaDetailViewCanvas_"+windowviewid; canvas.className = 'aaCanvas'; - canvas.height = screen.height<=768?screen.height: screen.height-300// parseInt(relativeHeight + 10); - canvas.width = screen.width<=1024?screen.width: screen.width-200//parseInt(relativeWidth + 10); + canvas.height =parseInt(relativeHeight)+20; + canvas.width =parseInt(relativeWidth)+50; canvas.style.left = '0px'; canvas.style.top = '0px'; canvas.style.position = "absolute"; canvas.style.zIndex = zindex; $("#canvasAADiv_" + windowviewid).append(canvas); + + var pnlName='AAImagePanel_' + windowviewid; + var canvasDiv='canvasAADiv_' + windowviewid; + var canvasDraw='canvasAA_' + windowviewid; + var canvasPaint='canvasPaintAA_' + windowviewid; + $scope.SetAAwindowStoreData(windowviewid, 'annotationData', {shapeStates:[],paintCanvasState:[]}); + + $('#' + canvasDraw).removeLayers();//remove all old shape + $("#" + canvasPaint).sketch().actions = [];//remove old paint data + + var extraheight=$('#aastickeyarea').height()+5; + var extrawidth=$('.tools').width()+15; + var canvasDIvHeight = $('#AAImagePanel_' + windowviewid+ " .jsPanel-content").height()-extraheight; + var canvasDIvWidth = $('#AAImagePanel_' + windowviewid+ " .jsPanel-content").width()-extrawidth; + + var demoData= {shapeStates:[],paintCanvasState:[]}; + $rootScope.setAADAPanelCordinate(windowviewid,0,pnlName,canvasDiv,canvasDraw,canvasPaint,canvasDIvHeight,canvasDIvWidth,demoData); $scope.SetAAwindowStoreData(windowviewid,'isSliderChange',true); var toolbtnID = ''; @@ -1121,6 +1266,10 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou scope.showAllPins(windowviewid,true); break; } + + //redraw annotation + $scope.SetAAwindowStoreData(windowviewid,'isShowBodyWithCBPinData',true); + $scope.ShowCBAnnotation(windowviewid); // } }); } @@ -1181,19 +1330,20 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou selectedPins = $scope.GetAAwindowStoreData(windowviewid, 'selectedPins'); var pinid = $scope.aaOpenInOtherModules.selectedPins[i]; - - selectedPins.push(pinid); - + var pinvalue = 'PinArc_' + pinid; var isFound = jQuery.inArray(pinvalue, activePinArray) if (isFound == -1) { activePinArray.push(pinvalue); clickedPins.push({ 'id': pinid }); + + if (selectedPins != undefined) { + selectedPins.push(pinid); + $scope.SetAAwindowStoreData(windowviewid, 'selectedPins', selectedPins); + } } } - if (selectedPins != undefined) { - $scope.SetAAwindowStoreData(windowviewid, 'selectedPins', selectedPins); - } + } if ($scope.aaOpenInOtherModules.selectedCallouts != undefined) { @@ -1352,7 +1502,6 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou } - $scope.SetAAwindowStoreData(windowviewid,'isShowBodyWithCBPinData',false); $rootScope.AAWindowLoadComplete=true; @@ -1474,7 +1623,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou $scope.activePinOnSliderChange(windowviewid); } - $scope.EnableUI(); + $scope.EnableAAUI(windowviewid); } } @@ -1497,13 +1646,13 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou } }, function (error) { - $scope.EnableUI(); + $scope.EnableAAUI(windowviewid); console.log(' error in showAllPins: ' + error.statusText); }) } $scope.FilterByImage = function (moduleId, query,windowviewid) { - $scope.DisableUI(); + $scope.DisableAAUI(windowviewid); if (windowviewid == undefined) { windowviewid = $rootScope.MULTI_VIEW_ID; } @@ -1671,12 +1820,12 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou } $timeout(function () { - $scope.EnableUI(); + $scope.EnableAAUI(windowviewid); $rootScope.ResetGridListLength(); }, 500); }, function (error) { - $timeout(function () { $scope.EnableUI(); }, 500); + $timeout(function () { $scope.EnableAAUI(windowviewid); }, 500); console.log(' error: ' + error.statusText); } ) @@ -1684,29 +1833,18 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou $rootScope.ResetGridListLength=function() { - var $ua = navigator.userAgent; - - if (($ua.match(/(iPod|iPhone|iPad|android)/i))) { + var innerheight =$(window).innerHeight(); - var srchHeight=$('.breadcrumb').height(); - var gridheight=screen.height-srchHeight-128; - var listheight=screen.height-srchHeight-352; - $('#grid-view').css({"height":gridheight,"overflow":"auto"}); - $('#ListViewDiv').css({"height":listheight,"overflow":"auto"}); - } - else - { - var srchHeight=$('.breadcrumb').height(); - var gridheight=screen.height-srchHeight-276; - var listheight=screen.height-srchHeight-500; - $('#grid-view').css({"height":gridheight,"overflow":"auto"}); - $('#ListViewDiv').css({"height":listheight,"overflow":"auto"}); - } - + var srchHeight=$('.breadcrumb').height(); + var gridheight=innerheight-srchHeight-135; + var listheight=innerheight-srchHeight-358; + $('#grid-view').css({"height":gridheight,"overflow":"auto","min-height":"160px"}); + $('#ListViewDiv').css({"height":listheight,"overflow":"auto","min-height":"100px"}); + } $scope.Reset = function (moduleId, query,windowviewid) { - $scope.DisableUI(); + $scope.DisableAAUI(windowviewid); if(windowviewid==undefined) // call from also home controller list manager windowviewid= $rootScope.MULTI_VIEW_ID; @@ -1743,6 +1881,9 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou if (typeof event == "object") { var len= (event.target.parentElement.parentElement.id).split("_").length; var windowviewid = (event.target.parentElement.parentElement.id).split("_")[len-1]; + + $('#selectedTermName_' + windowviewid).val(''); + $("#selectedTermName_" + windowviewid).attr("name", '0'); if (event.currentTarget.title == $("#bodySystemList_" + windowviewid + " li.activeAASystemSelect a").attr("title")) { } @@ -1760,6 +1901,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou $scope.SetAAwindowStoreData(windowviewid, 'activePinArray', []); $scope.SetAAwindowStoreData(windowviewid, 'selectedPins', []); $scope.SetAAwindowStoreData(windowviewid, 'SelectedSystemID', id); + $scope.SetAAwindowStoreData(windowviewid, 'CBselectedpinCordinate', []); } var isHidePinBtnClicked=$scope.GetAAwindowStoreData(windowviewid,'isHidePinBtnClicked'); @@ -1778,7 +1920,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou $(bodySystemListObj[i].parentElement).addClass("activeAASystemSelect"); } } - $scope.DisableUI(); + $scope.DisableAAUI(windowviewid); $scope.removeSpeechBubble(windowviewid); if (SelectedSystemID == "0") { @@ -1875,7 +2017,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou var SelectedSystemTitle = $("#bodySystemList_" + windowviewid + " li.activeAASystemSelect a").attr("title"); - $scope.DisableUI(); + $scope.DisableAAUI(windowviewid); var isHidePinBtnClicked=$scope.GetAAwindowStoreData(windowviewid,'isHidePinBtnClicked'); $scope.removeSpeechBubble(windowviewid); @@ -1908,6 +2050,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou $scope.SetAAwindowStoreData(windowviewid, 'activePinArray', []); $scope.SetAAwindowStoreData(windowviewid, 'selectedPins', []); $scope.SetAAwindowStoreData(windowviewid, 'SelectedSystemID', SelectedSystemID); + $scope.SetAAwindowStoreData(windowviewid, 'CBselectedpinCordinate', []); } var clickedPins=$scope.GetAAwindowStoreData(windowviewid,'clickedPins'); if(clickedPins.length>0) @@ -1986,16 +2129,6 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou .select(); - var activePinArray=$scope.GetAAwindowStoreData(windowviewid,'activePinArray'); - for (var i = 0; i <= pinDataWithFirstTermNumber.length - 1; i++) { - var pinvalue='PinArc_' + pinDataWithFirstTermNumber[i]._PinId; - var isFound = jQuery.inArray(pinvalue, activePinArray) - if (isFound == -1) { - activePinArray.push('PinArc_' + pinDataWithFirstTermNumber[i]._PinId); - } - - } - $scope.MultiLanguageAnnationArray = []; $scope.GetAnnotationBasedOnActualTermNo(pinTermNumber,windowviewid); @@ -2053,29 +2186,25 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou if (pinDataWithFirstTermNumber.length > 1) { isSameTermWithMultiPin = true; } - var selectedPins=$scope.GetAAwindowStoreData(windowviewid,'selectedPins'); var clickedPins=$scope.GetAAwindowStoreData(windowviewid,'clickedPins'); + var activePinArray=$scope.GetAAwindowStoreData(windowviewid,'activePinArray'); + var selectedPins=$scope.GetAAwindowStoreData(windowviewid,'selectedPins'); + angular.forEach(pinDataWithFirstTermNumber, function (value, key) { - if (isBodySystemSelected == true) { - - clickedPins.push({ 'id': value._PinId }); - //selectedPins.push(value._PinId); + if (isBodySystemSelected == true) { $scope.SetAAwindowStoreData(windowviewid,'isBodySystemSelected',false); } var headX = (parseInt(value._HeadX)); var headY = (parseInt(value._HeadY)); - $scope.createSpeechBubble(parseInt(headX) + 10, parseInt(headY) + 10,0,0, value._PinId, isCtrlPressed, isPinClicked, isSameTermWithMultiPin,windowviewid); - - // remove annotation/speechBubble while resize - if(isResize) - { - $scope.removeSpeechBubble(windowviewid); - } - - //Save Cordinate for show annotation as per Pin - - if ($rootScope.isCallFromOtherModule) { - + + var pinvalue='PinArc_' + value._PinId; + var isFound = jQuery.inArray(pinvalue, activePinArray) + if (isFound == -1) { + activePinArray.push(pinvalue); + clickedPins.push({ 'id': value._PinId }); + selectedPins.push(value._PinId); + + //Save Cordinate for show annotation as per Pin var CBselectedpinCordinate = $scope.GetAAwindowStoreData(windowviewid, 'CBselectedpinCordinate'); CBselectedpinCordinate.push( { @@ -2085,12 +2214,24 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou "lx": headX+30, "pinId": value._PinId }); + } + + // remove annotation/speechBubble while resize + if(isResize) + { + $scope.removeSpeechBubble(windowviewid); + } + else + { + $scope.createSpeechBubble(parseInt(headX) + 10, parseInt(headY) + 10,0,0, value._PinId, isCtrlPressed, isPinClicked, isSameTermWithMultiPin,windowviewid); + + } }) } - $scope.EnableUI(); + $scope.EnableAAUI(windowviewid); } @@ -2229,6 +2370,11 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou // $scope.ShowHideAnnotationText(windowviewid); + if ($("#hidePinBtn_" + windowviewid).hasClass("btn-primary")) { + + $scope.hideSpeechBubble(windowviewid); + } + } $scope.createSpeechBubbleBasedOnAnnotationLength = function (x, y, lx, ly, PinId, windowviewid) { @@ -2425,20 +2571,17 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou var windowviewid = (clickedSpeechBubbleId).split("_")[len - 1]; var sppechBubbleId = $(this).attr("id").substring(12); var PinId = sppechBubbleId.split("_")[0]; + $rootScope.UnsaveCurriculum = true; + $timeout(function () { + var CBselectedpinCordinate = $scope.GetAAwindowStoreData(windowviewid, 'CBselectedpinCordinate'); + var BubleObj = document.getElementById(clickedSpeechBubbleId); + var CBselectedpinCordinate = new jinqJs() + .from(CBselectedpinCordinate) + .update(function (coll, index) { coll[index].lx = BubleObj.offsetLeft; coll[index].ly = BubleObj.offsetTop; }) + .at("pinId == " + PinId); - if ($rootScope.isCallFromOtherModule) { - $rootScope.UnsaveCurriculum = true; - $timeout(function () { - var CBselectedpinCordinate = $scope.GetAAwindowStoreData(windowviewid, 'CBselectedpinCordinate'); - var BubleObj = document.getElementById(clickedSpeechBubbleId); - var CBselectedpinCordinate = new jinqJs() - .from(CBselectedpinCordinate) - .update(function (coll, index) { coll[index].lx = BubleObj.offsetLeft; coll[index].ly = BubleObj.offsetTop; }) - .at("pinId == " + PinId); - - }, 100); + }, 100); - } } }); @@ -2454,17 +2597,29 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou $('#speechBubble' + pinId+'_'+windowviewid).remove(); $("#speechBubbleDraggedLine" + pinId+'_'+windowviewid).remove(); $("#speechBubbleLine" + pinId + '_' + windowviewid).remove(); + var CBselectedpinCordinate = []; + CBselectedpinCordinate = $scope.GetAAwindowStoreData(windowviewid, 'CBselectedpinCordinate'); + CBselectedpinCordinate = new jinqJs() + .from(CBselectedpinCordinate) + .delete().at("pinId == " + pinId).select(); - if ($rootScope.isCallFromOtherModule) { - var CBselectedpinCordinate = []; - CBselectedpinCordinate = $scope.GetAAwindowStoreData(windowviewid, 'CBselectedpinCordinate'); - CBselectedpinCordinate = new jinqJs() - .from(CBselectedpinCordinate) - .delete().at("pinId == " + pinId).select(); + $scope.SetAAwindowStoreData(windowviewid, 'CBselectedpinCordinate', CBselectedpinCordinate); + + var clickedPins=$scope.GetAAwindowStoreData(windowviewid,'clickedPins'); + clickedPins = new jinqJs() + .from(clickedPins) + .delete().at("id == " + pinId).select(); + + $scope.SetAAwindowStoreData(windowviewid, 'clickedPins', clickedPins); - $scope.SetAAwindowStoreData(windowviewid, 'CBselectedpinCordinate', CBselectedpinCordinate); - $rootScope.UnsaveCurriculum = true; + var activePinArray=$scope.GetAAwindowStoreData(windowviewid,'activePinArray'); + + const index = activePinArray.indexOf("PinArc_"+pinId); + if (index > -1) { + activePinArray.splice(index, 1); } + $scope.GetAAwindowStoreData(windowviewid,'activePinArray',activePinArray); + $rootScope.UnsaveCurriculum = true; }); @@ -2579,92 +2734,118 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou click: function (clickedPin) { $rootScope.UnsaveCurriculum =true; + $('#selectedTermName_' + windowviewid).val(''); + $("#selectedTermName_" + windowviewid).attr("name", '0'); //birendra + var iskeyctrlActive= $scope.GetAAwindowStoreData(windowviewid, 'keyctrl');//for iPad // for mac os Command key use for multi selection - if (clickedPin.event.ctrlKey == false && clickedPin.event.metaKey == false) { + if (clickedPin.event.ctrlKey == false && clickedPin.event.metaKey == false && !iskeyctrlActive) { $scope.SetAAwindowStoreData(windowviewid, 'clickedPins', []); $scope.SetAAwindowStoreData(windowviewid, 'selectedPins', []); $scope.SetAAwindowStoreData(windowviewid, 'CBselectedpinCordinate', []); + $scope.SetAAwindowStoreData(windowviewid,'activePinArray',[]); } - var pinID = (clickedPin.name).substring(7, (clickedPin.name).length); - var aaPinData = $scope.GetAAwindowStoreData(windowviewid,'aaPinData'); - var pinData = new jinqJs() - .from(aaPinData) - .where("_PinId == " + pinID) - .select(); - - - var pinTermNumber = pinData[0]._TermId; - - var pinWithSameTerm = new jinqJs() - - .from(aaPinData) - .where("_TermId == " + pinTermNumber) - .select(); - if (pinWithSameTerm != undefined && pinWithSameTerm != null && pinWithSameTerm.length > 0) { - var selectedPins = $scope.GetAAwindowStoreData(windowviewid, 'selectedPins'); - var clickedPins=$scope.GetAAwindowStoreData(windowviewid,'clickedPins'); - for (var i = 0; i < pinWithSameTerm.length; i++) { - clickedPins.push({ 'id': pinWithSameTerm[i]._PinId }); - selectedPins.push(pinWithSameTerm[i]._PinId); - } - } - - $scope.SetAAwindowStoreData(windowviewid,'isSelectedPinBtnClickedAftrSliderCange',false); - var selectedPinData = new jinqJs() - .from(aaPinData) - .where("_PinId == " + pinID) - .select(); - + var activePinArray=$scope.GetAAwindowStoreData(windowviewid,'activePinArray'); - if (clickedPin.event.ctrlKey == true||clickedPin.event.metaKey == true) { - var isFound = jQuery.inArray(clickedPin.name, activePinArray) - if (isFound == -1) { - activePinArray.push(clickedPin.name); - } - var radialAfterClick = $('#aaDetailViewCanvas_' + windowviewid).createGradient({ - x1: 50, y1: 50, - x2: 50, y2: 50, - r1: 10, r2: 30, - c1: 'rgba(100, 50, 0,0)', - c2: 'rgb(126, 187, 83)' - }); - clickedPin.fillStyle = radialAfterClick; - $scope.showAnnotation(selectedPinData, true, true, false,false, windowviewid); - } - else { - $scope.SetAAwindowStoreData(windowviewid,'activePinArray',[]); - var activePin = []; - activePin.push(clickedPin.name); - $scope.SetAAwindowStoreData(windowviewid,'activePinArray',activePin); - - var radial = $('#aaDetailViewCanvas_' + windowviewid).createGradient({ - x1: 50, y1: 50, - x2: 50, y2: 50, - r1: 10, r2: 30, - c1: 'rgba(100, 50, 0,0)', - c2: 'rgb(216, 216, 216)' - }); - - - $('#aaDetailViewCanvas_' + windowviewid).setLayers({ - fillStyle: radial, - }).drawLayers(); - - //change the head color to green - var radialAfterClick = $('#aaDetailViewCanvas_' + windowviewid).createGradient({ - x1: 50, y1: 50, - x2: 50, y2: 50, - r1: 10, r2: 30, - c1: 'rgba(100, 50, 0,0)', - c2: 'rgb(126, 187, 83)' - }); + var isFound = jQuery.inArray(clickedPin.name, activePinArray) + if (isFound == -1) { + activePinArray.push(clickedPin.name); + + var pinID = (clickedPin.name).substring(7, (clickedPin.name).length); + var aaPinData = $scope.GetAAwindowStoreData(windowviewid,'aaPinData'); + var pinData = new jinqJs() + .from(aaPinData) + .where("_PinId == " + pinID) + .select(); + + + var pinTermNumber = pinData[0]._TermId; + + var pinWithSameTerm = new jinqJs() + + .from(aaPinData) + .where("_TermId == " + pinTermNumber) + .select(); + if (pinWithSameTerm != undefined && pinWithSameTerm != null && pinWithSameTerm.length > 0) { + var selectedPins = $scope.GetAAwindowStoreData(windowviewid, 'selectedPins'); + var clickedPins=$scope.GetAAwindowStoreData(windowviewid,'clickedPins'); + for (var i = 0; i < pinWithSameTerm.length; i++) { + clickedPins.push({ 'id': pinWithSameTerm[i]._PinId }); + selectedPins.push(pinWithSameTerm[i]._PinId); + //some time get multiple pinid on selected termid + var pinvalue='PinArc_' + pinWithSameTerm[i]._PinId; + var isFound = jQuery.inArray(pinvalue, activePinArray) + if (isFound == -1) { + activePinArray.push(pinvalue); + } - clickedPin.fillStyle = radialAfterClick; - $scope.showAnnotation(selectedPinData, false, true, false,false, windowviewid); + var headX = (parseInt(pinWithSameTerm[i]._HeadX)); + var headY = (parseInt(pinWithSameTerm[i]._HeadY)); + //Save Cordinate for show annotation as per Pin + var CBselectedpinCordinate = $scope.GetAAwindowStoreData(windowviewid, 'CBselectedpinCordinate'); + CBselectedpinCordinate.push( + { + "hy": headY, + "ly": headY+10, + "hx": headX, + "lx": headX+30, + "pinId": pinWithSameTerm[i]._PinId + }); - } + } + } + + $scope.SetAAwindowStoreData(windowviewid,'isSelectedPinBtnClickedAftrSliderCange',false); + var selectedPinData = new jinqJs() + .from(aaPinData) + .where("_PinId == " + pinID) + .select(); + + if (clickedPin.event.ctrlKey == true||clickedPin.event.metaKey == true ||iskeyctrlActive) { + + var radialAfterClick = $('#aaDetailViewCanvas_' + windowviewid).createGradient({ + x1: 50, y1: 50, + x2: 50, y2: 50, + r1: 10, r2: 30, + c1: 'rgba(100, 50, 0,0)', + c2: 'rgb(126, 187, 83)' + }); + clickedPin.fillStyle = radialAfterClick; + $scope.showAnnotation(selectedPinData, true, true, false,false, windowviewid); + } + else + { + var radial = $('#aaDetailViewCanvas_' + windowviewid).createGradient({ + x1: 50, y1: 50, + x2: 50, y2: 50, + r1: 10, r2: 30, + c1: 'rgba(100, 50, 0,0)', + c2: 'rgb(216, 216, 216)' + }); + + + $('#aaDetailViewCanvas_' + windowviewid).setLayers({ + fillStyle: radial, + }).drawLayers(); + + //change the head color to green + var radialAfterClick = $('#aaDetailViewCanvas_' + windowviewid).createGradient({ + x1: 50, y1: 50, + x2: 50, y2: 50, + r1: 10, r2: 30, + c1: 'rgba(100, 50, 0,0)', + c2: 'rgb(126, 187, 83)' + }); + + clickedPin.fillStyle = radialAfterClick; + $scope.showAnnotation(selectedPinData, false, true, false,false, windowviewid); + + } + + + } + } }).drawLayers(); @@ -2702,77 +2883,87 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou } + //Reload Body View after setting Change + $rootScope.reloadAABodyViewEvent = function (isLexiconChange, windowviewid) { + + $scope.loadaaBodyViewChangedBySetting(windowviewid,isLexiconChange); + } + + $scope.loadaaBodyViewChangedBySetting = function (windowviewid, isLexiconChange) { + $scope.DisableAAUI(windowviewid); + + // store image for export while click on panel + var currentViewTitle = $scope.GetAAwindowStoreData(windowviewid, 'currentViewTitle'); + var imageName = $scope.GetAAwindowStoreData(windowviewid, 'imageName'); + + $rootScope.StoreTitleName(currentViewTitle); + $rootScope.StoreOrgImageName(imageName); + + var timeintval=$scope.SetAAwindowStoreData(windowviewid,'intervalObject'); + if(isLexiconChange) + { + // remove first annotation text + $scope.removeSpeechBubble(windowviewid); + + //load term data and also language data + $rootScope.loadPinSearchData(windowviewid); + timeintval = $interval(function(){loadaaBodyViewBySetting(windowviewid)},5); + $scope.SetAAwindowStoreData(windowviewid,'intervalObject',timeintval); + function loadaaBodyViewBySetting(panid) { + var pinTermData = $scope.GetAAwindowStoreData(panid, 'pinTermData'); + if (pinTermData!=null) { + var intval=$scope.GetAAwindowStoreData(panid,'intervalObject'); + $scope.stopVocab(intval); + $scope.langSearchLoad(panid); + $scope.SetAAwindowStoreData(panid,'isShowBodyWithCBPinData',true); + //loading annotation + $scope.ShowCBAnnotation(panid); + + $timeout(function () { + if ($rootScope.isListManagerMenuSelected) { + var selectedPanel = $("#viewName option:selected").val(); + var winid = (selectedPanel).split("_")[1]; + if(winid==panid) + { + $scope.DisableAAUI(panid); + $rootScope.aalistManagerEvent(panid); + } + } + + }, 200); + + $scope.EnableAAUI(panid); + } + else + { + console.log("waiting for search term Data"); + } + } + + $scope.stopVocab = function (intvalobj) { + if (angular.isDefined(intvalobj)) { + $interval.cancel(intvalobj); + intvalobj = undefined; + } + }; + + } + + } + $rootScope.aaloadSearchData = function (windowviewid) { var imageId= $scope.GetAAwindowStoreData(windowviewid,'imageId'); + $scope.SetAAwindowStoreData(windowviewid,'pinTermData',[]); var promise = ModuleService.getTermTextDataForAAImage(imageId) .then( function (response) { var AAPinTermData = response.data.PinTermData.TermData; $scope.SetAAwindowStoreData(windowviewid,'AAPinTermData',AAPinTermData) - $scope.EnableUI(); - - $scope.SetAAwindowStoreData(windowviewid,'pinTermData',[]); + $scope.EnableAAUI(windowviewid); + $rootScope.loadPinSearchData(windowviewid); - var primaryLexicon = $rootScope.lexiconLanguageArray[0].id; - var matchedLanguageTermData = new jinqJs() - .from(AAPinTermData) - .where('_LanguageId == ' + primaryLexicon) - .select(); - var sortedTermTextArray = []; - for (var i = 0; i < matchedLanguageTermData.length; i++) { - sortedTermTextArray.push(matchedLanguageTermData[i]._TermText); - sortedTermTextArray.sort(); - } - - var pinTermData=$scope.GetAAwindowStoreData(windowviewid,'pinTermData'); - - for (var i = 0; i <= sortedTermTextArray.length - 1; i++) { - for (var j = 0; j <= matchedLanguageTermData.length - 1; j++) { - if (matchedLanguageTermData[j]._TermText == sortedTermTextArray[i]) { - pinTermData.push({ "LanguageId": matchedLanguageTermData[j]._LanguageId, "TermNumber": matchedLanguageTermData[j]._TermNumber, "TermTxt": matchedLanguageTermData[j]._TermText }); - break; - } - } - } - - $("#AABodySystems").empty(); - $("#bodySystems").css("display", "none"); - $("#langaugeDivLm").css("display", "none"); - $("#AABodySystems").css("display", "block"); - $("#bodySystemList_" + windowviewid + " li a").each(function (key, value) { - var sysid= $(this).attr('id') + '_' +windowviewid; - - if ($(this).parent().hasClass("disabledSelectedSystem")) { - var $systemOptions = $('').appendTo("#AABodySystems") - $compile($systemOptions)($scope); - } - else{ - var $systemOptions = $('').appendTo("#AABodySystems") - $compile($systemOptions)($scope); - } - - }); - - $scope.$watch('pinTermData', function (newValue, oldValue, scope) { - - $('#termlistfilter_' + windowviewid).empty(); - if (pinTermData.length > 0) { - $timeout(function () { - console.log('pinTermData= ' + pinTermData.length); - $('#termList').empty(); - $('#termlistfilter_' + windowviewid).empty(); - for (var j = 0; j < pinTermData.length; j++) { - var $el = $('
  • ' + pinTermData[j].TermTxt + '
  • ').appendTo('#termlistfilter_' + windowviewid) - $compile($el)($scope); - var $selectedOptions = $('').appendTo('#termList') - - $compile($selectedOptions)($scope); - } - }, 500); - } - }) }, function (error) { // handle errors here @@ -2782,118 +2973,349 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou } + $rootScope.loadPinSearchData = function (windowviewid) { + var AAPinTermData= $scope.GetAAwindowStoreData(windowviewid,'AAPinTermData') + for (var i = 0; i <= $rootScope.lexiconLanguageArray.length - 1; i++) { + + var lexiconId = $rootScope.lexiconLanguageArray[i].id; + var matchedLanguageTermData = new jinqJs() + .from(AAPinTermData) + .where('_LanguageId == ' + lexiconId) + .select(); + + if(matchedLanguageTermData.length>0) + { + if(i==0) + { + $scope.SetAAwindowStoreData(windowviewid, 'pinTermData', matchedLanguageTermData); + } + else + { + var pinTermData = $scope.GetAAwindowStoreData(windowviewid, 'pinTermData'); + var result=pinTermData.concat(matchedLanguageTermData); + $scope.SetAAwindowStoreData(windowviewid, 'pinTermData', result); + + } + } + + } + + } + //event remove it fire multiple time $rootScope.aalistManagerEvent=function(windowviewid){ - $scope.DisableUI(); - $rootScope.aaloadSearchData(windowviewid); + $scope.DisableAAUI(windowviewid); + $("#langaugeDivLm").css("display", "none"); + + $("#AABodySystems").empty(); + $("#bodySystems").css("display", "none"); + $("#langaugeDivLm").css("display", "none"); + $("#AABodySystems").css("display", "block"); + $('#termList').empty(); + + var totalstructure=0; + $rootScope.isListManagerMenuSelected = true; + + $scope.SetAAwindowStoreData(windowviewid,'totalstructureLm',0); + var languageArray = $rootScope.lexiconLanguageArray; + + if(languageArray.length>1) + { + $("#langaugeDivLm").css("display", "block"); + $("#selectLanguageLm").empty(); + for (var i = 0; i <= languageArray.length - 1; i++) { + $('#selectLanguageLm').append(''); + } + } + + var $all = $('').appendTo('#AABodySystems'); + $compile($all)($scope); + + $("#bodySystemList_" + windowviewid + " li a").each(function (key, value) { + if($(this).attr('id')!="0") + { + var sysid= $(this).attr('id') + '_' +windowviewid; + + if ($(this).parent().hasClass("disabledSelectedSystem")) { + var $systemOptions = $('').appendTo("#AABodySystems") + $compile($systemOptions)($scope); + } + else{ + var $systemOptions = $('').appendTo("#AABodySystems") + $compile($systemOptions)($scope); + } + } + + }); + + + // primary language + var langId=languageArray[0].id; + $scope.loadaaListManger(windowviewid,langId,totalstructure); + + } + + $rootScope.changeLanguageLmEventAA = function (windowviewid) { + $scope.DisableAAUI(windowviewid); + $('#termList').empty(); + var totalstructure=0; + $scope.SetAAwindowStoreData(windowviewid,'totalstructure',0); + + var langIdvalue = $("#selectLanguageLm option:selected").val(); + + setTimeout(function () { + + if(langIdvalue!=undefined) + { + var selectedLanguage = new jinqJs() + .from( $rootScope.lexiconLanguageArray) + .where('id == ' + langIdvalue) + .select()[0]; + + var langId=selectedLanguage.id; + + } + else + { + var langId=$rootScope.lexiconLanguageArray[0].id; + } + + var sysid = $("#AABodySystems option:selected").attr("id"); + var bodysystemId = (sysid).split("_")[0]; + if(bodysystemId=="0") + { + $scope.loadaaListManger(windowviewid,langId,totalstructure); + } + else + { + $scope.aasystemMatchTermLoad(bodysystemId,windowviewid,langId,totalstructure); + } + + },100) + + } + + $rootScope.LoadMoreLmEventAA = function (windowviewid) { + $scope.DisableAAUI(windowviewid); + var langIdvalue = $("#selectLanguageLm option:selected").val(); + var totalstructure = $scope.GetAAwindowStoreData(windowviewid, 'totalstructureLm'); + + setTimeout(function () { + + if(langIdvalue!=undefined) + { + var selectedLanguage = new jinqJs() + .from( $rootScope.lexiconLanguageArray) + .where('id == ' + langIdvalue) + .select()[0]; + + var langId=selectedLanguage.id; + + } + else + { + var langId=$rootScope.lexiconLanguageArray[0].id; + } + + var sysid = $("#AABodySystems option:selected").attr("id"); + var bodysystemId = (sysid).split("_")[0]; + if(bodysystemId=="0") + { + $scope.loadaaListManger(windowviewid,langId,totalstructure); + } + else + { + $scope.aasystemMatchTermLoad(bodysystemId,windowviewid,langId,totalstructure); + } + + }, 100); + + } + + $scope.loadaaListManger = function (windowviewid,langId,totalstructure) { - $timeout(function () { - $("#totalTermsLm").empty(); - $("#totalTermsLm").html("" + $("#termList option").length + " Structures"); - $scope.EnableUI(); - }, 1000); + var selectedpinTermData=$scope.GetAAwindowStoreData(windowviewid,'pinTermData');//term data for selected language + var languageTermDataArray = new jinqJs() + .from( selectedpinTermData) + .where('_LanguageId == ' + langId) + .select(); + + + var afterskipdata = new jinqJs() + .from(languageTermDataArray) + .skip(totalstructure) + .select(); + + var limitTofilterdata = $filter('limitTo')(afterskipdata, 500); + + var matchTermDataFilter = new jinqJs() + .from(limitTofilterdata) + .distinct('_TermText', '_TermNumber') + .orderBy([{ field: '_TermText', sort: 'asc' }]) + .select('_TermNumber', '_TermText'); + + var option=''; + + angular.forEach(matchTermDataFilter, function (value2, key2) { + totalstructure=totalstructure+1; + option=option+''; + + }) + var $el = $(option).appendTo('#termList') + $compile($el)($scope); + + $scope.SetAAwindowStoreData(windowviewid,'totalstructureLm',totalstructure); + var termsTotal = '' + totalstructure + ' Structures'; + + $("#totalTermsLm").empty(); + $("#totalTermsLm").append(termsTotal); + + if(totalstructure < languageTermDataArray.length) + { + $("#totalTermsLm").append(''); + } + else + { + $("#totalTermsLm").append(''); + $('#btlLoadMoreLm').attr('disabled', 'disabled'); + } + + $scope.EnableAAUI(windowviewid); + } $rootScope.refreshTermListOnAASystemSelection = function (selectedBodysystemId) { var windowviewid = (selectedBodysystemId).split("_")[1]; + var bodysystemId = (selectedBodysystemId).split("_")[0]; $("#AABodySystems").find("option:not(:disabled)").css({ "background-color": "#ffffff", "color": "#000000" }); $("#AABodySystems").find("option[id=" + selectedBodysystemId + "]").css({ "background-color": "#3399FF", "color": "#ffffff" }); $('#termList').empty(); - var bodySystemName = $("#AABodySystems #" + selectedBodysystemId).val(); + // var bodySystemName = $("#AABodySystems #" + selectedBodysystemId).val(); - if (bodySystemName == "All") { - var pinTermData=$scope.GetAAwindowStoreData(windowviewid,'pinTermData'); - for (var j = 0; j <= pinTermData.length - 1; j++) { - var $selectedOptions = $('').appendTo("#termList") + $scope.SetAAwindowStoreData(windowviewid, 'totalstructureLm',0); + var totalstructure = 0; + var langIdvalue = $("#selectLanguageLm option:selected").val(); + if(langIdvalue!=undefined) + { + var selectedLanguage = new jinqJs() + .from( $rootScope.lexiconLanguageArray) + .where('id == ' + langIdvalue) + .select()[0]; + + var langId=selectedLanguage.id; - $compile($selectedOptions)($scope); } - $("#totalTermsLm").empty(); - $("#totalTermsLm").html("" + $("#termList option").length + " Structures"); - } - else { - var imageId = $scope.GetAAwindowStoreData(windowviewid,'imageId'); - var pinDataUrl = "aa_dat_pinterm_" + imageId; - var bodySystemTermArray = []; - var sortedListArray = []; - var duplicateListArray = []; - $.ajax({ - url: '~/../content/data/json/aa/aa_pinterm/' + pinDataUrl + '.json', - type: 'GET', - dataType: "json", - async: false, - success: function (result) { - $(result.PinTermData.TermData).each(function (key, value) { - bodySystemTermArray.push({ "termNumbr": result.PinTermData.TermData[key]._TermNumber, "text": result.PinTermData.TermData[key]._TermText, "language": result.PinTermData.TermData[key]._LanguageId }); - }); + else + { + var langId=$rootScope.lexiconLanguageArray[0].id; + } - var aaPinData = $scope.GetAAwindowStoreData(windowviewid,'aaPinData'); - for (var i = 0; i <= aaPinData.length - 1; i++) { + if(bodysystemId=="0") + { + setTimeout(function () { + $scope.loadaaListManger(windowviewid,langId,totalstructure); + + }, 100); + } + else + { + $scope.aasystemMatchTermLoad(bodysystemId,windowviewid,langId,totalstructure); + } - if (aaPinData[i]._BodySystemName.toLowerCase() == bodySystemName.toLowerCase()) { + } - for (var j = 0 ; j <= bodySystemTermArray.length - 1; j++) { - if (aaPinData[i]._TermId == bodySystemTermArray[j].termNumbr) { - if (bodySystemTermArray[j].language == $rootScope.lexiconLanguageArray[0].id) { - duplicateListArray.push({ "title": bodySystemTermArray[j].text, "id": bodySystemTermArray[j].termNumbr }); - } - } - } - } - } - var temp = []; - for (var i = 0; i <= duplicateListArray.length - 1; i++) { - var termID = duplicateListArray[i].id; - if ($.inArray(termID, temp) == -1) { - temp.push(termID); - sortedListArray.push({ "title": duplicateListArray[i].title, "id": termID }); + $scope.aasystemMatchTermLoad=function(bodysystemId,windowviewid,langId,totalstructure) + { + var aaPinData = $scope.GetAAwindowStoreData(windowviewid,'aaPinData'); + var systemMatchedTermList = new jinqJs() + .from(aaPinData) + .where('_BodySystemId == ' + bodysystemId) + .select(); + if (systemMatchedTermList != null || systemMatchedTermList != undefined) { + $scope.refreshTerms(systemMatchedTermList,windowviewid,langId,totalstructure); + } - } - } + } - for (var i = 0; i <= sortedListArray.length - 1; i++) { + + $scope.refreshTerms = function (termList,windowviewid,langId,totalstructure) { + var matchTermData = []; + var selectedpinTermData=$scope.GetAAwindowStoreData(windowviewid,'pinTermData'); - for (j = i + 1; j <= sortedListArray.length - 1; j++) { + var languageTermDataArray = new jinqJs() + .from( selectedpinTermData) + .where('_LanguageId == ' + langId) + .select(); - if (sortedListArray[i].title.substr(0, 1) > sortedListArray[j].title.substr(0, 1)) { + + for (var i = 0; i < termList.length; i++) { - var termText = sortedListArray[i].title; - var termNumbr = sortedListArray[i].id; - var termLanguage = sortedListArray[i].language; + var actulaTerm = new jinqJs() + .from(languageTermDataArray) + .where('_TermNumber == ' + termList[i]._TermId) + .select()[0]; + + if (actulaTerm != null || actulaTerm != undefined) { + matchTermData.push( + { + "_TermNumber": actulaTerm._TermNumber, + "_TermText": actulaTerm._TermText + + }); + } - sortedListArray[i].title = sortedListArray[j].title; - sortedListArray[i].id = sortedListArray[j].id; - sortedListArray[i].language = sortedListArray[j].language; + } - sortedListArray[j].title = termText; - sortedListArray[j].id = termNumbr; - sortedListArray[j].language = termLanguage; - } - } - } - for (var j = 0; j <= sortedListArray.length - 1; j++) { - var $selectedOptions = $('').appendTo("#termList"); + var matchTermDataFilter = new jinqJs() + .from(matchTermData) + .distinct('_TermText', '_TermNumber') + .orderBy([{ field: '_TermText', sort: 'asc' }]) + .select('_TermNumber', '_TermText'); + + var option=''; + if (matchTermDataFilter != null || matchTermDataFilter != undefined) { + + angular.forEach(matchTermDataFilter, function (value2, key2) { + totalstructure=totalstructure+1; + option=option+''; + + }) + var $el = $(option).appendTo('#termList') + $compile($el)($scope); + + $scope.SetAAwindowStoreData(windowviewid,'totalstructureLm',totalstructure); + var termsTotal = '' + totalstructure + ' Structures'; - $compile($selectedOptions)($scope); - } - } - }); $("#totalTermsLm").empty(); - $("#totalTermsLm").html("" + $("#termList option").length + " Structures"); + $("#totalTermsLm").append(termsTotal); + + if(totalstructure < matchTermDataFilter.length) + { + $("#totalTermsLm").append(''); + } + else + { + $("#totalTermsLm").append(''); + $('#btlLoadMoreLm').attr('disabled', 'disabled'); + } + } - } + $scope.EnableAAUI(windowviewid); + + } + $scope.GetAnnotationBasedOnActualTermNo = function (actualTermNo,windowviewid) { - var languageArray = $rootScope.lexiconLanguageArray; - var AAPinTermData= $scope.GetAAwindowStoreData(windowviewid,'AAPinTermData'); + var languageArray = $rootScope.lexiconLanguageArray; + var pinTermData = $scope.GetAAwindowStoreData(windowviewid, 'pinTermData'); - if (AAPinTermData != null || AAPinTermData != undefined) { + if (pinTermData != null || pinTermData != undefined) { var matchedTermNoData = new jinqJs() - .from(AAPinTermData) + .from(pinTermData) .where('_TermNumber == ' + actualTermNo) .select(); @@ -2917,7 +3339,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou } $rootScope.hidePins = function (windowviewid) { $scope.ToolBoxStyle("HidePin",windowviewid); - $scope.DisableUI(); + $scope.DisableAAUI(windowviewid); $scope.hideSpeechBubble(windowviewid); $scope.SetAAwindowStoreData(windowviewid, 'isShowSelectedPins', false); $scope.SetAAwindowStoreData(windowviewid, 'isShowAllPins', false); @@ -2937,7 +3359,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou visible: false // set to true instead to show the layer again }).drawLayers(); }) - $scope.EnableUI(); + $scope.EnableAAUI(windowviewid); } @@ -2949,7 +3371,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou $scope.ToolBoxStyle("ShowAllPin",windowviewid); - $scope.DisableUI(); + $scope.DisableAAUI(windowviewid); $scope.SetAAwindowStoreData(windowviewid, 'isShowAllPins', true); $scope.SetAAwindowStoreData(windowviewid,'isHidePinBtnClicked',false); @@ -2990,17 +3412,16 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou $("#listManager").css("display", "none"); $("#optionsListManagerTab").removeClass("active"); - $scope.DisableUI(); + $scope.DisableAAUI(windowviewid); - //if ($rootScope.isCallFromOtherModule) { - var isHidePinBtnClicked = $scope.GetAAwindowStoreData(windowviewid, 'isHidePinBtnClicked'); - if (isHidePinBtnClicked) { - $scope.showAllPins(windowviewid); - setTimeout(function () { - $scope.activePinOnSliderChange(windowviewid); - }, 200); - } - //} + var isHidePinBtnClicked = $scope.GetAAwindowStoreData(windowviewid, 'isHidePinBtnClicked'); + if (isHidePinBtnClicked) { + $scope.showAllPins(windowviewid); + setTimeout(function () { + $scope.activePinOnSliderChange(windowviewid); + }, 200); + } + $scope.SetAAwindowStoreData(windowviewid, 'isShowAllPins', false); $scope.SetAAwindowStoreData(windowviewid, 'isHidePinBtnClicked', false); $scope.SetAAwindowStoreData(windowviewid, 'isShowSelectedPins', true); @@ -3103,84 +3524,267 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou }).drawLayers(); }) } - $scope.EnableUI(); + $scope.EnableAAUI(windowviewid); } - $scope.showItemsForSearch = function (event) { - var len= (event.currentTarget.id).split("_").length; - var windowviewid = (event.currentTarget.id).split("_")[len-1]; + $scope.showItemsForSearch = function (windowviewid, isbuttionclick) { + + if ($('#searchListDivAA_' + windowviewid).html() != "") + $('#termlistfilter_'+windowviewid).empty(); + + $scope.IsSearchVisible = true; + // clear time stamp on text box click + $scope.SetAAwindowStoreData(windowviewid, 'SearchTimeStampValue', 0); + + var langIdvalue = $("#searchLanguageLm_"+windowviewid+" option:selected").val(); + if(langIdvalue!=undefined) + { + var selectedLanguage = new jinqJs() + .from( $rootScope.lexiconLanguageArray) + .where('id == ' + langIdvalue) + .select()[0]; + + var langId=selectedLanguage.id; + } + else + { + // get default language + var langId=$rootScope.lexiconLanguageArray[0].id + } - console.log('showItemsForSearch is called'); - //this check is for log only because we are writing length so need to check if its not null or undefined + var selectedpinTermData=$scope.GetAAwindowStoreData(windowviewid,'pinTermData');//term data for selected language + + var languageTermDataArray = new jinqJs() + .from( selectedpinTermData) + .where('_LanguageId == ' + langId) + .select(); - var AAPinTermData=$scope.GetAAwindowStoreData(windowviewid,'AAPinTermData'); - $timeout(function () { - if ((AAPinTermData != null || AAPinTermData != undefined) && (AAPinTermData.length > 0)) { + var searchvalue = $("#selectedTermName_" + windowviewid).val(); + + var searchfilterdata = $filter('filter')(languageTermDataArray, searchvalue); + if(searchvalue.trim()!="") + { + searchfilterdata = $filter('orderBy')(searchfilterdata, '_TermText.length'); + } + else + { + searchfilterdata = $filter('orderBy')(searchfilterdata, '_TermText'); + } - $scope.IsSearchVisible = true; - $("#termlistfilter_" + windowviewid).css("display", "block"); + $scope.limitTofilterdata = $filter('limitTo')(searchfilterdata, 500); - $("#backdrop > #searchListDivAA > #termlistfilter_" + windowviewid + " > li").each(function (key, value) { + $('#termlistfilter_'+windowviewid).css("display", "block"); - if ($(this).find("a").html() == document.getElementById("selectedTermName_"+windowviewid).value) { - $("#termlistfilter_" + windowviewid + " li a").css({ "background-color": "#ffffff", "color": "#000000" }); - $(this).find("a").css({ "background-color": "#3399FF", "color": "#ffffff" }); - } - }); + angular.forEach($scope.limitTofilterdata, function (value2, key2) { + var $el = $('').appendTo('#termlistfilter_' + windowviewid); + $compile($el)($scope); + }) + + var $all = $('#termlistfilter_'+windowviewid).appendTo('#searchListDivAA_' + windowviewid); + $compile($all)($scope); + + if(isbuttionclick) + { + $timeout(function () { + $('#termlistfilter_'+windowviewid).focus(); + }, 200); + } - } - else { - $rootScope.aaloadSearchData(windowviewid); - if (AAPinTermData.length > 0) { - $scope.showItemsForSearch(event); - } - } + } + + $scope.resetSearchListView = function (event) { + + var len = (event.target.id).split("_").length; + var windowviewid = (event.target.id).split("_")[len - 1]; + var date = new Date(); + var newtimestamp = date.getTime(); - }, 500); + var oldtimestamp = $scope.GetAAwindowStoreData(windowviewid, 'SearchTimeStampValue'); + + if ((newtimestamp - oldtimestamp) > 100) { + + $scope.SetAAwindowStoreData(windowviewid, 'SearchTimeStampValue', newtimestamp); + $scope.showFilteredTerms(windowviewid); + } } $scope.HideSearchList = function (event) { var len= (event.currentTarget.id).split("_").length; var windowviewid = (event.currentTarget.id).split("_")[len-1]; + $timeout(function () { + if(!$scope.IsSearchVisible) + { + $("#termlistfilter_" + windowviewid).empty(); + $("#termlistfilter_" + windowviewid).css("display", "none"); + } + + }, 600); - $("#termlistfilter_"+windowviewid).css("display", "none"); + } + $scope.showFilteredTerms = function (windowviewid) { + var langIdvalue = $("#searchLanguageLm_"+windowviewid+" option:selected").val(); + if(langIdvalue!=undefined) + { + var selectedLanguage = new jinqJs() + .from( $rootScope.lexiconLanguageArray) + .where('id == ' + langIdvalue) + .select()[0]; - }, 500); + var langId=selectedLanguage.id; + } + else + { + // get default language + var langId=$rootScope.lexiconLanguageArray[0].id + } + + var selectedpinTermData=$scope.GetAAwindowStoreData(windowviewid,'pinTermData');//term data for selected language + + var languageTermDataArray = new jinqJs() + .from( selectedpinTermData) + .where('_LanguageId == ' + langId) + .select(); + + var searchvalue = $("#selectedTermName_" + windowviewid).val(); + + var searchfilterdata = $filter('filter')(languageTermDataArray, searchvalue); + if(searchvalue.trim()!="") + { + searchfilterdata = $filter('orderBy')(searchfilterdata, '_TermText.length'); + } + else + { + searchfilterdata = $filter('orderBy')(searchfilterdata, '_TermText'); + } + $scope.limitTofilterdata = $filter('limitTo')(searchfilterdata, 20); + + $('#termlistfilter_'+windowviewid).css("display", "block"); + $('#termlistfilter_'+windowviewid).empty(); + + angular.forEach($scope.limitTofilterdata, function (value2, key2) { + var $el = $('').appendTo('#termlistfilter_' + windowviewid); + $compile($el)($scope); + }) + + var $all = $('#termlistfilter_'+windowviewid).appendTo('#searchListDivAA_' + windowviewid); + $compile($all)($scope); + + $("#selectedTermName_" + windowviewid).attr("name", "0"); + + }; + + $scope.changeaaSearchLanguage = function (event) { + + var len= (event.currentTarget.id).split("_").length; + var windowviewid = (event.currentTarget.id).split("_")[len-1]; + + $scope.changeSearchText(windowviewid); + } - $scope.highlightPinBasedOnSerachItemEvent = function (termid) { + + $scope.changeSearchText = function (windowviewid) { + + setTimeout(function () { + + var term_num = $("#selectedTermName_" + windowviewid).attr("name"); + if(term_num!=undefined && term_num!="0") + { + var langIdvalue = $("#searchLanguageLm_"+windowviewid+" option:selected").val(); + if(langIdvalue!=undefined) + { + var selectedLanguage = new jinqJs() + .from( $rootScope.lexiconLanguageArray) + .where('id == ' + langIdvalue) + .select()[0]; + + var langId=selectedLanguage.id; + + } + else + { + var langId=$rootScope.lexiconLanguageArray[0].id; + } + var selectedpinTermData=$scope.GetAAwindowStoreData(windowviewid,'pinTermData');//term data for selected language + + var languageTermDataArray = new jinqJs() + .from( selectedpinTermData) + .where('_LanguageId == ' + langId) + .select(); + + + var selectedTerm = new jinqJs() + .from( languageTermDataArray) + .where('_TermNumber == '+term_num) + .select()[0]; + + + if(selectedTerm!=undefined) + { + + $("#selectedTermName_" + windowviewid).attr("name", selectedTerm._TermNumber); + $("#selectedTermName_" + windowviewid).val(selectedTerm._TermText); + + } + else + { + $("#selectedTermName_" + windowviewid).attr("name", "0"); + $("#selectedTermName_" + windowviewid).val(''); + } + + } + else + { + $("#selectedTermName_" + windowviewid).attr("name", "0"); + $("#selectedTermName_" + windowviewid).val(''); + } + + },100) + + + } + + + $scope.highlightPinBasedOnSerachItemEvent = function (termid,isTermListOptionClicked) { $rootScope.UnsaveCurriculum = true; - $scope.highlightPinBasedOnSerachItem(termid); + $scope.highlightPinBasedOnSerachItem(termid,isTermListOptionClicked); } - $scope.highlightPinBasedOnSerachItem = function (termid) { + $scope.highlightPinBasedOnSerachItem = function (termid,isTermListOptionClicked) { var windowviewid = (termid).split("_")[1]; - var id=(termid).split("_")[0]; + var TermNumber= termid.split('_')[0]; var currenttermidTxt = $('#' + termid).text(); + $scope.IsSearchVisible=false; + + + if (isTermListOptionClicked == true) { + $('#selectedTermName_' + windowviewid).val(''); + $("#selectedTermName_" + windowviewid).attr("name", '0'); + } + else + { + $('#selectedTermName_' + windowviewid).val(currenttermidTxt); + $("#selectedTermName_" + windowviewid).attr("name", TermNumber); + $("#termlistfilter_" + windowviewid).empty(); + $("#termlistfilter_" + windowviewid).css("display", "none"); + } $scope.showAllPinsAfterHide(windowviewid); - $('#termList option[selected="selected"]').prop("selected", false); - $('#termList option[value="' + currenttermidTxt + '"]').attr("selected", true); $("#termList").find("option").css({ "background-color": "#ffffff", "color": "#000000" }); - $('#termList option[value="' + currenttermidTxt + '"]').css({ "background-color": "#3399FF", "color": "#ffffff" }); - - $("#termlistfilter_" + windowviewid + " li").find("a").css({ "background-color": "#ffffff", "color": "#000000" }); - $("#termlistfilter_" + windowviewid + " li").find("a[id=" + termid + "]").css({ "background-color": "#3399FF", "color": "#ffffff" }); - - $('#selectedTermName_' + windowviewid).val(currenttermidTxt); - + $("#termList").find("option[id=" + termid + "]").css({ "background-color": "#3399FF", "color": "#ffffff" }); + //get data from pindata for this trem var aaPinData = $scope.GetAAwindowStoreData(windowviewid,'aaPinData'); var pinDataForTerm = new jinqJs() .from(aaPinData) - .where("_TermId == " + id) + .where("_TermId == " + TermNumber) .select(); // birendra @@ -3201,23 +3805,12 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou $('#aaDetailViewCanvas_'+windowviewid).setLayers({ fillStyle: radial, }).drawLayers(); - console.log(pinDataForTerm[0]._PinId); - var pinID = "PinArc_" + pinDataForTerm[0]._PinId; - + $scope.SetAAwindowStoreData(windowviewid,'clickedPins',[]); - var clickpin = []; - clickpin.push({ 'id': pinDataForTerm[0]._PinId }); - $scope.SetAAwindowStoreData(windowviewid, 'clickedPins', clickpin); - $scope.SetAAwindowStoreData(windowviewid, 'selectedPins', []); - var selectedPins = []; - selectedPins.push(pinDataForTerm[0]._PinId); - $scope.SetAAwindowStoreData(windowviewid, 'selectedPins', selectedPins); - - $scope.SetAAwindowStoreData(windowviewid,'activePinArray',[]); - var activePin = []; - activePin.push(pinID); - $scope.SetAAwindowStoreData(windowviewid,'activePinArray',activePin); + $scope.SetAAwindowStoreData(windowviewid,'activePinArray',[]); + //clear all cb data + $scope.SetAAwindowStoreData(windowviewid, 'CBselectedpinCordinate', []); $scope.showAnnotation(pinDataForTerm, false, false, true,false,windowviewid); // maintaing scroll position on selection of options in list manager. @@ -3229,23 +3822,48 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou } + $scope.MultipleAnnotation = function (event) { + var len= (event.currentTarget.id).split("_").length; + var windowviewid = (event.currentTarget.id).split("_")[len-1]; + + //set true to false or vice versa + var iskeyctrlActive= $scope.GetAAwindowStoreData(windowviewid, 'keyctrl'); + + $("#multiannotation_" + windowviewid).toggleClass("disableAAMultiAnnotationText"); + + if(iskeyctrlActive) + { + $("#multiannotation_"+windowviewid ).attr('title', 'Active Multiple Structure'); + } + else + { + $("#multiannotation_"+windowviewid ).attr('title', 'Disable Multiple Structure'); + } + + $scope.SetAAwindowStoreData(windowviewid, 'keyctrl', !iskeyctrlActive); + } + $scope.ShowHideAnnotation = function (event) { var len= (event.currentTarget.id).split("_").length; var windowviewid = (event.currentTarget.id).split("_")[len-1]; $rootScope.UnsaveCurriculum = true; var btnStrutureBoxname = document.getElementById("comment-box_"+windowviewid).name; + $("#comment-box_" + windowviewid).toggleClass("disableAAAnnotationText"); if (btnStrutureBoxname == "showAnnotationText") { - $("#comment-box_"+windowviewid).addClass("disableAnnotationText"); - document.getElementById("comment-box_"+windowviewid).name = "hideAnnotationText"; - $scope.SetAAwindowStoreData(windowviewid, 'showHideAnnotations', 'hideAnnotationText'); + $("#comment-box_"+windowviewid ).attr('title', 'Show Structure Name Boxes'); + $("#comment-box_"+windowviewid +" i").removeClass("far fa-comment-alt-times").addClass("far fa-comment-alt"); + $("#comment-box_"+windowviewid ).attr('name', 'hideAnnotationText'); + $scope.SetAAwindowStoreData(windowviewid, 'showHideAnnotations', 'hideAnnotationText'); } else { - $("#comment-box_"+windowviewid).removeClass("disableAnnotationText"); - document.getElementById("comment-box_"+windowviewid).name = "showAnnotationText"; + $("#comment-box_"+windowviewid ).attr('title', 'Hide Structure Name Boxes'); + $("#comment-box_"+windowviewid +" i").removeClass("far fa-comment-alt").addClass("far fa-comment-alt-times"); + $("#comment-box_"+windowviewid ).attr('name', 'showAnnotationText'); $scope.SetAAwindowStoreData(windowviewid, 'showHideAnnotations', 'showAnnotationText'); + } $scope.ShowHideAnnotationText(windowviewid); @@ -3263,7 +3881,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou } } else { - $("#comment-box_"+windowviewid).addClass("disableAnnotationText"); + $("#comment-box_"+windowviewid).addClass("disableAAAnnotationText"); for (var i = 0; i <= speechBubbleDimaensions.length - 1; i++) { $("#" + speechBubbleDimaensions[i].speechBuubleId).css("display", "none"); @@ -3454,10 +4072,28 @@ function onSearchAA(event) { console.log('AA search is called') var scope = angular.element(document.getElementById("aaBodyView")).scope(); scope.$apply(function () { - scope.showItemsForSearch(event); + var len= (event.currentTarget.id).split("_").length; + var windowviewid = (event.currentTarget.id).split("_")[len-1]; + + if((event.currentTarget.id).match('btnSearchAA')) + scope.showItemsForSearch(windowviewid,true); + else + { + scope.showItemsForSearch(windowviewid,false); + } + }); } +function changeaaSearchLanguage(event) { + event.stopPropagation(); + var scope = angular.element(document.getElementsByClassName("aaBodyView")).scope(); + scope.$apply(function () { + scope.changeaaSearchLanguage(event); + }); +} + + function hideSearchList(event) { console.log('AA hide search is called') var scope = angular.element(document.getElementById("aaBodyView")).scope(); @@ -3466,12 +4102,20 @@ function hideSearchList(event) { }); } -function onSearchItemSelection(termid) { +function resetSearchListView(event) { + console.log('AA keyup search is called') + var scope = angular.element(document.getElementById("aaBodyView")).scope(); + scope.$apply(function () { + scope.resetSearchListView(event); + }); +} + +function onSearchItemSelection(termid, isTermListOptionClicked) { console.log('AA hide search is called'); var scope = angular.element(document.getElementById("aaBodyView")).scope(); scope.$apply(function () { - scope.highlightPinBasedOnSerachItemEvent(termid); + scope.highlightPinBasedOnSerachItemEvent(termid,isTermListOptionClicked); }); } @@ -3484,6 +4128,14 @@ function showHideAnnotation(event) { }); } +function keyControlAAActive(event) { + + var scope = angular.element(document.getElementById("aaBodyView")).scope(); + scope.$apply(function () { + scope.MultipleAnnotation(event); + }); +} + function showSelectedPins(event) { console.log('showSelectedPins is called') diff --git a/400-SOURCECODE/AIAHTML5.Web/app/services/ModuleService.js b/400-SOURCECODE/AIAHTML5.Web/app/services/ModuleService.js index a28d357..2aeb186 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/services/ModuleService.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/services/ModuleService.js @@ -176,7 +176,8 @@ AIA.service('ModuleService', function ($http, DataService) { position: windowData.position, size: windowData.size, contextMenu: windowData.contextMenu, - annotationData: windowData.annotationData + annotationData: windowData.annotationData, + imgLeft:windowData.imgLeft }); } else if (windowData.mType == "MY_ANIMATIONS") { @@ -193,7 +194,7 @@ AIA.service('ModuleService', function ($http, DataService) { id: windowData.id, position: windowData.position, size: windowData.size, - contextMenu: windowData.contextMenu + contextMenu: windowData.contextMenu }); } else if (windowData.mType == "LAB_EXERCISE") { @@ -243,7 +244,8 @@ AIA.service('ModuleService', function ($http, DataService) { position: windowData.position, size: windowData.size, contextMenu: windowData.contextMenu, - annotationData: windowData.annotationData + annotationData: windowData.annotationData, + imgLeft:windowData.imgLeft }); } else if (windowData.mType == "CLINICAL_ANIMATIONS") { @@ -278,7 +280,8 @@ AIA.service('ModuleService', function ($http, DataService) { position: windowData.position, size: windowData.size, contextMenu: windowData.contextMenu, - annotationData: windowData.annotationData + annotationData: windowData.annotationData, + imgLeft:windowData.imgLeft }); } else if (windowData.mType == "ATLAS_ANATOMY") { @@ -305,8 +308,7 @@ AIA.service('ModuleService', function ($http, DataService) { size: windowData.size, contextMenu: windowData.contextMenu, showHideAnnotations: windowData.showHideAnnotations - // selectedSearchId: windowData.selectedSearchId - + }); } else if (windowData.mType == "DISSECTIBLE_ANATOMY") { @@ -354,7 +356,6 @@ AIA.service('ModuleService', function ($http, DataService) { transparencyY: windowData.transparencyY, layerNumberBeforeTBDraw: windowData.layerNumberBeforeTBDraw, showHideAnnotations: windowData.showHideAnnotations - }); } diff --git a/400-SOURCECODE/AIAHTML5.Web/app/views/AOD/AOD-view.html b/400-SOURCECODE/AIAHTML5.Web/app/views/AOD/AOD-view.html index 65742b7..eede1d5 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/views/AOD/AOD-view.html +++ b/400-SOURCECODE/AIAHTML5.Web/app/views/AOD/AOD-view.html @@ -1,7 +1,7 @@ 
    -
    +
    diff --git a/400-SOURCECODE/AIAHTML5.Web/app/views/CBuild/CBuild-view.html b/400-SOURCECODE/AIAHTML5.Web/app/views/CBuild/CBuild-view.html index f00d63f..f1c04b8 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/views/CBuild/CBuild-view.html +++ b/400-SOURCECODE/AIAHTML5.Web/app/views/CBuild/CBuild-view.html @@ -2,7 +2,7 @@
    -
    +
      diff --git a/400-SOURCECODE/AIAHTML5.Web/app/views/LabExerc/lab-exercises-detail.html b/400-SOURCECODE/AIAHTML5.Web/app/views/LabExerc/lab-exercises-detail.html index 258bcef..7c33025 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/views/LabExerc/lab-exercises-detail.html +++ b/400-SOURCECODE/AIAHTML5.Web/app/views/LabExerc/lab-exercises-detail.html @@ -1,4 +1,4 @@ -
      +
      @@ -119,109 +119,100 @@
      -
      - -
      -
      -
      -
      -
      -
      -
      -
      - Question of -
      +
      +
      +
      +
      +
      -
      -
      - - -
      - - -
    - -
    -
    + + +
    + +
    +
    +
    -
    +

    Zoom

    -
    +
    @@ -145,8 +153,8 @@
    - - + +
    diff --git a/400-SOURCECODE/AIAHTML5.Web/app/views/da/da-view.html b/400-SOURCECODE/AIAHTML5.Web/app/views/da/da-view.html index c9ebac3..8b6645b 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/views/da/da-view.html +++ b/400-SOURCECODE/AIAHTML5.Web/app/views/da/da-view.html @@ -212,7 +212,16 @@
    - + +
    + +
    +
    @@ -231,9 +240,10 @@
    -
    +