Skip to content

Commit

Permalink
Merge pull request #139 from khoa-nd/master
Browse files Browse the repository at this point in the history
Merged
  • Loading branch information
khoa-nd committed Jan 8, 2015
2 parents 52e8a76 + 22d8d8d commit ab419c5
Show file tree
Hide file tree
Showing 19 changed files with 54 additions and 86 deletions.
2 changes: 1 addition & 1 deletion src/main/webapp/assets/index.tem.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

<!-- Meta-Information -->
<title>Techlooper | Career Analytics. Open Source. Awesome!</title>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<link rel="shortcut icon" href="icon.ico" type="image/x-icon" />
<meta name="description" content="Techlooper.">
Expand Down
14 changes: 9 additions & 5 deletions src/main/webapp/assets/modules/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ techlooper.config(["$routeProvider", "$translateProvider", "$authProvider", "loc
switch (rejection.status) {
case 403:
case 401:
if (localStorageService.get(jsonValue.storage.back2Me) === true) {
if (localStorageService.get(jsonValue.storage.back2Me) === "true") {
utils.sendNotification(jsonValue.notifications.loginFailed);
}
break;
Expand All @@ -49,9 +49,11 @@ techlooper.config(["$routeProvider", "$translateProvider", "$authProvider", "loc
}
);

localStorageServiceProvider.setPrefix('techlooper')
.setStorageType('cookieStorage')
.setNotify(true, true);
localStorageServiceProvider
.setPrefix('techlooper')
.setStorageType('sessionStorage')
.setNotify(true, true)
.setStorageCookie(45);;

$.post("getSocialConfig", {providers: ["LINKEDIN", "FACEBOOK", "GOOGLE", "TWITTER", "GITHUB"]})
.done(function (resp) {
Expand All @@ -65,6 +67,8 @@ techlooper.config(["$routeProvider", "$translateProvider", "$authProvider", "loc
});
});

$authProvider.loginRedirect = undefined;

$translateProvider.useStaticFilesLoader({
prefix: "modules/translation/messages_",
suffix: ".json"
Expand Down Expand Up @@ -120,7 +124,7 @@ techlooper.run(function (shortcutFactory, connectionFactory, loadingBoxFactory,
connectionFactory.initialize();
loadingBoxFactory.initialize();
cleanupFactory.initialize();
tourService.initialize();
//tourService.initialize();
historyFactory.initialize();
routerService.initialize();
userService.initialize();
Expand Down
2 changes: 1 addition & 1 deletion src/main/webapp/assets/modules/common/cleanup.fac.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ angular.module("Common").factory("cleanupFactory", function (jsonValue, utils, l

cleanSession: function () {
$rootScope.userInfo = undefined;
localStorageService.remove(jsonValue.storage.key);
localStorageService.cookie.remove(jsonValue.storage.key);
}
}

Expand Down
9 changes: 5 additions & 4 deletions src/main/webapp/assets/modules/common/connection.fac.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,16 +68,17 @@ angular.module("Common").factory("connectionFactory",
var instance = {
verifyUserLogin: function() {
return $$.post(jsonValue.httpUri.verifyUserLogin,
{key: localStorageService.get(jsonValue.storage.key)});
{key: localStorageService.cookie.get(jsonValue.storage.key)});
},

login: function () {
if (localStorageService.get(jsonValue.storage.key) === null) {
var key = localStorageService.cookie.get(jsonValue.storage.key);
if (key === null) {
return utils.sendNotification(jsonValue.notifications.loginFailed);
}

$$.post(jsonValue.httpUri.login,
$.param({key: localStorageService.get(jsonValue.storage.key)}),
$.param({key: key}),
{headers: {'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'}})
.then(function (data, status, headers, config) {
utils.sendNotification(jsonValue.notifications.loginSuccess, data, status, headers, config);
Expand All @@ -93,7 +94,7 @@ angular.module("Common").factory("connectionFactory",

findUserInfoByKey: function () {
//HTTP version
$$.post(jsonValue.httpUri.getUserInfoByKey, {key: localStorageService.get(jsonValue.storage.key)})
$$.post(jsonValue.httpUri.getUserInfoByKey, {key: localStorageService.cookie.get(jsonValue.storage.key)})
.then(function(userInfo) {
$rootScope.userInfo = userInfo;
utils.sendNotification(jsonValue.notifications.userInfo, userInfo);
Expand Down
2 changes: 1 addition & 1 deletion src/main/webapp/assets/modules/common/history.fac.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ angular.module("Common").factory("historyFactory", function (jsonValue, $locatio
},

popHistory: function () {
historyStack.pop(); // remove current item
//historyStack.pop(); // remove current item
if (historyStack.length === 0) return "/";
return historyStack.pop();
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/webapp/assets/modules/common/router.ser.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ angular.module("Common").factory("routerService", function (jsonValue, utils, $l
},

loginSuccess: function () {
if (localStorageService.get(jsonValue.storage.back2Me) === true) {
if (localStorageService.get(jsonValue.storage.back2Me) === "true") {
localStorageService.remove(jsonValue.storage.back2Me);
var path = historyFactory.popHistory();
$location.path(path);
Expand Down
4 changes: 3 additions & 1 deletion src/main/webapp/assets/modules/job/searchBox.ser.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ angular.module("Jobs").factory("searchBoxService", function ($location, jsonValu
},

initializeSearchTextbox: function ($scope, $textArray) {
$('.search-block').css('min-height', $(window).height() - 5);
$('.search-block').css('min-height', $(window).height());
utils.sendNotification(jsonValue.notifications.gotData);
scope = $scope;
textArray = $textArray;
Expand Down Expand Up @@ -158,6 +158,8 @@ angular.module("Jobs").factory("searchBoxService", function ($location, jsonValu
updateNavi: function(){
$('.navi-container').find('li').removeClass('active');
$('.navi-container').find('a.m-search-jobs').parent().addClass('active');
$('.main-navi-block').css('background','url(images/line-h1.png) #ccc right top repeat-y');

}
}

Expand Down
1 change: 1 addition & 0 deletions src/main/webapp/assets/modules/job/searchForm.con.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ angular.module('Jobs').controller('searchFormController', function (utils, $scop
animationFactory.animatePage();
navigationService.addSpaceforNavi();
navigationService.reSetingPositionLangIcon();
navigationService.keepNaviBar();
});
1 change: 1 addition & 0 deletions src/main/webapp/assets/modules/job/searchResult.con.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,5 @@ angular.module('Jobs').controller('searchResultController',

searchBoxService.changeBodyColor();
navigationService.addSpaceforNavi();
navigationService.keepNaviBar();
});
11 changes: 1 addition & 10 deletions src/main/webapp/assets/modules/navigation/navigation.con.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
angular.module("Navigation").controller("navigationController", function ($scope, utils, jsonValue, navigationService, $rootScope) {
navigationService.initialize();
navigationService.addSpaceforNavi();
//navigationService.restartTour();
//$scope.userInfo = $rootScope.userInfo;
//$scope.changeChart = function (event) {
// if ($(event.currentTarget).hasClass('m-pie-chart')) {
// $(event.currentTarget).attr('href', '#/bubble-chart').removeClass('m-pie-chart');
// }
// else {
// $(event.currentTarget).attr('href', '#/pie-chart').addClass('m-pie-chart');
// }
//}
navigationService.keepNaviBar();
});
27 changes: 16 additions & 11 deletions src/main/webapp/assets/modules/navigation/navigation.ser.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,6 @@ angular.module("Navigation").factory("navigationService", function (utils, jsonV
});
},
updateHighlight: function(){
if(!userService.notLoggedIn()){
$('.main-navi-block').css('width', '0px');
$('.navi-container').css({'width': '0%', 'display': 'none'});
$('.manager-navi').find('.fa-bars').removeClass('active');
}
$('.navi-container').find('li').removeClass('active');
switch (utils.getView()) {
case jsonValue.views.pieChart:
Expand All @@ -94,6 +89,10 @@ angular.module("Navigation").factory("navigationService", function (utils, jsonV
$('.navi-container').find('a.m-search-jobs').parent().addClass('active');
$('.main-navi-block').css('background','url(images/line-h1.png) #ccc right top repeat-y');
break;
case jsonValue.views.jobsSearchText:
$('.navi-container').find('a.m-search-jobs').parent().addClass('active');
$('.main-navi-block').css('background','url(images/line-h1.png) #ccc right top repeat-y');
break;
case jsonValue.views.signIn:
$('.navi-container').find('a.sign-out-sign-in').parent().addClass('active');
break;
Expand Down Expand Up @@ -134,12 +133,6 @@ angular.module("Navigation").factory("navigationService", function (utils, jsonV
$$.registerEventListeners();
$$.naviControl();
},

//restartTour: function () {
// $('.infor-tour').on('click', function () {
// tourService.restart();
// });
//},
addSpaceforNavi: function(){
var page = $('.techlooper-body');
if($('.main-navi-block').width() == 85){
Expand All @@ -161,8 +154,20 @@ angular.module("Navigation").factory("navigationService", function (utils, jsonV
$('.navi-container').find('a.m-chart').parent().addClass('active');
$('.navi-container').find('a.m-search-jobs').parent().removeClass('active');
$('.main-navi-block').css('background','url(images/line-h.png) #000 right top repeat-y');
},
keepNaviBar: function(){
utils.registerNotification(jsonValue.notifications.userInfo, function(userInfo) {
$('.main-navi-block').css({
'width': '85px',
'position': 'fixed'
});
$('.navi-container').css({'width': '100%', 'display': 'block'});
$('.manager-navi').find('.fa-bars').addClass('active');
instance.addSpaceforNavi();
});
}
}

return instance;

});
6 changes: 3 additions & 3 deletions src/main/webapp/assets/modules/navigation/navigation.tem.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
<div class="navi-container">
<ul>
<li>
<a class="m-chart"/>
<a class="m-chart" title="Home page"/>
</li>
<li ng-show="userInfo !== undefined"><a href="#/register" class="m-user-profile"><img ng-src="{{userInfo.profileImageUrl}}" alt=""/></a></li>
<li><a href="#/jobs/search" class="m-search-jobs"></a></li>
<li ng-show="userInfo !== undefined"><a href="#/register" class="m-user-profile" title="User Profile"><img ng-src="{{userInfo.profileImageUrl}}" alt=""/></a></li>
<li><a href="#/jobs/search" class="m-search-jobs" title="Search Jobs"></a></li>
<li>
<div class="d-languages-block">
<translation></translation>
Expand Down
3 changes: 2 additions & 1 deletion src/main/webapp/assets/modules/register/register.con.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ angular.module('Register').controller('registerController',
$scope.authSource = jsonValue.authSource;
$scope.openOathDialog = registerService.openOathDialog;
$scope.salaryOptions = registerService.getSalaryOptions();

userService.getUserInfo().then(function () {
registerService.updateUserInfo();
utils.sendNotification(jsonValue.notifications.gotData);
});
navigationService.addSpaceforNavi();
navigationService.reSetingPositionLangIcon();
navigationService.keepNaviBar();
});
18 changes: 0 additions & 18 deletions src/main/webapp/assets/modules/register/register.ser.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,11 @@ angular.module('Register').factory('registerService',
$location.path("/");
})
.catch(function (errors) {
//console.log(errors);
utils.notify(jsonValue.messages.errorFieldsSave, 'error');
$.each(errors, function (i, error) {
// TODO: design error display
$("." + error.field).css("border", "1px solid red");//error.defaultMessage
});
//$.notify("Please correct the marked field(s) above.", {
// className: "error",
// autoHideDelay: 3000,
// globalPosition: 'bottom right'
//});
})
.finally(function () {
flag.saveUserInfo = false;
Expand All @@ -70,24 +64,12 @@ angular.module('Register').factory('registerService',
return options
},

updateUserInfo: function () {
$.each($rootScope.userInfo.profileNames, function (i, name) {
// TODO: high-light provider icon
$("a." + name.toLowerCase()).parent().addClass('active');
$("a." + name.toLowerCase()).unbind("click");
});
},

openOathDialog: function (auth) {
utils.sendNotification(jsonValue.notifications.loading, $(window).height());
$auth.authenticate(auth.provider)
.then(function (resp) {//success
delete $window.localStorage["satellizer_token"];
$rootScope.userInfo.profileNames.push(auth.provider.toUpperCase());
instance.updateUserInfo();
//localStorageService.set(jsonValue.storage.key, resp.data.key);
//$http.post("login", $.param({key: resp.data.key}), {headers:{'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'}});
//$location.path(jsonValue.routerUris.register);
})
.finally(function (resp) {
utils.sendNotification(jsonValue.notifications.loaded);
Expand Down
27 changes: 3 additions & 24 deletions src/main/webapp/assets/modules/register/register.tem.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,6 @@ <h2><span>Confirm Information</span></h2>
disabled="disabled" value="[email protected]">
</div>
</div>
<!--<div class="row technical-skill">-->
<!--<p>Choose Your Skills:</p>-->
<!--<ul>-->
<!--<li><label><input type="checkbox" class="checkbox"/>Java</label></li>-->
<!--<li><label><input type="checkbox" class="checkbox"/>.Net</label></li>-->
<!--<li><label><input type="checkbox" class="checkbox"/>PHP</label></li>-->
<!--<li><label><input type="checkbox" class="checkbox"/>Ruby</label></li>-->
<!--<li><label><input type="checkbox" class="checkbox"/>Python</label></li>-->
<!--<li><label><input type="checkbox" class="checkbox"/>DBA</label></li>-->
<!--<li><label><input type="checkbox" class="checkbox"/>BA</label></li>-->
<!--<li><label><input type="checkbox" class="checkbox"/>QA</label></li>-->
<!--<li><label><input type="checkbox" class="checkbox"/>Project Manager</label></li>-->
<!--</ul>-->
<!--</div>-->
<div class="row your-salary">
<p>Choose Your salary:</p>

Expand All @@ -60,16 +46,9 @@ <h2><span>Confirm Information</span></h2>
<h3>Allow us to connect</h3>
<ul>
<li ng-repeat="auth in authSource">
<!--<span ng-if="item.site == 'LinkedIn'">-->
<!--<span class="active" ng-style="{'background-color': item.bgcolor}">-->
<!--<img ng-src="{{item.logo}}" alt="">-->
<!--</span>-->
<!--</span>-->
<!--<span ng-if="item.site != 'LinkedIn'">-->
<span ng-if="auth.isNotSupported === undefined">
<a ng-click="openOathDialog(auth)" class="{{auth.provider}}"><img ng-src="{{auth.logo}}" alt=""></a>
</span>
<!--</span>-->
<span ng-if="auth.isNotSupported === undefined" class="{{userInfo !== undefined && userInfo.profileNames.indexOf(auth.provider.toUpperCase()) > -1 ? 'active' : 'inactive' }}">
<a ng-click="openOathDialog(auth)" class="{{auth.provider}}"><img ng-src="{{auth.logo}}" alt=""></a>
</span>
</li>
</ul>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/main/webapp/assets/modules/signin/signin.ser.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ angular.module('SignIn').factory('signInService',
$auth.authenticate(auth.provider)
.then(function (resp) {//success
delete $window.localStorage["satellizer_token"];
localStorageService.set(jsonValue.storage.key, resp.data.key);
localStorageService.cookie.set(jsonValue.storage.key, resp.data.key);
connectionFactory.login();
})
.catch(function (resp) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@ angular.module('Skill').controller('skillAnalyticsController',
//animationFactory.animatePage();
navigationService.addSpaceforNavi();
navigationService.reSetingPositionLangIcon();
navigationService.keepNaviBar();
});
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<a class="m-languages langKey" ng-class="icoLanguage" ng-click="changeLanguage()"></a>
<a class="m-languages langKey" ng-class="icoLanguage" ng-click="changeLanguage()" title="Select Languages"></a>
<!--<div class="langKey" translate>language</div>-->
6 changes: 3 additions & 3 deletions src/main/webapp/assets/sass/main.sass
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ a.m-languages.en:hover
a.m-pie-chart
background-position: 8px 8px !important
a.m-bubble-chart
background-position: 8px -58px
background-position: 8px -56px
a.m-search-jobs
background-position: 8px -187px
a.m-languages.vi
Expand Down Expand Up @@ -310,7 +310,7 @@ a.m-languages.en:hover
a.m-pie-chart:hover
background-position: -65px 8px !important
a.m-bubble-chart:hover
background-position: -65px -58px
background-position: -65px -56px
a.m-search-jobs:hover
background-position: -65px -187px
a.m-languages.vi:hover
Expand All @@ -331,7 +331,7 @@ a.m-languages.en:hover
a.m-pie-chart
background-position: -65px 8px !important
a.m-bubble-chart
background-position: -65px -58px
background-position: -65px -56px
a.m-search-jobs
background-position: -65px -187px
a.m-languages.vi
Expand Down

0 comments on commit ab419c5

Please sign in to comment.