Enable URL Shortening

We make use of a YOURLS url shortening service, which is triggered
whenever the user clicks on the #url-shortener <input> box.

Signed-off-by: Pang Yan Han <pangyanhan@gmail.com>
[REFACTOR] Shift ZeroClipboard config code into `short-url-setup`

Signed-off-by: Pang Yan Han <pangyanhan@gmail.com>
Copy to clipboard <button> - get value of copied text from url-shortener <input>

Signed-off-by: Pang Yan Han <pangyanhan@gmail.com>
[REFACTOR] Add `get-short-url` function

containing the code which makes the ajax call to obtain a short url for
the current module selection.

Signed-off-by: Pang Yan Han <pangyanhan@gmail.com>
[REFACTOR] Refactor `get-short-url` function

We split the `get-short-url` function into 2 functions:
- `get-short-url-jq-evt-handler-maker` which returns a function suitable
  for a jQuery event handler that will do the checks previously done in
  the `get-short-url` function before trying to make the ajax call to
  obtain the short url
- `make-request-to-get-shorturl` which makes the ajax request to obtain
  the short url

The primary purpose of this patch is to allow reuse of the
`get-short-url-jq-evt-handler-maker` function in upcoming patches, which
will try to obtain the short url on other events.

Signed-off-by: Pang Yan Han <pangyanhan@gmail.com>
Add `SHORTENING-IN-PROGRESS` var to track urls currently being shortened

The `SHORTENING-IN-PROGRESS` var is the set of all urls currently being
sent for shortening but whose ajax requests have not yet completed.
This prevents us from making redundant ajax calls for urls that are
currently being submitted for shortening.

Signed-off-by: Pang Yan Han <pangyanhan@gmail.com>
Fire ajax call to shorten url when hovering over #copy-to-clipboard <button>

Signed-off-by: Pang Yan Han <pangyanhan@gmail.com>
Add email and twitter <buttons>

Signed-off-by: Pang Yan Han <pangyanhan@gmail.com>
Style the social sharing controls

Signed-off-by: Pang Yan Han <pangyanhan@gmail.com>
Add qtip for social sharing buttons

Signed-off-by: Pang Yan Han <pangyanhan@gmail.com>
Enable sharing short url by email

Several changes in this patch:
- We change the `SHORTENING-IN-PROGRESS` var from a set to a
  hash of url -> set of actions. This allows us to perform the set of
  actions when the url has been shortened. Currently, only the `:email`
  action is supported
- Add the `add-url-and-action-to-shortening-in-progress` function
  used for adding a url and an associated action to the
  `SHORTENING-IN-PROGRESS` hash
- Add `do-action-after-url-shortening` function to perform an action
  associated with a short url. Currently, only the `:email` action is
  supported
- Modify the `make-request-to-get-short-url` function to perform the
  actions associated with the url to be shortened after shortening is
  successful
- Modify the `get-short-url-jq-evt-handler-maker` function to take in
  an optional `actionAfterDone` arg, which is the action to be performed
  after url shortening
- Modify `get-short-url-jq-evt-handler-maker` to add new actions to a
  url that is currently being shortened but whose ajax call has not been
  completed. This allows multiple actions to be associated with a url to
  be shortened.

Signed-off-by: Pang Yan Han <pangyanhan@gmail.com>
Enable sharing of short url via twitter

Signed-off-by: Pang Yan Han <pangyanhan@gmail.com>
Rename share-by-email to share-via-email, share-on-twitter to share-via-twitter

Signed-off-by: Pang Yan Han <pangyanhan@gmail.com>
[REFACTOR] Change `get-short-url-jq-evt-handler-maker` to evt handler maker maker

So we only need to pass in the `$urlShortenerInput` and `localStorage`
once.

Signed-off-by: Pang Yan Han <pangyanhan@gmail.com>
Enable sharing via facebook

Signed-off-by: Pang Yan Han <pangyanhan@gmail.com>
Update <title>

So that it shows up better in Facebook shares

Signed-off-by: Pang Yan Han <pangyanhan@gmail.com>
Add <meta> tags for facebook opengraph

For a nicer look and feel during facebook sharing

Signed-off-by: Pang Yan Han <pangyanhan@gmail.com>