From cf8ecf1fc9942dc00f0a5a11b313f8babbc9c3cd Mon Sep 17 00:00:00 2001 From: Aaron Parecki Date: Sun, 7 Sep 2014 11:48:52 -0700 Subject: adds bookmark posting interface with bookmarklet. now any URL can auto-login given a login token. --- views/partials/bookmark-bookmarklet.php | 5 +++++ views/partials/syndication-js.php | 24 ++++++++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 views/partials/bookmark-bookmarklet.php create mode 100644 views/partials/syndication-js.php (limited to 'views/partials') diff --git a/views/partials/bookmark-bookmarklet.php b/views/partials/bookmark-bookmarklet.php new file mode 100644 index 0000000..a4b095d --- /dev/null +++ b/views/partials/bookmark-bookmarklet.php @@ -0,0 +1,5 @@ +javascript:(function(){ + var t;try{t=((window.getSelection&&window.getSelection())||(document.getSelection&&document.getSelection())||(document.selection&&document.selection.createRange&&document.selection.createRange().text));}catch(e){t="";}; + window.location="http://quill.dev/bookmark?url="+encodeURIComponent(window.location.href)+"&content="+encodeURIComponent('"'+t+'"')+"&name="+encodeURIComponent(document.title)+"&token=token ?>"; +})(); + 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(''); + for(var i in data.targets) { + var target = data.targets[i].target; + var favicon = data.targets[i].favicon; + $("#syndication-container ul").append('
  • '); + } + bind_syndication_buttons(); + } else { + + } + console.log(data); + }); +} + +function bind_syndication_buttons() { + $("#syndication-container button").unbind("click").click(function(){ + $(this).toggleClass('btn-info'); + return false; + }); +} -- cgit v1.2.3