Initial commit to new repo

This commit is contained in:
Jonny Barnes 2016-05-19 15:01:28 +01:00
parent a267f9bfcc
commit a5173c981b
292 changed files with 17472 additions and 0 deletions

20
public/.htaccess Normal file
View file

@ -0,0 +1,20 @@
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
</IfModule>

1
public/assets/css/alertify.css vendored Normal file
View file

@ -0,0 +1 @@
.alertify-logs>*{padding:12px 24px;color:#fff;box-shadow:0 2px 5px 0 rgba(0,0,0,.2);border-radius:1px}.alertify-logs>*,.alertify-logs>.default{background:rgba(0,0,0,.8)}.alertify-logs>.error{background:rgba(244,67,54,.8)}.alertify-logs>.success{background:rgba(76,175,80,.9)}.alertify{position:fixed;background-color:rgba(0,0,0,.3);left:0;right:0;top:0;bottom:0;width:100%;height:100%;z-index:2}.alertify.hide{opacity:0;pointer-events:none}.alertify,.alertify.show{box-sizing:border-box;transition:all .33s cubic-bezier(.25,.8,.25,1)}.alertify,.alertify *{box-sizing:border-box}.alertify .dialog{padding:12px}.alertify .alert,.alertify .dialog{width:100%;margin:0 auto;position:relative;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%)}.alertify .alert>*,.alertify .dialog>*{width:400px;max-width:95%;margin:0 auto;text-align:center;padding:12px;background:#fff;box-shadow:0 2px 4px -1px rgba(0,0,0,.14),0 4px 5px 0 rgba(0,0,0,.098),0 1px 10px 0 rgba(0,0,0,.084)}.alertify .alert .msg,.alertify .dialog .msg{padding:12px;margin-bottom:12px;margin:0;text-align:left}.alertify .alert input:not(.form-control),.alertify .dialog input:not(.form-control){margin-bottom:15px;width:100%;font-size:100%;padding:12px}.alertify .alert input:not(.form-control):focus,.alertify .dialog input:not(.form-control):focus{outline-offset:-2px}.alertify .alert nav,.alertify .dialog nav{text-align:right}.alertify .alert nav button:not(.btn):not(.pure-button):not(.md-button):not(.mdl-button),.alertify .dialog nav button:not(.btn):not(.pure-button):not(.md-button):not(.mdl-button){background:transparent;box-sizing:border-box;color:rgba(0,0,0,.87);position:relative;outline:0;border:0;display:inline-block;-webkit-align-items:center;-ms-flex-align:center;-ms-grid-row-align:center;align-items:center;padding:0 6px;margin:6px 8px;line-height:36px;min-height:36px;white-space:nowrap;min-width:88px;text-align:center;text-transform:uppercase;font-size:14px;text-decoration:none;cursor:pointer;border:1px solid transparent;border-radius:2px}.alertify .alert nav button:not(.btn):not(.pure-button):not(.md-button):not(.mdl-button):active,.alertify .alert nav button:not(.btn):not(.pure-button):not(.md-button):not(.mdl-button):hover,.alertify .dialog nav button:not(.btn):not(.pure-button):not(.md-button):not(.mdl-button):active,.alertify .dialog nav button:not(.btn):not(.pure-button):not(.md-button):not(.mdl-button):hover{background-color:rgba(0,0,0,.05)}.alertify .alert nav button:not(.btn):not(.pure-button):not(.md-button):not(.mdl-button):focus,.alertify .dialog nav button:not(.btn):not(.pure-button):not(.md-button):not(.mdl-button):focus{border:1px solid rgba(0,0,0,.1)}.alertify .alert nav button.btn,.alertify .dialog nav button.btn{margin:6px 4px}.alertify-logs{position:fixed;z-index:1}.alertify-logs.bottom,.alertify-logs:not(.top){bottom:16px}.alertify-logs.left,.alertify-logs:not(.right){left:16px}.alertify-logs.left>*,.alertify-logs:not(.right)>*{float:left;-webkit-transform:translateZ(0);transform:translateZ(0);height:auto}.alertify-logs.left>.show,.alertify-logs:not(.right)>.show{left:0}.alertify-logs.left>*,.alertify-logs.left>.hide,.alertify-logs:not(.right)>*,.alertify-logs:not(.right)>.hide{left:-110%}.alertify-logs.right{right:16px}.alertify-logs.right>*{float:right;-webkit-transform:translateZ(0);transform:translateZ(0)}.alertify-logs.right>.show{right:0;opacity:1}.alertify-logs.right>*,.alertify-logs.right>.hide{right:-110%;opacity:0}.alertify-logs.top{top:0}.alertify-logs>*{box-sizing:border-box;transition:all .4s cubic-bezier(.25,.8,.25,1);position:relative;clear:both;-webkit-backface-visibility:hidden;backface-visibility:hidden;-webkit-perspective:1000;perspective:1000;max-height:0;margin:0;padding:0;overflow:hidden;opacity:0;pointer-events:none}.alertify-logs>.show{margin-top:12px;opacity:1;max-height:1000px;padding:12px;pointer-events:auto}

243
public/assets/css/global.css vendored Normal file
View file

@ -0,0 +1,243 @@
html {
background: url("/assets/img/escheresque.png"); }
.map {
height: 150px; }
html {
box-sizing: border-box; }
*, *:before, *:after {
box-sizing: inherit; }
#topheader {
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-flex-flow: row;
-ms-flex-flow: row;
flex-flow: row; }
#topheader a {
padding: 0.5em 1em; }
nav {
padding-top: 0.5em; }
.social-list {
padding-left: 2em; }
.note {
background-color: #eee8d5;
box-shadow: 0 0 10px 2px #93a1a1;
padding: 0.5em 0.5em;
margin-top: 1em; }
.note:after {
content: " ";
display: block;
height: 0;
clear: both; }
.note a {
word-wrap: break-word; }
.note .e-content p:first-child {
margin-top: 0; }
.note-metadata {
width: 100%; }
.social-links {
float: right; }
.social-links a {
text-decoration: none; }
.icon {
width: auto;
height: 1em;
fill: #268bd2; }
.reply {
margin-left: 2em;
margin-right: 2em;
font-size: 0.8em;
padding: 0.5em 0.5em; }
.reply-to {
margin-left: 2em;
margin-right: 2em;
font-size: 0.8em;
padding-top: 2em; }
.reply-to + .note {
margin-top: 0.3em; }
.mini-h-card {
border-radius: 2px;
border: 1px solid #586e75;
padding: 0 0.2em;
text-decoration: none;
margin-right: 5px;
white-space: nowrap; }
.mini-h-card img {
height: 1.26em;
display: inline;
border-radius: 2px;
vertical-align: text-bottom; }
.like-photo {
height: 1.26em; }
.reply .e-content {
margin-top: 0.5em;
padding-left: 0.5em; }
.notes-subtitle {
font-size: 1em; }
.note-photo {
width: 100%;
height: auto;
image-orientation: from-image; }
article header {
margin-top: 0.5em;
margin-bottom: 0.8em; }
.post-info {
font-size: 0.8em;
font-style: italic;
margin-top: -0.8em; }
.contact {
position: relative; }
.contact-links {
list-style-type: none; }
.contact img {
height: auto;
width: 2em;
position: absolute;
top: 0;
left: 0; }
.contact-info {
margin-left: 2em; }
#map {
height: 300px; }
/* media queries */
@media (min-width: 700px) {
main {
margin-left: 10em;
margin-right: 10em; }
footer {
margin-left: 13em;
margin-right: 13em; }
.youtube {
width: 640px;
height: 360px; } }
@media (max-width: 699px) {
main {
margin-left: 10px;
margin-right: 10px; }
article {
word-wrap: break-word; }
footer {
margin-left: 15px;
margin-right: 15px; }
.youtube {
width: 100%;
height: auto; } }
body {
text-rendering: optimizeLegibility;
-webkit-font-feature-settings: "liga";
font-feature-settings: "liga";
font-family: "leitura-news", serif;
font-size: 1.2em; }
#topheader h1 {
font-family: "leitura-news", serif; }
h1 {
font-family: "prenton", sans-serif; }
#topheader a {
text-decoration: none; }
nav {
-webkit-font-feature-settings: "dlig";
font-feature-settings: "dlig"; }
article header h1 a {
text-decoration: none; }
article div a {
text-decoration: none; }
footer {
font-size: 0.8em; }
.emoji {
width: auto;
height: 1em; }
body {
color: #002b36; }
header a {
color: #002b36; }
a {
color: #268bd2; }
form {
width: 100%; }
fieldset {
min-width: 0;
width: 100%; }
input[type="text"], input[type="file"], textarea {
width: 100%; }
input, button, textarea {
-webkit-appearance: none;
-moz-appearance: none;
background-color: #002b36;
color: #fdf6e3;
border: 1px solid #fdf6e3;
border-radius: 4px; }
button:hover {
transition: 0.5s ease-in-out;
background-color: #fdf6e3;
color: #002b36; }
button:disabled {
background-color: #93a1a1;
color: #002b36; }
input[type="checkbox"] {
-webkit-appearance: checkbox;
-moz-appearance: checkbox; }
#photo {
background: inherit;
color: inherit;
border: none; }
.twitter-tweet-rendered {
margin-bottom: 0 !important; }
.twitter-tweet-rendered + .note {
margin-top: 0; }
/*# sourceMappingURL=global.css.map */

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

424
public/assets/css/normalize.css vendored Normal file
View file

@ -0,0 +1,424 @@
/*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */
/**
* 1. Set default font family to sans-serif.
* 2. Prevent iOS and IE text size adjust after device orientation change,
* without disabling user zoom.
*/
html {
font-family: sans-serif; /* 1 */
-ms-text-size-adjust: 100%; /* 2 */
-webkit-text-size-adjust: 100%; /* 2 */
}
/**
* Remove default margin.
*/
body {
margin: 0;
}
/* HTML5 display definitions
========================================================================== */
/**
* Correct `block` display not defined for any HTML5 element in IE 8/9.
* Correct `block` display not defined for `details` or `summary` in IE 10/11
* and Firefox.
* Correct `block` display not defined for `main` in IE 11.
*/
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
main,
menu,
nav,
section,
summary {
display: block;
}
/**
* 1. Correct `inline-block` display not defined in IE 8/9.
* 2. Normalize vertical alignment of `progress` in Chrome, Firefox, and Opera.
*/
audio,
canvas,
progress,
video {
display: inline-block; /* 1 */
vertical-align: baseline; /* 2 */
}
/**
* Prevent modern browsers from displaying `audio` without controls.
* Remove excess height in iOS 5 devices.
*/
audio:not([controls]) {
display: none;
height: 0;
}
/**
* Address `[hidden]` styling not present in IE 8/9/10.
* Hide the `template` element in IE 8/9/10/11, Safari, and Firefox < 22.
*/
[hidden],
template {
display: none;
}
/* Links
========================================================================== */
/**
* Remove the gray background color from active links in IE 10.
*/
a {
background-color: transparent;
}
/**
* Improve readability of focused elements when they are also in an
* active/hover state.
*/
a:active,
a:hover {
outline: 0;
}
/* Text-level semantics
========================================================================== */
/**
* Address styling not present in IE 8/9/10/11, Safari, and Chrome.
*/
abbr[title] {
border-bottom: 1px dotted;
}
/**
* Address style set to `bolder` in Firefox 4+, Safari, and Chrome.
*/
b,
strong {
font-weight: bold;
}
/**
* Address styling not present in Safari and Chrome.
*/
dfn {
font-style: italic;
}
/**
* Address variable `h1` font-size and margin within `section` and `article`
* contexts in Firefox 4+, Safari, and Chrome.
*/
h1 {
font-size: 2em;
margin: 0.67em 0;
}
/**
* Address styling not present in IE 8/9.
*/
mark {
background: #ff0;
color: #000;
}
/**
* Address inconsistent and variable font size in all browsers.
*/
small {
font-size: 80%;
}
/**
* Prevent `sub` and `sup` affecting `line-height` in all browsers.
*/
sub,
sup {
font-size: 75%;
line-height: 0;
position: relative;
vertical-align: baseline;
}
sup {
top: -0.5em;
}
sub {
bottom: -0.25em;
}
/* Embedded content
========================================================================== */
/**
* Remove border when inside `a` element in IE 8/9/10.
*/
img {
border: 0;
}
/**
* Correct overflow not hidden in IE 9/10/11.
*/
svg:not(:root) {
overflow: hidden;
}
/* Grouping content
========================================================================== */
/**
* Address margin not present in IE 8/9 and Safari.
*/
figure {
margin: 1em 40px;
}
/**
* Address differences between Firefox and other browsers.
*/
hr {
box-sizing: content-box;
height: 0;
}
/**
* Contain overflow in all browsers.
*/
pre {
overflow: auto;
}
/**
* Address odd `em`-unit font size rendering in all browsers.
*/
code,
kbd,
pre,
samp {
font-family: monospace, monospace;
font-size: 1em;
}
/* Forms
========================================================================== */
/**
* Known limitation: by default, Chrome and Safari on OS X allow very limited
* styling of `select`, unless a `border` property is set.
*/
/**
* 1. Correct color not being inherited.
* Known issue: affects color of disabled elements.
* 2. Correct font properties not being inherited.
* 3. Address margins set differently in Firefox 4+, Safari, and Chrome.
*/
button,
input,
optgroup,
select,
textarea {
color: inherit; /* 1 */
font: inherit; /* 2 */
margin: 0; /* 3 */
}
/**
* Address `overflow` set to `hidden` in IE 8/9/10/11.
*/
button {
overflow: visible;
}
/**
* Address inconsistent `text-transform` inheritance for `button` and `select`.
* All other form control elements do not inherit `text-transform` values.
* Correct `button` style inheritance in Firefox, IE 8/9/10/11, and Opera.
* Correct `select` style inheritance in Firefox.
*/
button,
select {
text-transform: none;
}
/**
* 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio`
* and `video` controls.
* 2. Correct inability to style clickable `input` types in iOS.
* 3. Improve usability and consistency of cursor style between image-type
* `input` and others.
*/
button,
html input[type="button"], /* 1 */
input[type="reset"],
input[type="submit"] {
-webkit-appearance: button; /* 2 */
cursor: pointer; /* 3 */
}
/**
* Re-set default cursor for disabled elements.
*/
button[disabled],
html input[disabled] {
cursor: default;
}
/**
* Remove inner padding and border in Firefox 4+.
*/
button::-moz-focus-inner,
input::-moz-focus-inner {
border: 0;
padding: 0;
}
/**
* Address Firefox 4+ setting `line-height` on `input` using `!important` in
* the UA stylesheet.
*/
input {
line-height: normal;
}
/**
* It's recommended that you don't attempt to style these elements.
* Firefox's implementation doesn't respect box-sizing, padding, or width.
*
* 1. Address box sizing set to `content-box` in IE 8/9/10.
* 2. Remove excess padding in IE 8/9/10.
*/
input[type="checkbox"],
input[type="radio"] {
box-sizing: border-box; /* 1 */
padding: 0; /* 2 */
}
/**
* Fix the cursor style for Chrome's increment/decrement buttons. For certain
* `font-size` values of the `input`, it causes the cursor style of the
* decrement button to change from `default` to `text`.
*/
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
height: auto;
}
/**
* 1. Address `appearance` set to `searchfield` in Safari and Chrome.
* 2. Address `box-sizing` set to `border-box` in Safari and Chrome.
*/
input[type="search"] {
-webkit-appearance: textfield; /* 1 */
box-sizing: content-box; /* 2 */
}
/**
* Remove inner padding and search cancel button in Safari and Chrome on OS X.
* Safari (but not Chrome) clips the cancel button when the search input has
* padding (and `textfield` appearance).
*/
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration {
-webkit-appearance: none;
}
/**
* Define consistent border, margin, and padding.
*/
fieldset {
border: 1px solid #c0c0c0;
margin: 0 2px;
padding: 0.35em 0.625em 0.75em;
}
/**
* 1. Correct `color` not being inherited in IE 8/9/10/11.
* 2. Remove padding so people aren't caught out if they zero out fieldsets.
*/
legend {
border: 0; /* 1 */
padding: 0; /* 2 */
}
/**
* Remove default vertical scrollbar in IE 8/9/10/11.
*/
textarea {
overflow: auto;
}
/**
* Don't inherit the `font-weight` (applied by a rule above).
* NOTE: the default cannot safely be changed in Chrome and Safari on OS X.
*/
optgroup {
font-weight: bold;
}
/* Tables
========================================================================== */
/**
* Remove most spacing between table cells.
*/
table {
border-collapse: collapse;
border-spacing: 0;
}
td,
th {
padding: 0;
}

188
public/assets/css/prism.css vendored Normal file
View file

@ -0,0 +1,188 @@
/* http://prismjs.com/download.html?themes=prism-dark&languages=markup+css+clike+javascript+git+http+markdown+php+php-extras+scss+sql&plugins=line-numbers+show-invisibles */
/**
* prism.js Dark theme for JavaScript, CSS and HTML
* Based on the slides of the talk /Reg(exp){2}lained/
* @author Lea Verou
*/
code[class*="language-"],
pre[class*="language-"] {
color: white;
text-shadow: 0 -.1em .2em black;
font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
direction: ltr;
text-align: left;
white-space: pre;
word-spacing: normal;
word-break: normal;
line-height: 1.5;
-moz-tab-size: 4;
-o-tab-size: 4;
tab-size: 4;
-webkit-hyphens: none;
-moz-hyphens: none;
-ms-hyphens: none;
hyphens: none;
}
@media print {
code[class*="language-"],
pre[class*="language-"] {
text-shadow: none;
}
}
pre[class*="language-"],
:not(pre) > code[class*="language-"] {
background: hsl(30, 20%, 25%);
}
/* Code blocks */
pre[class*="language-"] {
padding: 1em;
margin: .5em 0;
overflow: auto;
border: .3em solid hsl(30, 20%, 40%);
border-radius: .5em;
box-shadow: 1px 1px .5em black inset;
}
/* Inline code */
:not(pre) > code[class*="language-"] {
padding: .15em .2em .05em;
border-radius: .3em;
border: .13em solid hsl(30, 20%, 40%);
box-shadow: 1px 1px .3em -.1em black inset;
}
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
color: hsl(30, 20%, 50%);
}
.token.punctuation {
opacity: .7;
}
.namespace {
opacity: .7;
}
.token.property,
.token.tag,
.token.boolean,
.token.number,
.token.constant,
.token.symbol {
color: hsl(350, 40%, 70%);
}
.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
color: hsl(75, 70%, 60%);
}
.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string,
.token.variable {
color: hsl(40, 90%, 60%);
}
.token.atrule,
.token.attr-value,
.token.keyword {
color: hsl(350, 40%, 70%);
}
.token.regex,
.token.important {
color: #e90;
}
.token.important,
.token.bold {
font-weight: bold;
}
.token.italic {
font-style: italic;
}
.token.entity {
cursor: help;
}
.token.deleted {
color: red;
}
pre.line-numbers {
position: relative;
padding-left: 3.8em;
counter-reset: linenumber;
}
pre.line-numbers > code {
position: relative;
}
.line-numbers .line-numbers-rows {
position: absolute;
pointer-events: none;
top: 0;
font-size: 100%;
left: -3.8em;
width: 3em; /* works for line-numbers below 1000 lines */
letter-spacing: -1px;
border-right: 1px solid #999;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.line-numbers-rows > span {
pointer-events: none;
display: block;
counter-increment: linenumber;
}
.line-numbers-rows > span:before {
content: counter(linenumber);
color: #999;
display: block;
padding-right: 0.8em;
text-align: right;
}
.token.tab:not(:empty):before,
.token.cr:before,
.token.lf:before {
color: hsl(24, 20%, 85%);
}
.token.tab:not(:empty):before {
content: '\21E5';
}
.token.cr:before {
content: '\240D';
}
.token.crlf:before {
content: '\240D\240A';
}
.token.lf:before {
content: '\240A';
}

10
public/assets/css/projects.css vendored Normal file
View file

@ -0,0 +1,10 @@
#projects {
padding-left: 33.33%;
}
h3 {
float: left;
width: 45%;
margin: 0 5% 0 -50%;
text-align: right;
}

2
public/assets/css/sanitize.min.css vendored Normal file
View file

@ -0,0 +1,2 @@
/*! sanitize.css v3.2.0 | CC0 1.0 Public Domain | github.com/10up/sanitize.css */audio:not([controls]){display:none}button{-webkit-appearance:button;overflow:visible}details{display:block}html{-ms-overflow-style:-ms-autohiding-scrollbar;overflow-y:scroll;-webkit-text-size-adjust:100%}input{-webkit-border-radius:0}input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button}input[type=number]{width:auto}input[type=search]{-webkit-appearance:textfield}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}main{display:block}pre{overflow:auto}progress{display:inline-block}small{font-size:75%}summary{display:block}svg:not(:root){overflow:hidden}template{display:none}textarea{overflow:auto}[hidden]{display:none}*,:after,:before{box-sizing:inherit}*{font-size:inherit;line-height:inherit}:after,:before{text-decoration:inherit;vertical-align:inherit}*,:after,:before{border-style:solid;border-width:0}*{background-repeat:no-repeat;margin:0;padding:0}:root{background-color:#fff;box-sizing:border-box;color:#000;cursor:default;font:100%/1.5 sans-serif}a{text-decoration:none}audio,canvas,iframe,img,svg,video{vertical-align:middle}button,input,select,textarea{background-color:transparent;color:inherit;font-family:inherit;font-style:inherit;font-weight:inherit}[type=button],[type=date],[type=datetime-local],[type=datetime],[type=email],[type=month],[type=number],[type=password],[type=reset],[type=search],[type=submit],[type=tel],[type=text],[type=time],[type=url],[type=week],button,select,textarea{min-height:1.5em}code,kbd,pre,samp{font-family:monospace}nav ol,nav ul{list-style:none}select{-moz-appearance:none;-webkit-appearance:none}select::-ms-expand{display:none}select::-ms-value{color:currentColor}table{border-collapse:collapse;border-spacing:0}textarea{resize:vertical}::-moz-selection{background-color:#b3d4fc;color:#fff;text-shadow:none}::selection{background-color:#b3d4fc;color:#fff;text-shadow:none}[aria-busy=true]{cursor:progress}[aria-controls]{cursor:pointer}[aria-disabled]{cursor:default}[hidden][aria-hidden=false]{clip:rect(0 0 0 0);display:inherit;position:absolute}[hidden][aria-hidden=false]:focus{clip:auto}[tabindex],a,area,button,input,label,select,textarea{-ms-touch-action:manipulation;touch-action:manipulation}
/*# sourceMappingURL=sanitize.min.css.map */

Binary file not shown.

After

Width:  |  Height:  |  Size: 395 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

3
public/assets/img/notes/.gitignore vendored Normal file
View file

@ -0,0 +1,3 @@
# ignore everthing in here except the .gitignore itself
*
!.gitignore

View file

@ -0,0 +1,22 @@
-----BEGIN PGP PUBLIC KEY BLOCK-----
mHMEVLAKNRMJKyQDAwIIAQELAwMEXwZt3GCBMfYdy4E6SYBlhI5OWB5KLWDJIszb
rHVk1lFzuCh8v9vO3TMJipved89lKdsqc8xa1rtUhDUSyk3DN6G9EA8CaZzPAI0W
3rIIjKr/6XdsrCbr4uBm8pfxojlrtCNKb25ueSBCYXJuZXMgPGpvbm55QGpvbm55
YmFybmVzLnVrPoifBBMTCgAnAhsDBQsJCAcDBRUKCQgLBRYDAgEAAh4BAheABQJW
jWw8BQkDvpWHAAoJEE6N3A7eXSOmEV0Bf1mwzjzKSZvn5l/VhQTrMbM47K82w/wj
JYF9ZTy1jmXTWTMB3grnjB+VhkF0fJEO7QF+N6EULNZu9xpUX00LfasRvjhDQEoZ
GWLJWuES3pIheS2wUKScnVxv/3Ntxl9DZyBRuHcEVLAKNRIJKyQDAwIIAQELAwME
MyNUNRiVoPuUZHkZmoR2fP0j2d6ukPxSyIwE1i0SOokPgh2ho9az2i1JuEJnAJdC
Jk7anTWqVIVDqY24BPdCAq3Tevvw6ZxYTX5syhQ06rP5fmA9qRvaJMj96bUk2I7U
AwEJCYiHBBgTCgAPAhsMBQJWjWxuBQkDvpW5AAoJEE6N3A7eXSOmEE4Bfj2IlY+w
66UuDaZubytEJ7RqZjxroSTygbFzmrrPcyeJo34spa97on2RJa3I1SUEqAF/ZXkY
dwnMIGjsQFhmp0v0SeQqRKzQ0UsP4X/fCMhXcq1qvSZvp0xGd88OIawGL5YauDME
VLBHDxYJKwYBBAHaRw8BAQdAN3zPDRahp3XZ2Q6SJcE4s36GziDIEOLq+jYZVTjG
mQ6I5wQYEwoADwIbAgUCVo1sjAUJA75Y/QBqXyAEGRYKAAYFAlSwRw8ACgkQzehE
GPNsf3t+2wEA4ZD2Fpw9oZuDVLKUfY2/7WvG9MFTJmhO7j6N2C8rdYgBAIm15ezk
A2DUCxDKmufsYrkp73nyB/5jq0++qdFXI2oMCRBOjdwO3l0jpm9FAX49J1fL41ZU
7QpJFEd8gJbYwjCu93YuIP6xpgSfNzE7y4Yl3fYEihmo21aEpeuxIY4BfiNY6r/z
e5MEKgkw5EYZZK295zhyzZUh0k+0Aezlj1G9faAWgasI+Hp4ATIicNunng==
=uwJN
-----END PGP PUBLIC KEY BLOCK-----

View file

@ -0,0 +1,52 @@
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v2
mQINBFIpsg4BEAD/N8gCtJLVmLFNZeS9x7NcDJKAhYYLeFcNzucVKG0Q+XsLl9Ly
u5YM4fNqKcHNSLz31lFFgM0kN6WLteCD2oRZJpKkgviitNXwX19om8rYMV7FqYBu
GDVN6yfXLEUwa/NzsiHSr0YckFphpmdQPYkWJappcaGUzgl9sgy1uc0876NNllSU
TA4XAgDNHydMTlXZT7b/+ttTUXkZBcl5LRBxeDx77sngkDUlZVIlD8b7fSvSNxec
1U+aWAbnnzntDNXJ8Sve0NE3ti8GeOqeg0wWbzh9HMjadb5lX7nmATKGehefIaUv
9D2GYk0LB/6wJVg0NK/SQmyBEB5jW3y0cI2il3NLC72qWU3J65Bl5AF0McKCBcDn
kA5zISL8lSWXRcCnM5rf13Lz8pAOIEnbURSRILXWdXuzd2+55HaJaZFj9fQWuFZf
3B/Rpr5rZskjdRgNToUEFYycEg70sCUnyl57oIWjQ5SWI0vqm8IaJO/wv0pSfdOC
NpOl7ra3BZmULuXzcfR1C4akQAxkwRB2E1cG/eHoDdPSb6s/CBqM14EscHbUel5j
xqRXc1uxRn7MOL6a8d/nE3iF8tUUPnXAwDgOZXKN2ZDfVjA9nKVuxOZka+lm2Phu
2M3VGSzHWkJViDKZJ5XH3bYZv1ZhsjAHHM31+LwmTiy2NYxJVG+JOYsM6QARAQAB
tDNKb25hdGhhbiBNYXggQmFybmVzIChKb25ueSkgPGpvbm55QGpvbm55YmFybmVz
Lm5ldD6JAj0EEwEIACcFAlIpsg4CGwMFCQHhM4AFCwkIBwMFFQoJCAsFFgIDAQAC
HgECF4AACgkQbBPmXsq8FiXn7hAAu1ssIlEtmaoVGMpmTMezqR36+/+2URfj9jah
5TqTVD0GPnyLxD3dEQ24zmgAHHgWOYSlc/gO5AA9Ck2FNhtlqtgADBLr0dIYEVxy
f0WckljxQ1UFGO+fDyJby2Q0lMQ+4qInY8X6G0UZ+/FhCO/7FtEdm4DKa0Kq5bof
Iea1bL1oYb/59ZFc4mk7afQWBsXIh9HCqBik0qQ9j8LJDlEOchx8s2EaqRHO3i6P
hRP9ceIiQrCmang7cmgfsXNe5KU9n2QFmLkiZxlH7YLSvEk2i6XerHrAduUyg+9j
Yzkgl1oRju1UPglTN7KfCIiI/2wzu8LRZvZFoB8uXkTFtf0Dex5VIkdKyHBQ/09l
o35+RTjviOybXv8jHYViXXpRrTx2rDLvilyueezHDDyrhEoU+19+JEzlc4bnSMes
k2QIuXtqiKThhCxUS3tnkTRmVy9NMsWU3TcBC8sXwCJYqWFexOl04K/jfLNEBz7M
Rj4fdo/GF8RmB/+9Kze5Rafha4pRQ5u/eevmGCxslaJe43JwV+ARNOzH7oDIPDiF
0xvxvP+8/zMF2qsR66o12veOfIcqwtXebr/K4yngfexKzKY7LJ+i3Gz+q+KFInid
HHwbX3rDamFdH4rSNavywg3AG6fTSDHgf8YLOPjkwHk8McWEXwcewSBE5tSNq+8O
ZA2xoKO5Ag0EUimyDgEQAOu/anBLz4xaEw+T9jBMnqdDptJCRkT14LJFTudJK6rE
D0qqnxNHWs+fDFs32RJSfpy8zMa+xCV0h9L2xbgI5PuWNFifQBcf+w9DWqor41Ta
MyRuixSRWpM5UNDVjFoVa/hPiWCxZMC7K73pQ6lFyxzlAz9iJXOG+dT7GNeLjiUX
AvBWRsfVIaV9bSNXK+o5Yb6UFwtCzeGcT0mCDs4Pc5cv3M+Kd5CDyfPPWJtGH9Fz
2I1mAEemzP4Rgab7q9Ms1J1Tv/H5P1kaVrmdTFxbX6vi8hmnymDY5IPCWmRjBTaH
xI9oby6Y+ExUwr1znD0pZBndJzq00hmxQIFFZDdlgqvTgJFtgvHEtjSMhMh5Cnkm
JkSarxDpnTzKvBCUvPQeBnl8vq78jYIB9rLvmZPiwqoqnURBgKXJl+MGjhixHrmU
hCrt0kOFX/w0APgueFXVcuBoxAQZx+uaFDrID9oJvXB7LGNnGhLd2aglz5a+kpB3
pbmij0ercumIz3+NcGiili5zk2VHMfOI9rfqMqYmq9R9qoRancqd9CgMd5z9x999
Ztj9GVs3rUhi4kVCzZbQLD/w7u22m+UsFEp7dbvHaaM2446k9pIcZZoUJLAmkgHQ
dz9i9cOB3DEqo3zM2bZaHXaPIhunbzT80kiuggFxrDL00Hsm5WKZXnEX3wLoG+QD
ABEBAAGJAiUEGAEIAA8FAlIpsg4CGwwFCQHhM4AACgkQbBPmXsq8FiX/KQ/+IzJB
FJ15zw4gE4YOsNF7NQ5Bp8m45082ZhNVjexbPI1J6b+kFCW7lMqY2mBFlMidiheb
RxMV5iNqrR1oXoSREo94z58X5+j1eIjjXk3TGUSuQ/4hG1yYuqrqsNpdLCmcnt5j
7CbJ/KxnyPDltMwsMv5iS3ZDPqYHVWUieuiVss5HbFbEA9x3Hrzy7kxQNI33ZfwF
dKNQv+Qz9dGLhygHuyPKc6e5jd6uw89pITkrnVdbc08miwGV/HlwQKNGyj2Ygwza
a7QfhFV18qI+6ylZjdu/Kp6M8TxCaswhDhrwGtZh7v3o8HHJrKYD2Hb7IP9+K84t
mkIII69Sbc9ZItIFzZMcyfk0RfeDy96oZUNvLc77OKbPCtD9/ZRObwxWc19s/LIJ
sD76WbwlrR2yUnX2HYf6DxRNvxeSwjGzcqRJCZgg8LsylH2oDE+AdLKxbelDqqyT
NtHhfF5W0URVnHxmjUBVjFxYtH8hSxSL+zOLUY6QXgtriRQa9PuQfbojlX9k3gtM
9+53u5xtQoSwPeHczwxenYBddBGo9TsXWSvMVUQ8hlepTK3O57C1Sf+wAxW/EHeO
30lNXDREr/J/IJ7AanL8fkUi7iaoBkx0Xdi3qe1YOu6MR1TuPT75cDoAjQEG2AUr
igdpfiESmrELanSGdSsSBtieo+imJ3G3xmj2vrs=
=dnNH
-----END PGP PUBLIC KEY BLOCK-----

10
public/assets/js/Autolinker.min.js vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

389
public/assets/js/fetch.js Normal file
View file

@ -0,0 +1,389 @@
(function(self) {
'use strict';
if (self.fetch) {
return
}
function normalizeName(name) {
if (typeof name !== 'string') {
name = String(name)
}
if (/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(name)) {
throw new TypeError('Invalid character in header field name')
}
return name.toLowerCase()
}
function normalizeValue(value) {
if (typeof value !== 'string') {
value = String(value)
}
return value
}
function Headers(headers) {
this.map = {}
if (headers instanceof Headers) {
headers.forEach(function(value, name) {
this.append(name, value)
}, this)
} else if (headers) {
Object.getOwnPropertyNames(headers).forEach(function(name) {
this.append(name, headers[name])
}, this)
}
}
Headers.prototype.append = function(name, value) {
name = normalizeName(name)
value = normalizeValue(value)
var list = this.map[name]
if (!list) {
list = []
this.map[name] = list
}
list.push(value)
}
Headers.prototype['delete'] = function(name) {
delete this.map[normalizeName(name)]
}
Headers.prototype.get = function(name) {
var values = this.map[normalizeName(name)]
return values ? values[0] : null
}
Headers.prototype.getAll = function(name) {
return this.map[normalizeName(name)] || []
}
Headers.prototype.has = function(name) {
return this.map.hasOwnProperty(normalizeName(name))
}
Headers.prototype.set = function(name, value) {
this.map[normalizeName(name)] = [normalizeValue(value)]
}
Headers.prototype.forEach = function(callback, thisArg) {
Object.getOwnPropertyNames(this.map).forEach(function(name) {
this.map[name].forEach(function(value) {
callback.call(thisArg, value, name, this)
}, this)
}, this)
}
function consumed(body) {
if (body.bodyUsed) {
return Promise.reject(new TypeError('Already read'))
}
body.bodyUsed = true
}
function fileReaderReady(reader) {
return new Promise(function(resolve, reject) {
reader.onload = function() {
resolve(reader.result)
}
reader.onerror = function() {
reject(reader.error)
}
})
}
function readBlobAsArrayBuffer(blob) {
var reader = new FileReader()
reader.readAsArrayBuffer(blob)
return fileReaderReady(reader)
}
function readBlobAsText(blob) {
var reader = new FileReader()
reader.readAsText(blob)
return fileReaderReady(reader)
}
var support = {
blob: 'FileReader' in self && 'Blob' in self && (function() {
try {
new Blob();
return true
} catch(e) {
return false
}
})(),
formData: 'FormData' in self,
arrayBuffer: 'ArrayBuffer' in self
}
function Body() {
this.bodyUsed = false
this._initBody = function(body) {
this._bodyInit = body
if (typeof body === 'string') {
this._bodyText = body
} else if (support.blob && Blob.prototype.isPrototypeOf(body)) {
this._bodyBlob = body
} else if (support.formData && FormData.prototype.isPrototypeOf(body)) {
this._bodyFormData = body
} else if (!body) {
this._bodyText = ''
} else if (support.arrayBuffer && ArrayBuffer.prototype.isPrototypeOf(body)) {
// Only support ArrayBuffers for POST method.
// Receiving ArrayBuffers happens via Blobs, instead.
} else {
throw new Error('unsupported BodyInit type')
}
if (!this.headers.get('content-type')) {
if (typeof body === 'string') {
this.headers.set('content-type', 'text/plain;charset=UTF-8')
} else if (this._bodyBlob && this._bodyBlob.type) {
this.headers.set('content-type', this._bodyBlob.type)
}
}
}
if (support.blob) {
this.blob = function() {
var rejected = consumed(this)
if (rejected) {
return rejected
}
if (this._bodyBlob) {
return Promise.resolve(this._bodyBlob)
} else if (this._bodyFormData) {
throw new Error('could not read FormData body as blob')
} else {
return Promise.resolve(new Blob([this._bodyText]))
}
}
this.arrayBuffer = function() {
return this.blob().then(readBlobAsArrayBuffer)
}
this.text = function() {
var rejected = consumed(this)
if (rejected) {
return rejected
}
if (this._bodyBlob) {
return readBlobAsText(this._bodyBlob)
} else if (this._bodyFormData) {
throw new Error('could not read FormData body as text')
} else {
return Promise.resolve(this._bodyText)
}
}
} else {
this.text = function() {
var rejected = consumed(this)
return rejected ? rejected : Promise.resolve(this._bodyText)
}
}
if (support.formData) {
this.formData = function() {
return this.text().then(decode)
}
}
this.json = function() {
return this.text().then(JSON.parse)
}
return this
}
// HTTP methods whose capitalization should be normalized
var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT']
function normalizeMethod(method) {
var upcased = method.toUpperCase()
return (methods.indexOf(upcased) > -1) ? upcased : method
}
function Request(input, options) {
options = options || {}
var body = options.body
if (Request.prototype.isPrototypeOf(input)) {
if (input.bodyUsed) {
throw new TypeError('Already read')
}
this.url = input.url
this.credentials = input.credentials
if (!options.headers) {
this.headers = new Headers(input.headers)
}
this.method = input.method
this.mode = input.mode
if (!body) {
body = input._bodyInit
input.bodyUsed = true
}
} else {
this.url = input
}
this.credentials = options.credentials || this.credentials || 'omit'
if (options.headers || !this.headers) {
this.headers = new Headers(options.headers)
}
this.method = normalizeMethod(options.method || this.method || 'GET')
this.mode = options.mode || this.mode || null
this.referrer = null
if ((this.method === 'GET' || this.method === 'HEAD') && body) {
throw new TypeError('Body not allowed for GET or HEAD requests')
}
this._initBody(body)
}
Request.prototype.clone = function() {
return new Request(this)
}
function decode(body) {
var form = new FormData()
body.trim().split('&').forEach(function(bytes) {
if (bytes) {
var split = bytes.split('=')
var name = split.shift().replace(/\+/g, ' ')
var value = split.join('=').replace(/\+/g, ' ')
form.append(decodeURIComponent(name), decodeURIComponent(value))
}
})
return form
}
function headers(xhr) {
var head = new Headers()
var pairs = xhr.getAllResponseHeaders().trim().split('\n')
pairs.forEach(function(header) {
var split = header.trim().split(':')
var key = split.shift().trim()
var value = split.join(':').trim()
head.append(key, value)
})
return head
}
Body.call(Request.prototype)
function Response(bodyInit, options) {
if (!options) {
options = {}
}
this.type = 'default'
this.status = options.status
this.ok = this.status >= 200 && this.status < 300
this.statusText = options.statusText
this.headers = options.headers instanceof Headers ? options.headers : new Headers(options.headers)
this.url = options.url || ''
this._initBody(bodyInit)
}
Body.call(Response.prototype)
Response.prototype.clone = function() {
return new Response(this._bodyInit, {
status: this.status,
statusText: this.statusText,
headers: new Headers(this.headers),
url: this.url
})
}
Response.error = function() {
var response = new Response(null, {status: 0, statusText: ''})
response.type = 'error'
return response
}
var redirectStatuses = [301, 302, 303, 307, 308]
Response.redirect = function(url, status) {
if (redirectStatuses.indexOf(status) === -1) {
throw new RangeError('Invalid status code')
}
return new Response(null, {status: status, headers: {location: url}})
}
self.Headers = Headers;
self.Request = Request;
self.Response = Response;
self.fetch = function(input, init) {
return new Promise(function(resolve, reject) {
var request
if (Request.prototype.isPrototypeOf(input) && !init) {
request = input
} else {
request = new Request(input, init)
}
var xhr = new XMLHttpRequest()
function responseURL() {
if ('responseURL' in xhr) {
return xhr.responseURL
}
// Avoid security warnings on getResponseHeader when not allowed by CORS
if (/^X-Request-URL:/m.test(xhr.getAllResponseHeaders())) {
return xhr.getResponseHeader('X-Request-URL')
}
return;
}
xhr.onload = function() {
var status = (xhr.status === 1223) ? 204 : xhr.status
if (status < 100 || status > 599) {
reject(new TypeError('Network request failed'))
return
}
var options = {
status: status,
statusText: xhr.statusText,
headers: headers(xhr),
url: responseURL()
}
var body = 'response' in xhr ? xhr.response : xhr.responseText;
resolve(new Response(body, options))
}
xhr.onerror = function() {
reject(new TypeError('Network request failed'))
}
xhr.open(request.method, request.url, true)
if (request.credentials === 'include') {
xhr.withCredentials = true
}
if ('responseType' in xhr && support.blob) {
xhr.responseType = 'blob'
}
request.headers.forEach(function(value, name) {
xhr.setRequestHeader(name, value)
})
xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit)
})
}
self.fetch.polyfill = true
})(typeof self !== 'undefined' ? self : this);

View file

@ -0,0 +1,69 @@
var feature = {
addEventListener : !!window.addEventListener,
querySelectorAll : !!document.querySelectorAll,
};
if(feature.addEventListener && feature.querySelectorAll) {
this.init();
}
function init() {
var keys = getKeys();
for(var i = 0; i < keys.length; i++) {
if(store.get(keys[i])) {
var formId = keys[i].split("~")[1];
document.getElementById(formId).value = store.get(keys[i]);
}
}
}
var timerId = window.setInterval(function() {
var saved = false;
var inputs = document.querySelectorAll('input[type=text], textarea');
for(var i = 0; i < inputs.length; i++) {
var key = getFormElement(inputs[i]).id + '~' + inputs[i].id;
if(store.get(key) !== inputs[i].value && inputs[i].value !== "") {
store.set(key, inputs[i].value);
saved = true;
}
}
if(saved === true) {
alertify.logPosition('top right');
alertify.success('Auto saved text');
}
}, 5000);
var forms = document.querySelectorAll('form');
for(var f = 0; f < forms.length; f++) {
var form = forms[f];
form.addEventListener('submit', function() {
window.clearInterval(timerId);
var formId = form.id;
var storedKeys = store.keys();
for(var i = 0; i < storedKeys.length; i++) {
if(storedKeys[i].indexOf(formId) > -1) {
store.remove(storedKeys[i]);
}
}
});
}
function getKeys() {
var keys = [];
var formFields = document.querySelectorAll('input[type=text], textarea');
for(var f = 0; f < formFields.length; f++) {
var parent = getFormElement(formFields[f]);
if(parent !== false) {
var key = parent.id + '~' + formFields[f].id;
keys.push(key);
}
}
return keys;
}
function getFormElement(elem) {
if(elem.nodeName.toLowerCase() !== 'body') {
var parent = elem.parentNode;
if(parent.nodeName.toLowerCase() === 'form') {
return parent;
} else {
return getFormElement(parent);
}
} else {
return false;
}
}

25
public/assets/js/links.js Normal file
View file

@ -0,0 +1,25 @@
//the autlinker object
var autolinker = new Autolinker();
//the youtube regex
var ytidregex = /watch\?v=([A-Za-z0-9\-_]+)/;
//grab the notes and loop through them
var notes = document.querySelectorAll('.e-content');
for(var i = 0; i < notes.length; i++) {
//get Youtube ID
var ytid = notes[i].textContent.match(ytidregex);
if(ytid !== null) {
var id = ytid[1];
var iframe = document.createElement('iframe');
iframe.classList.add('youtube');
iframe.setAttribute('src', '//www.youtube.com/embed/' + id);
iframe.setAttribute('frameborder', 0);
iframe.setAttribute('allowfullscreen', 'true');
notes[i].appendChild(iframe);
}
//now linkify everything
var orig = notes[i].innerHTML;
var linked = autolinker.link(orig);
notes[i].innerHTML = linked;
}

15
public/assets/js/maps.js Normal file
View file

@ -0,0 +1,15 @@
//This code runs on page load and looks for <div class="map">, then adds map
var mapDivs = document.querySelectorAll('.map');
for(var i = 0; i < mapDivs.length; i++) {
var mapDiv = mapDivs[i];
var latitude = mapDiv.dataset.latitude;
var longitude = mapDiv.dataset.longitude;
L.mapbox.accessToken = 'pk.eyJ1Ijoiam9ubnliYXJuZXMiLCJhIjoiVlpndW1EYyJ9.aP9fxAqLKh7lj0LpFh5k1w';
var map = L.mapbox.map(mapDiv, 'jonnybarnes.gnoihnim')
.setView([latitude, longitude], 15)
.addLayer(L.mapbox.tileLayer('jonnybarnes.gnoihnim', {
detectRetina: true,
}));
var marker = L.marker([latitude, longitude]).addTo(map);
map.scrollWheelZoom.disable();
}

6
public/assets/js/marked.min.js vendored Normal file

File diff suppressed because one or more lines are too long

284
public/assets/js/newnote.js Normal file
View file

@ -0,0 +1,284 @@
if ('geolocation' in navigator) {
var button = document.querySelector('#locate');
if (button.addEventListener) {
//if we have javascript, event listeners and geolocation, make the locate
//button clickable and add event
button.disabled = false;
button.addEventListener('click', getLocation);
}
}
function getLocation() {
navigator.geolocation.getCurrentPosition(function (position) {
//the locate button has been clicked so add the places/map
addPlaces(position.coords.latitude, position.coords.longitude);
});
}
function addPlaces(latitude, longitude) {
//get the nearby places
fetch('/places/near/' + latitude + '/' + longitude, {
credentials: 'same-origin',
method: 'get'
}).then(function (response) {
return response.json();
}).then(function (j) {
if (j.length > 0) {
var i;
var places = [];
for (i = 0; i < j.length; ++i) {
var latlng = parseLocation(j[i].location);
var name = j[i].name;
var slug = j[i].slug;
places.push([name, slug, latlng[0], latlng[1]]);
}
//add a map with the nearby places
addMap(latitude, longitude, places);
} else {
//add a map with just current location
addMap(latitude, longitude);
}
}).catch(function (err) {
console.log(err);
});
}
function addMap(latitude, longitude, places) {
//make places null if not supplied
if (arguments.length == 2) {
places = null;
}
var form = button.parentNode;
var div = document.createElement('div');
div.setAttribute('id', 'map');
//add the map div
form.appendChild(div);
L.mapbox.accessToken = 'pk.eyJ1Ijoiam9ubnliYXJuZXMiLCJhIjoiVlpndW1EYyJ9.aP9fxAqLKh7lj0LpFh5k1w';
var map = L.mapbox.map('map', 'jonnybarnes.gnoihnim')
.setView([latitude, longitude], 15)
.addLayer(L.mapbox.tileLayer('jonnybarnes.gnoihnim', {
detectRetina: true,
}));
//add a marker for the current location
var marker = L.marker([latitude, longitude], {
draggable: true,
}).addTo(map);
//when the location marker is dragged, if the new place form elements exist
//update the lat/lng values
marker.on('dragend', function () {
var placeFormLatitude = document.querySelector('#place-latitude');
if (placeFormLatitude !== null) {
placeFormLatitude.value = getLatitudeFromMapboxMarker(marker.getLatLng());
}
var placeFormLongitude = document.querySelector('#place-longitude');
if (placeFormLongitude !== null) {
placeFormLongitude.value = getLongitudeFromMapboxMarker(marker.getLatLng());
}
});
//create the <select> element and give it a no location default
var selectEl = document.createElement('select');
selectEl.setAttribute('name', 'location');
var noLocation = document.createElement('option');
noLocation.setAttribute('selected', 'selected');
noLocation.setAttribute('value', 'no-location');
noLocText = document.createTextNode('Select no location');
noLocation.appendChild(noLocText);
selectEl.appendChild(noLocation);
form.insertBefore(selectEl, div);
if (places !== null) {
//add the places both to the map and <select>
places.forEach(function (item, index, array) {
var option = document.createElement('option');
option.setAttribute('value', item[1]);
var text = document.createTextNode(item[0]);
option.appendChild(text);
option.dataset.latitude = item[2];
option.dataset.longitude = item[3];
selectEl.appendChild(option);
var placeMarker = L.marker([item[2], item[3]], {
icon: L.mapbox.marker.icon({
'marker-size': 'large',
'marker-symbol': 'building',
'marker-color': '#fa0'
})
}).addTo(map);
var name = 'Name: ' + item[0];
placeMarker.bindPopup(name, {
closeButton: true
});
placeMarker.on('click', function (e) {
map.panTo([item[2], item[3]]);
selectPlace(item[1]);
});
});
//add an event listener
selectEl.addEventListener('change', function () {
if (selectEl.value !== 'no-location') {
var placeLat = selectEl[selectEl.selectedIndex].dataset.latitude;
var placeLon = selectEl[selectEl.selectedIndex].dataset.longitude;
map.panTo([placeLat, placeLon]);
}
});
}
//add a button to add a new place
var newLocButton = document.createElement('button');
newLocButton.setAttribute('type', 'button');
newLocButton.setAttribute('id', 'create-new-place');
newLocButton.appendChild(document.createTextNode('Create New Place?'));
//the event listener
newLocButton.addEventListener('click', function() {
//add the form elements
var nameLabel = document.createElement('label');
nameLabel.setAttribute('for', 'place-name');
nameLabel.classList.add('place-label')
nameLabel.appendChild(document.createTextNode('Place Name:'));
var nameEl = document.createElement('input');
nameEl.setAttribute('placeholder', 'Name');
nameEl.setAttribute('name', 'place-name');
nameEl.setAttribute('id', 'place-name');
nameEl.setAttribute('type', 'text');
var descLabel = document.createElement('label');
descLabel.setAttribute('for', 'place-description');
descLabel.classList.add('place-label');
descLabel.appendChild(document.createTextNode('Place Description:'));
var descEl = document.createElement('input');
descEl.setAttribute('placeholder', 'Description');
descEl.setAttribute('name', 'place-description');
descEl.setAttribute('id', 'place-description');
descEl.setAttribute('type', 'text');
var latLabel = document.createElement('label');
latLabel.setAttribute('for', 'place-latitude');
latLabel.classList.add('place-label');
latLabel.appendChild(document.createTextNode('Place Latitude:'));
var latEl = document.createElement('input');
latEl.setAttribute('name', 'place-latitude');
latEl.setAttribute('id', 'place-latitude');
latEl.setAttribute('type', 'text');
latEl.value = getLatitudeFromMapboxMarker(marker.getLatLng());
var lonLabel = document.createElement('label');
lonLabel.setAttribute('for', 'place-longitude');
lonLabel.classList.add('place-label');
lonLabel.appendChild(document.createTextNode('Place Longitude:'));
var lonEl = document.createElement('input');
lonEl.setAttribute('name', 'place-longitude');
lonEl.setAttribute('id', 'place-longitude');
lonEl.setAttribute('type', 'text');
lonEl.value = getLongitudeFromMapboxMarker(marker.getLatLng());
var placeSubmit = document.createElement('button');
placeSubmit.setAttribute('id', 'place-submit');
placeSubmit.setAttribute('value', 'Submit New Place');
placeSubmit.setAttribute('name', 'place-submit');
placeSubmit.setAttribute('type', 'button');
placeSubmit.appendChild(document.createTextNode('Submit New Place'));
form.appendChild(nameLabel);
form.appendChild(nameEl);
form.appendChild(descLabel);
form.appendChild(descEl);
form.appendChild(latLabel);
form.appendChild(latEl);
form.appendChild(lonLabel);
form.appendChild(lonEl);
form.appendChild(placeSubmit);
//the event listener for the new place form
placeSubmit.addEventListener('click', function () {
//create the form data to send
var formData = new FormData();
formData.append('place-name', document.querySelector('#place-name').value);
formData.append('place-description', document.querySelector('#place-description').value);
formData.append('place-latitude', document.querySelector('#place-latitude').value);
formData.append('place-longitude', document.querySelector('#place-longitude').value);
//post the new place
fetch('/places/new', {
//send cookies with the request
credentials: 'same-origin',
method: 'post',
body: formData
})
.then(status)
.then(json)
.then(function (placeJson) {
//create the slug from the url
var urlParts = placeJson.split('/');
var slug = urlParts.pop();
//remove un-needed form elements
form.removeChild(document.querySelector('#place-name'));
form.removeChild(document.querySelector('#place-description'));
form.removeChild(document.querySelector('#place-latitude'));
form.removeChild(document.querySelector('#place-longitude'));
var labels = document.querySelectorAll('.place-label');
for (var label of labels) {
form.removeChild(label);
}
form.removeChild(document.querySelector('#place-submit'));
form.removeChild(document.querySelector('#create-new-place'));
//remove location marker
map.removeLayer(marker);
//add place marker
var newOption = document.createElement('option');
newOption.setAttribute('value', slug);
newOption.appendChild(document.createTextNode(placeJson['name']));
newOption.dataset.latitude = placeJson['latitude'];
newOption.dataset.longitude = placeJson['longitude'];
selectEl.appendChild(newOption);
var newPlaceMarker = L.marker([placeJson['latitude'], placeJson['longitude']], {
icon: L.mapbox.marker.icon({
'marker-size': 'large',
'marker-symbol': 'building',
'marker-color': '#fa0'
})
}).addTo(map);
var newName = 'Name: ' + placeJson['name'];
newPlaceMarker.bindPopup(newName, {
closeButton: true
});
newPlaceMarker.on('click', function (e) {
map.panTo([placeJson['latitude'], placeJson['longitude']]);
selectPlace(slug);
});
//make selected
selectPlace(slug);
}).catch(function (placeError) {
console.log(placeError);
});
})
});
form.insertBefore(newLocButton, div);
}
function parseLocation(point) {
var re = /\((.*)\)/;
var resultArray = re.exec(point);
var location = resultArray[1].split(' ');
return [location[1], location[0]];
}
function selectPlace(slug) {
document.querySelector('select [value=' + slug + ']').selected = true;
}
function getLatitudeFromMapboxMarker(latlng) {
var resultArray = /\((.*)\)/.exec(latlng);
var location = resultArray[1].split(' ');
return location[0].replace(',', '');
}
function getLongitudeFromMapboxMarker(latlng) {
var resultArray = /\((.*)\)/.exec(latlng);
var location = resultArray[1].split(' ');
return location[1];
}
function status(response) {
if (response.status >= 200 && response.status < 300) {
return Promise.resolve(response);
} else {
return Promise.reject(new Error(response.statusText));
}
}
function json(response) {
return response.json();
}

View file

@ -0,0 +1,45 @@
var button = document.querySelector('#locate');
if (button.addEventListener) {
button.addEventListener('click', getLocation);
} else {
button.attachEvent('onclick', getLocation);
}
function getLocation() {
if ('geolocation' in navigator) {
navigator.geolocation.getCurrentPosition(function(position) {
updateForm(position.coords.latitude, position.coords.longitude);
addMap(position.coords.latitude, position.coords.longitude);
});
} else {
console.log('I need to do something when geoloaction isnt available.');
}
}
function updateForm(latitude, longitude) {
var inputLatitude = document.querySelector('#latitude');
var inputLongitude = document.querySelector('#longitude');
inputLatitude.value = latitude;
inputLongitude.value = longitude;
}
function addMap(latitude, longitude) {
var form = document.querySelector('form');
var div = document.createElement('div');
div.setAttribute('id', 'map');
form.appendChild(div);
L.mapbox.accessToken = 'pk.eyJ1Ijoiam9ubnliYXJuZXMiLCJhIjoiVlpndW1EYyJ9.aP9fxAqLKh7lj0LpFh5k1w';
var map = L.mapbox.map('map', 'jonnybarnes.gnoihnim')
.setView([latitude, longitude], 15)
.addLayer(L.mapbox.tileLayer('jonnybarnes.gnoihnim', {
detectRetina: true,
}));
var marker = L.marker([latitude, longitude], {
draggable: true,
}).addTo(map);
marker.on('dragend', function () {
var markerLocation = marker.getLatLng();
updateForm(markerLocation.lat, markerLocation.lng);
});
}

15
public/assets/js/prism.js Normal file
View file

@ -0,0 +1,15 @@
/* http://prismjs.com/download.html?themes=prism-dark&languages=markup+css+clike+javascript+git+http+markdown+php+php-extras+scss+sql&plugins=line-numbers+show-invisibles */
var _self="undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{},Prism=function(){var e=/\blang(?:uage)?-(?!\*)(\w+)\b/i,t=_self.Prism={util:{encode:function(e){return e instanceof n?new n(e.type,t.util.encode(e.content),e.alias):"Array"===t.util.type(e)?e.map(t.util.encode):e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},type:function(e){return Object.prototype.toString.call(e).match(/\[object (\w+)\]/)[1]},clone:function(e){var n=t.util.type(e);switch(n){case"Object":var a={};for(var r in e)e.hasOwnProperty(r)&&(a[r]=t.util.clone(e[r]));return a;case"Array":return e.map&&e.map(function(e){return t.util.clone(e)})}return e}},languages:{extend:function(e,n){var a=t.util.clone(t.languages[e]);for(var r in n)a[r]=n[r];return a},insertBefore:function(e,n,a,r){r=r||t.languages;var i=r[e];if(2==arguments.length){a=arguments[1];for(var l in a)a.hasOwnProperty(l)&&(i[l]=a[l]);return i}var o={};for(var s in i)if(i.hasOwnProperty(s)){if(s==n)for(var l in a)a.hasOwnProperty(l)&&(o[l]=a[l]);o[s]=i[s]}return t.languages.DFS(t.languages,function(t,n){n===r[e]&&t!=e&&(this[t]=o)}),r[e]=o},DFS:function(e,n,a){for(var r in e)e.hasOwnProperty(r)&&(n.call(e,r,e[r],a||r),"Object"===t.util.type(e[r])?t.languages.DFS(e[r],n):"Array"===t.util.type(e[r])&&t.languages.DFS(e[r],n,r))}},highlightAll:function(e,n){for(var a,r=document.querySelectorAll('code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'),i=0;a=r[i++];)t.highlightElement(a,e===!0,n)},highlightElement:function(a,r,i){for(var l,o,s=a;s&&!e.test(s.className);)s=s.parentNode;s&&(l=(s.className.match(e)||[,""])[1],o=t.languages[l]),a.className=a.className.replace(e,"").replace(/\s+/g," ")+" language-"+l,s=a.parentNode,/pre/i.test(s.nodeName)&&(s.className=s.className.replace(e,"").replace(/\s+/g," ")+" language-"+l);var u=a.textContent,g={element:a,language:l,grammar:o,code:u};if(!u||!o)return t.hooks.run("complete",g),void 0;if(t.hooks.run("before-highlight",g),r&&_self.Worker){var c=new Worker(t.filename);c.onmessage=function(e){g.highlightedCode=n.stringify(JSON.parse(e.data),l),t.hooks.run("before-insert",g),g.element.innerHTML=g.highlightedCode,i&&i.call(g.element),t.hooks.run("after-highlight",g),t.hooks.run("complete",g)},c.postMessage(JSON.stringify({language:g.language,code:g.code}))}else g.highlightedCode=t.highlight(g.code,g.grammar,g.language),t.hooks.run("before-insert",g),g.element.innerHTML=g.highlightedCode,i&&i.call(a),t.hooks.run("after-highlight",g),t.hooks.run("complete",g)},highlight:function(e,a,r){var i=t.tokenize(e,a);return n.stringify(t.util.encode(i),r)},tokenize:function(e,n){var a=t.Token,r=[e],i=n.rest;if(i){for(var l in i)n[l]=i[l];delete n.rest}e:for(var l in n)if(n.hasOwnProperty(l)&&n[l]){var o=n[l];o="Array"===t.util.type(o)?o:[o];for(var s=0;s<o.length;++s){var u=o[s],g=u.inside,c=!!u.lookbehind,f=0,h=u.alias;u=u.pattern||u;for(var p=0;p<r.length;p++){var d=r[p];if(r.length>e.length)break e;if(!(d instanceof a)){u.lastIndex=0;var m=u.exec(d);if(m){c&&(f=m[1].length);var y=m.index-1+f,m=m[0].slice(f),v=m.length,k=y+v,b=d.slice(0,y+1),w=d.slice(k+1),N=[p,1];b&&N.push(b);var O=new a(l,g?t.tokenize(m,g):m,h);N.push(O),w&&N.push(w),Array.prototype.splice.apply(r,N)}}}}}return r},hooks:{all:{},add:function(e,n){var a=t.hooks.all;a[e]=a[e]||[],a[e].push(n)},run:function(e,n){var a=t.hooks.all[e];if(a&&a.length)for(var r,i=0;r=a[i++];)r(n)}}},n=t.Token=function(e,t,n){this.type=e,this.content=t,this.alias=n};if(n.stringify=function(e,a,r){if("string"==typeof e)return e;if("Array"===t.util.type(e))return e.map(function(t){return n.stringify(t,a,e)}).join("");var i={type:e.type,content:n.stringify(e.content,a,r),tag:"span",classes:["token",e.type],attributes:{},language:a,parent:r};if("comment"==i.type&&(i.attributes.spellcheck="true"),e.alias){var l="Array"===t.util.type(e.alias)?e.alias:[e.alias];Array.prototype.push.apply(i.classes,l)}t.hooks.run("wrap",i);var o="";for(var s in i.attributes)o+=s+'="'+(i.attributes[s]||"")+'"';return"<"+i.tag+' class="'+i.classes.join(" ")+'" '+o+">"+i.content+"</"+i.tag+">"},!_self.document)return _self.addEventListener?(_self.addEventListener("message",function(e){var n=JSON.parse(e.data),a=n.language,r=n.code;_self.postMessage(JSON.stringify(t.util.encode(t.tokenize(r,t.languages[a])))),_self.close()},!1),_self.Prism):_self.Prism;var a=document.getElementsByTagName("script");return a=a[a.length-1],a&&(t.filename=a.src,document.addEventListener&&!a.hasAttribute("data-manual")&&document.addEventListener("DOMContentLoaded",t.highlightAll)),_self.Prism}();"undefined"!=typeof module&&module.exports&&(module.exports=Prism);;
Prism.languages.markup={comment:/<!--[\w\W]*?-->/,prolog:/<\?[\w\W]+?\?>/,doctype:/<!DOCTYPE[\w\W]+?>/,cdata:/<!\[CDATA\[[\w\W]*?]]>/i,tag:{pattern:/<\/?[^\s>\/]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\\1|\\?(?!\1)[\w\W])*\1|[^\s'">=]+))?)*\s*\/?>/i,inside:{tag:{pattern:/^<\/?[^\s>\/]+/i,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"attr-value":{pattern:/=(?:('|")[\w\W]*?(\1)|[^\s>]+)/i,inside:{punctuation:/[=>"']/}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:/&#?[\da-z]{1,8};/i},Prism.hooks.add("wrap",function(t){"entity"===t.type&&(t.attributes.title=t.content.replace(/&amp;/,"&"))});;
Prism.languages.css={comment:/\/\*[\w\W]*?\*\//,atrule:{pattern:/@[\w-]+?.*?(;|(?=\s*\{))/i,inside:{rule:/@[\w-]+/}},url:/url\((?:(["'])(\\(?:\r\n|[\w\W])|(?!\1)[^\\\r\n])*\1|.*?)\)/i,selector:/[^\{\}\s][^\{\};]*?(?=\s*\{)/,string:/("|')(\\(?:\r\n|[\w\W])|(?!\1)[^\\\r\n])*\1/,property:/(\b|\B)[\w-]+(?=\s*:)/i,important:/\B!important\b/i,"function":/[-a-z0-9]+(?=\()/i,punctuation:/[(){};:]/},Prism.languages.css.atrule.inside.rest=Prism.util.clone(Prism.languages.css),Prism.languages.markup&&(Prism.languages.insertBefore("markup","tag",{style:{pattern:/<style[\w\W]*?>[\w\W]*?<\/style>/i,inside:{tag:{pattern:/<style[\w\W]*?>|<\/style>/i,inside:Prism.languages.markup.tag.inside},rest:Prism.languages.css},alias:"language-css"}}),Prism.languages.insertBefore("inside","attr-value",{"style-attr":{pattern:/\s*style=("|').*?\1/i,inside:{"attr-name":{pattern:/^\s*style/i,inside:Prism.languages.markup.tag.inside},punctuation:/^\s*=\s*['"]|['"]\s*$/,"attr-value":{pattern:/.+/i,inside:Prism.languages.css}},alias:"language-css"}},Prism.languages.markup.tag));;
Prism.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\w\W]*?\*\//,lookbehind:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0}],string:/("|')(\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,"class-name":{pattern:/((?:\b(?:class|interface|extends|implements|trait|instanceof|new)\s+)|(?:catch\s+\())[a-z0-9_\.\\]+/i,lookbehind:!0,inside:{punctuation:/(\.|\\)/}},keyword:/\b(if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/,"boolean":/\b(true|false)\b/,"function":/[a-z0-9_]+(?=\()/i,number:/\b-?(0x[\dA-Fa-f]+|\d*\.?\d+([Ee]-?\d+)?)\b/,operator:/[-+]{1,2}|!|<=?|>=?|={1,3}|&{1,2}|\|?\||\?|\*|\/|~|\^|%/,punctuation:/[{}[\];(),.:]/};;
Prism.languages.javascript=Prism.languages.extend("clike",{keyword:/\b(as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|false|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|true|try|typeof|var|void|while|with|yield)\b/,number:/\b-?(0x[\dA-Fa-f]+|0b[01]+|0o[0-7]+|\d*\.?\d+([Ee][+-]?\d+)?|NaN|Infinity)\b/,"function":/(?!\d)[a-z0-9_$]+(?=\()/i}),Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:/(^|[^/])\/(?!\/)(\[.+?]|\\.|[^/\\\r\n])+\/[gimyu]{0,5}(?=\s*($|[\r\n,.;})]))/,lookbehind:!0}}),Prism.languages.insertBefore("javascript","class-name",{"template-string":{pattern:/`(?:\\`|\\?[^`])*`/,inside:{interpolation:{pattern:/\$\{[^}]+\}/,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:Prism.languages.javascript}},string:/[\s\S]+/}}}),Prism.languages.markup&&Prism.languages.insertBefore("markup","tag",{script:{pattern:/<script[\w\W]*?>[\w\W]*?<\/script>/i,inside:{tag:{pattern:/<script[\w\W]*?>|<\/script>/i,inside:Prism.languages.markup.tag.inside},rest:Prism.languages.javascript},alias:"language-javascript"}});;
Prism.languages.git={comment:/^#.*$/m,string:/("|')(\\?.)*?\1/m,command:{pattern:/^.*\$ git .*$/m,inside:{parameter:/\s(--|-)\w+/m}},coord:/^@@.*@@$/m,deleted:/^-(?!-).+$/m,inserted:/^\+(?!\+).+$/m,commit_sha1:/^commit \w{40}$/m};;
Prism.languages.http={"request-line":{pattern:/^(POST|GET|PUT|DELETE|OPTIONS|PATCH|TRACE|CONNECT)\b\shttps?:\/\/\S+\sHTTP\/[0-9.]+/,inside:{property:/^\b(POST|GET|PUT|DELETE|OPTIONS|PATCH|TRACE|CONNECT)\b/,"attr-name":/:\w+/}},"response-status":{pattern:/^HTTP\/1.[01] [0-9]+.*/,inside:{property:/[0-9]+[A-Z\s-]+$/i}},keyword:/^[\w-]+:(?=.+)/m};var httpLanguages={"application/json":Prism.languages.javascript,"application/xml":Prism.languages.markup,"text/xml":Prism.languages.markup,"text/html":Prism.languages.markup};for(var contentType in httpLanguages)if(httpLanguages[contentType]){var options={};options[contentType]={pattern:new RegExp("(content-type:\\s*"+contentType+"[\\w\\W]*?)\\n\\n[\\w\\W]*","i"),lookbehind:!0,inside:{rest:httpLanguages[contentType]}},Prism.languages.insertBefore("http","keyword",options)};
Prism.languages.markdown=Prism.languages.extend("markup",{}),Prism.languages.insertBefore("markdown","prolog",{blockquote:{pattern:/(^|\n)>(?:[\t ]*>)*/,lookbehind:!0,alias:"punctuation"},code:[{pattern:/(^|\n)(?: {4}|\t).+/,lookbehind:!0,alias:"keyword"},{pattern:/``.+?``|`[^`\n]+`/,alias:"keyword"}],title:[{pattern:/\w+.*\n(?:==+|--+)/,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/((?:^|\n)\s*)#+.+/,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/((?:^|\n)\s*)([*-])([\t ]*\2){2,}(?=\s*(?:\n|$))/,lookbehind:!0,alias:"punctuation"},list:{pattern:/((?:^|\n)\s*)(?:[*+-]|\d+\.)(?=[\t ].)/,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:[^>]|\\>)+>)(?:[\t ]+(?:"(?:[^"]|\\")*"|'(?:[^']|\\')*'|\((?:[^)]|\\\))*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:[^"]|\\")*"|'(?:[^']|\\')*'|\((?:[^)]|\\\))*\))$/,punctuation:/[[\]\(\)<>:]/},alias:"url"},bold:{pattern:/(^|[^\\])(\*\*|__)(?:\n(?!\n)|.)+?\2/,lookbehind:!0,inside:{punctuation:/^\*\*|^__|\*\*\s*$|__\s*$/}},italic:{pattern:/(^|[^\\])(?:\*(?:\n(?!\n)|.)+?\*|_(?:\n(?!\n)|.)+?_)/,lookbehind:!0,inside:{punctuation:/^[*_]|[*_]$/}},url:{pattern:/!?\[[^\]]+\](?:\([^\s)]+(?:[\t ]+"(?:[^"]|\\")*")?\)| ?\[[^\]\n]*\])/,inside:{variable:{pattern:/(!?\[)[^\]]+(?=\]$)/,lookbehind:!0},string:{pattern:/"(?:[^"]|\\")*"(?=\)$)/}}}}),Prism.languages.markdown.bold.inside.url=Prism.util.clone(Prism.languages.markdown.url),Prism.languages.markdown.italic.inside.url=Prism.util.clone(Prism.languages.markdown.url),Prism.languages.markdown.bold.inside.italic=Prism.util.clone(Prism.languages.markdown.italic),Prism.languages.markdown.italic.inside.bold=Prism.util.clone(Prism.languages.markdown.bold);;
Prism.languages.php=Prism.languages.extend("clike",{keyword:/\b(and|or|xor|array|as|break|case|cfunction|class|const|continue|declare|default|die|do|else|elseif|enddeclare|endfor|endforeach|endif|endswitch|endwhile|extends|for|foreach|function|include|include_once|global|if|new|return|static|switch|use|require|require_once|var|while|abstract|interface|public|implements|private|protected|parent|throw|null|echo|print|trait|namespace|final|yield|goto|instanceof|finally|try|catch)\b/i,constant:/\b[A-Z0-9_]{2,}\b/,comment:{pattern:/(^|[^\\])(\/\*[\w\W]*?\*\/|(^|[^:])(\/\/).*?(\r?\n|$))/,lookbehind:!0}}),Prism.languages.insertBefore("php","class-name",{"shell-comment":{pattern:/(^|[^\\])#.*?(\r?\n|$)/,lookbehind:!0,alias:"comment"}}),Prism.languages.insertBefore("php","keyword",{delimiter:/(\?>|<\?php|<\?)/i,variable:/(\$\w+)\b/i,"package":{pattern:/(\\|namespace\s+|use\s+)[\w\\]+/,lookbehind:!0,inside:{punctuation:/\\/}}}),Prism.languages.insertBefore("php","operator",{property:{pattern:/(->)[\w]+/,lookbehind:!0}}),Prism.languages.markup&&(Prism.hooks.add("before-highlight",function(e){"php"===e.language&&(e.tokenStack=[],e.backupCode=e.code,e.code=e.code.replace(/(?:<\?php|<\?)[\w\W]*?(?:\?>)/gi,function(n){return e.tokenStack.push(n),"{{{PHP"+e.tokenStack.length+"}}}"}))}),Prism.hooks.add("before-insert",function(e){"php"===e.language&&(e.code=e.backupCode,delete e.backupCode)}),Prism.hooks.add("after-highlight",function(e){if("php"===e.language){for(var n,a=0;n=e.tokenStack[a];a++)e.highlightedCode=e.highlightedCode.replace("{{{PHP"+(a+1)+"}}}",Prism.highlight(n,e.grammar,"php"));e.element.innerHTML=e.highlightedCode}}),Prism.hooks.add("wrap",function(e){"php"===e.language&&"markup"===e.type&&(e.content=e.content.replace(/(\{\{\{PHP[0-9]+\}\}\})/g,'<span class="token php">$1</span>'))}),Prism.languages.insertBefore("php","comment",{markup:{pattern:/<[^?]\/?(.*?)>/,inside:Prism.languages.markup},php:/\{\{\{PHP[0-9]+\}\}\}/}));;
Prism.languages.insertBefore("php","variable",{"this":/\$this/,global:/\$_?(GLOBALS|SERVER|GET|POST|FILES|REQUEST|SESSION|ENV|COOKIE|HTTP_RAW_POST_DATA|argc|argv|php_errormsg|http_response_header)/,scope:{pattern:/\b[\w\\]+::/,inside:{keyword:/(static|self|parent)/,punctuation:/(::|\\)/}}});;
Prism.languages.scss=Prism.languages.extend("css",{comment:{pattern:/(^|[^\\])(\/\*[\w\W]*?\*\/|\/\/.*?(\r?\n|$))/,lookbehind:!0},atrule:{pattern:/@[\w-]+(?:\([^()]+\)|[^(])*?(?=\s+(\{|;))/i,inside:{rule:/@[\w-]+/}},url:/([-a-z]+-)*url(?=\()/i,selector:{pattern:/([^@;\{\}\(\)]?([^@;\{\}\(\)]|&|#\{\$[-_\w]+\})+)(?=\s*\{(\}|\s|[^\}]+(:|\{)[^\}]+))/m,inside:{placeholder:/%[-_\w]+/i}}}),Prism.languages.insertBefore("scss","atrule",{keyword:/@(if|else if|else|for|each|while|import|extend|debug|warn|mixin|include|function|return|content)|(?=@for\s+\$[-_\w]+\s)+from/i}),Prism.languages.insertBefore("scss","property",{variable:/((\$[-_\w]+)|(#\{\$[-_\w]+\}))/i}),Prism.languages.insertBefore("scss","function",{placeholder:{pattern:/%[-_\w]+/i,alias:"selector"},statement:/\B!(default|optional)\b/i,"boolean":/\b(true|false)\b/,"null":/\b(null)\b/,operator:/\s+([-+]{1,2}|={1,2}|!=|\|?\||\?|\*|\/|%)\s+/}),Prism.languages.scss.atrule.inside.rest=Prism.util.clone(Prism.languages.scss);;
Prism.languages.sql={comment:{pattern:/(^|[^\\])(\/\*[\w\W]*?\*\/|((--)|(\/\/)|#).*?(\r?\n|$))/,lookbehind:!0},string:{pattern:/(^|[^@])("|')(\\?[\s\S])*?\2/,lookbehind:!0},variable:/@[\w.$]+|@("|'|`)(\\?[\s\S])+?\1/,"function":/\b(?:COUNT|SUM|AVG|MIN|MAX|FIRST|LAST|UCASE|LCASE|MID|LEN|ROUND|NOW|FORMAT)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALTER|ANALYZE|APPLY|AS|ASC|AUTHORIZATION|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADE|CASCADED|CASE|CHAIN|CHAR VARYING|CHARACTER VARYING|CHECK|CHECKPOINT|CLOSE|CLUSTERED|COALESCE|COLUMN|COLUMNS|COMMENT|COMMIT|COMMITTED|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS|CONTAINSTABLE|CONTINUE|CONVERT|CREATE|CROSS|CURRENT|CURRENT_DATE|CURRENT_TIME|CURRENT_TIMESTAMP|CURRENT_USER|CURSOR|DATA|DATABASE|DATABASES|DATETIME|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DOUBLE PRECISION|DROP|DUMMY|DUMP|DUMPFILE|DUPLICATE KEY|ELSE|ENABLE|ENCLOSED BY|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPE|ESCAPED BY|EXCEPT|EXEC|EXECUTE|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR|FOR EACH ROW|FORCE|FOREIGN|FREETEXT|FREETEXTTABLE|FROM|FULL|FUNCTION|GEOMETRY|GEOMETRYCOLLECTION|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|IDENTITY|IDENTITY_INSERT|IDENTITYCOL|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTO|INVOKER|ISOLATION LEVEL|JOIN|KEY|KEYS|KILL|LANGUAGE SQL|LAST|LEFT|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONGBLOB|LONGTEXT|MATCH|MATCHED|MEDIUMBLOB|MEDIUMINT|MEDIUMTEXT|MERGE|MIDDLEINT|MODIFIES SQL DATA|MODIFY|MULTILINESTRING|MULTIPOINT|MULTIPOLYGON|NATIONAL|NATIONAL CHAR VARYING|NATIONAL CHARACTER|NATIONAL CHARACTER VARYING|NATIONAL VARCHAR|NATURAL|NCHAR|NCHAR VARCHAR|NEXT|NO|NO SQL|NOCHECK|NOCYCLE|NONCLUSTERED|NULLIF|NUMERIC|OF|OFF|OFFSETS|ON|OPEN|OPENDATASOURCE|OPENQUERY|OPENROWSET|OPTIMIZE|OPTION|OPTIONALLY|ORDER|OUT|OUTER|OUTFILE|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREV|PRIMARY|PRINT|PRIVILEGES|PROC|PROCEDURE|PUBLIC|PURGE|QUICK|RAISERROR|READ|READS SQL DATA|READTEXT|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEATABLE|REPLICATION|REQUIRE|RESTORE|RESTRICT|RETURN|RETURNS|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROWCOUNT|ROWGUIDCOL|ROWS?|RTREE|RULE|SAVE|SAVEPOINT|SCHEMA|SELECT|SERIAL|SERIALIZABLE|SESSION|SESSION_USER|SET|SETUSER|SHARE MODE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|START|STARTING BY|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLE|TABLES|TABLESPACE|TEMP(?:ORARY)?|TEMPTABLE|TERMINATED BY|TEXT|TEXTSIZE|THEN|TIMESTAMP|TINYBLOB|TINYINT|TINYTEXT|TO|TOP|TRAN|TRANSACTION|TRANSACTIONS|TRIGGER|TRUNCATE|TSEQUAL|TYPE|TYPES|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNPIVOT|UPDATE|UPDATETEXT|USAGE|USE|USER|USING|VALUE|VALUES|VARBINARY|VARCHAR|VARCHARACTER|VARYING|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH|WITH ROLLUP|WITHIN|WORK|WRITE|WRITETEXT)\b/i,"boolean":/\b(?:TRUE|FALSE|NULL)\b/i,number:/\b-?(0x)?\d*\.?[\da-f]+\b/,operator:/\b(?:ALL|AND|ANY|BETWEEN|EXISTS|IN|LIKE|NOT|OR|IS|UNIQUE|CHARACTER SET|COLLATE|DIV|OFFSET|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b|[-+]|!|[=<>]{1,2}|(&){1,2}|\|?\||\?|\*|\//i,punctuation:/[;[\]()`,.]/};;
Prism.hooks.add("complete",function(e){if(e.code){var t=e.element.parentNode,s=/\s*\bline-numbers\b\s*/;if(t&&/pre/i.test(t.nodeName)&&(s.test(t.className)||s.test(e.element.className))&&!e.element.querySelector(".line-numbers-rows")){s.test(e.element.className)&&(e.element.className=e.element.className.replace(s,"")),s.test(t.className)||(t.className+=" line-numbers");var a,n=e.code.match(/\n(?!$)/g).length+1,l=new Array(n+1);l=l.join("<span></span>"),a=document.createElement("span"),a.className="line-numbers-rows",a.innerHTML=l,t.hasAttribute("data-start")&&(t.style.counterReset="linenumber "+(parseInt(t.getAttribute("data-start"),10)-1)),e.element.appendChild(a)}}});;
!function(){if(window.Prism)for(var r in Prism.languages){var g=Prism.languages[r];g.tab=/\t/g,g.crlf=/\r\n/g,g.lf=/\n/g,g.cr=/\r/g}}();;

5
public/assets/js/store2.min.js vendored Normal file
View file

@ -0,0 +1,5 @@
/*! store2 - v2.3.2 - 2015-10-27
* Copyright (c) 2015 Nathan Bubna; Licensed MIT, GPL */
!function(a,b){var c={version:"2.3.2",areas:{},apis:{},inherit:function(a,b){for(var c in a)b.hasOwnProperty(c)||(b[c]=a[c]);return b},stringify:function(a){return void 0===a||"function"==typeof a?a+"":JSON.stringify(a)},parse:function(a){try{return JSON.parse(a)}catch(b){return a}},fn:function(a,b){c.storeAPI[a]=b;for(var d in c.apis)c.apis[d][a]=b},get:function(a,b){return a.getItem(b)},set:function(a,b,c){a.setItem(b,c)},remove:function(a,b){a.removeItem(b)},key:function(a,b){return a.key(b)},length:function(a){return a.length},clear:function(a){a.clear()},Store:function(a,b,d){var e=c.inherit(c.storeAPI,function(a,b,c){return 0===arguments.length?e.getAll():void 0!==b?e.set(a,b,c):"string"==typeof a||"number"==typeof a?e.get(a):a?e.setAll(a,b):e.clear()});e._id=a;try{var f="_safariPrivate_";b.setItem(f,"sucks"),e._area=b,b.removeItem(f)}catch(g){}return e._area||(e._area=c.inherit(c.storageAPI,{items:{},name:"fake"})),e._ns=d||"",c.areas[a]||(c.areas[a]=e._area),c.apis[e._ns+e._id]||(c.apis[e._ns+e._id]=e),e},storeAPI:{area:function(a,b){var d=this[a];return d&&d.area||(d=c.Store(a,b,this._ns),this[a]||(this[a]=d)),d},namespace:function(a,b){if(!a)return this._ns?this._ns.substring(0,this._ns.length-1):"";var d=a,e=this[d];return e&&e.namespace||(e=c.Store(this._id,this._area,this._ns+d+"."),this[d]||(this[d]=e),b||e.area("session",c.areas.session)),e},isFake:function(){return"fake"===this._area.name},toString:function(){return"store"+(this._ns?"."+this.namespace():"")+"["+this._id+"]"},has:function(a){return this._area.has?this._area.has(this._in(a)):!!(this._in(a)in this._area)},size:function(){return this.keys().length},each:function(a,b){for(var d=0,e=c.length(this._area);e>d;d++){var f=this._out(c.key(this._area,d));if(void 0!==f&&a.call(this,f,b||this.get(f))===!1)break;e>c.length(this._area)&&(e--,d--)}return b||this},keys:function(){return this.each(function(a,b){b.push(a)},[])},get:function(a,b){var d=c.get(this._area,this._in(a));return null!==d?c.parse(d):b||d},getAll:function(){return this.each(function(a,b){b[a]=this.get(a)},{})},set:function(a,b,d){var e=this.get(a);return null!=e&&d===!1?b:c.set(this._area,this._in(a),c.stringify(b),d)||e},setAll:function(a,b){var c,d;for(var e in a)d=a[e],this.set(e,d,b)!==d&&(c=!0);return c},remove:function(a){var b=this.get(a);return c.remove(this._area,this._in(a)),b},clear:function(){return this._ns?this.each(function(a){c.remove(this._area,this._in(a))},1):c.clear(this._area),this},clearAll:function(){var a=this._area;for(var b in c.areas)c.areas.hasOwnProperty(b)&&(this._area=c.areas[b],this.clear());return this._area=a,this},_in:function(a){return"string"!=typeof a&&(a=c.stringify(a)),this._ns?this._ns+a:a},_out:function(a){return this._ns?a&&0===a.indexOf(this._ns)?a.substring(this._ns.length):void 0:a}},storageAPI:{length:0,has:function(a){return this.items.hasOwnProperty(a)},key:function(a){var b=0;for(var c in this.items)if(this.has(c)&&a===b++)return c},setItem:function(a,b){this.has(a)||this.length++,this.items[a]=b},removeItem:function(a){this.has(a)&&(delete this.items[a],this.length--)},getItem:function(a){return this.has(a)?this.items[a]:null},clear:function(){for(var a in this.list)this.removeItem(a)},toString:function(){return this.length+" items in "+this.name+"Storage"}}};a.store&&(c.conflict=a.store);var d=c.Store("local",function(){try{return localStorage}catch(a){}}());d.local=d,d._=c,d.area("session",function(){try{return sessionStorage}catch(a){}}()),a.store=d,"function"==typeof b&&void 0!==b.amd?b(function(){return d}):"undefined"!=typeof module&&module.exports&&(module.exports=d)}(this,this.define);
//# sourceMappingURL=store2.min.js.map

View file

@ -0,0 +1,19 @@
{
"RbrS": "https://jonnybarnes.net/note/1",
"pfua": "https://jonnybarnes.net/note/2",
"HQ8X": "https://jonnybarnes.net/note/3",
"7Duc": "https://jonnybarnes.net/note/4",
"m0vZ": "https://jonnybarnes.net/note/5",
"uB95": "https://jonnybarnes.net/note/6",
"yUx8": "https://jonnybarnes.net/note/7",
"tMLB": "https://jonnybarnes.net/note/8",
"a1HU": "https://jonnybarnes.net/note/9",
"rx3e": "https://jonnybarnes.net/note/10",
"dW3p": "https://jonnybarnes.net/note/11",
"_6za": "https://jonnybarnes.net/note/12",
"eTvB": "https://jonnybarnes.net/note/13",
"6kMh": "https://jonnybarnes.net/note/14",
"T72f": "https://jonnybarnes.net/note/15",
"enot": "https://jonnybarnes.net/note/16",
"QCDv": "https://jonnybarnes.net/note/17"
}

View file

@ -0,0 +1,3 @@
*
!.gitignore
!default-image

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 KiB

View file

@ -0,0 +1 @@
.alertify-logs>*{padding:12px 24px;color:#fff;box-shadow:0 2px 5px 0 rgba(0,0,0,.2);border-radius:1px}.alertify-logs>*,.alertify-logs>.default{background:rgba(0,0,0,.8)}.alertify-logs>.error{background:rgba(244,67,54,.8)}.alertify-logs>.success{background:rgba(76,175,80,.9)}.alertify{position:fixed;background-color:rgba(0,0,0,.3);left:0;right:0;top:0;bottom:0;width:100%;height:100%;z-index:2}.alertify.hide{opacity:0;pointer-events:none}.alertify,.alertify.show{box-sizing:border-box;transition:all .33s cubic-bezier(.25,.8,.25,1)}.alertify,.alertify *{box-sizing:border-box}.alertify .dialog{padding:12px}.alertify .alert,.alertify .dialog{width:100%;margin:0 auto;position:relative;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%)}.alertify .alert>*,.alertify .dialog>*{width:400px;max-width:95%;margin:0 auto;text-align:center;padding:12px;background:#fff;box-shadow:0 2px 4px -1px rgba(0,0,0,.14),0 4px 5px 0 rgba(0,0,0,.098),0 1px 10px 0 rgba(0,0,0,.084)}.alertify .alert .msg,.alertify .dialog .msg{padding:12px;margin-bottom:12px;margin:0;text-align:left}.alertify .alert input:not(.form-control),.alertify .dialog input:not(.form-control){margin-bottom:15px;width:100%;font-size:100%;padding:12px}.alertify .alert input:not(.form-control):focus,.alertify .dialog input:not(.form-control):focus{outline-offset:-2px}.alertify .alert nav,.alertify .dialog nav{text-align:right}.alertify .alert nav button:not(.btn):not(.pure-button):not(.md-button):not(.mdl-button),.alertify .dialog nav button:not(.btn):not(.pure-button):not(.md-button):not(.mdl-button){background:transparent;box-sizing:border-box;color:rgba(0,0,0,.87);position:relative;outline:0;border:0;display:inline-block;-webkit-align-items:center;-ms-flex-align:center;-ms-grid-row-align:center;align-items:center;padding:0 6px;margin:6px 8px;line-height:36px;min-height:36px;white-space:nowrap;min-width:88px;text-align:center;text-transform:uppercase;font-size:14px;text-decoration:none;cursor:pointer;border:1px solid transparent;border-radius:2px}.alertify .alert nav button:not(.btn):not(.pure-button):not(.md-button):not(.mdl-button):active,.alertify .alert nav button:not(.btn):not(.pure-button):not(.md-button):not(.mdl-button):hover,.alertify .dialog nav button:not(.btn):not(.pure-button):not(.md-button):not(.mdl-button):active,.alertify .dialog nav button:not(.btn):not(.pure-button):not(.md-button):not(.mdl-button):hover{background-color:rgba(0,0,0,.05)}.alertify .alert nav button:not(.btn):not(.pure-button):not(.md-button):not(.mdl-button):focus,.alertify .dialog nav button:not(.btn):not(.pure-button):not(.md-button):not(.mdl-button):focus{border:1px solid rgba(0,0,0,.1)}.alertify .alert nav button.btn,.alertify .dialog nav button.btn{margin:6px 4px}.alertify-logs{position:fixed;z-index:1}.alertify-logs.bottom,.alertify-logs:not(.top){bottom:16px}.alertify-logs.left,.alertify-logs:not(.right){left:16px}.alertify-logs.left>*,.alertify-logs:not(.right)>*{float:left;-webkit-transform:translateZ(0);transform:translateZ(0);height:auto}.alertify-logs.left>.show,.alertify-logs:not(.right)>.show{left:0}.alertify-logs.left>*,.alertify-logs.left>.hide,.alertify-logs:not(.right)>*,.alertify-logs:not(.right)>.hide{left:-110%}.alertify-logs.right{right:16px}.alertify-logs.right>*{float:right;-webkit-transform:translateZ(0);transform:translateZ(0)}.alertify-logs.right>.show{right:0;opacity:1}.alertify-logs.right>*,.alertify-logs.right>.hide{right:-110%;opacity:0}.alertify-logs.top{top:0}.alertify-logs>*{box-sizing:border-box;transition:all .4s cubic-bezier(.25,.8,.25,1);position:relative;clear:both;-webkit-backface-visibility:hidden;backface-visibility:hidden;-webkit-perspective:1000;perspective:1000;max-height:0;margin:0;padding:0;overflow:hidden;opacity:0;pointer-events:none}.alertify-logs>.show{margin-top:12px;opacity:1;max-height:1000px;padding:12px;pointer-events:auto}

Binary file not shown.

Binary file not shown.

View file

@ -0,0 +1,243 @@
html {
background: url("/assets/img/escheresque.png"); }
.map {
height: 150px; }
html {
box-sizing: border-box; }
*, *:before, *:after {
box-sizing: inherit; }
#topheader {
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-flex-flow: row;
-ms-flex-flow: row;
flex-flow: row; }
#topheader a {
padding: 0.5em 1em; }
nav {
padding-top: 0.5em; }
.social-list {
padding-left: 2em; }
.note {
background-color: #eee8d5;
box-shadow: 0 0 10px 2px #93a1a1;
padding: 0.5em 0.5em;
margin-top: 1em; }
.note:after {
content: " ";
display: block;
height: 0;
clear: both; }
.note a {
word-wrap: break-word; }
.note .e-content p:first-child {
margin-top: 0; }
.note-metadata {
width: 100%; }
.social-links {
float: right; }
.social-links a {
text-decoration: none; }
.icon {
width: auto;
height: 1em;
fill: #268bd2; }
.reply {
margin-left: 2em;
margin-right: 2em;
font-size: 0.8em;
padding: 0.5em 0.5em; }
.reply-to {
margin-left: 2em;
margin-right: 2em;
font-size: 0.8em;
padding-top: 2em; }
.reply-to + .note {
margin-top: 0.3em; }
.mini-h-card {
border-radius: 2px;
border: 1px solid #586e75;
padding: 0 0.2em;
text-decoration: none;
margin-right: 5px;
white-space: nowrap; }
.mini-h-card img {
height: 1.26em;
display: inline;
border-radius: 2px;
vertical-align: text-bottom; }
.like-photo {
height: 1.26em; }
.reply .e-content {
margin-top: 0.5em;
padding-left: 0.5em; }
.notes-subtitle {
font-size: 1em; }
.note-photo {
width: 100%;
height: auto;
image-orientation: from-image; }
article header {
margin-top: 0.5em;
margin-bottom: 0.8em; }
.post-info {
font-size: 0.8em;
font-style: italic;
margin-top: -0.8em; }
.contact {
position: relative; }
.contact-links {
list-style-type: none; }
.contact img {
height: auto;
width: 2em;
position: absolute;
top: 0;
left: 0; }
.contact-info {
margin-left: 2em; }
#map {
height: 300px; }
/* media queries */
@media (min-width: 700px) {
main {
margin-left: 10em;
margin-right: 10em; }
footer {
margin-left: 13em;
margin-right: 13em; }
.youtube {
width: 640px;
height: 360px; } }
@media (max-width: 699px) {
main {
margin-left: 10px;
margin-right: 10px; }
article {
word-wrap: break-word; }
footer {
margin-left: 15px;
margin-right: 15px; }
.youtube {
width: 100%;
height: auto; } }
body {
text-rendering: optimizeLegibility;
-webkit-font-feature-settings: "liga";
font-feature-settings: "liga";
font-family: "leitura-news", serif;
font-size: 1.2em; }
#topheader h1 {
font-family: "leitura-news", serif; }
h1 {
font-family: "prenton", sans-serif; }
#topheader a {
text-decoration: none; }
nav {
-webkit-font-feature-settings: "dlig";
font-feature-settings: "dlig"; }
article header h1 a {
text-decoration: none; }
article div a {
text-decoration: none; }
footer {
font-size: 0.8em; }
.emoji {
width: auto;
height: 1em; }
body {
color: #002b36; }
header a {
color: #002b36; }
a {
color: #268bd2; }
form {
width: 100%; }
fieldset {
min-width: 0;
width: 100%; }
input[type="text"], input[type="file"], textarea {
width: 100%; }
input, button, textarea {
-webkit-appearance: none;
-moz-appearance: none;
background-color: #002b36;
color: #fdf6e3;
border: 1px solid #fdf6e3;
border-radius: 4px; }
button:hover {
transition: 0.5s ease-in-out;
background-color: #fdf6e3;
color: #002b36; }
button:disabled {
background-color: #93a1a1;
color: #002b36; }
input[type="checkbox"] {
-webkit-appearance: checkbox;
-moz-appearance: checkbox; }
#photo {
background: inherit;
color: inherit;
border: none; }
.twitter-tweet-rendered {
margin-bottom: 0 !important; }
.twitter-tweet-rendered + .note {
margin-top: 0; }
/*# sourceMappingURL=global.css.map */

Binary file not shown.

Binary file not shown.

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,188 @@
/* http://prismjs.com/download.html?themes=prism-dark&languages=markup+css+clike+javascript+git+http+markdown+php+php-extras+scss+sql&plugins=line-numbers+show-invisibles */
/**
* prism.js Dark theme for JavaScript, CSS and HTML
* Based on the slides of the talk /Reg(exp){2}lained/
* @author Lea Verou
*/
code[class*="language-"],
pre[class*="language-"] {
color: white;
text-shadow: 0 -.1em .2em black;
font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
direction: ltr;
text-align: left;
white-space: pre;
word-spacing: normal;
word-break: normal;
line-height: 1.5;
-moz-tab-size: 4;
-o-tab-size: 4;
tab-size: 4;
-webkit-hyphens: none;
-moz-hyphens: none;
-ms-hyphens: none;
hyphens: none;
}
@media print {
code[class*="language-"],
pre[class*="language-"] {
text-shadow: none;
}
}
pre[class*="language-"],
:not(pre) > code[class*="language-"] {
background: hsl(30, 20%, 25%);
}
/* Code blocks */
pre[class*="language-"] {
padding: 1em;
margin: .5em 0;
overflow: auto;
border: .3em solid hsl(30, 20%, 40%);
border-radius: .5em;
box-shadow: 1px 1px .5em black inset;
}
/* Inline code */
:not(pre) > code[class*="language-"] {
padding: .15em .2em .05em;
border-radius: .3em;
border: .13em solid hsl(30, 20%, 40%);
box-shadow: 1px 1px .3em -.1em black inset;
}
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
color: hsl(30, 20%, 50%);
}
.token.punctuation {
opacity: .7;
}
.namespace {
opacity: .7;
}
.token.property,
.token.tag,
.token.boolean,
.token.number,
.token.constant,
.token.symbol {
color: hsl(350, 40%, 70%);
}
.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
color: hsl(75, 70%, 60%);
}
.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string,
.token.variable {
color: hsl(40, 90%, 60%);
}
.token.atrule,
.token.attr-value,
.token.keyword {
color: hsl(350, 40%, 70%);
}
.token.regex,
.token.important {
color: #e90;
}
.token.important,
.token.bold {
font-weight: bold;
}
.token.italic {
font-style: italic;
}
.token.entity {
cursor: help;
}
.token.deleted {
color: red;
}
pre.line-numbers {
position: relative;
padding-left: 3.8em;
counter-reset: linenumber;
}
pre.line-numbers > code {
position: relative;
}
.line-numbers .line-numbers-rows {
position: absolute;
pointer-events: none;
top: 0;
font-size: 100%;
left: -3.8em;
width: 3em; /* works for line-numbers below 1000 lines */
letter-spacing: -1px;
border-right: 1px solid #999;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.line-numbers-rows > span {
pointer-events: none;
display: block;
counter-increment: linenumber;
}
.line-numbers-rows > span:before {
content: counter(linenumber);
color: #999;
display: block;
padding-right: 0.8em;
text-align: right;
}
.token.tab:not(:empty):before,
.token.cr:before,
.token.lf:before {
color: hsl(24, 20%, 85%);
}
.token.tab:not(:empty):before {
content: '\21E5';
}
.token.cr:before {
content: '\240D';
}
.token.crlf:before {
content: '\240D\240A';
}
.token.lf:before {
content: '\240A';
}

Binary file not shown.

Binary file not shown.

View file

@ -0,0 +1,10 @@
#projects {
padding-left: 33.33%;
}
h3 {
float: left;
width: 45%;
margin: 0 5% 0 -50%;
text-align: right;
}

Binary file not shown.

Binary file not shown.

View file

@ -0,0 +1,2 @@
/*! sanitize.css v3.2.0 | CC0 1.0 Public Domain | github.com/10up/sanitize.css */audio:not([controls]){display:none}button{-webkit-appearance:button;overflow:visible}details{display:block}html{-ms-overflow-style:-ms-autohiding-scrollbar;overflow-y:scroll;-webkit-text-size-adjust:100%}input{-webkit-border-radius:0}input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button}input[type=number]{width:auto}input[type=search]{-webkit-appearance:textfield}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}main{display:block}pre{overflow:auto}progress{display:inline-block}small{font-size:75%}summary{display:block}svg:not(:root){overflow:hidden}template{display:none}textarea{overflow:auto}[hidden]{display:none}*,:after,:before{box-sizing:inherit}*{font-size:inherit;line-height:inherit}:after,:before{text-decoration:inherit;vertical-align:inherit}*,:after,:before{border-style:solid;border-width:0}*{background-repeat:no-repeat;margin:0;padding:0}:root{background-color:#fff;box-sizing:border-box;color:#000;cursor:default;font:100%/1.5 sans-serif}a{text-decoration:none}audio,canvas,iframe,img,svg,video{vertical-align:middle}button,input,select,textarea{background-color:transparent;color:inherit;font-family:inherit;font-style:inherit;font-weight:inherit}[type=button],[type=date],[type=datetime-local],[type=datetime],[type=email],[type=month],[type=number],[type=password],[type=reset],[type=search],[type=submit],[type=tel],[type=text],[type=time],[type=url],[type=week],button,select,textarea{min-height:1.5em}code,kbd,pre,samp{font-family:monospace}nav ol,nav ul{list-style:none}select{-moz-appearance:none;-webkit-appearance:none}select::-ms-expand{display:none}select::-ms-value{color:currentColor}table{border-collapse:collapse;border-spacing:0}textarea{resize:vertical}::-moz-selection{background-color:#b3d4fc;color:#fff;text-shadow:none}::selection{background-color:#b3d4fc;color:#fff;text-shadow:none}[aria-busy=true]{cursor:progress}[aria-controls]{cursor:pointer}[aria-disabled]{cursor:default}[hidden][aria-hidden=false]{clip:rect(0 0 0 0);display:inherit;position:absolute}[hidden][aria-hidden=false]:focus{clip:auto}[tabindex],a,area,button,input,label,select,textarea{-ms-touch-action:manipulation;touch-action:manipulation}
/*# sourceMappingURL=sanitize.min.css.map */

Binary file not shown.

Binary file not shown.

File diff suppressed because one or more lines are too long

Binary file not shown.

Binary file not shown.

File diff suppressed because one or more lines are too long

Binary file not shown.

Binary file not shown.

View file

@ -0,0 +1,389 @@
(function(self) {
'use strict';
if (self.fetch) {
return
}
function normalizeName(name) {
if (typeof name !== 'string') {
name = String(name)
}
if (/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(name)) {
throw new TypeError('Invalid character in header field name')
}
return name.toLowerCase()
}
function normalizeValue(value) {
if (typeof value !== 'string') {
value = String(value)
}
return value
}
function Headers(headers) {
this.map = {}
if (headers instanceof Headers) {
headers.forEach(function(value, name) {
this.append(name, value)
}, this)
} else if (headers) {
Object.getOwnPropertyNames(headers).forEach(function(name) {
this.append(name, headers[name])
}, this)
}
}
Headers.prototype.append = function(name, value) {
name = normalizeName(name)
value = normalizeValue(value)
var list = this.map[name]
if (!list) {
list = []
this.map[name] = list
}
list.push(value)
}
Headers.prototype['delete'] = function(name) {
delete this.map[normalizeName(name)]
}
Headers.prototype.get = function(name) {
var values = this.map[normalizeName(name)]
return values ? values[0] : null
}
Headers.prototype.getAll = function(name) {
return this.map[normalizeName(name)] || []
}
Headers.prototype.has = function(name) {
return this.map.hasOwnProperty(normalizeName(name))
}
Headers.prototype.set = function(name, value) {
this.map[normalizeName(name)] = [normalizeValue(value)]
}
Headers.prototype.forEach = function(callback, thisArg) {
Object.getOwnPropertyNames(this.map).forEach(function(name) {
this.map[name].forEach(function(value) {
callback.call(thisArg, value, name, this)
}, this)
}, this)
}
function consumed(body) {
if (body.bodyUsed) {
return Promise.reject(new TypeError('Already read'))
}
body.bodyUsed = true
}
function fileReaderReady(reader) {
return new Promise(function(resolve, reject) {
reader.onload = function() {
resolve(reader.result)
}
reader.onerror = function() {
reject(reader.error)
}
})
}
function readBlobAsArrayBuffer(blob) {
var reader = new FileReader()
reader.readAsArrayBuffer(blob)
return fileReaderReady(reader)
}
function readBlobAsText(blob) {
var reader = new FileReader()
reader.readAsText(blob)
return fileReaderReady(reader)
}
var support = {
blob: 'FileReader' in self && 'Blob' in self && (function() {
try {
new Blob();
return true
} catch(e) {
return false
}
})(),
formData: 'FormData' in self,
arrayBuffer: 'ArrayBuffer' in self
}
function Body() {
this.bodyUsed = false
this._initBody = function(body) {
this._bodyInit = body
if (typeof body === 'string') {
this._bodyText = body
} else if (support.blob && Blob.prototype.isPrototypeOf(body)) {
this._bodyBlob = body
} else if (support.formData && FormData.prototype.isPrototypeOf(body)) {
this._bodyFormData = body
} else if (!body) {
this._bodyText = ''
} else if (support.arrayBuffer && ArrayBuffer.prototype.isPrototypeOf(body)) {
// Only support ArrayBuffers for POST method.
// Receiving ArrayBuffers happens via Blobs, instead.
} else {
throw new Error('unsupported BodyInit type')
}
if (!this.headers.get('content-type')) {
if (typeof body === 'string') {
this.headers.set('content-type', 'text/plain;charset=UTF-8')
} else if (this._bodyBlob && this._bodyBlob.type) {
this.headers.set('content-type', this._bodyBlob.type)
}
}
}
if (support.blob) {
this.blob = function() {
var rejected = consumed(this)
if (rejected) {
return rejected
}
if (this._bodyBlob) {
return Promise.resolve(this._bodyBlob)
} else if (this._bodyFormData) {
throw new Error('could not read FormData body as blob')
} else {
return Promise.resolve(new Blob([this._bodyText]))
}
}
this.arrayBuffer = function() {
return this.blob().then(readBlobAsArrayBuffer)
}
this.text = function() {
var rejected = consumed(this)
if (rejected) {
return rejected
}
if (this._bodyBlob) {
return readBlobAsText(this._bodyBlob)
} else if (this._bodyFormData) {
throw new Error('could not read FormData body as text')
} else {
return Promise.resolve(this._bodyText)
}
}
} else {
this.text = function() {
var rejected = consumed(this)
return rejected ? rejected : Promise.resolve(this._bodyText)
}
}
if (support.formData) {
this.formData = function() {
return this.text().then(decode)
}
}
this.json = function() {
return this.text().then(JSON.parse)
}
return this
}
// HTTP methods whose capitalization should be normalized
var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT']
function normalizeMethod(method) {
var upcased = method.toUpperCase()
return (methods.indexOf(upcased) > -1) ? upcased : method
}
function Request(input, options) {
options = options || {}
var body = options.body
if (Request.prototype.isPrototypeOf(input)) {
if (input.bodyUsed) {
throw new TypeError('Already read')
}
this.url = input.url
this.credentials = input.credentials
if (!options.headers) {
this.headers = new Headers(input.headers)
}
this.method = input.method
this.mode = input.mode
if (!body) {
body = input._bodyInit
input.bodyUsed = true
}
} else {
this.url = input
}
this.credentials = options.credentials || this.credentials || 'omit'
if (options.headers || !this.headers) {
this.headers = new Headers(options.headers)
}
this.method = normalizeMethod(options.method || this.method || 'GET')
this.mode = options.mode || this.mode || null
this.referrer = null
if ((this.method === 'GET' || this.method === 'HEAD') && body) {
throw new TypeError('Body not allowed for GET or HEAD requests')
}
this._initBody(body)
}
Request.prototype.clone = function() {
return new Request(this)
}
function decode(body) {
var form = new FormData()
body.trim().split('&').forEach(function(bytes) {
if (bytes) {
var split = bytes.split('=')
var name = split.shift().replace(/\+/g, ' ')
var value = split.join('=').replace(/\+/g, ' ')
form.append(decodeURIComponent(name), decodeURIComponent(value))
}
})
return form
}
function headers(xhr) {
var head = new Headers()
var pairs = xhr.getAllResponseHeaders().trim().split('\n')
pairs.forEach(function(header) {
var split = header.trim().split(':')
var key = split.shift().trim()
var value = split.join(':').trim()
head.append(key, value)
})
return head
}
Body.call(Request.prototype)
function Response(bodyInit, options) {
if (!options) {
options = {}
}
this.type = 'default'
this.status = options.status
this.ok = this.status >= 200 && this.status < 300
this.statusText = options.statusText
this.headers = options.headers instanceof Headers ? options.headers : new Headers(options.headers)
this.url = options.url || ''
this._initBody(bodyInit)
}
Body.call(Response.prototype)
Response.prototype.clone = function() {
return new Response(this._bodyInit, {
status: this.status,
statusText: this.statusText,
headers: new Headers(this.headers),
url: this.url
})
}
Response.error = function() {
var response = new Response(null, {status: 0, statusText: ''})
response.type = 'error'
return response
}
var redirectStatuses = [301, 302, 303, 307, 308]
Response.redirect = function(url, status) {
if (redirectStatuses.indexOf(status) === -1) {
throw new RangeError('Invalid status code')
}
return new Response(null, {status: status, headers: {location: url}})
}
self.Headers = Headers;
self.Request = Request;
self.Response = Response;
self.fetch = function(input, init) {
return new Promise(function(resolve, reject) {
var request
if (Request.prototype.isPrototypeOf(input) && !init) {
request = input
} else {
request = new Request(input, init)
}
var xhr = new XMLHttpRequest()
function responseURL() {
if ('responseURL' in xhr) {
return xhr.responseURL
}
// Avoid security warnings on getResponseHeader when not allowed by CORS
if (/^X-Request-URL:/m.test(xhr.getAllResponseHeaders())) {
return xhr.getResponseHeader('X-Request-URL')
}
return;
}
xhr.onload = function() {
var status = (xhr.status === 1223) ? 204 : xhr.status
if (status < 100 || status > 599) {
reject(new TypeError('Network request failed'))
return
}
var options = {
status: status,
statusText: xhr.statusText,
headers: headers(xhr),
url: responseURL()
}
var body = 'response' in xhr ? xhr.response : xhr.responseText;
resolve(new Response(body, options))
}
xhr.onerror = function() {
reject(new TypeError('Network request failed'))
}
xhr.open(request.method, request.url, true)
if (request.credentials === 'include') {
xhr.withCredentials = true
}
if ('responseType' in xhr && support.blob) {
xhr.responseType = 'blob'
}
request.headers.forEach(function(value, name) {
xhr.setRequestHeader(name, value)
})
xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit)
})
}
self.fetch.polyfill = true
})(typeof self !== 'undefined' ? self : this);

Binary file not shown.

Binary file not shown.

View file

@ -0,0 +1,69 @@
var feature = {
addEventListener : !!window.addEventListener,
querySelectorAll : !!document.querySelectorAll,
};
if(feature.addEventListener && feature.querySelectorAll) {
this.init();
}
function init() {
var keys = getKeys();
for(var i = 0; i < keys.length; i++) {
if(store.get(keys[i])) {
var formId = keys[i].split("~")[1];
document.getElementById(formId).value = store.get(keys[i]);
}
}
}
var timerId = window.setInterval(function() {
var saved = false;
var inputs = document.querySelectorAll('input[type=text], textarea');
for(var i = 0; i < inputs.length; i++) {
var key = getFormElement(inputs[i]).id + '~' + inputs[i].id;
if(store.get(key) !== inputs[i].value && inputs[i].value !== "") {
store.set(key, inputs[i].value);
saved = true;
}
}
if(saved === true) {
alertify.logPosition('top right');
alertify.success('Auto saved text');
}
}, 5000);
var forms = document.querySelectorAll('form');
for(var f = 0; f < forms.length; f++) {
var form = forms[f];
form.addEventListener('submit', function() {
window.clearInterval(timerId);
var formId = form.id;
var storedKeys = store.keys();
for(var i = 0; i < storedKeys.length; i++) {
if(storedKeys[i].indexOf(formId) > -1) {
store.remove(storedKeys[i]);
}
}
});
}
function getKeys() {
var keys = [];
var formFields = document.querySelectorAll('input[type=text], textarea');
for(var f = 0; f < formFields.length; f++) {
var parent = getFormElement(formFields[f]);
if(parent !== false) {
var key = parent.id + '~' + formFields[f].id;
keys.push(key);
}
}
return keys;
}
function getFormElement(elem) {
if(elem.nodeName.toLowerCase() !== 'body') {
var parent = elem.parentNode;
if(parent.nodeName.toLowerCase() === 'form') {
return parent;
} else {
return getFormElement(parent);
}
} else {
return false;
}
}

Binary file not shown.

Binary file not shown.

View file

@ -0,0 +1,25 @@
//the autlinker object
var autolinker = new Autolinker();
//the youtube regex
var ytidregex = /watch\?v=([A-Za-z0-9\-_]+)/;
//grab the notes and loop through them
var notes = document.querySelectorAll('.e-content');
for(var i = 0; i < notes.length; i++) {
//get Youtube ID
var ytid = notes[i].textContent.match(ytidregex);
if(ytid !== null) {
var id = ytid[1];
var iframe = document.createElement('iframe');
iframe.classList.add('youtube');
iframe.setAttribute('src', '//www.youtube.com/embed/' + id);
iframe.setAttribute('frameborder', 0);
iframe.setAttribute('allowfullscreen', 'true');
notes[i].appendChild(iframe);
}
//now linkify everything
var orig = notes[i].innerHTML;
var linked = autolinker.link(orig);
notes[i].innerHTML = linked;
}

Binary file not shown.

Binary file not shown.

View file

@ -0,0 +1,15 @@
//This code runs on page load and looks for <div class="map">, then adds map
var mapDivs = document.querySelectorAll('.map');
for(var i = 0; i < mapDivs.length; i++) {
var mapDiv = mapDivs[i];
var latitude = mapDiv.dataset.latitude;
var longitude = mapDiv.dataset.longitude;
L.mapbox.accessToken = 'pk.eyJ1Ijoiam9ubnliYXJuZXMiLCJhIjoiVlpndW1EYyJ9.aP9fxAqLKh7lj0LpFh5k1w';
var map = L.mapbox.map(mapDiv, 'jonnybarnes.gnoihnim')
.setView([latitude, longitude], 15)
.addLayer(L.mapbox.tileLayer('jonnybarnes.gnoihnim', {
detectRetina: true,
}));
var marker = L.marker([latitude, longitude]).addTo(map);
map.scrollWheelZoom.disable();
}

Binary file not shown.

Binary file not shown.

File diff suppressed because one or more lines are too long

Binary file not shown.

Binary file not shown.

View file

@ -0,0 +1,284 @@
if ('geolocation' in navigator) {
var button = document.querySelector('#locate');
if (button.addEventListener) {
//if we have javascript, event listeners and geolocation, make the locate
//button clickable and add event
button.disabled = false;
button.addEventListener('click', getLocation);
}
}
function getLocation() {
navigator.geolocation.getCurrentPosition(function (position) {
//the locate button has been clicked so add the places/map
addPlaces(position.coords.latitude, position.coords.longitude);
});
}
function addPlaces(latitude, longitude) {
//get the nearby places
fetch('/places/near/' + latitude + '/' + longitude, {
credentials: 'same-origin',
method: 'get'
}).then(function (response) {
return response.json();
}).then(function (j) {
if (j.length > 0) {
var i;
var places = [];
for (i = 0; i < j.length; ++i) {
var latlng = parseLocation(j[i].location);
var name = j[i].name;
var slug = j[i].slug;
places.push([name, slug, latlng[0], latlng[1]]);
}
//add a map with the nearby places
addMap(latitude, longitude, places);
} else {
//add a map with just current location
addMap(latitude, longitude);
}
}).catch(function (err) {
console.log(err);
});
}
function addMap(latitude, longitude, places) {
//make places null if not supplied
if (arguments.length == 2) {
places = null;
}
var form = button.parentNode;
var div = document.createElement('div');
div.setAttribute('id', 'map');
//add the map div
form.appendChild(div);
L.mapbox.accessToken = 'pk.eyJ1Ijoiam9ubnliYXJuZXMiLCJhIjoiVlpndW1EYyJ9.aP9fxAqLKh7lj0LpFh5k1w';
var map = L.mapbox.map('map', 'jonnybarnes.gnoihnim')
.setView([latitude, longitude], 15)
.addLayer(L.mapbox.tileLayer('jonnybarnes.gnoihnim', {
detectRetina: true,
}));
//add a marker for the current location
var marker = L.marker([latitude, longitude], {
draggable: true,
}).addTo(map);
//when the location marker is dragged, if the new place form elements exist
//update the lat/lng values
marker.on('dragend', function () {
var placeFormLatitude = document.querySelector('#place-latitude');
if (placeFormLatitude !== null) {
placeFormLatitude.value = getLatitudeFromMapboxMarker(marker.getLatLng());
}
var placeFormLongitude = document.querySelector('#place-longitude');
if (placeFormLongitude !== null) {
placeFormLongitude.value = getLongitudeFromMapboxMarker(marker.getLatLng());
}
});
//create the <select> element and give it a no location default
var selectEl = document.createElement('select');
selectEl.setAttribute('name', 'location');
var noLocation = document.createElement('option');
noLocation.setAttribute('selected', 'selected');
noLocation.setAttribute('value', 'no-location');
noLocText = document.createTextNode('Select no location');
noLocation.appendChild(noLocText);
selectEl.appendChild(noLocation);
form.insertBefore(selectEl, div);
if (places !== null) {
//add the places both to the map and <select>
places.forEach(function (item, index, array) {
var option = document.createElement('option');
option.setAttribute('value', item[1]);
var text = document.createTextNode(item[0]);
option.appendChild(text);
option.dataset.latitude = item[2];
option.dataset.longitude = item[3];
selectEl.appendChild(option);
var placeMarker = L.marker([item[2], item[3]], {
icon: L.mapbox.marker.icon({
'marker-size': 'large',
'marker-symbol': 'building',
'marker-color': '#fa0'
})
}).addTo(map);
var name = 'Name: ' + item[0];
placeMarker.bindPopup(name, {
closeButton: true
});
placeMarker.on('click', function (e) {
map.panTo([item[2], item[3]]);
selectPlace(item[1]);
});
});
//add an event listener
selectEl.addEventListener('change', function () {
if (selectEl.value !== 'no-location') {
var placeLat = selectEl[selectEl.selectedIndex].dataset.latitude;
var placeLon = selectEl[selectEl.selectedIndex].dataset.longitude;
map.panTo([placeLat, placeLon]);
}
});
}
//add a button to add a new place
var newLocButton = document.createElement('button');
newLocButton.setAttribute('type', 'button');
newLocButton.setAttribute('id', 'create-new-place');
newLocButton.appendChild(document.createTextNode('Create New Place?'));
//the event listener
newLocButton.addEventListener('click', function() {
//add the form elements
var nameLabel = document.createElement('label');
nameLabel.setAttribute('for', 'place-name');
nameLabel.classList.add('place-label')
nameLabel.appendChild(document.createTextNode('Place Name:'));
var nameEl = document.createElement('input');
nameEl.setAttribute('placeholder', 'Name');
nameEl.setAttribute('name', 'place-name');
nameEl.setAttribute('id', 'place-name');
nameEl.setAttribute('type', 'text');
var descLabel = document.createElement('label');
descLabel.setAttribute('for', 'place-description');
descLabel.classList.add('place-label');
descLabel.appendChild(document.createTextNode('Place Description:'));
var descEl = document.createElement('input');
descEl.setAttribute('placeholder', 'Description');
descEl.setAttribute('name', 'place-description');
descEl.setAttribute('id', 'place-description');
descEl.setAttribute('type', 'text');
var latLabel = document.createElement('label');
latLabel.setAttribute('for', 'place-latitude');
latLabel.classList.add('place-label');
latLabel.appendChild(document.createTextNode('Place Latitude:'));
var latEl = document.createElement('input');
latEl.setAttribute('name', 'place-latitude');
latEl.setAttribute('id', 'place-latitude');
latEl.setAttribute('type', 'text');
latEl.value = getLatitudeFromMapboxMarker(marker.getLatLng());
var lonLabel = document.createElement('label');
lonLabel.setAttribute('for', 'place-longitude');
lonLabel.classList.add('place-label');
lonLabel.appendChild(document.createTextNode('Place Longitude:'));
var lonEl = document.createElement('input');
lonEl.setAttribute('name', 'place-longitude');
lonEl.setAttribute('id', 'place-longitude');
lonEl.setAttribute('type', 'text');
lonEl.value = getLongitudeFromMapboxMarker(marker.getLatLng());
var placeSubmit = document.createElement('button');
placeSubmit.setAttribute('id', 'place-submit');
placeSubmit.setAttribute('value', 'Submit New Place');
placeSubmit.setAttribute('name', 'place-submit');
placeSubmit.setAttribute('type', 'button');
placeSubmit.appendChild(document.createTextNode('Submit New Place'));
form.appendChild(nameLabel);
form.appendChild(nameEl);
form.appendChild(descLabel);
form.appendChild(descEl);
form.appendChild(latLabel);
form.appendChild(latEl);
form.appendChild(lonLabel);
form.appendChild(lonEl);
form.appendChild(placeSubmit);
//the event listener for the new place form
placeSubmit.addEventListener('click', function () {
//create the form data to send
var formData = new FormData();
formData.append('place-name', document.querySelector('#place-name').value);
formData.append('place-description', document.querySelector('#place-description').value);
formData.append('place-latitude', document.querySelector('#place-latitude').value);
formData.append('place-longitude', document.querySelector('#place-longitude').value);
//post the new place
fetch('/places/new', {
//send cookies with the request
credentials: 'same-origin',
method: 'post',
body: formData
})
.then(status)
.then(json)
.then(function (placeJson) {
//create the slug from the url
var urlParts = placeJson.split('/');
var slug = urlParts.pop();
//remove un-needed form elements
form.removeChild(document.querySelector('#place-name'));
form.removeChild(document.querySelector('#place-description'));
form.removeChild(document.querySelector('#place-latitude'));
form.removeChild(document.querySelector('#place-longitude'));
var labels = document.querySelectorAll('.place-label');
for (var label of labels) {
form.removeChild(label);
}
form.removeChild(document.querySelector('#place-submit'));
form.removeChild(document.querySelector('#create-new-place'));
//remove location marker
map.removeLayer(marker);
//add place marker
var newOption = document.createElement('option');
newOption.setAttribute('value', slug);
newOption.appendChild(document.createTextNode(placeJson['name']));
newOption.dataset.latitude = placeJson['latitude'];
newOption.dataset.longitude = placeJson['longitude'];
selectEl.appendChild(newOption);
var newPlaceMarker = L.marker([placeJson['latitude'], placeJson['longitude']], {
icon: L.mapbox.marker.icon({
'marker-size': 'large',
'marker-symbol': 'building',
'marker-color': '#fa0'
})
}).addTo(map);
var newName = 'Name: ' + placeJson['name'];
newPlaceMarker.bindPopup(newName, {
closeButton: true
});
newPlaceMarker.on('click', function (e) {
map.panTo([placeJson['latitude'], placeJson['longitude']]);
selectPlace(slug);
});
//make selected
selectPlace(slug);
}).catch(function (placeError) {
console.log(placeError);
});
})
});
form.insertBefore(newLocButton, div);
}
function parseLocation(point) {
var re = /\((.*)\)/;
var resultArray = re.exec(point);
var location = resultArray[1].split(' ');
return [location[1], location[0]];
}
function selectPlace(slug) {
document.querySelector('select [value=' + slug + ']').selected = true;
}
function getLatitudeFromMapboxMarker(latlng) {
var resultArray = /\((.*)\)/.exec(latlng);
var location = resultArray[1].split(' ');
return location[0].replace(',', '');
}
function getLongitudeFromMapboxMarker(latlng) {
var resultArray = /\((.*)\)/.exec(latlng);
var location = resultArray[1].split(' ');
return location[1];
}
function status(response) {
if (response.status >= 200 && response.status < 300) {
return Promise.resolve(response);
} else {
return Promise.reject(new Error(response.statusText));
}
}
function json(response) {
return response.json();
}

Binary file not shown.

Binary file not shown.

View file

@ -0,0 +1,45 @@
var button = document.querySelector('#locate');
if (button.addEventListener) {
button.addEventListener('click', getLocation);
} else {
button.attachEvent('onclick', getLocation);
}
function getLocation() {
if ('geolocation' in navigator) {
navigator.geolocation.getCurrentPosition(function(position) {
updateForm(position.coords.latitude, position.coords.longitude);
addMap(position.coords.latitude, position.coords.longitude);
});
} else {
console.log('I need to do something when geoloaction isnt available.');
}
}
function updateForm(latitude, longitude) {
var inputLatitude = document.querySelector('#latitude');
var inputLongitude = document.querySelector('#longitude');
inputLatitude.value = latitude;
inputLongitude.value = longitude;
}
function addMap(latitude, longitude) {
var form = document.querySelector('form');
var div = document.createElement('div');
div.setAttribute('id', 'map');
form.appendChild(div);
L.mapbox.accessToken = 'pk.eyJ1Ijoiam9ubnliYXJuZXMiLCJhIjoiVlpndW1EYyJ9.aP9fxAqLKh7lj0LpFh5k1w';
var map = L.mapbox.map('map', 'jonnybarnes.gnoihnim')
.setView([latitude, longitude], 15)
.addLayer(L.mapbox.tileLayer('jonnybarnes.gnoihnim', {
detectRetina: true,
}));
var marker = L.marker([latitude, longitude], {
draggable: true,
}).addTo(map);
marker.on('dragend', function () {
var markerLocation = marker.getLatLng();
updateForm(markerLocation.lat, markerLocation.lng);
});
}

Binary file not shown.

Binary file not shown.

View file

@ -0,0 +1,15 @@
/* http://prismjs.com/download.html?themes=prism-dark&languages=markup+css+clike+javascript+git+http+markdown+php+php-extras+scss+sql&plugins=line-numbers+show-invisibles */
var _self="undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{},Prism=function(){var e=/\blang(?:uage)?-(?!\*)(\w+)\b/i,t=_self.Prism={util:{encode:function(e){return e instanceof n?new n(e.type,t.util.encode(e.content),e.alias):"Array"===t.util.type(e)?e.map(t.util.encode):e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},type:function(e){return Object.prototype.toString.call(e).match(/\[object (\w+)\]/)[1]},clone:function(e){var n=t.util.type(e);switch(n){case"Object":var a={};for(var r in e)e.hasOwnProperty(r)&&(a[r]=t.util.clone(e[r]));return a;case"Array":return e.map&&e.map(function(e){return t.util.clone(e)})}return e}},languages:{extend:function(e,n){var a=t.util.clone(t.languages[e]);for(var r in n)a[r]=n[r];return a},insertBefore:function(e,n,a,r){r=r||t.languages;var i=r[e];if(2==arguments.length){a=arguments[1];for(var l in a)a.hasOwnProperty(l)&&(i[l]=a[l]);return i}var o={};for(var s in i)if(i.hasOwnProperty(s)){if(s==n)for(var l in a)a.hasOwnProperty(l)&&(o[l]=a[l]);o[s]=i[s]}return t.languages.DFS(t.languages,function(t,n){n===r[e]&&t!=e&&(this[t]=o)}),r[e]=o},DFS:function(e,n,a){for(var r in e)e.hasOwnProperty(r)&&(n.call(e,r,e[r],a||r),"Object"===t.util.type(e[r])?t.languages.DFS(e[r],n):"Array"===t.util.type(e[r])&&t.languages.DFS(e[r],n,r))}},highlightAll:function(e,n){for(var a,r=document.querySelectorAll('code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'),i=0;a=r[i++];)t.highlightElement(a,e===!0,n)},highlightElement:function(a,r,i){for(var l,o,s=a;s&&!e.test(s.className);)s=s.parentNode;s&&(l=(s.className.match(e)||[,""])[1],o=t.languages[l]),a.className=a.className.replace(e,"").replace(/\s+/g," ")+" language-"+l,s=a.parentNode,/pre/i.test(s.nodeName)&&(s.className=s.className.replace(e,"").replace(/\s+/g," ")+" language-"+l);var u=a.textContent,g={element:a,language:l,grammar:o,code:u};if(!u||!o)return t.hooks.run("complete",g),void 0;if(t.hooks.run("before-highlight",g),r&&_self.Worker){var c=new Worker(t.filename);c.onmessage=function(e){g.highlightedCode=n.stringify(JSON.parse(e.data),l),t.hooks.run("before-insert",g),g.element.innerHTML=g.highlightedCode,i&&i.call(g.element),t.hooks.run("after-highlight",g),t.hooks.run("complete",g)},c.postMessage(JSON.stringify({language:g.language,code:g.code}))}else g.highlightedCode=t.highlight(g.code,g.grammar,g.language),t.hooks.run("before-insert",g),g.element.innerHTML=g.highlightedCode,i&&i.call(a),t.hooks.run("after-highlight",g),t.hooks.run("complete",g)},highlight:function(e,a,r){var i=t.tokenize(e,a);return n.stringify(t.util.encode(i),r)},tokenize:function(e,n){var a=t.Token,r=[e],i=n.rest;if(i){for(var l in i)n[l]=i[l];delete n.rest}e:for(var l in n)if(n.hasOwnProperty(l)&&n[l]){var o=n[l];o="Array"===t.util.type(o)?o:[o];for(var s=0;s<o.length;++s){var u=o[s],g=u.inside,c=!!u.lookbehind,f=0,h=u.alias;u=u.pattern||u;for(var p=0;p<r.length;p++){var d=r[p];if(r.length>e.length)break e;if(!(d instanceof a)){u.lastIndex=0;var m=u.exec(d);if(m){c&&(f=m[1].length);var y=m.index-1+f,m=m[0].slice(f),v=m.length,k=y+v,b=d.slice(0,y+1),w=d.slice(k+1),N=[p,1];b&&N.push(b);var O=new a(l,g?t.tokenize(m,g):m,h);N.push(O),w&&N.push(w),Array.prototype.splice.apply(r,N)}}}}}return r},hooks:{all:{},add:function(e,n){var a=t.hooks.all;a[e]=a[e]||[],a[e].push(n)},run:function(e,n){var a=t.hooks.all[e];if(a&&a.length)for(var r,i=0;r=a[i++];)r(n)}}},n=t.Token=function(e,t,n){this.type=e,this.content=t,this.alias=n};if(n.stringify=function(e,a,r){if("string"==typeof e)return e;if("Array"===t.util.type(e))return e.map(function(t){return n.stringify(t,a,e)}).join("");var i={type:e.type,content:n.stringify(e.content,a,r),tag:"span",classes:["token",e.type],attributes:{},language:a,parent:r};if("comment"==i.type&&(i.attributes.spellcheck="true"),e.alias){var l="Array"===t.util.type(e.alias)?e.alias:[e.alias];Array.prototype.push.apply(i.classes,l)}t.hooks.run("wrap",i);var o="";for(var s in i.attributes)o+=s+'="'+(i.attributes[s]||"")+'"';return"<"+i.tag+' class="'+i.classes.join(" ")+'" '+o+">"+i.content+"</"+i.tag+">"},!_self.document)return _self.addEventListener?(_self.addEventListener("message",function(e){var n=JSON.parse(e.data),a=n.language,r=n.code;_self.postMessage(JSON.stringify(t.util.encode(t.tokenize(r,t.languages[a])))),_self.close()},!1),_self.Prism):_self.Prism;var a=document.getElementsByTagName("script");return a=a[a.length-1],a&&(t.filename=a.src,document.addEventListener&&!a.hasAttribute("data-manual")&&document.addEventListener("DOMContentLoaded",t.highlightAll)),_self.Prism}();"undefined"!=typeof module&&module.exports&&(module.exports=Prism);;
Prism.languages.markup={comment:/<!--[\w\W]*?-->/,prolog:/<\?[\w\W]+?\?>/,doctype:/<!DOCTYPE[\w\W]+?>/,cdata:/<!\[CDATA\[[\w\W]*?]]>/i,tag:{pattern:/<\/?[^\s>\/]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\\1|\\?(?!\1)[\w\W])*\1|[^\s'">=]+))?)*\s*\/?>/i,inside:{tag:{pattern:/^<\/?[^\s>\/]+/i,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"attr-value":{pattern:/=(?:('|")[\w\W]*?(\1)|[^\s>]+)/i,inside:{punctuation:/[=>"']/}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:/&#?[\da-z]{1,8};/i},Prism.hooks.add("wrap",function(t){"entity"===t.type&&(t.attributes.title=t.content.replace(/&amp;/,"&"))});;
Prism.languages.css={comment:/\/\*[\w\W]*?\*\//,atrule:{pattern:/@[\w-]+?.*?(;|(?=\s*\{))/i,inside:{rule:/@[\w-]+/}},url:/url\((?:(["'])(\\(?:\r\n|[\w\W])|(?!\1)[^\\\r\n])*\1|.*?)\)/i,selector:/[^\{\}\s][^\{\};]*?(?=\s*\{)/,string:/("|')(\\(?:\r\n|[\w\W])|(?!\1)[^\\\r\n])*\1/,property:/(\b|\B)[\w-]+(?=\s*:)/i,important:/\B!important\b/i,"function":/[-a-z0-9]+(?=\()/i,punctuation:/[(){};:]/},Prism.languages.css.atrule.inside.rest=Prism.util.clone(Prism.languages.css),Prism.languages.markup&&(Prism.languages.insertBefore("markup","tag",{style:{pattern:/<style[\w\W]*?>[\w\W]*?<\/style>/i,inside:{tag:{pattern:/<style[\w\W]*?>|<\/style>/i,inside:Prism.languages.markup.tag.inside},rest:Prism.languages.css},alias:"language-css"}}),Prism.languages.insertBefore("inside","attr-value",{"style-attr":{pattern:/\s*style=("|').*?\1/i,inside:{"attr-name":{pattern:/^\s*style/i,inside:Prism.languages.markup.tag.inside},punctuation:/^\s*=\s*['"]|['"]\s*$/,"attr-value":{pattern:/.+/i,inside:Prism.languages.css}},alias:"language-css"}},Prism.languages.markup.tag));;
Prism.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\w\W]*?\*\//,lookbehind:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0}],string:/("|')(\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,"class-name":{pattern:/((?:\b(?:class|interface|extends|implements|trait|instanceof|new)\s+)|(?:catch\s+\())[a-z0-9_\.\\]+/i,lookbehind:!0,inside:{punctuation:/(\.|\\)/}},keyword:/\b(if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/,"boolean":/\b(true|false)\b/,"function":/[a-z0-9_]+(?=\()/i,number:/\b-?(0x[\dA-Fa-f]+|\d*\.?\d+([Ee]-?\d+)?)\b/,operator:/[-+]{1,2}|!|<=?|>=?|={1,3}|&{1,2}|\|?\||\?|\*|\/|~|\^|%/,punctuation:/[{}[\];(),.:]/};;
Prism.languages.javascript=Prism.languages.extend("clike",{keyword:/\b(as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|false|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|true|try|typeof|var|void|while|with|yield)\b/,number:/\b-?(0x[\dA-Fa-f]+|0b[01]+|0o[0-7]+|\d*\.?\d+([Ee][+-]?\d+)?|NaN|Infinity)\b/,"function":/(?!\d)[a-z0-9_$]+(?=\()/i}),Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:/(^|[^/])\/(?!\/)(\[.+?]|\\.|[^/\\\r\n])+\/[gimyu]{0,5}(?=\s*($|[\r\n,.;})]))/,lookbehind:!0}}),Prism.languages.insertBefore("javascript","class-name",{"template-string":{pattern:/`(?:\\`|\\?[^`])*`/,inside:{interpolation:{pattern:/\$\{[^}]+\}/,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:Prism.languages.javascript}},string:/[\s\S]+/}}}),Prism.languages.markup&&Prism.languages.insertBefore("markup","tag",{script:{pattern:/<script[\w\W]*?>[\w\W]*?<\/script>/i,inside:{tag:{pattern:/<script[\w\W]*?>|<\/script>/i,inside:Prism.languages.markup.tag.inside},rest:Prism.languages.javascript},alias:"language-javascript"}});;
Prism.languages.git={comment:/^#.*$/m,string:/("|')(\\?.)*?\1/m,command:{pattern:/^.*\$ git .*$/m,inside:{parameter:/\s(--|-)\w+/m}},coord:/^@@.*@@$/m,deleted:/^-(?!-).+$/m,inserted:/^\+(?!\+).+$/m,commit_sha1:/^commit \w{40}$/m};;
Prism.languages.http={"request-line":{pattern:/^(POST|GET|PUT|DELETE|OPTIONS|PATCH|TRACE|CONNECT)\b\shttps?:\/\/\S+\sHTTP\/[0-9.]+/,inside:{property:/^\b(POST|GET|PUT|DELETE|OPTIONS|PATCH|TRACE|CONNECT)\b/,"attr-name":/:\w+/}},"response-status":{pattern:/^HTTP\/1.[01] [0-9]+.*/,inside:{property:/[0-9]+[A-Z\s-]+$/i}},keyword:/^[\w-]+:(?=.+)/m};var httpLanguages={"application/json":Prism.languages.javascript,"application/xml":Prism.languages.markup,"text/xml":Prism.languages.markup,"text/html":Prism.languages.markup};for(var contentType in httpLanguages)if(httpLanguages[contentType]){var options={};options[contentType]={pattern:new RegExp("(content-type:\\s*"+contentType+"[\\w\\W]*?)\\n\\n[\\w\\W]*","i"),lookbehind:!0,inside:{rest:httpLanguages[contentType]}},Prism.languages.insertBefore("http","keyword",options)};
Prism.languages.markdown=Prism.languages.extend("markup",{}),Prism.languages.insertBefore("markdown","prolog",{blockquote:{pattern:/(^|\n)>(?:[\t ]*>)*/,lookbehind:!0,alias:"punctuation"},code:[{pattern:/(^|\n)(?: {4}|\t).+/,lookbehind:!0,alias:"keyword"},{pattern:/``.+?``|`[^`\n]+`/,alias:"keyword"}],title:[{pattern:/\w+.*\n(?:==+|--+)/,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/((?:^|\n)\s*)#+.+/,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/((?:^|\n)\s*)([*-])([\t ]*\2){2,}(?=\s*(?:\n|$))/,lookbehind:!0,alias:"punctuation"},list:{pattern:/((?:^|\n)\s*)(?:[*+-]|\d+\.)(?=[\t ].)/,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:[^>]|\\>)+>)(?:[\t ]+(?:"(?:[^"]|\\")*"|'(?:[^']|\\')*'|\((?:[^)]|\\\))*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:[^"]|\\")*"|'(?:[^']|\\')*'|\((?:[^)]|\\\))*\))$/,punctuation:/[[\]\(\)<>:]/},alias:"url"},bold:{pattern:/(^|[^\\])(\*\*|__)(?:\n(?!\n)|.)+?\2/,lookbehind:!0,inside:{punctuation:/^\*\*|^__|\*\*\s*$|__\s*$/}},italic:{pattern:/(^|[^\\])(?:\*(?:\n(?!\n)|.)+?\*|_(?:\n(?!\n)|.)+?_)/,lookbehind:!0,inside:{punctuation:/^[*_]|[*_]$/}},url:{pattern:/!?\[[^\]]+\](?:\([^\s)]+(?:[\t ]+"(?:[^"]|\\")*")?\)| ?\[[^\]\n]*\])/,inside:{variable:{pattern:/(!?\[)[^\]]+(?=\]$)/,lookbehind:!0},string:{pattern:/"(?:[^"]|\\")*"(?=\)$)/}}}}),Prism.languages.markdown.bold.inside.url=Prism.util.clone(Prism.languages.markdown.url),Prism.languages.markdown.italic.inside.url=Prism.util.clone(Prism.languages.markdown.url),Prism.languages.markdown.bold.inside.italic=Prism.util.clone(Prism.languages.markdown.italic),Prism.languages.markdown.italic.inside.bold=Prism.util.clone(Prism.languages.markdown.bold);;
Prism.languages.php=Prism.languages.extend("clike",{keyword:/\b(and|or|xor|array|as|break|case|cfunction|class|const|continue|declare|default|die|do|else|elseif|enddeclare|endfor|endforeach|endif|endswitch|endwhile|extends|for|foreach|function|include|include_once|global|if|new|return|static|switch|use|require|require_once|var|while|abstract|interface|public|implements|private|protected|parent|throw|null|echo|print|trait|namespace|final|yield|goto|instanceof|finally|try|catch)\b/i,constant:/\b[A-Z0-9_]{2,}\b/,comment:{pattern:/(^|[^\\])(\/\*[\w\W]*?\*\/|(^|[^:])(\/\/).*?(\r?\n|$))/,lookbehind:!0}}),Prism.languages.insertBefore("php","class-name",{"shell-comment":{pattern:/(^|[^\\])#.*?(\r?\n|$)/,lookbehind:!0,alias:"comment"}}),Prism.languages.insertBefore("php","keyword",{delimiter:/(\?>|<\?php|<\?)/i,variable:/(\$\w+)\b/i,"package":{pattern:/(\\|namespace\s+|use\s+)[\w\\]+/,lookbehind:!0,inside:{punctuation:/\\/}}}),Prism.languages.insertBefore("php","operator",{property:{pattern:/(->)[\w]+/,lookbehind:!0}}),Prism.languages.markup&&(Prism.hooks.add("before-highlight",function(e){"php"===e.language&&(e.tokenStack=[],e.backupCode=e.code,e.code=e.code.replace(/(?:<\?php|<\?)[\w\W]*?(?:\?>)/gi,function(n){return e.tokenStack.push(n),"{{{PHP"+e.tokenStack.length+"}}}"}))}),Prism.hooks.add("before-insert",function(e){"php"===e.language&&(e.code=e.backupCode,delete e.backupCode)}),Prism.hooks.add("after-highlight",function(e){if("php"===e.language){for(var n,a=0;n=e.tokenStack[a];a++)e.highlightedCode=e.highlightedCode.replace("{{{PHP"+(a+1)+"}}}",Prism.highlight(n,e.grammar,"php"));e.element.innerHTML=e.highlightedCode}}),Prism.hooks.add("wrap",function(e){"php"===e.language&&"markup"===e.type&&(e.content=e.content.replace(/(\{\{\{PHP[0-9]+\}\}\})/g,'<span class="token php">$1</span>'))}),Prism.languages.insertBefore("php","comment",{markup:{pattern:/<[^?]\/?(.*?)>/,inside:Prism.languages.markup},php:/\{\{\{PHP[0-9]+\}\}\}/}));;
Prism.languages.insertBefore("php","variable",{"this":/\$this/,global:/\$_?(GLOBALS|SERVER|GET|POST|FILES|REQUEST|SESSION|ENV|COOKIE|HTTP_RAW_POST_DATA|argc|argv|php_errormsg|http_response_header)/,scope:{pattern:/\b[\w\\]+::/,inside:{keyword:/(static|self|parent)/,punctuation:/(::|\\)/}}});;
Prism.languages.scss=Prism.languages.extend("css",{comment:{pattern:/(^|[^\\])(\/\*[\w\W]*?\*\/|\/\/.*?(\r?\n|$))/,lookbehind:!0},atrule:{pattern:/@[\w-]+(?:\([^()]+\)|[^(])*?(?=\s+(\{|;))/i,inside:{rule:/@[\w-]+/}},url:/([-a-z]+-)*url(?=\()/i,selector:{pattern:/([^@;\{\}\(\)]?([^@;\{\}\(\)]|&|#\{\$[-_\w]+\})+)(?=\s*\{(\}|\s|[^\}]+(:|\{)[^\}]+))/m,inside:{placeholder:/%[-_\w]+/i}}}),Prism.languages.insertBefore("scss","atrule",{keyword:/@(if|else if|else|for|each|while|import|extend|debug|warn|mixin|include|function|return|content)|(?=@for\s+\$[-_\w]+\s)+from/i}),Prism.languages.insertBefore("scss","property",{variable:/((\$[-_\w]+)|(#\{\$[-_\w]+\}))/i}),Prism.languages.insertBefore("scss","function",{placeholder:{pattern:/%[-_\w]+/i,alias:"selector"},statement:/\B!(default|optional)\b/i,"boolean":/\b(true|false)\b/,"null":/\b(null)\b/,operator:/\s+([-+]{1,2}|={1,2}|!=|\|?\||\?|\*|\/|%)\s+/}),Prism.languages.scss.atrule.inside.rest=Prism.util.clone(Prism.languages.scss);;
Prism.languages.sql={comment:{pattern:/(^|[^\\])(\/\*[\w\W]*?\*\/|((--)|(\/\/)|#).*?(\r?\n|$))/,lookbehind:!0},string:{pattern:/(^|[^@])("|')(\\?[\s\S])*?\2/,lookbehind:!0},variable:/@[\w.$]+|@("|'|`)(\\?[\s\S])+?\1/,"function":/\b(?:COUNT|SUM|AVG|MIN|MAX|FIRST|LAST|UCASE|LCASE|MID|LEN|ROUND|NOW|FORMAT)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALTER|ANALYZE|APPLY|AS|ASC|AUTHORIZATION|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADE|CASCADED|CASE|CHAIN|CHAR VARYING|CHARACTER VARYING|CHECK|CHECKPOINT|CLOSE|CLUSTERED|COALESCE|COLUMN|COLUMNS|COMMENT|COMMIT|COMMITTED|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS|CONTAINSTABLE|CONTINUE|CONVERT|CREATE|CROSS|CURRENT|CURRENT_DATE|CURRENT_TIME|CURRENT_TIMESTAMP|CURRENT_USER|CURSOR|DATA|DATABASE|DATABASES|DATETIME|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DOUBLE PRECISION|DROP|DUMMY|DUMP|DUMPFILE|DUPLICATE KEY|ELSE|ENABLE|ENCLOSED BY|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPE|ESCAPED BY|EXCEPT|EXEC|EXECUTE|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR|FOR EACH ROW|FORCE|FOREIGN|FREETEXT|FREETEXTTABLE|FROM|FULL|FUNCTION|GEOMETRY|GEOMETRYCOLLECTION|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|IDENTITY|IDENTITY_INSERT|IDENTITYCOL|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTO|INVOKER|ISOLATION LEVEL|JOIN|KEY|KEYS|KILL|LANGUAGE SQL|LAST|LEFT|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONGBLOB|LONGTEXT|MATCH|MATCHED|MEDIUMBLOB|MEDIUMINT|MEDIUMTEXT|MERGE|MIDDLEINT|MODIFIES SQL DATA|MODIFY|MULTILINESTRING|MULTIPOINT|MULTIPOLYGON|NATIONAL|NATIONAL CHAR VARYING|NATIONAL CHARACTER|NATIONAL CHARACTER VARYING|NATIONAL VARCHAR|NATURAL|NCHAR|NCHAR VARCHAR|NEXT|NO|NO SQL|NOCHECK|NOCYCLE|NONCLUSTERED|NULLIF|NUMERIC|OF|OFF|OFFSETS|ON|OPEN|OPENDATASOURCE|OPENQUERY|OPENROWSET|OPTIMIZE|OPTION|OPTIONALLY|ORDER|OUT|OUTER|OUTFILE|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREV|PRIMARY|PRINT|PRIVILEGES|PROC|PROCEDURE|PUBLIC|PURGE|QUICK|RAISERROR|READ|READS SQL DATA|READTEXT|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEATABLE|REPLICATION|REQUIRE|RESTORE|RESTRICT|RETURN|RETURNS|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROWCOUNT|ROWGUIDCOL|ROWS?|RTREE|RULE|SAVE|SAVEPOINT|SCHEMA|SELECT|SERIAL|SERIALIZABLE|SESSION|SESSION_USER|SET|SETUSER|SHARE MODE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|START|STARTING BY|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLE|TABLES|TABLESPACE|TEMP(?:ORARY)?|TEMPTABLE|TERMINATED BY|TEXT|TEXTSIZE|THEN|TIMESTAMP|TINYBLOB|TINYINT|TINYTEXT|TO|TOP|TRAN|TRANSACTION|TRANSACTIONS|TRIGGER|TRUNCATE|TSEQUAL|TYPE|TYPES|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNPIVOT|UPDATE|UPDATETEXT|USAGE|USE|USER|USING|VALUE|VALUES|VARBINARY|VARCHAR|VARCHARACTER|VARYING|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH|WITH ROLLUP|WITHIN|WORK|WRITE|WRITETEXT)\b/i,"boolean":/\b(?:TRUE|FALSE|NULL)\b/i,number:/\b-?(0x)?\d*\.?[\da-f]+\b/,operator:/\b(?:ALL|AND|ANY|BETWEEN|EXISTS|IN|LIKE|NOT|OR|IS|UNIQUE|CHARACTER SET|COLLATE|DIV|OFFSET|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b|[-+]|!|[=<>]{1,2}|(&){1,2}|\|?\||\?|\*|\//i,punctuation:/[;[\]()`,.]/};;
Prism.hooks.add("complete",function(e){if(e.code){var t=e.element.parentNode,s=/\s*\bline-numbers\b\s*/;if(t&&/pre/i.test(t.nodeName)&&(s.test(t.className)||s.test(e.element.className))&&!e.element.querySelector(".line-numbers-rows")){s.test(e.element.className)&&(e.element.className=e.element.className.replace(s,"")),s.test(t.className)||(t.className+=" line-numbers");var a,n=e.code.match(/\n(?!$)/g).length+1,l=new Array(n+1);l=l.join("<span></span>"),a=document.createElement("span"),a.className="line-numbers-rows",a.innerHTML=l,t.hasAttribute("data-start")&&(t.style.counterReset="linenumber "+(parseInt(t.getAttribute("data-start"),10)-1)),e.element.appendChild(a)}}});;
!function(){if(window.Prism)for(var r in Prism.languages){var g=Prism.languages[r];g.tab=/\t/g,g.crlf=/\r\n/g,g.lf=/\n/g,g.cr=/\r/g}}();;

Binary file not shown.

Binary file not shown.

View file

@ -0,0 +1,5 @@
/*! store2 - v2.3.2 - 2015-10-27
* Copyright (c) 2015 Nathan Bubna; Licensed MIT, GPL */
!function(a,b){var c={version:"2.3.2",areas:{},apis:{},inherit:function(a,b){for(var c in a)b.hasOwnProperty(c)||(b[c]=a[c]);return b},stringify:function(a){return void 0===a||"function"==typeof a?a+"":JSON.stringify(a)},parse:function(a){try{return JSON.parse(a)}catch(b){return a}},fn:function(a,b){c.storeAPI[a]=b;for(var d in c.apis)c.apis[d][a]=b},get:function(a,b){return a.getItem(b)},set:function(a,b,c){a.setItem(b,c)},remove:function(a,b){a.removeItem(b)},key:function(a,b){return a.key(b)},length:function(a){return a.length},clear:function(a){a.clear()},Store:function(a,b,d){var e=c.inherit(c.storeAPI,function(a,b,c){return 0===arguments.length?e.getAll():void 0!==b?e.set(a,b,c):"string"==typeof a||"number"==typeof a?e.get(a):a?e.setAll(a,b):e.clear()});e._id=a;try{var f="_safariPrivate_";b.setItem(f,"sucks"),e._area=b,b.removeItem(f)}catch(g){}return e._area||(e._area=c.inherit(c.storageAPI,{items:{},name:"fake"})),e._ns=d||"",c.areas[a]||(c.areas[a]=e._area),c.apis[e._ns+e._id]||(c.apis[e._ns+e._id]=e),e},storeAPI:{area:function(a,b){var d=this[a];return d&&d.area||(d=c.Store(a,b,this._ns),this[a]||(this[a]=d)),d},namespace:function(a,b){if(!a)return this._ns?this._ns.substring(0,this._ns.length-1):"";var d=a,e=this[d];return e&&e.namespace||(e=c.Store(this._id,this._area,this._ns+d+"."),this[d]||(this[d]=e),b||e.area("session",c.areas.session)),e},isFake:function(){return"fake"===this._area.name},toString:function(){return"store"+(this._ns?"."+this.namespace():"")+"["+this._id+"]"},has:function(a){return this._area.has?this._area.has(this._in(a)):!!(this._in(a)in this._area)},size:function(){return this.keys().length},each:function(a,b){for(var d=0,e=c.length(this._area);e>d;d++){var f=this._out(c.key(this._area,d));if(void 0!==f&&a.call(this,f,b||this.get(f))===!1)break;e>c.length(this._area)&&(e--,d--)}return b||this},keys:function(){return this.each(function(a,b){b.push(a)},[])},get:function(a,b){var d=c.get(this._area,this._in(a));return null!==d?c.parse(d):b||d},getAll:function(){return this.each(function(a,b){b[a]=this.get(a)},{})},set:function(a,b,d){var e=this.get(a);return null!=e&&d===!1?b:c.set(this._area,this._in(a),c.stringify(b),d)||e},setAll:function(a,b){var c,d;for(var e in a)d=a[e],this.set(e,d,b)!==d&&(c=!0);return c},remove:function(a){var b=this.get(a);return c.remove(this._area,this._in(a)),b},clear:function(){return this._ns?this.each(function(a){c.remove(this._area,this._in(a))},1):c.clear(this._area),this},clearAll:function(){var a=this._area;for(var b in c.areas)c.areas.hasOwnProperty(b)&&(this._area=c.areas[b],this.clear());return this._area=a,this},_in:function(a){return"string"!=typeof a&&(a=c.stringify(a)),this._ns?this._ns+a:a},_out:function(a){return this._ns?a&&0===a.indexOf(this._ns)?a.substring(this._ns.length):void 0:a}},storageAPI:{length:0,has:function(a){return this.items.hasOwnProperty(a)},key:function(a){var b=0;for(var c in this.items)if(this.has(c)&&a===b++)return c},setItem:function(a,b){this.has(a)||this.length++,this.items[a]=b},removeItem:function(a){this.has(a)&&(delete this.items[a],this.length--)},getItem:function(a){return this.has(a)?this.items[a]:null},clear:function(){for(var a in this.list)this.removeItem(a)},toString:function(){return this.length+" items in "+this.name+"Storage"}}};a.store&&(c.conflict=a.store);var d=c.Store("local",function(){try{return localStorage}catch(a){}}());d.local=d,d._=c,d.area("session",function(){try{return sessionStorage}catch(a){}}()),a.store=d,"function"==typeof b&&void 0!==b.amd?b(function(){return d}):"undefined"!=typeof module&&module.exports&&(module.exports=d)}(this,this.define);
//# sourceMappingURL=store2.min.js.map

Binary file not shown.

Binary file not shown.

View file

@ -0,0 +1,18 @@
{
"assets/css/alertify.css": "assets/css/alertify-d84546f82d.css",
"assets/css/global.css": "assets/css/global-ef9dfef096.css",
"assets/css/prism.css": "assets/css/prism-5c98941a94.css",
"assets/css/projects.css": "assets/css/projects-d945298e4f.css",
"assets/css/sanitize.min.css": "assets/css/sanitize.min-535bccd783.css",
"assets/js/Autolinker.min.js": "assets/js/Autolinker.min-b46556773a.js",
"assets/js/alertify.js": "assets/js/alertify-269e23cb46.js",
"assets/js/fetch.js": "assets/js/fetch-5e9040330a.js",
"assets/js/form-save.js": "assets/js/form-save-7849d1a5f3.js",
"assets/js/links.js": "assets/js/links-ea4c99f585.js",
"assets/js/maps.js": "assets/js/maps-ffa37774ae.js",
"assets/js/marked.min.js": "assets/js/marked.min-c2a88705e2.js",
"assets/js/newnote.js": "assets/js/newnote-c1700073b7.js",
"assets/js/newplace.js": "assets/js/newplace-18722f800b.js",
"assets/js/prism.js": "assets/js/prism-f6e997bc6d.js",
"assets/js/store2.min.js": "assets/js/store2.min-c4daa8f871.js"
}

0
public/favicon.ico Normal file
View file

58
public/index.php Normal file
View file

@ -0,0 +1,58 @@
<?php
/**
* Laravel - A PHP Framework For Web Artisans
*
* @package Laravel
* @author Taylor Otwell <taylorotwell@gmail.com>
*/
/*
|--------------------------------------------------------------------------
| Register The Auto Loader
|--------------------------------------------------------------------------
|
| Composer provides a convenient, automatically generated class loader for
| our application. We just need to utilize it! We'll simply require it
| into the script here so that we don't have to worry about manual
| loading any of our classes later on. It feels nice to relax.
|
*/
require __DIR__.'/../bootstrap/autoload.php';
/*
|--------------------------------------------------------------------------
| Turn On The Lights
|--------------------------------------------------------------------------
|
| We need to illuminate PHP development, so let us turn on the lights.
| This bootstraps the framework and gets it ready for use, then it
| will load up this application so that we can run it and send
| the responses back to the browser and delight our users.
|
*/
$app = require_once __DIR__.'/../bootstrap/app.php';
/*
|--------------------------------------------------------------------------
| Run The Application
|--------------------------------------------------------------------------
|
| Once we have the application, we can handle the incoming request
| through the kernel, and send the associated response back to
| the client's browser allowing them to enjoy the creative
| and wonderful application we have prepared for them.
|
*/
$kernel = $app->make(Illuminate\Contracts\Http\Kernel::class);
$response = $kernel->handle(
$request = Illuminate\Http\Request::capture()
);
$response->send();
$kernel->terminate($request, $response);

2
public/media/.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
*
!.gitignore

2
public/robots.txt Normal file
View file

@ -0,0 +1,2 @@
User-agent: *
Disallow:

23
public/web.config Normal file
View file

@ -0,0 +1,23 @@
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Imported Rule 1" stopProcessing="true">
<match url="^(.*)/$" ignoreCase="false" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
</conditions>
<action type="Redirect" redirectType="Permanent" url="/{R:1}" />
</rule>
<rule name="Imported Rule 2" stopProcessing="true">
<match url="^" ignoreCase="false" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
</conditions>
<action type="Rewrite" url="index.php" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>