From bdc4f3fc14d7040d73a0cd811d0ff6994c6d800f Mon Sep 17 00:00:00 2001 From: nikita Date: Mon, 11 Apr 2016 16:17:49 +0530 Subject: [PATCH] added constant for ethnicity and modesty. added by default laod of mail body view list. --- 400-SOURCECODE/AIAHTML5.Web/AIAHTML5.Web.csproj.user | 2 +- 400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js | 72 ++++++++++++++++++++++++++++++++++++++++++++++-------------------------- 400-SOURCECODE/AIAHTML5.Web/app/main/AIA.js | 50 +++++++++----------------------------------------- 400-SOURCECODE/AIAHTML5.Web/app/views/da/da-body-view-list.html | 34 ++++++++++++++++++---------------- 4 files changed, 74 insertions(+), 84 deletions(-) diff --git a/400-SOURCECODE/AIAHTML5.Web/AIAHTML5.Web.csproj.user b/400-SOURCECODE/AIAHTML5.Web/AIAHTML5.Web.csproj.user index c77621e..8bd9366 100644 --- a/400-SOURCECODE/AIAHTML5.Web/AIAHTML5.Web.csproj.user +++ b/400-SOURCECODE/AIAHTML5.Web/AIAHTML5.Web.csproj.user @@ -7,7 +7,7 @@ - login.html + app/views/da/da-body-view-list.html SpecificPage True False diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js index 9c163c4..3e634cd 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js @@ -1,29 +1,21 @@ 'use strict'; -AIA.controller("DAController", ["$scope","$http", "$log", "$location", "$timeout", - function ($scope,$http, $log, $location, $timeout) { +AIA.controller("DAController", ["$scope", "$compile", "$http", "$log", "$location", "$timeout","DA", + function ($scope, $compile,$http, $log, $location, $timeout,DA ) { $scope.genderId = ""; $scope.BodyViewData = null; $scope.selectedGenderBodyViewData = null; $scope.imagePath = ""; - //get body view list data - $http({ method: 'GET', url: 'http://localhost/AIA/content/data/json/da_dat_contentlist.json' }).success(function (data) { - debugger; - $scope.BodyViewData = data; - //clonsole.log($scope.BodyRegionData); - }) - .error(function (data, status, headers, config) { - console.log(data); - }); + //get the DA body view list based on selected gender $scope.getDAViewList = function ($event) { - debugger; + $("#bodyViewList").empty(); //for default load if ($event == null) { @@ -39,26 +31,27 @@ AIA.controller("DAController", ["$scope","$http", "$log", "$location", "$timeout angular.forEach($scope.selectedGenderBodyViewData, function (value, key) { - // debugger + + var userEthnicity = DA[0].ethnicity; + var userModestysettings = DA[0].modesty; var userSelectedSkintone = 'W'; $scope.userModestySetting = 'Y' - var thumbnailImage = ((value._thumbnailImage).replace('.jpg', '_' + userSelectedSkintone + $scope.userModestySetting)) + '.jpg'; - $scope.imagePath = "http://localhost/AIA/content/images/DA/BodyViews/" + value._id + '/skintone/' + userSelectedSkintone + '/' + thumbnailImage; + var thumbnailImage = ((value._thumbnailImage).replace('.jpg', '_' + userEthnicity + userModestysettings)) + '.jpg'; + $scope.imagePath = "http://localhost/AIA/content/images/DA/BodyViews/" + value._id + '/skintone/' + userEthnicity + '/' + thumbnailImage; $scope.isImageExists = $scope.checkImgExistance($scope.imagePath); - + //debugger if ($scope.isImageExists == false) { $scope.imagePath = ($scope.imagePath).replace($scope.userModestySetting, ""); } - var bodyView = ''; - - - $('#bodyViewList').append(bodyView); - + //debugger + var $el = $('
' + + '' + + '

' + value._title + '

').appendTo('#bodyViewList'); + $compile($el)($scope); + }); @@ -79,13 +72,40 @@ AIA.controller("DAController", ["$scope","$http", "$log", "$location", "$timeout }, }) - debugger; + debugger return result; } - $(document).on("click", ".daImg", function () { - alert('opening') + + + $scope.openView = function ($event) { + alert('clicked: ' + $event.currentTarget.id) + } + + + //load json data for body view + $scope.loadData = function () { + $http({ method: 'GET', url: 'http://localhost/AIA/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); + }); + } + + + angular.element(document).ready(function () { + + + }) }] + + + ); diff --git a/400-SOURCECODE/AIAHTML5.Web/app/main/AIA.js b/400-SOURCECODE/AIAHTML5.Web/app/main/AIA.js index 6655e70..af62c59 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/main/AIA.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/main/AIA.js @@ -3,47 +3,6 @@ var AIA = angular.module('AIA', ['ngSanitize', 'ngRoute']); -AIA.directive('checkImageExistance', function ($http) { - return { - restrict: 'A', - link: function (scope, element, attrs) { - debugger; - attrs.$observe('ngSrc', function (ngSrc) { - $http.get(ngSrc).success(function () { - alert('image exist'); - }).error(function () { - alert('image not exist'); - element.attr('src', 'http://upload.wikimedia.org/wikipedia/commons/7/73/Lion_waiting_in_Namibia.jpg'); // set default image - }); - }); - } - }; -}); - - -AIA.directive('nnkn', function () { - return { - restrict: 'E', - link: function (scope, element, attrs) { - alert('nt') - // show an image-missing image - element.error(function () { - alert('not exist') - var w = element.width(); - var h = element.height(); - var source = element.src; - // using 20 here because it seems even a missing image will have ~18px width - // after this error function has been called - if (w <= 20) { w = 100; } - if (h <= 20) { h = 100; } - var url = 'http://placehold.it/' + w + 'x' + h + '/cccccc/ffffff&text=Oh No!'; - element.prop('src', url); - element.css('border', 'double 3px #cccccc'); - }); - } - } -}); - AIA.constant('pages', [ { @@ -67,6 +26,15 @@ AIA.constant('pages', [ ]); +AIA.constant('DA', [ + { + ethnicity: 'W', + modesty: 'Y', + + }, +]); + + AIA.config(function ($routeProvider, pages) { for (var i = 0; i < pages.length; i++) { if (pages[i].pageSlug != null) { diff --git a/400-SOURCECODE/AIAHTML5.Web/app/views/da/da-body-view-list.html b/400-SOURCECODE/AIAHTML5.Web/app/views/da/da-body-view-list.html index 61172dd..f499d22 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/views/da/da-body-view-list.html +++ b/400-SOURCECODE/AIAHTML5.Web/app/views/da/da-body-view-list.html @@ -20,7 +20,7 @@ - +
-
-
-
+
+
+
+
- - - - -
-
-
+ + + + +
+
+
+
-
+
-- libgit2 0.21.4