diff --git a/app/Http/Controllers/Api/ApiV1Controller.php b/app/Http/Controllers/Api/ApiV1Controller.php index 43cf046b4..82a87006a 100644 --- a/app/Http/Controllers/Api/ApiV1Controller.php +++ b/app/Http/Controllers/Api/ApiV1Controller.php @@ -2459,4 +2459,126 @@ class ApiV1Controller extends Controller ->values(); return response()->json(compact('posts')); } + + /** + * GET /api/v2/statuses/{id}/replies + * + * + * @return array + */ + public function statusReplies(Request $request, $id) + { + abort_if(!$request->user(), 403); + + $this->validate($request, [ + 'limit' => 'int|min:1|max:10', + 'sort' => 'in:all,newest,popular' + ]); + + $limit = $request->input('limit', 3); + $pid = $request->user()->profile_id; + $status = StatusService::get($id); + + abort_if(!in_array($status['visibility'], ['public', 'unlisted']), 404); + + $sortBy = $request->input('sort', 'all'); + + if($sortBy == 'all' && !$request->has('cursor')) { + $ids = Cache::remember('status:replies:all:' . $id, 900, function() use($id) { + return DB::table('statuses') + ->where('in_reply_to_id', $id) + ->orderBy('id') + ->cursorPaginate(3); + }); + } else { + $ids = DB::table('statuses') + ->where('in_reply_to_id', $id) + ->when($sortBy, function($q, $sortBy) { + if($sortBy === 'all') { + return $q->orderBy('id'); + } + + if($sortBy === 'newest') { + return $q->orderByDesc('created_at'); + } + + if($sortBy === 'popular') { + return $q->orderByDesc('likes_count'); + } + }) + ->cursorPaginate($limit); + } + + $data = $ids->map(function($post) use($pid) { + $status = StatusService::get($post->id); + + if(!$status || !isset($status['id'])) { + return false; + } + + $status['favourited'] = LikeService::liked($pid, $post->id); + return $status; + }) + ->filter(function($post) { + return $post && isset($post['id']); + }) + ->values(); + + $res = [ + 'data' => $data, + 'next' => $ids->nextPageUrl() + ]; + + return $res; + } + + /** + * GET /api/v2/statuses/{id}/state + * + * + * @return array + */ + public function statusState(Request $request, $id) + { + abort_if(!$request->user(), 403); + + $status = Status::findOrFail($id); + $pid = $request->user()->profile_id; + abort_if(!in_array($status->scope, ['public', 'unlisted', 'private']), 404); + + return StatusService::getState($status->id, $pid); + } + + /** + * GET /api/v1/discover/accounts/popular + * + * + * @return array + */ + public function discoverAccountsPopular(Request $request) + { + abort_if(!$request->user(), 403); + $pid = $request->user()->profile_id; + + $ids = DB::table('profiles') + ->where('is_private', false) + ->whereNull('status') + ->orderByDesc('profiles.followers_count') + ->limit(20) + ->get(); + + $ids = $ids->map(function($profile) { + return AccountService::get($profile->id); + }) + ->filter(function($profile) use($pid) { + return $profile && + isset($profile['id']) && + !FollowerService::follows($pid, $profile['id']) && + $profile['id'] != $pid; + }) + ->take(6) + ->values(); + + return response()->json($ids, 200, [], JSON_PRETTY_PRINT|JSON_UNESCAPED_SLASHES); + } } diff --git a/app/Http/Controllers/SpaController.php b/app/Http/Controllers/SpaController.php new file mode 100644 index 000000000..ca4eb93b3 --- /dev/null +++ b/app/Http/Controllers/SpaController.php @@ -0,0 +1,99 @@ +middleware('auth'); + } + + public function index() + { + abort_unless(config('exp.spa'), 404); + return view('layouts.spa'); + } + + public function webPost(Request $request, $id) + { + abort_unless(config('exp.spa'), 404); + if($request->user()) { + return view('layouts.spa'); + } + + if(SnowflakeService::byDate(now()->subDays(30)) > $id) { + abort(404); + } + + $post = StatusService::get($id); + + if( + $post && + isset($post['url']) && + isset($post['local']) && + $post['local'] === true + ) { + return redirect($post['url']); + } + + abort(404); + } + + public function webProfile(Request $request, $id) + { + abort_unless(config('exp.spa'), 404); + if($request->user()) { + if(substr($id, 0, 1) == '@') { + $id = AccountService::usernameToId(substr($id, 1)); + return redirect("/i/web/profile/{$id}"); + } + return view('layouts.spa'); + } + + $account = AccountService::get($id); + + if($account && isset($account['url'])) { + return redirect($account['url']); + } + + return redirect('404'); + } + + public function getPrivacy() + { + $body = $this->markdownToHtml('views/page/privacy.md'); + return [ + 'body' => $body + ]; + } + + public function getTerms() + { + $body = $this->markdownToHtml('views/page/terms.md'); + return [ + 'body' => $body + ]; + } + + protected function markdownToHtml($src, $ttl = 600) + { + return Cache::remember( + 'pf:doc_cache:markdown:' . $src, + $ttl, + function() use($src) { + $path = resource_path($src); + $file = file_get_contents($path); + $converter = new CommonMarkConverter(); + return (string) $converter->convertToHtml($file); + }); + } +} diff --git a/app/Services/StatusService.php b/app/Services/StatusService.php index c13ddd58b..9f00ab2b6 100644 --- a/app/Services/StatusService.php +++ b/app/Services/StatusService.php @@ -41,6 +41,25 @@ class StatusService }); } + public static function getState($id, $pid) + { + $status = self::get($id, false); + + if(!$status) { + return [ + 'liked' => false, + 'shared' => false, + 'bookmarked' => false + ]; + } + + return [ + 'liked' => LikeService::liked($pid, $id), + 'shared' => self::isShared($id, $pid), + 'bookmarked' => self::isBookmarked($id, $pid) + ]; + } + public static function getFull($id, $pid, $publicOnly = true) { $res = self::get($id, $publicOnly); @@ -89,4 +108,24 @@ class StatusService self::get($id, false); self::get($id, true); } + + public static function isShared($id, $pid = null) + { + return $pid ? + DB::table('statuses') + ->where('reblog_of_id', $id) + ->where('profile_id', $pid) + ->exists() : + false; + } + + public static function isBookmarked($id, $pid = null) + { + return $pid ? + DB::table('bookmarks') + ->where('status_id', $id) + ->where('profile_id', $pid) + ->exists() : + false; + } } diff --git a/config/exp.php b/config/exp.php index c90a2d33b..3db8817a6 100644 --- a/config/exp.php +++ b/config/exp.php @@ -8,4 +8,6 @@ return [ 'top' => env('EXP_TOP', false), 'polls' => env('EXP_POLLS', false), 'cached_public_timeline' => env('EXP_CPT', false), + 'gps' => env('EXP_GPS', false), + 'spa' => env('EXP_SPA', false), ]; diff --git a/public/css/spa.css b/public/css/spa.css new file mode 100644 index 000000000..f0280c5e3 --- /dev/null +++ b/public/css/spa.css @@ -0,0 +1 @@ +@font-face{font-family:IBM Plex Sans;font-style:normal;font-weight:400;font-display:swap;src:url(/fonts/zYXgKVElMYYaJe8bpLHnCwDKhdzeFaxOedfTDw.woff2) format("woff2");unicode-range:U+0460-052f,U+1c80-1c88,U+20b4,U+2de0-2dff,U+a640-a69f,U+fe2e-fe2f}@font-face{font-family:IBM Plex Sans;font-style:normal;font-weight:400;font-display:swap;src:url(/fonts/zYXgKVElMYYaJe8bpLHnCwDKhdXeFaxOedfTDw.woff2) format("woff2");unicode-range:U+0400-045f,U+0490-0491,U+04b0-04b1,U+2116}@font-face{font-family:IBM Plex Sans;font-style:normal;font-weight:400;font-display:swap;src:url(/fonts/zYXgKVElMYYaJe8bpLHnCwDKhdLeFaxOedfTDw.woff2) format("woff2");unicode-range:U+0370-03ff}@font-face{font-family:IBM Plex Sans;font-style:normal;font-weight:400;font-display:swap;src:url(/fonts/zYXgKVElMYYaJe8bpLHnCwDKhd7eFaxOedfTDw.woff2) format("woff2");unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01a0-01a1,U+01af-01b0,U+1ea0-1ef9,U+20ab}@font-face{font-family:IBM Plex Sans;font-style:normal;font-weight:400;font-display:swap;src:url(/fonts/zYXgKVElMYYaJe8bpLHnCwDKhd_eFaxOedfTDw.woff2) format("woff2");unicode-range:U+0100-024f,U+0259,U+1e??,U+2020,U+20a0-20ab,U+20ad-20cf,U+2113,U+2c60-2c7f,U+a720-a7ff}@font-face{font-family:IBM Plex Sans;font-style:normal;font-weight:400;font-display:swap;src:url(/fonts/zYXgKVElMYYaJe8bpLHnCwDKhdHeFaxOedc.woff2) format("woff2");unicode-range:U+00??,U+0131,U+0152-0153,U+02bb-02bc,U+02c6,U+02da,U+02dc,U+2000-206f,U+2074,U+20ac,U+2122,U+2191,U+2193,U+2212,U+2215,U+feff,U+fffd}@font-face{font-family:IBM Plex Sans;font-style:normal;font-weight:600;font-display:swap;src:url(/fonts/zYX9KVElMYYaJe8bpLHnCwDKjQ76AIxsdP3pBmtF8A.woff2) format("woff2");unicode-range:U+0460-052f,U+1c80-1c88,U+20b4,U+2de0-2dff,U+a640-a69f,U+fe2e-fe2f}@font-face{font-family:IBM Plex Sans;font-style:normal;font-weight:600;font-display:swap;src:url(/fonts/zYX9KVElMYYaJe8bpLHnCwDKjQ76AIVsdP3pBmtF8A.woff2) format("woff2");unicode-range:U+0400-045f,U+0490-0491,U+04b0-04b1,U+2116}@font-face{font-family:IBM Plex Sans;font-style:normal;font-weight:600;font-display:swap;src:url(/fonts/zYX9KVElMYYaJe8bpLHnCwDKjQ76AIJsdP3pBmtF8A.woff2) format("woff2");unicode-range:U+0370-03ff}@font-face{font-family:IBM Plex Sans;font-style:normal;font-weight:600;font-display:swap;src:url(/fonts/zYX9KVElMYYaJe8bpLHnCwDKjQ76AI5sdP3pBmtF8A.woff2) format("woff2");unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01a0-01a1,U+01af-01b0,U+1ea0-1ef9,U+20ab}@font-face{font-family:IBM Plex Sans;font-style:normal;font-weight:600;font-display:swap;src:url(/fonts/zYX9KVElMYYaJe8bpLHnCwDKjQ76AI9sdP3pBmtF8A.woff2) format("woff2");unicode-range:U+0100-024f,U+0259,U+1e??,U+2020,U+20a0-20ab,U+20ad-20cf,U+2113,U+2c60-2c7f,U+a720-a7ff}@font-face{font-family:IBM Plex Sans;font-style:normal;font-weight:600;font-display:swap;src:url(/fonts/zYX9KVElMYYaJe8bpLHnCwDKjQ76AIFsdP3pBms.woff2) format("woff2");unicode-range:U+00??,U+0131,U+0152-0153,U+02bb-02bc,U+02c6,U+02da,U+02dc,U+2000-206f,U+2074,U+20ac,U+2122,U+2191,U+2193,U+2212,U+2215,U+feff,U+fffd}body{background:#f3f4f6;font-family:IBM Plex Sans,sans-serif}.primary{color:#3b82f6}.web-wrapper{margin-bottom:10rem}.jumbotron{border-radius:18px}.doc-body p:last-child{margin-bottom:0} \ No newline at end of file diff --git a/public/js/app.js b/public/js/app.js index 6dd8ad84e..131f168cd 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[4],{"+lRy":function(t,e){},0:function(t,e,r){r("JO1w"),r("+lRy"),r("xWuY"),r("BLqG"),t.exports=r("YfGV")},"8FsP":function(t,e){function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}!function(){var t="object"===("undefined"==typeof window?"undefined":r(window))?window:"object"===("undefined"==typeof self?"undefined":r(self))?self:this,e=t.BlobBuilder||t.WebKitBlobBuilder||t.MSBlobBuilder||t.MozBlobBuilder;t.URL=t.URL||t.webkitURL||function(t,e){return(e=document.createElement("a")).href=t,e};var n=t.Blob,o=URL.createObjectURL,i=URL.revokeObjectURL,a=t.Symbol&&t.Symbol.toStringTag,s=!1,c=!1,f=!!t.ArrayBuffer,u=e&&e.prototype.append&&e.prototype.getBlob;try{s=2===new Blob(["ä"]).size,c=2===new Blob([new Uint8Array([1,2])]).size}catch(t){}function h(t){return t.map((function(t){if(t.buffer instanceof ArrayBuffer){var e=t.buffer;if(t.byteLength!==e.byteLength){var r=new Uint8Array(t.byteLength);r.set(new Uint8Array(e,t.byteOffset,t.byteLength)),e=r.buffer}return e}return t}))}function p(t,r){r=r||{};var n=new e;return h(t).forEach((function(t){n.append(t)})),r.type?n.getBlob(r.type):n.getBlob()}function d(t,e){return new n(h(t),e||{})}t.Blob&&(p.prototype=Blob.prototype,d.prototype=Blob.prototype);var b="function"==typeof TextEncoder?TextEncoder.prototype.encode.bind(new TextEncoder):function(e){for(var r=0,n=e.length,o=t.Uint8Array||Array,i=0,a=Math.max(32,n+(n>>1)+7),s=new o(a>>3<<3);r=55296&&l<=56319){if(r=55296&&l<=56319)continue}if(i+4>s.length){a+=8,a=(a*=1+r/e.length*2)>>3<<3;var f=new Uint8Array(a);f.set(s),s=f}if(0!=(4294967168&l)){if(0==(4294965248&l))s[i++]=l>>6&31|192;else if(0==(4294901760&l))s[i++]=l>>12&15|224,s[i++]=l>>6&63|128;else{if(0!=(4292870144&l))continue;s[i++]=l>>18&7|240,s[i++]=l>>12&63|128,s[i++]=l>>6&63|128}s[i++]=63&l|128}else s[i++]=l}return s.slice(0,i)},y="function"==typeof TextDecoder?TextDecoder.prototype.decode.bind(new TextDecoder):function(t){for(var e=t.length,r=[],n=0;n239?4:l>223?3:l>191?2:1;if(n+f<=e)switch(f){case 1:l<128&&(c=l);break;case 2:128==(192&(o=t[n+1]))&&(s=(31&l)<<6|63&o)>127&&(c=s);break;case 3:o=t[n+1],i=t[n+2],128==(192&o)&&128==(192&i)&&(s=(15&l)<<12|(63&o)<<6|63&i)>2047&&(s<55296||s>57343)&&(c=s);break;case 4:o=t[n+1],i=t[n+2],a=t[n+3],128==(192&o)&&128==(192&i)&&128==(192&a)&&(s=(15&l)<<18|(63&o)<<12|(63&i)<<6|63&a)>65535&&s<1114112&&(c=s)}null===c?(c=65533,f=1):c>65535&&(c-=65536,r.push(c>>>10&1023|55296),c=56320|1023&c),r.push(c),n+=f}var u=r.length,h="";for(n=0;n>2,f=(3&o)<<4|a>>4,u=(15&a)<<2|l>>6,h=63&l;s||(h=64,i||(u=64)),r.push(e[c],e[f],e[u],e[h])}return r.join("")}var n=Object.create||function(t){function e(){}return e.prototype=t,new e};if(f)var a=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],s=ArrayBuffer.isView||function(t){return t&&a.indexOf(Object.prototype.toString.call(t))>-1};function c(r,n){n=null==n?{}:n;for(var o=0,i=(r=r||[]).length;o=e.size&&r.close()}))}})}}catch(t){try{new ReadableStream({}),g=function(t){var e=0;t=this;return new ReadableStream({pull:function(r){return t.slice(e,e+524288).arrayBuffer().then((function(n){e+=n.byteLength;var o=new Uint8Array(n);r.enqueue(o),e==t.size&&r.close()}))}})}}catch(t){try{new Response("").body.getReader().read(),g=function(){return new Response(this).body}}catch(t){g=function(){throw new Error("Include https://github.com/MattiasBuelens/web-streams-polyfill")}}}}m.arrayBuffer||(m.arrayBuffer=function(){var t=new FileReader;return t.readAsArrayBuffer(this),v(t)}),m.text||(m.text=function(){var t=new FileReader;return t.readAsText(this),v(t)}),m.stream||(m.stream=g)}(),function(t){"use strict";var e,r=t.Uint8Array,n=t.HTMLCanvasElement,o=n&&n.prototype,i=/\s*;\s*base64\s*(?:;|$)/i,a="toDataURL",s=function(t){for(var n,o,i=t.length,a=new r(i/4*3|0),s=0,l=0,c=[0,0],f=0,u=0;i--;)o=t.charCodeAt(s++),255!==(n=e[o-43])&&void 0!==n&&(c[1]=c[0],c[0]=o,u=u<<6|n,4===++f&&(a[l++]=u>>>16,61!==c[1]&&(a[l++]=u>>>8),61!==c[0]&&(a[l++]=u),f=0));return a};r&&(e=new r([62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,0,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51])),!n||o.toBlob&&o.toBlobHD||(o.toBlob||(o.toBlob=function(t,e){if(e||(e="image/png"),this.mozGetAsFile)t(this.mozGetAsFile("canvas",e));else if(this.msToBlob&&/^\s*image\/png\s*(?:$|;)/i.test(e))t(this.msToBlob());else{var n,o=Array.prototype.slice.call(arguments,1),l=this[a].apply(this,o),c=l.indexOf(","),f=l.substring(c+1),u=i.test(l.substring(0,c));Blob.fake?((n=new Blob).encoding=u?"base64":"URI",n.data=f,n.size=f.length):r&&(n=u?new Blob([s(f)],{type:e}):new Blob([decodeURIComponent(f)],{type:e})),t(n)}}),!o.toBlobHD&&o.toDataURLHD?o.toBlobHD=function(){a="toDataURLHD";var t=this.toBlob();return a="toDataURL",t}:o.toBlobHD=o.toBlob)}("undefined"!=typeof self&&self||"undefined"!=typeof window&&window||this.content||this)},"8oxB":function(t,e){var r,n,o=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(t){if(r===setTimeout)return setTimeout(t,0);if((r===i||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:i}catch(t){r=i}try{n="function"==typeof clearTimeout?clearTimeout:a}catch(t){n=a}}();var l,c=[],f=!1,u=-1;function h(){f&&l&&(f=!1,l.length?c=l.concat(c):u=-1,c.length&&p())}function p(){if(!f){var t=s(h);f=!0;for(var e=c.length;e;){for(l=c,c=[];++u1)for(var r=1;r5&&r.startsWith("https://")){var n=new URL(r);n.host!==window.location.host&&"/i/redirect"!==n.pathname&&t.setAttribute("href","/i/redirect?url="+encodeURIComponent(r))}}))},window.App.boot=function(){new Vue({el:"#content"})},window.addEventListener("load",(function(){"serviceWorker"in navigator&&navigator.serviceWorker.register("/sw.js")})),window.App.util={compose:{post:function(){var t=window.location.pathname;["/","/timeline/public"].includes(t)?$("#composeModal").modal("show"):window.location.href="/?a=co"},circle:function(){console.log("Unsupported method.")},collection:function(){console.log("Unsupported method.")},loop:function(){console.log("Unsupported method.")},story:function(){console.log("Unsupported method.")}},time:function(){return new Date},version:1,format:{count:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"en-GB",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"compact";return t<1?0:new Intl.NumberFormat(e,{notation:r,compactDisplay:"short"}).format(t)},timeAgo:function(t){var e=Date.parse(t),r=Math.floor((new Date-e)/1e3),n=Math.floor(r/63072e3);return n>=1?n+"y":(n=Math.floor(r/604800))>=1?n+"w":(n=Math.floor(r/86400))>=1?n+"d":(n=Math.floor(r/3600))>=1?n+"h":(n=Math.floor(r/60))>=1?n+"m":Math.floor(r)+"s"},timeAhead:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=Date.parse(t),n=r-Date.parse(new Date),o=Math.floor(n/1e3),i=Math.floor(o/63072e3);return i>=1?i+(e?"y":" years"):(i=Math.floor(o/604800))>=1?i+(e?"w":" weeks"):(i=Math.floor(o/86400))>=1?i+(e?"d":" days"):(i=Math.floor(o/3600))>=1?i+(e?"h":" hours"):(i=Math.floor(o/60))>=1?i+(e?"m":" minutes"):Math.floor(o)+(e?"s":" seconds")},rewriteLinks:function(t){var e=t.innerText;return t.href.startsWith(window.location.origin)?t.href:e=1==e.startsWith("#")?"/discover/tags/"+e.substr(1)+"?src=rph":1==e.startsWith("@")?"/"+t.innerText+"?src=rpp":"/i/redirect?url="+encodeURIComponent(e)}},filters:[["1977","filter-1977"],["Aden","filter-aden"],["Amaro","filter-amaro"],["Ashby","filter-ashby"],["Brannan","filter-brannan"],["Brooklyn","filter-brooklyn"],["Charmes","filter-charmes"],["Clarendon","filter-clarendon"],["Crema","filter-crema"],["Dogpatch","filter-dogpatch"],["Earlybird","filter-earlybird"],["Gingham","filter-gingham"],["Ginza","filter-ginza"],["Hefe","filter-hefe"],["Helena","filter-helena"],["Hudson","filter-hudson"],["Inkwell","filter-inkwell"],["Kelvin","filter-kelvin"],["Kuno","filter-juno"],["Lark","filter-lark"],["Lo-Fi","filter-lofi"],["Ludwig","filter-ludwig"],["Maven","filter-maven"],["Mayfair","filter-mayfair"],["Moon","filter-moon"],["Nashville","filter-nashville"],["Perpetua","filter-perpetua"],["Poprocket","filter-poprocket"],["Reyes","filter-reyes"],["Rise","filter-rise"],["Sierra","filter-sierra"],["Skyline","filter-skyline"],["Slumber","filter-slumber"],["Stinson","filter-stinson"],["Sutro","filter-sutro"],["Toaster","filter-toaster"],["Valencia","filter-valencia"],["Vesper","filter-vesper"],["Walden","filter-walden"],["Willow","filter-willow"],["X-Pro II","filter-xpro-ii"]],filterCss:{"filter-1977":"sepia(.5) hue-rotate(-30deg) saturate(1.4)","filter-aden":"sepia(.2) brightness(1.15) saturate(1.4)","filter-amaro":"sepia(.35) contrast(1.1) brightness(1.2) saturate(1.3)","filter-ashby":"sepia(.5) contrast(1.2) saturate(1.8)","filter-brannan":"sepia(.4) contrast(1.25) brightness(1.1) saturate(.9) hue-rotate(-2deg)","filter-brooklyn":"sepia(.25) contrast(1.25) brightness(1.25) hue-rotate(5deg)","filter-charmes":"sepia(.25) contrast(1.25) brightness(1.25) saturate(1.35) hue-rotate(-5deg)","filter-clarendon":"sepia(.15) contrast(1.25) brightness(1.25) hue-rotate(5deg)","filter-crema":"sepia(.5) contrast(1.25) brightness(1.15) saturate(.9) hue-rotate(-2deg)","filter-dogpatch":"sepia(.35) saturate(1.1) contrast(1.5)","filter-earlybird":"sepia(.25) contrast(1.25) brightness(1.15) saturate(.9) hue-rotate(-5deg)","filter-gingham":"contrast(1.1) brightness(1.1)","filter-ginza":"sepia(.25) contrast(1.15) brightness(1.2) saturate(1.35) hue-rotate(-5deg)","filter-hefe":"sepia(.4) contrast(1.5) brightness(1.2) saturate(1.4) hue-rotate(-10deg)","filter-helena":"sepia(.5) contrast(1.05) brightness(1.05) saturate(1.35)","filter-hudson":"sepia(.25) contrast(1.2) brightness(1.2) saturate(1.05) hue-rotate(-15deg)","filter-inkwell":"brightness(1.25) contrast(.85) grayscale(1)","filter-kelvin":"sepia(.15) contrast(1.5) brightness(1.1) hue-rotate(-10deg)","filter-juno":"sepia(.35) contrast(1.15) brightness(1.15) saturate(1.8)","filter-lark":"sepia(.25) contrast(1.2) brightness(1.3) saturate(1.25)","filter-lofi":"saturate(1.1) contrast(1.5)","filter-ludwig":"sepia(.25) contrast(1.05) brightness(1.05) saturate(2)","filter-maven":"sepia(.35) contrast(1.05) brightness(1.05) saturate(1.75)","filter-mayfair":"contrast(1.1) brightness(1.15) saturate(1.1)","filter-moon":"brightness(1.4) contrast(.95) saturate(0) sepia(.35)","filter-nashville":"sepia(.25) contrast(1.5) brightness(.9) hue-rotate(-15deg)","filter-perpetua":"contrast(1.1) brightness(1.25) saturate(1.1)","filter-poprocket":"sepia(.15) brightness(1.2)","filter-reyes":"sepia(.75) contrast(.75) brightness(1.25) saturate(1.4)","filter-rise":"sepia(.25) contrast(1.25) brightness(1.2) saturate(.9)","filter-sierra":"sepia(.25) contrast(1.5) brightness(.9) hue-rotate(-15deg)","filter-skyline":"sepia(.15) contrast(1.25) brightness(1.25) saturate(1.2)","filter-slumber":"sepia(.35) contrast(1.25) saturate(1.25)","filter-stinson":"sepia(.35) contrast(1.25) brightness(1.1) saturate(1.25)","filter-sutro":"sepia(.4) contrast(1.2) brightness(.9) saturate(1.4) hue-rotate(-10deg)","filter-toaster":"sepia(.25) contrast(1.5) brightness(.95) hue-rotate(-15deg)","filter-valencia":"sepia(.25) contrast(1.1) brightness(1.1)","filter-vesper":"sepia(.35) contrast(1.15) brightness(1.2) saturate(1.3)","filter-walden":"sepia(.35) contrast(.8) brightness(1.25) saturate(1.4)","filter-willow":"brightness(1.2) contrast(.85) saturate(.05) sepia(.2)","filter-xpro-ii":"sepia(.45) contrast(1.25) brightness(1.75) saturate(1.3) hue-rotate(-5deg)"},emoji:["😂","💯","❤️","🙌","👏","👌","😍","😯","😢","😅","😁","🙂","😎","😀","🤣","😃","😄","😆","😉","😊","😋","😘","😗","😙","😚","🤗","🤩","🤔","🤨","😐","😑","😶","🙄","😏","😣","😥","😮","🤐","😪","😫","😴","😌","😛","😜","😝","🤤","😒","😓","😔","😕","🙃","🤑","😲","🙁","😖","😞","😟","😤","😭","😦","😧","😨","😩","🤯","😬","😰","😱","😳","🤪","😵","😡","😠","🤬","😷","🤒","🤕","🤢","🤮","🤧","😇","🤠","🤡","🤥","🤫","🤭","🧐","🤓","😈","👿","👹","👺","💀","👻","👽","🤖","💩","😺","😸","😹","😻","😼","😽","🙀","😿","😾","🤲","👐","🤝","👍","👎","👊","✊","🤛","🤜","🤞","✌️","🤟","🤘","👈","👉","👆","👇","☝️","✋","🤚","🖐","🖖","👋","🤙","💪","🖕","✍️","🙏","💍","💄","💋","👄","👅","👂","👃","👣","👁","👀","🧠","🗣","👤","👥"],embed:{post:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"full",o=t+"/embed?";return o+=e?"caption=true&":"caption=false&",o+=r?"likes=true&":"likes=false&",' + @endauth + + +
+ + + +
+ + + + + diff --git a/routes/api.php b/routes/api.php index fde9963de..35e106bb1 100644 --- a/routes/api.php +++ b/routes/api.php @@ -85,6 +85,8 @@ Route::group(['prefix' => 'api'], function() use($middleware) { Route::group(['prefix' => 'v2'], function() use($middleware) { Route::get('search', 'Api\ApiV1Controller@searchV2')->middleware($middleware); + Route::get('statuses/{id}/replies', 'Api\ApiV1Controller@statusReplies')->middleware($middleware); + Route::get('statuses/{id}/state', 'Api\ApiV1Controller@statusState')->middleware($middleware); }); }); diff --git a/routes/web.php b/routes/web.php index 76f331545..951ffc993 100644 --- a/routes/web.php +++ b/routes/web.php @@ -333,6 +333,11 @@ Route::domain(config('pixelfed.domain.app'))->middleware(['validemail', 'twofact Route::get('warning', 'AccountInterstitialController@get'); Route::post('warning', 'AccountInterstitialController@read'); Route::get('my2020', 'SeasonalController@yearInReview'); + + Route::get('web/post/{id}', 'SpaController@webPost'); + Route::get('web/profile/{id}', 'SpaController@webProfile'); + Route::get('web/{q}', 'SpaController@index')->where('q', '.*'); + Route::get('web', 'SpaController@index'); }); Route::group(['prefix' => 'account'], function () {