You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

60 lines
1.9 KiB

  1. <div class="narrow">
  2. <?= partial('partials/header') ?>
  3. <h2>Signed In As</h2>
  4. <table class="table table-condensed">
  5. <tr>
  6. <td>me</td>
  7. <td><code><?= $this->user->url; ?></code> (should be your URL)</td>
  8. </tr>
  9. <tr>
  10. <td>scope</td>
  11. <td><code><?= $this->user->micropub_scope ?></code> (should be a space-separated list of permissions including "create")</td>
  12. </tr>
  13. <tr>
  14. <td>micropub endpoint</td>
  15. <td><code><?= $this->user->micropub_endpoint ?></code> (should be a URL)</td>
  16. </tr>
  17. <tr>
  18. <td>media endpoint</td>
  19. <td><?= $this->user->media_endpoint ? '<code>'.$this->user->media_endpoint.'</code>' : '<a href="https://www.w3.org/TR/micropub/#media-endpoint">no media endpoint</a>' ?></td>
  20. </tr>
  21. <tr>
  22. <td width="140">access token</td>
  23. <td><code style="word-break: break-word; white-space: pre-wrap;"><?= $this->user->micropub_access_token ?></code></td>
  24. </tr>
  25. </table>
  26. <h3>Twitter</h3>
  27. <p>Connecting a Twitter account will automatically "favorite" and "retweet" tweets on Twitter when you favorite and retweet a Twitter URL in Quill.</p>
  28. <input type="button" id="twitter-button" value="Checking" class="btn">
  29. </div>
  30. <script>
  31. $(function(){
  32. $.getJSON("/auth/twitter", function(data){
  33. // Check if we're already authorized with twitter
  34. if(data && data.result == 'ok') {
  35. $("#twitter-button").val("Connected").addClass("btn-success");
  36. } else if(data && data.url) {
  37. $("#twitter-button").val("Sign In").data("url", data.url).addClass("btn-warning");
  38. } else {
  39. $("#twitter-button").val("Error").addClass("btn-danger");
  40. }
  41. });
  42. $("#twitter-button").click(function(){
  43. if($(this).data('url')) {
  44. window.location = $(this).data('url');
  45. } else {
  46. $.getJSON("/auth/twitter", {login: 1}, function(data){
  47. window.location = data.url;
  48. });
  49. }
  50. });
  51. });
  52. </script>