Merge branch 'release/0.4.2'

This commit is contained in:
Jonny Barnes 2017-03-24 14:41:52 +00:00
commit ba3d9ff97f
37 changed files with 7431 additions and 245 deletions

View file

@ -53,10 +53,10 @@ class Article extends Model
*
* @return string
*/
public function getMainAttribute($value)
public function getHtmlAttribute()
{
$markdown = new CommonMarkConverter();
$html = $markdown->convertToHtml($value);
$html = $markdown->convertToHtml($this->main);
//change <pre><code>[lang] ~> <pre><code data-language="lang">
$match = '/<pre><code>\[(.*)\]\n/';
$replace = '<pre><code class="language-$1">';

View file

@ -3,7 +3,6 @@
namespace App\Http\Controllers;
use App\Services\IndieAuthService;
use Illuminate\Support\Facades\Log;
use IndieAuth\Client as IndieClient;
use GuzzleHttp\Client as GuzzleClient;
use Illuminate\Http\{Request, Response};
@ -184,44 +183,6 @@ class MicropubClientController extends Controller
}
}
/**
* We make a request to the micropub endpoint requesting syndication targets
* and store them in the session.
*
* @todo better handling of response regarding mp-syndicate-to
* and syndicate-to
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Routing\Redirector redirect
*/
public function refreshSyndicationTargets(Request $request)
{
$domain = $request->session()->get('me');
$token = $request->session()->get('token');
$micropubEndpoint = $this->indieAuthService->discoverMicropubEndpoint($domain, $this->indieClient);
if (! $micropubEndpoint) {
return redirect(route('micropub-client'))->with('error', 'Unable to determine micropub API endpoint');
}
try {
$response = $this->guzzleClient->get($micropubEndpoint, [
'headers' => ['Authorization' => 'Bearer ' . $token],
'query' => ['q' => 'syndicate-to'],
]);
} catch (\GuzzleHttp\Exception\BadResponseException $e) {
return redirect(route('micropub-client'))->with(
'error',
'Bad response when refreshing syndication targets'
);
}
$body = (string) $response->getBody();
$syndication = $this->parseSyndicationTargets($body);
$request->session()->put('syndication', $syndication);
return redirect(route('micropub-client'));
}
/**
* This method performs the actual POST request.
*
@ -418,8 +379,6 @@ class MicropubClientController extends Controller
'query' => ['q' => $query],
]);
} catch (\GuzzleHttp\Exception\BadResponseException $e) {
Log::info($e->getResponse()->getBody());
return response()->json([
'error' => true,
'error_description' => 'The endpoint ' . $micropubEndpoint . ' returned a non-good response',

View file

@ -26,11 +26,12 @@ class NoteService
);
if (array_key_exists('location', $data) && $data['location'] !== null && $data['location'] !== 'no-location') {
if (substr($data['location'], 0, strlen(config('app.url'))) == config('app.url')) {
//uri of form http://host/places/slug, we want slug so chop off start
//that’s the app’s url plus `/places/`
$slug = mb_substr($location, mb_strlen(config('app.url')) + 8);
$place = Place::where('slug', '=', $slug)->first();
if (starts_with($data['location'], config('app.url'))) {
//uri of form http://host/places/slug, we want slug
//get the URL path, then take last part, we can hack with basename
//as path looks like file path.
$slug = basename(parse_url($data['location'], PHP_URL_PATH));
$place = Place::where('slug', $slug)->first();
$note->place()->associate($place);
}
if (substr($data['location'], 0, 4) == 'geo:') {

View file

@ -1,5 +1,10 @@
# Changelog
## Version 0.4.2 (2017-03-24)
- fixed issue#47, only the slug was being sent by client, which was messing up endpoint code
- minor changes to es6 code, bet lint-staged working again
- Make processed article content its own fake attribute, articles can now be uploaded as a file
## Version 0.4.1 (2017-03-18)
- Improve HTML Purification, target=blank rel-nofollow and rel-noopener should
now be added to external links

View file

@ -33,7 +33,8 @@
"jakub-onderka/php-parallel-lint": "^0.9.2",
"laravel/dusk": "^1.0",
"mockery/mockery": "0.9.*",
"phpunit/phpunit": "~5.7"
"phpunit/phpunit": "~5.7",
"sebastian/phpcpd": "^3.0"
},
"autoload": {
"classmap": [

216
composer.lock generated
View file

@ -4,26 +4,26 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"content-hash": "3a440750c3e5403668fd82dbe7c54de0",
"content-hash": "7cfa8f05a76283f45a0f1a30d00ecbad",
"packages": [
{
"name": "aws/aws-sdk-php",
"version": "3.24.4",
"version": "3.24.7",
"source": {
"type": "git",
"url": "https://github.com/aws/aws-sdk-php.git",
"reference": "2823e0a0742505f655b0cb3bcdb10844f60e6078"
"reference": "f062d7ea2123fe2aefef91da855c10ef8ff3af1c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/2823e0a0742505f655b0cb3bcdb10844f60e6078",
"reference": "2823e0a0742505f655b0cb3bcdb10844f60e6078",
"url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/f062d7ea2123fe2aefef91da855c10ef8ff3af1c",
"reference": "f062d7ea2123fe2aefef91da855c10ef8ff3af1c",
"shasum": ""
},
"require": {
"guzzlehttp/guzzle": "^5.3.1|^6.2.1",
"guzzlehttp/promises": "~1.0",
"guzzlehttp/psr7": "^1.3.1, !=1.4.0",
"guzzlehttp/psr7": "^1.4.1",
"mtdowling/jmespath.php": "~2.2",
"php": ">=5.5"
},
@ -84,7 +84,7 @@
"s3",
"sdk"
],
"time": "2017-03-14T00:56:44+00:00"
"time": "2017-03-23T22:17:20+00:00"
},
{
"name": "barnabywalters/mf-cleaner",
@ -980,16 +980,16 @@
},
{
"name": "guzzlehttp/psr7",
"version": "1.4.1",
"version": "1.4.2",
"source": {
"type": "git",
"url": "https://github.com/guzzle/psr7.git",
"reference": "0d6c7ca039329247e4f0f8f8f6506810e8248855"
"reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/guzzle/psr7/zipball/0d6c7ca039329247e4f0f8f8f6506810e8248855",
"reference": "0d6c7ca039329247e4f0f8f8f6506810e8248855",
"url": "https://api.github.com/repos/guzzle/psr7/zipball/f5b8a8512e2b58b0071a7280e39f14f72e05d87c",
"reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c",
"shasum": ""
},
"require": {
@ -1041,7 +1041,7 @@
"uri",
"url"
],
"time": "2017-02-27T10:51:17+00:00"
"time": "2017-03-20T17:10:46+00:00"
},
{
"name": "indieauth/client",
@ -1405,16 +1405,16 @@
},
{
"name": "laravel/framework",
"version": "v5.4.15",
"version": "v5.4.16",
"source": {
"type": "git",
"url": "https://github.com/laravel/framework.git",
"reference": "ecc6468b8af30b77566a8519ce8898740ef691d7"
"reference": "6cf379ec34d08bcdc9c7183e369a8fdf04ade80d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/laravel/framework/zipball/ecc6468b8af30b77566a8519ce8898740ef691d7",
"reference": "ecc6468b8af30b77566a8519ce8898740ef691d7",
"url": "https://api.github.com/repos/laravel/framework/zipball/6cf379ec34d08bcdc9c7183e369a8fdf04ade80d",
"reference": "6cf379ec34d08bcdc9c7183e369a8fdf04ade80d",
"shasum": ""
},
"require": {
@ -1530,7 +1530,7 @@
"framework",
"laravel"
],
"time": "2017-03-02T14:41:40+00:00"
"time": "2017-03-21T19:34:41+00:00"
},
{
"name": "laravel/scout",
@ -1779,16 +1779,16 @@
},
{
"name": "league/flysystem",
"version": "1.0.36",
"version": "1.0.37",
"source": {
"type": "git",
"url": "https://github.com/thephpleague/flysystem.git",
"reference": "d9c1698582dfbfbd092ec9c5c3325f862cdb3297"
"reference": "78b5cc4feb61a882302df4fbaf63b7662e5e4ccd"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/thephpleague/flysystem/zipball/d9c1698582dfbfbd092ec9c5c3325f862cdb3297",
"reference": "d9c1698582dfbfbd092ec9c5c3325f862cdb3297",
"url": "https://api.github.com/repos/thephpleague/flysystem/zipball/78b5cc4feb61a882302df4fbaf63b7662e5e4ccd",
"reference": "78b5cc4feb61a882302df4fbaf63b7662e5e4ccd",
"shasum": ""
},
"require": {
@ -1858,7 +1858,7 @@
"sftp",
"storage"
],
"time": "2017-03-18T16:02:30+00:00"
"time": "2017-03-22T15:43:14+00:00"
},
{
"name": "league/flysystem-aws-s3-v3",
@ -2585,16 +2585,16 @@
},
{
"name": "psy/psysh",
"version": "v0.8.2",
"version": "v0.8.3",
"source": {
"type": "git",
"url": "https://github.com/bobthecow/psysh.git",
"reference": "97113db4107a4126bef933b60fea6dbc9f615d41"
"reference": "1dd4bbbc64d71e7ec075ffe82b42d9e096dc8d5e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/bobthecow/psysh/zipball/97113db4107a4126bef933b60fea6dbc9f615d41",
"reference": "97113db4107a4126bef933b60fea6dbc9f615d41",
"url": "https://api.github.com/repos/bobthecow/psysh/zipball/1dd4bbbc64d71e7ec075ffe82b42d9e096dc8d5e",
"reference": "1dd4bbbc64d71e7ec075ffe82b42d9e096dc8d5e",
"shasum": ""
},
"require": {
@ -2654,7 +2654,7 @@
"interactive",
"shell"
],
"time": "2017-03-01T00:13:29+00:00"
"time": "2017-03-19T21:40:44+00:00"
},
{
"name": "ramsey/uuid",
@ -3861,34 +3861,37 @@
},
{
"name": "facebook/webdriver",
"version": "1.3.0",
"version": "1.4.0",
"source": {
"type": "git",
"url": "https://github.com/facebook/php-webdriver.git",
"reference": "77300c4ab2025d4316635f592ec849ca7323bd8c"
"reference": "3ea034c056189e11c0ce7985332a9f4b5b2b5db2"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/facebook/php-webdriver/zipball/77300c4ab2025d4316635f592ec849ca7323bd8c",
"reference": "77300c4ab2025d4316635f592ec849ca7323bd8c",
"url": "https://api.github.com/repos/facebook/php-webdriver/zipball/3ea034c056189e11c0ce7985332a9f4b5b2b5db2",
"reference": "3ea034c056189e11c0ce7985332a9f4b5b2b5db2",
"shasum": ""
},
"require": {
"ext-curl": "*",
"ext-zip": "*",
"php": "^5.5 || ~7.0",
"symfony/process": "^2.8 || ^3.1"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^1.11",
"friendsofphp/php-cs-fixer": "^2.0",
"php-mock/php-mock-phpunit": "^1.1",
"phpunit/phpunit": "4.6.* || ~5.0",
"satooshi/php-coveralls": "^1.0",
"squizlabs/php_codesniffer": "^2.6"
},
"suggest": {
"phpdocumentor/phpdocumentor": "2.*"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-community": "1.5-dev"
}
},
"autoload": {
"psr-4": {
"Facebook\\WebDriver\\": "lib/"
@ -3898,7 +3901,7 @@
"license": [
"Apache-2.0"
],
"description": "A PHP client for WebDriver",
"description": "A PHP client for Selenium WebDriver",
"homepage": "https://github.com/facebook/php-webdriver",
"keywords": [
"facebook",
@ -3906,7 +3909,7 @@
"selenium",
"webdriver"
],
"time": "2017-01-13T15:48:08+00:00"
"time": "2017-03-22T10:56:03+00:00"
},
{
"name": "fzaninotto/faker",
@ -4731,16 +4734,16 @@
},
{
"name": "phpunit/phpunit",
"version": "5.7.16",
"version": "5.7.17",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git",
"reference": "dafc78e2a7d12139b0e97078d1082326bd09363d"
"reference": "68752b665d3875f9a38a357e3ecb35c79f8673bf"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/dafc78e2a7d12139b0e97078d1082326bd09363d",
"reference": "dafc78e2a7d12139b0e97078d1082326bd09363d",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/68752b665d3875f9a38a357e3ecb35c79f8673bf",
"reference": "68752b665d3875f9a38a357e3ecb35c79f8673bf",
"shasum": ""
},
"require": {
@ -4809,7 +4812,7 @@
"testing",
"xunit"
],
"time": "2017-03-15T13:02:34+00:00"
"time": "2017-03-19T16:52:12+00:00"
},
{
"name": "phpunit/phpunit-mock-objects",
@ -5148,6 +5151,45 @@
],
"time": "2016-11-19T08:54:04+00:00"
},
{
"name": "sebastian/finder-facade",
"version": "1.2.1",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/finder-facade.git",
"reference": "2a6f7f57efc0aa2d23297d9fd9e2a03111a8c0b9"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/finder-facade/zipball/2a6f7f57efc0aa2d23297d9fd9e2a03111a8c0b9",
"reference": "2a6f7f57efc0aa2d23297d9fd9e2a03111a8c0b9",
"shasum": ""
},
"require": {
"symfony/finder": "~2.3|~3.0",
"theseer/fdomdocument": "~1.3"
},
"type": "library",
"autoload": {
"classmap": [
"src/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Sebastian Bergmann",
"email": "sebastian@phpunit.de",
"role": "lead"
}
],
"description": "FinderFacade is a convenience wrapper for Symfony's Finder component.",
"homepage": "https://github.com/sebastianbergmann/finder-facade",
"time": "2016-02-17T07:02:23+00:00"
},
{
"name": "sebastian/global-state",
"version": "1.1.1",
@ -5245,6 +5287,56 @@
"homepage": "https://github.com/sebastianbergmann/object-enumerator/",
"time": "2017-02-18T15:18:39+00:00"
},
{
"name": "sebastian/phpcpd",
"version": "3.0.0",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/phpcpd.git",
"reference": "d7006078b75a34c9250831c3453a2e256a687615"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/phpcpd/zipball/d7006078b75a34c9250831c3453a2e256a687615",
"reference": "d7006078b75a34c9250831c3453a2e256a687615",
"shasum": ""
},
"require": {
"php": "^5.6|^7.0",
"phpunit/php-timer": "^1.0.6",
"sebastian/finder-facade": "^1.1",
"sebastian/version": "^2.0",
"symfony/console": "^3.0"
},
"bin": [
"phpcpd"
],
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.0-dev"
}
},
"autoload": {
"classmap": [
"src/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Sebastian Bergmann",
"email": "sebastian@phpunit.de",
"role": "lead"
}
],
"description": "Copy/Paste Detector (CPD) for PHP code.",
"homepage": "https://github.com/sebastianbergmann/phpcpd",
"time": "2017-02-05T07:48:01+00:00"
},
{
"name": "sebastian/recursion-context",
"version": "2.0.0",
@ -5438,6 +5530,46 @@
"homepage": "https://symfony.com",
"time": "2017-03-07T16:47:02+00:00"
},
{
"name": "theseer/fdomdocument",
"version": "1.6.1",
"source": {
"type": "git",
"url": "https://github.com/theseer/fDOMDocument.git",
"reference": "d9ad139d6c2e8edf5e313ffbe37ff13344cf0684"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/theseer/fDOMDocument/zipball/d9ad139d6c2e8edf5e313ffbe37ff13344cf0684",
"reference": "d9ad139d6c2e8edf5e313ffbe37ff13344cf0684",
"shasum": ""
},
"require": {
"ext-dom": "*",
"lib-libxml": "*",
"php": ">=5.3.3"
},
"type": "library",
"autoload": {
"classmap": [
"src/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Arne Blankerts",
"email": "arne@blankerts.de",
"role": "lead"
}
],
"description": "The classes contained within this repository extend the standard DOM to use exceptions at all occasions of errors instead of PHP warnings or notices. They also add various custom methods and shortcuts for convenience and to simplify the usage of DOM.",
"homepage": "https://github.com/theseer/fDOMDocument",
"time": "2015-05-27T22:58:02+00:00"
},
{
"name": "webmozart/assert",
"version": "1.2.0",

12
compress Normal file → Executable file
View file

@ -1,9 +1,9 @@
#!/usr/bin/zsh
#!/usr/bin/env zsh
echo "compressing app.css and prism files"
zopfli ./public/assets/css/app.css
zopfli ./public/assets/prism/prism.css
zopfli ./public/assets/prism/prism.js
zopfli --i1000 ./public/assets/css/app.css
zopfli --i1000 ./public/assets/prism/prism.css
zopfli --i1000 ./public/assets/prism/prism.js
bro --force --quality 11 --input ./public/assets/css/app.css --output ./public/assets/css/app.css.br
bro --force --quality 11 --input ./public/assets/prism/prism.css --output ./public/assets/prism/prism.css.br
bro --force --quality 11 --input ./public/assets/prism/prism.js --output ./public/assets/prism/prism.js.br
@ -11,13 +11,13 @@ bro --force --quality 11 --input ./public/assets/prism/prism.js --output ./publi
echo "compressing js assets"
for file in ./public/assets/js/*.js
do
zopfli $file
zopfli --i1000 $file
bro --force --quality 11 --input $file --output $file.br
done
echo "compressing frontend assets"
for file in ./public/assets/frontend/*.css
do
zopfli $file
zopfli --i1000 $file
bro --force --quality 11 --input $file --output $file.br
done

View file

@ -27,7 +27,6 @@
"scripts": {
"lint-staged": "lint-staged",
"stylelint-staged": "stylelint --syntax=scss",
"eslint-staged": "eslint",
"sass": "sassc --style compressed --sourcemap resources/assets/sass/app.scss public/assets/css/app.css",
"postcss": "postcss --use autoprefixer --autoprefixer.browsers \"> 5%\" --output public/assets/css/app.css public/assets/css/app.css",
"make:css": "npm run sass && npm run postcss",
@ -38,8 +37,8 @@
"uglifyjs": "for f in ./public/assets/js/*.js; do uglifyjs $f --screw-ie8 --in-source-map $f.map --source-map $f.map --source-map-url /assets/js/`basename $f`.map --output $f; done"
},
"lint-staged": {
"eslint-staged": "resources/assets/es6/*.js",
"stylelint-staged": "resources/assets/sass/**/*.scss"
"resources/assets/es6/*.js": "eslint",
"resources/assets/sass/**/*.scss": "stylelint-staged"
},
"pre-commit": [
"lint-staged"

Binary file not shown.

View file

@ -1,2 +1,133 @@
(function(modules){var installedModules={};function __webpack_require__(moduleId){if(installedModules[moduleId])return installedModules[moduleId].exports;var module=installedModules[moduleId]={i:moduleId,l:false,exports:{}};modules[moduleId].call(module.exports,module,module.exports,__webpack_require__);module.l=true;return module.exports}__webpack_require__.m=modules;__webpack_require__.c=installedModules;__webpack_require__.i=function(value){return value};__webpack_require__.d=function(exports,name,getter){if(!__webpack_require__.o(exports,name)){Object.defineProperty(exports,name,{configurable:false,enumerable:true,get:getter})}};__webpack_require__.n=function(module){var getter=module&&module.__esModule?function getDefault(){return module["default"]}:function getModuleExports(){return module};__webpack_require__.d(getter,"a",getter);return getter};__webpack_require__.o=function(object,property){return Object.prototype.hasOwnProperty.call(object,property)};__webpack_require__.p="";return __webpack_require__(__webpack_require__.s=18)})({18:function(module,exports,__webpack_require__){"use strict";var youtubeRegex=/watch\?v=([A-Za-z0-9\-_]+)\b/;var spotifyRegex=/https\:\/\/play\.spotify\.com\/(.*)\b/;var notes=document.querySelectorAll(".e-content");var _iteratorNormalCompletion=true;var _didIteratorError=false;var _iteratorError=undefined;try{for(var _iterator=notes[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var note=_step.value;var ytid=note.textContent.match(youtubeRegex);if(ytid){var ytcontainer=document.createElement("div");ytcontainer.classList.add("container");var ytiframe=document.createElement("iframe");ytiframe.classList.add("youtube");ytiframe.setAttribute("src","https://www.youtube.com/embed/"+ytid[1]);ytiframe.setAttribute("frameborder",0);ytiframe.setAttribute("allowfullscreen","true");ytcontainer.appendChild(ytiframe);note.appendChild(ytcontainer)}var spotifyid=note.textContent.match(spotifyRegex);if(spotifyid){var sid=spotifyid[1].replace("/",":");var siframe=document.createElement("iframe");siframe.classList.add("spotify");siframe.setAttribute("src","https://embed.spotify.com/?uri=spotify:"+sid);siframe.setAttribute("frameborder",0);siframe.setAttribute("allowtransparency","true");note.appendChild(siframe)}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}}});
//# sourceMappingURL=/assets/js/links.js.map
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId])
/******/ return installedModules[moduleId].exports;
/******/
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // identity function for calling harmony imports with the correct context
/******/ __webpack_require__.i = function(value) { return value; };
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, {
/******/ configurable: false,
/******/ enumerable: true,
/******/ get: getter
/******/ });
/******/ }
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 12);
/******/ })
/************************************************************************/
/******/ ({
/***/ 12:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
//links.js
var youtubeRegex = /watch\?v=([A-Za-z0-9\-_]+)\b/;
var spotifyRegex = /https\:\/\/play\.spotify\.com\/(.*)\b/;
var notes = document.querySelectorAll('.e-content');
var _iteratorNormalCompletion = true;
var _didIteratorError = false;
var _iteratorError = undefined;
try {
for (var _iterator = notes[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
var note = _step.value;
var ytid = note.textContent.match(youtubeRegex);
if (ytid) {
var ytcontainer = document.createElement('div');
ytcontainer.classList.add('container');
var ytiframe = document.createElement('iframe');
ytiframe.classList.add('youtube');
ytiframe.setAttribute('src', 'https://www.youtube.com/embed/' + ytid[1]);
ytiframe.setAttribute('frameborder', 0);
ytiframe.setAttribute('allowfullscreen', 'true');
ytcontainer.appendChild(ytiframe);
note.appendChild(ytcontainer);
}
var spotifyid = note.textContent.match(spotifyRegex);
if (spotifyid) {
var sid = spotifyid[1].replace('/', ':');
var siframe = document.createElement('iframe');
siframe.classList.add('spotify');
siframe.setAttribute('src', 'https://embed.spotify.com/?uri=spotify:' + sid);
siframe.setAttribute('frameborder', 0);
siframe.setAttribute('allowtransparency', 'true');
note.appendChild(siframe);
}
}
} catch (err) {
_didIteratorError = true;
_iteratorError = err;
} finally {
try {
if (!_iteratorNormalCompletion && _iterator.return) {
_iterator.return();
}
} finally {
if (_didIteratorError) {
throw _iteratorError;
}
}
}
/***/ })
/******/ });
//# sourceMappingURL=links.js.map

Binary file not shown.

Binary file not shown.

File diff suppressed because one or more lines are too long

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

Some files were not shown because too many files have changed in this diff Show more