diff --git a/.hg/00changelog.i b/.hg/00changelog.i new file mode 100644 index 00000000000..d3a8311050e Binary files /dev/null and b/.hg/00changelog.i differ diff --git a/.hg/cur-message.txt b/.hg/cur-message.txt new file mode 100644 index 00000000000..e69de29bb2d diff --git a/.hg/hgrc b/.hg/hgrc new file mode 100644 index 00000000000..9681297c194 --- /dev/null +++ b/.hg/hgrc @@ -0,0 +1 @@ +# Generated by TortoiseHg diff --git a/.hg/requires b/.hg/requires new file mode 100644 index 00000000000..f634f664bf3 --- /dev/null +++ b/.hg/requires @@ -0,0 +1,4 @@ +dotencode +fncache +revlogv1 +store diff --git a/.hg/thgstatus b/.hg/thgstatus new file mode 100644 index 00000000000..e69de29bb2d diff --git a/CHANGELOG.md b/CHANGELOG.md index 59ee6a441e5..ee496db6c9b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ ## Version 1.2 -*June 20, 2014* +*June 20, 2015* **Fixes:** diff --git a/Gemfile b/Gemfile index 3a2a2e01a82..bac215a9ea1 100644 --- a/Gemfile +++ b/Gemfile @@ -6,7 +6,7 @@ gem 'middleman-gh-pages', '~> 0.0.3' gem 'middleman-syntax', '~> 2.0.0' gem 'middleman-autoprefixer', '~> 2.4.4' gem 'rouge', '~> 1.9.0' -gem 'redcarpet', '~> 3.3.1' +gem 'redcarpet', '~> 3.3.3' gem 'rake', '~> 10.4.2' gem 'therubyracer', '~> 0.12.1', platforms: :ruby diff --git a/Gemfile.lock b/Gemfile.lock index f9978492816..201af97e7ca 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -32,10 +32,12 @@ GEM erubis (2.7.0) execjs (2.5.2) ffi (1.9.8) + ffi (1.9.8-x86-mingw32) haml (4.0.6) tilt hike (1.2.3) - hitimes (1.2.2) + hitimes (1.2.3) + hitimes (1.2.3-x86-mingw32) hooks (0.4.0) uber (~> 0.0.4) i18n (0.7.0) @@ -97,7 +99,7 @@ GEM rb-fsevent (0.9.5) rb-inotify (0.9.5) ffi (>= 0.5.0) - redcarpet (3.3.1) + redcarpet (3.3.3) ref (1.0.5) rouge (1.9.0) sass (3.4.14) @@ -128,6 +130,7 @@ GEM PLATFORMS ruby + x86-mingw32 DEPENDENCIES middleman (~> 3.3.10) @@ -135,6 +138,9 @@ DEPENDENCIES middleman-gh-pages (~> 0.0.3) middleman-syntax (~> 2.0.0) rake (~> 10.4.2) - redcarpet (~> 3.3.1) + redcarpet (~> 3.3.3) rouge (~> 1.9.0) therubyracer (~> 0.12.1) + +BUNDLED WITH + 1.10.6 diff --git a/README.md b/README.md index efb7e1eb8cd..98c03e4a6b1 100644 --- a/README.md +++ b/README.md @@ -91,6 +91,11 @@ Examples of Slate in the Wild * [viagogo API Documentation](http://developer.viagogo.net/) * [Fidor Bank API Documentation](http://docs.fidor.de/) * [Market Prophit API Documentation](http://developer.marketprophit.com/) +* [OAuth.io API Documentation](http://docs.oauth.io/) +* [Aircall for Developers](http://developer.aircall.io/) +* [SupportKit API Docs](http://docs.supportkit.io/) +* [SocialRadar's LocationKit Docs](https://docs.locationkit.io/) +* [SafetyCulture API Documentation](https://developer.safetyculture.io/) (Feel free to add your site to this list in a pull request!) diff --git a/config.rb b/config.rb index 43bceaa5a43..346f172f32b 100644 --- a/config.rb +++ b/config.rb @@ -1,5 +1,6 @@ # Markdown -set :markdown_engine, :redcarpet +# set :markdown_engine, :redcarpet +set :markdown_engine, :kramdown set :markdown, fenced_code_blocks: true, smartypants: true, diff --git a/source/fonts/lato/lato-bol-webfont-g.eot b/source/fonts/lato/lato-bol-webfont-g.eot new file mode 100644 index 00000000000..70bcada1b7d Binary files /dev/null and b/source/fonts/lato/lato-bol-webfont-g.eot differ diff --git a/source/fonts/lato/lato-bol-webfont-g.ttf b/source/fonts/lato/lato-bol-webfont-g.ttf new file mode 100644 index 00000000000..74343694e2b Binary files /dev/null and b/source/fonts/lato/lato-bol-webfont-g.ttf differ diff --git a/source/fonts/lato/lato-bol-webfont-g.woff b/source/fonts/lato/lato-bol-webfont-g.woff new file mode 100644 index 00000000000..eba023931c0 Binary files /dev/null and b/source/fonts/lato/lato-bol-webfont-g.woff differ diff --git a/source/fonts/lato/lato-bol-webfont.svg b/source/fonts/lato/lato-bol-webfont.svg new file mode 100644 index 00000000000..0d9a336af62 --- /dev/null +++ b/source/fonts/lato/lato-bol-webfont.svg @@ -0,0 +1,244 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/source/fonts/lato/lato-bolita-webfont-g.eot b/source/fonts/lato/lato-bolita-webfont-g.eot new file mode 100644 index 00000000000..7a73a9566b2 Binary files /dev/null and b/source/fonts/lato/lato-bolita-webfont-g.eot differ diff --git a/source/fonts/lato/lato-bolita-webfont-g.ttf b/source/fonts/lato/lato-bolita-webfont-g.ttf new file mode 100644 index 00000000000..684aacf5b4f Binary files /dev/null and b/source/fonts/lato/lato-bolita-webfont-g.ttf differ diff --git a/source/fonts/lato/lato-bolita-webfont-g.woff b/source/fonts/lato/lato-bolita-webfont-g.woff new file mode 100644 index 00000000000..00bd1cb15eb Binary files /dev/null and b/source/fonts/lato/lato-bolita-webfont-g.woff differ diff --git a/source/fonts/lato/lato-bolita-webfont.svg b/source/fonts/lato/lato-bolita-webfont.svg new file mode 100644 index 00000000000..f13e44e7716 --- /dev/null +++ b/source/fonts/lato/lato-bolita-webfont.svg @@ -0,0 +1,253 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/source/fonts/lato/lato-lig-webfont-g.eot b/source/fonts/lato/lato-lig-webfont-g.eot new file mode 100644 index 00000000000..d95b3e85a6d Binary files /dev/null and b/source/fonts/lato/lato-lig-webfont-g.eot differ diff --git a/source/fonts/lato/lato-lig-webfont-g.ttf b/source/fonts/lato/lato-lig-webfont-g.ttf new file mode 100644 index 00000000000..a958067a86f Binary files /dev/null and b/source/fonts/lato/lato-lig-webfont-g.ttf differ diff --git a/source/fonts/lato/lato-lig-webfont-g.woff b/source/fonts/lato/lato-lig-webfont-g.woff new file mode 100644 index 00000000000..5c0b7f60561 Binary files /dev/null and b/source/fonts/lato/lato-lig-webfont-g.woff differ diff --git a/source/fonts/lato/lato-lig-webfont.svg b/source/fonts/lato/lato-lig-webfont.svg new file mode 100644 index 00000000000..7957db932b2 --- /dev/null +++ b/source/fonts/lato/lato-lig-webfont.svg @@ -0,0 +1,244 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/source/fonts/lato/lato-ligita-webfont-g.eot b/source/fonts/lato/lato-ligita-webfont-g.eot new file mode 100644 index 00000000000..d525402bc7f Binary files /dev/null and b/source/fonts/lato/lato-ligita-webfont-g.eot differ diff --git a/source/fonts/lato/lato-ligita-webfont-g.ttf b/source/fonts/lato/lato-ligita-webfont-g.ttf new file mode 100644 index 00000000000..5e45ad9a6c9 Binary files /dev/null and b/source/fonts/lato/lato-ligita-webfont-g.ttf differ diff --git a/source/fonts/lato/lato-ligita-webfont-g.woff b/source/fonts/lato/lato-ligita-webfont-g.woff new file mode 100644 index 00000000000..b1e2fa3b7a3 Binary files /dev/null and b/source/fonts/lato/lato-ligita-webfont-g.woff differ diff --git a/source/fonts/lato/lato-ligita-webfont.svg b/source/fonts/lato/lato-ligita-webfont.svg new file mode 100644 index 00000000000..117ef31dd3e --- /dev/null +++ b/source/fonts/lato/lato-ligita-webfont.svg @@ -0,0 +1,253 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/source/fonts/lato/lato-reg-webfont-g.eot b/source/fonts/lato/lato-reg-webfont-g.eot new file mode 100644 index 00000000000..31d3585eabb Binary files /dev/null and b/source/fonts/lato/lato-reg-webfont-g.eot differ diff --git a/source/fonts/lato/lato-reg-webfont-g.ttf b/source/fonts/lato/lato-reg-webfont-g.ttf new file mode 100644 index 00000000000..04ea8efb136 Binary files /dev/null and b/source/fonts/lato/lato-reg-webfont-g.ttf differ diff --git a/source/fonts/lato/lato-reg-webfont-g.woff b/source/fonts/lato/lato-reg-webfont-g.woff new file mode 100644 index 00000000000..c62bcc9929b Binary files /dev/null and b/source/fonts/lato/lato-reg-webfont-g.woff differ diff --git a/source/fonts/lato/lato-reg-webfont.svg b/source/fonts/lato/lato-reg-webfont.svg new file mode 100644 index 00000000000..2d5354004be --- /dev/null +++ b/source/fonts/lato/lato-reg-webfont.svg @@ -0,0 +1,244 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/source/fonts/lato/lato-regita-webfont-g.eot b/source/fonts/lato/lato-regita-webfont-g.eot new file mode 100644 index 00000000000..38b94be82f3 Binary files /dev/null and b/source/fonts/lato/lato-regita-webfont-g.eot differ diff --git a/source/fonts/lato/lato-regita-webfont-g.ttf b/source/fonts/lato/lato-regita-webfont-g.ttf new file mode 100644 index 00000000000..3d3b7a2984a Binary files /dev/null and b/source/fonts/lato/lato-regita-webfont-g.ttf differ diff --git a/source/fonts/lato/lato-regita-webfont-g.woff b/source/fonts/lato/lato-regita-webfont-g.woff new file mode 100644 index 00000000000..3d0dfadd2f5 Binary files /dev/null and b/source/fonts/lato/lato-regita-webfont-g.woff differ diff --git a/source/fonts/lato/lato-regita-webfont.svg b/source/fonts/lato/lato-regita-webfont.svg new file mode 100644 index 00000000000..e077164850a --- /dev/null +++ b/source/fonts/lato/lato-regita-webfont.svg @@ -0,0 +1,253 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/source/images/logo.bak.png b/source/images/logo.bak.png new file mode 100644 index 00000000000..fa1f13da819 Binary files /dev/null and b/source/images/logo.bak.png differ diff --git a/source/images/logo.png b/source/images/logo.png index fa1f13da819..4b19eeb5d14 100644 Binary files a/source/images/logo.png and b/source/images/logo.png differ diff --git a/source/includes/_errors.md b/source/includes/_errors.md index 56cffb34d22..be05f3cb41d 100644 --- a/source/includes/_errors.md +++ b/source/includes/_errors.md @@ -1,20 +1,16 @@ # Errors - - -The Kittn API uses the following error codes: +The RingCentral for Developers API uses the following error codes: Error Code | Meaning ---------- | ------- -400 | Bad Request -- Your request sucks +400 | Bad Request -- Your request is incorrectly formatted 401 | Unauthorized -- Your API key is wrong -403 | Forbidden -- The kitten requested is hidden for administrators only -404 | Not Found -- The specified kitten could not be found -405 | Method Not Allowed -- You tried to access a kitten with an invalid method -406 | Not Acceptable -- You requested a format that isn't json -410 | Gone -- The kitten requested has been removed from our servers -418 | I'm a teapot -429 | Too Many Requests -- You're requesting too many kittens! Slow down! +403 | Forbidden -- The resource requested is hidden for administrators only +404 | Not Found -- The specified resource could not be found +405 | Method Not Allowed -- You tried to access a resource with an invalid method +410 | Gone -- The resource requested has been removed from our servers +429 | Too Many Requests -- You're making too many requests! Slown down! 500 | Internal Server Error -- We had a problem with our server. Try again later. -503 | Service Unavailable -- We're temporarially offline for maintanance. Please try again later. +503 | Service Unavailable -- We're temporarially offline for maintanance. Please try again later. \ No newline at end of file diff --git a/source/index.md b/source/index.md index 4c1fa8c9f7d..a8310b0c795 100644 --- a/source/index.md +++ b/source/index.md @@ -1,14 +1,13 @@ --- -title: API Reference +title: RingCentral API Reference language_tabs: - - shell - - ruby - - python + - http + - javascript toc_footers: - - Sign Up for a Developer Key - - Documentation Powered by Slate + - Sign Up for RingCentral for Developers + - Documentation Powered by Slate includes: - errors @@ -18,151 +17,839 @@ search: true # Introduction -Welcome to the Kittn API! You can use our API to access Kittn API endpoints, which can get information on various cats, kittens, and breeds in our database. +Welcome to the RingCentral CTI Developer Tutorial. This tutorial uses the [RingCentral JavaScript SDK](http://github.com/ringcentral/js-sdk). -We have language bindings in Shell, Ruby, and Python! You can view code examples in the dark area to the right, and you can switch the programming language of the examples with the tabs in the top right. +Call management integration typically includes monitoring of incoming calls, listing calls and performing of RingOuts, all of which are covered in this tutorial. -This example API documentation page was created with [Slate](http://github.com/tripit/slate). Feel free to edit it and use it as a base for your own API's documentation. +# Quickstart -# Authentication +## Retrieve Call Logs -> To authorize, use this code: +~~~ http +GET https://platform.ringcentral.com/restapi/v1.0/account/~/extension/~/call-log HTTP/1.1 +Authorization: Bearer U0pDMDFQMDFQQVMwMnxBQUFWZmY4ZXoxMlh +Accept: application/json +~~~ -```ruby -require 'kittn' +~~~ +HTTP/1.1 200 OK +Content-Language: en +Content-Type: application/json; charset=UTF-8 +Content-Length: 4145 -api = Kittn::APIClient.authorize!('meowmeowmeow') -``` +{ + "uri": ".../account/401501489004/extension/401501489004/call-log?dateFrom=2013-01-01T00:00:00.000Z&page=1&perPage=100", + "records": [ + { + "uri": ".../account/401501489004/extension/401501489004/call-log/IXtVRs-3B7A_PfE", + "id": "IXtVRs-3B7A_PfE", + "sessionId": "404769762004", + "startTime": "2014-09-22T12:58:09.000Z", + "duration": 4, + "type": "Voice", + "direction": "Inbound", + "action": "Phone Call", + "result": "Accepted", + "to": { + "phoneNumber": "18662130006", + "name": "Rose White" + }, + "from": { + "phoneNumber": "16504445567", + "name": "Phillip Marco", + "location": "Palo Alto, CA" + } + }, + { + "uri": ".../account/401501489004/extension/401501489004/call-log/IXtVPRjQvSF5Pe4", + "id": "IXtVPRjQvSF5Pe4", + "sessionId": "404769755004", + "startTime": "2014-09-22T12:58:06.000Z", + "duration": 10, + "type": "Voice", + "direction": "Outbound", + "action": "VoIP Call", + "result": "Call connected", + "to": { + "phoneNumber": "16504445567", + "location": "Palo Alto, CA" + }, + "from": { + "phoneNumber": "16504445567", + "name": "Irene Fox" + } + }, + { + ... + } + ], + "paging": { + "page": 1, + "perPage": 100, + "pageStart": 0, + "pageEnd": 6 + }, + "navigation": { + "firstPage": { + "uri": ".../account/401501489004/extension/401501489004/call-log?dateFrom=2013-01-01T00:00:00.000Z&page=1&perPage=100" + } + } +} +~~~ -```python -import kittn +To access a Call Log resource you will require this URI: -api = kittn.authorize('meowmeowmeow') -``` +`GET /restapi/v1.0/account/{accountId}/extension/{extensionId}/call-log` -```shell -# With shell, you can just pass the correct header with each request -curl "api_endpoint_here" - -H "Authorization: meowmeowmeow" -``` +Send the request having specified particular accountId and extensionId or using simplified syntax with tilde characters. Please note, that if dateFrom parameter is not specified, server will return records for last week only. -> Make sure to replace `meowmeowmeow` with your API key. +## Retrieve Filtered Call Logs -Kittn uses API keys to allow access to the API. You can register a new Kittn API key at our [developer portal](http://example.com/developers). +~~~ http +GET https://platform.ringcentral.com/restapi/v1.0/account/~/extension/~/call-log?dateFrom=2014-09-18&phoneNumber=16504445567&dateTo=2014-09-25&type=Voice HTTP/1.1 +Authorization: Bearer U0pDMDFQMDFQQVMwMnxBQUFWZmY4ZXoxMl +Accept: application/json +~~~ -Kittn expects for the API key to be included in all API requests to the server in a header that looks like the following: +~~~ +HTTP/1.1 200 OK +Content-Language: en +Content-Type: application/json; charset=UTF-8 +Content-Length: 1725 -`Authorization: meowmeowmeow` +{ + "uri": ".../account/401501489004/extension/401501489004/call-log?phoneNumber=16504445567&type=Voice&dateFrom=2014-09-18T00:00:00.000Z&dateTo=2014-09-25T00:00:00.000Z&page=1&perPage=100", + "records": [ + { + "uri": ".../account/401501489004/extension/401501489004/call-log/IXtVRs-3B7A_PfE", + "id": "IXtVRs-3B7A_PfE", + "sessionId": "404769762004", + "startTime": "2014-09-22T12:58:09.000Z", + "duration": 4, + "type": "Voice", + "direction": "Inbound", + "action": "Phone Call", + "result": "Accepted", + "to": { + "phoneNumber": "18662130006", + "name": "Steve Jones" + }, + "from": { + "phoneNumber": "16504445567", + "name": "Tony Black", + "location": "Palo Alto, CA" + } + }, + { + "uri": ".../account/401501489004/extension/401501489004/call-log/IXtVPRjQvSF5Pe4", + "id": "IXtVPRjQvSF5Pe4", + "sessionId": "404769755004", + "startTime": "2014-09-22T12:58:06.000Z", + "duration": 10, + "type": "Voice", + "direction": "Outbound", + "action": "VoIP Call", + "result": "Call connected", + "to": { + "phoneNumber": "16504445567", + "location": "Palo Alto, CA" + }, + "from": { + "phoneNumber": "18662130006", + "name": "Steve Jones" + } + } + ], + "paging": { + "page": 1, + "perPage": 100, + "pageStart": 0, + "pageEnd": 1 + }, + "navigation": { + "firstPage": { + "uri": ".../account/401501489004/extension/401501489004/call-log?phoneNumber=16504445567&type=Voice&dateFrom=2014-09-18T00:00:00.000Z&dateTo=2014-09-25T00:00:00.000Z&page=1&perPage=100" + } + } +} +~~~ - +You may get exactly the records you require by setting a few filters. For example if you need the records over a week (dateFrom, dateTo) of voice calls (type) to/from a certain number (phoneNumber), sned the request having set the following query parameters: -# Kittens +* `dateFrom` = 2014-09-18 +* `dateTo` = 2014-09-25 +* `type` = Voice +* `phoneNumber` = 16504445567 -## Get All Kittens +## Send SMS Message -```ruby -require 'kittn' +~~~ http +POST https://platform.ringcentral.com/restapi/v1.0/account/~/extension/~/sms HTTP/1.1 +Authorization: Bearer U0pDMDFQMDFQQVMwMXxBQUFWZmY4ZXoxMlhvUFI5dmhYVzV +Content-Type: application/json +Accept: application/json +Content-Length: 323 -api = Kittn::APIClient.authorize!('meowmeowmeow') -api.kittens.get -``` +{ + "to": [{"phoneNumber": "+18662130006"}], + "from": {"phoneNumber": "+16504445567"}, + "text": "Test SMS message from Platform server" +} +~~~ -```python -import kittn +~~~ +HTTP/1.1 200 OK +Content-Language: en +Content-Type: application/json; charset=UTF-8 +Content-Length: 926 -api = kittn.authorize('meowmeowmeow') -api.kittens.get() -``` +{ + "uri": ".../account/401474882008/extension/401474882008/message-store/402206716008", + "id": 402206716008, + "to": [ + { + "phoneNumber": "+16505393204", + "location": "San Mateo, CA" + } + ], + "from": { + "phoneNumber": "+18004900003" + }, + "type": "SMS", + "creationTime": "2014-09-24T07:04:26.000Z", + "readStatus": "Read", + "priority": "Normal", + "attachments": [ + { + "id": 402206716008, + "uri": ".../account/401474882008/extension/401474882008/message-store/402206716008/content/402206716008", + "type": "Text", + "contentType": "text/plain" + } + ], + "direction": "Outbound", + "availability": "Alive", + "subject": "Test SMS message from Platform server", + "messageStatus": "Sent", + "smsSendingAttemptsCount": 1, + "conversationId": 5578972751633835268, + "lastModifiedTime": "2014-09-24T07:04:26.534Z" +} +~~~ -```shell -curl "http://example.com/api/kittens" - -H "Authorization: meowmeowmeow" -``` +If you need to send a text message to somebody, you should use this URI: -> The above command returns JSON structured like this: +`POST /restapi/v1.0/account/{accountId}/extension/{extensionId}/sms` -```json -[ - { - "id": 1, - "name": "Fluffums", - "breed": "calico", - "fluffiness": 6, - "cuteness": 7 - }, - { - "id": 2, - "name": "Isis", - "breed": "unknown", - "fluffiness": 5, - "cuteness": 10 - } -] -``` +Send `POST` request: Specify `accountId` and `extensionId` in the request URL or use simplified syntax with tilde characters. Specify the recipient phone number in the `to` field and one of your valid RingCentral phone numbers in the `from` field. Enter your message in the `text` field. + +## Send Pager Message + +~~~ http +POST /restapi/v1.0/account/~/extension/~/company-pager HTTP/1.1 +Content-Type: application/json +Content-Length: ACTUAL_CONTENT_LENGTH_HERE + +{ +"to": [{"extensionNumber": "102"}, + {"extensionNumber": "103"}], + +"from": {"extensionNumber": "101"}, +"text": "Hello!" +} + +HTTP/1.1 200 OK +Content-Type: application/json + +{ + "uri": ".../account/1346632010/extension/1346632010/message-store/320272670010", + "id": 320272670010, + "to": [ + {"extensionNumber": "101"}, + {"extensionNumber": "102"}, + {"extensionNumber": "103"} + ], + "from": {"extensionNumber": "101"}, + "type": "Pager", + "creationTime": "2012-10-18T13:18:24.000Z", + "readStatus": "Unread", + "priority": "Normal", + "attachments": [ { + "id": 1, + "uri": "http:.../restapi/v1.0/account/1346632010/extension/1346632010/message-store/320272670010/content/1", + "contentType": "text/plain" + }], + "direction": "Outbound", + "availability": "Alive", + "subject": "Hello!", + "messageStatus": "Sent", + "conversationId": 320272670010, + "lastModifiedTime": "2012-10-18T13:18:24.000Z", + "pgToDepartment": false +} +~~~ + +Pager messages are RingCentral specific types of text messages which can be sent between extensions of one account. Unlike SMS, pager messages can be sent to multiple recipients, so the API allows several extension numbers in the **to** field. Another difference from SMS is that the pager message that is sent to the department extension is automatically forwarded to all department members. This allows setting up dedicated mailing lists within the organization. The endpoint **company-pager** is designed to handle pager messages. + +# Getting Started + +## Installing the SDK + +To install the SDK, follow the online instructions posted at Github: + +[https://github.com/ringcentral/js-sdk#installation](https://github.com/ringcentral/js-sdk#installation) + +## Instantiating the SDK + +~~~ javascript +var RC_SERVER_PRODUCTION = 'https://platform.ringcentral.com'; +var RC_SERVER_SANDBOX = 'https://platform.devtest.ringcentral.com'; + +var rcsdk = new RCSDK({ + server: RC_SERVER_SANDBOX, + appKey: 'yourAppKey', + appSecret: 'yourAppSecret' +}); +~~~ + +The SDK is represented by the global RCSDK constructor. Your application must create an instance of this object. -This endpoint retrieves all kittens. +In order to bootstrap the RingCentral JavaScript SDK, you have to first get a reference to the Platform singleton and then configure it. Before you can do anything using the Platform singleton, you need to configure it with the server URL (this tells the SDK which server to connect to) and your unique API key (this is provided by RingCentral's developer relations team). -### HTTP Request + + +## Getting the Platform Singleton + +~~~ javascript +var platform = rcsdk.getPlatform(); +~~~ + +Now that you have your platform singleton and SDK has been configured with the correct server URL and API key, your application can log in so that it can access the features of the API. + +## Login via 3-legged OAuth + +~~~ javascript +// Get user authorization URL +var myRedirectUri = 'https://example.com/oauth'; +var authorizeUrl = rcsdk.getPlatform().getAuthURL({ + redirectUri: myRedirectUri +}); +// Open window for authorizeUrl + +// In redirect URL, retrieve `code` from query string and exhange for access token. +// Get query string +var myRedirectUri = 'https://example.com/oauth'; +var qs = rcsdk.getPlatform().parseAuthRedirectUrl(window.location.href); +qs.redirectUri = myRedirectUri; + +if ('code' in qs) { + var res = rcsdk.getPlatform().authorize(qs) + .then(function(response) { + // process response and close window (if popup) + window.open('', '_self', ''); + window.close(); + }).catch(function(e) { + console.log("Error: Authorization") + }); +} else { + console.log("Error: No Code") +} +~~~ + +3-legged OAuth is the standard login approach for user applications via the web where the user will be presented with a standard RingCentral login. This approach also supports RingCentral customers that have deployed single sign-on (SSO) via 3-rd party identity providers (IdPs). To implement 3-legged OAuth, implement the following steps: + +1. Configure a redirect URI for your service in the RingCentral Developer portal which will be used to send the authorization code upon success login and authorization. +2. Then use the redirect URI with the SDK to retrieve an OAuth authorization URL that can be used to open a browser window. +3. Finally, in the web page at your redirect URI, extract the authoriation code from the URL string's `code` query parameter and exchange the authorization code for an access token. + +## Login via 2-legged OAuth + +~~~ javascript +platform.authorize({ + username: '+18001234567', // your phone number in E.164 format + extension: '101', // leave blank if direct number is used + password: 'yourpassword' +}).then(function(ajax) { + // your code here +}).catch(function(e) { + alert(e.message || 'Server cannot authorize user'); +}); +~~~ -`GET http://example.com/api/kittens` +Client-server applications can use the 2-legged OAuth approach which doesn't provide a user login page. -### Query Parameters +To log in to RingCentral, get the Platform object and call its authorize method, providing valid username, extension, and password values. Enter your phone number in E.164 format for username. The `+` may be omitted. -Parameter | Default | Description ---------- | ------- | ----------- -include_cats | false | If set to true, the result will also include cats. -available | true | If set to false, the result will include kittens that have already been adopted. +A Promise is returned, and you can use its then method to specify your continuation function, and its catch method to specify an error handling function. + +## Handling Authorization Exceptions + +~~~ javascript +platform.on(platform.events.accessViolation, function(e){ + // do something +}); +~~~ + +To handle possible access or authentication exceptions that may occur while the application is running (after the user has successfully logged in), you can provide a handler for the `accessViolation` platform event. -## Get a Specific Kitten +## Determining Authorization Status + +~~~ javascript +// To check authentication status: +platform.isAuthorized() + .then(function(){ ... }) + .catch(function(e){ ... }); + +// Checking authn status synchronously +// without auto-refresh of the access token +if (platform.isTokenValid()) {...} +~~~ + +The `isAuthorized` method will automatically perform a refresh of the access token, if needed. This method may be used in the login page of your application for automatic login. + +There is also a synchronous method for checking the authentication status that does not automatically perform a refresh of the access token. + +## Manual Access Token Refresh + +~~~ javascript +// Refreshing the access token manually +platform.refresh().then(...) +~~~ + +Access token refresh normally happens automatically for common use cases. On rare occasions, you may perform a refresh of the access token manually by calling the refresh method using the `platform.refresh()` method. + +## Logout + +~~~ javascript +// without callback +platform.logout() +// with callback +platform.logout().then(...) +~~~ + +Your application can log out the user by calling the `platform.logout()` method. + +# Making Calls (RingOut) + +Outbound calls using RingCentral can be made using the RingOut functionality. + +## Two-Legged Calls + +When making a call, the RingCentral system establishes two calls, one for each of the two parties being connected, and then connects them. This results in events for two calls (2-legged calls) when initiated a single click-to-call? + +## Making an Outbound Call + +~~~ javascript +// Phone numbers should be in E.164 format. +platform + .apiCall(rcsdk.getRingoutHelper().saveRequest({ + from: {phoneNumber: '+16501111111'}, + to: {phoneNumber: '+18882222222'}, + callerId: {phoneNumber: '+18882222222'}, // optional, + playPrompt: false // optional + })) + .then(function(ajax) { + // here application can start polling + // also save ajax.data as, for example, prevRingoutData + }) + .catch(handleError); +~~~ + +The application should stop polling the RingOut when its status changes to error or success because after that there will be no status updates. + +## Polling Outbound Call Status -```ruby -require 'kittn' +~~~ javascript +// Poll for the status of an ongoing outbound call +function update(next, delay) { -api = Kittn::APIClient.authorize!('meowmeowmeow') -api.kittens.get(2) -``` + if (!rcsdk.getRingoutHelper().isInProgress(ringout)) return; -```python -import kittn + platform + .apiCall(rcsdk.getRingoutHelper().loadRequest(prevRingoutData)) + .then(function(ajax) { + // also save ajax.data as, for example, prevRingoutData + console.log(ajax.data); // updated status of ringout + timeout = next(delay); // you can increase delay here + }) + .catch(handleError); -api = kittn.authorize('meowmeowmeow') -api.kittens.get(2) -``` +} + +var timeout = rcsdk.getUtils().poll(update, 3000); // stay in RPS limits + +// To stop polling: + +rcsdk.getUtils().stopPolling(timeout); +~~~ + +Use polling to get the status of an ongoing outbound call. + +## Outbound Call Control + +The RingCentral Connect Platform does not currently support control of outbound calls. However, you can cancel ringout call while callee party status is `InProgress`. To do that make a `DELETE` request to ringout URI. + +## Outbound Call Statuses + +* A 2-legged RingOut call is represented in events as an outbound call between `from` and `to` numbers provided in RingOut API request. +* There is the known issue: notification with `CallConnected` status comes after first leg is connected. So actually a call can be missed by callee but it won't be reflected in event flow; but it will be reflected in call log. +* Phone numbers in notification (`from` and `to`) may be either E.164 phone numbers (with or without `+`) or short extension numbers (e.g. '101') for calls between extensions +* For some RC phone system configurations when multiple devices are ringing for inbound call, you may get transitional notifications with `NoCall` status which will be immediately followed by `Ringing` or `CallConnected` (for the same `sessionId`). + +## Polling & Events Notification + +All RingOut calls will appear in event notifications and active calls endpoint. The difference between what RingOut polling provides is more granular status updates (application can track status of both parties). Normally it should be represented by two independent views/flows in application. In general there is no point to match ringout calls with any of active calls, those process may happen concurrently. + +If the application needs to track outbound calls and save them somewhere, it is better to initiate the ringout and NOT poll it, but expect a notification and work only with notifications/active calls. + +# Making Calls (URI Scheme) + +In addition to making calls via the RingOut API, if the user has the RingCentral for Desktop softphone installed, it is possible to use a URI scheme to initiate a dial out from the application. + +RingCentral supports both a custom `rcmobile` URI scheme will resolve the issue of competing applications using the same URI scheme and a standard `tel` URI scheme which is more common but subject to competing uses. -```shell -curl "http://example.com/api/kittens/2" - -H "Authorization: meowmeowmeow" -``` +## RingCentral URI Scheme + +~~~ +// HTML URI Scheme +1-650-111-2222 +~~~ + +~~~ javascript +// Use the following for Google Chrome only +var w = (window.parent)?window.parent:window; +w.location.assign('rcmobile://call?number=16501112222'); +// For more info, see http://stackoverflow.com/questions/2330545/ +~~~ + +The RingCentral `rcmobile` URI Scheme is specific to RingCentral and thus has a higher probability of workign as intended. + +## Standard URI Scheme + +~~~ +// HTML URI Scheme +1-650-111-2222 +1-650-111-2222 +~~~ + +The standard `tel` URI Scheme is also supported but since multiple applications use this URI scheme, there may be competing applications resulting in a less desirable expeirence. + +# Call Management + +If you are integrating with a CRM or ERP system, use of the JavaScript SDK is highly recommended. Following is an example of a call management integration that includes monitoring of incoming calls and performing of RingOuts. + +A call management integration usually consists of the following tasks: + +* Track the telephony status +* View the list of active calls +* View the recent calls + +## Call States + +~~~ javascript + +// 1) Missed inbound call (Ringing -> No Call) +{ + "body": { + "telephonyStatus": "Ringing", + "extensionId": 607457016, + "activeCalls": [{"direction": "Inbound", "from": "13027430863", "telephonyStatus": "Ringing", "to": "18885434778", "sessionId": "67029198021", "id": "8ad4d5ea165f4e2aa00474a666368728"}], + "sequence": 133702 + }, + "timestamp": "2015-04-10T18:48:55.133+0000", + "uuid": "2b5bb8c0-c36c-46af-bd93-fb41e330d87c", + "event": "/restapi/v1.0/account/~/extension/607457016/presence?detailedTelephonyState=true" +} + +{ + "body": { + "telephonyStatus": "NoCall", + "extensionId": 607457016, + "activeCalls": [{"direction": "Inbound", "from": "13027430863", "telephonyStatus": "NoCall", "to": "18885434778", "sessionId": "67029198021", "id": "8ad4d5ea165f4e2aa00474a666368728"}], + "sequence": 133857 + }, + "timestamp": "2015-04-10T18:49:14.679+0000", + "uuid": "a5a876ab-3356-41e5-b1fe-fff91da3a281", + "event": "/restapi/v1.0/account/~/extension/607457016/presence?detailedTelephonyState=true" +} -> The above command returns JSON structured like this: +// 2) Answered inbound call (Ringing -> CallConnected -> NoCall) + +{ + "body": { + "telephonyStatus": "Ringing", + "extensionId": 607457016, + "activeCalls": [{"direction": "Inbound", "from": "13027430863", "telephonyStatus": "Ringing", "to": "18885434778", "sessionId": "67029198021", "id": "61803278cbf74d7490539a6174a6c094"}], + "sequence": 133897 + }, + "timestamp": "2015-04-10T18:49:20.858+0000", + "uuid": "c394ccf6-85dd-4da4-a87e-d31fac7f1283", + "event": "/restapi/v1.0/account/~/extension/607457016/presence?detailedTelephonyState=true" +} + +{ + "body": { + "telephonyStatus": "CallConnected", + "extensionId": 607457016, + "activeCalls": [{"direction": "Inbound", "from": "13027430863", "telephonyStatus": "CallConnected", "to": "18885434778", "sessionId": "67029198021", "id": "61803278cbf74d7490539a6174a6c094"}], + "sequence": 133942 + }, + "timestamp": "2015-04-10T18:49:26.687+0000", + "uuid": "96df6fdd-a2a4-42fb-bc34-cffb5d637754", + "event": "/restapi/v1.0/account/~/extension/607457016/presence?detailedTelephonyState=true" +} + +{ + "body": { + "telephonyStatus": "NoCall", + "extensionId": 607457016, + "activeCalls": [{"direction": "Inbound", "from": "13027430863", "telephonyStatus": "NoCall", "to": "", "sessionId": "67029198021", "id": "61803278cbf74d7490539a6174a6c094"}], + "sequence": 134051 + }, + "timestamp": "2015-04-10T18:49:41.828+0000", + "uuid": "7fa7ac3c-5b7b-4127-88ec-9734f478d4a3", + "event": "/restapi/v1.0/account/~/extension/607457016/presence?detailedTelephonyState=true" +} -```json +// 3) 2-legged Ringout { - "id": 2, - "name": "Isis", - "breed": "unknown", - "fluffiness": 5, - "cuteness": 10 + "body": { + "telephonyStatus": "Ringing", + "extensionId": 255537016, +"activeCalls": [{"to": "16502008440", "direction": "Outbound", "from": "16509540334", "sessionId": "915021981016", "telephonyStatus": "Ringing"}], + "sequence": 46061598 + }, + "timestamp": "2015-04-17T19:38:59.718+0000", + "uuid": "305b8075-5dad-4686-b22a-d26744802566", "event": "/restapi/v1.0/account/~/extension/255537016/presence?detailedTelephonyState=true" } -``` + +{ + "body": { + "telephonyStatus": "CallConnected", + "extensionId": 255537016, + "activeCalls": [{"direction": "Outbound", "from": "16509540334", "telephonyStatus": "CallConnected", "to": "16502008440", "sessionId": "915021981016", "id": "b5ea44d61b6a4658aadf948348db069c"}], + "sequence": 46062162 + }, + "timestamp": "2015-04-17T19:39:12.950+0000", + "uuid": "71673991-dad0-4c8e-9c22-78b0244c790c", + "event": "/restapi/v1.0/account/~/extension/255537016/presence?detailedTelephonyState=true" +} + +{ + "body": { + "telephonyStatus": "NoCall", + "extensionId": 255537016, + "activeCalls": [{"direction": "Outbound", "from": "16509540334", "telephonyStatus": "NoCall", "to": "16502008440", "sessionId": "915021981016", "id": "b5ea44d61b6a4658aadf948348db069c"}], + "sequence": 46063265 + }, + "timestamp": "2015-04-17T19:39:40.172+0000", + "uuid": "97b01949-1438-45f2-856a-54f89e83367f", + "event": "/restapi/v1.0/account/~/extension/255537016/presence?detailedTelephonyState=true" +} +~~~ + +* A call may consist of multiple call legs. Top-level telephonyStatus should be aggregated across these multiple call legs. +* A call is identified by its sessionId. For tracking a call, application should match by sessionId across activeCall items from multiple notifications. +* In some rare cases notifications can be delivered in incorrect order. Application should remember largest 'sequence' value from an event for a given call (identified by its sessionId) and ignore any events which come later with smaller 'sequence' + +Some typical event flows for inbound calls are listed for the following scenarios: -This endpoint retrieves a specific kitten. +1. Missed inbound call (Ringing -> No Call) +1. Answered inbound call (Ringing -> CallConnected -> NoCall) +1. 2-legged Ringout - +## Call Notification -### HTTP Request +~~~ javascript +var subscription = rcsdk.getSubscription(); -`GET http://example.com/kittens/` +subscription + .on(subscription.events.notification, function(msg) { + console.log(msg, msg.body); + }) + .register({ + events: [ + '/account/~/extension/~/presence?detailedTelephonyState=true' + ] + }) + .then(...); +~~~ + +To get notification of inbound and outbound call events, your application can receive push notifications from the RingCentral Connect Platform by subscribing to specific events, such as the telephony presence event. + +## Caller ID & Called Number + +~~~ javascript +var subscription = rcsdk.getSubscription(); + +subscription + .on(subscription.events.notification, function(msg) { + console.log(msg.body.activeCalls[n].from); // activeCalls is array + console.log(msg.body.activeCalls[n].to); + }) + .register({ + events: [ + '/account/~/extension/~/presence?detailedTelephonyState=true' + ], + }) + .then(...); +~~~ + +Subscript to the account using the `detailedTelephonyState` to get caller info (caller id and called number) from telephony presence events. + +## Call Information During Call + +~~~ javascript +platform.apiCall({ + url: rcsdk.getCallHelper().createUrl({active: true}), + get: { // this can be omitted + page: 1, + perPage: 10 + } +}).then(function(ajax) { + console.log(ajax.data.records); +}).catch(function(e) { + alert('Active Calls Error: ' + e.message); +}); +~~~ + +To determine call duration or any other information about the call during the call, the application needs to remember discovered calls and save the time at which they were discovered (had Ringing or Connected status) and then duration can be calculated as difference between now and the saved time. + +The application may periodically (around 2-5 minutes) poll the active calls endpoint to make sure that even missed event notifications will not affect the application state. The application may also load a list of active calls after receiving event notifications. Please keep in mind that application may exceed RPS limits and will be throttled in this case, so application must handle this situation. + +## Determining End of Call + +The application is responsible for caching active calls. A common method is to use a session ID to track a call. +Your application may gather information about discovered calls and when it sees 'No Call' after 'Connected' status it means that the call has ended. Also the call will disappear from active calls list. See the section below on determining call duration of a recently ended call for more info. + +## Call Duration Post-Call + +~~~ javascript +// Determining call duaration of a recently ended call. +platform.apiCall({ + url: rcsdk.getCallHelper().createUrl({active: true}), + get: { // this can be omitted + page: 1, + perPage: 10 + } +}).then(function(ajax) { + console.log(ajax.data.records); +}).catch(function(e) { + alert('Active Calls Error: ' + e.message); +}); +~~~ + +Completed calls will stay in Active Calls for a limited time (few minutes). Use the following code to determine the duration of a recently completed call. + +## Call and Event Matching + +To match calls and events from the call log or active calls, use the `sessionId` property of calls from events' active calls array and call log or active calls response. + +## Multiple Concurrent Calls + +To handle multiple concurrent calls, each call event will contain information about all calls, application must go through all calls in `msg.body.activeCalls` array. The application must remember `sequenceNumber` and ignore events with smaller sequence number than already received. + +## Call Control + +The RingCentral Connect Platform does not currently support any call control functions. + +# Call Queries + +A call management integration usually consists of tracking the telephony call status per the above and the following call query tasks: + +* View active calls +* View recently ended calls +* View historical calls + +## View Active Calls + +~~~ javascript +var activeCalls = [], + Call = rcsdk.getCallHelper(); + +// This call may be repeated when needed, for example as a response to incoming Subscription +platform.apiCall(Call.loadRequest(null, { + url: Call.createUrl({active: true}), + query: { // this can be omitted + page: 1, + perPage: 10 + } +})).then(function(response) { + activeCalls = Call.merge(activeCalls, response.data.records); // safely merge existing active calls with new ones +}).catch(function(e) { + alert('Active Calls Error: ' + e.message); +}); +~~~ + +By default, the load request returns calls that were made during the last week. To alter the time frame, provide custom query.dateTo and query.dateFrom properties. + +## View Recently Ended Calls + +~~~ javascript +// Getting historical call information +platform.apiCall({ + url: rcsdk.getCallHelper().createUrl(), + get: { // this can be omitted + page: 1, + perPage: 10 + } +}).then(function(ajax) { + console.log(ajax.data.records); +}).catch(function(e) { + alert('Calls Error: ' + e.message); +}); +~~~ + +Recently ended calls appear in Call Log with some delay (seconds to a minute or so) so the recommended way to retrieve them is to use Active Calls API. + + + +## View Historical Calls + +~~~ javascript +var calls = [], + Call = rcsdk.getCallHelper(); + +// This call may be repeated when needed, for example as a response to incoming Subscription +platform.apiCall(Call.loadRequest(null, { + query: { // this can be omitted + page: 1, + perPage: 10 + }, +})).then(function(response) { + calls = Call.merge(calls, response.data.records); // safely merge existing active calls with new ones +}).catch(function(e) { + alert('Recent Calls Error: ' + e.message); +}); +~~~ + +By default, the load request returns calls that were made during the last week. To alter the time frame, provide custom query.dateTo and query.dateFrom properties. + +# Call Recordings + +Call log records with recordings will have a `recording` object property which includes information on the recording including the `contentUri` string property which can be used to retrieve the recording. + +~~~ javascript +var callLogRecord = { + [...] + "recording": { + "uri": "https.../restapi/v1.0/account/401190149008/recording/401547458008", + "id": "401547458008", + "type": "OnDemand", + "contentUri": "https.../restapi/v1.0/account/401190149008/recording/401547458008/content" + } +} -### URL Parameters +var recordingUrl = callLogRecord['recording']['contentUri']; +var recordingUrlWithToken = rcsdk.getPlatform().apiUrl(uri, {addToken: true}); +~~~ -Parameter | Description ---------- | ----------- -ID | The ID of the kitten to retrieve diff --git a/source/javascripts/app/_toc.js b/source/javascripts/app/_toc.js index d84bf8e197a..bc2aa3e1f11 100644 --- a/source/javascripts/app/_toc.js +++ b/source/javascripts/app/_toc.js @@ -1,5 +1,6 @@ //= require ../lib/_jquery_ui //= require ../lib/_jquery.tocify +//= require ../lib/_imagesloaded.min (function (global) { 'use strict'; @@ -37,14 +38,18 @@ // Hack to make already open sections to start opened, // instead of displaying an ugly animation - function animate () { + function animate() { setTimeout(function() { toc.setOption('showEffectSpeed', 180); }, 50); } - $(makeToc); - $(animate); - + $(function() { + makeToc(); + animate(); + $('.content').imagesLoaded( function() { + global.toc.calculateHeights(); + }); + }); })(window); diff --git a/source/javascripts/lib/_imagesloaded.min.js b/source/javascripts/lib/_imagesloaded.min.js new file mode 100644 index 00000000000..d66f658937d --- /dev/null +++ b/source/javascripts/lib/_imagesloaded.min.js @@ -0,0 +1,7 @@ +/*! + * imagesLoaded PACKAGED v3.1.8 + * JavaScript is all like "You images are done yet or what?" + * MIT License + */ + +(function(){function e(){}function t(e,t){for(var n=e.length;n--;)if(e[n].listener===t)return n;return-1}function n(e){return function(){return this[e].apply(this,arguments)}}var i=e.prototype,r=this,o=r.EventEmitter;i.getListeners=function(e){var t,n,i=this._getEvents();if("object"==typeof e){t={};for(n in i)i.hasOwnProperty(n)&&e.test(n)&&(t[n]=i[n])}else t=i[e]||(i[e]=[]);return t},i.flattenListeners=function(e){var t,n=[];for(t=0;e.length>t;t+=1)n.push(e[t].listener);return n},i.getListenersAsObject=function(e){var t,n=this.getListeners(e);return n instanceof Array&&(t={},t[e]=n),t||n},i.addListener=function(e,n){var i,r=this.getListenersAsObject(e),o="object"==typeof n;for(i in r)r.hasOwnProperty(i)&&-1===t(r[i],n)&&r[i].push(o?n:{listener:n,once:!1});return this},i.on=n("addListener"),i.addOnceListener=function(e,t){return this.addListener(e,{listener:t,once:!0})},i.once=n("addOnceListener"),i.defineEvent=function(e){return this.getListeners(e),this},i.defineEvents=function(e){for(var t=0;e.length>t;t+=1)this.defineEvent(e[t]);return this},i.removeListener=function(e,n){var i,r,o=this.getListenersAsObject(e);for(r in o)o.hasOwnProperty(r)&&(i=t(o[r],n),-1!==i&&o[r].splice(i,1));return this},i.off=n("removeListener"),i.addListeners=function(e,t){return this.manipulateListeners(!1,e,t)},i.removeListeners=function(e,t){return this.manipulateListeners(!0,e,t)},i.manipulateListeners=function(e,t,n){var i,r,o=e?this.removeListener:this.addListener,s=e?this.removeListeners:this.addListeners;if("object"!=typeof t||t instanceof RegExp)for(i=n.length;i--;)o.call(this,t,n[i]);else for(i in t)t.hasOwnProperty(i)&&(r=t[i])&&("function"==typeof r?o.call(this,i,r):s.call(this,i,r));return this},i.removeEvent=function(e){var t,n=typeof e,i=this._getEvents();if("string"===n)delete i[e];else if("object"===n)for(t in i)i.hasOwnProperty(t)&&e.test(t)&&delete i[t];else delete this._events;return this},i.removeAllListeners=n("removeEvent"),i.emitEvent=function(e,t){var n,i,r,o,s=this.getListenersAsObject(e);for(r in s)if(s.hasOwnProperty(r))for(i=s[r].length;i--;)n=s[r][i],n.once===!0&&this.removeListener(e,n.listener),o=n.listener.apply(this,t||[]),o===this._getOnceReturnValue()&&this.removeListener(e,n.listener);return this},i.trigger=n("emitEvent"),i.emit=function(e){var t=Array.prototype.slice.call(arguments,1);return this.emitEvent(e,t)},i.setOnceReturnValue=function(e){return this._onceReturnValue=e,this},i._getOnceReturnValue=function(){return this.hasOwnProperty("_onceReturnValue")?this._onceReturnValue:!0},i._getEvents=function(){return this._events||(this._events={})},e.noConflict=function(){return r.EventEmitter=o,e},"function"==typeof define&&define.amd?define("eventEmitter/EventEmitter",[],function(){return e}):"object"==typeof module&&module.exports?module.exports=e:this.EventEmitter=e}).call(this),function(e){function t(t){var n=e.event;return n.target=n.target||n.srcElement||t,n}var n=document.documentElement,i=function(){};n.addEventListener?i=function(e,t,n){e.addEventListener(t,n,!1)}:n.attachEvent&&(i=function(e,n,i){e[n+i]=i.handleEvent?function(){var n=t(e);i.handleEvent.call(i,n)}:function(){var n=t(e);i.call(e,n)},e.attachEvent("on"+n,e[n+i])});var r=function(){};n.removeEventListener?r=function(e,t,n){e.removeEventListener(t,n,!1)}:n.detachEvent&&(r=function(e,t,n){e.detachEvent("on"+t,e[t+n]);try{delete e[t+n]}catch(i){e[t+n]=void 0}});var o={bind:i,unbind:r};"function"==typeof define&&define.amd?define("eventie/eventie",o):e.eventie=o}(this),function(e,t){"function"==typeof define&&define.amd?define(["eventEmitter/EventEmitter","eventie/eventie"],function(n,i){return t(e,n,i)}):"object"==typeof exports?module.exports=t(e,require("wolfy87-eventemitter"),require("eventie")):e.imagesLoaded=t(e,e.EventEmitter,e.eventie)}(window,function(e,t,n){function i(e,t){for(var n in t)e[n]=t[n];return e}function r(e){return"[object Array]"===d.call(e)}function o(e){var t=[];if(r(e))t=e;else if("number"==typeof e.length)for(var n=0,i=e.length;i>n;n++)t.push(e[n]);else t.push(e);return t}function s(e,t,n){if(!(this instanceof s))return new s(e,t);"string"==typeof e&&(e=document.querySelectorAll(e)),this.elements=o(e),this.options=i({},this.options),"function"==typeof t?n=t:i(this.options,t),n&&this.on("always",n),this.getImages(),a&&(this.jqDeferred=new a.Deferred);var r=this;setTimeout(function(){r.check()})}function f(e){this.img=e}function c(e){this.src=e,v[e]=this}var a=e.jQuery,u=e.console,h=u!==void 0,d=Object.prototype.toString;s.prototype=new t,s.prototype.options={},s.prototype.getImages=function(){this.images=[];for(var e=0,t=this.elements.length;t>e;e++){var n=this.elements[e];"IMG"===n.nodeName&&this.addImage(n);var i=n.nodeType;if(i&&(1===i||9===i||11===i))for(var r=n.querySelectorAll("img"),o=0,s=r.length;s>o;o++){var f=r[o];this.addImage(f)}}},s.prototype.addImage=function(e){var t=new f(e);this.images.push(t)},s.prototype.check=function(){function e(e,r){return t.options.debug&&h&&u.log("confirm",e,r),t.progress(e),n++,n===i&&t.complete(),!0}var t=this,n=0,i=this.images.length;if(this.hasAnyBroken=!1,!i)return this.complete(),void 0;for(var r=0;i>r;r++){var o=this.images[r];o.on("confirm",e),o.check()}},s.prototype.progress=function(e){this.hasAnyBroken=this.hasAnyBroken||!e.isLoaded;var t=this;setTimeout(function(){t.emit("progress",t,e),t.jqDeferred&&t.jqDeferred.notify&&t.jqDeferred.notify(t,e)})},s.prototype.complete=function(){var e=this.hasAnyBroken?"fail":"done";this.isComplete=!0;var t=this;setTimeout(function(){if(t.emit(e,t),t.emit("always",t),t.jqDeferred){var n=t.hasAnyBroken?"reject":"resolve";t.jqDeferred[n](t)}})},a&&(a.fn.imagesLoaded=function(e,t){var n=new s(this,e,t);return n.jqDeferred.promise(a(this))}),f.prototype=new t,f.prototype.check=function(){var e=v[this.img.src]||new c(this.img.src);if(e.isConfirmed)return this.confirm(e.isLoaded,"cached was confirmed"),void 0;if(this.img.complete&&void 0!==this.img.naturalWidth)return this.confirm(0!==this.img.naturalWidth,"naturalWidth"),void 0;var t=this;e.on("confirm",function(e,n){return t.confirm(e.isLoaded,n),!0}),e.check()},f.prototype.confirm=function(e,t){this.isLoaded=e,this.emit("confirm",this,t)};var v={};return c.prototype=new t,c.prototype.check=function(){if(!this.isChecked){var e=new Image;n.bind(e,"load",this),n.bind(e,"error",this),e.src=this.src,this.isChecked=!0}},c.prototype.handleEvent=function(e){var t="on"+e.type;this[t]&&this[t](e)},c.prototype.onload=function(e){this.confirm(!0,"onload"),this.unbindProxyEvents(e)},c.prototype.onerror=function(e){this.confirm(!1,"onerror"),this.unbindProxyEvents(e)},c.prototype.confirm=function(e,t){this.isConfirmed=!0,this.isLoaded=e,this.emit("confirm",this,t)},c.prototype.unbindProxyEvents=function(e){n.unbind(e.target,"load",this),n.unbind(e.target,"error",this)},s}); \ No newline at end of file diff --git a/source/layouts/layout.erb b/source/layouts/layout.erb index 36ae0f95f81..724958301d8 100644 --- a/source/layouts/layout.erb +++ b/source/layouts/layout.erb @@ -48,7 +48,7 @@ under the License.
- <%= image_tag "logo.png" %> + <% if language_tabs %>
<% language_tabs.each do |lang| %> diff --git a/source/stylesheets/_icon-font.scss b/source/stylesheets/_icon-font.scss index b5994839881..23456f18a22 100644 --- a/source/stylesheets/_icon-font.scss +++ b/source/stylesheets/_icon-font.scss @@ -1,11 +1,65 @@ +$fontPath: "../fonts"; +$fontLatoPath: $fontPath + "/lato"; + +// Lato Light/Light Italic +// -------------------------------------------------- +@font-face { + font-family: "Lato"; + font-weight: 300; + font-style: normal; + src: url($fontLatoPath + '/lato-lig-webfont-g.eot'); + src: url($fontLatoPath + '/lato-lig-webfont-g.eot?#iefix') format('embedded-opentype'), url($fontLatoPath + '/lato-lig-webfont-g.woff') format('woff'),url($fontLatoPath + '/lato-lig-webfont-g.ttf') format('truetype'),url($fontLatoPath + '/lato-lig-webfont.svg#latolight') format('svg'); +} +@font-face { + font-family: "Lato"; + font-weight: 300; + font-style: italic; + src: url($fontLatoPath + '/lato-ligita-webfont-g.eot'); + src: url($fontLatoPath + '/lato-ligita-webfont-g.eot?#iefix') format('embedded-opentype'), url($fontLatoPath + '/lato-ligita-webfont-g.woff') format('woff'),url($fontLatoPath + '/lato-ligita-webfont-g.ttf') format('truetype'),url($fontLatoPath + '/lato-ligita-webfont.svg#latolight_italic') format('svg'); +} + +// Lato Normal/Normal Italic +// -------------------------------------------------- +@font-face { + font-family: "Lato"; + font-weight: normal; + font-style: normal; + src: url($fontLatoPath + '/lato-reg-webfont-g.eot'); + src: url($fontLatoPath + '/lato-reg-webfont-g.eot?#iefix') format('embedded-opentype'), url($fontLatoPath + "/lato-reg-webfont-g.woff") format('woff'), url($fontLatoPath + '/lato-reg-webfont-g.ttf') format('truetype'),url($fontLatoPath + '/lato-reg-webfont.svg#latoregular') format('svg'); +} +@font-face { + font-family: "Lato"; + font-weight: normal; + font-style: italic; + src: url($fontLatoPath + '/lato-regita-webfont-g.eot'); + src: url($fontLatoPath + '/lato-regita-webfont-g.eot?#iefix') format('embedded-opentype'),url($fontLatoPath + '/lato-regita-webfont-g.woff') format('woff'),url($fontLatoPath + '/lato-regita-webfont-g.ttf') format('truetype'),url($fontLatoPath + '/lato-regita-webfont.svg#latoitalic') format('svg'); +} + +// Lato Bold/Bold Italic +// -------------------------------------------------- +@font-face { + font-family: "Lato"; + font-weight: 700; + font-style: normal; + src: url($fontLatoPath + '/lato-bol-webfont-g.eot'); + src: url($fontLatoPath + '/lato-bol-webfont-g.eot?#iefix') format('embedded-opentype'), url($fontLatoPath + "/lato-bol-webfont-g.woff") format('woff'), url($fontLatoPath + '/lato-bol-webfont-g.ttf') format('truetype'),url($fontLatoPath + '/lato-bol-webfont.svg#latobold') format('svg'); +} +@font-face { + font-family: "Lato"; + font-weight: 700; + font-style: italic; + src: url($fontLatoPath + '/lato-bolita-webfont-g.eot'); + src: url($fontLatoPath + '/lato-bolita-webfont-g.eot?#iefix') format('embedded-opentype'),url($fontLatoPath + '/lato-bolita-webfont-g.woff') format('woff'),url($fontLatoPath + '/lato-bolita-webfont-g.ttf') format('truetype'),url($fontLatoPath + '/lato-bolita-webfont.svg#latobold_italic') format('svg'); +} + @font-face { font-family: 'slate'; src:font-url('slate.eot?-syv14m'); src:font-url('slate.eot?#iefix-syv14m') format('embedded-opentype'), - font-url('slate.woff2?-syv14m') format('woff2'), - font-url('slate.woff?-syv14m') format('woff'), - font-url('slate.ttf?-syv14m') format('truetype'), - font-url('slate.svg?-syv14m#slate') format('svg'); + font-url('slate.woff2?-syv14m') format('woff2'), + font-url('slate.woff?-syv14m') format('woff'), + font-url('slate.ttf?-syv14m') format('truetype'), + font-url('slate.svg?-syv14m#slate') format('svg'); font-weight: normal; font-style: normal; } @@ -18,6 +72,8 @@ font-variant: normal; text-transform: none; line-height: 1; + position: relative; + top: -2px; } %icon-exclamation-sign { diff --git a/source/stylesheets/_syntax.scss.erb b/source/stylesheets/_syntax.scss.erb index dfeb0c15240..19f1280b4e8 100644 --- a/source/stylesheets/_syntax.scss.erb +++ b/source/stylesheets/_syntax.scss.erb @@ -19,9 +19,57 @@ under the License. <%= Rouge::Themes::Base16::Monokai.render(:scope => '.highlight') %> .highlight .c, .highlight .cm, .highlight .c1, .highlight .cs { - color: #909090; + color: #a9a9a9; } .highlight, .highlight .w { background-color: $code-bg; +} +.highlight .kd { + color: #ff8800; +} +.highlight .nx { + color: #0073ae; +} +.highlight .o { + color: #1f1f1f; +} +.highlight .s1 { + color: #585858; +} +.highlight .k { + color: #ee0000; +} +.highlight .na { + color: #34AC2F; +} +.highlight .p { + color: #1f1f1f; +} +.highlight .mi { + color: #eb6321; +} +.highlight .kc { + color: #8100d3; +} +.highlight .err { + background-color: transparent; +} +.highlight .nf { + color: #ff8800; +} +.highlight .nn { + color: #0073ae; +} +.highlight .s { + color: #1f1f1f; +} +.highlight .m { + color: #1f1f1f; +} +.highlight .nt { + color: #ff8800; +} +.highlight .s2 { + color: #585858; } \ No newline at end of file diff --git a/source/stylesheets/_variables.scss b/source/stylesheets/_variables.scss index 5fe64b1f302..15bba39ead3 100644 --- a/source/stylesheets/_variables.scss +++ b/source/stylesheets/_variables.scss @@ -23,36 +23,38 @@ under the License. // BACKGROUND COLORS //////////////////// -$nav-bg: #393939; -$examples-bg: #393939; -$code-bg: #292929; -$code-annotation-bg: #1c1c1c; -$nav-subitem-bg: #262626; -$nav-active-bg: #2467af; +$nav-bg: #f5f5f5; +$examples-bg: #fff; +$code-bg: #f5f5f5; +$code-annotation-bg: #f6f6d5; +$nav-subitem-bg: #f5f5f5; +$nav-active-bg: #ebebeb; $lang-select-border: #000; -$lang-select-bg: #222; -$lang-select-active-bg: $examples-bg; // feel free to change this to blue or something -$lang-select-pressed-bg: #111; // color of language tab bg when mouse is pressed -$main-bg: #eaf2f6; -$aside-notice-bg: #8fbcd4; -$aside-warning-bg: #c97a7e; -$aside-success-bg: #6ac174; -$search-notice-bg: #c97a7e; +$lang-select-bg: #fff; +$lang-select-active-bg: #fff; // feel free to change this to blue or something +$lang-select-pressed-bg: #fff; // color of language tab bg when mouse is pressed +$main-bg: #fff; +$aside-notice-bg: #d8f4ff; +$aside-warning-bg: #ffccce; +$aside-success-bg: #d7f0db; +$search-notice-bg: #a9a9a9; // TEXT COLORS //////////////////// -$main-text: #333; // main content text color -$nav-text: #fff; -$nav-active-text: #fff; -$lang-select-text: #fff; // color of unselected language tab text -$lang-select-active-text: #fff; // color of selected language tab text -$lang-select-pressed-text: #fff; // color of language tab text when mouse is pressed +$main-text: #585858; // main content text color +$nav-text: #585858; +$nav-link-text: #0073ae; +$nav-active-text: #ff8800; +$lang-select-text: $main-text; // color of unselected language tab text +$lang-select-active-text: #585858; // color of selected language tab text +$lang-select-pressed-text: #585858; // color of language tab text when mouse is pressed +$content-header-color: #0073ae; // SIZES //////////////////// -$nav-width: 230px; // width of the navbar +$nav-width: 280px; // width of the navbar $examples-width: 50%; // portion of the screen taken up by code examples $logo-margin: 20px; // margin between nav items and logo, ignored if search is active $main-padding: 28px; // padding to left and right of content & examples @@ -68,7 +70,7 @@ $phone-width: $tablet-width - $nav-width; // min width before reverting to mobil // FONTS //////////////////// %default-font { - font-family: "Helvetica Neue", Helvetica, Arial, "Microsoft Yahei","微软雅黑", STXihei, "华文细黑", sans-serif; + font-family: "Lato", "Helvetica Neue", Helvetica, Arial, "Microsoft Yahei","微软雅黑", STXihei, "华文细黑", sans-serif; font-size: 13px; } @@ -79,7 +81,7 @@ $phone-width: $tablet-width - $nav-width; // min width before reverting to mobil %code-font { font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, serif; - font-size: 12px; + font-size: 14px; line-height: 1.5; } @@ -91,7 +93,9 @@ $nav-footer-border-color: #666; $nav-embossed-border-top: #000; $nav-embossed-border-bottom: #939393; $main-embossed-text-shadow: 0px 1px 0px #fff; -$search-box-border-color: #666; +$search-box-border-color: #a9a9a9; +$content-border-color: #dcdcdc; +$lang-border-color: #0073ae; //////////////////////////////////////////////////////////////////////////////// @@ -100,10 +104,10 @@ $search-box-border-color: #666; // These settings are probably best left alone. %break-words { - word-break: break-all; + word-break: break-all; - /* Non standard for webkit */ - word-break: break-word; + /* Non standard for webkit */ + word-break: break-word; - hyphens: auto; + hyphens: auto; } diff --git a/source/stylesheets/screen.css.scss b/source/stylesheets/screen.css.scss index e4b3ef82b22..23e10fb7476 100644 --- a/source/stylesheets/screen.css.scss +++ b/source/stylesheets/screen.css.scss @@ -50,11 +50,11 @@ html, body { @mixin embossed-bg { background: - linear-gradient(to bottom, rgba(#000, 0.2), rgba(#000, 0) 8px), - linear-gradient(to top, rgba(#000, 0.2), rgba(#000, 0) 8px), - linear-gradient(to bottom, rgba($nav-embossed-border-top, 1), rgba($nav-embossed-border-top, 0) 1.5px), - linear-gradient(to top, rgba($nav-embossed-border-bottom, 1), rgba($nav-embossed-border-bottom, 0) 1.5px), - $nav-subitem-bg; + linear-gradient(to bottom, rgba(#000, 0.2), rgba(#000, 0) 8px), + linear-gradient(to top, rgba(#000, 0.2), rgba(#000, 0) 8px), + linear-gradient(to bottom, rgba($nav-embossed-border-top, 1), rgba($nav-embossed-border-top, 0) 1.5px), + linear-gradient(to top, rgba($nav-embossed-border-bottom, 1), rgba($nav-embossed-border-bottom, 0) 1.5px), + $nav-subitem-bg; } .tocify-wrapper { @@ -65,7 +65,6 @@ html, body { position: fixed; z-index: 30; top: 0; - left: 0; bottom: 0; width: $nav-width; background-color: $nav-bg; @@ -81,9 +80,16 @@ html, body { } } + .logo { + display: block; + width: 100%; + padding: 15px 0; + } + // This is the logo at the top of the ToC - &>img { + img { display: block; + margin: 0 auto; } &>.search { @@ -106,7 +112,7 @@ html, body { position: absolute; top: 17px; left: $nav-padding; - color: $nav-text; + color: #a9a9a9; @extend %icon-search; } } @@ -129,8 +135,6 @@ html, body { margin-bottom: 1em; } - @include embossed-bg; - li { margin: 1em $nav-padding; line-height: 1; @@ -155,6 +159,10 @@ html, body { text-overflow: ellipsis; } + .tocify-item.tocify-focus>a { + padding-left: 10px; + } + // The Table of Contents is composed of multiple nested // unordered lists. These styles remove the default // styling of an unordered list because it is ugly. @@ -174,9 +182,13 @@ html, body { // This is the currently selected ToC entry .tocify-focus { - box-shadow: 0px 1px 0px $nav-active-shadow; - background-color: $nav-active-bg; color: $nav-active-text; + border-left: 5px solid $nav-active-text; + } + + .tocify-hover { + color: $nav-active-text; + background-color: $nav-active-bg; } // Subheaders are the submenus that slide open @@ -189,9 +201,10 @@ html, body { padding-left: $nav-padding + $nav-indent; font-size: 12px; } + .tocify-item.tocify-focus>a { + padding-left: 20px; + } - // for embossed look: - @include embossed-bg; &>li:last-child { box-shadow: none; // otherwise it'll overflow out of the subheader } @@ -200,11 +213,11 @@ html, body { .toc-footer { padding: 1em 0; margin-top: 1em; - border-top: 1px dashed $nav-footer-border-color; li,a { - color: $nav-text; - text-decoration: none; + color: $nav-link-text; + text-decoration: underline; + font-size: 12px; } a:hover { @@ -212,9 +225,11 @@ html, body { } li { - font-size: 0.8em; + font-size: 12px; line-height: 1.7; text-decoration: none; + color: #585858; + white-space: normal; } } @@ -279,19 +294,20 @@ html, body { right: 0; top: 0; bottom: 0; + border-left: 1px solid $content-border-color; } .lang-selector { position: fixed; z-index: 50; - border-bottom: 5px solid $lang-select-active-bg; + border-bottom: 1px solid $lang-border-color; } } .lang-selector { background-color: $lang-select-bg; - width: 100%; font-weight: bold; + width: 100%; a { display: block; float:left; @@ -303,12 +319,14 @@ html, body { &:active, &:focus { background-color: $lang-select-pressed-bg; + border-bottom: 5px solid $lang-border-color; color: $lang-select-pressed-text; } &.active { background-color: $lang-select-active-bg; color: $lang-select-active-text; + border-bottom: 5px solid $lang-border-color; } } @@ -329,6 +347,11 @@ html, body { position: relative; z-index: 30; + a { + color: $nav-link-text; + text-decoration: underline; + } + &:after { content: ''; display: block; @@ -357,35 +380,34 @@ html, body { h1 { @extend %header-font; font-size: 30px; - padding-top: 0.5em; - padding-bottom: 0.5em; - border-bottom: 1px solid #ccc; - margin-bottom: $h1-margin-bottom; - margin-top: 2em; - border-top: 1px solid #ddd; - background-image: linear-gradient(to bottom, #fff, #f9f9f9); + padding: 1em 0 0 $main-padding; + margin: 2em 50% 1em 0; + border-top: 1px solid $content-border-color; + color: $content-header-color; + font-weight: 200; } h1:first-child, div:first-child + h1 { border-top-width: 0; - margin-top: 0; + margin: 0 50% 1em 0; } h2 { @extend %header-font; font-size: 20px; - margin-top: 4em; - margin-bottom: 0; - border-top: 1px solid #ccc; - padding-top: 1.2em; - padding-bottom: 1.2em; + border-top: 1px solid $content-border-color; + padding: 0.8em 0; + margin-left: $main-padding; + margin-right: calc(50% + 28px); + margin-right: -webkit-calc(50% + 28px); + margin-right: -moz-calc(50% + 28px); background-image: linear-gradient(to bottom, rgba(#fff, 0.4), rgba(#fff, 0)); } // h2s right after h1s should bump right up // against the h1s. h1 + h2, h1 + div + h2 { - margin-top: $h1-margin-bottom * -1; + margin-top: 0; border-top: none; } @@ -402,7 +424,7 @@ html, body { hr { margin: 2em 0; - border-top: 2px solid $examples-bg; + border-top: 2px solid $content-border-color; border-bottom: 2px solid $main-bg; } @@ -419,10 +441,12 @@ html, body { padding: 5px 10px; border-bottom: 1px solid #ccc; vertical-align: bottom; + min-width: 70px; } td { - padding: 10px; + padding: 0 10px; + line-height: 30px; } tr:last-child { @@ -430,11 +454,11 @@ html, body { } tr:nth-child(odd)>td { - background-color: lighten($main-bg,4.2%); + background-color: white; } tr:nth-child(even)>td { - background-color: lighten($main-bg,2.4%); + background-color: #f6f6f6; } } @@ -456,8 +480,8 @@ html, body { } code { - background-color: rgba(0,0,0,0.05); - padding: 3px; + background-color: #eaeaea; + padding: 2px 3px; border-radius: 3px; @extend %break-words; @extend %code-font; @@ -510,9 +534,7 @@ html, body { padding: 2px; margin: -2px; border-radius: 4px; - border: 1px solid #F7E633; - @include text-shadow(1px 1px 0 #666); - background: linear-gradient(to top left, #F7E633 0%, #F1D32F 100%); + background-color: #fff200; } } @@ -524,9 +546,9 @@ html, body { .content { pre, blockquote { background-color: $code-bg; - color: #fff; + color: #0073ae; - padding: 2em $main-padding; + padding: 1.2em 0; margin: 0; width: $examples-width; @@ -534,7 +556,6 @@ html, body { clear:right; box-sizing: border-box; - @include text-shadow(0px 1px 2px rgba(0,0,0,0.4)); @extend %right-col; @@ -549,16 +570,16 @@ html, body { pre { @extend %code-font; + padding-left: 28px; + padding-right: 28px; } blockquote { &>p { background-color: $code-annotation-bg; - border-radius: 5px; - padding: $code-annotation-padding; - color: #ccc; - border-top: 1px solid #000; - border-bottom: 1px solid #404040; + padding: 0 $code-annotation-padding; + color: #585858; + line-height: 28px; } } } diff --git a/start.sh b/start.sh new file mode 100644 index 00000000000..05371492548 --- /dev/null +++ b/start.sh @@ -0,0 +1 @@ +bundle exec middleman server