diff --git a/authority/static/css/sil.ttf b/authority/static/css/sil.ttf new file mode 100644 index 0000000000000000000000000000000000000000..903e32be5e3dbc418dea268b28bc3432bde14a10 Binary files /dev/null and b/authority/static/css/sil.ttf differ diff --git a/authority/static/css/style.css b/authority/static/css/style.css index 4edf98f678ae5837609efc943b3c696aa6ebce40..eaddc5820305219dcb77029d5bd87f6827a97f28 100644 --- a/authority/static/css/style.css +++ b/authority/static/css/style.css @@ -1,3 +1,17 @@ +@font-face { + font-family: 'Shadows Into Light'; + font-style: normal; + font-weight: normal; + src: local('Shadows Into Light'), local('ShadowsIntoLight'), url('sil.ttf') format('truetype'); +} + +@font-face { + font-family: 'Tenor Sans'; + font-style: normal; + font-weight: normal; + src: local('Tenor Sans'), local('TenorSans'), url('ts.ttf') format('truetype'); +} + body { padding: 0; margin: 0; diff --git a/authority/static/css/ts.ttf b/authority/static/css/ts.ttf new file mode 100644 index 0000000000000000000000000000000000000000..c5842d5fefd18738bcc6ec4384975bdae4a80b3b Binary files /dev/null and b/authority/static/css/ts.ttf differ diff --git a/authority/static/index.html b/authority/static/index.html index 228ca2fec8605d8e5ba5d46e2dfd38a7ca765cd3..522efde4240fb47ae96dd3b2a5b7d55dd0b43216 100644 --- a/authority/static/index.html +++ b/authority/static/index.html @@ -3,8 +3,6 @@ <head> <meta http-equiv="Content-type" content="text/html; charset=utf-8"> <title>BrowserID: A better way to log in.</title> - <link href='http://fonts.googleapis.com/css?family=Tenor+Sans' rel='stylesheet' type='text/css'> - <link href='http://fonts.googleapis.com/css?family=Shadows+Into+Light' rel='stylesheet' type='text/css'> <link rel="stylesheet" href="css/style.css" type="text/css"> </head> <body> diff --git a/run.js b/run.js index 2ff7c00fc78f2a23e551e1cacb0596c03ed3a58e..569ccd1fd5170641e1106e73d63a1aefeea1c136 100644 --- a/run.js +++ b/run.js @@ -18,7 +18,7 @@ function subHostNames(data) { var a = o.server.address(); var from = o.name; var to = "http://" + a.address + ":" + a.port; - data = data.replace(new RegExp(from, 'g'), to); + data = data.toString().replace(new RegExp(from, 'g'), to); // now do another replacement to catch bare hostnames sans http(s) // and explicit cases where port is appended @@ -51,20 +51,23 @@ function createServer(obj) { var realWrite = resp.write; var realEnd = resp.end; - var buf = ""; + var buf = undefined; var enc = undefined; resp.write = function (chunk, encoding) { - buf += chunk; + if (buf) buf += chunk; + else buf = chunk; enc = encoding; }; resp.end = function() { - buf = subHostNames(buf); - try { resp.setHeader('Content-Length', buf.length); } catch(e) { console.log("OOOH: ", e) } - if (buf.length) { - realWrite.call(resp, buf, enc); + var ct = resp.getHeader('content-type'); + if (ct && (ct === "application/javascript" || ct.substr(4) === 'text')) { + var l = buf.length; + buf = subHostNames(buf); + if (l != buf.length) resp.setHeader('Content-Length', buf.length); } + if (buf && buf.length) realWrite.call(resp, buf, enc ? enc : "binary"); realEnd.call(resp); }