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 ''; - } 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 ''; - } 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); + }); +}