diff --git a/PocketSharp.Website/Assets/Javascripts/main.js b/PocketSharp.Website/Assets/Javascripts/main.js new file mode 100644 index 0000000..f74ac06 --- /dev/null +++ b/PocketSharp.Website/Assets/Javascripts/main.js @@ -0,0 +1,42 @@ + + +(function () +{ + var anchors = document.querySelectorAll('.app-nav a'); + + for (var i = anchors.length - 1; i >= 0; i--) + { + anchors[i].addEventListener('click', changePart, false); + } + + + + function changePart(e) + { + e.preventDefault(); + + var id = this.id; + var parts = document.querySelectorAll('div[data-part]'); + var isActive = false; + + for (var i = parts.length - 1; i >= 0; i--) + { + isActive = parts[i].getAttribute("data-part") === id; + + parts[i].style.display = isActive ? "block" : "none"; + + changeActiveClass(this); + } + } + + + function changeActiveClass(el) + { + for (var i = anchors.length - 1; i >= 0; i--) + { + anchors[i].classList.remove('is-active'); + } + el.classList.add('is-active'); + } + +})(); \ No newline at end of file diff --git a/PocketSharp.Website/Assets/Stylesheets/Interface/_main.scss b/PocketSharp.Website/Assets/Stylesheets/Interface/_main.scss index e6456ac..65d07b2 100644 --- a/PocketSharp.Website/Assets/Stylesheets/Interface/_main.scss +++ b/PocketSharp.Website/Assets/Stylesheets/Interface/_main.scss @@ -61,6 +61,16 @@ object, embed .article { color: darken($midColor, 10%); + padding-bottom: 50px; +} + +div[data-part] +{ + display: none; +} +div[data-part="gettingstarted"] +{ + display: block; } @@ -103,6 +113,7 @@ object, embed padding: 0 15px; color: white; float: left; + cursor: pointer; &.is-active { diff --git a/PocketSharp.Website/index.html b/PocketSharp.Website/index.html index 9a768fd..8a32633 100644 --- a/PocketSharp.Website/index.html +++ b/PocketSharp.Website/index.html @@ -45,69 +45,95 @@
-

Getting Started

-

Request a Consumer Key on Pocket.

-

Include the PocketSharp namespace and it's associated models (you will need them later):

-

-

using PocketSharp;
-using PocketSharp.Models;
-

-

Initialize PocketClient with:

-

-

PocketClient _client = new PocketClient("[YOUR_CONSUMER_KEY]", "[YOUR_ACCESS_CODE]");
-

-

Do a simple request - e.g. a search for CSS:

-

-

_client.Search("css").ForEach(
-	item => Console.WriteLine(item.ID + " | " + item.Title)
-);
-

-

Which will output:

-
330361896 | CSS Front-end Frameworks with comparison : By usabli.ca
-345541438 | Editr - HTML, CSS, JavaScript playground
-251743431 | CSS Architecture
-343693149 | CSS3 Transitions - Thank God We Have A Specification!
-...
-
+
+

Getting Started

+

Request a Consumer Key on Pocket.

+

Include the PocketSharp namespace and it's associated models (you will need them later):

+

+

using PocketSharp;
+  using PocketSharp.Models;
+

+

Initialize PocketClient with:

+

+

PocketClient _client = new PocketClient("[YOUR_CONSUMER_KEY]", "[YOUR_ACCESS_CODE]");
+

+

Do a simple request - e.g. a search for CSS:

+

+

_client.Search("css").ForEach(
+	  item => Console.WriteLine(item.ID + " | " + item.Title)
+  );
+

+

Which will output:

+
330361896 | CSS Front-end Frameworks with comparison : By usabli.ca
+  345541438 | Editr - HTML, CSS, JavaScript playground
+  251743431 | CSS Architecture
+  343693149 | CSS3 Transitions - Thank God We Have A Specification!
+  ...
+  
-

Create an instance

-

Constructor:

+

Create an instance

+

Constructor:

+

+

PocketClient(string consumerKey, string accessCode = null, Uri callbackUri = null)
+

+

+ consumerKey: The API key +
+ accessCode: Provide an access code if the user is already authenticated +
+ callbackUri: The callback URL is called by Pocket after authentication +

+

Example:

+

+

PocketClient _client = new PocketClient(
+	  consumerKey: "123498237423498723498723",
+	  callbackUri: new Uri("http:⁄⁄ceecore.com"),
+	  accessCode: "097809-oi987-izi8-jk98-oiuu89"
+  );
+

+

You can change the Access Code after initialization:

+

+

_client.AccessCode = "[YOU_ACCESS_CODE]";
+

+

+ Before authentication you will need to provide the callbackUri for authentication requests. +
+ After authentication you will need to provide the accessCode. +

+ +

Release History

+
    +
  • 2013-07-07 v0.3.1 authentication fixes
  • +
  • 2013-07-02 v0.3.0 update authentication process
  • +
  • 2013-06-27 v0.2.0 add, modify item & modify tags
  • +
  • 2013-06-26 v0.1.0 authentication & retrieve functionality
  • +
+

Used Packages

+ +

Contributors

-

PocketClient(string consumerKey, string accessCode = null, Uri callbackUri = null)
+ + twitter/artistandsocial   Tobias Klika @ceee

-

- consumerKey: The API key -
- accessCode: Provide an access code if the user is already authenticated -
- callbackUri: The callback URL is called by Pocket after authentication -

-

Example:

-

-

PocketClient _client = new PocketClient(
-	consumerKey: "123498237423498723498723",
-	callbackUri: new Uri("http:⁄⁄ceecore.com"),
-	accessCode: "097809-oi987-izi8-jk98-oiuu89"
-);
-

-

You can change the Access Code after initialization:

-

-

_client.AccessCode = "[YOU_ACCESS_CODE]";
-

-

- Before authentication you will need to provide the callbackUri for authentication requests. -
- After authentication you will need to provide the accessCode. -

-

Authentication

+
+ + + +
+ + +

Authentication

In order to communicate with a Pocket User, you will need a consumer key (which is generated by creating a new application on Pocket) and an Access Code.

The authentication is a 3-step process:

1) Generate authentication URI

@@ -139,7 +165,13 @@ Note that GetAccessCode can only be called with an existing req
Without it you would always have to redo the authentication process.

-

Retrieve

+ +
+ + +
+ +

Retrieve

Get list of all items:

List<PocketItem> items = _client.Retrieve();
@@ -175,7 +207,12 @@ var parameters = new RetrieveParameters()
 List items = _client.Retrieve(parameters);
 

-

Add

+ +
+ +
+ +

Add

Adds a new item to your pocket list. Accepts four parameters, with uri being required. @@ -192,7 +229,12 @@ Accepts four parameters, with uri being required.

The title can be included for cases where an item does not have a title, which is typical for image or PDF URLs. If Pocket detects a title from the content of the page, this parameter will be ignored.

If you are adding Pocket support to a Twitter client, please send along a reference to the tweet status id (with the tweetID). This allows Pocket to show the original tweet alongside the article.

-

Modify

+ +
+ +
+ +

Modify

All Modify methods accept either the itemID (as int) or a PocketItem as parameter.

Archive the specified item:

bool isSuccess = _client.Archive(myPocketItem);
@@ -235,27 +277,7 @@ Accepts four parameters, with uri being required.
         
bool isSuccess = _client.RenameTag(myPocketItem, "oldTagName", "newTagName");
 
-
-

Release History

-
    -
  • 2013-07-07 v0.3.1 authentication fixes
  • -
  • 2013-07-02 v0.3.0 update authentication process
  • -
  • 2013-06-27 v0.2.0 add, modify item & modify tags
  • -
  • 2013-06-26 v0.1.0 authentication & retrieve functionality
  • -
-

Used Packages

- -

Contributors

-

- | - twitter/artistandsocial | -|---| -| Tobias Klika @ceee | -

- +