Commit ba4f459ff28df3c40120e239726aa9ea2fdb7a3f

Authored by Nikita Kulshreshtha
1 parent 56dce78f

added scripts for layer change slider.

removed debugger
400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
1   -/// <reference path="../views/da/da-view.html" />
2   -/// <reference path="../views/da/da-view.html" />
  1 +
3 2 'use strict';
4 3  
5 4 AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$log", "$location", "$timeout", "DA", "$routeParams",
... ... @@ -15,7 +14,6 @@ function ($scope,$rootScope, $compile,$http, $log, $location, $timeout,DA,$route
15 14 $scope.BodyLayerData = null;
16 15 $scope.VocabTermData = null;
17 16 $scope.bodyViewId = 0;
18   -
19 17 //view specific constants
20 18 $scope.voId ;
21 19 $scope.layerNo;
... ... @@ -88,14 +86,14 @@ function ($scope,$rootScope, $compile,$http, $log, $location, $timeout,DA,$route
88 86  
89 87 },
90 88 })
91   - debugger
  89 + // debugger
92 90 return result;
93 91 }
94 92  
95 93  
96 94  
97 95 $scope.openView = function ($event) {
98   - debugger;
  96 + // debugger;
99 97 $rootScope.pageToOpen = 'app/views/da/da-body-view.html';
100 98 $scope.voId = $event.currentTarget.id;
101 99  
... ... @@ -171,7 +169,7 @@ function ($scope,$rootScope, $compile,$http, $log, $location, $timeout,DA,$route
171 169 },
172 170 //overflow: { horizontal: 'scroll', vertical: 'scroll' },
173 171  
174   - size: { width: $(window).outerWidth() - 120, height: $(window).outerHeight()-110 },
  172 + size: { width: $(window).outerWidth() - 110, height: $(window).outerHeight()-110 },
175 173 //size: { width: 500, height: 500 },
176 174  
177 175 });
... ... @@ -195,10 +193,10 @@ function ($scope,$rootScope, $compile,$http, $log, $location, $timeout,DA,$route
195 193  
196 194  
197 195 $scope.LoadDefaultLayerImage = function () {
198   - debugger;
  196 + // debugger;
199 197  
200 198 $http({ method: 'GET', url: 'http://localhost/AIA/content/data/json/da_dat_brview.json' }).success(function (data) {
201   - debugger;
  199 + // debugger;
202 200 $scope.BodyRegionData = data;
203 201 console.log($scope.BodyRegionData);
204 202 })
... ... @@ -209,7 +207,7 @@ function ($scope,$rootScope, $compile,$http, $log, $location, $timeout,DA,$route
209 207  
210 208 // Load Layer data
211 209 $http({ method: 'GET', url: 'http://localhost/AIA/content/data/json/da_dat_layer_1.json' }).success(function (data) {
212   - debugger
  210 + // debugger
213 211 $scope.BodyLayerData = data;
214 212 console.log($scope.BodyLayerData);
215 213  
... ... @@ -231,12 +229,15 @@ function ($scope,$rootScope, $compile,$http, $log, $location, $timeout,DA,$route
231 229 //calculate coordinates for body region images
232 230 $scope.CalculateImageCordinates = function (viewOrientationId) {
233 231  
234   - debugger;
  232 + //debugger;
235 233 //set height of canvas div and left tool bar as per window size
236 234 $scope.BodyRegionCordinatesData = []; // create an empty array
237 235  
238   - //$('#canvasDiv').css('height', $('#daImagePanel').outerHeight() - 124)
239   - //$('#leftToolBar').css('height', $('#daImagePanel').outerHeight() - 124)
  236 + $('#canvasDiv').css('height', $('#daImagePanel').outerHeight() - 134)
  237 + //$('#canvasDiv').css('width', $('#daImagePanel').outerWidth() - 100)
  238 + $('#leftToolBar').css('height', $('#daImagePanel').outerHeight() - 124)
  239 +
  240 +
240 241  
241 242 //calculate image coordinates and draw image
242 243 var bodyRegionCoordinates = $scope.BodyRegionData.BodyRegionViews;
... ... @@ -261,10 +262,10 @@ function ($scope,$rootScope, $compile,$http, $log, $location, $timeout,DA,$route
261 262 //1.Get image source
262 263 var src = $scope.GetImageSource(value._BodyRegionId);
263 264 $scope.imageSource = src;
264   - debugger;
  265 + // debugger;
265 266 //2.Draw mirror image
266 267 $scope.DrawMirroredImage(Math.round(rectangle.scaledHeight), Math.round(rectangle.scaledWidth), Math.round(rectangle.scaledX), Math.round(rectangle.scaledY), src, value._BodyRegionId, 'N');
267   - debugger;
  268 + // debugger;
268 269 $scope.BodyRegionCordinatesData.push(
269 270 {
270 271 "bodyRegionId": value._BodyRegionId, "Height": Math.round(rectangle.scaledHeight), "Width": Math.round(rectangle.scaledWidth),
... ... @@ -274,7 +275,7 @@ function ($scope,$rootScope, $compile,$http, $log, $location, $timeout,DA,$route
274 275  
275 276 //3.GetMaskImageSource
276 277 var maskImageSrc = $scope.GetMaskImageSource($scope.imageSource);
277   - debugger;
  278 + // debugger;
278 279 //4 Draw Mask Mirror Image
279 280 $scope.DrawMirroredImage(Math.round(rectangle.scaledHeight), Math.round(rectangle.scaledWidth), Math.round(rectangle.scaledX), Math.round(rectangle.scaledY), maskImageSrc, value._BodyRegionId, 'Y');
280 281  
... ... @@ -333,7 +334,8 @@ function ($scope,$rootScope, $compile,$http, $log, $location, $timeout,DA,$route
333 334 $('#daLoaderLabel').css('visibility', 'hidden')
334 335 $('#canvasDiv').css('overflow', 'scroll')
335 336 $('#canvasDiv').scrollLeft($('#canvasDiv').width() / 2)
336   -
  337 + // $('#canvasDiv').scrollLeft($scope.imageHorizontlScrollPosition)
  338 + $('#canvasDiv').scrollTop(50)
337 339 var abc = $scope.BodyRegionCordinatesData
338 340 }
339 341  
... ... @@ -382,7 +384,7 @@ function ($scope,$rootScope, $compile,$http, $log, $location, $timeout,DA,$route
382 384  
383 385  
384 386 $scope.GetImageSource = function (bodyRegionId) {
385   - debugger;
  387 + // debugger;
386 388 var dataLength = $scope.BodyLayerData.Layers.DataLayer.length;
387 389  
388 390 //set max for LayerNumber input
... ... @@ -745,7 +747,10 @@ function ($scope,$rootScope, $compile,$http, $log, $location, $timeout,DA,$route
745 747 }
746 748  
747 749  
748   -
  750 + //layer change function
  751 + $scope.LayerChange = function () {
  752 + alert('layer changed');
  753 + }
749 754  
750 755  
751 756  
... ...
400-SOURCECODE/AIAHTML5.Web/app/views/da/da-view.html
1 1 <div class=" ">
2   - <div class="tools pull-left">
  2 + <div class="tools pull-left" id="leftToolBar">
3 3 <div class="toggle-icon toggleBar toggleHeadingButton" title="Show/Hide Sidebar"></div>
4 4 <div class="">
5 5 <div class="col-sm-6" title="Identify">
... ... @@ -63,9 +63,10 @@
63 63 </div>
64 64 <div class="">
65 65 <p>
66   - <input type="number" id="amount" value="0" step="1" max="100" min="0" style="width:80px; margin:10px 0 0 15px;">
  66 + <input type="number" id="txtlayerNumber" value="0" step="1" max="100" min="0" style="width:80px; margin:10px 0 0 15px;" ng-model="layerNo" ng-change="LayerChange()">
  67 +
67 68 </p>
68   - <div id="slider-vertical" style="height:140px;" class="vert_slider "></div>
  69 + <div id="layerChangeSlider" style="height:140px;" class="vert_slider "></div>
69 70 </div>
70 71 </div>
71 72 </div>
... ... @@ -98,11 +99,11 @@
98 99 </div>
99 100 </div>
100 101 </div>
101   - <div class="col-sm-12">
102   - <div class="container-fluid">
103   - <div class="">
  102 + <div style="top:100px;" >
  103 + <div >
  104 + <div >
104 105 <!--<div class="col-sm-12 img-thumbnail" align="center"><img src="http://localhost/AIA/content/images/1000x600.jpg" alt="" title="" class="img-responsive"></div>-->
105   - <div id="canvasDiv" style=" width: 100% !important;top:2px;">
  106 + <div id="canvasDiv" style=" width: 99% !important;top:2px;overflow:scroll;">
106 107 <div id="daLoaderLabel">Loading....</div>
107 108  
108 109 </div>
... ... @@ -112,3 +113,64 @@
112 113 </div>
113 114 <div class="clearfix"></div>
114 115 </div>
  116 +<script>$(window).load(function () {
  117 + $(".stickey-area").sticky();
  118 +});</script>
  119 +<script>
  120 + $(function () {
  121 + $("#layerChangeSlider").slider({
  122 + orientation: "vertical",
  123 + range: "max", // <--- needed...
  124 + min: 0,
  125 + max: 100,
  126 + value: 50,
  127 + slide: function (event, ui) {
  128 + $("#txtlayerNumber").val(100 - ui.value); // basic math operation..
  129 + }
  130 + });
  131 + $("#txtlayerNumber").val($("#layerChangeSlider").slider("value"));
  132 + });
  133 +</script>
  134 +
  135 +<script>
  136 + $(function () {
  137 + $("#slider-range-min-2").slider({
  138 + range: "min",
  139 + min: 1,
  140 + max: 60,
  141 + value: 10,
  142 + slide: function (event, ui) {
  143 + $("#amount-2").val(ui.value);
  144 + }
  145 + });
  146 + $("#amount-2").val($("#slider-vertical-2").slider("value"));
  147 +
  148 + });
  149 +</script>
  150 +<script src="js/jquery-ui-slider-pips.js"></script>
  151 +<script>
  152 + $(".slider")
  153 +
  154 + .slider({
  155 + min: 0,
  156 + max: 100,
  157 + value: 40,
  158 + range: "min",
  159 + orientation: "horizontal"
  160 + })
  161 +
  162 + .slider("pips", {
  163 + rest: "label",
  164 + step: "25"
  165 + });
  166 +</script>
  167 +<script>
  168 + $(document).ready(function () {
  169 + $('[data-toggle="tooltip"]').tooltip();
  170 + });
  171 +</script>
  172 +<script>
  173 + $(function () {
  174 + $(".modal").draggable();
  175 + });
  176 +</script>
115 177 \ No newline at end of file
... ...