summaryrefslogtreecommitdiff
path: root/views
diff options
context:
space:
mode:
Diffstat (limited to 'views')
-rw-r--r--views/new-post.php10
-rw-r--r--views/partials/syndication-js.php3
2 files changed, 10 insertions, 3 deletions
diff --git a/views/new-post.php b/views/new-post.php
index be5dafb..2c8c9f9 100644
--- a/views/new-post.php
+++ b/views/new-post.php
@@ -38,7 +38,12 @@
if($this->syndication_targets) {
echo '<ul>';
foreach($this->syndication_targets as $syn) {
- echo '<li><button data-syndication="'.$syn['target'].'" class="btn btn-default btn-block"><img src="'.$syn['favicon'].'" width="16" height="16"> '.$syn['target'].'</button></li>';
+ echo '<li>'
+ . '<button data-syndicate-to="'.(isset($syn['uid']) ? $syn['uid'] : $syn['target']).'" class="btn btn-default btn-block">'
+ . ($syn['favicon'] ? '<img src="'.$syn['favicon'].'" width="16" height="16"> ' : '')
+ . $syn['target']
+ . '</button>'
+ . '</li>';
}
echo '</ul>';
} else {
@@ -181,9 +186,10 @@ $(function(){
$("#btn_post").click(function(){
+ // Collect all the syndication buttons that are pressed
var syndications = [];
$("#syndication-container button.btn-info").each(function(i,btn){
- syndications.push($(btn).data('syndication'));
+ syndications.push($(btn).data('syndicate-to'));
});
var category = csv_to_array($("#note_category").val());
diff --git a/views/partials/syndication-js.php b/views/partials/syndication-js.php
index bd657f3..088cb43 100644
--- a/views/partials/syndication-js.php
+++ b/views/partials/syndication-js.php
@@ -5,8 +5,9 @@ function reload_syndications() {
$("#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-syndication="'+target+'" class="btn btn-default btn-block"><img src="'+favicon+'" width="16" height="16"> '+target+'</button></li>');
+ $("#syndication-container ul").append('<li><button data-syndicate-to="'+(uid ? uid : target)+'" class="btn btn-default btn-block">'+(favicon ? '<img src="'+favicon+'" width="16" height="16"> ':'')+target+'</button></li>');
}
bind_syndication_buttons();
} else {