Mirror of Quill
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
939 B

  1. function reload_syndications() {
  2. $.getJSON("/micropub/syndications", function(data){
  3. if(data.targets) {
  4. $("#syndication-container").html('<ul></ul>');
  5. for(var i in data.targets) {
  6. var target = data.targets[i].target;
  7. var uid = data.targets[i].uid;
  8. var favicon = data.targets[i].favicon;
  9. $("#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>');
  10. }
  11. bind_syndication_buttons();
  12. } else {
  13. }
  14. console.log(data);
  15. });
  16. }
  17. function bind_syndication_buttons() {
  18. $("#syndication-container button").unbind("click").click(function(){
  19. $(this).toggleClass('btn-info');
  20. if(window.saveNoteState) {
  21. saveNoteState();
  22. }
  23. return false;
  24. });
  25. }