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

do not load fonts for the UI from the internet #96

Merged
merged 6 commits into from
May 2, 2018
Merged
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
1 change: 1 addition & 0 deletions src/server_manager/bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
],
"dependencies": {
"app-layout": "PolymerElements/app-layout#^2.0.4",
"font-roboto": "PolymerElements/font-roboto-local#^1.1.0",
"iron-autogrow-textarea": "PolymerElements/iron-autogrow-textarea#^2.1.1",
"iron-icons": "PolymerElements/iron-icons#^2.0.1",
"iron-fit-behavior": "PolymerElements/iron-fit-behavior#^2.1.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -333,8 +333,9 @@ function addDigitalOceanSignupBanner(text?: string) {
// we should not rely on any frameworks like Polymer, as they might conflict with
// existing frameworks on those pages.
// All class names should begin with Outline to ensure no collisions.
// The outline:// protocol should be marked secure to avoid mixed content warnings.
bannerDiv.innerHTML = `
<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500" rel="stylesheet">
<link href="outline://web_app/bower_components/font-roboto/roboto.html" rel="import">
<style>
#outlineBanner {
font-family: "Roboto", sans-serif;
Expand Down
3 changes: 2 additions & 1 deletion src/server_manager/electron_app/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ const debugMode = process.env.OUTLINE_DEBUG === 'true';
// prevent window being garbage collected
let mainWindow: Electron.BrowserWindow;

electron.protocol.registerStandardSchemes(['outline']);
// Mark secure to avoid mixed content warnings when loading DigitalOcean pages via https://.
electron.protocol.registerStandardSchemes(['outline'], {secure: true});

app.on('ready', () => {
const menuTemplate = menu.getMenuTemplate(debugMode);
Expand Down
15 changes: 15 additions & 0 deletions src/server_manager/images/outline-manager-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 0 additions & 4 deletions src/server_manager/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@

<link rel="shortcut icon" href="/ui_components/images/favicon.png">
<link rel="stylesheet" href="/ui_components/style.css">
<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Roboto+Condensed:400" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Roboto+Mono" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Google+Sans" rel="stylesheet">
<script src="/bower_components/webcomponentsjs/webcomponents-loader.js"></script>
<link rel="import" href="/bower_components/app-layout/app-toolbar/app-toolbar.html">
<link rel="import" href="/ui_components/app-root.html">
Expand Down
14 changes: 8 additions & 6 deletions src/server_manager/ui_components/app-root.html
Original file line number Diff line number Diff line change
Expand Up @@ -103,15 +103,17 @@
#settingsDrawer #signOutButton:hover {
color: var(--primary-green);
}
app-toolbar [main-title] {
font-family: 'Google Sans', 'Roboto', sans-serif;
font-size: 20px;
text-align: center;
}
app-toolbar paper-icon-button {
/* needed so the "Outline Manager" title appears centered in the window. */
position: absolute;
}
app-toolbar [main-title] {
text-align: center;
}
app-toolbar [main-title] img {
height: 20px;
margin-top: 10px;
}
</style>

<app-drawer id="settingsDrawer">
Expand Down Expand Up @@ -146,7 +148,7 @@

<app-toolbar class='toolbar'>
<paper-icon-button icon="menu" on-tap="toggleSettingsDrawer"></paper-icon-button>
<div main-title>Outline Manager</div>
<div main-title><img src="images/outline-manager-logo.svg"></div>
</app-toolbar>

<div id='contentColumn'>
Expand Down
14 changes: 0 additions & 14 deletions src/server_manager/ui_components/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -123,20 +123,6 @@ pre {
font-family: monospace;
}

/* "logo" stuff */

/* header */
#header {
padding: 15px 0 8px 20px;
background-color: #263238;
text-align: left;
height: 133px;
}

#header img {
height: 48px;
}

paper-menu {
white-space: nowrap;
}