summaryrefslogtreecommitdiff
path: root/views/partials
diff options
context:
space:
mode:
Diffstat (limited to 'views/partials')
-rw-r--r--views/partials/bookmark-bookmarklet.php5
-rw-r--r--views/partials/syndication-js.php24
2 files changed, 29 insertions, 0 deletions
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=<?= $this->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('<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;
+ });
+}