Commit 37873d3b764bf8261bb2b663a993e3b42694f73f

Authored by mangaldeep patel
1 parent d717573c

AdamImage Module changes

400-SOURCECODE/AIAHTML5.Web/app/controllers/AIController.js
... ... @@ -70,7 +70,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
70 70  
71 71 $scope.reRunSearchOnLoad = function () {
72 72  
73   - var curBodyRegion = $rootScope.getLocalStorageValue("AICurBodyId");
  73 + var curBodyRegion = $rootScope.getLocalStorageValue("AIImageId");
74 74 if (typeof (curBodyRegion) !== "undefined" && curBodyRegion !== null && curBodyRegion !== '') {
75 75 $scope.query.selectedbodyregion = curBodyRegion;
76 76 }
... ... @@ -109,11 +109,13 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
109 109 };
110 110  
111 111 $scope.loadAllAI = function () {
  112 + $rootScope.isLoading = true;
112 113 $('#aiSpinner').css('visibility', 'visible');
113 114 $('#aiSpinner').css('zIndex', '20000');
114 115 var promise = DataService.getJson('~/../content/data/json/ai/ai_dat_contentlist.json')
115 116 promise.then(
116 117 function (result) {
  118 +
117 119 $scope.IllustrationData = result;
118 120  
119 121 $scope.selectedAIListViewData = new jinqJs()
... ... @@ -126,21 +128,22 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
126 128  
127 129  
128 130 $('#grid-view').empty();
129   - var $e1 = $('<ul><li ng-repeat="value in selectedAIListViewData" class="col-sm-3 col-md-2"><div id="{{value._id}}" title = "{{value._Title}}" class="GridViewDataDivHeight" data-ng-click="openView($event)">'
130   - + '<div class="thumbnail" >'
  131 + var $e1 = $('<ul><li ng-repeat="value in selectedAIListViewData" class="col-sm-3 col-md-2"><div id="{{value._id}}" title = "{{value._Title}}" class="GridViewDataDivHeight" data-ng-click="AdamDetail($event)">'
  132 + + '<div class="thumbnail" id= "thumbnailDiv" >'
131 133 + '<img id="{{value._Title}}" ng-src="~/../content/images/ai/thumbnails/{{value._ThumbnailImage}}" >'//alt="{{value._Title}}" >'
132 134 + '<div class="caption"><p> {{value._Title}}</p></div></a></div></div></li></ul>').appendTo('#grid-view');
133 135 $compile($e1)($scope);
134 136  
135 137 $timeout(function () {
136   - $('#' + $rootScope.getLocalStorageValue("currentBodyViewId")).find('.thumbnail').addClass('HightLightThumbnail');
  138 + $('#' + $rootScope.getLocalStorageValue("currentAIImageId")).find('.thumbnail').addClass('HightLightThumbnail');
137 139 if ($rootScope.getLocalStorageValue('AIGridViewScroll') !== null && $location.url() == "/ADAM-images") {
138 140 $('html, body').animate({ scrollTop: $rootScope.getLocalStorageValue('AIGridViewScroll') });
139 141 }
140 142 }, 100);
141 143  
142   -
143   - $timeout(function () { $('#aiSpinner').css('visibility', 'hidden'); }, 300);
  144 + $rootScope.isLoading = false;
  145 + $('#aiSpinner').css('visibility', 'hidden');
  146 +
144 147 },
145 148 function (error) {
146 149 // handle errors here
... ... @@ -201,7 +204,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
201 204  
202 205  
203 206 //set localstorage values
204   - localStorage.setItem("AICurBodyId", '');
  207 + localStorage.setItem("AIImageId", '');
205 208 localStorage.setItem("AIListViewScroll", '');
206 209  
207 210 if ($('.selected').hasClass("selected")) { $('.selected').removeClass("selected"); }
... ... @@ -223,21 +226,20 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
223 226  
224 227  
225 228 $scope.filterstring = true;
226   -
  229 + $scope.searchAIListViewData = [];
227 230 while ($scope.searchAIListViewData.length) {
228 231 $scope.searchAIListViewData.pop();
229 232 }
230 233  
231   -
232   -
233   -
  234 + filtercount = 0;
234 235 if (typeof (SearchText) !== "undefined" && (SearchText !== null && SearchText !== "")) {
235 236  
236   - localStorage.setItem("AICurBodyId", SearchText);
  237 + localStorage.setItem("AIImageId", SearchText.trim());
  238 + filtercount = filtercount + 1;
237 239  
238 240 }
239 241 else {
240   - localStorage.setItem("AICurBodyId", '');
  242 + localStorage.setItem("AIImageId", '');
241 243  
242 244 }
243 245  
... ... @@ -256,36 +258,29 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
256 258 angular.forEach($scope.selectedAIListViewData, function (value, key) {
257 259  
258 260 var selectimg = true;
259   - //var count = 0;
260   -
261   -
  261 + var count = 0;
262 262 if (typeof (SearchText) !== "undefined" && (SearchText !== null && SearchText !== "")) {
263 263 var posbodyregion = value._Title.indexOf(SearchText);
264 264 if (posbodyregion > -1) {
265 265 selectimg = true;
266   - //count = count + 1;
  266 + count = count + 1;
267 267  
268 268 }
269 269 else {
270 270 selectimg = false;
271   - //count = count - 1;
  271 + count = count - 1;
272 272 }
273 273  
274 274 }
275 275  
276   -
277   -
278   - if (selectimg === true ) {
279   -
280   -
  276 + if (selectimg === true && count >= filtercount) {
281 277 $scope.imagePath = "~/../content/images/ai/thumbnails/" + value._ThumbnailImage;
282 278  
283   - var $el = $('<div id="' + value._id + '" class="col-sm-3 col-md-2" title = "' + value._Title + '" data-ng-click="openView($event)">'
  279 + var $el = $('<div id="' + value._id + '" class="col-sm-3 col-md-2" title = "' + value._Title + '" data-ng-click="AdamDetail($event)">'
284 280 + '<div class="thumbnail" >'
285 281 + '<img id="' + value._Title + '"ng-src="' + $scope.imagePath + '" alt="" title="" >'
286 282 + '<div class="caption"><p>' + value._Title + '</p></div></a></div></div>').appendTo('#grid-view');
287 283  
288   -
289 284 $compile($el)($scope);
290 285  
291 286 $(".sidebar").mCustomScrollbar({
... ... @@ -297,7 +292,6 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
297 292 $scope.searchAIListViewData.push(
298 293 {
299 294 "_id": value._id,
300   - "_ImageId": value._ImageId,
301 295 "_Title": value._Title,
302 296 "_contentImage": value._contentImage,
303 297 "_ThumbnailImage": value._ThumbnailImage,
... ... @@ -329,12 +323,12 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
329 323 }
330 324  
331 325  
332   - $scope.openView = function ($event) {
  326 + $scope.AdamDetail = function ($event) {
333 327  
334 328 $rootScope.MenuModuleName = "AI";
335 329 $rootScope.disableAnnotationTB = false;
336 330 $rootScope.AIAnotationIdentifyModeOff = true;
337   - $rootScope.currentBodyViewId = $event.currentTarget.id;
  331 + $rootScope.currentAIImageId = $event.currentTarget.id;
338 332 if ($event.currentTarget.textContent !== null && typeof ($event.currentTarget.textContent) !== "undefined") {
339 333 var AITitle = [];
340 334 AITitle = new jinqJs()
... ... @@ -348,8 +342,8 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
348 342  
349 343 }
350 344  
351   - localStorage.setItem("currentViewTitleFromJson", $rootScope.ViewTitle);
352   - localStorage.setItem("currentBodyViewId", $event.currentTarget.id);
  345 + localStorage.setItem("currentImageTitleFromJson", $rootScope.ViewTitle);
  346 + localStorage.setItem("currentAIImageId", $event.currentTarget.id);
353 347  
354 348 //Set the vertical scroll value of the Grid-View.
355 349 var y = $($window).scrollTop();
... ... @@ -358,7 +352,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
358 352 $location.url('/adam-images-detail');
359 353 }
360 354  
361   - $scope.openBodyView = function () {
  355 + $scope.OpenAdamImageDeatail = function () {
362 356  
363 357 if ($rootScope.refreshcheck == null) {
364 358 $location.path('/');
... ... @@ -366,11 +360,11 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
366 360  
367 361 $rootScope.isLoading = true;
368 362 $('#spinner').css('visibility', 'visible');
369   - $scope.voId = $rootScope.getLocalStorageValue("currentBodyViewId");
  363 + $scope.voId = $rootScope.getLocalStorageValue("currentAIImageId");
370 364  
371 365 var counter = 1;
372   - var tittle = $rootScope.getLocalStorageValue("currentViewTitleFromJson");
373   - localStorage.setItem("currentViewTitle", tittle);
  366 + var tittle = $rootScope.getLocalStorageValue("currentImageTitleFromJson");
  367 + localStorage.setItem("currentImageTitle", tittle);
374 368  
375 369 var promise = DataService.getJson('~/../content/data/json/ai/ai_dat_contentlist.json')
376 370 promise.then(
... ... @@ -400,7 +394,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
400 394 //ajax: {
401 395 // url: 'app/views/ci/ci-view-detail.html'
402 396 //},
403   - title: $rootScope.getLocalStorageValue("currentViewTitle"),
  397 + title: $rootScope.getLocalStorageValue("currentImageTitle"),
404 398 position: {
405 399 top: 70,
406 400 left: 20,
... ... @@ -419,9 +413,9 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
419 413  
420 414 $rootScope.currentSlug = 'adam-images-detail';
421 415  
422   - $rootScope.openViews.push(
  416 + $rootScope.AdamDetails.push(
423 417 {
424   - "module": $rootScope.currentActiveModuleTitle, "bodyView": tittle, "state": 'max', "BodyViewId": $rootScope.currentBodyViewId,
  418 + "module": $rootScope.currentActiveModuleTitle, "bodyView": tittle, "state": 'max', "BodyViewId": $rootScope.currentAIImageId,
425 419 "slug": $rootScope.currentSlug
426 420 });
427 421  
... ... @@ -440,7 +434,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
440 434  
441 435 );
442 436  
443   - // console.log($rootScope.openViews);
  437 + // console.log($rootScope.AdamDetails);
444 438 $('#AIView').css("height", $(window).outerHeight());
445 439  
446 440 $('#AIView').css("width", $(window).outerWidth());
... ...
400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js
... ... @@ -1248,6 +1248,14 @@ function ($rootScope, $scope, Modules, $log, $location, $timeout, DataService, A
1248 1248 $("#optionsListManagerTab").addClass("disableSubMenu");
1249 1249 $rootScope.disableFileMenu = " ";
1250 1250 }
  1251 + else if ($location.url() == "/adam-images-detail") {
  1252 + $rootScope.disableMenuannotation = " ";
  1253 + $rootScope.disableMenuoption = " ";
  1254 + $rootScope.disableSubMenu = "disableSubMenu";
  1255 + $("#annotationToolBarOptions").removeClass("disableSubMenu");
  1256 + $("#optionsListManagerTab").addClass("disableSubMenu");
  1257 + $rootScope.disableFileMenu = " ";
  1258 + }
1251 1259 else if ($location.url() == "/module-item-view") {
1252 1260 $rootScope.disableMenuannotation = " ";
1253 1261 $rootScope.disableMenuoption = " ";
... ...
400-SOURCECODE/AIAHTML5.Web/app/views/ai/adam-images-detail.html
1 1 <div>
2 2 <div ng-include="aap/widget/MainMenu.html"></div>
3   - <div ng-init="openBodyView()" id="AIView" class="aiView" ng-controller="AIController" style=" "></div> <!--position: absolute !important;-->
  3 + <div ng-init="OpenAdamImageDeatail()" id="AIView" class="aiView" ng-controller="AIController" style=" "></div> <!--position: absolute !important;-->
4 4  
5 5  
6 6 </div>
... ...
400-SOURCECODE/AIAHTML5.Web/app/views/ai/ai-view.html
... ... @@ -61,14 +61,14 @@
61 61 </tr>
62 62 </thead>
63 63 <tbody id="ListViewDiv" ng-if="!filterstring" class="clstbody">
64   - <tr id="{{item._id}}" ng-class="{selected: item._id === idSelected}" ng-click="showItem(item._id)" ng-dblclick="openView($event)" ng-repeat="item in selectedAIListViewData">
  64 + <tr id="{{item._id}}" ng-class="{selected: item._id === idSelected}" ng-click="showItem(item._id)" ng-dblclick="AdamDetail($event)" ng-repeat="item in selectedAIListViewData">
65 65 <td width="20%">
66 66 {{item._Title}}
67 67 </td>
68 68 </tr>
69 69 </tbody>
70 70 <tbody id="ListViewDiv" ng-if="filterstring" class="clstbody">
71   - <tr ng-click="showItem(item._id)" ng-class="{selected: item._id === idSelected}" ng-dblclick="openView($event)" ng-repeat="item in searchAIListViewData">
  71 + <tr ng-click="showItem(item._id)" ng-class="{selected: item._id === idSelected}" ng-dblclick="AdamDetail($event)" ng-repeat="item in searchAIListViewData">
72 72 <td width="20%">
73 73 {{item._Title}}
74 74 </td>
... ... @@ -81,12 +81,12 @@
81 81 <div class="row well">
82 82 <div title="{{SelectedAITitle}}" class="col-sm-3 col-lg-2 no-padding">
83 83 <div class="thumbnail no-margin">
84   - <img id="{{SelectedAIId}}" src="{{SelectedAIthumbImage}}" alt="" title="{{SelectedAITitle}}" data-ng-click="openView($event)">
  84 + <img id="{{SelectedAIId}}" src="{{SelectedAIthumbImage}}" alt="" title="{{SelectedAITitle}}" data-ng-click="AdamDetail($event)">
85 85 </div>
86 86 </div>
87 87 <div class="col-sm-9 col-lg-9" style="padding-left:10px;">
88 88 <p class="f11" ng-bind-html="SelectedCISummary"></p>
89   - <button id="{{SelectedAIId}}" type="button" class="btn btn-primary btn-sm pull-right" data-ng-click="openView($event)">Open</button>
  89 + <button id="{{SelectedAIId}}" type="button" class="btn btn-primary btn-sm pull-right" data-ng-click="AdamDetail($event)">Open</button>
90 90 </div>
91 91 </div>
92 92  
... ...