From 57c82d830d04cfc930bcc62bd886b9a96fb57164 Mon Sep 17 00:00:00 2001 From: Aaron Parecki Date: Wed, 1 Aug 2018 18:35:13 -0700 Subject: if no syndication targets are found, hide the section add syndication reload button to the settings screen --- controllers/controllers.php | 1 + views/new-bookmark.php | 8 +++----- views/new-post.php | 8 +++----- views/settings.php | 48 +++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 55 insertions(+), 10 deletions(-) diff --git a/controllers/controllers.php b/controllers/controllers.php index cc74674..a5fb5be 100644 --- a/controllers/controllers.php +++ b/controllers/controllers.php @@ -483,6 +483,7 @@ $app->get('/settings', function() use($app) { render('settings', [ 'title' => 'Settings', 'user' => $user, + 'syndication_targets' => json_decode($user->syndication_targets, true), 'authorizing' => false ]); } diff --git a/views/new-bookmark.php b/views/new-bookmark.php index 35e1907..0181dae 100644 --- a/views/new-bookmark.php +++ b/views/new-bookmark.php @@ -32,11 +32,11 @@ + syndication_targets): ?>
syndication_targets) { echo '
    '; foreach($this->syndication_targets as $syn) { echo '
  • ' @@ -47,13 +47,11 @@ . '
  • '; } echo '
'; - } else { - ?>
No syndication targets were found on your site. - You can provide a list of supported syndication targets that will appear as checkboxes here.
+ + diff --git a/views/new-post.php b/views/new-post.php index b31d2be..ec74b28 100644 --- a/views/new-post.php +++ b/views/new-post.php @@ -78,11 +78,12 @@ + + syndication_targets): ?>
syndication_targets) { echo '
    '; foreach($this->syndication_targets as $syn) { echo '
  • ' @@ -93,13 +94,10 @@ . '
  • '; } echo '
'; - } else { - ?>
No syndication targets were found on your site. - You can provide a list of supported syndication targets that will appear as checkboxes here.
+
diff --git a/views/settings.php b/views/settings.php index 247aaf6..be32df8 100644 --- a/views/settings.php +++ b/views/settings.php @@ -50,11 +50,39 @@ +

Syndication Targets

+ +
+ +
+ syndication_targets) { + echo '
    '; + foreach($this->syndication_targets as $syn) { + echo '
  • ' + . '' + . '
  • '; + } + echo '
'; + } else { + ?>
No syndication targets were found on your site. + Your server can provide a list of supported syndication targets that will appear as checkboxes here.
+
+
+ + +

Twitter

Connecting a Twitter account will automatically "favorite" and "retweet" tweets on Twitter when you favorite and retweet a Twitter URL in Quill.

+

Backwards Compatibility

You can customize some of the properties that are sent in the Micropub request to work with your specific endpoint.

@@ -139,5 +167,25 @@ $(function(){ }); }); + + }); + +function reload_syndications() { + $.getJSON("/micropub/syndications", function(data){ + if(data.targets) { + $("#syndication-container").html(''); + for(var i in data.targets) { + var target = data.targets[i].target; + var uid = data.targets[i].uid; + var favicon = data.targets[i].favicon; + $("#syndication-container ul").append('
  • '); + } + bind_syndication_buttons(); + } else { + + } + console.log(data); + }); +} -- cgit v1.2.3