diff --git a/controllers/Controller.php b/controllers/Controller.php index 864262e..1a0a227 100644 --- a/controllers/Controller.php +++ b/controllers/Controller.php @@ -68,6 +68,27 @@ class Controller { return $response; } + public function superfeedr(Request $request, Response $response) { + session_start(); + if(session('user_id')) { + $role = $this->_get_role($request, $response); + $site = ORM::for_table('sites')->where_id_is($role->site_id)->find_one(); + } else { + $role = false; + $site = false; + } + + $response->setContent(view('superfeedr', [ + 'title' => 'Telegraph Superfeedr Documentation', + 'user' => $this->_user(), + 'accounts' => $this->_accounts(), + 'site' => $site, + 'role' => $role, + 'return_to' => $request->getRequestURI() + ])); + return $response; + } + private static function _icon_for_status($status) { switch($status) { case 'success': diff --git a/public/assets/styles.css b/public/assets/styles.css index 8fb70bf..7913bc4 100644 --- a/public/assets/styles.css +++ b/public/assets/styles.css @@ -36,3 +36,10 @@ h2.site-name:hover .edit-site { max-width: 620px; word-wrap: break-word; } + +.tutorial-image { + max-width: 100%; + -webkit-box-shadow: 0px 0px 8px 0px rgba(0,0,0,0.5); + -moz-box-shadow: 0px 0px 8px 0px rgba(0,0,0,0.5); + box-shadow: 0px 0px 8px 0px rgba(0,0,0,0.5); +} \ No newline at end of file diff --git a/public/assets/superfeedr/create-new-website.png b/public/assets/superfeedr/create-new-website.png new file mode 100644 index 0000000..67a34c9 Binary files /dev/null and b/public/assets/superfeedr/create-new-website.png differ diff --git a/public/assets/superfeedr/new-site-form.png b/public/assets/superfeedr/new-site-form.png new file mode 100644 index 0000000..a8c98d8 Binary files /dev/null and b/public/assets/superfeedr/new-site-form.png differ diff --git a/public/assets/superfeedr/site-created.png b/public/assets/superfeedr/site-created.png new file mode 100644 index 0000000..22cd114 Binary files /dev/null and b/public/assets/superfeedr/site-created.png differ diff --git a/public/assets/superfeedr/site-settings.png b/public/assets/superfeedr/site-settings.png new file mode 100644 index 0000000..634db70 Binary files /dev/null and b/public/assets/superfeedr/site-settings.png differ diff --git a/public/assets/superfeedr/superfeedr-configuration.png b/public/assets/superfeedr/superfeedr-configuration.png new file mode 100644 index 0000000..d7f0464 Binary files /dev/null and b/public/assets/superfeedr/superfeedr-configuration.png differ diff --git a/public/assets/superfeedr/superfeedr-signup.png b/public/assets/superfeedr/superfeedr-signup.png new file mode 100644 index 0000000..ee3312f Binary files /dev/null and b/public/assets/superfeedr/superfeedr-signup.png differ diff --git a/public/assets/superfeedr/telegraph-dashboard-mentions.png b/public/assets/superfeedr/telegraph-dashboard-mentions.png new file mode 100644 index 0000000..7433edb Binary files /dev/null and b/public/assets/superfeedr/telegraph-dashboard-mentions.png differ diff --git a/public/index.php b/public/index.php index 1f26c39..d2b50d1 100644 --- a/public/index.php +++ b/public/index.php @@ -28,6 +28,8 @@ $router->addRoute('GET', '/site/new', 'Controller::new_site'); $router->addRoute('GET', '/site/edit', 'Controller::new_site'); $router->addRoute('POST', '/site/save', 'Controller::save_site'); $router->addRoute('GET', '/api', 'Controller::api'); +$router->addRoute('GET', '/superfeedr', 'Controller::superfeedr'); + $router->addRoute('GET', '/webmention/{code}/details', 'Controller::webmention_details'); $router->addRoute('GET', '/dashboard/send', 'Controller::dashboard_send'); $router->addRoute('POST', '/dashboard/get_outgoing_links.json', 'Controller::get_outgoing_links'); diff --git a/views/api.php b/views/api.php index 265affd..47a4410 100644 --- a/views/api.php +++ b/views/api.php @@ -8,7 +8,7 @@ $this->layout('layout-loggedin', ['title' => $title, 'accounts' => $accounts, 'u

Telegraph API

-

Send a webmention to a specific page

+

Send a webmention to a specific page

Post to `https://telegraph.p3k.io/webmention` * `token` - your API key obtained after signing up @@ -73,7 +73,7 @@ Content-type: application/json } ``` -

Status API

+

Status API

You can poll the status URL returned after queuing a webmention for more information on the progress of sending the webmention. The response will look like the following: @@ -130,7 +130,7 @@ Other possible status codes are listed below. Other status codes may be returned depending on the receiver's status endpoint. You should only assume a webmention was successfully sent if the status is `success` or `accepted`. If the response does not contain a `location` parameter you should not continue polling the endpoint. -

Callback Events

+

Callback Events

After Telegraph processes your request, you will receive a post to the callback URL. The initial callback you receive will be one of the status codes returned by the status API. Typically, webmention endpoints defer processing until later, so normally the first callback received will indicate that the webmention was queued. This callback will normally be sent relatively quickly after you make the initial request, typically within a few seconds. diff --git a/views/layout-loggedin.php b/views/layout-loggedin.php index 0b24b00..357f678 100644 --- a/views/layout-loggedin.php +++ b/views/layout-loggedin.php @@ -10,6 +10,7 @@ Dashboard API + Superfeedr