summaryrefslogtreecommitdiff
path: root/views/settings.php
diff options
context:
space:
mode:
authorAaron Parecki <aaron@parecki.com>2018-08-01 18:35:13 -0700
committerAaron Parecki <aaron@parecki.com>2018-08-01 18:35:13 -0700
commit57c82d830d04cfc930bcc62bd886b9a96fb57164 (patch)
tree90bbcccec17ada5d90cc817f06548563f86c3ecf /views/settings.php
parent782780234a4d5eefc692b14b4a620fc24444f2db (diff)
if no syndication targets are found, hide the section
add syndication reload button to the settings screen
Diffstat (limited to 'views/settings.php')
-rw-r--r--views/settings.php48
1 files changed, 48 insertions, 0 deletions
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 @@
</table>
+ <h3>Syndication Targets</h3>
+
+ <div class="form-group">
+ <label for="note_syndicate-to"><a href="javascript:reload_syndications()">Reload</a></label>
+ <div id="syndication-container">
+ <?php
+ if($this->syndication_targets) {
+ echo '<ul>';
+ foreach($this->syndication_targets as $syn) {
+ echo '<li>'
+ . '<button data-syndicate-to="'.(isset($syn['uid']) ? htmlspecialchars($syn['uid']) : htmlspecialchars($syn['target'])).'" class="btn btn-default btn-block">'
+ . ($syn['favicon'] ? '<img src="'.htmlspecialchars($syn['favicon']).'" width="16" height="16"> ' : '')
+ . htmlspecialchars($syn['target'])
+ . '</button>'
+ . '</li>';
+ }
+ echo '</ul>';
+ } else {
+ ?><div class="bs-callout bs-callout-warning">No syndication targets were found on your site.
+ Your server can provide a <a href="/docs#syndication">list of supported syndication targets</a> that will appear as checkboxes here.</div><?php
+ }
+ ?>
+ </div>
+ </div>
+
+
+
<h3>Twitter</h3>
<p>Connecting a Twitter account will automatically "favorite" and "retweet" tweets on Twitter when you favorite and retweet a Twitter URL in Quill.</p>
<input type="button" id="twitter-button" value="Checking" class="btn">
+
<h3>Backwards Compatibility</h3>
<p>You can customize some of the properties that are sent in the Micropub request to work with your specific endpoint.</p>
@@ -139,5 +167,25 @@ $(function(){
});
});
+
+
});
+
+function reload_syndications() {
+ $.getJSON("/micropub/syndications", function(data){
+ if(data.targets) {
+ $("#syndication-container").html('<ul></ul>');
+ 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('<li><button data-syndicate-to="'+htmlspecialchars(uid ? uid : target)+'" class="btn btn-default btn-block">'+(favicon ? '<img src="'+htmlspecialchars(favicon)+'" width="16" height="16"> ':'')+htmlspecialchars(target)+'</button></li>');
+ }
+ bind_syndication_buttons();
+ } else {
+
+ }
+ console.log(data);
+ });
+}
</script>