From 207b13c4da1ec8bb98dedd365b0161d764195f6b Mon Sep 17 00:00:00 2001 From: ceee Date: Sat, 13 Jul 2013 00:04:35 +0200 Subject: [PATCH] sidebar fixed; syntax highlighting for code; social links; --- .../Assets/Stylesheets/Config/_colors.scss | 4 +- .../Assets/Stylesheets/Interface/_side.scss | 20 +++ .../Assets/Stylesheets/Vendor/_entypo.scss | 6 +- .../Assets/Stylesheets/Vendor/_prism.scss | 13 +- PocketSharp.Website/index.html | 126 ++++++++---------- 5 files changed, 85 insertions(+), 84 deletions(-) diff --git a/PocketSharp.Website/Assets/Stylesheets/Config/_colors.scss b/PocketSharp.Website/Assets/Stylesheets/Config/_colors.scss index 3e49868..30053f0 100644 --- a/PocketSharp.Website/Assets/Stylesheets/Config/_colors.scss +++ b/PocketSharp.Website/Assets/Stylesheets/Config/_colors.scss @@ -7,4 +7,6 @@ $lightColor: #f4f8f8; $midColor: #d9dcdc; -$textColor: white; \ No newline at end of file +$textColor: white; + +$secondaryColor: #f5b64c; \ No newline at end of file diff --git a/PocketSharp.Website/Assets/Stylesheets/Interface/_side.scss b/PocketSharp.Website/Assets/Stylesheets/Interface/_side.scss index e8d2dc7..0fe142f 100644 --- a/PocketSharp.Website/Assets/Stylesheets/Interface/_side.scss +++ b/PocketSharp.Website/Assets/Stylesheets/Interface/_side.scss @@ -4,6 +4,7 @@ { width: 280px; float: left; + position: fixed; h1 { @@ -26,4 +27,23 @@ padding: 10px 20px; font-size: 12px; } +} + +.app-social +{ + margin-top: 30px; + + a + { + width: 40px; + height: 40px; + font-size: 2em; + margin-right: 10px; + color: lighten($darkColor, 15%); + + &:hover + { + color: $secondaryColor; + } + } } \ No newline at end of file diff --git a/PocketSharp.Website/Assets/Stylesheets/Vendor/_entypo.scss b/PocketSharp.Website/Assets/Stylesheets/Vendor/_entypo.scss index 79a72d3..39d9257 100644 --- a/PocketSharp.Website/Assets/Stylesheets/Vendor/_entypo.scss +++ b/PocketSharp.Website/Assets/Stylesheets/Vendor/_entypo.scss @@ -703,9 +703,9 @@ //.entypo-cc-remix:before { // content:"\e7af" //} -//.entypo-github:before { -// content:"\f300" -//} +.entypo-github:before { + content:"\f300" +} //.entypo-github-circled:before { // content:"\f301" //} diff --git a/PocketSharp.Website/Assets/Stylesheets/Vendor/_prism.scss b/PocketSharp.Website/Assets/Stylesheets/Vendor/_prism.scss index 2d34d29..4920d36 100644 --- a/PocketSharp.Website/Assets/Stylesheets/Vendor/_prism.scss +++ b/PocketSharp.Website/Assets/Stylesheets/Vendor/_prism.scss @@ -6,13 +6,13 @@ code[class*="language-"], pre[class*="language-"] { - color: black; - text-shadow: 0 1px white; + color: white; font-family: Consolas, Monaco, 'Andale Mono', monospace; direction: ltr; text-align: left; - white-space: pre; + //white-space: pre; word-spacing: normal; + white-space: pre-wrap; -moz-tab-size: 4; -o-tab-size: 4; @@ -22,6 +22,8 @@ pre[class*="language-"] { -moz-hyphens: none; -ms-hyphens: none; hyphens: none; + border-radius: 4px; + font-size: 0.9em; } @media print { @@ -40,7 +42,7 @@ pre[class*="language-"] { :not(pre) > code[class*="language-"], pre[class*="language-"] { - background: #f5f2f0; + background: lighten(#1f2424, 3%); } /* Inline code */ @@ -68,7 +70,7 @@ pre[class*="language-"] { .token.tag, .token.boolean, .token.number { - color: #905; + color: lighten(#905, 10%); } .token.selector, @@ -83,7 +85,6 @@ pre[class*="language-"] { .language-css .token.string, .style .token.string { color: #a67f59; - background: hsla(0,0%,100%,.5); } .token.atrule, diff --git a/PocketSharp.Website/index.html b/PocketSharp.Website/index.html index 7afcda1..9a768fd 100644 --- a/PocketSharp.Website/index.html +++ b/PocketSharp.Website/index.html @@ -37,48 +37,41 @@
Install-Package PocketSharp
+
+ + +
-

PocketSharp and consists of 4 parts:

-
    -
  • Authentication
  • -
  • Retrieve
  • -
  • Modify
  • -
  • Add
  • -
-
-

If you don't know Pocket, be sure to check it out. It's an awesome service that lets you save articles, videos, ... in the cloud and access it from all your devices.

-
-

Usage Example

+

Getting Started

Request a Consumer Key on Pocket.

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

- csharp -using PocketSharp; -using PocketSharp.Models; +

using PocketSharp;
+using PocketSharp.Models;

Initialize PocketClient with:

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

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

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

- csharp -_client.Search("css").ForEach( +

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

Which will output:

-
330361896 | CSS Front-end Frameworks with comparison : By usabli.ca
+        
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!
@@ -88,8 +81,7 @@ _client.Search("css").ForEach(
         

Create an instance

Constructor:

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

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

consumerKey: The API key @@ -100,34 +92,31 @@ PocketClient(string consumerKey, string accessCode = null, Uri callbackUri = nul

Example:

- csharp -PocketClient _client = new PocketClient( +

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

You can change the Access Code after initialization:

- csharp -_client.AccessCode = "[YOU_ACCESS_CODE]"; +

_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

Receive the request code and authentication URI from the library by calling string GetRequestCode():

- csharp -string requestCode = _client.GetRequestCode(); +

string requestCode = _client.GetRequestCode();
 // 0f453f2d-1605-8584-28fd-39af8e
 Uri authenticationUri = _client.GenerateAuthenticationUri();
-// https://getpocket.com/auth/authorize?request_token=0f453f2d-1605-8584-28fd-39af8e&redirect_uri=http%253a%252f%252fceecore.com
+// https://getpocket.com/auth/authorize?request_token=0f453f2d-1605-8584-28fd-39af8e&redirect_uri=http%253a%252f%252fceecore.com

The request code is stored internally, but you can also provide it as param in GenerateAuthenticationUri(string requestCode = null).

2) Redirect to Pocket

@@ -137,9 +126,8 @@ Uri authenticationUri = _client.GenerateAuthenticationUri();

3) Get Access Code

Call string GetAccessCode(string requestCode = null)

- csharp -string accessCode = _client.GetAccessCode(); -// fa8bfc16-69b3-4d22-7db7-84a58d +

string accessCode = _client.GetAccessCode();
+// fa8bfc16-69b3-4d22-7db7-84a58d

Again, the received access code is stored internally. @@ -151,37 +139,32 @@ 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:

- csharp -List<PocketItem> items = _client.Retrieve(); -// equivalent to: _client.Retrieve(RetrieveFilter.All) +

List<PocketItem> items = _client.Retrieve();
+// equivalent to: _client.Retrieve(RetrieveFilter.All)

Find items by a tag:

- csharp -List<PocketItem> items = _client.SearchByTag("tutorial"); +

List<PocketItem> items = _client.SearchByTag("tutorial");

Find items by a search string:

- csharp -List<PocketItem> items = _client.Search("css"); +

List<PocketItem> items = _client.Search("css");

Find items by a filter:

- csharp -List<PocketItem> items = _client.Retrieve(RetrieveFilter.Favorite); // only favorites +

List<PocketItem> items = _client.Retrieve(RetrieveFilter.Favorite); // only favorites

The RetrieveFilter Enum is specified as follows:

- csharp -enum RetrieveFilter { All, Unread, Archive, Favorite, Article, Video, Image } +

enum RetrieveFilter { All, Unread, Archive, Favorite, Article, Video, Image }

Custom Parameters

You can create a completely custom parameter list for retrieval with the POCO RetrieveParameters:

- ```csharp +


 var parameters = new RetrieveParameters()
 {
 	Count = 50,
@@ -189,72 +172,67 @@ var parameters = new RetrieveParameters()
 	Sort = SortEnum.oldest
 	...
 };
+List items = _client.Retrieve(parameters);
+

-

- List - items = _client.Retrieve(parameters); -``` -

-

Add

+

Add

Adds a new item to your pocket list. Accepts four parameters, with uri being required.

- csharp -PocketItem Add(Uri uri, string[] tags = null, string title = null, string tweetID = null) +

PocketItem Add(Uri uri, string[] tags = null, string title = null, string tweetID = null)

Example:

- csharp -PocketItem newItem = _client.Add( - new Uri("http://www.neowin.net/news/full-build-2013-conference-sessions-listing-revealed"), +

PocketItem newItem = _client.Add(
+	new Uri("http:⁄⁄www.neowin.net/news/full-build-2013-conference-sessions-listing-revealed"),
 	new string[] { "microsoft", "neowin", "build" }
-);
+);

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);
+        
bool isSuccess = _client.Archive(myPocketItem);
 

Un-archive the specified item:

-
bool isSuccess = _client.Unarchive(myPocketItem);
+        
bool isSuccess = _client.Unarchive(myPocketItem);
 

Favorites the specified item:

-
bool isSuccess = _client.Favorite(myPocketItem);
+        
bool isSuccess = _client.Favorite(myPocketItem);
 

Un-favorites the specified item:

-
bool isSuccess = _client.Unfavorite(myPocketItem);
+        
bool isSuccess = _client.Unfavorite(myPocketItem);
 

Deletes the specified item:

-
bool isSuccess = _client.Delete(myPocketItem);
+        
bool isSuccess = _client.Delete(myPocketItem);
 

Modify tags

Add tags to the specified item:

-
bool isSuccess = _client.AddTags(myPocketItem, new string[] { "css", "2013" });
+        
bool isSuccess = _client.AddTags(myPocketItem, new string[] { "css", "2013" });
 

Remove tags from the specified item:

-
bool isSuccess = _client.RemoveTags(myPocketItem, new string[] { "css", "2013" });
+        
bool isSuccess = _client.RemoveTags(myPocketItem, new string[] { "css", "2013" });
 

Remove all tags from the specified item:

-
bool isSuccess = _client.RemoveTags(myPocketItem);
+        
bool isSuccess = _client.RemoveTags(myPocketItem);
 

Replaces all existing tags with new ones for the specified item:

-
bool isSuccess = _client.ReplaceTags(myPocketItem, new string[] { "css", "2013" });
+        
bool isSuccess = _client.ReplaceTags(myPocketItem, new string[] { "css", "2013" });
 

Renames a tag for the specified item:

-
bool isSuccess = _client.RenameTag(myPocketItem, "oldTagName", "newTagName");
+        
bool isSuccess = _client.RenameTag(myPocketItem, "oldTagName", "newTagName");