-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #372 from khoa-nd/master
Merged
- Loading branch information
Showing
16 changed files
with
241 additions
and
249 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
techlooper.directive("navigation", function () { | ||
return { | ||
restrict: "A", | ||
replace: true, | ||
templateUrl: "modules/navigation/navigation.tem.html", | ||
controller: "navigationController" | ||
} | ||
}) | ||
.directive("findjobs", function () { | ||
return { | ||
restrict: "A", | ||
replace: true, | ||
templateUrl: "modules/job/findJobs.tem.html" | ||
} | ||
}) | ||
.directive('onlyDigits', function ($filter) { | ||
return { | ||
require: 'ngModel', | ||
restrict: 'A', | ||
link: function (scope, element, attr, ctrl) { | ||
function inputValue(val) { | ||
if (val) { | ||
var digits = val.replace(/[^0-9.]/g, ''); | ||
if (digits !== val) { | ||
ctrl.$setViewValue(digits); | ||
ctrl.$render(); | ||
} | ||
var number = parseFloat(digits); | ||
if (!isNaN(number)) { | ||
//number = $filter('number')(number, 2); | ||
//ctrl.$setViewValue(number); | ||
//ctrl.$render(); | ||
return number; | ||
} | ||
return ""; | ||
} | ||
return ''; | ||
} | ||
|
||
ctrl.$parsers.push(inputValue); | ||
} | ||
} | ||
}) | ||
.directive('onlyDigitsString', function () { | ||
return { | ||
require: 'ngModel', | ||
restrict: 'A', | ||
link: function (scope, element, attr, ctrl) { | ||
function inputValue(val) { | ||
if (val) { | ||
var digits = val.replace(/[^0-9.]/g, ''); | ||
|
||
if (digits !== val) { | ||
ctrl.$setViewValue(digits); | ||
ctrl.$render(); | ||
} | ||
var number = parseFloat(digits); | ||
return isNaN(number) ? "" : val; | ||
|
||
} | ||
return ''; | ||
} | ||
|
||
ctrl.$parsers.push(inputValue); | ||
} | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
techlooper.run(function (shortcutFactory, connectionFactory, loadingBoxFactory, cleanupFactory, | ||
signInService, historyFactory, userService, routerService, $location, | ||
utils, $rootScope, $translate, jsonValue, localStorageService, securityService, | ||
apiService, resourcesService, seoService) { | ||
shortcutFactory.initialize(); | ||
connectionFactory.initialize(); | ||
loadingBoxFactory.initialize(); | ||
cleanupFactory.initialize(); | ||
historyFactory.initialize(); | ||
routerService.initialize(); | ||
userService.initialize(); | ||
securityService.initialize(); | ||
seoService.initialize(); | ||
|
||
$rootScope.apiService = apiService; | ||
$rootScope.resourcesService = resourcesService; | ||
|
||
var doTranslate = function () { | ||
$translate(["newGradLevel", "experienced", "manager", "timeline", "numberOfJobs", "jobs", "isRequired", "exItSoftware", "ex149", | ||
"salaryRangeJob", "jobNumber", "salaryRangeInJob", "jobNumberLabel", "allLevel", "newGradLevel", "exHoChiMinh", "exManager", | ||
"experienced", "manager", "maximum5", "maximum3", "hasExist", "directorAndAbove", "requiredThisField", | ||
"genderMale", "genderFemale", "exMale", "exYob", 'exDay', 'day', 'week', 'month', "maximum50", "whoJoinAndWhyEx"]).then(function (translate) { | ||
$rootScope.translate = translate; | ||
}); | ||
} | ||
|
||
var campaign = $location.search(); | ||
var langKey = (campaign && campaign.lang); | ||
langKey !== $translate.use() && ($translate.use(langKey)); | ||
$rootScope.$on('$translateChangeSuccess', function () { | ||
langKey !== $translate.use() && ($translate.use(langKey)); | ||
doTranslate(); | ||
}); | ||
|
||
doTranslate(); | ||
|
||
$rootScope.jsonValue = jsonValue; | ||
|
||
$('html, body').animate({scrollTop: 0}); | ||
|
||
var param = $location.search(); | ||
if (!$.isEmptyObject(param)) { | ||
switch (param.action) { | ||
case "registerVnwUser": | ||
localStorageService.set("lastName", param.lastName); | ||
localStorageService.set("firstName", param.firstName); | ||
localStorageService.set("email", param.email); | ||
break; | ||
|
||
//TODO route user to login by social | ||
case "loginBySocial": | ||
securityService.login(param.code, param.social, param.social); | ||
break; | ||
|
||
case "redirectJA": | ||
window.location.href = param.targetUrl; | ||
break; | ||
} | ||
} | ||
|
||
$rootScope.today = moment().format(jsonValue.dateFormat); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
techlooper.factory("seoService", function ($rootScope, utils) { | ||
|
||
$rootScope.$on("$routeChangeStart", function (event, next, current) { | ||
var uiView = utils.getUiView(); | ||
switch (uiView.type) { | ||
case "SEO": | ||
if (!next || !next.params) break; | ||
var parts = next.params.id.split("-"); | ||
var lastPart = parts.pop(); | ||
if (parts.length < 2 || (lastPart !== "id")) { | ||
return $location.path("/"); | ||
} | ||
|
||
var id = parts.pop(); | ||
var title = parts.join("-"); | ||
if (utils.hasNonAsciiChar(title)) { | ||
title = utils.toAscii(title); | ||
event.preventDefault(); | ||
return $location.url(sprintf("%s/%s-%s-id", uiView.url, title, id)); | ||
} | ||
} | ||
}); | ||
|
||
return { | ||
initialize: function () {} | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.