Merge branch 'release/0.0.14'

This commit is contained in:
Jonny Barnes 2016-10-07 15:34:39 +01:00
commit 4a6ff98690
13 changed files with 163 additions and 129 deletions

View file

@ -224,7 +224,7 @@ class MicropubClientController extends Controller
} }
return response()->json([ return response()->json([
'url' => $place, 'uri' => $place,
'name' => $request->input('place-name'), 'name' => $request->input('place-name'),
'latitude' => $request->input('place-latitude'), 'latitude' => $request->input('place-latitude'),
'longitude' => $request->input('place-longitude'), 'longitude' => $request->input('place-longitude'),

View file

@ -150,7 +150,7 @@ class MicropubController extends Controller
$distance = (count($matches[0]) == 3) ? 100 * $matches[0][2] : 1000; $distance = (count($matches[0]) == 3) ? 100 * $matches[0][2] : 1000;
$places = Place::near($matches[0][0], $matches[0][1], $distance); $places = Place::near($matches[0][0], $matches[0][1], $distance);
foreach ($places as $place) { foreach ($places as $place) {
$place->uri = config('app.url') . '/place/' . $place->slug; $place->uri = config('app.url') . '/places/' . $place->slug;
} }
return response()->json([ return response()->json([

View file

@ -141,10 +141,12 @@ class NotesController extends Controller
$note->placeLink = '/places/' . $note->place->slug; $note->placeLink = '/places/' . $note->place->slug;
} }
$note->photoURLs = []; $photoURLs = [];
foreach ($note->getMedia() as $photo) { $photos = $note->getMedia();
$note->photoURLs[] = $photo->getUrl(); foreach ($photos as $photo) {
$photoURLs[] = $photo->getUrl();
} }
$note->photoURLs = $photoURLs;
return view('singlenote', [ return view('singlenote', [
'note' => $note, 'note' => $note,

View file

@ -22,14 +22,14 @@ class NoteService
if ($request->header('Content-Type') == 'application/json') { if ($request->header('Content-Type') == 'application/json') {
$content = $request->input('properties.content')[0]; $content = $request->input('properties.content')[0];
$inReplyTo = $request->input('properties.in-reply-to')[0]; $inReplyTo = $request->input('properties.in-reply-to')[0];
$place = $request->input('properties.location'); $location = $request->input('properties.location');
if (is_array($place)) { if (is_array($location)) {
$place = $place[0]; $location = $location[0];
} }
} else { } else {
$content = $request->input('content'); $content = $request->input('content');
$inReplyTo = $request->input('in-reply-to'); $inReplyTo = $request->input('in-reply-to');
$place = $request->input('location'); $location = $request->input('location');
} }
$note = Note::create( $note = Note::create(
@ -40,19 +40,19 @@ class NoteService
] ]
); );
if ($place !== null && $place !== 'no-location') { if ($location !== null && $location !== 'no-location') {
if (substr($place, 0, strlen(config('app.url'))) == config('app.url')) { if (substr($location, 0, strlen(config('app.url'))) == config('app.url')) {
//uri of form http://host/place/slug, we want slug so chop off start //uri of form http://host/places/slug, we want slug so chop off start
//thats the apps url plus `/place/` //thats the apps url plus `/places/`
$slug = mb_substr($place, mb_strlen(config('app.url')) + 7); $slug = mb_substr($location, mb_strlen(config('app.url')) + 8);
$placeModel = Place::where('slug', '=', $slug)->first(); $place = Place::where('slug', '=', $slug)->first();
$note->place()->associate($placeModel); $note->place()->associate($place);
$note->save(); $note->save();
} }
if (substr($place, 0, 4) == 'geo:') { if (substr($location, 0, 4) == 'geo:') {
preg_match_all( preg_match_all(
'/([0-9\.\-]+)/', '/([0-9\.\-]+)/',
$place, $location,
$matches $matches
); );
$note->location = $matches[0][0] . ', ' . $matches[0][1]; $note->location = $matches[0][0] . ', ' . $matches[0][1];
@ -64,7 +64,7 @@ class NoteService
if ($request->hasFile('photo')) { if ($request->hasFile('photo')) {
$files = $request->file('photo'); $files = $request->file('photo');
foreach ($files as $file) { foreach ($files as $file) {
$note->addMedia($file)->toMediaLibrary('images', 's3'); $note->addMedia($file)->toCollectionOnDisk('images', 's3');
} }
} }

View file

@ -1,5 +1,10 @@
# Changelog # Changelog
## Version 0.0.14 (2016-10-07)
- Fix image upload for notes
- Allow co-ordinates to be sent by the client as a geo: URI
- Allow endpoint to process geo: URIs for location
## Version 0.0.13.9 (2016-10-06) ## Version 0.0.13.9 (2016-10-06)
- Hotfix, add missing semi-colon - Hotfix, add missing semi-colon

174
composer.lock generated
View file

@ -58,16 +58,16 @@
}, },
{ {
"name": "aws/aws-sdk-php", "name": "aws/aws-sdk-php",
"version": "3.19.12", "version": "3.19.13",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/aws/aws-sdk-php.git", "url": "https://github.com/aws/aws-sdk-php.git",
"reference": "5d5697c7bc9ab22ce718afb51e5496d0c5cb8778" "reference": "57b0efed8fcf5d8c854bc1c26cf4a685af9108d9"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/5d5697c7bc9ab22ce718afb51e5496d0c5cb8778", "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/57b0efed8fcf5d8c854bc1c26cf4a685af9108d9",
"reference": "5d5697c7bc9ab22ce718afb51e5496d0c5cb8778", "reference": "57b0efed8fcf5d8c854bc1c26cf4a685af9108d9",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -134,7 +134,7 @@
"s3", "s3",
"sdk" "sdk"
], ],
"time": "2016-09-29 21:07:49" "time": "2016-10-06 21:17:44"
}, },
{ {
"name": "barnabywalters/mf-cleaner", "name": "barnabywalters/mf-cleaner",
@ -1532,16 +1532,16 @@
}, },
{ {
"name": "laravel/framework", "name": "laravel/framework",
"version": "v5.3.15", "version": "v5.3.17",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/laravel/framework.git", "url": "https://github.com/laravel/framework.git",
"reference": "f034a02f38db77d4b0b3e89942394cae456a627f" "reference": "67fb3e638eb4d862279f50642101910163d14e61"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/laravel/framework/zipball/f034a02f38db77d4b0b3e89942394cae456a627f", "url": "https://api.github.com/repos/laravel/framework/zipball/67fb3e638eb4d862279f50642101910163d14e61",
"reference": "f034a02f38db77d4b0b3e89942394cae456a627f", "reference": "67fb3e638eb4d862279f50642101910163d14e61",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -1656,7 +1656,7 @@
"framework", "framework",
"laravel" "laravel"
], ],
"time": "2016-09-29 22:13:17" "time": "2016-10-06 18:06:32"
}, },
{ {
"name": "lcobucci/jwt", "name": "lcobucci/jwt",
@ -2891,16 +2891,16 @@
}, },
{ {
"name": "spatie/laravel-medialibrary", "name": "spatie/laravel-medialibrary",
"version": "4.9.1", "version": "4.9.2",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/spatie/laravel-medialibrary.git", "url": "https://github.com/spatie/laravel-medialibrary.git",
"reference": "bb8786724f87c2d187897809849b7dc79a84a4d9" "reference": "8799c17ca99c49718d7effe49de06b55117e8662"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/spatie/laravel-medialibrary/zipball/bb8786724f87c2d187897809849b7dc79a84a4d9", "url": "https://api.github.com/repos/spatie/laravel-medialibrary/zipball/8799c17ca99c49718d7effe49de06b55117e8662",
"reference": "bb8786724f87c2d187897809849b7dc79a84a4d9", "reference": "8799c17ca99c49718d7effe49de06b55117e8662",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -2953,7 +2953,7 @@
"media", "media",
"spatie" "spatie"
], ],
"time": "2016-09-23 11:54:31" "time": "2016-10-06 05:42:25"
}, },
{ {
"name": "spatie/pdf-to-image", "name": "spatie/pdf-to-image",
@ -3007,24 +3007,24 @@
}, },
{ {
"name": "spatie/string", "name": "spatie/string",
"version": "2.1.0", "version": "2.2.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/spatie/string.git", "url": "https://github.com/spatie/string.git",
"reference": "1843189c711be4dcf62b655824f2f17120c2dc7d" "reference": "42b433803942494ee96dabd8f763f5b455e8de1a"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/spatie/string/zipball/1843189c711be4dcf62b655824f2f17120c2dc7d", "url": "https://api.github.com/repos/spatie/string/zipball/42b433803942494ee96dabd8f763f5b455e8de1a",
"reference": "1843189c711be4dcf62b655824f2f17120c2dc7d", "reference": "42b433803942494ee96dabd8f763f5b455e8de1a",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"anahkiasen/underscore-php": "^2.0", "anahkiasen/underscore-php": "^2.0",
"php": ">=5.5.0" "php": ">=5.6.0"
}, },
"require-dev": { "require-dev": {
"phpunit/phpunit": "4.*", "phpunit/phpunit": "5.*",
"scrutinizer/ocular": "~1.1" "scrutinizer/ocular": "~1.1"
}, },
"type": "library", "type": "library",
@ -3056,7 +3056,7 @@
"spatie", "spatie",
"string" "string"
], ],
"time": "2015-11-02 13:00:37" "time": "2016-10-04 15:31:55"
}, },
{ {
"name": "swiftmailer/swiftmailer", "name": "swiftmailer/swiftmailer",
@ -3113,20 +3113,21 @@
}, },
{ {
"name": "symfony/console", "name": "symfony/console",
"version": "v3.1.4", "version": "v3.1.5",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/console.git", "url": "https://github.com/symfony/console.git",
"reference": "8ea494c34f0f772c3954b5fbe00bffc5a435e563" "reference": "6cb0872fb57b38b3b09ff213c21ed693956b9eb0"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/console/zipball/8ea494c34f0f772c3954b5fbe00bffc5a435e563", "url": "https://api.github.com/repos/symfony/console/zipball/6cb0872fb57b38b3b09ff213c21ed693956b9eb0",
"reference": "8ea494c34f0f772c3954b5fbe00bffc5a435e563", "reference": "6cb0872fb57b38b3b09ff213c21ed693956b9eb0",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": ">=5.5.9", "php": ">=5.5.9",
"symfony/debug": "~2.8|~3.0",
"symfony/polyfill-mbstring": "~1.0" "symfony/polyfill-mbstring": "~1.0"
}, },
"require-dev": { "require-dev": {
@ -3169,20 +3170,20 @@
], ],
"description": "Symfony Console Component", "description": "Symfony Console Component",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"time": "2016-08-19 06:48:39" "time": "2016-09-28 00:11:12"
}, },
{ {
"name": "symfony/debug", "name": "symfony/debug",
"version": "v3.1.4", "version": "v3.1.5",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/debug.git", "url": "https://github.com/symfony/debug.git",
"reference": "34f6ac18c2974ca5fce68adf419ee7d15def6f11" "reference": "e2b3f74a67fc928adc3c1b9027f73e1bc01190a8"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/debug/zipball/34f6ac18c2974ca5fce68adf419ee7d15def6f11", "url": "https://api.github.com/repos/symfony/debug/zipball/e2b3f74a67fc928adc3c1b9027f73e1bc01190a8",
"reference": "34f6ac18c2974ca5fce68adf419ee7d15def6f11", "reference": "e2b3f74a67fc928adc3c1b9027f73e1bc01190a8",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -3226,11 +3227,11 @@
], ],
"description": "Symfony Debug Component", "description": "Symfony Debug Component",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"time": "2016-08-23 13:39:15" "time": "2016-09-06 11:02:40"
}, },
{ {
"name": "symfony/event-dispatcher", "name": "symfony/event-dispatcher",
"version": "v3.1.4", "version": "v3.1.5",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/event-dispatcher.git", "url": "https://github.com/symfony/event-dispatcher.git",
@ -3290,16 +3291,16 @@
}, },
{ {
"name": "symfony/finder", "name": "symfony/finder",
"version": "v3.1.4", "version": "v3.1.5",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/finder.git", "url": "https://github.com/symfony/finder.git",
"reference": "e568ef1784f447a0e54dcb6f6de30b9747b0f577" "reference": "205b5ffbb518a98ba2ae60a52656c4a31ab00c6f"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/finder/zipball/e568ef1784f447a0e54dcb6f6de30b9747b0f577", "url": "https://api.github.com/repos/symfony/finder/zipball/205b5ffbb518a98ba2ae60a52656c4a31ab00c6f",
"reference": "e568ef1784f447a0e54dcb6f6de30b9747b0f577", "reference": "205b5ffbb518a98ba2ae60a52656c4a31ab00c6f",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -3335,20 +3336,20 @@
], ],
"description": "Symfony Finder Component", "description": "Symfony Finder Component",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"time": "2016-08-26 12:04:02" "time": "2016-09-28 00:11:12"
}, },
{ {
"name": "symfony/http-foundation", "name": "symfony/http-foundation",
"version": "v3.1.4", "version": "v3.1.5",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/http-foundation.git", "url": "https://github.com/symfony/http-foundation.git",
"reference": "63592e00fd90632b57ee50220a1ddb29b6bf3bb4" "reference": "5114f1becca9f29e3af94374f1689c83c1aa3d97"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/http-foundation/zipball/63592e00fd90632b57ee50220a1ddb29b6bf3bb4", "url": "https://api.github.com/repos/symfony/http-foundation/zipball/5114f1becca9f29e3af94374f1689c83c1aa3d97",
"reference": "63592e00fd90632b57ee50220a1ddb29b6bf3bb4", "reference": "5114f1becca9f29e3af94374f1689c83c1aa3d97",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -3388,20 +3389,20 @@
], ],
"description": "Symfony HttpFoundation Component", "description": "Symfony HttpFoundation Component",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"time": "2016-08-22 12:11:19" "time": "2016-09-21 20:55:10"
}, },
{ {
"name": "symfony/http-kernel", "name": "symfony/http-kernel",
"version": "v3.1.4", "version": "v3.1.5",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/http-kernel.git", "url": "https://github.com/symfony/http-kernel.git",
"reference": "aeda215d6b01f119508c090d2a09ebb5b0bc61f3" "reference": "dc339d6eebadfa6e39c52868b4d4a715eff13c69"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/http-kernel/zipball/aeda215d6b01f119508c090d2a09ebb5b0bc61f3", "url": "https://api.github.com/repos/symfony/http-kernel/zipball/dc339d6eebadfa6e39c52868b4d4a715eff13c69",
"reference": "aeda215d6b01f119508c090d2a09ebb5b0bc61f3", "reference": "dc339d6eebadfa6e39c52868b4d4a715eff13c69",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -3470,7 +3471,7 @@
], ],
"description": "Symfony HttpKernel Component", "description": "Symfony HttpKernel Component",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"time": "2016-09-03 15:28:24" "time": "2016-10-03 19:01:06"
}, },
{ {
"name": "symfony/polyfill-mbstring", "name": "symfony/polyfill-mbstring",
@ -3641,16 +3642,16 @@
}, },
{ {
"name": "symfony/process", "name": "symfony/process",
"version": "v3.1.4", "version": "v3.1.5",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/process.git", "url": "https://github.com/symfony/process.git",
"reference": "e64e93041c80e77197ace5ab9385dedb5a143697" "reference": "66de154ae86b1a07001da9fbffd620206e4faf94"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/process/zipball/e64e93041c80e77197ace5ab9385dedb5a143697", "url": "https://api.github.com/repos/symfony/process/zipball/66de154ae86b1a07001da9fbffd620206e4faf94",
"reference": "e64e93041c80e77197ace5ab9385dedb5a143697", "reference": "66de154ae86b1a07001da9fbffd620206e4faf94",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -3686,11 +3687,11 @@
], ],
"description": "Symfony Process Component", "description": "Symfony Process Component",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"time": "2016-08-16 14:58:24" "time": "2016-09-29 14:13:09"
}, },
{ {
"name": "symfony/routing", "name": "symfony/routing",
"version": "v3.1.4", "version": "v3.1.5",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/routing.git", "url": "https://github.com/symfony/routing.git",
@ -3765,16 +3766,16 @@
}, },
{ {
"name": "symfony/translation", "name": "symfony/translation",
"version": "v3.1.4", "version": "v3.1.5",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/translation.git", "url": "https://github.com/symfony/translation.git",
"reference": "a35edc277513c9bc0f063ca174c36b346f974528" "reference": "93013a18d272e59dab8e67f583155b78c68947eb"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/translation/zipball/a35edc277513c9bc0f063ca174c36b346f974528", "url": "https://api.github.com/repos/symfony/translation/zipball/93013a18d272e59dab8e67f583155b78c68947eb",
"reference": "a35edc277513c9bc0f063ca174c36b346f974528", "reference": "93013a18d272e59dab8e67f583155b78c68947eb",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -3825,20 +3826,20 @@
], ],
"description": "Symfony Translation Component", "description": "Symfony Translation Component",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"time": "2016-08-05 08:37:39" "time": "2016-09-06 11:02:40"
}, },
{ {
"name": "symfony/var-dumper", "name": "symfony/var-dumper",
"version": "v3.1.4", "version": "v3.1.5",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/var-dumper.git", "url": "https://github.com/symfony/var-dumper.git",
"reference": "62ee73706c421654a4c840028954510277f7dfc8" "reference": "70bfe927b86ba9999aeebd829715b0bb2cd39a10"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/var-dumper/zipball/62ee73706c421654a4c840028954510277f7dfc8", "url": "https://api.github.com/repos/symfony/var-dumper/zipball/70bfe927b86ba9999aeebd829715b0bb2cd39a10",
"reference": "62ee73706c421654a4c840028954510277f7dfc8", "reference": "70bfe927b86ba9999aeebd829715b0bb2cd39a10",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -3888,7 +3889,7 @@
"debug", "debug",
"dump" "dump"
], ],
"time": "2016-08-31 09:05:42" "time": "2016-09-29 14:13:09"
}, },
{ {
"name": "themattharris/tmhoauth", "name": "themattharris/tmhoauth",
@ -4851,16 +4852,16 @@
}, },
{ {
"name": "phpunit/phpunit", "name": "phpunit/phpunit",
"version": "5.5.6", "version": "5.6.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git", "url": "https://github.com/sebastianbergmann/phpunit.git",
"reference": "146e0fe0bb7f44d1cefade0c93e86fe0b206dd79" "reference": "a7f2db56518e50ab92f28f739810dfad2f223b6b"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/146e0fe0bb7f44d1cefade0c93e86fe0b206dd79", "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/a7f2db56518e50ab92f28f739810dfad2f223b6b",
"reference": "146e0fe0bb7f44d1cefade0c93e86fe0b206dd79", "reference": "a7f2db56518e50ab92f28f739810dfad2f223b6b",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -4894,7 +4895,6 @@
"ext-pdo": "*" "ext-pdo": "*"
}, },
"suggest": { "suggest": {
"ext-tidy": "*",
"ext-xdebug": "*", "ext-xdebug": "*",
"phpunit/php-invoker": "~1.1" "phpunit/php-invoker": "~1.1"
}, },
@ -4904,7 +4904,7 @@
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "5.5.x-dev" "dev-master": "5.6.x-dev"
} }
}, },
"autoload": { "autoload": {
@ -4930,20 +4930,20 @@
"testing", "testing",
"xunit" "xunit"
], ],
"time": "2016-10-03 07:48:45" "time": "2016-10-06 15:20:39"
}, },
{ {
"name": "phpunit/phpunit-mock-objects", "name": "phpunit/phpunit-mock-objects",
"version": "3.3.0", "version": "3.3.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git",
"reference": "7462c19bdb9814f6e6bdeb5cad3eb3ce72c6e0da" "reference": "03500345483e1e17b52e2e4d34a89c9408ab2902"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/7462c19bdb9814f6e6bdeb5cad3eb3ce72c6e0da", "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/03500345483e1e17b52e2e4d34a89c9408ab2902",
"reference": "7462c19bdb9814f6e6bdeb5cad3eb3ce72c6e0da", "reference": "03500345483e1e17b52e2e4d34a89c9408ab2902",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -4989,7 +4989,7 @@
"mock", "mock",
"xunit" "xunit"
], ],
"time": "2016-09-27 03:17:40" "time": "2016-10-04 11:03:26"
}, },
{ {
"name": "sebastian/code-unit-reverse-lookup", "name": "sebastian/code-unit-reverse-lookup",
@ -5506,16 +5506,16 @@
}, },
{ {
"name": "symfony/css-selector", "name": "symfony/css-selector",
"version": "v3.1.4", "version": "v3.1.5",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/css-selector.git", "url": "https://github.com/symfony/css-selector.git",
"reference": "2851e1932d77ce727776154d659b232d061e816a" "reference": "ca809c64072e0fe61c1c7fb3c76cdc32265042ac"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/css-selector/zipball/2851e1932d77ce727776154d659b232d061e816a", "url": "https://api.github.com/repos/symfony/css-selector/zipball/ca809c64072e0fe61c1c7fb3c76cdc32265042ac",
"reference": "2851e1932d77ce727776154d659b232d061e816a", "reference": "ca809c64072e0fe61c1c7fb3c76cdc32265042ac",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -5555,11 +5555,11 @@
], ],
"description": "Symfony CssSelector Component", "description": "Symfony CssSelector Component",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"time": "2016-06-29 05:41:56" "time": "2016-09-06 11:02:40"
}, },
{ {
"name": "symfony/dom-crawler", "name": "symfony/dom-crawler",
"version": "v3.1.4", "version": "v3.1.5",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/dom-crawler.git", "url": "https://github.com/symfony/dom-crawler.git",
@ -5615,16 +5615,16 @@
}, },
{ {
"name": "symfony/yaml", "name": "symfony/yaml",
"version": "v3.1.4", "version": "v3.1.5",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/yaml.git", "url": "https://github.com/symfony/yaml.git",
"reference": "f291ed25eb1435bddbe8a96caaef16469c2a092d" "reference": "368b9738d4033c8b93454cb0dbd45d305135a6d3"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/yaml/zipball/f291ed25eb1435bddbe8a96caaef16469c2a092d", "url": "https://api.github.com/repos/symfony/yaml/zipball/368b9738d4033c8b93454cb0dbd45d305135a6d3",
"reference": "f291ed25eb1435bddbe8a96caaef16469c2a092d", "reference": "368b9738d4033c8b93454cb0dbd45d305135a6d3",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -5660,7 +5660,7 @@
], ],
"description": "Symfony Yaml Component", "description": "Symfony Yaml Component",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"time": "2016-09-02 02:12:52" "time": "2016-09-25 08:27:07"
}, },
{ {
"name": "webmozart/assert", "name": "webmozart/assert",

View file

@ -29,7 +29,12 @@ return [
* When urls to files get generated this class will be called. Leave empty * When urls to files get generated this class will be called. Leave empty
* if your files are stored locally above the site root or on s3. * if your files are stored locally above the site root or on s3.
*/ */
'custom_url_generator_class' => '', 'custom_url_generator_class' => null,
/*
* The class that contains the strategy for determining a media file's path.
*/
'custom_path_generator_class' => null,
's3' => [ 's3' => [
/* /*
@ -37,4 +42,18 @@ return [
*/ */
'domain' => env('AWS_S3_URL'), 'domain' => env('AWS_S3_URL'),
], ],
'remote' => [
/**
* Any extra headers that should be included when uploading media to
* a remote disk. Even though supported headers may vary between
* different drivers, a sensible default has been provided.
*
* Supported by S3: CacheControl, Expires, StorageClass,
* ServerSideEncryption, Metadata, ACL, ContentEncoding
*/
'extra_headers' => [
'CacheControl' => 'max-age=604800',
]
],
]; ];

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.

View file

@ -71,24 +71,34 @@ function addMap(latitude, longitude, places) {
//when the location marker is dragged, if the new place form elements exist //when the location marker is dragged, if the new place form elements exist
//update the lat/lng values //update the lat/lng values
marker.on('dragend', function () { marker.on('dragend', function () {
var mapMarkerLatitude = getLatitudeFromMapboxMarker(marker.getLatLng());
var mapMarkerLongitude = getLongitudeFromMapboxMarker(marker.getLatLng());
var coordsOption = document.querySelector('#option-coords');
if (coordsOption != null) {
coordsOption.value = 'geo:' + mapMarkerLatitude + ',' + mapMarkerLongitude;
}
var placeFormLatitude = document.querySelector('#place-latitude'); var placeFormLatitude = document.querySelector('#place-latitude');
if (placeFormLatitude !== null) { if (placeFormLatitude !== null) {
placeFormLatitude.value = getLatitudeFromMapboxMarker(marker.getLatLng()); placeFormLatitude.value = mapMarkerLatitude;
} }
var placeFormLongitude = document.querySelector('#place-longitude'); var placeFormLongitude = document.querySelector('#place-longitude');
if (placeFormLongitude !== null) { if (placeFormLongitude !== null) {
placeFormLongitude.value = getLongitudeFromMapboxMarker(marker.getLatLng()); placeFormLongitude.value = mapMarkerLongitude;
} }
}); });
//create the <select> element and give it a no location default //create the <select> element and give it a no location default
var selectEl = document.createElement('select'); var selectEl = document.createElement('select');
selectEl.setAttribute('name', 'location'); selectEl.setAttribute('name', 'location');
var noLocation = document.createElement('option'); var noLocation = document.createElement('option');
noLocation.setAttribute('selected', 'selected');
noLocation.setAttribute('value', 'no-location'); noLocation.setAttribute('value', 'no-location');
var noLocText = document.createTextNode('Select no location'); noLocation.appendChild(document.createTextNode('Dont send location'));
noLocation.appendChild(noLocText);
selectEl.appendChild(noLocation); selectEl.appendChild(noLocation);
var geoLocation = document.createElement('option');
geoLocation.setAttribute('selected', 'selected');
geoLocation.setAttribute('id', 'option-coords');
geoLocation.setAttribute('value', 'geo:' + latitude + ',' + longitude);
geoLocation.appendChild(document.createTextNode('Send co-ordinates'));
selectEl.appendChild(geoLocation);
form.insertBefore(selectEl, div); form.insertBefore(selectEl, div);
if (places !== null) { if (places !== null) {
//add the places both to the map and <select> //add the places both to the map and <select>
@ -206,9 +216,6 @@ function addMap(latitude, longitude, places) {
if (placeJson.error == true) { if (placeJson.error == true) {
throw new Error(placeJson.error_description); throw new Error(placeJson.error_description);
} }
//create the slug from the url
var urlParts = placeJson.split('/');
var slug = urlParts.pop();
//remove un-needed form elements //remove un-needed form elements
form.removeChild(document.querySelector('#place-name')); form.removeChild(document.querySelector('#place-name'));
form.removeChild(document.querySelector('#place-description')); form.removeChild(document.querySelector('#place-description'));
@ -224,28 +231,29 @@ function addMap(latitude, longitude, places) {
map.removeLayer(marker); map.removeLayer(marker);
//add place marker //add place marker
var newOption = document.createElement('option'); var newOption = document.createElement('option');
newOption.setAttribute('value', slug); newOption.setAttribute('value', placeJson.uri);
newOption.appendChild(document.createTextNode(placeJson['name'])); newOption.appendChild(document.createTextNode(placeJson.name));
newOption.dataset.latitude = placeJson['latitude']; newOption.dataset.latitude = placeJson.latitude;
newOption.dataset.longitude = placeJson['longitude']; newOption.dataset.longitude = placeJson.longitude;
selectEl.appendChild(newOption); selectEl.appendChild(newOption);
var newPlaceMarker = L.marker([placeJson['latitude'], placeJson['longitude']], { var newPlaceMarker = L.marker([placeJson.latitude, placeJson.longitude], {
icon: L.mapbox.marker.icon({ icon: L.mapbox.marker.icon({
'marker-size': 'large', 'marker-size': 'large',
'marker-symbol': 'building', 'marker-symbol': 'building',
'marker-color': '#fa0' 'marker-color': '#fa0'
}) })
}).addTo(map); }).addTo(map);
var newName = 'Name: ' + placeJson['name']; map.panTo([placeJson.latitude, placeJson.longitude]);
var newName = 'Name: ' + placeJson.name;
newPlaceMarker.bindPopup(newName, { newPlaceMarker.bindPopup(newName, {
closeButton: true closeButton: true
}); });
newPlaceMarker.on('click', function () { newPlaceMarker.on('click', function () {
map.panTo([placeJson['latitude'], placeJson['longitude']]); map.panTo([placeJson.latitude, placeJson.longitude]);
selectPlace(slug); selectPlace(placeJson.uri);
}); });
//make selected //make selected
selectPlace(slug); selectPlace(placeJson.uri);
}).catch(function (placeError) { }).catch(function (placeError) {
alertify.reset(); alertify.reset();
alertify.error(placeError); alertify.error(placeError);
@ -263,8 +271,8 @@ function parseLocation(point) {
return [location[1], location[0]]; return [location[1], location[0]];
} }
function selectPlace(slug) { function selectPlace(uri) {
document.querySelector('select [value=' + slug + ']').selected = true; document.querySelector('select [value="' + uri + '"]').selected = true;
} }
function getLatitudeFromMapboxMarker(latlng) { function getLatitudeFromMapboxMarker(latlng) {

View file

@ -30,7 +30,7 @@
<main> <main>
@yield('content') @yield('content')
</main> </main>
<script src="https://use.typekit.net/kmb3cdb.js" integrity="sha384-OB5f9FHlHSvyS7naCO3mhhaMFEPYwqwcyFjiY6HdkAq3MihmBkC2KW8QmYboUwS3" crossorigin="anonymous"></script> <script src="https://use.typekit.net/kmb3cdb.js" integrity="sha384-0dhd7OudcM5zfMelBVFKeuV+wz6Y3xYrssP9G2sYBCDnCKWmcaAl9oqYzmhiSO7k" crossorigin="anonymous"></script>
<script>try{Typekit.load({ async: true });}catch(e){}</script> <script>try{Typekit.load({ async: true });}catch(e){}</script>
@section('scripts') @section('scripts')
<!--scripts go here when needed--> <!--scripts go here when needed-->