Browse Source

initial commit

english
Ev Bogue 2 years ago
commit
8856e4b188
78 changed files with 1396 additions and 0 deletions
  1. +1
    -0
      .gitignore
  2. +193
    -0
      app.js
  3. +1
    -0
      css/source-sans-pro.min.css
  4. +110
    -0
      css/style.css
  5. BIN
      fonts/EOT/SourceSansPro-Black.eot
  6. BIN
      fonts/EOT/SourceSansPro-BlackIt.eot
  7. BIN
      fonts/EOT/SourceSansPro-Bold.eot
  8. BIN
      fonts/EOT/SourceSansPro-BoldIt.eot
  9. BIN
      fonts/EOT/SourceSansPro-ExtraLight.eot
  10. BIN
      fonts/EOT/SourceSansPro-ExtraLightIt.eot
  11. BIN
      fonts/EOT/SourceSansPro-It.eot
  12. BIN
      fonts/EOT/SourceSansPro-Light.eot
  13. BIN
      fonts/EOT/SourceSansPro-LightIt.eot
  14. BIN
      fonts/EOT/SourceSansPro-Regular.eot
  15. BIN
      fonts/EOT/SourceSansPro-Semibold.eot
  16. BIN
      fonts/EOT/SourceSansPro-SemiboldIt.eot
  17. +93
    -0
      fonts/LICENSE.txt
  18. BIN
      fonts/OTF/SourceSansPro-Black.otf
  19. BIN
      fonts/OTF/SourceSansPro-BlackIt.otf
  20. BIN
      fonts/OTF/SourceSansPro-Bold.otf
  21. BIN
      fonts/OTF/SourceSansPro-BoldIt.otf
  22. BIN
      fonts/OTF/SourceSansPro-ExtraLight.otf
  23. BIN
      fonts/OTF/SourceSansPro-ExtraLightIt.otf
  24. BIN
      fonts/OTF/SourceSansPro-It.otf
  25. BIN
      fonts/OTF/SourceSansPro-Light.otf
  26. BIN
      fonts/OTF/SourceSansPro-LightIt.otf
  27. BIN
      fonts/OTF/SourceSansPro-Regular.otf
  28. BIN
      fonts/OTF/SourceSansPro-Semibold.otf
  29. BIN
      fonts/OTF/SourceSansPro-SemiboldIt.otf
  30. +20
    -0
      fonts/README.md
  31. +72
    -0
      fonts/ReadMe.html
  32. +274
    -0
      fonts/SourceSansProReadMe.html
  33. BIN
      fonts/TTF/SourceSansPro-Black.ttf
  34. BIN
      fonts/TTF/SourceSansPro-BlackIt.ttf
  35. BIN
      fonts/TTF/SourceSansPro-Bold.ttf
  36. BIN
      fonts/TTF/SourceSansPro-BoldIt.ttf
  37. BIN
      fonts/TTF/SourceSansPro-ExtraLight.ttf
  38. BIN
      fonts/TTF/SourceSansPro-ExtraLightIt.ttf
  39. BIN
      fonts/TTF/SourceSansPro-It.ttf
  40. BIN
      fonts/TTF/SourceSansPro-Light.ttf
  41. BIN
      fonts/TTF/SourceSansPro-LightIt.ttf
  42. BIN
      fonts/TTF/SourceSansPro-Regular.ttf
  43. BIN
      fonts/TTF/SourceSansPro-Semibold.ttf
  44. BIN
      fonts/TTF/SourceSansPro-SemiboldIt.ttf
  45. BIN
      fonts/WOFF/OTF/SourceSansPro-Black.otf.woff
  46. BIN
      fonts/WOFF/OTF/SourceSansPro-BlackIt.otf.woff
  47. BIN
      fonts/WOFF/OTF/SourceSansPro-Bold.otf.woff
  48. BIN
      fonts/WOFF/OTF/SourceSansPro-BoldIt.otf.woff
  49. BIN
      fonts/WOFF/OTF/SourceSansPro-ExtraLight.otf.woff
  50. BIN
      fonts/WOFF/OTF/SourceSansPro-ExtraLightIt.otf.woff
  51. BIN
      fonts/WOFF/OTF/SourceSansPro-It.otf.woff
  52. BIN
      fonts/WOFF/OTF/SourceSansPro-Light.otf.woff
  53. BIN
      fonts/WOFF/OTF/SourceSansPro-LightIt.otf.woff
  54. BIN
      fonts/WOFF/OTF/SourceSansPro-Regular.otf.woff
  55. BIN
      fonts/WOFF/OTF/SourceSansPro-Semibold.otf.woff
  56. BIN
      fonts/WOFF/OTF/SourceSansPro-SemiboldIt.otf.woff
  57. BIN
      fonts/WOFF/TTF/SourceSansPro-Black.ttf.woff
  58. BIN
      fonts/WOFF/TTF/SourceSansPro-BlackIt.ttf.woff
  59. BIN
      fonts/WOFF/TTF/SourceSansPro-Bold.ttf.woff
  60. BIN
      fonts/WOFF/TTF/SourceSansPro-BoldIt.ttf.woff
  61. BIN
      fonts/WOFF/TTF/SourceSansPro-ExtraLight.ttf.woff
  62. BIN
      fonts/WOFF/TTF/SourceSansPro-ExtraLightIt.ttf.woff
  63. BIN
      fonts/WOFF/TTF/SourceSansPro-It.ttf.woff
  64. BIN
      fonts/WOFF/TTF/SourceSansPro-Light.ttf.woff
  65. BIN
      fonts/WOFF/TTF/SourceSansPro-LightIt.ttf.woff
  66. BIN
      fonts/WOFF/TTF/SourceSansPro-Regular.ttf.woff
  67. BIN
      fonts/WOFF/TTF/SourceSansPro-Semibold.ttf.woff
  68. BIN
      fonts/WOFF/TTF/SourceSansPro-SemiboldIt.ttf.woff
  69. +17
    -0
      fonts/bower.json
  70. +131
    -0
      fonts/source-sans-pro.css
  71. +13
    -0
      index.html
  72. +264
    -0
      lib.js
  73. +1
    -0
      nacl-util.min.js
  74. +1
    -0
      nacl.min.js
  75. +65
    -0
      package-lock.json
  76. +17
    -0
      package.json
  77. +65
    -0
      readme.md
  78. +58
    -0
      server.js

+ 1
- 0
.gitignore View File

@ -0,0 +1 @@
node_modules

+ 193
- 0
app.js View File

@ -0,0 +1,193 @@
var screen = h('div', {id: 'screen'})
document.body.appendChild(screen)
var header = h('div', {classList: 'message'})
var keys = getKeys()
function compose (keys, opts) {
var header = h('div', {classList: 'message'})
var scroller = document.getElementById('scroller')
scroller.insertBefore(header, scroller.firstChild)
var textarea = h('textarea', {placeholder: 'Write a new bog post'})
header.appendChild(textarea)
var composer = h('div', [
h('button', {
onclick: function () {
if (textarea.value) {
var content = {
author: keys.publicKey,
type: 'post',
text: textarea.value,
timestamp: Date.now()
}
textarea.value = ''
publish(content, keys)
}
}
}, ['Publish'])
])
header.appendChild(composer)
}
function route () {
src = window.location.hash.substring(1)
var scroller = h('div', {id: 'scroller'})
var screen = document.getElementById('screen')
screen.appendChild(scroller)
if (src === 'key') {
var keyMessage = h('div', {classList: 'message'})
// delete key button
keyMessage.appendChild(h('button', {classList: 'right',
onclick: function () {
localStorage['id'] = ''
location.reload()
}
}, ['Delete Key']))
// print stringified keypair
keyMessage.appendChild(h('pre', {style: 'width: 80%'}, [h('code', [JSON.stringify(keys)])]))
scroller.appendChild(keyMessage)
}
else if (src[0] === '@') {
var profile = h('div', {classList: 'message'})
scroller.appendChild(profile)
var nameInput = h('input', {placeholder: 'Publish a new name'})
var namePublisher = h('div',[
nameInput,
h('button', {
onclick: function () {
if (nameInput.value) {
var content = {
author: keys.publicKey,
type: 'name',
text: nameInput.value,
timestamp: Date.now()
}
publish(content, keys)
}
}
}, ['Publish'])
])
profile.appendChild(namePublisher)
readFile()
var imageInput = h('span', [
h('input', {id: 'inp', type:'file'}),
h('span', {id: 'b64'}),
h('img', {id: 'img'})
])
var imagePublisher = h('div', [
imageInput,
h('button', {
onclick: function () {
var content = {
author: keys.publicKey,
type: 'image',
image: document.getElementById("img").src,
timestamp: Date.now()
}
publish(content, keys)
}
}, ['Publish'])
])
profile.appendChild(imagePublisher)
document.getElementById("inp").addEventListener("change", readFile);
var ws = new WebSocket('ws://localhost:8080/' + src)
var clientLog = {
publicKey: src
}
if (localStorage[src]) {
clientLog.log = JSON.parse(localStorage[src])
} else {
clientLog.log = []
}
/*if (localSTorage['log']) {
var publicLog = localStorage['log']
} else {
var publicLog = []
}*/
ws.onopen = function () {
ws.send(JSON.stringify(clientLog))
}
ws.onmessage = function (ev) {
var serverData = JSON.parse(ev.data)
if (serverData.log.length > clientLog.log.length) {
localStorage[src] = JSON.stringify(serverData.log)
location.reload()
}
}
if (localStorage[src]) {
var log = JSON.parse(localStorage[src])
for (var i=0; i < log.length; i++) {
var post = log[i]
scroller.appendChild(renderMessage(post))
}
}
}
else if (src[0] === '%') {
if (localStorage['log']) {
var log = JSON.parse(localStorage['log'])
for (var i=0; i < log.length; i++) {
if (log[i].key === src) {
var post = log[i]
scroller.appendChild(renderMessage(post))
}
}
}
}
else {
compose(keys)
if (localStorage['log']) {
var log = JSON.parse(localStorage['log'])
for (var i=0; i < log.length; i++) {
var post = log[i]
scroller.appendChild(renderMessage(post))
}
}
}
}
route()
window.onhashchange = function () {
var oldscreen = document.getElementById('screen')
var newscreen = h('div', {id: 'screen'})
oldscreen.parentNode.replaceChild(newscreen, oldscreen)
route()
}

+ 1
- 0
css/source-sans-pro.min.css
File diff suppressed because it is too large
View File


+ 110
- 0
css/style.css View File

@ -0,0 +1,110 @@
body {
font-family: 'Source Sans Pro';
background: #222;
color: #f5f5f5;
max-width: 780px;
margin-right: auto;
margin-left: auto;
}
p {
margin-top: 5px;
margin-bottom: 5px;
font-size: 1em;
}
#screen {
top: 0; right: 0; left: 0; bottom: 0;
}
.right { float: right;}
.message {
background: #333;
margin-top: .5em;
padding: .5em;
border-radius: 5px;
}
img {
max-width: 100%;
}
img.small {
vertical-align: top;
width: 25px;
height: 25px;
margin-right: .2em;
border-radius: 3px;
}
a {
color: cyan;
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
pre {
color: violet;
width: 100%;
display: block;
}
code {
display: inline-block;
vertical-align: bottom;
}
code, pre {
overflow: auto;
word-break: break-all;
word-wrap: break-word;
white-space: pre;
white-space: -moz-pre-wrap;
white-space: pre-wrap;
white-space: pre\9;
}
textarea, input {
background: #222;
padding: .5em;
color: #f5f5f5;
border: none;
border-radius: 5px;
}
textarea {
width: 100%;
}
button {
display: inline-block;
padding: 2px 6px;
margin: .2em .2em .2em 0em;
font-size: 14px;
line-height: 20px;
color: #d5d5d5;
text-align: center;
text-shadow: 0 1px 1px rgba(0, 0, 0, 0.75);
vertical-align: middle;
cursor: pointer;
background-color: #222;
border: 1px solid #222;
border-radius: 4px;
}
button:hover,
button:focus,
button:active {
color: white;
background-color: black;
}
button.active {
background-color: #111;
}

BIN
fonts/EOT/SourceSansPro-Black.eot View File


BIN
fonts/EOT/SourceSansPro-BlackIt.eot View File


BIN
fonts/EOT/SourceSansPro-Bold.eot View File


BIN
fonts/EOT/SourceSansPro-BoldIt.eot View File


BIN
fonts/EOT/SourceSansPro-ExtraLight.eot View File


BIN
fonts/EOT/SourceSansPro-ExtraLightIt.eot View File


BIN
fonts/EOT/SourceSansPro-It.eot View File


BIN
fonts/EOT/SourceSansPro-Light.eot View File


BIN
fonts/EOT/SourceSansPro-LightIt.eot View File


BIN
fonts/EOT/SourceSansPro-Regular.eot View File


BIN
fonts/EOT/SourceSansPro-Semibold.eot View File


BIN
fonts/EOT/SourceSansPro-SemiboldIt.eot View File


+ 93
- 0
fonts/LICENSE.txt View File

@ -0,0 +1,93 @@
Copyright 2010, 2012, 2014 Adobe Systems Incorporated (http://www.adobe.com/), with Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark of Adobe Systems Incorporated in the United States and/or other countries.
This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at: http://scripts.sil.org/OFL
-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------
PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.
The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.
DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.
"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).
"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).
"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.
"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.
PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:
1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.
2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.
3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.
5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.
TERMINATION
This license becomes null and void if any of the above conditions are
not met.
DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.

BIN
fonts/OTF/SourceSansPro-Black.otf View File


BIN
fonts/OTF/SourceSansPro-BlackIt.otf View File


BIN
fonts/OTF/SourceSansPro-Bold.otf View File


BIN
fonts/OTF/SourceSansPro-BoldIt.otf View File


BIN
fonts/OTF/SourceSansPro-ExtraLight.otf View File


BIN
fonts/OTF/SourceSansPro-ExtraLightIt.otf View File


BIN
fonts/OTF/SourceSansPro-It.otf View File


BIN
fonts/OTF/SourceSansPro-Light.otf View File


BIN
fonts/OTF/SourceSansPro-LightIt.otf View File


BIN
fonts/OTF/SourceSansPro-Regular.otf View File


BIN
fonts/OTF/SourceSansPro-Semibold.otf View File


BIN
fonts/OTF/SourceSansPro-SemiboldIt.otf View File


+ 20
- 0
fonts/README.md View File

@ -0,0 +1,20 @@
# Source Sans Pro
Source Sans Pro is a set of OpenType fonts that have been designed to work well
in user interface (UI) environments. In addition to a functional OpenType font, this open
source project provides all of the source files that were used to build this OpenType font
by using the AFDKO makeotf tool.
## Installation instructions
* [Mac OS X](http://support.apple.com/kb/HT2509)
* [Windows](http://windows.microsoft.com/en-us/windows-vista/install-or-uninstall-fonts)
* [Linux/Unix-based systems](https://github.com/adobe-fonts/source-code-pro/issues/17#issuecomment-8967116)
## Getting Involved
Send suggestions for changes to the Source Sans OpenType font project maintainer, [Paul D. Hunt](mailto:opensourcefonts@adobe.com?subject=[GitHub] Source Sans Pro), for consideration.
## Further information
For information about the design and background of Source Sans, please refer to the [official font readme file](http://htmlpreview.github.io/?https://github.com/adobe-fonts/source-sans-pro/blob/master/SourceSansProReadMe.html).

+ 72
- 0
fonts/ReadMe.html View File

@ -0,0 +1,72 @@
<!DOCTYPE html>
<html>
<head>
<title>Read Me File for Adobe® OpenType® Fonts</title>
<meta charset="utf-8" />
</head>
<body bgcolor="white" link="#ce0000" alink="#ce0000" vlink="#9c6363">
<h2><font color="#333333"
face="verdana,geneva,arial">Adobe&reg; OpenType&reg; Fonts</font></h2>
<p><font size="2" face="verdana,geneva,arial">Thank
you for licensing Adobe OpenType fonts. In order to ensure that you
have the most up-to-date product information, Adobe has posted <a
href="http://www.adobe.com/type/browser/OTReadMe.html">an OpenType
Read Me file</a> on the Adobe web site that contains information such
as minimum system requirements, technical support contact information
and software installation notes. We have also posted <a
href="http://www.adobe.com/type/browser/pdfs/OTGuide.pdf">an OpenType
User's Guide</a> in PDF format on the Adobe web site that can be
viewed online and downloaded to your computer. <P>If you have
licensed an Adobe OpenType Pro font, there may be additional PDF
documents, such as a specimen book, a glyph complement showing, and a
typeface-specific Read Me file, available on the typeface&#146;s
product pages on the Adobe web site. These additional files may be
viewed online or downloaded to your computer.<P>To get you started
quickly, below are links to localized installation instructions for
your fonts.
<h4>Installation Instructions</h4><hr>
<p lang=en><b>English</b><br>
Instructions for installing this font can be found online at <a
href="http://www.adobe.com/type/browser/fontinstall/instructions_main.html">http://www.adobe.com/type/browser/fontinstall/instructions_main.html</a>.</p>
<p lang=fr><b>French / Fran&#231;ais</b><br>
Le mode d'installation de cette police de caract&#232;re se trouve en
ligne &#224; <a
href="http://www.adobe.com/type/browser/fontinstall/instructions_main.html">http://www.adobe.com/type/browser/fontinstall/instructions_main.html</a>.</p>
<p lang=de><b>German / Deutsch</b><br>
Die Anweisungen zur Installation dieser Schriftart finden Sie online
unter <a
href="http://www.adobe.com/type/browser/fontinstall/instructions_main.html">http://www.adobe.com/type/browser/fontinstall/instructions_main.html</a>.</p>
<p lang=it><b>Italian / Italiano</b><br>
Le istruzioni per l'installazione di questo font sono disponibili
online all'indirizzo <a
href="http://www.adobe.com/type/browser/fontinstall/instructions_main.html">http://www.adobe.com/type/browser/fontinstall/instructions_main.html</a>.</p>
<p lang=es><b>Spanish / Espa&#241;ol</b><br>
Las instrucciones para instalar esta fuente se pueden encontrar
online en <a
href="http://www.adobe.com/type/browser/fontinstall/instructions_main.html">http://www.adobe.com/type/browser/fontinstall/instructions_main.html</a>.</p>
<p lang=nl><b>Dutch / Hollands</b><br>
De instructies voor de installatie van dit lettertype vindt u op <a
href="http://www.adobe.com/type/browser/fontinstall/instructions_main.html">http://www.adobe.com/type/browser/fontinstall/instructions_main.html</a>.</p>
<p><b>Swedish / Svenska</b><br>
Anvisningar f&#246;r hur det h&#228;r teckensnittet installeras finns
online p&#229; <a
href="http://www.adobe.com/type/browser/fontinstall/instructions_main.html">http://www.adobe.com/type/browser/fontinstall/instructions_main.html</a>.</p>
<p><b>Norwegian / Norsk</b><br>
Instruksjoner for installering av skrifttypen finnes online p&#229;
<a
href="http://www.adobe.com/type/browser/fontinstall/instructions_main.html">http://www.adobe.com/type/browser/fontinstall/instructions_main.html</a>.</p>
<p><b>Finnish / Suomi</b><br>
Ohjeet t&#228;m&#228;n fontin asentamiseen l&#246;ytyv&#228;t
osoitteesta <a
href="http://www.adobe.com/type/browser/fontinstall/instructions_main.html">http://www.adobe.com/type/browser/fontinstall/instructions_main.html</a>.</p>
<p><b>Danish / Dansk</b><br>
Du finder en vejledning i installation af denne skrifttype online
p&#229; adressen <a
href="http://www.adobe.com/type/browser/fontinstall/instructions_main.html">http://www.adobe.com/type/browser/fontinstall/instructions_main.html</a>.</p>
<p lang=ja><b>Japanese / 日本語</b><br>
このフォントをインストールする手順は、オンラインで <a
href="http://www.adobe.com/type/browser/fontinstall/instructions_main.html">http://www.adobe.com/type/browser/fontinstall/instructions_main.html</a>
を参照してください。</p>
</body>
</html>

+ 274
- 0
fonts/SourceSansProReadMe.html View File

@ -0,0 +1,274 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!-- Read-me Template Version 1.003 Jan 145 2013 -->
<html>
<head>
<meta http-equiv="content-type" content="text/html" />
<meta name="title" content="Read Me File for Source Sans Pro" />
<meta name="description" content="Read Me file for Source Sans Pro ..." />
<title>Source Sans Pro Read Me</title>
<style type="text/css" media="screen">
/*********************** fonts ************************/
body {font-family: sans-serif; font-weight: normal; font-size: 10pt; color: #000000; margin: 0px; background-color: white;}
h1 {display:inline; font-family: sans-serif; font-weight: normal; color: #999999;}
h2 {display:inline; font-size: 10pt; font-family: sans-serif; font-weight: bold; color: #666666;}
hFooter {font-family: sans-serif; font-weight: normal; font-size: 7pt; color: #000000; margin: 0px; background-color: white;}
/*********************** links ************************/
a:link {color:#004477; text-decoration:none; margin: 0px 0px 0px 0px;}
a:visited {color:#6d7f8e; text-decoration:none; margin: 0px 0px 0px 0px;}
a:hover {color:#ff0000; text-decoration:none; margin: 0px 0px 0px 0px;}
/*********************** div tags ************************/
#page {float:left; width:700px; margin:20px 20px 20px 20px;}
#subTitle {background-color:#e3e3e3; float:left; width:700px; border-bottom:solid #999999 1.0pt; border-bottom-alt:solid #999999 .5pt; padding:2px 0px 4px 0px;}
#title {background-color:#e3e3e3; float:left; width:700px; border-bottom:solid #999999 1.0pt; border-bottom-alt:solid #999999 .5pt; padding:2px 0px 4px 0px;}
#description {float:left; width:700px; padding:15px 0px 15px 0px;} .style6 {color: #666666} .style7 {color: #FF0000}</style>
</head>
<body>
<div id="page">
<h1>
<span style="font-size:16pt">Source Sans Pro Read Me</span>
</h1>
<br />
<div id="description">
<p>This document contains late-breaking product information, updates, and troubleshooting tips.
<br />
<br />
<a href="#A1">Minimum system requirements and font installation instructions</a>
<br />
<a href="#A2A">Font versions</a>
<br />
<a href="#A2">Family information</a>
<br />
<a href="#A3">Release Notes</a>
<br />
<a href="#A8">Known issues</a>
<br />
<a href="#A9">Customer care</a>
<br />
<a href="#A10">Other resources</a>
<br />
<a href="#A12"></a>
<br /></p>
</div>
<div id="title">
<a name="A1" id="A1"></a>
<h2>Minimum system requirements and font installation instructions</h2>
</div>
<div id="description">
<p>For information on minimum system requirements and font installation, see <span class="style7">
<a title="http://www.adobe.com/go/learn_fontinstall_en" href="http://www.adobe.com/go/learn_fontinstall_en">http://www.adobe.com/go/learn_fontinstall_en</a>.</span></p>
</div>
<div id="title">
<a name="A2A" id=A2A></a>
<h2>Font versions</h2>
</div>
<div id="description">
<p>To check that you have the correct font file, compare the font version of your font file to the font version provided in the Release Notes section below.</p>
</div>
<div id="title">
<h2>
<a name="A2" id="A2">Family information</a>
</h2>
</div>
<div id="description">
<p>
<strong>History</strong>
</p>Source Sans Pro was designed by Paul D. Hunt under the guidance of Robert Slimbach. It is Adobe's first open source typeface family, conceived primarily as a typeface for user interfaces. Source Sans Pro draws inspiration from the clarity and legibility of twentieth-century American gothic typeface designs. Distilling the best archetypical qualities of these models, Paul followed a rational design approach by simplifying glyph shapes by paring them to their essential form. However, in order to more easily differentiate similar letter shapes (such as uppercase I and lowercase L), some additional details have been added. Besides providing such explicitly clarity in short text strings, another fundamental design consideration was to create a typeface that reads well in extended settings. This can be seen in the general proportions: Source Sans Pro has been designed with a more generous width than many other comparable gothics, and its shorter majuscule letters, combined with minuscule letters with longer extenders, create a more pleasant reading texture in longer text passages.</p>
<p>
Source Sans Pro currently supports a wide range of languages using Latin script. The non-italic fonts also support both modern and polytonic Greek, as well as glyph coverage for extended Cyrillic. Other members of the greater Source type system include Source Code Pro, a monospaced version of Source Sans designed specifically for coding, and Source Serif Pro. As an open source project, it is expected that incremental updates will be made over time to extend glyph set coverage and functionality. If you are interested in contributing to this open source project, please visit this project page on GitHub for information on how to become involved. Source Sans Pro can be adapted and redistributed according to the terms of the Open Font License (OFL) agreement. </p>
<p>
<strong>Menu Names And Style Linking</strong>
</p>
<p>In many Windows<sup>&reg;</sup> applications, instead of every font appearing on
the menu, fonts are grouped into style-linked sets, and only the name of
the base style font for a set is shown in the menu. The italic and the
bold weight fonts of the set (if any) are not shown in the font menu, but can still be
accessed by selecting the base style font, and then using the italic
and bold style buttons. In this family, such programs will show only the
following base style font names in the menu:</p>
<p>Source Sans Pro<br>
Source Sans Pro Black<br>
Source Sans Pro ExtraLight<br>
Source Sans Pro Light<br>
Source Sans Pro SemiBold<br></p>
<p>The other fonts in this family must be selected by choosing a menu name
and then a style option following the guide below.</p>
<table border="0">
<tr> <td>Menu Name</td> <td> </td> <td>plus Style Option... </td> <td> </td> <td>selects this font</td> </tr>
<tr> <td>Source Sans Pro</td> <td> </td> <td>[none]</td> <td> </td> <td>Source Sans Pro Regular</td> </tr>
<tr> <td>Source Sans Pro</td> <td> </td> <td>Italic</td> <td> </td> <td>Source Sans Pro Italic</td> </tr>
<tr> <td>Source Sans Pro</td> <td> </td> <td>Bold</td> <td> </td> <td>Source Sans Pro Bold</td> </tr>
<tr> <td>Source Sans Pro</td> <td> </td> <td>Bold, Italic</td> <td> </td> <td>Source Sans Pro Bold Italic</td> </tr>
<tr> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr>
<tr> <td>Source Sans Pro Black</td> <td> </td> <td>[none]</td> <td> </td> <td>Source Sans Pro Black</td> </tr>
<tr> <td>Source Sans Pro Black</td> <td> </td> <td>Italic</td> <td> </td> <td>Source Sans Pro Black Italic</td> </tr>
<tr> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr>
<tr> <td>Source Sans Pro ExtraLight</td> <td> </td> <td>[none]</td> <td> </td> <td>Source Sans Pro ExtraLight</td> </tr>
<tr> <td>Source Sans Pro ExtraLight</td> <td> </td> <td>Italic</td> <td> </td> <td>Source Sans Pro ExtraLight Italic</td> </tr>
<tr> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr>
<tr> <td>Source Sans Pro Light</td> <td> </td> <td>[none]</td> <td> </td> <td>Source Sans Pro Light</td> </tr>
<tr> <td>Source Sans Pro Light</td> <td> </td> <td>Italic</td> <td> </td> <td>Source Sans Pro Light Italic</td> </tr>
<tr> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr>
<tr> <td>Source Sans Pro SemiBold</td> <td> </td> <td>[none]</td> <td> </td> <td>Source Sans Pro Semibold</td> </tr>
<tr> <td>Source Sans Pro SemiBold</td> <td> </td> <td>Italic</td> <td> </td> <td>Source Sans Pro Semibold Italic</td> </tr>
<tr> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr>
</table>
<p>On the Mac OS operating system, although each font appears as a separate entry on the
font menu, users may also select fonts by means of style links.
Selecting a base style font and then using the style links (as described
above for Windows applications) enhances cross-platform document compatibility with
many applications, such as Microsoft Word and Adobe PageMaker software,
although it is unnecessary with more sophisticated Adobe applications
such as recent versions of Illustrator, Photoshop or
InDesign software.</p>
<p>One should not, however, select a base font which has no style-linked
variant, and then use the bold or italic styling button. Doing so will
either have no effect, or result in programmatic bolding or slanting of
the base font, which will usually produce inferior screen and print
results.</p>
</div>
<div id="title">
<h2>
<a name="A3" id="A3">Release Notes</a>
</h2>
</div>
<div id="description"><p>For all Roman fonts of family Source Sans Pro: version 2.010 created on Fri Jun 27 11:31:39 2014.</p>
<p>For all Italic fonts of family Source Sans Pro: version 1.065 created on Wed Jun 25 13:50:02 2014.</p>
<p>version 2.010 created 2014/06/27</p>
<ul>
<li> [This release is Roman fonts only]
<li> Fixed inconsistencies in several derived glyphs.
</ul>
<p>version 2.005 created 2014/06/25</p>
<ul>
<li> [This release is Roman fonts only]
<li> Fixed issue affecting composite glyphs with accents below in TrueType fonts.
</ul>
<p>version 1.065 created 2014/06/25</p>
<ul>
<li> [This release is Italic fonts only]
<li> Fixed TT hinting issues in Ohorn and eight.
<li> Adjusted the position of some accents over a.alt.
<li> Fixed issue affecting composite glyphs with accents below in TrueType fonts.
</ul>
<p>version 2.000 created 2014/06/17</p>
<ul>
<li> [This release is Roman fonts only]</li>
<li> Geometric shapes were made larger. (GitHub issue #39)</li>
<li> Adds narrow no-break space [U+202F] (GitHub issue #30)</li>
<li> Updates kerning of small caps and adds small cap punctuation (GitHub issues #15 & #27)</li>
<li> Adds Cyrillic and Greek support (GitHub issues #6 & #38)</li>
<li> Updates size and shape of diacritics (GitHub issue #21)</li>
<li> Adjusts superscript height to coordinate baseline of letters and numbers (GitHub issue #18)</li>
</ul>
<p>version 1.060 created 2014/06/17</p>
<ul>
<li> [Italic fonts only] Updates size and shape of diacritics.</li>
</ul>
<p>version 1.050 created 2013/04/16</p>
<ul>
<li> [TrueType] Coordinated the vertical alignment of the tops of the letters across all
the styles at the various sizes. (GitHub issue #25)</li>
</ul>
<p>version 1.040 created 2013/04/08</p>
<ul>
<li> Adds Zero_Width_Non_Breaking_Space character (ZWNBS, U+FEFF) to address GitHub issue #20.</li>
</ul>
<p>version 1.039 created 2012/10/19</p>
<ul>
<li> Rebuilt fonts with new MakeOTF version.</li>
</ul>
<p>version 1.038 created 2012/10/15</p>
<ul>
<li> Updates TTF fonts with better hinting for asciitilde and approxequal, which references this hinting.</li>
</ul>
<p>version 1.037 created 2012/10/11</p>
<ul>
<li> Updates the metrics of Majuscule letters in lighter weights.</li>
<li> Updates fonts to add small capitals and superior capital letters to upright styles.</li>
<li> Adds the following characters for transliteration: Blinebelow blinebelow</li>
<li> Klinebelow klinebelow Emacronacute emacronacute Omacronacute omacronacute primemod</li>
<li> Adds the following punctuation characters: bardbl iterrobang ceilingleft ceilingright </li>
<li> floorleft floorright bracketleftwhite bracketrightwhite brackhalftopleft </li>
<li> brackhalftopright brackhalfbotleft brackhalfbotright</li>
<li> Adds dotted zero and slashed zero.</li>
</ul>
<p>version 1.036 created 2012/09/12</p>
<ul>
<li> Updates fonts to fix bug in TTF versions in which the GDEF table was not included.</li>
</ul>
<p>version 1.035 created 2012/09/10</p>
<ul>
<li> Updates the fitting for 'u' and its related glyphs. Updates the kerning in the upright fonts.</li>
</ul>
<p>version 1.034 created 2012/08/15</p>
<ul>
<li> Improved sidebearings of some glyphs, improved kerning classes, improved some kern pairs.</li>
<li> Fixed metrics issues with upright letter D and composites.</li>
<li> Added glyphs and OT feature support for Jarai language.</li>
<li> Added 'ordfeminine' glyph to 'ss02' feature.</li>
<li> Changed glyph name 'schwa.supss' to 'uni0259.sups'.</li>
<li> Changed weightClass value of the ExtraLight fonts from 250 to 200.</li>
<li> Changed OS/2.usWinAscent and OS/2.usWinDescent values to be the same across all fonts.</li>
<li> Changed hhea.Ascender and hhea.Descender values as a result of the OS/2usWin changes.</li>
<li> Changed OS/2 table version number from 4 to 3.</li>
<li> Harmonized the copyright strings.</li>
</ul>
<p>version 1.033 created 2012/07/31</p>
<ul>
<li> First release.</li>
</ul>
</div>
<div id="title">
<h2>
<a name="A8" id="A8">Known issues</a>
</h2>
</div>
<div id="description"><ul> <li>Some glyphs in the font cannot be accessed unless you are using an OpenType compatible application.
</li>
</ul></div>
<div id="title">
<h2>
<a name="A9" id="A9">Customer care</a>
</h2>
</div>
<div id="description">
<p>
<strong>Customer Service</strong>
<br />Adobe Customer Service provides assistance with product information, sales, registration, and other non-technical issues.
To find out how to contact Adobe Customer Service, please visit <a href="http://www.adobe.com">Adobe.com</a> for your region or country and click on Contact Adobe.</p>
<p>
<strong>Support Plan Options and Technical Resources</strong>
<br />If you require technical assistance for your product, including information on free and paid support options and troubleshooting resources, more information is available at
<a title="http://www.adobe.com/go/support/" href="http://www.adobe.com/go/support/">
<span title="http://www.adobe.com/go/support/">http://www.adobe.com/go/support/.</span>
</a> Outside of North America, go to
<a title="http://www.adobe.com/go/intlsupport/" href="http://www.adobe.com/go/intlsupport/">
<span title="http://www.adobe.com/go/intlsupport/">http://www.adobe.com/go/intlsupport/.</span>
</a>Font specific resources include the <a href="http://helpx.adobe.com/font-folio-type.html">Font Folio and Type Product Help page</a> and the <a href="http://forums.adobe.com/community/typography_fonts">Adobe Type user-to-user forums</a>.</p>
</div>
<div id="title">
<h2>
<a name="A10" id="A10">Other resources</a>
</h2>
</div>
<div id="description">
<p>
<a href="http://www.adobe.com/type">Adobe Type Showroom</a>
<br />
<a href="http://www.adobe.com/type/family_readmes.html">Index page for all family Read Me files</a>
<br />
</p>
<p align="left">
<br />
Adobe, the Adobe Logo, Source, Illustrator, InDesign, PageMaker and Photoshop are either registered trademarks or trademarks of Adobe Systems Incorporated in the United States and/or other countries. Windows and OpenType are either registered trademarks or trademarks of Microsoft Corporation in the United States and/or other countries. Mac, Mac OS and TrueType are trademarks of Apple Inc., registered in the U.S. and other countries. All other trademarks are the property of their respective owners. <br />
<br />
<hFooter>
&copy; 2014 Adobe Systems Incorporated. All rights reserved.<br /><br />created 2014 Jun 17
<hFooter>
</p>
</div>
</div>
</body>
</html>

BIN
fonts/TTF/SourceSansPro-Black.ttf View File


BIN
fonts/TTF/SourceSansPro-BlackIt.ttf View File


BIN
fonts/TTF/SourceSansPro-Bold.ttf View File


BIN
fonts/TTF/SourceSansPro-BoldIt.ttf View File


BIN
fonts/TTF/SourceSansPro-ExtraLight.ttf View File


BIN
fonts/TTF/SourceSansPro-ExtraLightIt.ttf View File


BIN
fonts/TTF/SourceSansPro-It.ttf View File


BIN
fonts/TTF/SourceSansPro-Light.ttf View File


BIN
fonts/TTF/SourceSansPro-LightIt.ttf View File


BIN
fonts/TTF/SourceSansPro-Regular.ttf View File


BIN
fonts/TTF/SourceSansPro-Semibold.ttf View File


BIN
fonts/TTF/SourceSansPro-SemiboldIt.ttf View File


BIN
fonts/WOFF/OTF/SourceSansPro-Black.otf.woff View File


BIN
fonts/WOFF/OTF/SourceSansPro-BlackIt.otf.woff View File


BIN
fonts/WOFF/OTF/SourceSansPro-Bold.otf.woff View File


BIN
fonts/WOFF/OTF/SourceSansPro-BoldIt.otf.woff View File


BIN
fonts/WOFF/OTF/SourceSansPro-ExtraLight.otf.woff View File


BIN
fonts/WOFF/OTF/SourceSansPro-ExtraLightIt.otf.woff View File


BIN
fonts/WOFF/OTF/SourceSansPro-It.otf.woff View File


BIN
fonts/WOFF/OTF/SourceSansPro-Light.otf.woff View File


BIN
fonts/WOFF/OTF/SourceSansPro-LightIt.otf.woff View File


BIN
fonts/WOFF/OTF/SourceSansPro-Regular.otf.woff View File


BIN
fonts/WOFF/OTF/SourceSansPro-Semibold.otf.woff View File


BIN
fonts/WOFF/OTF/SourceSansPro-SemiboldIt.otf.woff View File


BIN
fonts/WOFF/TTF/SourceSansPro-Black.ttf.woff View File


BIN
fonts/WOFF/TTF/SourceSansPro-BlackIt.ttf.woff View File


BIN
fonts/WOFF/TTF/SourceSansPro-Bold.ttf.woff View File


BIN
fonts/WOFF/TTF/SourceSansPro-BoldIt.ttf.woff View File


BIN
fonts/WOFF/TTF/SourceSansPro-ExtraLight.ttf.woff View File


BIN
fonts/WOFF/TTF/SourceSansPro-ExtraLightIt.ttf.woff View File


BIN
fonts/WOFF/TTF/SourceSansPro-It.ttf.woff View File


BIN
fonts/WOFF/TTF/SourceSansPro-Light.ttf.woff View File


BIN
fonts/WOFF/TTF/SourceSansPro-LightIt.ttf.woff View File


BIN
fonts/WOFF/TTF/SourceSansPro-Regular.ttf.woff View File


BIN
fonts/WOFF/TTF/SourceSansPro-Semibold.ttf.woff View File


BIN
fonts/WOFF/TTF/SourceSansPro-SemiboldIt.ttf.woff View File


+ 17
- 0
fonts/bower.json View File

@ -0,0 +1,17 @@
{
"name": "source-sans-pro",
"version": "2.010R-ro/1.065R-it",
"main": "source-sans-pro.css",
"homepage": "https://github.com/adobe-fonts/source-sans-pro",
"repository": {
"type": "git",
"url": "https://github.com/adobe-fonts/source-sans-pro.git"
},
"authors": [
{ "name": "Paul D. Hunt" }
],
"description": "Source Sans Pro font family by Adobe",
"license": "SIL OFL 1.1",
"keywords": ["font", "sourcesans", "sourcesanspro", "source sans", "source sans pro"],
"ignore": ["**/.*"]
}

+ 131
- 0
fonts/source-sans-pro.css View File

@ -0,0 +1,131 @@
@font-face{
font-family: 'Source Sans Pro';
font-weight: 200;
font-style: normal;
font-stretch: normal;
src: url('EOT/SourceSansPro-ExtraLight.eot') format('embedded-opentype'),
url('WOFF/OTF/SourceSansPro-ExtraLight.otf.woff') format('woff'),
url('OTF/SourceSansPro-ExtraLight.otf') format('opentype'),
url('TTF/SourceSansPro-ExtraLight.ttf') format('truetype');
}
@font-face{
font-family: 'Source Sans Pro';
font-weight: 200;
font-style: italic;
font-stretch: normal;
src: url('EOT/SourceSansPro-ExtraLightIt.eot') format('embedded-opentype'),
url('WOFF/OTF/SourceSansPro-ExtraLightIt.otf.woff') format('woff'),
url('OTF/SourceSansPro-ExtraLightIt.otf') format('opentype'),
url('TTF/SourceSansPro-ExtraLightIt.ttf') format('truetype');
}
@font-face{
font-family: 'Source Sans Pro';
font-weight: 300;
font-style: normal;
font-stretch: normal;
src: url('EOT/SourceSansPro-Light.eot') format('embedded-opentype'),
url('WOFF/OTF/SourceSansPro-Light.otf.woff') format('woff'),
url('OTF/SourceSansPro-Light.otf') format('opentype'),
url('TTF/SourceSansPro-Light.ttf') format('truetype');
}
@font-face{
font-family: 'Source Sans Pro';
font-weight: 300;
font-style: italic;
font-stretch: normal;
src: url('EOT/SourceSansPro-LightIt.eot') format('embedded-opentype'),
url('WOFF/OTF/SourceSansPro-LightIt.otf.woff') format('woff'),
url('OTF/SourceSansPro-LightIt.otf') format('opentype'),
url('TTF/SourceSansPro-LightIt.ttf') format('truetype');
}
@font-face{
font-family: 'Source Sans Pro';
font-weight: 400;
font-style: normal;
font-stretch: normal;
src: url('EOT/SourceSansPro-Regular.eot') format('embedded-opentype'),
url('WOFF/OTF/SourceSansPro-Regular.otf.woff') format('woff'),
url('OTF/SourceSansPro-Regular.otf') format('opentype'),
url('TTF/SourceSansPro-Regular.ttf') format('truetype');
}
@font-face{
font-family: 'Source Sans Pro';
font-weight: 400;
font-style: italic;
font-stretch: normal;
src: url('EOT/SourceSansPro-It.eot') format('embedded-opentype'),
url('WOFF/OTF/SourceSansPro-It.otf.woff') format('woff'),
url('OTF/SourceSansPro-It.otf') format('opentype'),
url('TTF/SourceSansPro-It.ttf') format('truetype');
}
@font-face{
font-family: 'Source Sans Pro';
font-weight: 600;
font-style: normal;
font-stretch: normal;
src: url('EOT/SourceSansPro-Semibold.eot') format('embedded-opentype'),
url('WOFF/OTF/SourceSansPro-Semibold.otf.woff') format('woff'),
url('OTF/SourceSansPro-Semibold.otf') format('opentype'),
url('TTF/SourceSansPro-Semibold.ttf') format('truetype');
}
@font-face{
font-family: 'Source Sans Pro';
font-weight: 600;
font-style: italic;
font-stretch: normal;
src: url('EOT/SourceSansPro-SemiboldIt.eot') format('embedded-opentype'),
url('WOFF/OTF/SourceSansPro-SemiboldIt.otf.woff') format('woff'),
url('OTF/SourceSansPro-SemiboldIt.otf') format('opentype'),
url('TTF/SourceSansPro-SemiboldIt.ttf') format('truetype');
}
@font-face{
font-family: 'Source Sans Pro';
font-weight: 700;
font-style: normal;
font-stretch: normal;
src: url('EOT/SourceSansPro-Bold.eot') format('embedded-opentype'),
url('WOFF/OTF/SourceSansPro-Bold.otf.woff') format('woff'),
url('OTF/SourceSansPro-Bold.otf') format('opentype'),
url('TTF/SourceSansPro-Bold.ttf') format('truetype');
}
@font-face{
font-family: 'Source Sans Pro';
font-weight: 700;
font-style: italic;
font-stretch: normal;
src: url('EOT/SourceSansPro-BoldIt.eot') format('embedded-opentype'),
url('WOFF/OTF/SourceSansPro-BoldIt.otf.woff') format('woff'),
url('OTF/SourceSansPro-BoldIt.otf') format('opentype'),
url('TTF/SourceSansPro-BoldIt.ttf') format('truetype');
}
@font-face{
font-family: 'Source Sans Pro';
font-weight: 900;
font-style: normal;
font-stretch: normal;
src: url('EOT/SourceSansPro-Black.eot') format('embedded-opentype'),
url('WOFF/OTF/SourceSansPro-Black.otf.woff') format('woff'),
url('OTF/SourceSansPro-Black.otf') format('opentype'),
url('TTF/SourceSansPro-Black.ttf') format('truetype');
}
@font-face{
font-family: 'Source Sans Pro';
font-weight: 900;
font-style: italic;
font-stretch: normal;
src: url('EOT/SourceSansPro-BlackIt.eot') format('embedded-opentype'),
url('WOFF/OTF/SourceSansPro-BlackIt.otf.woff') format('woff'),
url('OTF/SourceSansPro-BlackIt.otf') format('opentype'),
url('TTF/SourceSansPro-BlackIt.ttf') format('truetype');
}

+ 13
- 0
index.html View File

@ -0,0 +1,13 @@
<html>
<head>
<title>Basic example bog</title>
<link rel='stylesheet' href='./css/source-sans-pro.min.css' />
<link rel='stylesheet' href='./css/style.css' />
</head>
<body>
<script src="nacl.min.js"></script>
<script src="nacl-util.min.js"></script>
<script src="lib.js"></script>
<script src="app.js"></script>
</body>
</html>

+ 264
- 0
lib.js View File

@ -0,0 +1,264 @@
// generate a public.private keypair with TweetNaCl.js
function getKeys () {
if (localStorage['id']) {
var keys = JSON.parse(localStorage['id'])
return keys
} else {
var genkey = nacl.sign.keyPair()
if (genkey) {
var keys = {
publicKey: '@' + nacl.util.encodeBase64(genkey.publicKey),
privateKey: nacl.util.encodeBase64(genkey.secretKey),
}
console.log(genkey)
if ((keys.publicKey.includes('+')) || (keys.publicKey.includes('/'))) {
console.log('TRYING AGAIN')
setTimeout(function () {
window.location.reload()
}, 100)
} else {
localStorage['id'] = JSON.stringify(keys)
return keys
}
}
}
}
// publish new messages to your log
function publish (content, keys) {
if (localStorage[keys.publicKey]) {
var log = JSON.parse(localStorage[keys.publicKey])
var lastPost = log[0]
var seq = lastPost.content.sequence
content.sequence = ++seq
content.previous = nacl.util.encodeBase64(nacl.hash(nacl.util.decodeUTF8(JSON.stringify(log[0]))))
console.log(content.previous)
} else {
console.log('SEQUENCE 0')
content.sequence = 0
}
var post = {
content: content,
signature: nacl.util.encodeBase64(nacl.sign(nacl.util.decodeUTF8(JSON.stringify(content)), nacl.util.decodeBase64(keys.privateKey)))
}
// add key (which is a hash of the stringified object post)
post.key = '%' + nacl.util.encodeBase64(nacl.hash(nacl.util.decodeUTF8(JSON.stringify(post))))
// update the log
updateLog(keys.publicKey, post)
var scroller = document.getElementById('scroller')
if (scroller.firstChild) {
scroller.insertBefore(renderMessage(post), scroller.childNodes[1])
} else {
scroller.appendChild(renderMessage(post))
}
}
// update your log in the browser
function updateLog (feed, post) {
if (localStorage[feed]) {
var log = JSON.parse(localStorage[feed])
log.unshift(post)
localStorage[feed] = JSON.stringify(log)
} else {
var log = [post]
localStorage[feed] = JSON.stringify(log)
}
if (localStorage['log']) {
var log = JSON.parse(localStorage['log'])
log.unshift(post)
localStorage['log'] = JSON.stringify(log)
} else {
var log = [post]
localStorage['log'] = JSON.stringify(log)
}
}
// file uploaders for user images
function readFile () {
if (this.files && this.files[0]) {
var fr = new FileReader();
fr.addEventListener("load", function(e) {
var image = e.target.result
document.getElementById("img").src = e.target.result;
document.getElementById("img").style = 'width: 75px; height: 75px';
document.getElementById("b64").innerHTML = e.target.result;
});
fr.readAsDataURL( this.files[0] );
}
}
// render messages
function renderMessage (post) {
var message = h('div', {classList: 'message'})
if (post.content.type == 'name') {
var mini = h('span', [
' identified as ',
post.content.text
])
message.appendChild(getHeader(post, mini))
//message.appendChild(h('pre', [JSON.stringify(post)]))
}
if (post.content.type == 'image') {
var mini = h('span', [
' identified as ',
h('img', {classList: 'small', src:post.content.image})
])
message.appendChild(getHeader(post, mini))
//message.appendChild(h('pre', [JSON.stringify(post)]))
}
if (post.content.type == 'post') {
message.appendChild(getHeader(post))
message.appendChild(h('div', [post.content.text]))
message.appendChild(h('pre', [JSON.stringify(post)]))
var textarea = h('textarea', {placeholder: 'Reply to this bog post'})
message.appendChild(h('button', {
onclick: function () {
message.appendChild(textarea)
message.appendChild(h('button', {
onclick: function () {
if (textarea.value) {
var content = {
author: keys.publicKey,
type: 'post',
text: textarea.value,
reply: post.key,
timestamp: Date.now()
}
console.log(content)
publish(content, keys)
}
}
}, ['Publish']))
}
}, ['Reply']))
}
return message
}
function getImage (id) {
var image = h('img', {classList: 'small'})
if (localStorage[id]) {
var log = JSON.parse(localStorage[id])
for (var i=0; i < log.length; i++) {
var imagePost = log[i]
if (imagePost.content.type == 'image') {
image = h('img', {classList: 'small', src: imagePost.content.image})
return image
}
}
}
return image
}
function getName (id) {
var name = h('span', [id])
if (localStorage[id]) {
var log = JSON.parse(localStorage[id])
for (var i=0; i < log.length; i++) {
var namePost = log[i]
if (namePost.content.type == 'name') {
name = h('span', ['@' + namePost.content.text])
return name
}
}
}
return name
}
function getHeader (post, mini) {
var inner
if (mini) {
var inner = mini
}
var head = h('span', [
h('a', {href: '#' + post.key}, [
h('p', {classList: 'right'}, [human(new Date(post.content.timestamp))]),
]),
h('p', [
h('a', {href: '#' + post.content.author}, [
getImage(post.content.author),
getName(post.content.author)
]),
inner
])
])
return head
}
// human-time by Dave Eddy https://github.com/bahamas10/human
function human(seconds) {
if (seconds instanceof Date)
seconds = Math.round((Date.now() - seconds) / 1000);
var suffix = seconds < 0 ? 'from now' : 'ago';
seconds = Math.abs(seconds);
var times = [
seconds / 60 / 60 / 24 / 365, // years
seconds / 60 / 60 / 24 / 30, // months
seconds / 60 / 60 / 24 / 7, // weeks
seconds / 60 / 60 / 24, // days
seconds / 60 / 60, // hours
seconds / 60, // minutes
seconds // seconds
];
var names = ['year', 'month', 'week', 'day', 'hour', 'minute', 'second'];
for (var i = 0; i < names.length; i++) {
var time = Math.floor(times[i]);
var name = names[i];
if (time > 1)
name += 's';
if (time >= 1)
return time + ' ' + name + ' ' + suffix;
}
return '0 seconds ' + suffix;
}
// hscrpt by Dominic Tarr https://github.com/dominictarr/hscrpt/blob/master/LICENSE
function h (tag, attrs, content) {
if(Array.isArray(attrs)) content = attrs, attrs = {}
var el = document.createElement(tag)
for(var k in attrs) el[k] = attrs[k]
if(content) content.forEach(function (e) {
if(e) el.appendChild('string' == typeof e ? document.createTextNode(e) : e)
})
return el
}

+ 1
- 0
nacl-util.min.js View File

@ -0,0 +1 @@
!function(e,n){"use strict";"undefined"!=typeof module&&module.exports?module.exports=n():e.nacl?e.nacl.util=n():(e.nacl={},e.nacl.util=n())}(this,function(){"use strict";function e(e){if(!/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(e))throw new TypeError("invalid encoding")}var n={};return n.decodeUTF8=function(e){if("string"!=typeof e)throw new TypeError("expected string");var n,r=unescape(encodeURIComponent(e)),t=new Uint8Array(r.length);for(n=0;n<r.length;n++)t[n]=r.charCodeAt(n);return t},n.encodeUTF8=function(e){var n,r=[];for(n=0;n<e.length;n++)r.push(String.fromCharCode(e[n]));return decodeURIComponent(escape(r.join("")))},"undefined"==typeof atob?"undefined"!=typeof Buffer.from?(n.encodeBase64=function(e){return Buffer.from(e).toString("base64")},n.decodeBase64=function(n){return e(n),new Uint8Array(Array.prototype.slice.call(Buffer.from(n,"base64"),0))}):(n.encodeBase64=function(e){return new Buffer(e).toString("base64")},n.decodeBase64=function(n){return e(n),new Uint8Array(Array.prototype.slice.call(new Buffer(n,"base64"),0))}):(n.encodeBase64=function(e){var n,r=[],t=e.length;for(n=0;n<t;n++)r.push(String.fromCharCode(e[n]));return btoa(r.join(""))},n.decodeBase64=function(n){e(n);var r,t=atob(n),o=new Uint8Array(t.length);for(r=0;r<t.length;r++)o[r]=t.charCodeAt(r);return o}),n});

+ 1
- 0
nacl.min.js
File diff suppressed because it is too large
View File


+ 65
- 0
package-lock.json View File

@ -0,0 +1,65 @@
{
"name": "bogbook",
"version": "1.0.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"async-limiter": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.0.tgz",
"integrity": "sha512-jp/uFnooOiO+L211eZOoSyzpOITMXx1rBITauYykG3BRYPu8h0UcxsPNB04RR5vo4Tyz3+ay17tR6JVf9qzYWg=="
},
"ecstatic": {
"version": "3.3.1",
"resolved": "https://registry.npmjs.org/ecstatic/-/ecstatic-3.3.1.tgz",
"integrity": "sha512-/rrctvxZ78HMI/tPIsqdvFKHHscxR3IJuKrZI2ZoUgkt2SiufyLFBmcco+aqQBIu6P1qBsUNG3drAAGLx80vTQ==",
"requires": {
"he": "^1.1.1",
"mime": "^1.6.0",
"minimist": "^1.1.0",
"url-join": "^2.0.5"
}
},
"he": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz",
"integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw=="
},
"is-wsl": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-1.1.0.tgz",
"integrity": "sha1-HxbkqiKwTRM2tmGIpmrzxgDDpm0="
},
"mime": {
"version": "1.6.0",
"resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz",
"integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg=="
},
"minimist": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
"integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ="
},
"opn": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/opn/-/opn-6.0.0.tgz",
"integrity": "sha512-I9PKfIZC+e4RXZ/qr1RhgyCnGgYX0UEIlXgWnCOVACIvFgaC9rz6Won7xbdhoHrd8IIhV7YEpHjreNUNkqCGkQ==",
"requires": {
"is-wsl": "^1.1.0"
}
},
"url-join": {
"version": "2.0.5",
"resolved": "https://registry.npmjs.org/url-join/-/url-join-2.0.5.tgz",
"integrity": "sha1-WvIvGMBSoACkjXuCxenC4v7tpyg="
},
"ws": {
"version": "6.2.1",
"resolved": "https://registry.npmjs.org/ws/-/ws-6.2.1.tgz",
"integrity": "sha512-GIyAXC2cB7LjvpgMt9EKS2ldqr0MTrORaleiOno6TweZ6r3TKtoFQWay/2PceJ3RuBasOHzXNn5Lrw1X0bEjqA==",
"requires": {
"async-limiter": "~1.0.0"
}
}
}
}

+ 17
- 0
package.json View File

@ -0,0 +1,17 @@
{
"name": "bogbook",
"version": "1.0.0",
"description": "secure blockchain logging (blogging, without the l) -- bogging",
"main": "server.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "node server.js"
},
"author": "Ev Bogue <ev@evbogue.com>",
"license": "MIT",
"dependencies": {
"ecstatic": "^3.3.1",
"opn": "^6.0.0",
"ws": "^6.2.1"
}
}

+ 65
- 0
readme.md View File

@ -0,0 +1,65 @@
# bogbook
### secure blockchain logging (blogging).
To avoid confusion we're dropping the 'l' and calling them 'bogs'.
**WARNING** This is very new and experimental software, **not intended for use in production**. Pull-requests are welcome, and if you find anything wrong feel free to report it in public.
Try it online at http://bogbook.com/ !
### What?
bogbook is a distributed social networking application using [TweetNaCl.js](https://tweetnacl.js.org/#/) to publish signed append-only logs to your browser's localStorage.
The bogs are then gossiped between your bog client and bog 'pub' servers using websockets. You're responsible for syncing your messages between different bog 'pub' servers. Bog 'pubs' themselves don't talk to each other, instead they only talk to clients.
When you click on a public key, your client will connect to your current pub to see if there are any new messages from the public key that you've clicked on.
### But what about ssb?!
This is _not_ [secure-scuttlebutt](http://scuttlebot.io/). But it is influenced by my 3+ years working on the project, and there are many similarities between bogbook and secure-scuttlebutt.
The biggest difference is that all of the bogging happens in the client, making it a browser-first bogging network. Last I checked, ssb isn't leaving the server.
Right now we have no private bogging, and no blob distribution (besides profile photos, which are saved to your log in base64).
### how to
bogbook servers
```
git clone git@github.com/bogbook/bogbook.git
cd bogbook
npm install
npm start
```
Bogbook should launch in your browser. If it doesn't, navigate to http://localhost:8080/
### crypto
All of the bogbook cryptography is produced using [TweetNaCl.js](https://tweetnacl.js.org/#/) which is a port of [TweetNaCl](https://tweetnacl.cr.yp.to/), a cryptography library written in 100 Tweets.
bogbook generates an ed25519 public/private keypair on load using `nacl.sign.keyPair()`, which is then stored in localStorage at `localStorage['id']` as a JSON object with the public/private keypairs base64-encoded.
When you post a new message, bogbook will
+ iterate up the message sequence number
+ hash the contents of the previous message using sha512
+ sign the contents of the current message with your ed22519 private key
+ hash the new message (including the signature) using sha512
before appending the feed to the log stored in your browser.
Please note: All logs are append-only, public, and plain text at the current time. While you _can_ moderate your local database and pub servers by deleting logs associated with public keys, it can be difficult to unsay something, so don't drink and bog, people.
Some browsers clear localStorage upon exit, others will clear it if you wipe your browser cache. Remember to save your public/private keypair somewhere, because no one can regenerate it for you.
### contributing
Please report all bugs at http://bogbook.com/
---
MIT

+ 58
- 0
server.js View File

@ -0,0 +1,58 @@
// static server (8089)
var http = require('http')
var serve = require('ecstatic')
http.createServer(
serve({ root: __dirname})
).listen(8089)
// websocket server (8080)
var WebSocket = require('ws')
var fs = require('fs')
var wss = new WebSocket.Server({ port: 8080 })
wss.on('connection', function (ws) {
ws.on('message', function (message) {
var receivedLog = JSON.parse(message)
if (receivedLog.publicKey) {
var publicKey = receivedLog.publicKey
var clientLog = receivedLog.log
// check to see if log is on server
if (fs.existsSync(__dirname + '/bogs/' + publicKey)) {
var serverLog = JSON.parse(fs.readFileSync(__dirname + '/bogs/' + receivedLog.publicKey))
// if the server log has more entries than the log in the client, send the server log to the client
if (serverLog.length > clientLog.length) {
sendingLog = {
publicKey: publicKey,
log: serverLog
}
ws.send(JSON.stringify(sendingLog))
console.log('SENT LOG TO CLIENT')
}
// if server log has less entries than the log sent by the client, write it to the server
if (serverLog.length < clientLog.length) {
fs.writeFile(__dirname + '/bogs/' + publicKey, JSON.stringify(clientLog), function (err) {
if (err) throw err
console.log('SAVED LOG TO SERVER')
})
}
// if logs are identical, do nothing
if (serverLog.length == clientLog.length) {
console.log('LOGS ARE THE SAME')
}
// if log doesn't already exist, write it
} else {
fs.writeFile(__dirname + '/bogs/' + publicKey, JSON.stringify(clientLog), function (err) {
if (err) throw err
console.log('SAVED LOG TO SERVER')
})
}
}
})
})

Loading…
Cancel
Save