diff --git a/UI/Common/UIxPageFrame.m b/UI/Common/UIxPageFrame.m index a3b8a0c38..999301b45 100644 --- a/UI/Common/UIxPageFrame.m +++ b/UI/Common/UIxPageFrame.m @@ -273,42 +273,49 @@ - (NSString *) pageJavaScriptURL { WOComponent *page; - NSString *theme, *filename; + NSString *theme, *filename, *url; + url = nil; page = [context page]; theme = [context objectForKey: @"theme"]; if ([theme length]) { filename = [NSString stringWithFormat: @"js/%@/%@.js", theme, NSStringFromClass([page class])]; + url = [self urlForResourceFilename: filename]; } - else + if ([url length] == 0) { + // No theme defined or no specific JavaScript for the theme; rollback to default JavaScript filename = [NSString stringWithFormat: @"js/%@.js", NSStringFromClass([page class])]; + url = [self urlForResourceFilename: filename]; } NSLog(@"pageJavaScript => %@", filename); - return [self urlForResourceFilename: filename]; + return url; } - (NSString *) productJavaScriptURL { WOComponent *page; - NSString *theme, *filename; + NSString *theme, *filename, *url; + url = nil; page = [context page]; [context resourceLookupLanguages]; theme = [context objectForKey: @"theme"]; if ([theme length]) { filename = [NSString stringWithFormat: @"js/%@/%@.js", theme, [page frameworkName]]; + url = [self urlForResourceFilename: filename]; } - else + if ([url length] == 0) { filename = [NSString stringWithFormat: @"js/%@.js", [page frameworkName]]; + url = [self urlForResourceFilename: filename]; } NSLog(@"productJavaScript => %@", filename); - return [self urlForResourceFilename: filename]; + return url; } - (BOOL) hasPageSpecificJavaScript diff --git a/UI/Templates/Themes/mobile/MainUI/SOGoRootPage.wox b/UI/Templates/Themes/mobile/MainUI/SOGoRootPage.wox index 1e743cdc8..94ba59bc9 100644 --- a/UI/Templates/Themes/mobile/MainUI/SOGoRootPage.wox +++ b/UI/Templates/Themes/mobile/MainUI/SOGoRootPage.wox @@ -33,7 +33,7 @@

inverse.ca - + diff --git a/UI/WebServerResources/js/mobile/SOGoRootPage.js b/UI/WebServerResources/js/mobile/SOGoRootPage.js index 67b855d19..18ffa879a 100644 --- a/UI/WebServerResources/js/mobile/SOGoRootPage.js +++ b/UI/WebServerResources/js/mobile/SOGoRootPage.js @@ -48,7 +48,7 @@ $urlRouterProvider.otherwise('/app/login'); }) - .controller('AppCtrl', ['$scope', 'sgSettings', function(Settings, $scope) { + .controller('AppCtrl', ['$scope', 'sgSettings', function($scope, Settings) { $scope.ApplicationBaseURL = Settings.baseURL; }])