Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use typeface name in page title #172

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions client/app/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,13 @@ angular.module('googleWebfontsHelperApp', [
'cgBusy'
])
.config(function($stateProvider, $urlRouterProvider, $locationProvider) {

$urlRouterProvider
.otherwise('/fonts'); // default urls is /fonts

$locationProvider.html5Mode(true);

});
})
.run(function($rootScope) {
$rootScope.APP_TITLE = 'Google Webfonts Helper'
});
7 changes: 5 additions & 2 deletions client/app/fonts/fonts.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ angular.module('googleWebfontsHelperApp')

})

.controller('FontsItemCtrl', function($scope, $stateParams, $http, $state, $timeout, $interval) {
.controller('FontsItemCtrl', function($scope, $stateParams, $http, $state, $timeout, $interval, $rootScope) {

var subSetString = $stateParams.subsets || '';

Expand Down Expand Up @@ -80,6 +80,9 @@ angular.module('googleWebfontsHelperApp')

$scope.loadingPromise = $http.get('/api/fonts/' + $stateParams.id + '?subsets=' + subSetString)
.success(function(fontItem) {

// Prepend the name of the typeface to the document title
window.document.title = fontItem.family + ' | ' + $rootScope.APP_TITLE;
$scope.fontItem = fontItem;

$scope.downloadSubSetID = fontItem.storeID.replace(/_/g, ',');
Expand Down Expand Up @@ -269,4 +272,4 @@ angular.module('googleWebfontsHelperApp')
$scope.modernFontsOnly = false;
};

});
});
6 changes: 3 additions & 3 deletions client/app/fonts/fonts.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

<div class="col-lg-10 col-md-9 col-sm-9 col-xs-8">
<!-- App name -->
<h4 class="page-header"><a href="/" ng-click="selectedItemID=''">google-webfonts-helper</a><br/><small>Get eot, ttf, svg, woff and woff2 files + CSS snippets</small></h4>
<h4 class="page-header"><a href="/" ng-click="selectedItemID=''">{{APP_TITLE}}</a><br/><small>Get eot, ttf, svg, woff and woff2 files + CSS snippets</small></h4>
<!-- GH Stars -->
<iframe id="githubCount" src="https://ghbtns.com/github-btn.html?user=majodev&repo=google-webfonts-helper&type=watch&count=true&size=large"
allowtransparency="true" frameborder="0" scrolling="0" width="170px" height="30px"></iframe>
Expand Down Expand Up @@ -62,7 +62,7 @@ <h5 class="list-group-item-heading">{{font.family}} <small>{{predicate.pre}}{{pr
<!-- Placeholder no item selected -->
<header class="jumbotron masthead">
<div class="inner">
<h1>google-webfonts-helper</h1>
<h1>{{APP_TITLE}}</h1>
<h2>A Hassle-Free Way to Self-Host Google Fonts</h2>
<h6>by <a href="http://mranftl.com" target="_blank">Mario Ranftl</a></h6>
<hr />
Expand Down Expand Up @@ -102,4 +102,4 @@ <h2>API Error ({{errorStatus}})</h2>
</div>
</div>

</div>
</div>
2 changes: 1 addition & 1 deletion client/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<base href="/">
<meta name="google-site-verification" content="al_wEWN9QTMdH0LIzJpanPUiK1lrThiJVuQYDoyflJg" />
<title>google webfonts helper</title>
<title>Google Webfonts Helper</title>
<meta name="description" content="A Hassle-Free Way to Self-Host Google Fonts. Get eot, ttf, svg, woff and woff2 files + CSS snippets!">
<meta name="author" content="Mario Ranftl">
<meta name="keywords" content="font, host, self-host, font-face, serve, zip, archive, css, woff, woff2, eot, ttf, svg, web fonts, google web fonts, google fonts, instructions, modern browsers, best support, font service">
Expand Down