summaryrefslogtreecommitdiff
path: root/views/partials/syndication-js.php
diff options
context:
space:
mode:
Diffstat (limited to 'views/partials/syndication-js.php')
-rw-r--r--views/partials/syndication-js.php24
1 files changed, 24 insertions, 0 deletions
diff --git a/views/partials/syndication-js.php b/views/partials/syndication-js.php
new file mode 100644
index 0000000..bd657f3
--- /dev/null
+++ b/views/partials/syndication-js.php
@@ -0,0 +1,24 @@
+
+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 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>');
+ }
+ bind_syndication_buttons();
+ } else {
+
+ }
+ console.log(data);
+ });
+}
+
+function bind_syndication_buttons() {
+ $("#syndication-container button").unbind("click").click(function(){
+ $(this).toggleClass('btn-info');
+ return false;
+ });
+}