Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
bevacqua committed Mar 15, 2015
0 parents commit ef3ce54
Show file tree
Hide file tree
Showing 61 changed files with 3,263 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .editorconfig
@@ -0,0 +1,13 @@
# editorconfig.org
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
4 changes: 4 additions & 0 deletions .gitignore
@@ -0,0 +1,4 @@
node_modules
npm-debug.log
.DS_Store
Thumbs.db
5 changes: 5 additions & 0 deletions .jshintignore
@@ -0,0 +1,5 @@
node_modules
bower_components
dist
example
ponymark
23 changes: 23 additions & 0 deletions .jshintrc
@@ -0,0 +1,23 @@
{
"curly": true,
"eqeqeq": true,
"newcap": true,
"noarg": true,
"noempty": true,
"nonew": true,
"sub": true,
"undef": true,
"unused": true,
"trailing": true,
"boss": true,
"eqnull": true,
"strict": true,
"immed": true,
"expr": true,
"latedef": "nofunc",
"quotmark": "single",
"validthis": true,
"indent": 2,
"node": true,
"browser": true
}
3 changes: 3 additions & 0 deletions TODO.md
@@ -0,0 +1,3 @@
- image uploading
- arbitrary attachments/endpoints/file types
- play nicely with autocompletion
11 changes: 11 additions & 0 deletions bower.json
@@ -0,0 +1,11 @@
{
"name": "barkup",
"version": "1.0.0",
"description": "Barking up the DOM tree. A modular, progressive, and beautiful Markdown and HTML editor",
"main": "dist/barkup.js",
"homepage": "https://github.com/bevacqua/barkup",
"authors": [
"Nicolas Bevacqua <nicolasbevacqua@gmail.com>"
],
"license": "MIT"
}
3 changes: 3 additions & 0 deletions changelog.markdown
@@ -0,0 +1,3 @@
# 1.0.0 IPO

- Initial Public Release
152 changes: 152 additions & 0 deletions example/example.css
@@ -0,0 +1,152 @@
body {
background-color: #e74c3c;
margin: 0 auto;
max-width: 760px;
}

html, body {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}

*, *:before, *:after {
-webkit-box-sizing: inherit;
-moz-box-sizing: inherit;
box-sizing: inherit;
}

body, input, button {
font-family: Georgia, Helvetica;
font-size: 17px;
color: #ecf0f1;
}

h1 {
margin-top: 20px;
padding: 10px 0;
text-align: center;
}

h1,h2,h3,h4,h5,h6{
background-color: rgba(255, 255, 255, 0.2);
}

h3 {
padding: 10px;
text-align: center;
line-height: 36px;
}

h3 b {
font-size: 27px;
color: #2c3e50;
}

a,
a:hover {
color: #ecf0f1;
}

pre code {
color: #fff;
font-size: 18px;
}

blockquote {
border-left: 5px solid #fff;
margin: 10px 0;
padding: 0 15px;
}

label {
display: block;
margin-bottom: 15px;
}

sub {
display: block;
margin-top: -10px;
margin-bottom: 15px;
font-size: 11px;
font-style: italic;
}

ul {
margin: 0;
padding: 0;
}

.parent {
background-color: rgba(255, 255, 255, 0.2);
margin: 50px 0;
padding: 20px;
}

input,
textarea {
border: none;
outline: none;
background-color: #ecf0f1;
padding: 10px;
color: #e74c3c;
border: 0;
display: block;
width: 100%;
}

textarea {
min-height: 350px;
font-size: 14px;
}

button {
background-color: #ecf0f1;
color: #e74c3c;
border: 0;
padding: 18px 12px;
cursor: pointer;
outline: none;
}

button:hover {
background-color: #e74c3c;
color: #ecf0f1;
}

kbd {
display: inline-block;
border: 1px solid #ccc;
margin: -2px 0.1em 0;
padding: 0.1em 0.6em;
line-height: 1.4;
font-size: 11px;
background-color: #f8f8f8;
box-shadow: 0 1px 0 #bbb, 0 0 0 2px #fff inset;
border-radius: 3px;
color: #555;
text-shadow: 0 1px 0 #fff;
white-space: nowrap;
vertical-align: middle;
}

.nsg-tag {
border-color: #e74c3c;
}

.inline {
display: inline-block;
}

.gh-fork {
position: fixed;
top: 0;
right: 0;
border: 0;
z-index: 1;
}

.autofruit {
width: 16px;
margin-right: 3px;
}
25 changes: 25 additions & 0 deletions example/example.js
@@ -0,0 +1,25 @@
void function () {
'use strict';

barkup(ta, {
parseMarkdown: megamark,
parseHTML: domador
});

function events (el, type, fn) {
if (el.addEventListener) {
el.addEventListener(type, fn);
} else if (el.attachEvent) {
el.attachEvent('on' + type, wrap(fn));
} else {
el['on' + type] = wrap(fn);
}
function wrap (originalEvent) {
var e = originalEvent || global.event;
e.target = e.target || e.srcElement;
e.preventDefault = e.preventDefault || function preventDefault () { e.returnValue = false; };
e.stopPropagation = e.stopPropagation || function stopPropagation () { e.cancelBubble = true; };
fn.call(el, e);
}
}
}();
41 changes: 41 additions & 0 deletions index.html
@@ -0,0 +1,41 @@
<!doctype html>
<link href='dist/barkup.css' rel='stylesheet' type='text/css' />
<link href='example/example.css' rel='stylesheet' type='text/css' />
<title>barkup</title>
<h1>barkup</h1>
<h3>Barking up the DOM tree. <b>**woof** &lt;strong&gt;woof&lt;/strong&gt;</b><br/>A modular, progressive, and beautiful Markdown and HTML editor</h3>
<a href='https://github.com/bevacqua/barkup'>
<img class='gh-fork' src='https://camo.githubusercontent.com/365986a132ccd6a44c23a9169022c0b5c890c387/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f7265645f6161303030302e706e67' alt='Fork me on GitHub' data-canonical-src='https://s3.amazonaws.com/github/ribbons/forkme_right_red_aa0000.png' />
</a>
<div class='parent'>
<label for='ta'>Create your website in the area below: </label>
<div>
<textarea id='ta', autofocus># Markdown?

Here's a teensie bit of [Markdown][1] to get you started.

Markdown lets you produce **rich** HTML-formatted text by writing _plain text_. You can write `code`, text in _italics_ or give them **a "bolder" format**. You can create headings by prefixing them with one or more hash characters _(#)_. The less hashes they have, the more prominent your headings become.

Creating links is merely a matter of [wrapping some text in brackets][2] and referencing a resource locator, like the ones you'll find at the bottom of this text. Images can be embedded just the same, except you'll have to prefix the wrapped text with an exclamation point.

> Click on the <kbd>HTML</kbd> button to see this text come to life as HTML, the markup language of the web.
>
> -- Nico

[1]: http://daringfireball.net/projects/markdown/ "Original introduction to Markdown"
[2]: http://stompflow.com</textarea>
</div>
<pre>
<code>
barkup(ta, {
parseMarkdown: megamark,
parseHTML: domador
});
</code>
</pre>
</div>
<h3>Get it on GitHub! <a href='https://github.com/bevacqua/barkup'>bevacqua/barkup</a></h3>
<script src='node_modules/megamark/dist/megamark.js'></script>
<script src='node_modules/domador/dist/domador.js'></script>
<script src='dist/barkup.js'></script>
<script src='example/example.js'></script>
20 changes: 20 additions & 0 deletions license
@@ -0,0 +1,20 @@
The MIT License (MIT)

Copyright © 2015 Nicolas Bevacqua

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
41 changes: 41 additions & 0 deletions package.json
@@ -0,0 +1,41 @@
{
"name": "barkup",
"version": "1.0.0",
"description": "Barking up the DOM tree. A modular, progressive, and beautiful Markdown and HTML editor",
"main": "src/barkup.js",
"scripts": {
"start": "browserify -s barkup -do dist/barkup.js src/barkup.js && watchify -s barkup -dvo dist/barkup.js src/barkup.js & stylus -w src/barkup.styl -o dist",
"scripts": "jshint . && browserify -s barkup -do dist/barkup.js src/barkup.js && uglifyjs -m -c -o dist/barkup.min.js dist/barkup.js",
"styles": "stylus src/barkup.styl -o dist && cleancss dist/barkup.css -o dist/barkup.min.css",
"build": "npm run scripts && npm run styles",
"deployment": "git add dist && npm version ${BUMP:-\"patch\"} --no-git-tag-version && git add package.json && git commit -m \"Autogenerated pre-deployment commit\" && bower version ${BUMP:-\"patch\"} && git reset HEAD~2 && git add . && git commit -am \"Release $(cat package.json | jq -r .version)\" && git push --tags && npm publish && git push",
"sync": "git checkout gh-pages ; git merge master ; git push ; git checkout master",
"deploy": "npm run build && npm run deployment && npm run sync"
},
"repository": {
"type": "git",
"url": "https://github.com/bevacqua/barkup.git"
},
"author": "Nicolas Bevacqua <nicolasbevacqua@gmail.com> (http://bevacqua.io/)",
"license": "MIT",
"bugs": {
"url": "https://github.com/bevacqua/barkup/issues"
},
"homepage": "https://github.com/bevacqua/barkup",
"devDependencies": {
"browserify": "^8.1.0",
"clean-css": "^3.0.4",
"domador": "^1.1.0",
"jshint": "^2.5.11",
"megamark": "^2.1.3",
"nib": "^1.0.4",
"stylus": "^0.49.3",
"uglify-js": "^2.4.16",
"watchify": "^2.2.1"
},
"dependencies": {
"crossvent": "^1.1.0",
"kanye": "^2.0.2",
"local-storage": "^1.4.0"
}
}
23 changes: 23 additions & 0 deletions ponymark/configure.js
@@ -0,0 +1,23 @@
'use strict';

function configure (opts) {
var uploads;
var o = opts || {};
if (o.imageUploads) {
if (typeof o.imageUploads === 'string') {
uploads = { url: o.imageUploads };
} else {
uploads = o.imageUploads;
}
if (!uploads.url) { throw new Error('Required imageUploads.url property missing'); }
if (!uploads.method) { uploads.method = 'PUT'; }
if (!uploads.key) { uploads.key = 'image'; }
if (!uploads.timeout) { uploads.timeout = 15000; }
configure.imageUploads = uploads;
}
if (o.markdown) {
configure.markdown = o.markdown;
}
}

module.exports = configure;

0 comments on commit ef3ce54

Please sign in to comment.