Commit eb153fe96b6e347e376f537a94e0f553c1def01f

Authored by Nikita Kulshreshtha
1 parent ab5d8b3f

1. fixed the toggle button issue on main menu.

2. added dynamic title for modules and for views.
3. added constant for module names.
300-PROTOTYPES/20160229/AIA/js/custom.js
@@ -5,6 +5,7 @@ $(function(){ @@ -5,6 +5,7 @@ $(function(){
5 var bar = $('.sidebar'); 5 var bar = $('.sidebar');
6 var main = $('.main'); 6 var main = $('.main');
7 $('.toggleBar').click(function() { 7 $('.toggleBar').click(function() {
  8 + alert('jjjj')
8 /*barPos = parseInt($('.sidebar').css('left')); 9 /*barPos = parseInt($('.sidebar').css('left'));
9 if(barPos!==0 && !bar.hasClass('active')) 10 if(barPos!==0 && !bar.hasClass('active'))
10 { 11 {
@@ -27,7 +28,8 @@ $(function(){ @@ -27,7 +28,8 @@ $(function(){
27 var barPos=0; 28 var barPos=0;
28 var bar = $('.tools'); 29 var bar = $('.tools');
29 var main = $('.main2'); 30 var main = $('.main2');
30 - $('.toggleBar').click(function() { 31 + $('.toggleBar').click(function() {
  32 + alert('hjh')
31 /*barPos = parseInt($('.tools').css('left')); 33 /*barPos = parseInt($('.tools').css('left'));
32 if(barPos!==0 && !bar.hasClass('active')) 34 if(barPos!==0 && !bar.hasClass('active'))
33 { 35 {
@@ -51,7 +53,7 @@ $(function(){ @@ -51,7 +53,7 @@ $(function(){
51 var barPos=0; 53 var barPos=0;
52 var bar = $('.treeview-left'); 54 var bar = $('.treeview-left');
53 var main = $('.main-treeview'); 55 var main = $('.main-treeview');
54 - $('.toggleBar').click(function() { 56 + $('.toggleBar').click(function() { alert('kkkk')
55 /*barPos = parseInt($('.sidebar').css('left')); 57 /*barPos = parseInt($('.sidebar').css('left'));
56 if(barPos!==0 && !bar.hasClass('active')) 58 if(barPos!==0 && !bar.hasClass('active'))
57 { 59 {
300-PROTOTYPES/20160229/AIA/js/main.js
1 /*** 1 /***
2 CUSTOM.JS FUNCTION 2 CUSTOM.JS FUNCTION
3 **/ 3 **/
4 -$(function(){ 4 +$(function(){ alert('ggggggg')
5 "use strict"; 5 "use strict";
6 /*** Sidebar Toggle ***/ 6 /*** Sidebar Toggle ***/
7 var barPos=0; 7 var barPos=0;
400-SOURCECODE/AIAHTML5.Web/MainMenu.html
1 -<div class="bodyWrap row">  
2 - <div class="col-sm-12 pageHeading"> 1 +<div class="bodyWrap row" >
  2 + <div class="col-sm-12 col-md-12 pageHeading">
3 <!--<button type="button" class="btn btn-success pull-left toggleBar btn-sm" data-toggle="tooltip" data-placement="top" title="Show/Hide Sidebar"> <i class="fa fa-bars"></i> </button>--> 3 <!--<button type="button" class="btn btn-success pull-left toggleBar btn-sm" data-toggle="tooltip" data-placement="top" title="Show/Hide Sidebar"> <i class="fa fa-bars"></i> </button>-->
4 - <div class=" pull-left toggleBar toggleHeadingButton" data-toggle="tooltip" data-placement="top" title="Show/Hide Sidebar"> <i class="fa fa-bars"></i> </div>  
5 - <h4 class="pull-left">Welcome to A.D.A.M. Interactive Anatomy</h4>  
6 - <div class="clearfix"></div> 4 + <div class=" pull-left toggleBar toggleHeadingButton" data-toggle="tooltip" data-placement="top" title="Show/Hide Sidebar" style="padding-left: 15px; "> <i class="fa fa-bars"></i> </div>
  5 + <h4 class="pull-left" ng->{{currentActiveModuleTitle}}</h4>
  6 + <div class="clearfix" style=""></div>
7 </div> 7 </div>
8 <!--Sidebar--> 8 <!--Sidebar-->
9 <div class="sidebar pull-left"> 9 <div class="sidebar pull-left">
@@ -29,6 +29,7 @@ @@ -29,6 +29,7 @@
29 </div> 29 </div>
30 <div class="main"> 30 <div class="main">
31 <div class="col-sm-12"> 31 <div class="col-sm-12">
  32 + <div align="center" id="MainImage"><img src="content/images/img1.png" alt="" title="" class="img-responsive"></div>
32 <div ng-view></div> 33 <div ng-view></div>
33 </div> 34 </div>
34 </div> 35 </div>
@@ -69,4 +70,29 @@ @@ -69,4 +70,29 @@
69 $(function () { 70 $(function () {
70 $(".modal").draggable(); 71 $(".modal").draggable();
71 }); 72 });
  73 +</script>
  74 +<script>
  75 + $(function () {
  76 + "use strict";
  77 + /*** Sidebar Toggle ***/
  78 + var barPos = 0;
  79 + var bar = $('.sidebar');
  80 + var main = $('.main');
  81 + $('.toggleBar').click(function () {
  82 + // alert('kkkkkkkkkkkkkk')
  83 + /*barPos = parseInt($('.sidebar').css('left'));
  84 + if(barPos!==0 && !bar.hasClass('active'))
  85 + {
  86 + bar.addClass('active');
  87 + main.addClass('active');
  88 + }
  89 + else
  90 + {
  91 + bar.removeClass('active');
  92 + main.removeClass('active');
  93 + }*/
  94 + bar.toggleClass('active');
  95 + main.toggleClass('active');
  96 + });
  97 + });
72 </script> 98 </script>
73 \ No newline at end of file 99 \ No newline at end of file
400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
1  1 
2 'use strict'; 2 'use strict';
3 3
4 -AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$log", "$location", "$timeout", "DA", "$routeParams",  
5 -function ($scope,$rootScope, $compile,$http, $log, $location, $timeout,DA,$routeParam ) { 4 +AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$log", "$location", "$timeout", "DA","Modules", "$routeParams",
  5 +function ($scope,$rootScope, $compile,$http, $log, $location, $timeout,DA,Modules,$routeParam ) {
6 6
7 $scope.genderId = ""; 7 $scope.genderId = "";
8 $scope.BodyViewData = null; 8 $scope.BodyViewData = null;
@@ -17,12 +17,17 @@ function ($scope,$rootScope, $compile,$http, $log, $location, $timeout,DA,$route @@ -17,12 +17,17 @@ function ($scope,$rootScope, $compile,$http, $log, $location, $timeout,DA,$route
17 //view specific constants 17 //view specific constants
18 $scope.voId ; 18 $scope.voId ;
19 $scope.layerNo; 19 $scope.layerNo;
  20 +
20 21
21 22
22 //get the DA body view list based on selected gender 23 //get the DA body view list based on selected gender
23 $scope.getDAViewList = function ($event) { 24 $scope.getDAViewList = function ($event) {
24 25
25 - // debugger; 26 + // debugger;
  27 + if ($('#MainImage') != null) {
  28 + $('#MainImage').remove();
  29 + }
  30 + $rootScope.currentActiveModuleTitle = Modules[0].Name;
26 $("#bodyViewList").empty(); 31 $("#bodyViewList").empty();
27 //for default load 32 //for default load
28 if ($event == null) { 33 if ($event == null) {
@@ -54,9 +59,9 @@ function ($scope,$rootScope, $compile,$http, $log, $location, $timeout,DA,$route @@ -54,9 +59,9 @@ function ($scope,$rootScope, $compile,$http, $log, $location, $timeout,DA,$route
54 } 59 }
55 60
56 $scope.imagePath = "~/../content/images/DA/BodyViews/" + value._id + '/skintone/' + userEthnicity + '/' + thumbnailImage; 61 $scope.imagePath = "~/../content/images/DA/BodyViews/" + value._id + '/skintone/' + userEthnicity + '/' + thumbnailImage;
57 - 62 + // debugger;
58 63
59 - var $el = $('<div id=' + value._id + ' class="col-sm-3 col-lg-2" data-ng-click="openView($event)"><div class="thumbnail" >' 64 + var $el = $('<div id=' + value._id + ' class="col-sm-3 col-lg-2" title = ' + value._title + ' data-ng-click="openView($event)"><div class="thumbnail" >'
60 + '<img class= "daImg" id="' + value._title + '" src="' + $scope.imagePath + '" alt="" title="" >' 65 + '<img class= "daImg" id="' + value._title + '" src="' + $scope.imagePath + '" alt="" title="" >'
61 + '<div class="caption"><p>' + value._title + '</p></div></a></div></div>').appendTo('#bodyViewList'); 66 + '<div class="caption"><p>' + value._title + '</p></div></a></div></div>').appendTo('#bodyViewList');
62 67
@@ -93,9 +98,11 @@ function ($scope,$rootScope, $compile,$http, $log, $location, $timeout,DA,$route @@ -93,9 +98,11 @@ function ($scope,$rootScope, $compile,$http, $log, $location, $timeout,DA,$route
93 98
94 99
95 $scope.openView = function ($event) { 100 $scope.openView = function ($event) {
96 - // debugger; 101 + debugger;
  102 + $rootScope.currentBodyViewId = $event.currentTarget.id;
  103 + $rootScope.CurrentActiveView = $event.currentTarget.textContent;
97 $rootScope.pageToOpen = 'app/views/da/da-body-view.html'; 104 $rootScope.pageToOpen = 'app/views/da/da-body-view.html';
98 - $scope.voId = $event.currentTarget.id; 105 +
99 106
100 } 107 }
101 108
@@ -160,7 +167,7 @@ function ($scope,$rootScope, $compile,$http, $log, $location, $timeout,DA,$route @@ -160,7 +167,7 @@ function ($scope,$rootScope, $compile,$http, $log, $location, $timeout,DA,$route
160 ajax: { 167 ajax: {
161 url: 'app/views/da/da-view.html' 168 url: 'app/views/da/da-view.html'
162 }, 169 },
163 - title: "Male Anterior", 170 + title: $rootScope.CurrentActiveView,
164 // bootstrap: 'columns large-10 medium-9', 171 // bootstrap: 'columns large-10 medium-9',
165 position: { 172 position: {
166 top: 70, //50, 173 top: 70, //50,
@@ -215,9 +222,9 @@ function ($scope,$rootScope, $compile,$http, $log, $location, $timeout,DA,$route @@ -215,9 +222,9 @@ function ($scope,$rootScope, $compile,$http, $log, $location, $timeout,DA,$route
215 .error(function (data, status, headers, config) { 222 .error(function (data, status, headers, config) {
216 console.log(data); 223 console.log(data);
217 }); 224 });
  225 + debugger;
218 226
219 -  
220 - $scope.voId = 1; 227 + $scope.voId = $rootScope.currentBodyViewId;
221 $scope.layerNo = 0; 228 $scope.layerNo = 0;
222 $scope.skinTone = DA[0].ethnicity; 229 $scope.skinTone = DA[0].ethnicity;
223 230
400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js
1 'use strict'; 1 'use strict';
2 2
3 -AIA.controller("HomeController", ["$rootScope", "$log", "$location", "$timeout",  
4 - function ($rootScope, $log, $location, $timeout) { 3 +AIA.controller("HomeController", ["$rootScope","Modules", "$log", "$location", "$timeout",
  4 + function ($rootScope,Modules, $log, $location, $timeout) {
5 5
6 //$scope.pageToOpen = { 6 //$scope.pageToOpen = {
7 // name: 'MainMenu' 7 // name: 'MainMenu'
8 //}; 8 //};
9 $rootScope.pageToOpen = 'MainMenu.html'; 9 $rootScope.pageToOpen = 'MainMenu.html';
  10 + $rootScope.currentBodyViewId = 1;
  11 + $rootScope.currentActiveModuleTitle = 'Welcome to A.D.A.M. Interactive Anatomy';//Modules[0].Name;
  12 + $rootScope.CurrentActiveView;
10 }] 13 }]
11 ); 14 );
12 \ No newline at end of file 15 \ No newline at end of file
400-SOURCECODE/AIAHTML5.Web/app/main/AIA.js
@@ -41,6 +41,27 @@ AIA.constant(&#39;DA&#39;, [ @@ -41,6 +41,27 @@ AIA.constant(&#39;DA&#39;, [
41 ]); 41 ]);
42 42
43 43
  44 +AIA.constant('Modules', [
  45 + {
  46 + Id:1,
  47 + Name: 'Dissectible Anatomy',
  48 + },
  49 + {
  50 + Id:2,
  51 + Name: 'Atlas Anatomy',
  52 + },
  53 + {
  54 + Id:3,
  55 + Name: '3D Anatomy',
  56 + },
  57 + {
  58 + Id:4,
  59 + Name: 'Clinical Illustrations',
  60 + },
  61 +
  62 +]);
  63 +
  64 +
44 AIA.config(function ($routeProvider, pages, $locationProvider) { 65 AIA.config(function ($routeProvider, pages, $locationProvider) {
45 66
46 $locationProvider.html5Mode(true); 67 $locationProvider.html5Mode(true);
400-SOURCECODE/AIAHTML5.Web/content/js/custom/custom.js
@@ -4,7 +4,8 @@ $(function(){ @@ -4,7 +4,8 @@ $(function(){
4 var barPos=0; 4 var barPos=0;
5 var bar = $('.sidebar'); 5 var bar = $('.sidebar');
6 var main = $('.main'); 6 var main = $('.main');
7 - $('.toggleBar').click(function() { 7 + $('.toggleBar').click(function () {
  8 + alert('kkkkkkkkkkkkkk')
8 /*barPos = parseInt($('.sidebar').css('left')); 9 /*barPos = parseInt($('.sidebar').css('left'));
9 if(barPos!==0 && !bar.hasClass('active')) 10 if(barPos!==0 && !bar.hasClass('active'))
10 { 11 {
@@ -27,7 +28,8 @@ $(function(){ @@ -27,7 +28,8 @@ $(function(){
27 var barPos=0; 28 var barPos=0;
28 var bar = $('.tools'); 29 var bar = $('.tools');
29 var main = $('.main2'); 30 var main = $('.main2');
30 - $('.toggleBar').click(function() { 31 + $('.toggleBar').click(function () {
  32 + alert('hjh gjgvghg')
31 /*barPos = parseInt($('.tools').css('left')); 33 /*barPos = parseInt($('.tools').css('left'));
32 if(barPos!==0 && !bar.hasClass('active')) 34 if(barPos!==0 && !bar.hasClass('active'))
33 { 35 {
@@ -63,6 +65,7 @@ $(function(){ @@ -63,6 +65,7 @@ $(function(){
63 bar.removeClass('active'); 65 bar.removeClass('active');
64 main.removeClass('active'); 66 main.removeClass('active');
65 }*/ 67 }*/
  68 + alert('hjh')
66 bar.toggleClass('active'); 69 bar.toggleClass('active');
67 main.toggleClass('active'); 70 main.toggleClass('active');
68 }); 71 });
400-SOURCECODE/AIAHTML5.Web/content/js/custom/main.js
@@ -7,8 +7,9 @@ $(function(){ @@ -7,8 +7,9 @@ $(function(){
7 var barPos=0; 7 var barPos=0;
8 var bar = $('.sidebar'); 8 var bar = $('.sidebar');
9 var main = $('.main'); 9 var main = $('.main');
10 - $('.toggleBar').click(function() {  
11 - barPos = parseInt($('.sidebar').css('left')); 10 + $('.toggleBar').click(function () {
  11 + debugger;
  12 + barPos = parseInt($('.sidebar').css('left'));
12 if(barPos!==0 && !bar.hasClass('active')) 13 if(barPos!==0 && !bar.hasClass('active'))
13 { 14 {
14 bar.addClass('active'); 15 bar.addClass('active');
400-SOURCECODE/AIAHTML5.Web/index.html
@@ -44,7 +44,7 @@ @@ -44,7 +44,7 @@
44 </button> 44 </button>
45 <a class="frameLogo navbar-brand" href="welcome.html"><img src="content/images/logo-main.png" class="img-responsive" alt=""></a> 45 <a class="frameLogo navbar-brand" href="welcome.html"><img src="content/images/logo-main.png" class="img-responsive" alt=""></a>
46 </div> 46 </div>
47 - <div ng-include="'TopMenu.html'"/> 47 + <div ng-include="'TopMenu.html'"></div>
48 </div> 48 </div>
49 </nav> 49 </nav>
50 <div class="bodyWrap row"> 50 <div class="bodyWrap row">
@@ -52,7 +52,7 @@ @@ -52,7 +52,7 @@
52 <!--Body--> 52 <!--Body-->
53 53
54 <!--<div ng-include="'MainMenu.html'" />--> 54 <!--<div ng-include="'MainMenu.html'" />-->
55 - <div ng-include="pageToOpen" /> 55 + <div ng-include="pageToOpen" ></div>
56 <!--<div data-ng-include data-ng-src="' pageToOpen.name '"></div>--> 56 <!--<div data-ng-include data-ng-src="' pageToOpen.name '"></div>-->
57 <!-- Footer 57 <!-- Footer
58 <footer> 58 <footer>
400-SOURCECODE/AIAHTML5.Web/libs/jquery/jquery_plugin/jsPanel/jspanel/jquery.jspanel.js
  1 +/// <reference path="../../../../../index.html" />
  2 +/// <reference path="../../../../../index.html" />
1 /* global console, MobileDetect, jQuery */ 3 /* global console, MobileDetect, jQuery */
2 /* jQuery Plugin jsPanel 4 /* jQuery Plugin jsPanel
3 Dependencies: 5 Dependencies:
@@ -313,6 +315,7 @@ var jsPanel = { @@ -313,6 +315,7 @@ var jsPanel = {
313 315
314 // closes a jsPanel and removes it from the DOM 316 // closes a jsPanel and removes it from the DOM
315 close: function (panel) { 317 close: function (panel) {
  318 + alert('jspanel closed')
316 // get parent-element of jsPanel 319 // get parent-element of jsPanel
317 var context = panel.parent(), 320 var context = panel.parent(),
318 panelID = panel.attr('id'); 321 panelID = panel.attr('id');
@@ -1507,6 +1510,7 @@ console.log(&quot;jsPanel version: &quot; + jsPanel.version); @@ -1507,6 +1510,7 @@ console.log(&quot;jsPanel version: &quot; + jsPanel.version);
1507 }; 1510 };
1508 1511
1509 jsP.close = function () { 1512 jsP.close = function () {
  1513 + alert('1')
1510 jsPanel.close(jsP); 1514 jsPanel.close(jsP);
1511 // no need to return something 1515 // no need to return something
1512 }; 1516 };
@@ -1596,6 +1600,7 @@ console.log(&quot;jsPanel version: &quot; + jsPanel.version); @@ -1596,6 +1600,7 @@ console.log(&quot;jsPanel version: &quot; + jsPanel.version);
1596 1600
1597 // jsPanel close 1601 // jsPanel close
1598 $('.jsPanel-btn-close', jsP).on('click', function (e) { 1602 $('.jsPanel-btn-close', jsP).on('click', function (e) {
  1603 + alert('2')
1599 e.preventDefault(); 1604 e.preventDefault();
1600 if (!jsP.option.controls.confirmClose) { 1605 if (!jsP.option.controls.confirmClose) {
1601 jsPanel.close(jsP, jsP.parentElmtTagname); 1606 jsPanel.close(jsP, jsP.parentElmtTagname);
@@ -1604,6 +1609,7 @@ console.log(&quot;jsPanel version: &quot; + jsPanel.version); @@ -1604,6 +1609,7 @@ console.log(&quot;jsPanel version: &quot; + jsPanel.version);
1604 jsPanel.close(jsP, jsP.parentElmtTagname); 1609 jsPanel.close(jsP, jsP.parentElmtTagname);
1605 } 1610 }
1606 } 1611 }
  1612 + window.location.href = "da-view-list";
1607 }); 1613 });
1608 1614
1609 // jsPanel minimize 1615 // jsPanel minimize