Skip to content

Commit

Permalink
Basic level user level customization from json
Browse files Browse the repository at this point in the history
  • Loading branch information
Jakke Korpelainen committed Mar 12, 2015
1 parent 9163d7e commit 18b66bd
Show file tree
Hide file tree
Showing 12 changed files with 268 additions and 106 deletions.
5 changes: 5 additions & 0 deletions config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"locale" : "fi",
"name" : "jakke",
"location" : "Helsinki"
}
8 changes: 8 additions & 0 deletions js/lib/angular-cookies.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions js/lib/angular-localization.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions js/lib/angular-sanitize.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 8 additions & 1 deletion js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,21 @@ require.config({
paths: {
'angular': '../lib/angular.min',
'angular-route': '../lib/angular-route.min',
'angular-cookies': '../lib/angular-cookies.min',
'angular-sanitize': '../lib/angular-sanitize.min',
'angular-localization': '../lib/angular-localization.min',
'angularAMD': '../lib/angularAMD.min',
'moment': '../lib/moment-with-locales.min',
'storage' : 'storage',
'controllers' : 'controllers'
},

shim: {
'angularAMD': ['angular'],
'angular-route': ['angular']
'angular-route': ['angular'],
'angular-cookies': ['angular'],
'angular-sanitize': ['angular'],
'angular-localization': ['angular']
},

deps: ['app']
Expand Down
28 changes: 24 additions & 4 deletions js/scripts/app.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
define(['angularAMD', 'angular-route', 'moment', 'controllers'], function (angularAMD) {
moment.locale('en');
var app = angular.module("newtab", ['ngRoute', 'controllers']);
define(['angularAMD', 'angular-route', 'angular-cookies', 'angular-sanitize', 'angular-localization', 'moment', 'storage', 'controllers'], function (angularAMD) {
//moment.locale('en');
console.log('loading');
var app = angular.module("newtab", ['ngRoute', 'ngLocalize', 'ngLocalize.Config', 'ngLocalize.InstalledLanguages', 'services', 'controllers']);
app.config(['$routeProvider', function($routeProvider) {
$routeProvider.
when('/', {
Expand All @@ -10,7 +11,25 @@ define(['angularAMD', 'angular-route', 'moment', 'controllers'], function (angul
otherwise({
redirectTo : '/'
});
}]);
}])
.value('localeConf', {
basePath: 'languages',
defaultLocale: 'en-US',
sharedDictionary: 'time',
fileExtension: '.lang.json',
persistSelection: true,
cookieName: 'COOKIE_LOCALE_LANG',
observableAttrs: new RegExp('^data-(?!ng-|i18n)'),
delimiter: '::'
})
.value('localeSupported', [
'en-US',
'fi-FI'
])
.value('localeFallbacks', {
'en': 'en-US',
'fi': 'fi-FI'
});

var cssPaths = [
"css/normalize.min.css",
Expand All @@ -24,6 +43,7 @@ define(['angularAMD', 'angular-route', 'moment', 'controllers'], function (angul
loadCss(value);
});

console.log('bootstraping');
return angularAMD.bootstrap(app);

function loadCss(url) {
Expand Down
Loading

0 comments on commit 18b66bd

Please sign in to comment.