From 1ddf7575ab77f87d72dca1091961a3790ed565b5 Mon Sep 17 00:00:00 2001 From: nikita Date: Mon, 2 May 2016 17:55:34 +0530 Subject: [PATCH] all is working fine except toggle button in male anterior. in this commit. 1. layer change and Annoatations are working fine. --- 400-SOURCECODE/AIAHTML5.Web/Web.config | 2 +- 400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js | 1388 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ 400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js | 8 ++++---- 400-SOURCECODE/AIAHTML5.Web/app/main/AIA.js | 18 +++++++++--------- 400-SOURCECODE/AIAHTML5.Web/app/views/da/da-body-view.html | 12 +++++------- 400-SOURCECODE/AIAHTML5.Web/app/views/da/da-view.html | 76 ++++++++++++++++++++++++++++++++++++++++++++++------------------------------ 400-SOURCECODE/AIAHTML5.Web/app/widget/MainMenu.html | 2 +- 400-SOURCECODE/AIAHTML5.Web/app/widget/MainView.html | 2 +- 400-SOURCECODE/AIAHTML5.Web/content/css/main.css | 1 + 400-SOURCECODE/AIAHTML5.Web/index.html | 13 ++++++++----- 400-SOURCECODE/AIAHTML5.Web/libs/jquery/jquery_plugin/SpeechBubble/README.md | 15 +++++++++++++++ 400-SOURCECODE/AIAHTML5.Web/libs/jquery/jquery_plugin/SpeechBubble/browser.js | 278 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 400-SOURCECODE/AIAHTML5.Web/libs/jquery/jquery_plugin/SpeechBubble/bubble.js | 704 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 400-SOURCECODE/AIAHTML5.Web/libs/jquery/jquery_plugin/SpeechBubble/css/bubble.css | 142 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 400-SOURCECODE/AIAHTML5.Web/libs/jquery/jquery_plugin/SpeechBubble/demo.js | 20 ++++++++++++++++++++ 400-SOURCECODE/AIAHTML5.Web/libs/jquery/jquery_plugin/SpeechBubble/example.json | 4 ++++ 400-SOURCECODE/AIAHTML5.Web/libs/jquery/jquery_plugin/SpeechBubble/images/bubble/bottomLeftArrow.png | Bin 0 -> 880 bytes 400-SOURCECODE/AIAHTML5.Web/libs/jquery/jquery_plugin/SpeechBubble/images/bubble/bottomLeftArrow123.png | Bin 0 -> 778 bytes 400-SOURCECODE/AIAHTML5.Web/libs/jquery/jquery_plugin/SpeechBubble/images/bubble/bottomRightArrow.png | Bin 0 -> 1109 bytes 400-SOURCECODE/AIAHTML5.Web/libs/jquery/jquery_plugin/SpeechBubble/images/bubble/dismiss_icon.png | Bin 0 -> 3858 bytes 400-SOURCECODE/AIAHTML5.Web/libs/jquery/jquery_plugin/SpeechBubble/images/bubble/edit_icon.png | Bin 0 -> 883 bytes 400-SOURCECODE/AIAHTML5.Web/libs/jquery/jquery_plugin/SpeechBubble/images/bubble/topLeftArrow.png | Bin 0 -> 667 bytes 400-SOURCECODE/AIAHTML5.Web/libs/jquery/jquery_plugin/SpeechBubble/images/bubble/topRightArrow.png | Bin 0 -> 588 bytes 400-SOURCECODE/AIAHTML5.Web/libs/jquery/jquery_plugin/SpeechBubble/images/other/dot.gif | Bin 0 -> 43 bytes 400-SOURCECODE/AIAHTML5.Web/libs/jquery/jquery_plugin/SpeechBubble/index.html | 137 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 400-SOURCECODE/AIAHTML5.Web/libs/jquery/jquery_plugin/jsPanel/jspanel/jquery.jspanel.css | 5 +++++ 400-SOURCECODE/AIAHTML5.Web/libs/jquery/jquery_plugin/jsPanel/jspanel/jquery.jspanel.js | 354 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------------------------------------------------------------------------------------------------------------------------------------------------- 400-SOURCECODE/AIAHTML5.Web/login.html | 202 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----------------------------------------------------------------------------------------------------- 28 files changed, 2442 insertions(+), 941 deletions(-) create mode 100644 400-SOURCECODE/AIAHTML5.Web/libs/jquery/jquery_plugin/SpeechBubble/README.md create mode 100644 400-SOURCECODE/AIAHTML5.Web/libs/jquery/jquery_plugin/SpeechBubble/browser.js create mode 100644 400-SOURCECODE/AIAHTML5.Web/libs/jquery/jquery_plugin/SpeechBubble/bubble.js create mode 100644 400-SOURCECODE/AIAHTML5.Web/libs/jquery/jquery_plugin/SpeechBubble/css/bubble.css create mode 100644 400-SOURCECODE/AIAHTML5.Web/libs/jquery/jquery_plugin/SpeechBubble/demo.js create mode 100644 400-SOURCECODE/AIAHTML5.Web/libs/jquery/jquery_plugin/SpeechBubble/example.json create mode 100644 400-SOURCECODE/AIAHTML5.Web/libs/jquery/jquery_plugin/SpeechBubble/images/bubble/bottomLeftArrow.png create mode 100644 400-SOURCECODE/AIAHTML5.Web/libs/jquery/jquery_plugin/SpeechBubble/images/bubble/bottomLeftArrow123.png create mode 100644 400-SOURCECODE/AIAHTML5.Web/libs/jquery/jquery_plugin/SpeechBubble/images/bubble/bottomRightArrow.png create mode 100644 400-SOURCECODE/AIAHTML5.Web/libs/jquery/jquery_plugin/SpeechBubble/images/bubble/dismiss_icon.png create mode 100644 400-SOURCECODE/AIAHTML5.Web/libs/jquery/jquery_plugin/SpeechBubble/images/bubble/edit_icon.png create mode 100644 400-SOURCECODE/AIAHTML5.Web/libs/jquery/jquery_plugin/SpeechBubble/images/bubble/topLeftArrow.png create mode 100644 400-SOURCECODE/AIAHTML5.Web/libs/jquery/jquery_plugin/SpeechBubble/images/bubble/topRightArrow.png create mode 100644 400-SOURCECODE/AIAHTML5.Web/libs/jquery/jquery_plugin/SpeechBubble/images/other/dot.gif create mode 100644 400-SOURCECODE/AIAHTML5.Web/libs/jquery/jquery_plugin/SpeechBubble/index.html diff --git a/400-SOURCECODE/AIAHTML5.Web/Web.config b/400-SOURCECODE/AIAHTML5.Web/Web.config index 8411b91..03f5c84 100644 --- a/400-SOURCECODE/AIAHTML5.Web/Web.config +++ b/400-SOURCECODE/AIAHTML5.Web/Web.config @@ -38,7 +38,7 @@ - + diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js index e52db63..945c461 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js @@ -1,849 +1,977 @@ - -'use strict'; - -AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$log", "$location", "$timeout", "DA","Modules", "$routeParams", -function ($scope,$rootScope, $compile,$http, $log, $location, $timeout,DA,Modules,$routeParam ) { - - $scope.genderId = ""; - $scope.BodyViewData = null; - $scope.selectedGenderBodyViewData = null; - $scope.imagePath = ""; - $scope.BodyRegionData = null; - $scope.BodyRegionCordinatesData = null; - $scope.isTransparencyActivated = null; - $scope.BodyLayerData = null; - $scope.VocabTermData = null; - $scope.bodyViewId = 0; +'use strict'; + +AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$log", "$location", "$timeout", "DA", "Modules", "$routeParams", +function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Modules, $routeParam) { + + $scope.genderId = ""; + $scope.BodyViewData; + $scope.selectedGenderBodyViewData; + $scope.imagePath = ""; + $scope.BodyRegionData; + $scope.BodyRegionCordinatesData; + $scope.isTransparencyActivated; + $scope.BodyLayerData; + $scope.VocabTermData; + $scope.TermNumberData; + $scope.bodyViewId = 0; //view specific constants - $scope.voId ; - $scope.layerNo; - $scope.daCounter=1; - + $scope.voId; + $scope.layerNumber; + $scope.daCounter = 1; - //get the DA body view list based on selected gender - $scope.getDAViewList = function ($event) { - // debugger; - if ($('#MainImage') != null) { - $('#MainImage').remove(); - } - $rootScope.currentActiveModuleTitle = Modules[0].Name; - $("#bodyViewList").empty(); - //for default load - if ($event == null) { - $scope.genderId = "Male"; + //get the DA body view list based on selected gender + $scope.getDAViewList = function ($event) { + + // debugger; + if ($('#MainImage') != null) { + $('#MainImage').remove(); + } + $rootScope.currentActiveModuleTitle = Modules[0].Name; + $("#bodyViewList").empty(); + //for default load + if ($event == null) { + $scope.genderId = "Male"; + } + else { + $scope.genderId = $event.currentTarget.id; + } + if ($event != null) { + if ($event.currentTarget.id == "Male") { + $('#Male').addClass('active'); + $('#Female').removeClass("active"); } else { - $scope.genderId = $event.currentTarget.id; + $('#Female').addClass('active'); + $('#Male').removeClass("active"); } - if ($event != null) { - if ($event.currentTarget.id == "Male") { - $('#Male').addClass('active'); - $('#Female').removeClass("active"); - } - else{ - $('#Female').addClass('active'); - $('#Male').removeClass("active"); - } - - } - $scope.selectedGenderBodyViewData = new jinqJs() - .from($scope.BodyViewData.BodyViews.view) - .where('_gender == ' + $scope.genderId) - .select(); - - - angular.forEach($scope.selectedGenderBodyViewData, function (value, key) { - - var userEthnicity = DA[0].ethnicity; - var userModestysettings = DA[0].modesty; - var userSelectedSkintone = 'W'; - $scope.userModestySetting = 'Y' - var thumbnailImage; - if((value._id==1)||(value._id==3)|| (value._id==5)||(value._id==6)||(value._id==7)||(value._id==11)) - thumbnailImage = ((value._thumbnailImage).replace('.jpg', '_' + userEthnicity + userModestysettings)) + '.jpg'; - else { - thumbnailImage = ((value._thumbnailImage).replace('.jpg', '_' + userEthnicity)) + '.jpg'; - - } - - $scope.imagePath = "~/../content/images/DA/BodyViews/" + value._id + '/skintone/' + userEthnicity + '/' + thumbnailImage; - // debugger; - - var $el = $('
' - + '' - + '

' + value._title + '

').appendTo('#bodyViewList'); - - - $compile($el)($scope); - $(".sidebar").mCustomScrollbar({ - autoHideScrollbar: true, - //theme:"rounded" - }); - - }); - - }; - - - - $scope.openView = function ($event) { - // debugger; - $rootScope.currentBodyViewId = $event.currentTarget.id; - $rootScope.ViewTitle = $event.currentTarget.textContent; - - localStorage.setItem("currentViewTitleFromJson", $event.currentTarget.textContent); - localStorage.setItem("currentBodyViewId", $event.currentTarget.id); - - var u = $location.url(); - $location.url('/da-body-view'); - - - } - - //load json data for body view - $scope.loadDissectibleAnatomyData = function () { - - $rootScope.ClearIframe(); - //load bodyView data - $http({ method: 'GET', url: '~/../content/data/json/da_dat_contentlist.json' }).success(function (data) { - - $scope.BodyViewData = data; - //load default body view list for male - $scope.getDAViewList(); - - }) - .error(function (data, status, headers, config) { - console.log(data); - }); - - - - $('#daLoaderLabel').css('visibility', 'hidden') - - - $http({ method: 'GET', url: '~/../content/data/json/da_dat_tm_sg_1.json' }).success(function (data) { - $scope.TermNumberData = data; - - }) - .error(function (data, status, headers, config) { - console.log(data); - }); - - - //load vocabterm data - $http({ method: 'GET', url: '~/../content/data/json/cm_dat_vocabterm_1.json' }).success(function (data) { - $scope.VocabTermData = data; - }) - .error(function (data, status, headers, config) { - console.log(data); - }); - - //push the details of open module in array $rootScope.openModules - $rootScope.openModules.push( { "ModuleId": 1 } ); } + $scope.selectedGenderBodyViewData = new jinqJs() + .from($scope.BodyViewData.BodyViews.view) + .where('_gender == ' + $scope.genderId) + .select(); - //da-body-view functions + angular.forEach($scope.selectedGenderBodyViewData, function (value, key) { - $scope.openBodyView = function () { - - - var openViews; - var currentBodyViewId = localStorage.getItem("currentBodyViewId"); - // debugger; - if ($rootScope.openViews.length>0) { - openViews = new jinqJs() - .from($rootScope.openViews) - .where("BodyViewId==" + currentBodyViewId) - .select(); - } - var counter = 1; - - // var tittle = $rootScope.ViewTitle; - var tittle = localStorage.getItem("currentViewTitleFromJson"); - - if (openViews!=null && openViews.length > 0) - { - angular.forEach(openViews, function (value, key) { - - if (value.BodyView == tittle) { - tittle = localStorage.getItem("currentViewTitleFromJson") + counter++; - $rootScope.currentActiveViewTitle = tittle; - localStorage.setItem("currentViewTitle", tittle); - } - - }); - } + var userEthnicity = DA[0].ethnicity; + var userModestysettings = DA[0].modesty; + var userSelectedSkintone = 'W'; + $scope.userModestySetting = 'Y' + var thumbnailImage; + if ((value._id == 1) || (value._id == 3) || (value._id == 5) || (value._id == 6) || (value._id == 7) || (value._id == 11)) + thumbnailImage = ((value._thumbnailImage).replace('.jpg', '_' + userEthnicity + userModestysettings)) + '.jpg'; else { - localStorage.setItem("currentViewTitle", tittle); + thumbnailImage = ((value._thumbnailImage).replace('.jpg', '_' + userEthnicity)) + '.jpg'; + } - - - $.jsPanel({ - id: 'daImagePanel', - //selector: '.daView', - theme: 'success', - ajax: { - url: 'app/views/da/da-view.html' - }, - title: localStorage.getItem("currentViewTitle"), - // bootstrap: 'columns large-10 medium-9', - position: { - top: 70, //50, - left: 1, - // right: 0 - }, - //overflow: { horizontal: 'scroll', vertical: 'scroll' }, - - size: { width: $(window).outerWidth()-10 , height: $(window).outerHeight()-110 }, - //size: { width: 500, height: 500 }, + $scope.imagePath = "~/../content/images/DA/BodyViews/" + value._id + '/skintone/' + userEthnicity + '/' + thumbnailImage; + // debugger; + + var $el = $('
' + + '' + + '

' + value._title + '

').appendTo('#bodyViewList'); + + $compile($el)($scope); + $(".sidebar").mCustomScrollbar({ + autoHideScrollbar: true, + //theme:"rounded" }); - $scope.LoadDefaultLayerImage(); - // $rootScope.openViewsDA.push({ "ViewId": 1 }); - $rootScope.currentSlug = 'da-body-view'; - - //hide scrollbar + }); + }; - $rootScope.openViews.push( - { - "module": $rootScope.currentActiveModuleTitle, "BodyView": tittle, "state": 'max', "BodyViewId": $rootScope.currentBodyViewId, - "slug": $rootScope.currentSlug - } - ); - // debugger; - } - angular.element(document).ready(function () { + $scope.openView = function ($event) { + // debugger; + $rootScope.currentBodyViewId = $event.currentTarget.id; + $rootScope.ViewTitle = $event.currentTarget.textContent; + + localStorage.setItem("currentViewTitleFromJson", $event.currentTarget.textContent); + localStorage.setItem("currentBodyViewId", $event.currentTarget.id); + + var u = $location.url(); + $location.url('/da-body-view'); + + + } + + + //load json data for body view + $scope.loadDissectibleAnatomyData = function () { + + $rootScope.ClearIframe(); + //load bodyView data + $http({ method: 'GET', url: '~/../content/data/json/da_dat_contentlist.json' }).success(function (data) { + + $scope.BodyViewData = data; + //load default body view list for male + $scope.getDAViewList(); - }) - + .error(function (data, status, headers, config) { + console.log(data); + }); + $('#daLoaderLabel').css('visibility', 'hidden') + $http({ method: 'GET', url: '~/../content/data/json/da_dat_tm_sg_1.json' }).success(function (data) { + $scope.TermNumberData = data; + + }) + .error(function (data, status, headers, config) { + console.log(data); + }); + //load vocabterm data + $http({ method: 'GET', url: '~/../content/data/json/cm_dat_vocabterm_1.json' }).success(function (data) { + $scope.VocabTermData = data; + }) + .error(function (data, status, headers, config) { + console.log(data); + }); - $scope.LoadDefaultLayerImage = function () { - - $http({ method: 'GET', url: '~/../content/data/json/da_dat_brview.json' }).success(function (data) { - - $scope.BodyRegionData = data; - console.log($scope.BodyRegionData); - }) - .error(function (data, status, headers, config) { - console.log(data); - }); + //push the details of open module in array $rootScope.openModules + $rootScope.openModules.push({ "ModuleId": 1 }); + } - // Load Layer data - $http({ method: 'GET', url: '~/../content/data/json/da_dat_layer_1.json' }).success(function (data) { - // debugger - $scope.BodyLayerData = data; - console.log($scope.BodyLayerData); + //da-body-view functions + + $scope.openBodyView = function () { + + + //load json + $http({ method: 'GET', url: '~/../content/data/json/da_dat_tm_sg_1.json' }).success(function (data) { + $scope.TermNumberData = data; + }) + .error(function (data, status, headers, config) { + console.log(data); + }); + + + //load vocabterm data + $http({ method: 'GET', url: '~/../content/data/json/cm_dat_vocabterm_1.json' }).success(function (data) { + $scope.VocabTermData = data; + }) + .error(function (data, status, headers, config) { + console.log(data); + }); + + + + var openViews; + var currentBodyViewId = localStorage.getItem("currentBodyViewId"); + // debugger; + if ($rootScope.openViews.length > 0) { + openViews = new jinqJs() + .from($rootScope.openViews) + .where("BodyViewId==" + currentBodyViewId) + .select(); + } + var counter = 1; + + // var tittle = $rootScope.ViewTitle; + var tittle = localStorage.getItem("currentViewTitleFromJson"); + + if (openViews != null && openViews.length > 0) { + angular.forEach(openViews, function (value, key) { + + if (value.BodyView == tittle) { + tittle = localStorage.getItem("currentViewTitleFromJson") + counter++; + $rootScope.currentActiveViewTitle = tittle; + localStorage.setItem("currentViewTitle", tittle); + } - }) - .error(function (data, status, headers, config) { - console.log(data); }); - // debugger; + } + else { + localStorage.setItem("currentViewTitle", tittle); + } - $scope.voId = localStorage.getItem("currentBodyViewId");; - $scope.layerNo = 0; - $scope.skinTone = DA[0].ethnicity; - $timeout(function () { $scope.CalculateImageCordinates($scope.voId); }, 250); - }; + $.jsPanel({ + id: 'daImagePanel', + selector: '.daBodyView', + theme: 'success', + ajax: { + url: 'app/views/da/da-view.html' + }, + title: localStorage.getItem("currentViewTitle"), + position: { + top: 70, + left: 1, + }, + size: { width: $(window).outerWidth() - 10, height: $(window).outerHeight() - 110 }, - //calculate coordinates for body region images - $scope.CalculateImageCordinates = function (viewOrientationId) { + }); - //debugger; - //set height of canvas div and left tool bar as per window size - $scope.BodyRegionCordinatesData = []; // create an empty array - $('#canvasDiv').css('height', $('#daImagePanel').outerHeight() - 104) - //$('#canvasDiv').css('width', $('#daImagePanel').outerWidth() - 100) - $('#leftToolBar').css('height', $('#daImagePanel').outerHeight() ) - - //calculate image coordinates and draw image - var bodyRegionCoordinates = $scope.BodyRegionData.BodyRegionViews; - var viewOrientationId = String($scope.voId); + $scope.LoadDefaultLayerImage(); + // $rootScope.openViewsDA.push({ "ViewId": 1 }); + $rootScope.currentSlug = 'da-body-view'; - $scope.bodyRegionCoordinates = new jinqJs() - .from($scope.BodyRegionData.BodyRegionViews.BodyRegionCordinates) - .where('_ViewOrientationId == ' + viewOrientationId) - .select(); + //hide scrollbar - angular.forEach($scope.bodyRegionCoordinates, function (value, key) { + $rootScope.openViews.push( + { + "module": $rootScope.currentActiveModuleTitle, "BodyView": tittle, "state": 'max', "BodyViewId": $rootScope.currentBodyViewId, + "slug": $rootScope.currentSlug + } + ); + // debugger; - if (value._HaveMirrorImage == 'Y') { + var e1 = angular.element(document.getElementById("daBodyview")); + $timeout(function () { $compile(e1.contents())($scope) }, 250); + // $compile(e1.contents())($scope); - //DrawMirroredImage + $('#daBodyview').css("height", $(window).outerHeight()); + + $('#daBodyview').css("width", $(window).outerWidth()); + } - //0. Scaling as per default zoom - var rectangle = scaleRectangle(value._X, value._Y, value._Height, value._Width, value._MirrorValue); + angular.element(document).ready(function () { - //1.Get image source - var src = $scope.GetImageSource(value._BodyRegionId); - $scope.imageSource = src; - // debugger; - //2.Draw mirror image - $scope.DrawMirroredImage(Math.round(rectangle.scaledHeight), Math.round(rectangle.scaledWidth), Math.round(rectangle.scaledX), Math.round(rectangle.scaledY), src, value._BodyRegionId, 'N'); - // debugger; - $scope.BodyRegionCordinatesData.push( - { - "bodyRegionId": value._BodyRegionId, "Height": Math.round(rectangle.scaledHeight), "Width": Math.round(rectangle.scaledWidth), - "X": Math.round(rectangle.scaledX), "Y": Math.round(rectangle.scaledY), "IsMirror": 'Yes' - } - ); - //3.GetMaskImageSource - var maskImageSrc = $scope.GetMaskImageSource($scope.imageSource); - // debugger; - //4 Draw Mask Mirror Image - $scope.DrawMirroredImage(Math.round(rectangle.scaledHeight), Math.round(rectangle.scaledWidth), Math.round(rectangle.scaledX), Math.round(rectangle.scaledY), maskImageSrc, value._BodyRegionId, 'Y'); - + }) - //Draw Normal Image - //0. Scaling as per default zoom - var rectangle = scaleRectangle(value._X, value._Y, value._Height, value._Width, 0); - //1.Draw body region which have mirror image - $scope.DrawImage(Math.round(rectangle.scaledHeight), Math.round(rectangle.scaledWidth), Math.round(rectangle.scaledX), Math.round(rectangle.scaledY), src, value._BodyRegionId, 'N'); - $scope.BodyRegionCordinatesData.push( - { - "bodyRegionId": value._BodyRegionId, "Height": Math.round(rectangle.scaledHeight), "Width": Math.round(rectangle.scaledWidth), - "X": Math.round(rectangle.scaledX), "Y": Math.round(rectangle.scaledY), "IsMirror": 'No' - } - ); - //2.Draw body region for mask image - $scope.DrawImage(Math.round(rectangle.scaledHeight), Math.round(rectangle.scaledWidth), Math.round(rectangle.scaledX), Math.round(rectangle.scaledY), maskImageSrc, value._BodyRegionId, 'Y'); - - } - else { - //Draw body region which don't have mirror image - //0.Scaling as per default zoom - var rectangle = scaleRectangle(value._X, value._Y, value._Height, value._Width, value._MirrorValue); - //1.Get image source - var src = $scope.GetImageSource(value._BodyRegionId); - $scope.imageSource = src; - //2.Draw body region which don't have mirror image - $scope.DrawImage(Math.round(rectangle.scaledHeight), Math.round(rectangle.scaledWidth), Math.round(rectangle.scaledX), Math.round(rectangle.scaledY), src, value._BodyRegionId, 'N'); + $scope.LoadDefaultLayerImage = function () { + // debugger; + $http({ method: 'GET', url: '~/../content/data/json/da_dat_brview.json' }).success(function (data) { - $scope.BodyRegionCordinatesData.push( - { - "bodyRegionId": value._BodyRegionId, "Height": Math.round(rectangle.scaledHeight), "Width": Math.round(rectangle.scaledWidth), - "X": Math.round(rectangle.scaledX), "Y": Math.round(rectangle.scaledY), "IsMirror": 'No' - } - ); + $scope.BodyRegionData = data; + console.log($scope.BodyRegionData); + }) + .error(function (data, status, headers, config) { + console.log(data); + }); - //3.GetMaskImageSource - var maskSRC = $scope.GetMaskImageSource($scope.imageSource); - //4.Draw body region for mask image - $scope.DrawImage(Math.round(rectangle.scaledHeight), Math.round(rectangle.scaledWidth), Math.round(rectangle.scaledX), Math.round(rectangle.scaledY), maskSRC, value._BodyRegionId, 'Y'); - - } + // Load Layer data + $http({ method: 'GET', url: '~/../content/data/json/da_dat_layer_1.json' }).success(function (data) { + // debugger + $scope.BodyLayerData = data; + console.log($scope.BodyLayerData); + }) + .error(function (data, status, headers, config) { + console.log(data); + }); - }); + // debugger; - //set scrollbars on canvas and hide loading label - $('#daLoaderLabel').css('visibility', 'hidden') - $('#canvasDiv').css('overflow', 'scroll') - $('#canvasDiv').scrollLeft($('#canvasDiv').width() / 2) - // $('#canvasDiv').scrollLeft($scope.imageHorizontlScrollPosition) - $('#canvasDiv').scrollTop(50) - var abc = $scope.BodyRegionCordinatesData - } + $scope.voId = localStorage.getItem("currentBodyViewId");; + $scope.layerNumber = 0; + $scope.skinTone = DA[0].ethnicity; - function scaleRectangle(x, y, height, width, mirrorValue) { - var nzoom = 75; - var existingZoon = 100; + $timeout(function () { $scope.CalculateImageCordinates($scope.voId); }, 250); - var X = 0; - var scaledY = 0; - var scaledHeight = 0; - var scaledWidth = 0; - if (mirrorValue != 0) { - var mirroredX = parseInt(mirrorValue) + parseInt(x); - var newX = (mirroredX * nzoom); - mirroredX = (newX / existingZoon); - X = mirroredX; - } - else { - var newX = (x * nzoom); - X = (newX / existingZoon); - } + }; - var newY = (y * nzoom); - var Y = (newY / existingZoon); - var newHeight = (height * nzoom); - var ht = (newHeight / existingZoon); + //calculate coordinates for body region images + $scope.CalculateImageCordinates = function (viewOrientationId) { - var newWidth = (width * nzoom); - var wt = (newWidth / existingZoon); + // debugger; + //set height of canvas div and left tool bar as per window size + $scope.BodyRegionCordinatesData = []; // create an empty array - return { - scaledX: X, - scaledY: Y, - scaledHeight: ht, - scaledWidth: wt - } - } + $('#canvasDiv').css('height', $('#daImagePanel').outerHeight() - 104) + //$('#canvasDiv').css('width', $('#daImagePanel').outerWidth() - 100) + $('#leftToolBar').css('height', $('#daImagePanel').outerHeight()) - $scope.GetMaskImageSource = function (src) { - var mciImage = src.replace('.jpg', '_mci.png') - return mciImage; - } + //calculate image coordinates and draw image + var bodyRegionCoordinates = $scope.BodyRegionData.BodyRegionViews; + var viewOrientationId = String($scope.voId); - $scope.GetImageSource = function (bodyRegionId) { - // debugger; - var dataLength = $scope.BodyLayerData.Layers.DataLayer.length; - //set max for LayerNumber input - $scope.totalLayers = dataLength - 1; + $scope.bodyRegionCoordinates = new jinqJs() + .from($scope.BodyRegionData.BodyRegionViews.BodyRegionCordinates) + .where('_ViewOrientationId == ' + viewOrientationId) + .select(); - $('#txtLayerNumber').attr('max', $scope.totalLayers); + angular.forEach($scope.bodyRegionCoordinates, function (value, key) { - $scope.one = 1; - $scope.userInput = parseInt($scope.layerNo); + if (value._HaveMirrorImage == 'Y') { + //DrawMirroredImage - var SelectedLayerData = []; - SelectedLayerData = $scope.BodyLayerData.Layers.DataLayer[dataLength - $scope.userInput - 1]; - if ($scope.layerNo == 0) { - for (var z = 0; z <= SelectedLayerData.BodyRegion.length; z++) { + //0. Scaling as per default zoom + var rectangle = scaleRectangle(value._X, value._Y, value._Height, value._Width, value._MirrorValue); - var bodyRegion = SelectedLayerData.BodyRegion[z]._BodyRegionId; - var bodyRegionSkinTone = SelectedLayerData.BodyRegion[z].Image._SkintTone; + //1.Get image source + var src = $scope.GetImageSource(value._BodyRegionId); + $scope.imageSource = src; + // debugger; + //2.Draw mirror image + $scope.DrawMirroredImage(Math.round(rectangle.scaledHeight), Math.round(rectangle.scaledWidth), Math.round(rectangle.scaledX), Math.round(rectangle.scaledY), src, value._BodyRegionId, 'N'); + // debugger; + $scope.BodyRegionCordinatesData.push( + { + "bodyRegionId": value._BodyRegionId, "Height": Math.round(rectangle.scaledHeight), "Width": Math.round(rectangle.scaledWidth), + "X": Math.round(rectangle.scaledX), "Y": Math.round(rectangle.scaledY), "IsMirror": 'Yes' + } + ); - if (bodyRegion == bodyRegionId && bodyRegionSkinTone == $scope.skinTone) { + //3.GetMaskImageSource + var maskImageSrc = $scope.GetMaskImageSource($scope.imageSource); + // debugger; + //4 Draw Mask Mirror Image + $scope.DrawMirroredImage(Math.round(rectangle.scaledHeight), Math.round(rectangle.scaledWidth), Math.round(rectangle.scaledX), Math.round(rectangle.scaledY), maskImageSrc, value._BodyRegionId, 'Y'); - return "content/images/DA/BodyViews/" + $scope.voId + "/layers/" + $scope.layerNo + "/" + bodyRegionId + "/" + $scope.skinTone + "/" + SelectedLayerData.BodyRegion[z].Image._ImageName; - } - } - } - else { - for (z = 0; z <= SelectedLayerData.BodyRegion.length; z++) { - var bodyRegion = SelectedLayerData.BodyRegion[z]._BodyRegionId; - if (bodyRegion == bodyRegionId) { - return "content/images/DA/BodyViews/" + $scope.voId + "/layers/" + $scope.layerNo + "/" + bodyRegionId + "/" + SelectedLayerData.BodyRegion[z].Image._ImageName; - } - } - } - } + //Draw Normal Image + //0. Scaling as per default zoom + var rectangle = scaleRectangle(value._X, value._Y, value._Height, value._Width, 0); - $scope.DrawMirroredImage = function (h, w, x, y, src, bodyRegionId, isMaskImage) { + //1.Draw body region which have mirror image + $scope.DrawImage(Math.round(rectangle.scaledHeight), Math.round(rectangle.scaledWidth), Math.round(rectangle.scaledX), Math.round(rectangle.scaledY), src, value._BodyRegionId, 'N'); + $scope.BodyRegionCordinatesData.push( + { + "bodyRegionId": value._BodyRegionId, "Height": Math.round(rectangle.scaledHeight), "Width": Math.round(rectangle.scaledWidth), + "X": Math.round(rectangle.scaledX), "Y": Math.round(rectangle.scaledY), "IsMirror": 'No' + } + ); - var FlipedImgCanvas = document.createElement('canvas'); - FlipedImgCanvas.height = h; - FlipedImgCanvas.width = w; - FlipedImgCanvas.setAttribute("data-IsMirrored", "Y") - FlipedImgCanvas.style.position = "absolute"; - FlipedImgCanvas.style.left = x + "px"; - FlipedImgCanvas.style.top = y + "px"; + //2.Draw body region for mask image + $scope.DrawImage(Math.round(rectangle.scaledHeight), Math.round(rectangle.scaledWidth), Math.round(rectangle.scaledX), Math.round(rectangle.scaledY), maskImageSrc, value._BodyRegionId, 'Y'); - if (isMaskImage == 'Y') { - FlipedImgCanvas.id = 'imageCanvas' + bodyRegionId + '_MR_mci'; - FlipedImgCanvas.style.visibility = 'hidden' } else { - FlipedImgCanvas.id = 'imageCanvas' + bodyRegionId + '_MR'; - FlipedImgCanvas.style.visibility = 'visible' + //Draw body region which don't have mirror image + + //0.Scaling as per default zoom + var rectangle = scaleRectangle(value._X, value._Y, value._Height, value._Width, value._MirrorValue); + + //1.Get image source + var src = $scope.GetImageSource(value._BodyRegionId); + $scope.imageSource = src; + + //2.Draw body region which don't have mirror image + $scope.DrawImage(Math.round(rectangle.scaledHeight), Math.round(rectangle.scaledWidth), Math.round(rectangle.scaledX), Math.round(rectangle.scaledY), src, value._BodyRegionId, 'N'); + + $scope.BodyRegionCordinatesData.push( + { + "bodyRegionId": value._BodyRegionId, "Height": Math.round(rectangle.scaledHeight), "Width": Math.round(rectangle.scaledWidth), + "X": Math.round(rectangle.scaledX), "Y": Math.round(rectangle.scaledY), "IsMirror": 'No' + } + ); + + //3.GetMaskImageSource + var maskSRC = $scope.GetMaskImageSource($scope.imageSource); + + //4.Draw body region for mask image + $scope.DrawImage(Math.round(rectangle.scaledHeight), Math.round(rectangle.scaledWidth), Math.round(rectangle.scaledX), Math.round(rectangle.scaledY), maskSRC, value._BodyRegionId, 'Y'); } - FlipedImgCanvas.addEventListener('click', function (evt) { - //get mouse coordinate of mirror image click - var mousePos = getMousePos(evt); - //alert(mousePos.x + ',' + mousePos.y); - var context = FlipedImgCanvas.getContext("2d"); - var canvasId = context.canvas.getAttribute('id'); + }); - var mirrorCanvasX = context.canvas.offsetLeft; - var mirrorCanvasWidth = context.canvas.clientWidth; + //set scrollbars on canvas and hide loading label + $('#daLoaderLabel').css('visibility', 'hidden') + $('#canvasDiv').css('overflow', 'scroll') + $('#canvasDiv').scrollLeft($('#canvasDiv').width() / 2) + // $('#canvasDiv').scrollLeft($scope.imageHorizontlScrollPosition) + $('#canvasDiv').scrollTop(50) + var abc = $scope.BodyRegionCordinatesData; + // debugger; + $('#layerChangeSlider').slider("option", "value", parseInt($scope.totalLayers) - parseInt($scope.layerNumber)); - var maskCanvasId = (canvasId.replace('_MR', '')) + '_mci'; - var maskCanvas = document.getElementById(maskCanvasId); - var canvasContextForRGB = maskCanvas.getContext("2d"); + } - var canvasDiv = document.getElementById('canvasDiv'); - var verticalScrollPosition = canvasDiv.scrollTop; - var horizontlScrollPosition = canvasDiv.scrollLeft; + function scaleRectangle(x, y, height, width, mirrorValue) { + var nzoom = 75; + var existingZoon = 100; - var distanceXOnMirrorImage = (parseInt(mirrorCanvasX) + parseInt(mirrorCanvasWidth)) - (parseInt(mousePos.x) + horizontlScrollPosition);// - 135); + var X = 0; + var scaledY = 0; + var scaledHeight = 0; + var scaledWidth = 0; - var mirrorXOnNormalImage = parseInt(canvasContextForRGB.canvas.offsetLeft) + parseInt(distanceXOnMirrorImage); + if (mirrorValue != 0) { + var mirroredX = parseInt(mirrorValue) + parseInt(x); + var newX = (mirroredX * nzoom); + mirroredX = (newX / existingZoon); + X = mirroredX; + } + else { + var newX = (x * nzoom); + X = (newX / existingZoon); + } - var actulalX = mirrorXOnNormalImage - var actualY = mousePos.y + verticalScrollPosition + var newY = (y * nzoom); + var Y = (newY / existingZoon); + var newHeight = (height * nzoom); + var ht = (newHeight / existingZoon); + var newWidth = (width * nzoom); + var wt = (newWidth / existingZoon); + return { + scaledX: X, + scaledY: Y, + scaledHeight: ht, + scaledWidth: wt + } + } - var pixelData = canvasContextForRGB.getImageData(Math.round(actulalX - parseInt(canvasContextForRGB.canvas.offsetLeft)), Math.round(actualY - y), 1, 1); + $scope.GetMaskImageSource = function (src) { + var mciImage = src.replace('.jpg', '_mci.png') + return mciImage; - pixelData.data[0] = pixelData.data[0] - 9; - pixelData.data[1] = pixelData.data[1] - 9; - pixelData.data[2] = pixelData.data[2] - 9 + } - var Red; - var Green; - var Blue; - var zero = "0"; - if ((pixelData.data[0]).toString().length != 2) { - Red = zero.concat((pixelData.data[0]).toString()) - } - else { - Red = (pixelData.data[0]).toString() - } - if ((pixelData.data[1]).toString().length != 2) { - Green = zero.concat((pixelData.data[1]).toString()) - } - else { - Green = (pixelData.data[1]).toString() + $scope.GetImageSource = function (bodyRegionId) { + // debugger; + var dataLength = $scope.BodyLayerData.Layers.DataLayer.length; - } - if ((pixelData.data[2]).toString().length != 2) { - Blue = zero.concat((pixelData.data[2]).toString()) - } - else { - Blue = (pixelData.data[2]).toString() + //set max for LayerNumber input + $scope.totalLayers = dataLength - 1; - } - var RGBColor = (Red + Green + Blue); + $('#txtLayerNumber').attr('max', $scope.totalLayers); + $('#layerChangeSlider').slider("option", "max", $scope.totalLayers); + // $('#layerChangeSlider').slider("option", "value",parseInt($scope.totalLayers)-parseInt($scope.layerNumber)); + $scope.one = 1; - var annotationText = $scope.GetAnnotationText(parseInt(RGBColor)); + $scope.userInput = parseInt($scope.layerNumber); - if ($('#speechBubble').length > 0) { - $('#speechBubble').remove(); - createSpeechBubble(evt, annotationText, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left + 5, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top - 50) + var SelectedLayerData = []; + SelectedLayerData = $scope.BodyLayerData.Layers.DataLayer[dataLength - $scope.userInput - 1]; + if ($scope.layerNumber == 0) { + for (var z = 0; z <= SelectedLayerData.BodyRegion.length; z++) { - } - else - createSpeechBubble(evt, annotationText, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left + 5, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top - 50) + var bodyRegion = SelectedLayerData.BodyRegion[z]._BodyRegionId; + var bodyRegionSkinTone = SelectedLayerData.BodyRegion[z].Image._SkintTone; + if (bodyRegion == bodyRegionId && bodyRegionSkinTone == $scope.skinTone) { + return "content/images/DA/BodyViews/" + $scope.voId + "/layers/" + $scope.layerNumber + "/" + bodyRegionId + "/" + $scope.skinTone + "/" + SelectedLayerData.BodyRegion[z].Image._ImageName; + } + } + } + + else { + for (z = 0; z <= SelectedLayerData.BodyRegion.length; z++) { + var bodyRegion = SelectedLayerData.BodyRegion[z]._BodyRegionId; + if (bodyRegion == bodyRegionId) { + return "content/images/DA/BodyViews/" + $scope.voId + "/layers/" + $scope.layerNumber + "/" + bodyRegionId + "/" + SelectedLayerData.BodyRegion[z].Image._ImageName; + } + } + } + } - }, false); - FlipedImgCanvas.addEventListener('mousedown', function (evt) { + $scope.DrawMirroredImage = function (h, w, x, y, src, bodyRegionId, isMaskImage) { - //alert('mousedown') - }, false); + var FlipedImgCanvas = document.createElement('canvas'); + FlipedImgCanvas.height = h; + FlipedImgCanvas.width = w; + FlipedImgCanvas.setAttribute("data-IsMirrored", "Y") + FlipedImgCanvas.style.position = "absolute"; + FlipedImgCanvas.style.left = x + "px"; + FlipedImgCanvas.style.top = y + "px"; + if (isMaskImage == 'Y') { + FlipedImgCanvas.id = 'imageCanvas' + bodyRegionId + '_MR_mci'; + FlipedImgCanvas.style.visibility = 'hidden' - FlipedImgCanvas.addEventListener('mouseup', function (evt) { - //alert('mouseup') + } + else { + FlipedImgCanvas.id = 'imageCanvas' + bodyRegionId + '_MR'; + FlipedImgCanvas.style.visibility = 'visible' + } + FlipedImgCanvas.addEventListener('click', function (evt) { - }, false); + //get mouse coordinate of mirror image click + var mousePos = $scope.getMousePos(evt); + //alert(mousePos.x + ',' + mousePos.y); var context = FlipedImgCanvas.getContext("2d"); + var canvasId = context.canvas.getAttribute('id'); - var PI = Math.PI; - var PI2 = PI * 2; - var cw, ch, imgW, imgH, mouseX, mouseY; - var scaleFactor = 1.00; + var mirrorCanvasX = context.canvas.offsetLeft; + var mirrorCanvasWidth = context.canvas.clientWidth; - //$scaler = $("#scaler"); - //$scaler.val(scaleFactor); - //$scaler.hide(); + var maskCanvasId = (canvasId.replace('_MR', '')) + '_mci'; + var maskCanvas = document.getElementById(maskCanvasId); + var canvasContextForRGB = maskCanvas.getContext("2d"); - var img = new Image(); - img.onload = start; - // img.src = "~/../content/images/" + src;; - img.src = src; - console.log("img.src: " + img.src); - console.log("src: " + src); + var canvasDiv = document.getElementById('canvasDiv'); + var verticalScrollPosition = canvasDiv.scrollTop; + var horizontlScrollPosition = canvasDiv.scrollLeft; + var distanceXOnMirrorImage = (parseInt(mirrorCanvasX) + parseInt(mirrorCanvasWidth)) - (parseInt(mousePos.x) + horizontlScrollPosition);// - 135); - function start() { - context.save(); - context.translate(w, 0); - context.scale(-1, 1); - context.drawImage(img, 0, 0); - context.restore(); + var mirrorXOnNormalImage = parseInt(canvasContextForRGB.canvas.offsetLeft) + parseInt(distanceXOnMirrorImage); + var actulalX = mirrorXOnNormalImage + var actualY = mousePos.y + verticalScrollPosition - }; - document.getElementById('canvasDiv').appendChild(FlipedImgCanvas); - } + var pixelData = canvasContextForRGB.getImageData(Math.round(actulalX - parseInt(canvasContextForRGB.canvas.offsetLeft)), Math.round(actualY - y), 1, 1); - $scope.DrawImage = function (h, w, x, y, src, bodyRegionId, isMaskImage) { + pixelData.data[0] = pixelData.data[0] - 9; + pixelData.data[1] = pixelData.data[1] - 9; + pixelData.data[2] = pixelData.data[2] - 9 - var imgCanvas = document.createElement('canvas'); - // imgCanvas.style.backgroundColor = 'red'; - imgCanvas.height = h; - imgCanvas.width = w; - imgCanvas.setAttribute("data-IsMirrored", "N") - imgCanvas.style.position = "absolute"; - imgCanvas.style.left = x + "px"; - imgCanvas.style.top = y + "px"; - if (isMaskImage == 'Y') { - imgCanvas.style.visibility = 'hidden' - imgCanvas.id = 'imageCanvas' + bodyRegionId + '_mci'; + var Red; + var Green; + var Blue; + var zero = "0"; + if ((pixelData.data[0]).toString().length != 2) { + Red = zero.concat((pixelData.data[0]).toString()) } else { - imgCanvas.id = 'imageCanvas' + bodyRegionId; - imgCanvas.style.visibility = 'visible' + Red = (pixelData.data[0]).toString() + } + if ((pixelData.data[1]).toString().length != 2) { + Green = zero.concat((pixelData.data[1]).toString()) + } + else { + Green = (pixelData.data[1]).toString() } - imgCanvas.addEventListener('click', function (evt) { + if ((pixelData.data[2]).toString().length != 2) { + Blue = zero.concat((pixelData.data[2]).toString()) + } + else { + Blue = (pixelData.data[2]).toString() + } + var RGBColor = (Red + Green + Blue); - var context = imgCanvas.getContext("2d"); + var annotationText = $scope.GetAnnotationText(parseInt(RGBColor)); + if ($('#speechBubble').length > 0) { + $('#speechBubble').remove(); - var canvasId = context.canvas.getAttribute('id'); + $scope.createSpeechBubble(evt, annotationText, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left + 5, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top - 50) - var maskCanvasId = canvasId + '_mci'; - var maskCanvas = document.getElementById(maskCanvasId); - var canvasContextForRGB = maskCanvas.getContext("2d"); + } + else + $scope.createSpeechBubble(evt, annotationText, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left + 5, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top - 50) - var mousePos = getMousePos(evt); - // alert(mousePos.x + ',' + mousePos.y); - var canvasDiv = document.getElementById('canvasDiv'); - var verticalScrollPosition = canvasDiv.scrollTop; - var horizontlScrollPosition = canvasDiv.scrollLeft; + }, false); + FlipedImgCanvas.addEventListener('mousedown', function (evt) { - //We substracted 135, as the difference between flex and html coordinates for same organ is 135 - var actulalX = mousePos.x + horizontlScrollPosition// - 135;// + leftToolBarWidth; - var actualY = mousePos.y + verticalScrollPosition //- 135; //+ tomenuBarheight + titleBarheight + searchComboheight; + //alert('mousedown') + }, false); + FlipedImgCanvas.addEventListener('mouseup', function (evt) { + //alert('mouseup') - var pixelData = canvasContextForRGB.getImageData(Math.round(actulalX - x), Math.round(actualY - y), 1, 1); - pixelData.data[0] = pixelData.data[0] - 9; - pixelData.data[1] = pixelData.data[1] - 9; - pixelData.data[2] = pixelData.data[2] - 9; - var Red; - var Green; - var Blue; - var zero = "0"; + }, false); - if ((pixelData.data[0]).toString().length != 2) { - Red = zero.concat((pixelData.data[0]).toString()) - } - else { - Red = (pixelData.data[0]).toString() - } - if ((pixelData.data[1]).toString().length != 2) { - Green = zero.concat((pixelData.data[1]).toString()) - } - else { - Green = (pixelData.data[1]).toString() + var context = FlipedImgCanvas.getContext("2d"); - } - if ((pixelData.data[2]).toString().length != 2) { - Blue = zero.concat((pixelData.data[2]).toString()) - } - else { - Blue = (pixelData.data[2]).toString() + var PI = Math.PI; + var PI2 = PI * 2; + var cw, ch, imgW, imgH, mouseX, mouseY; + var scaleFactor = 1.00; - } - var RGBColor = (Red + Green + Blue); + //$scaler = $("#scaler"); + //$scaler.val(scaleFactor); + //$scaler.hide(); + var img = new Image(); + img.onload = start; - var annotationText = $scope.GetAnnotationText(parseInt(RGBColor)); + // img.src = "~/../content/images/" + src;; + img.src = src; + console.log("img.src: " + img.src); + console.log("src: " + src); - if ($('#speechBubble').length > 0) { - $('#speechBubble').remove(); - createSpeechBubble(evt, annotationText, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left + 5, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top - 50) + function start() { + context.save(); + context.translate(w, 0); + context.scale(-1, 1); + context.drawImage(img, 0, 0); + context.restore(); - } - else - createSpeechBubble(evt, annotationText, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left + 5, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top - 50) + }; + + document.getElementById('canvasDiv').appendChild(FlipedImgCanvas); - }, false); + } + $scope.DrawImage = function (h, w, x, y, src, bodyRegionId, isMaskImage) { + var imgCanvas = document.createElement('canvas'); + // imgCanvas.style.backgroundColor = 'red'; + imgCanvas.height = h; + imgCanvas.width = w; + imgCanvas.setAttribute("data-IsMirrored", "N") + imgCanvas.style.position = "absolute"; + imgCanvas.style.left = x + "px"; + imgCanvas.style.top = y + "px"; + if (isMaskImage == 'Y') { + imgCanvas.style.visibility = 'hidden' + imgCanvas.id = 'imageCanvas' + bodyRegionId + '_mci'; - var PI = Math.PI; - var PI2 = PI * 2; - var cw, ch, imgW, imgH, mouseX, mouseY; - var scaleFactor = 1.00; + } + else { + imgCanvas.id = 'imageCanvas' + bodyRegionId; + imgCanvas.style.visibility = 'visible' - //$scaler = $("#scaler"); - //$scaler.val(scaleFactor); - //$scaler.hide(); + } + imgCanvas.addEventListener('click', function (evt) { - var context = imgCanvas.getContext('2d'); - var img = new Image(); - img.onload = start; - img.src = src; - // img.src = img.src = "~/../content/images/" + src; - console.log("img.src: " + img.src); - console.log("src: " + src); + // debugger; + var context = imgCanvas.getContext("2d"); + var canvasId = context.canvas.getAttribute('id'); - function start() { + var maskCanvasId = canvasId + '_mci'; + var maskCanvas = document.getElementById(maskCanvasId); + var canvasContextForRGB = maskCanvas.getContext("2d"); - context.drawImage(img, 0, 0); - }; - $('#daLoaderLabel').css('visibility', 'visible') - document.getElementById('canvasDiv').appendChild(imgCanvas); - } + var mousePos = $scope.getMousePos(evt); + // alert(mousePos.x + ',' + mousePos.y); - //get annotation from term number - $scope.GetAnnotationText = function (termNumber) { - - var annotationText; - //0 - var figLeafTermNo = 5868; // to do declare constant for this - - if (parseInt(termNumber) != parseInt(figLeafTermNo)) { - $scope.TermNumber = termNumber; - $scope.matchedTermNoData = new jinqJs() - .from($scope.TermNumberData.TermData.Term) - .where('_TermNumber == ' + termNumber) - .select(); - //1. - var actualTermNo = 0; - for (z = 0; z <= $scope.matchedTermNoData.length; z++) { - //send actual term no to get the term text. - actualTermNo = $scope.matchedTermNoData[0]._ActualTermNumber; - annotationText = $scope.GetAnnotationBasedOnActualTermNo(actualTermNo); - break; - }; - - //2. + var canvasDiv = document.getElementById('canvasDiv'); + var verticalScrollPosition = canvasDiv.scrollTop; + var horizontlScrollPosition = canvasDiv.scrollLeft; + + + //We substracted 135, as the difference between flex and html coordinates for same organ is 135 + var actulalX = mousePos.x + horizontlScrollPosition// - 135;// + leftToolBarWidth; + var actualY = mousePos.y + verticalScrollPosition //- 135; //+ tomenuBarheight + titleBarheight + searchComboheight; + + + + var pixelData = canvasContextForRGB.getImageData(Math.round(actulalX - x), Math.round(actualY - y), 1, 1); + + pixelData.data[0] = pixelData.data[0] - 9; + pixelData.data[1] = pixelData.data[1] - 9; + pixelData.data[2] = pixelData.data[2] - 9; + var Red; + var Green; + var Blue; + var zero = "0"; + if ((pixelData.data[0]).toString().length != 2) { + Red = zero.concat((pixelData.data[0]).toString()) } else { - // send term no to vocab json data to get the text + Red = (pixelData.data[0]).toString() } - return annotationText; - } + if ((pixelData.data[1]).toString().length != 2) { + Green = zero.concat((pixelData.data[1]).toString()) + } + else { + Green = (pixelData.data[1]).toString() + + } + if ((pixelData.data[2]).toString().length != 2) { + Blue = zero.concat((pixelData.data[2]).toString()) + } + else { + Blue = (pixelData.data[2]).toString() + + } + var RGBColor = (Red + Green + Blue); + + + var annotationText = $scope.GetAnnotationText(parseInt(RGBColor)); + + if ($('#speechBubble').length > 0) { + $('#speechBubble').remove(); + + $scope.createSpeechBubble(evt, annotationText, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left + 5, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top - 50) + + } + else + $scope.createSpeechBubble(evt, annotationText, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left + 5, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top - 50) + + + }, false); + + + + + var PI = Math.PI; + var PI2 = PI * 2; + var cw, ch, imgW, imgH, mouseX, mouseY; + var scaleFactor = 1.00; + + //$scaler = $("#scaler"); + //$scaler.val(scaleFactor); + //$scaler.hide(); + + var context = imgCanvas.getContext('2d'); + var img = new Image(); + img.onload = start; + + img.src = src; + // img.src = img.src = "~/../content/images/" + src; + console.log("img.src: " + img.src); + console.log("src: " + src); + - $scope.GetAnnotationBasedOnActualTermNo = function (actualTermNo) { - var Annotation; - $scope.ActualTermNo = actualTermNo; + function start() { - $scope.matchedActualTermData = new jinqJs() - .from($scope.VocabTermData.VocabTerms.Term) - .where('_ActualTermNumber == ' + actualTermNo) + context.drawImage(img, 0, 0); + }; + $('#daLoaderLabel').css('visibility', 'visible') + document.getElementById('canvasDiv').appendChild(imgCanvas); + + } + + //get annotation from term number + $scope.GetAnnotationText = function (termNumber) { + // debugger; + + var annotationText; + //0 + var figLeafTermNo = 5868; // to do declare constant for this + + if (parseInt(termNumber) != parseInt(figLeafTermNo)) { + $scope.TermNumber = termNumber; + $scope.matchedTermNoData = new jinqJs() + .from($scope.TermNumberData.TermData.Term) + .where('_TermNumber == ' + termNumber) .select(); - for (z = 0; z <= $scope.matchedActualTermData.length; z++) { + //1. + var actualTermNo = 0; + for (var z = 0; z <= $scope.matchedTermNoData.length; z++) { //send actual term no to get the term text. - Annotation = $scope.matchedActualTermData[0]._TermText; - // alert("Annotation : " + Annotation); + actualTermNo = $scope.matchedTermNoData[0]._ActualTermNumber; + annotationText = $scope.GetAnnotationBasedOnActualTermNo(actualTermNo); break; }; - return Annotation; + + //2. + + } + else { + // send term no to vocab json data to get the text } + return annotationText; + } + + $scope.GetAnnotationBasedOnActualTermNo = function (actualTermNo) { + // debugger; + + var Annotation; + $scope.ActualTermNo = actualTermNo; + + $scope.matchedActualTermData = new jinqJs() + .from($scope.VocabTermData.VocabTerms.Term) + .where('_ActualTermNumber == ' + actualTermNo) + .select(); + for (var z = 0; z <= $scope.matchedActualTermData.length; z++) { + //send actual term no to get the term text. + Annotation = $scope.matchedActualTermData[0]._TermText; + // alert("Annotation : " + Annotation); + break; + }; + return Annotation; + } //layer change function - $scope.LayerChange = function () { - alert('layer changed'); + $scope.LayerChange = function () { + + var canvasDiv = document.getElementById('canvasDiv'); + $scope.imageVerticalScrollPosition = canvasDiv.scrollTop; + $scope.imageHorizontlScrollPosition = canvasDiv.scrollLeft; + + + $('#daLoaderLabel').css('visibility', 'visible') + var canDiv = document.getElementById('canvasDiv'); + var canDivChildCount = canDiv.childElementCount; + if (canDivChildCount > 0) { + canDiv.innerHTML = ''; } + $scope.CalculateImageCordinates($scope.voId); + + + $('#canvasDiv').scrollLeft($scope.imageHorizontlScrollPosition) + $('#canvasDiv').scrollTop($scope.imageVerticalScrollPosition) + + } //called on jspanel close - $scope.openParent = function () { - // debugger; - var openViews = $rootScope.openViews; - if (openViews.length > 0) { - $rootScope.openViews.splice(openViews.length - 1); - } - if (openViews.length > 0) { - var lastOpenMoudle = $rootScope.openViews[openViews.length - 1]; - } - $('#daImagePanel').remove(); - $location.url('/da-view-list'); + $scope.openParent = function () { + // debugger; + var openViews = $rootScope.openViews; + if (openViews.length > 0) { + $rootScope.openViews.splice(openViews.length - 1); + } + if (openViews.length > 0) { + var lastOpenMoudle = $rootScope.openViews[openViews.length - 1]; } + $('#daImagePanel').remove(); + $location.url('/da-view-list'); + } //called on jsanel minimize - $scope.setState = function (state,title) { - //debugger; - + $scope.setState = function (state, title) { + //debugger; - $('#canvasDiv').css('overflow', 'scroll') - $('#canvasDiv').scrollLeft($('#canvasDiv').width() / 2) - // $('#canvasDiv').scrollLeft($scope.imageHorizontlScrollPosition) - $('#canvasDiv').scrollTop(50) - var alreadyOpenThisView = new jinqJs() - .from($rootScope.openViews) - .where("BodyView == " + title) - .select(); - var k=0; - if (alreadyOpenThisView != null) { - for (var i = 0; i < $rootScope.openViews.length; i++) { - k++; - if ($rootScope.openViews[i].BodyView == title) { - $rootScope.openViews.splice((k-1),1); - - $rootScope.openViews.push( - { - "module": $rootScope.currentActiveModuleTitle, "BodyView": title, "state": state, "BodyViewId": $rootScope.currentBodyViewId, - "slug": $rootScope.currentSlug - } - ); - } + var alreadyOpenThisView = new jinqJs() + .from($rootScope.openViews) + .where("BodyView == " + title) + .select(); + var k = 0; + if (alreadyOpenThisView != null) { + for (var i = 0; i < $rootScope.openViews.length; i++) { + k++; + if ($rootScope.openViews[i].BodyView == title) { + $rootScope.openViews.splice((k - 1), 1); + + $rootScope.openViews.push( + { + "module": $rootScope.currentActiveModuleTitle, "BodyView": title, "state": state, "BodyViewId": $rootScope.currentBodyViewId, + "slug": $rootScope.currentSlug } + ); } - - } + } + } + + } + + $scope.changeLayer = function () { + console.log('changeLayer'); + // alert('slide') + } + $('layerChangeSlider').slider().on('slideStop', function (ev) { + alert('slide') + var newVal = $('.span2').data('slider').getValue(); + if (originalVal != newVal) { + alert('Value Changed!'); + } + }); + + + $scope.getMousePos = function (evt) { + + return { + x: Math.round(evt.pageX - $('#canvasDiv').offset().left), + y: Math.round(evt.pageY - $('#canvasDiv').offset().top) + } + } + + + $scope.createSpeechBubble = function(event, text, x, y) { + + $('#canvasDiv').css('cursor', 'pointer'); + $('
' + + '
' + + '
' + text + '
' + //+'
+ + '
').appendTo('#canvasDiv'); + + $('#speechBubble').on('click', '.BubbleCloseBtn', function (e) { + $('#speechBubble').css('display', 'none'); + }); + + $('#canvasDiv').attr("data-bubbleid", "speechBubble") + + + }; + + $scope.createSpeechBubbleOnTransparencyBox = function (event, text1, text2, x, y) { + + $('#canvasDiv').css('cursor', 'pointer'); + $('
' + + '
' + + '
' + text1 + '
' + text2 + '
' + //+'
+ + '
').appendTo('#canvasDiv'); + + $('#speechBubbleTrns').on('click', '.BubbleCloseBtn', function (e) { + $('#speechBubbleTrns').css('display', 'none'); + }); + + $('#canvasDiv').attr("data-bubbleid", "speechBubble") + + + }; + + + function positionTooltip(event, x, y) { + // alert('positionTooltip') + x = 100, + y = 200, + + $('div.speech-bubble').css({ + 'position': 'absolute', 'top': x, 'left': y, 'background-color': '#f8f8f8', + 'border': '2px solid #c8c8c8', 'width': '150px', 'height': '50px' + }); + + + $('.arrow').css({ + 'border-style': 'solid', + 'position': 'absolute' + }); + + $('.bottom').css({ + 'border-color': '#c8c8c8 transparent transparent transparent', + 'border-width': ' 8px 8px 0px 8px', + 'bottom': -'8px' + }) + }; - }] +}] -); +); \ No newline at end of file diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js index 1634dcf..14b532c 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js @@ -1,13 +1,13 @@ 'use strict'; -AIA.controller("HomeController", ["$rootScope","Modules", "$log", "$location", "$timeout", - function ($rootScope,Modules, $log, $location, $timeout) { +AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", "$timeout", + function ($rootScope, Modules, $log, $location, $timeout) { //$scope.pageToOpen = { // name: 'MainMenu' //}; $rootScope.pageToOpen = 'app/widget/MainMenu.html'; - $rootScope.currentBodyViewId ; + $rootScope.currentBodyViewId; $rootScope.currentActiveModuleTitle = 'Welcome to A.D.A.M. Interactive Anatomy';//Modules[0].Name; $rootScope.currentActiveViewTitle; $rootScope.cuurentActiveModuleId; @@ -18,7 +18,7 @@ AIA.controller("HomeController", ["$rootScope","Modules", "$log", "$location", " $rootScope.ViewTitle; $rootScope.ClearIframe = function () { - if ($('#daImagePanel')!=null) + if ($('#daImagePanel') != null) $('#daImagePanel').remove(); $rootScope.hideScrollbar(); diff --git a/400-SOURCECODE/AIAHTML5.Web/app/main/AIA.js b/400-SOURCECODE/AIAHTML5.Web/app/main/AIA.js index 9ccff91..b653c19 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/main/AIA.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/main/AIA.js @@ -43,26 +43,26 @@ AIA.constant('DA', [ AIA.constant('Modules', [ { - Id:1, + Id: 1, Name: 'Dissectible Anatomy', }, { - Id:2, + Id: 2, Name: 'Atlas Anatomy', }, { - Id:3, + Id: 3, Name: '3D Anatomy', }, { - Id:4, + Id: 4, Name: 'Clinical Illustrations', }, - + ]); AIA.constant('BodyViewws', [ { - Id:1, + Id: 1, Name: 'Male Anterior', }, ]); @@ -78,12 +78,12 @@ AIA.config(function ($routeProvider, pages, $locationProvider) { { templateUrl: pages[i].pageUrl, controller: pages[i].pageController - }) + }) .otherwise({ templateUrl: 'app/widget/MainView.html', controller: 'HomeController' }) - + } } -}); +}); \ No newline at end of file diff --git a/400-SOURCECODE/AIAHTML5.Web/app/views/da/da-body-view.html b/400-SOURCECODE/AIAHTML5.Web/app/views/da/da-body-view.html index 43ab475..5c01f51 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/views/da/da-body-view.html +++ b/400-SOURCECODE/AIAHTML5.Web/app/views/da/da-body-view.html @@ -1,9 +1,7 @@ - -
+
-
-
- -
-
+
+ +
\ No newline at end of file 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 91bab61..9c9a0e4 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/views/da/da-view.html +++ b/400-SOURCECODE/AIAHTML5.Web/app/views/da/da-view.html @@ -1,9 +1,9 @@ -
-
+
+
- +
@@ -63,15 +63,15 @@

- +

-
+
-
+
-
+
+
- + + + \ No newline at end of file diff --git a/400-SOURCECODE/AIAHTML5.Web/app/widget/MainMenu.html b/400-SOURCECODE/AIAHTML5.Web/app/widget/MainMenu.html index 290e2be..fe24d6e 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/widget/MainMenu.html +++ b/400-SOURCECODE/AIAHTML5.Web/app/widget/MainMenu.html @@ -1,4 +1,4 @@ -
+
diff --git a/400-SOURCECODE/AIAHTML5.Web/app/widget/MainView.html b/400-SOURCECODE/AIAHTML5.Web/app/widget/MainView.html index b0bcc6f..85d4e00 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/widget/MainView.html +++ b/400-SOURCECODE/AIAHTML5.Web/app/widget/MainView.html @@ -1,5 +1,5 @@ 
-
+
diff --git a/400-SOURCECODE/AIAHTML5.Web/content/css/main.css b/400-SOURCECODE/AIAHTML5.Web/content/css/main.css index b8558a8..ad2d355 100644 --- a/400-SOURCECODE/AIAHTML5.Web/content/css/main.css +++ b/400-SOURCECODE/AIAHTML5.Web/content/css/main.css @@ -694,3 +694,4 @@ textarea { line-height: 30px; } +.daBodyView{} \ No newline at end of file diff --git a/400-SOURCECODE/AIAHTML5.Web/index.html b/400-SOURCECODE/AIAHTML5.Web/index.html index 3819492..3d5ba45 100644 --- a/400-SOURCECODE/AIAHTML5.Web/index.html +++ b/400-SOURCECODE/AIAHTML5.Web/index.html @@ -28,11 +28,12 @@ + - -
+ +
-
+
@@ -67,7 +68,7 @@
Mode
- +
@@ -138,6 +139,8 @@ + + @@ -146,7 +149,7 @@ - + + + + + + + + + +

Drag any of these boxes anywhere on the screen, and then mouse into it to see + Bubble position and info for that box. To dismiss the bubble, click anywhere outside the + bubble or click the bubble's dismiss icon. The bubble will auto-dismiss 2 seconds + after moving the mouse off the bubble or the associated target.

+

Bubbles that have the "editable" option set to true will show an edit icon in the header. + When clicked, the bubble title and content will each display in a textarea for editting. + Clicking the icon when in edit mode will returns the bubble to normal mode with the changes + applied. Changes from edit mode can be cancelled by dismissing the bubble via the dismiss + icon or clicking anywhere outside the bubble. The bubble title is text-only, the content + can be HTML markup.

+ + +
+ + + + +
+ + +
+
+ + + + + +
+ Parent container for the black square. +
+
+
+ + + + + +
+ + +
+ + + + + diff --git a/400-SOURCECODE/AIAHTML5.Web/libs/jquery/jquery_plugin/jsPanel/jspanel/jquery.jspanel.css b/400-SOURCECODE/AIAHTML5.Web/libs/jquery/jquery_plugin/jsPanel/jspanel/jquery.jspanel.css index c3abb3b..b6edb82 100644 --- a/400-SOURCECODE/AIAHTML5.Web/libs/jquery/jquery_plugin/jsPanel/jspanel/jquery.jspanel.css +++ b/400-SOURCECODE/AIAHTML5.Web/libs/jquery/jquery_plugin/jsPanel/jspanel/jquery.jspanel.css @@ -650,3 +650,8 @@ h3.jsPanel-title{ [data-tips].left-tip:hover:before { top: 7px; } + + +span#min { + background-image: url(/betatesting/wp-content/themes/dynamik/css/images/brunelwantsyou_hover.jpg); +} \ No newline at end of file diff --git a/400-SOURCECODE/AIAHTML5.Web/libs/jquery/jquery_plugin/jsPanel/jspanel/jquery.jspanel.js b/400-SOURCECODE/AIAHTML5.Web/libs/jquery/jquery_plugin/jsPanel/jspanel/jquery.jspanel.js index e55c275..890d989 100644 --- a/400-SOURCECODE/AIAHTML5.Web/libs/jquery/jquery_plugin/jsPanel/jspanel/jquery.jspanel.js +++ b/400-SOURCECODE/AIAHTML5.Web/libs/jquery/jquery_plugin/jsPanel/jspanel/jquery.jspanel.js @@ -43,14 +43,14 @@ if (!$.fn.jquery || !$.fn.uniqueId || !$.widget || !$.ui.mouse || !$.ui.draggabl console.log("Error: jQuery or at least one jQuery UI component is not loaded! You need at least jQuery 1.9.1 and jQuery UI 1.9.2 (modules Core, Mouse, Widget, Draggable and Resizable)."); } else { console.log("Loaded: jQuery " + $.fn.jquery + ", jQuery UI " + $.ui.version + - "\nUI core: " + $.isFunction($.fn.uniqueId) + ", UI widget: " + $.isFunction($.widget) + ", UI mouse: " +$.isFunction($.ui.mouse) + + "\nUI core: " + $.isFunction($.fn.uniqueId) + ", UI widget: " + $.isFunction($.widget) + ", UI mouse: " + $.isFunction($.ui.mouse) + ", UI draggable: " + $.isFunction($.ui.draggable) + ", UI resizable: " + $.isFunction($.ui.resizable)); } var jsPanel = { version: '2.6.0 2015-12-04 14:15', - device: (function(){ + device: (function () { try { var imported = document.createElement('script'); imported.src = '//vendor/mobile-detect.js'; @@ -63,10 +63,10 @@ var jsPanel = { tablet = md.tablet(), os = md.os(), userAgent = md.userAgent(); - return {mobile: mobile, tablet: tablet, phone: phone, os: os, userAgent: userAgent}; + return { mobile: mobile, tablet: tablet, phone: phone, os: os, userAgent: userAgent }; } catch (e) { console.log(e + "; Seems like mobile-detect.js is not loaded"); - return {mobile: undefined, tablet: undefined, phone: undefined, os: undefined, userAgent: undefined}; + return { mobile: undefined, tablet: undefined, phone: undefined, os: undefined, userAgent: undefined }; } })(), ID: 0, // kind of a counter to add to automatically generated id attribute @@ -77,8 +77,10 @@ var jsPanel = { '
' + '
' + '
' + - '
' + - '
' + + '
' + + '
' + + + //'
' + //'
' + //'
' + '
' + @@ -93,7 +95,7 @@ var jsPanel = { if (place === 'header') { this.configToolbar(items, panel.header.toolbar, panel); } else if (place === 'footer') { - panel.footer.css({display: 'block'}); + panel.footer.css({ display: 'block' }); this.configToolbar(items, panel.footer, panel); } // give toolbar the same font-family as title @@ -102,7 +104,7 @@ var jsPanel = { }, // loads content using jQuery.ajax(); - ajax: function(panel) { + ajax: function (panel) { var oAjax = panel.option.ajax, pc = panel.content; $.ajax(oAjax) @@ -160,7 +162,7 @@ var jsPanel = { // used in option.autoclose and checks prior use of .close() whether the panel is still there autoclose: function (panel) { window.setTimeout(function () { - if(panel) { + if (panel) { panel.fadeOut('slow', function () { panel.close(); }); @@ -260,11 +262,11 @@ var jsPanel = { } else { posT = ($(optSelector).outerHeight() / 2) - ((parseInt(optSize.height, 10) / 2)); } - return {top: posT, left: posL}; + return { top: posT, left: posL }; }, // calculate position for maximized panels using option.controls.maxtoScreen (for devmondo) - calcPosmaxtoScreen: function(panel) { + calcPosmaxtoScreen: function (panel) { var offset = panel.offset(); return { top: parseInt(panel.css('top')) - (offset.top - $(document).scrollTop()) + 5, @@ -308,7 +310,7 @@ var jsPanel = { }, // calculate final tooltip position - calcToooltipPosition: function(jsPparent, option) { + calcToooltipPosition: function (jsPparent, option) { return { top: this.calcPosTooltipTop(jsPparent, option), left: this.calcPosTooltipLeft(jsPparent, option) @@ -321,7 +323,7 @@ var jsPanel = { // closes a jsPanel and removes it from the DOM close: function (panel) { - // alert('jspanel closed') + // alert('jspanel closed') // get parent-element of jsPanel var context = panel.parent(), panelID = panel.attr('id'); @@ -383,7 +385,7 @@ var jsPanel = { }, // configure controls - configControls: function(panel) { + configControls: function (panel) { var controls = ["close", "maximize", "minimize", "normalize", "smallify"]; if (panel.option.controls.buttons === 'closeonly') { $("div:not('.jsPanel-btn-close')", panel.header.controls).remove(); // change in 2.5.3 @@ -393,13 +395,13 @@ var jsPanel = { panel.header.title.css("width", "100%"); } // disable controls individually - controls.forEach(function(ctrl){ - if (panel.option.controls[ctrl]) {panel.control('disable', ctrl);} + controls.forEach(function (ctrl) { + if (panel.option.controls[ctrl]) { panel.control('disable', ctrl); } }); }, // configure iconfonts - configIconfont: function(panel) { + configIconfont: function (panel) { var controlsArray = ["close", "max", "norm", "min", "small", "smallrev"], bootstrapArray = ["remove", "fullscreen", "resize-full", "minus", "chevron-up", "chevron-down"], fontawesomeArray = ["times", "arrows-alt", "expand", "minus", "chevron-up", "chevron-down"], @@ -409,11 +411,11 @@ var jsPanel = { $('*', controls).css('background-image', 'none'); // set icons if (optIconfont === 'bootstrap') { - controlsArray.forEach(function(item, i){ + controlsArray.forEach(function (item, i) { $('.jsPanel-btn-' + item, controls).empty().append(''); }); } else if (optIconfont === 'font-awesome') { - controlsArray.forEach(function(item, i){ + controlsArray.forEach(function (item, i) { $('.jsPanel-btn-' + item, controls).empty().append(''); }); } @@ -422,8 +424,8 @@ var jsPanel = { // builds toolbar configToolbar: function (toolbaritems, toolbarplace, panel) { var el; - toolbaritems.forEach(function(item){ - if(typeof item === "object") { + toolbaritems.forEach(function (item) { + if (typeof item === "object") { el = $(item.item); // add text to button if (typeof item.btntext === 'string') { @@ -461,7 +463,7 @@ var jsPanel = { controlbtn = $('.jsPanel-btn-small', controls); } // unbind handler and set styles - controlbtn.off().css({opacity:0.5, cursor: 'default'}); + controlbtn.off().css({ opacity: 0.5, cursor: 'default' }); } else if (arguments[1] === 'enable') { if (btn === 'close') { controlbtn = $('.jsPanel-btn-close', controls); @@ -478,7 +480,7 @@ var jsPanel = { controlbtn.on('click', function (e) { e.preventDefault(); panel[btn](); - }).css({opacity: 1, cursor: 'pointer'}); + }).css({ opacity: 1, cursor: 'pointer' }); } } return panel; @@ -500,11 +502,11 @@ var jsPanel = { }, // export a panel layout to localStorage and returns array with an object for each panel - exportPanels: function() { + exportPanels: function () { var elmtOffset, elmtPosition, elmtTop, elmtLeft, elmtWidth, elmtHeight, elmtStatus, panelParent, panelArr = [], exportedPanel, panels = $(".jsPanel").not(".jsPanel-tt, .jsPanel-hint, .jsPanel-modal"); - panels.each(function(index, elmt){ + panels.each(function (index, elmt) { exportedPanel = { panelstatus: $(elmt).data("panelstatus"), id: $(elmt).prop("id"), @@ -590,16 +592,16 @@ var jsPanel = { }, // imports panel layout from localStorage.jspanels and restores panels - importPanels: function(predefinedConfigs) { + importPanels: function (predefinedConfigs) { /* panelConfig needs to be an object with predefined configs. * A config named "default" will be applied to ALL panels * * panelConfig = { default: { } [, config1 [, config2 [, configN ]]] }; */ - var savedPanels,restoredConfig, defaultConfig; + var savedPanels, restoredConfig, defaultConfig; savedPanels = JSON.parse(localStorage.jspanels) || {}; defaultConfig = predefinedConfigs["default"] || {}; - savedPanels.forEach(function(savedconfig){ + savedPanels.forEach(function (savedconfig) { // safedconfig represents one item in safedPanels if (typeof savedconfig.custom.config === "string") { restoredConfig = $.extend(true, {}, defaultConfig, predefinedConfigs[savedconfig.custom.config], savedconfig); @@ -621,14 +623,14 @@ var jsPanel = { }, // calculate panel margins - getMargins: function(panel) { + getMargins: function (panel) { var off, elmtOff, mR, mL, mB, mT, selector = panel.option.paneltype.shiftwithin, winWidth = $(window).outerWidth(), winHeight = $(window).outerHeight(), panelWidth = panel.outerWidth(), panelHeight = panel.outerHeight(); - if(!selector || selector === "body") { + if (!selector || selector === "body") { // panel margins relative to browser viewport off = panel.offset(); mR = winWidth - off.left - panelWidth + $(window).scrollLeft(); @@ -644,7 +646,7 @@ var jsPanel = { mB = $(selector).outerHeight() - (off.top - elmtOff.top) - parseInt(panel.css('height')); mT = off.top - elmtOff.top; } - return {marginTop: parseInt(mT), marginRight: parseInt(mR), marginBottom: parseInt(mB), marginLeft: parseInt(mL)}; + return { marginTop: parseInt(mT), marginRight: parseInt(mR), marginBottom: parseInt(mB), marginLeft: parseInt(mL) }; }, // return max value of an array with numbers @@ -653,14 +655,14 @@ var jsPanel = { }, // calculate max horizontal and vertical tooltip shift - getMaxpanelshift: function(panel) { + getMaxpanelshift: function (panel) { var panelWidth = panel.outerWidth(), panelHeight = panel.outerHeight(), - horiz = parseInt( panelWidth/2 ) + parseInt( panel.parent().outerWidth()/2 ) - 20, - vert = parseInt( panelHeight/2 ) + parseInt( panel.parent().outerHeight()/2 ) - 20, - cornerHoriz = parseInt( panelWidth/2 ) - 16, - cornerVert = parseInt( panelHeight/2 ) - 16; - return {maxshiftH: horiz, maxshiftV: vert, maxCornerH: cornerHoriz, maxCornerV: cornerVert}; + horiz = parseInt(panelWidth / 2) + parseInt(panel.parent().outerWidth() / 2) - 20, + vert = parseInt(panelHeight / 2) + parseInt(panel.parent().outerHeight() / 2) - 20, + cornerHoriz = parseInt(panelWidth / 2) - 16, + cornerVert = parseInt(panelHeight / 2) - 16; + return { maxshiftH: horiz, maxshiftV: vert, maxCornerH: cornerHoriz, maxCornerV: cornerVert }; }, // hide controls specified by param "sel" of the jsPanel "panel" @@ -673,21 +675,21 @@ var jsPanel = { // calculates option.position for hints using 'top left', 'top center' or 'top right' hintTop: function (hintGroup) { var hintH = 0; - $("." + hintGroup).each(function(){ + $("." + hintGroup).each(function () { hintH += $(this).outerHeight(true); }); if (hintGroup === "jsPanel-hint-tr") { - return {top: hintH, right: 0}; + return { top: hintH, right: 0 }; } else if (hintGroup === "jsPanel-hint-tl") { - return {top: hintH, left: 0}; + return { top: hintH, left: 0 }; } else if (hintGroup === "jsPanel-hint-tc") { - return {top: hintH, left: 'center'}; + return { top: hintH, left: 'center' }; } - return {top: 0, left: 0}; + return { top: 0, left: 0 }; }, // loads content in an iFrame - iframe: function(panel) { + iframe: function (panel) { var iFrame = $(""); // iframe content if (panel.option.iframe.srcdoc) { @@ -753,7 +755,7 @@ var jsPanel = { }, // check whether a bootstrap compatible theme is used - isBootstrapTheme: function(optionBootstrap) { + isBootstrapTheme: function (optionBootstrap) { if ($.inArray(optionBootstrap, ["default", "primary", "info", "success", "warning", "danger"]) > -1) { return optionBootstrap; } @@ -761,7 +763,8 @@ var jsPanel = { }, // loads content using jQuery.load() - load: function(panel) { + load: function (panel) { + // alert('pppp') panel.content.load(panel.option.load.url, panel.option.load.data || undefined, function (responseText, textStatus, jqXHR) { if ($.isFunction(panel.option.load.complete)) { panel.option.load.complete.call(panel.content, responseText, textStatus, jqXHR, panel); @@ -776,6 +779,9 @@ var jsPanel = { }); }); panel.data("loadURL", panel.option.load.url); // needed for exportPanels() + + + }, // maximizes a panel within the body element @@ -797,7 +803,7 @@ var jsPanel = { //nikita //newTop = $(window).scrollTop() + parseInt(panel.option.maximizedMargin.top); //newLeft = $(window).scrollLeft() + parseInt(panel.option.maximizedMargin.left); - newTop =70; + newTop = 70; newLeft = 0; //nikita newRight = 15; @@ -814,14 +820,14 @@ var jsPanel = { }); //nikita if (panel.outerHeight() >= 435 && panel.outerWidth() >= 650) { - // alert('if') - $('#canvasDiv').css('height', panel.outerHeight() - 80) + // alert('if') + $('#canvasDiv').css('height', panel.outerHeight() - 75) $('#canvasDiv').css('width', panel.outerWidth() - 100) $('#canvasDiv').css('overflow', 'scroll') } else { // alert('else') - $('#canvasDiv').css('height', panel.outerHeight() - 115) + $('#canvasDiv').css('height', panel.outerHeight() - 110) $('#canvasDiv').css('width', panel.outerWidth() - 90) $('#canvasDiv').css('overflow', 'scroll') } @@ -835,22 +841,39 @@ var jsPanel = { // maximizes a panel within an element other than body maxWithinElement: function (panel) { + // debugger; if ((panel.status !== "maximized" || panel.option.panelstatus !== "maximized") && panel.option.paneltype.mode !== 'default') { // restore minimized panel to initial container if necessary if (panel.status === "minimized" || panel.option.panelstatus === "minimized") { this.restoreFromMinimized(panel); } panel.css({ - top: parseInt(panel.option.maximizedMargin.top), + top: parseInt(70),//panel.option.maximizedMargin.top), left: parseInt(panel.option.maximizedMargin.left), width: parseInt(panel.parent().outerWidth(), 10) - parseInt(panel.option.maximizedMargin.left) - parseInt(panel.option.maximizedMargin.right), - height: parseInt(panel.parent().outerHeight(), 10) - parseInt(panel.option.maximizedMargin.top) - parseInt(panel.option.maximizedMargin.bottom) + height: parseInt(panel.parent().outerHeight()) - parseInt(panel.option.maximizedMargin.top) - parseInt(panel.option.maximizedMargin.bottom) - 65 }); } + + //nikita + if (panel.outerHeight() >= 435 && panel.outerWidth() >= 650) { + //alert('if') + $('#canvasDiv').css('height', panel.outerHeight() - 85) + $('#canvasDiv').css('width', panel.outerWidth() - 100) + $('#canvasDiv').css('overflow', 'scroll') + } + else { + // alert('else') + $('#canvasDiv').css('height', panel.outerHeight() - 105) + $('#canvasDiv').css('width', panel.outerWidth() - 90) + $('#canvasDiv').css('overflow', 'scroll') + } + //nikita }, // calls functions to maximize a jsPanel maximize: function (panel) { + // debugger; panel.trigger('jspanelbeforemaximize', panel.attr('id')); if ($.isFunction(panel.option.onbeforemaximize)) { var maximize = panel.option.onbeforemaximize.call(panel, panel); @@ -929,8 +952,8 @@ var jsPanel = { opacity: 1 }) .appendTo('#jsPanel-min-container') - .resizable({disabled: true}) - .draggable({disabled: true}); + .resizable({ disabled: true }) + .draggable({ disabled: true }); panel.trigger('jspanelminimized', panel.attr('id')); panel.trigger('jspanelstatechange', panel.attr('id')); } @@ -938,7 +961,7 @@ var jsPanel = { // restores a panel to its "normalized" (not minimized, maximized or smallified) position & size normalize: function (panel) { - // debugger; + // debugger; var panelTop, interactions = ["resizable", "draggable"]; panel.trigger('jspanelbeforenormalize', panel.attr('id')); @@ -962,16 +985,16 @@ var jsPanel = { } panel.css({ width: panel.option.size.width, - height: panel.option.size.height+10, + height: panel.option.size.height + 10, top: panelTop, left: panel.option.position.left }); - interactions.forEach(function(action){ + interactions.forEach(function (action) { if (panel.option[action] !== "disabled") { panel[action]("enable"); // get resizer and cursor for resizable back - $('.ui-icon-gripsmall-diagonal-se', panel).css({'background-image': 'none', 'text-indent': 0}); - $('.ui-resizable-handle', panel).css({'cursor': ''}); + $('.ui-icon-gripsmall-diagonal-se', panel).css({ 'background-image': 'none', 'text-indent': 0 }); + $('.ui-resizable-handle', panel).css({ 'cursor': '' }); } }); panel.trigger('jspanelnormalized', panel.attr('id')); @@ -1012,7 +1035,7 @@ var jsPanel = { } else { hintH = 0; } - $("." + hintGroup).each(function(){ + $("." + hintGroup).each(function () { $(this).animate({ top: hintH }); @@ -1021,7 +1044,7 @@ var jsPanel = { }, // reposition hints on window scroll - reposHintsScroll: function(panel) { + reposHintsScroll: function (panel) { var dif = panel.offset().top - $(window).scrollTop(); // with window.onscroll only the last added hint would stay in position $(window).scroll(function () { @@ -1031,7 +1054,7 @@ var jsPanel = { // repositions a panel and optionally moves it to another container reposition: function (panel, position, selector) { - alert('reposition') + //alert('reposition') if (selector && typeof selector === "string") { panel.option.selector = selector; panel.appendTo(selector); @@ -1042,7 +1065,7 @@ var jsPanel = { // rewrite passed position to be a proper object panel.option.position = jsPanel.rewriteOPosition(position); // delete element styles concerning position, otherwise you might end up with left &right and/or top & bottom values - panel.css({top: "", right: "", bottom: "", left: ""}); + panel.css({ top: "", right: "", bottom: "", left: "" }); this.calcPanelposition(panel); panel.verticalOffset = jsPanel.calcVerticalOffset(panel) || 0; this.replaceCSSBottomRight(panel); @@ -1058,7 +1081,7 @@ var jsPanel = { // repositions minimized jsPanels reposMinimized: function () { - $('.jsPanel', '#jsPanel-min-container').each(function(index, elmt){ + $('.jsPanel', '#jsPanel-min-container').each(function (index, elmt) { $(elmt).animate({ left: (index * jsPanel.widthForMinimized) }); @@ -1067,20 +1090,21 @@ var jsPanel = { // resize exsisting jsPanel; resizes the full panel (not content section only) resize: function (panel, width, height) { + // debugger; if (panel.option.panelstatus !== "minimized") { // v2.4.1 don't call resize() on minimized panels - if(width && width !== null) { + if (width && width !== null) { panel.css("width", width); } else { panel.css("width", panel.content.css("width")); } - if(height && height !== null) { + if (height && height !== null) { panel.css("height", height); } this.resizeContent(panel); this.resizeTitle(panel); } - $('#canvasDiv').css('height', $(window).outerHeight() - 124) - $('#leftToolBar').css('height', $(window).outerHeight() - 124) + $('#canvasDiv').css('height', $(window).outerHeight() - 120) + $('#leftToolBar').css('height', $(window).outerHeight() - 120) }, // reset dimensions of content section after resize and so on @@ -1099,7 +1123,7 @@ var jsPanel = { }, // resize the title h3 to use full width minus controls width (and prevent being longer than panel) - resizeTitle: function(panel) { + resizeTitle: function (panel) { var titleWidth = (panel.outerWidth() - $(panel.header.controls).outerWidth() - 15); panel.header.title.css('width', titleWidth); }, @@ -1111,12 +1135,12 @@ var jsPanel = { if (panel.status === "minimized" || panel.option.panelstatus === "minimized") { panel.appendTo(panel.option.selector); } - interactions.forEach(function(action){ + interactions.forEach(function (action) { if (panel.option[action] !== "disabled") { panel[action]("enable"); // get resizer and cursor for resizable back - $('.ui-icon-gripsmall-diagonal-se', panel).css({'background-image': 'none', 'text-indent': 0}); - $('.ui-resizable-handle', panel).css({'cursor': ''}); + $('.ui-icon-gripsmall-diagonal-se', panel).css({ 'background-image': 'none', 'text-indent': 0 }); + $('.ui-resizable-handle', panel).css({ 'cursor': '' }); } }); // reposition minimized panels @@ -1127,13 +1151,13 @@ var jsPanel = { rewriteOPaneltype: function (optionPaneltype) { var op = optionPaneltype; if (op === 'modal') { - return {type: 'modal', mode: 'default'}; + return { type: 'modal', mode: 'default' }; } else if (op === 'tooltip') { - return {type: 'tooltip', position: 'top'}; + return { type: 'tooltip', position: 'top' }; } else if (op === 'hint') { - return {type: 'hint'}; + return { type: 'hint' }; } else if (op.type === 'modal') { - return {type: 'modal', mode: op.mode || 'default'}; + return { type: 'modal', mode: op.mode || 'default' }; } else if (op.type === 'tooltip') { return { type: 'tooltip', @@ -1146,7 +1170,7 @@ var jsPanel = { cornerOY: op.cornerOY || false }; } else { - return {paneltype: false}; + return { paneltype: false }; } }, @@ -1154,25 +1178,25 @@ var jsPanel = { rewriteOPosition: function (optionPosition) { var op = optionPosition; if (op === 'center') { - return {top: 'center', left: 'center'}; + return { top: 'center', left: 'center' }; } else if (op === 'auto') { - return {top: 'auto', left: 'auto'}; + return { top: 'auto', left: 'auto' }; } else if (op === 'top left') { - return {top: '0', left: '0'}; + return { top: '0', left: '0' }; } else if (op === 'top center') { - return {top: '0', left: 'center'}; + return { top: '0', left: 'center' }; } else if (op === 'top right') { - return {top: '0', right: '0'}; + return { top: '0', right: '0' }; } else if (op === 'center right') { - return {top: 'center', right: '0'}; + return { top: 'center', right: '0' }; } else if (op === 'bottom right') { - return {bottom: '0', right: '0'}; + return { bottom: '0', right: '0' }; } else if (op === 'bottom center') { - return {bottom: '0', left: 'center'}; + return { bottom: '0', left: 'center' }; } else if (op === 'bottom left') { - return {bottom: '0', left: '0'}; + return { bottom: '0', left: '0' }; } else if (op === 'center left') { - return {top: 'center', left: '0'}; + return { top: 'center', left: '0' }; } // if bottom and/or right is set to "center" change that to top and/or left set to "center" if (op.bottom === "center") { @@ -1199,7 +1223,7 @@ var jsPanel = { }, // set default options for hints and add necessary classes - setHintDefaults: function(panel) { + setHintDefaults: function (panel) { panel.option.resizable = false; panel.option.draggable = false; panel.option.removeHeader = true; @@ -1227,8 +1251,8 @@ var jsPanel = { panel.option.resizable = false; panel.option.draggable = false; panel.option.removeHeader = false; - panel.option.position = {top: 'center', left: 'center'}; - panel.option.offset = {top: 0, left: 0}; + panel.option.position = { top: 'center', left: 'center' }; + panel.option.offset = { top: 0, left: 0 }; panel.option.controls.buttons = 'closeonly'; //do not delete else "modal" with no close button possible $(".jsPanel-btn-min, .jsPanel-btn-norm, .jsPanel-btn-max, .jsPanel-btn-small, .jsPanel-btn-smallrev", panel).remove(); $(panel.header, panel.header.title, panel.footer).css('cursor', 'default'); @@ -1237,9 +1261,9 @@ var jsPanel = { }, // set right-to-left text direction and language; set styles and reoorder controls for rtl - setRTL: function(panel) { - var elmts = [ panel.header.title, panel.content, panel.header.toolbar, panel.footer ]; - elmts.forEach(function(item){ + setRTL: function (panel) { + var elmts = [panel.header.title, panel.content, panel.header.toolbar, panel.footer]; + elmts.forEach(function (item) { item.prop('dir', 'rtl'); if (panel.option.rtl.lang) { item.prop('lang', panel.option.rtl.lang); @@ -1250,7 +1274,7 @@ var jsPanel = { $('.jsPanel-btn-max', panel.header.controls).insertAfter($('.jsPanel-btn-min', panel.header.controls)); $('.jsPanel-btn-small', panel.header.controls).insertBefore($('.jsPanel-btn-min', panel.header.controls)); $('.jsPanel-btn-smallrev', panel.header.controls).insertBefore($('.jsPanel-btn-min', panel.header.controls)); - $('.jsPanel-hdr-r', panel).css({left: '0px', right: '', position: 'relative', 'float': 'left'}); + $('.jsPanel-hdr-r', panel).css({ left: '0px', right: '', position: 'relative', 'float': 'left' }); $('.jsPanel-hint-close', panel).css('float', 'left'); $('.jsPanel-title', panel).css('float', 'right'); $('.jsPanel-ftr', panel).append('
'); @@ -1258,7 +1282,7 @@ var jsPanel = { }, // set default options for tooltips - setTooltipDefaults: function(panel) { + setTooltipDefaults: function (panel) { panel.option.position = {}; panel.option.resizable = false; panel.option.draggable = false; @@ -1278,7 +1302,7 @@ var jsPanel = { jspanel = panel; } // build array with all z-index values - $(".jsPanel:not('.jsPanel-modal, .jsPanel-nofront')").each(function(i, elmt){ + $(".jsPanel:not('.jsPanel-modal, .jsPanel-nofront')").each(function (i, elmt) { if (jspanel.attr("id") !== $(elmt).attr("id")) { allZi.push($(elmt).css("z-index")); } @@ -1290,7 +1314,7 @@ var jsPanel = { }, // shift tooltip left/right if it overflows window; when using horizontal offsets of panel and/or corner result might be not as expected - shiftTooltipHorizontal: function(panel){ + shiftTooltipHorizontal: function (panel) { var margins = this.getMargins(panel), leftShiftRequired, maxShift = this.getMaxpanelshift(panel), @@ -1319,19 +1343,19 @@ var jsPanel = { // shift panel panel.animate({ "left": newPanelLeft - },{ queue: false /* to have both animation run simultaneously */ }); + }, { queue: false /* to have both animation run simultaneously */ }); // shift corner if present if ($('.jsPanel-corner', panel)) { $('.jsPanel-corner', panel).animate({ "left": newCornerLeft - },{ queue: false /* to have both animation run simultaneously */ }); + }, { queue: false /* to have both animation run simultaneously */ }); } } }, // shift tooltip up/down if it overflows window; when using vertical offsets of panel and/or corner result might be not as expected - shiftTooltipVertical: function(panel){ + shiftTooltipVertical: function (panel) { //console.log( parseInt($('*:first-child', panel.parent()).css('margin-left')) ); var margins = this.getMargins(panel), topShiftRequired, @@ -1361,18 +1385,18 @@ var jsPanel = { // shift panel panel.animate({ "top": newPanelTop - },{ queue: false /* to have both animation run simultaneously */ }); + }, { queue: false /* to have both animation run simultaneously */ }); // shift corner if present if ($('.jsPanel-corner', panel)) { $('.jsPanel-corner', panel).animate({ "top": newCornerTop - },{ queue: false /* to have both animation run simultaneously */ }); + }, { queue: false /* to have both animation run simultaneously */ }); } } }, - smallify: function(panel) { + smallify: function (panel) { var statusNew; if ((panel.status !== "smallified" || panel.option.panelstatus !== "smallified") && (panel.status !== "smallifiedMax" || panel.option.panelstatus !== "smallifiedMax")) { if (panel.status === "maximized" || panel.option.panelstatus === "maximized") { @@ -1386,8 +1410,8 @@ var jsPanel = { panel.panelfooterheight = panel.footer.outerHeight(); panel.panelcontentheight = panel.content.outerHeight(); panel.animate({ - height: panel.panelheaderheight - }, + height: panel.panelheaderheight + }, { done: function () { if (panel.status === 'maximized' || panel.option.panelstatus === 'maximized') { @@ -1403,10 +1427,10 @@ var jsPanel = { } }, - unsmallify: function(panel) { + unsmallify: function (panel) { panel.animate({ - height: panel.smallify.height - }, + height: panel.smallify.height + }, { done: function () { if (panel.status === 'smallified' || panel.option.panelstatus === 'smallified') { @@ -1426,7 +1450,7 @@ var jsPanel = { }, // updates option.position to hold actual values - updateOptionPosition: function(panel) { + updateOptionPosition: function (panel) { panel.option.position.top = panel.css('top'); panel.option.position.left = panel.css('left'); }, @@ -1437,13 +1461,13 @@ var jsPanel = { panel.option.size.height = $(".jsPanel-content", panel).css("height"); }, - updateCustomData: function(panel, key, val) { + updateCustomData: function (panel, key, val) { var custom = panel.data("custom"); custom[key] = val; panel.data("custom", custom); }, - updateStateProps: function(panel, status) { + updateStateProps: function (panel, status) { panel.status = status; panel.option.panelstatus = status; panel.data("panelstatus", status); @@ -1458,12 +1482,13 @@ var jsPanel = { console.log("jsPanel version: " + jsPanel.version); -(function($){ +(function ($) { $.jsPanel = function (config) { + var jsP, template, id, - panelconfig = config || {}, - optConfig = panelconfig.config || {}; + panelconfig = config || {}, + optConfig = panelconfig.config || {}; // use custom jsPanel template if present else standard template template = panelconfig.template || jsPanel.template; @@ -1518,13 +1543,13 @@ console.log("jsPanel version: " + jsPanel.version); jsP.footer = $('.jsPanel-ftr', jsP); - jsP.normalize = function() { + jsP.normalize = function () { jsPanel.normalize(jsP); return jsP; }; jsP.close = function () { - // alert('1') + // alert('1') jsPanel.close(jsP); // no need to return something }; @@ -1578,7 +1603,7 @@ console.log("jsPanel version: " + jsPanel.version); }; jsP.resize = function (width, height) { - // alert('jsP.resize') + // alert('jsP.resize') // method resizes the full panel (not content section only) jsPanel.resize(jsP, width, height); return jsP; @@ -1589,7 +1614,7 @@ console.log("jsPanel version: " + jsPanel.version); return jsP; }; - jsP.reloadContent = function() { + jsP.reloadContent = function () { if (jsP.option.content) { jsP.content.empty().append(jsP.option.content); } else if (jsP.option.load) { @@ -1604,7 +1629,7 @@ console.log("jsPanel version: " + jsPanel.version); // handler to move panel to foreground on click jsP.on('click', function (e) { - alert('1') + //alert('1') // use of e.preventDefault(); would prevent events from inside a panel from firing properly if (!$(e.target).is("a[href], button, .jsPanel-nofront, .jsPanel-nofront *")) { if (!jsP.hasClass("jsPanel-modal")) { @@ -1615,7 +1640,7 @@ console.log("jsPanel version: " + jsPanel.version); // jsPanel close $('.jsPanel-btn-close', jsP).on('click', function (e) { - // alert('2') + // alert('2') //e.preventDefault(); //if (!jsP.option.controls.confirmClose) { // jsPanel.close(jsP, jsP.parentElmtTagname); @@ -1630,24 +1655,30 @@ console.log("jsPanel version: " + jsPanel.version); }); - + // jsPanel minimize $('.jsPanel-btn-min', jsP).on('click', function (e) { - // alert('minimized') + // alert('minimized') e.preventDefault(); jsPanel.minimize(jsP); - debugger; + // debugger; var headerTitle = $('.jsPanel-title'); var title = headerTitle[0].innerHTML; var $scope = jsPanel.getScope('DAController'); $scope.setState('min', title); + + var canvasDiv = document.getElementById('canvasDiv'); + $scope.imageVerticalScrollPosition = canvasDiv.scrollTop; + $scope.imageHorizontlScrollPosition = canvasDiv.scrollLeft; + $scope.$apply(); }); // jsPanel maximize $('.jsPanel-btn-max', jsP).on('click', function (e) { + // debugger; e.preventDefault(); jsPanel.maximize(jsP); @@ -1660,8 +1691,17 @@ console.log("jsPanel version: " + jsPanel.version); // jsPanel normalize $('.jsPanel-btn-norm', jsP).on('click', function (e) { + // debugger; e.preventDefault(); jsPanel.normalize(jsP); + + var $scope = jsPanel.getScope('DAController'); + + + $('#canvasDiv').scrollLeft($scope.imageHorizontlScrollPosition) + $('#canvasDiv').scrollTop($scope.imageVerticalScrollPosition) + + $scope.$apply(); }); // jsPanel smallify @@ -1746,17 +1786,17 @@ console.log("jsPanel version: " + jsPanel.version); corner.addClass("jsPanel-corner " + cornerLoc).prependTo(jsP); } if (jsP.option.paneltype.position === "top") { - cornerPos = parseInt(jsP.option.size.width)/2 - 12 + (cornerOX) + "px"; - corner.css({borderTopColor: cornerBG, left: cornerPos}); + cornerPos = parseInt(jsP.option.size.width) / 2 - 12 + (cornerOX) + "px"; + corner.css({ borderTopColor: cornerBG, left: cornerPos }); } else if (jsP.option.paneltype.position === "right") { - cornerPos = parseInt(jsP.option.size.height)/2 - 12 + (cornerOY) + "px"; - corner.css({borderRightColor: cornerBG, left: "-22px", top: cornerPos}); + cornerPos = parseInt(jsP.option.size.height) / 2 - 12 + (cornerOY) + "px"; + corner.css({ borderRightColor: cornerBG, left: "-22px", top: cornerPos }); } else if (jsP.option.paneltype.position === "bottom") { - cornerPos = parseInt(jsP.option.size.width)/2 - 12 + (cornerOX) + "px"; - corner.css({borderBottomColor: cornerBG, left: cornerPos, top: "-22px"}); + cornerPos = parseInt(jsP.option.size.width) / 2 - 12 + (cornerOX) + "px"; + corner.css({ borderBottomColor: cornerBG, left: cornerPos, top: "-22px" }); } else if (jsP.option.paneltype.position === "left") { - cornerPos = parseInt(jsP.option.size.height)/2 - 12 + (cornerOY) + "px"; - corner.css({borderLeftColor: cornerBG, left: jsP.option.size.width, top: cornerPos}); + cornerPos = parseInt(jsP.option.size.height) / 2 - 12 + (cornerOY) + "px"; + corner.css({ borderLeftColor: cornerBG, left: jsP.option.size.width, top: cornerPos }); } } } else if (jsP.option.paneltype.type === 'hint') { @@ -1820,7 +1860,7 @@ console.log("jsPanel version: " + jsPanel.version); } else { // activate normal non bootstrap themes var components = [jsP, jsP.header, jsP.content, jsP.footer]; - components.forEach(function(elmt){ + components.forEach(function (elmt) { $(elmt).alterClass('jsPanel-theme-*', 'jsPanel-theme-' + jsP.option.theme); }); } @@ -1907,8 +1947,8 @@ console.log("jsPanel version: " + jsPanel.version); } else if (jsP.option.resizable === 'disabled') { // jquery ui resizable initialize disabled to allow to query status jsP.resizable({ disabled: true }); - $('.ui-icon-gripsmall-diagonal-se', jsP).css({'background-image': 'none', 'text-indent': -9999}); - $('.ui-resizable-handle', jsP).css({'cursor': 'inherit'}); + $('.ui-icon-gripsmall-diagonal-se', jsP).css({ 'background-image': 'none', 'text-indent': -9999 }); + $('.ui-resizable-handle', jsP).css({ 'cursor': 'inherit' }); } /* option.content ------------------------------------------------------------------------------------------- */ @@ -1935,7 +1975,7 @@ console.log("jsPanel version: " + jsPanel.version); }); // Important! limit title width; final adjustment follows later; otherwise title might be longer than panel width - jsP.header.title.css('width', jsP.content.width()-90); + jsP.header.title.css('width', jsP.content.width() - 90); /* option.iframe -------------------------------------------------------------------------------------------- */ // implemented after option.size because option.size.width/height are either "auto" or pixel values already @@ -2018,7 +2058,7 @@ console.log("jsPanel version: " + jsPanel.version); opacity: 1 }); $(jsP).addClass(jsP.option.show); - $(jsP) .trigger('jspanelloaded', jsP.attr('id')); + $(jsP).trigger('jspanelloaded', jsP.attr('id')); $(jsP).trigger('jspanelstatechange', jsP.attr('id')); jsP.option.size = { width: jsP.outerWidth(), @@ -2055,13 +2095,14 @@ console.log("jsPanel version: " + jsPanel.version); }); $(jsP).on("resize", function () { + // debugger; // jquery ui resize event is also fired when panel is maximized or normalized (on request of Gareth Bult) jsPanel.resizeContent(jsP); jsPanel.resizeTitle(jsP); }); $(jsP).on("resizestop", function () { - + //alert('resized') jsP.option.size = { width: jsP.outerWidth(), @@ -2069,18 +2110,18 @@ console.log("jsPanel version: " + jsPanel.version); }; //nikita if (jsP.outerHeight() >= 435 && jsP.outerWidth() >= 650) { - // alert('resizestop') - $('#canvasDiv').css('height', jsP.outerHeight()-90) - $('#canvasDiv').css('width', jsP.outerWidth() - 100) - $('#canvasDiv').css('overflow', 'scroll') + // alert('resizestop') + $('#canvasDiv').css('height', jsP.outerHeight() - 85) + $('#canvasDiv').css('width', jsP.outerWidth() - 95) + $('#canvasDiv').css('overflow', 'scroll') } else { - $('#canvasDiv').css('height', jsP.outerHeight() - 115) - $('#canvasDiv').css('width', jsP.outerWidth() - 90) + $('#canvasDiv').css('height', jsP.outerHeight() - 110) + $('#canvasDiv').css('width', jsP.outerWidth() - 85) $('#canvasDiv').css('overflow', 'scroll') } //nikita - // $('#leftToolBar').css('height', jsP.outerWidth()) + // $('#leftToolBar').css('height', jsP.outerWidth()) jsPanel.updateStateProps(jsP, "normalized"); $(jsP).trigger('jspanelnormalized', jsP.attr('id')); @@ -2092,7 +2133,7 @@ console.log("jsPanel version: " + jsPanel.version); $(jsP).on("dragstart", function () { // alert("dragstart") - // debugger; + // debugger; // remove window.scroll handler, is added again on dragstop $(window).off('scroll', jsP.jsPanelfixPos); if (jsP.option.paneltype.mode === 'extended') { @@ -2101,8 +2142,8 @@ console.log("jsPanel version: " + jsPanel.version); }); $(jsP).on("dragstop", function () { - // alert("dragstop") - // debugger; + // alert("dragstop") + // debugger; jsP.option.position = { top: jsP.css('top'), left: jsP.css('left') @@ -2113,13 +2154,14 @@ console.log("jsPanel version: " + jsPanel.version); } }); - $(jsP).on( "jspanelminimized", function(){ + $(jsP).on("jspanelminimized", function () { jsPanel.hideControls(".jsPanel-btn-min, .jsPanel-btn-small, .jsPanel-btn-smallrev, .jsPanel-btn-hide", jsP); jsPanel.updateStateProps(jsP, "minimized"); $(window).off('scroll', jsP.jsPanelfixPos); }); - $(jsP).on( "jspanelmaximized", function(){ + $(jsP).on("jspanelmaximized", function () { + // debugger; jsPanel.resizeContent(jsP); jsPanel.resizeTitle(jsP); jsPanel.hideControls(".jsPanel-btn-max, .jsPanel-btn-smallrev", jsP); @@ -2128,7 +2170,7 @@ console.log("jsPanel version: " + jsPanel.version); jsP.trigger("resize"); }); - $(jsP).on( "jspanelnormalized", function(){ + $(jsP).on("jspanelnormalized", function () { jsPanel.hideControls(".jsPanel-btn-norm, .jsPanel-btn-smallrev", jsP); jsPanel.resizeTitle(jsP); jsPanel.resizeContent(jsP); @@ -2176,13 +2218,14 @@ console.log("jsPanel version: " + jsPanel.version); if ($.isFunction(jsP.option.callback)) { jsP.option.callback.call(jsP, jsP); } else if ($.isArray(jsP.option.callback)) { - jsP.option.callback.forEach(function(item){ + jsP.option.callback.forEach(function (item) { if ($.isFunction(item)) { item.call(jsP, jsP); } }); } + return jsP; }; @@ -2265,8 +2308,11 @@ console.log("jsPanel version: " + jsPanel.version); "title": 'jsPanel', "toolbarFooter": false, "toolbarHeader": false + + }; + /* * jQuery alterClass plugin * Remove element classes with wildcard matching. Optionally add classes: @@ -2275,6 +2321,7 @@ console.log("jsPanel version: " + jsPanel.version); * Free under terms of the MIT license: http://www.opensource.org/licenses/mit-license.php */ $.fn.alterClass = function (removals, additions) { + var self = this, patt; if (removals.indexOf('*') === -1) { @@ -2298,7 +2345,7 @@ console.log("jsPanel version: " + jsPanel.version); /* body click handler: remove all tooltips on click in body except click is inside tooltip */ $('body').click(function (e) { var pID, - isTT = $(e.target).closest('.jsPanel-tt' ).length; + isTT = $(e.target).closest('.jsPanel-tt').length; if (isTT < 1) { $('.jsPanel-tt').each(function () { pID = $(this).attr('id'); @@ -2309,6 +2356,9 @@ console.log("jsPanel version: " + jsPanel.version); } }); + + + }(jQuery)); /* @@ -2320,4 +2370,4 @@ if (!Number.isInteger) { "use strict"; return typeof nVal === 'number' && isFinite(nVal) && nVal > -9007199254740992 && nVal < 9007199254740992 && Math.floor(nVal) === nVal; }; -} +} \ No newline at end of file diff --git a/400-SOURCECODE/AIAHTML5.Web/login.html b/400-SOURCECODE/AIAHTML5.Web/login.html index b9837b9..1538922 100644 --- a/400-SOURCECODE/AIAHTML5.Web/login.html +++ b/400-SOURCECODE/AIAHTML5.Web/login.html @@ -1,102 +1,102 @@ - - - - - - - -A.D.A.M. Interactive Anatomy - - - - - - - - - - - - - -
-
-
- - -
-
-

A.D.A.M. Interactive Anatomy

-

The most compresive online interactive anatomy learning resource

-
-
-
- -
-
-
- -
-
- - - - -
- - -
- Forgot User ID? - - -
-
- - -
- - -
- Forgot Password? -
-
- -
-
-
-
- -
-
-
- - -
-
Copyright © 2016 Ebix Inc. All rights reserved.
-
- - - - - - - - - - - - - - - - - + + + + + + + + A.D.A.M. Interactive Anatomy + + + + + + + + + + + + + +
+
+
+ + +
+
+

A.D.A.M. Interactive Anatomy

+

The most compresive online interactive anatomy learning resource

+
+
+
+ +
+
+
+ +
+
+ + + + +
+ + +
+ Forgot User ID? + + +
+
+ + +
+ + +
+ Forgot Password? +
+
+ +
+
+
+
+ +
+
+
+ + +
+
Copyright © 2016 Ebix Inc. All rights reserved.
+
+ + + + + + + + + + + + + + + + + \ No newline at end of file -- libgit2 0.21.4