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/dashboard.php | 317 -------------------------------- views/layout.php | 1 + views/new-bookmark.php | 106 +++++++++++ views/new-post.php | 219 ++++++++++++++++++++++ views/partials/bookmark-bookmarklet.php | 5 + views/partials/syndication-js.php | 24 +++ 6 files changed, 355 insertions(+), 317 deletions(-) delete mode 100644 views/dashboard.php create mode 100644 views/new-bookmark.php create mode 100644 views/new-post.php create mode 100644 views/partials/bookmark-bookmarklet.php create mode 100644 views/partials/syndication-js.php (limited to 'views') diff --git a/views/dashboard.php b/views/dashboard.php deleted file mode 100644 index d88a59c..0000000 --- a/views/dashboard.php +++ /dev/null @@ -1,317 +0,0 @@ -
- - -
- -
- - -
- -
- - -
- -
- - -
- -
- - -
- -
- -
- syndication_targets) { - echo '
    '; - foreach($this->syndication_targets as $syn) { - echo '
  • '; - } - echo '
'; - } else { - ?>
No syndication targets were found on your site. - You can provide a list of supported syndication targets that will appear as checkboxes here.
-
-
- -
- - - - - - - - - -
- - -
- - - - - - - - test_response): ?> -

Last response from your Micropub endpoint (response_date) ?>)

- -
test_response) ?>
- - -
-

Clicking "Post" will post this note to your Micropub endpoint. Below is some information about the request that will be made.

- - - - - - - - - - - - - - - - - - -
me (should be your URL)
scopemicropub_scope ?> (should be a space-separated list of permissions including "post")
micropub endpointmicropub_endpoint ?> (should be a URL)
access tokenString of length micropub_access_token) ?>micropub_access_token) > 0) ? (', ending in ' . substr($this->micropub_access_token, -7) . '') : '' ?> (should be greater than length 0)
-
- -
- - - - diff --git a/views/layout.php b/views/layout.php index 3d181e4..531dec9 100644 --- a/views/layout.php +++ b/views/layout.php @@ -57,6 +57,7 @@
  • New Post
  • +
  • Bookmark
  • Docs
  • diff --git a/views/new-bookmark.php b/views/new-bookmark.php new file mode 100644 index 0000000..5738036 --- /dev/null +++ b/views/new-bookmark.php @@ -0,0 +1,106 @@ +
    + + +
    + +
    + +
    + + +
    + +
    + +
    + + +
    + +
    + + +
    + +
    + + +
    + +
    + + +
    + +
    + +
    + syndication_targets) { + echo '
      '; + foreach($this->syndication_targets as $syn) { + echo '
    • '; + } + echo '
    '; + } else { + ?>
    No syndication targets were found on your site. + You can provide a list of supported syndication targets that will appear as checkboxes here.
    +
    +
    +
    + + +
    +
    + Bookmarklet: bookmark +
    + +
    + + diff --git a/views/new-post.php b/views/new-post.php new file mode 100644 index 0000000..5221dc8 --- /dev/null +++ b/views/new-post.php @@ -0,0 +1,219 @@ +
    + + +
    + +
    + + +
    + +
    + + +
    + +
    + + +
    + +
    + + +
    + +
    + +
    + syndication_targets) { + echo '
      '; + foreach($this->syndication_targets as $syn) { + echo '
    • '; + } + echo '
    '; + } else { + ?>
    No syndication targets were found on your site. + You can provide a list of supported syndication targets that will appear as checkboxes here.
    +
    +
    + +
    + + + + + + + + + +
    + + +
    + + + + + + + + test_response): ?> +

    Last response from your Micropub endpoint (response_date) ?>)

    + +
    test_response) ?>
    + + +
    +

    Clicking "Post" will post this note to your Micropub endpoint. Below is some information about the request that will be made.

    + + + + + + + + + + + + + + + + + + +
    me (should be your URL)
    scopemicropub_scope ?> (should be a space-separated list of permissions including "post")
    micropub endpointmicropub_endpoint ?> (should be a URL)
    access tokenString of length micropub_access_token) ?>micropub_access_token) > 0) ? (', ending in ' . substr($this->micropub_access_token, -7) . '') : '' ?> (should be greater than length 0)
    +
    + +
    + + + + 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