diff options
author | Felix Hammerl <fhammerl@thoughtworks.com> | 2016-03-24 12:18:22 +0100 |
---|---|---|
committer | Felix Hammerl <fhammerl@thoughtworks.com> | 2016-03-24 12:22:25 +0100 |
commit | e1211fc4fcfbad96be8692a1d375cf10c9157ee5 (patch) | |
tree | d6b485420be0bb1115737330b5e0496f24e94c7b | |
parent | e887b933ab9b6f83d6ebe02138ea3cd79d30c710 (diff) |
Issue #656: Fix sandbox fonts
Add CORS headers to sandbox resource
Add OpenSans in normal font weight (400) to the sandbox CSS
-rw-r--r-- | service/pixelated/resources/sandbox_resource.py | 2 | ||||
-rw-r--r-- | web-ui/app/sandbox.html | 1 | ||||
-rw-r--r-- | web-ui/app/scss/opensans.scss | 60 | ||||
-rw-r--r-- | web-ui/app/scss/sandbox.scss | 7 |
4 files changed, 9 insertions, 61 deletions
diff --git a/service/pixelated/resources/sandbox_resource.py b/service/pixelated/resources/sandbox_resource.py index a2d41cb7..35f99774 100644 --- a/service/pixelated/resources/sandbox_resource.py +++ b/service/pixelated/resources/sandbox_resource.py @@ -32,4 +32,6 @@ class SandboxResource(File): request.setHeader('X-Content-Security-Policy', self.CSP_HEADER_VALUES) request.setHeader('X-Webkit-CSP', self.CSP_HEADER_VALUES) request.setHeader('Access-Control-Allow-Origin', '*') + request.setHeader('Access-Control-Allow-Methods', 'GET') + return super(SandboxResource, self).render_GET(request) diff --git a/web-ui/app/sandbox.html b/web-ui/app/sandbox.html index 13a86f25..8325b0da 100644 --- a/web-ui/app/sandbox.html +++ b/web-ui/app/sandbox.html @@ -3,7 +3,6 @@ <head> <meta charset="utf-8"> - <link href="css/opensans.css" rel="stylesheet" type="text/css"> <link href="css/sandbox.css" rel="stylesheet" type="text/css"> <!--usemin_start--> diff --git a/web-ui/app/scss/opensans.scss b/web-ui/app/scss/opensans.scss deleted file mode 100644 index 4a179f8f..00000000 --- a/web-ui/app/scss/opensans.scss +++ /dev/null @@ -1,60 +0,0 @@ -@font-face { - font-family: 'Open Sans'; - font-style: normal; - font-weight: 300; - src: local('Open Sans Light'), local('OpenSans-Light'), url('/sandbox/fonts/OpenSans-Light.woff') format('woff'); -} -@font-face { - font-family: 'Open Sans'; - font-style: normal; - font-weight: 400; - src: local('Open Sans'), local('OpenSans'), url('/sandbox/fonts/OpenSans.woff') format('woff'); -} -@font-face { - font-family: 'Open Sans'; - font-style: normal; - font-weight: 600; - src: local('Open Sans Semibold'), local('OpenSans-Semibold'), url('/sandbox/fonts/OpenSans-Semibold.woff') format('woff'); -} -@font-face { - font-family: 'Open Sans'; - font-style: normal; - font-weight: 700; - src: local('Open Sans Bold'), local('OpenSans-Bold'), url('/sandbox/fonts/OpenSans-Bold.woff') format('woff'); -} -@font-face { - font-family: 'Open Sans'; - font-style: normal; - font-weight: 800; - src: local('Open Sans Extrabold'), local('OpenSans-Extrabold'), url('/sandbox/fonts/OpenSans-Extrabold.woff') format('woff'); -} -@font-face { - font-family: 'Open Sans'; - font-style: italic; - font-weight: 300; - src: local('Open Sans Light Italic'), local('OpenSansLight-Italic'), url('/sandbox/fonts/OpenSansLight-Italic.woff') format('woff'); -} -@font-face { - font-family: 'Open Sans'; - font-style: italic; - font-weight: 400; - src: local('Open Sans Italic'), local('OpenSans-Italic'), url('/sandbox/fonts/OpenSans-Italic.woff') format('woff'); -} -@font-face { - font-family: 'Open Sans'; - font-style: italic; - font-weight: 600; - src: local('Open Sans Semibold Italic'), local('OpenSans-SemiboldItalic'), url('/sandbox/fonts/OpenSans-SemiboldItalic.woff') format('woff'); -} -@font-face { - font-family: 'Open Sans'; - font-style: italic; - font-weight: 700; - src: local('Open Sans Bold Italic'), local('OpenSans-BoldItalic'), url('/sandbox/fonts/OpenSans-BoldItalic.woff') format('woff'); -} -@font-face { - font-family: 'Open Sans'; - font-style: italic; - font-weight: 800; - src: local('Open Sans Extrabold Italic'), local('OpenSans-ExtraboldItalic'), url('/sandbox/fonts/OpenSans-ExtraboldItalic.woff') format('woff'); -} diff --git a/web-ui/app/scss/sandbox.scss b/web-ui/app/scss/sandbox.scss index 3cb4c441..3c1be358 100644 --- a/web-ui/app/scss/sandbox.scss +++ b/web-ui/app/scss/sandbox.scss @@ -1,5 +1,12 @@ $search-highlight: #FFEF29; +@font-face { + font-family: 'Open Sans'; + font-style: normal; + font-weight: 400; + src: local('Open Sans'), local('OpenSans'), url('/sandbox/fonts/OpenSans.woff') format('woff'); +} + body { font-family: "Open Sans", "Microsoft YaHei", "Hiragino Sans GB", "Hiragino Sans GB W3", "微软雅黑", "Helvetica Neue", Arial, sans-serif; font-size: 13px; |