Content-Length: 764457 | pFad | http://github.com/NativeScript/plugins/commit/d61a1d6a6e411ba6879f7058bbbb892523760567

2E chore(all): update snippets for website rendering (#174) · NativeScript/plugins@d61a1d6 · GitHub
Skip to content

Commit d61a1d6

Browse files
authored
chore(all): update snippets for website rendering (#174)
1 parent 07554e9 commit d61a1d6

File tree

22 files changed

+430
-388
lines changed

22 files changed

+430
-388
lines changed

packages/animated-circle/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Nativescript animated-circle
1+
# @nativescript/animated-circle
22

33
```bash
44
ns plugin add @nativescript/animated-circle

packages/appavailability/README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# Nativescript appavailability
1+
# @nativescript/app-availability
22

33
A plugin to check for availability of other apps on the device.
44

5-
```javascript
5+
```cli
66
ns plugin add @nativescript/appavailability
77
```
88

@@ -38,7 +38,7 @@ appavailability.available('twitter://').then((avail: boolean) => {
3838

3939
### JavaScript
4040

41-
```js
41+
```javascript
4242
var appAvailability = require('@nativescript/appavailability');
4343

4444
// examples of what to pass:

packages/auto-fit-text/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Nativescript auto-fit-text
1+
# @nativescript/auto-fit-text
22

3-
```bash
3+
```cli
44
ns plugin add @nativescript/auto-fit-text
55
```
66

packages/background-http/README.md

+37-38
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Nativescript background-http
1+
# @nativescript/background-http
22

3-
```javascript
3+
```cli
44
ns plugin add @nativescript/background-http
55
```
66

@@ -12,24 +12,23 @@ The below attached code snippets demonstrate how to use `@nativescript/backgroun
1212

1313
Sample code for configuring the upload session. Each session must have a unique `id`, but it can have multiple tasks running simultaneously. The `id` is passed as a parameter when creating the session (the `image-upload` string in the code bellow):
1414

15-
```JavaScript
16-
15+
```javascript
1716
// file path and url
18-
var file = "/some/local/file/path/and/file/name.jpg";
19-
var url = "https://some.remote.service.com/path";
20-
var name = file.substr(file.lastIndexOf("/") + 1);
17+
var file = '/some/local/file/path/and/file/name.jpg';
18+
var url = 'https://some.remote.service.com/path';
19+
var name = file.substr(file.lastIndexOf('/') + 1);
2120

2221
// upload configuration
23-
var bghttp = require("@nativescript/background-http");
24-
var session = bghttp.session("image-upload");
22+
var bghttp = require('@nativescript/background-http');
23+
var session = bghttp.session('image-upload');
2524
var request = {
26-
url: url,
27-
method: "POST",
28-
headers: {
29-
"Content-Type": "application/octet-stream"
30-
},
31-
description: "Uploading " + name
32-
};
25+
url: url,
26+
method: 'POST',
27+
headers: {
28+
'Content-Type': 'application/octet-stream',
29+
},
30+
description: 'Uploading ' + name,
31+
};
3332
```
3433

3534
For a single file upload, use the following code:
@@ -57,30 +56,30 @@ In order to have a successful upload, the following must be taken into account:
5756

5857
The request object parameter has the following properties:
5958

60-
Name | Type | Description
61-
--- | --- | ---
62-
url | `string` | The request url (e.g.`https://some.remote.service.com/path`).
63-
method | `string` | The request method (e.g. `POST`).
64-
headers | `object` | Used to specify additional headers.
65-
description | `string` | Used to help identify the upload task locally - not sent to the remote server.
66-
utf8 | `boolean` | (Android only/multipart only) If true, sets the charset for the multipart request to UTF-8. Default is false.
67-
androidDisplayNotificationProgress | `boolean` | (Android only) Used to set if progress notifications should be displayed or not. Please note that since API26, Android requires developers to use notifications when running background tasks. https://developer.android.com/about/versions/oreo/background
68-
androidNotificationTitle | `string` | (Android only) Used to set the title shown in the Android notifications center.
69-
androidAutoDeleteAfterUpload | `boolean` | (Android only) Used to set if files should be deleted automatically after upload.
70-
androidMaxRetries | `number` | (Android only) Used to set the maximum retry count. The default retry count is 0. https://github.com/gotev/android-upload-service/wiki/Recipes#backoff
71-
androidAutoClearNotification | `boolean` | (Android only) Used to set if notifications should be cleared automatically upon upload completion. Default is false. Please note that setting this to true will also disable the ringtones.
72-
androidRingToneEnabled | `boolean` | (Android only) Used to set if a ringtone should be played upon upload completion. Default is true. Please note that this flag has no effect when `androidAutoClearNotification` is set to true.
73-
androidNotificationChannelID | `string` | (Android only) Used to set the channel ID for the notifications.
59+
| Name | Type | Description |
60+
| ---------------------------------- | --------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
61+
| url | `string` | The request url (e.g.`https://some.remote.service.com/path`). |
62+
| method | `string` | The request method (e.g. `POST`). |
63+
| headers | `object` | Used to specify additional headers. |
64+
| description | `string` | Used to help identify the upload task locally - not sent to the remote server. |
65+
| utf8 | `boolean` | (Android only/multipart only) If true, sets the charset for the multipart request to UTF-8. Default is false. |
66+
| androidDisplayNotificationProgress | `boolean` | (Android only) Used to set if progress notifications should be displayed or not. Please note that since API26, Android requires developers to use notifications when running background tasks. https://developer.android.com/about/versions/oreo/background |
67+
| androidNotificationTitle | `string` | (Android only) Used to set the title shown in the Android notifications center. |
68+
| androidAutoDeleteAfterUpload | `boolean` | (Android only) Used to set if files should be deleted automatically after upload. |
69+
| androidMaxRetries | `number` | (Android only) Used to set the maximum retry count. The default retry count is 0. https://github.com/gotev/android-upload-service/wiki/Recipes#backoff |
70+
| androidAutoClearNotification | `boolean` | (Android only) Used to set if notifications should be cleared automatically upon upload completion. Default is false. Please note that setting this to true will also disable the ringtones. |
71+
| androidRingToneEnabled | `boolean` | (Android only) Used to set if a ringtone should be played upon upload completion. Default is true. Please note that this flag has no effect when `androidAutoClearNotification` is set to true. |
72+
| androidNotificationChannelID | `string` | (Android only) Used to set the channel ID for the notifications. |
7473

7574
The task object has the following properties and methods, that can be used to get information about the upload:
7675

77-
Name | Type | Description
78-
--- | --- | ---
79-
upload | `number` | Bytes uploaded.
80-
totalUpload | `number` | Total number of bytes to upload.
81-
status | `string` | One of the following: `error`, `uploading`, `complete`, `pending`, `cancelled`.
82-
description | `string` | The description set in the request used to create the upload task.
83-
cancel()| `void` | Call this method to cancel an upload in progress.
76+
| Name | Type | Description |
77+
| ----------- | -------- | ------------------------------------------------------------------------------- |
78+
| upload | `number` | Bytes uploaded. |
79+
| totalUpload | `number` | Total number of bytes to upload. |
80+
| status | `string` | One of the following: `error`, `uploading`, `complete`, `pending`, `cancelled`. |
81+
| description | `string` | The description set in the request used to create the upload task. |
82+
| cancel() | `void` | Call this method to cancel an upload in progress. |
8483

8584
### Handling upload events
8685

@@ -152,7 +151,7 @@ node server 8080
152151

153152
The above commands will start a server listening on port 8080. Remember to update the URL in your app to match the address/port where the server is running.
154153

155-
>Note: If you are using the iOS simulator then `http://localhost:8080` should be used to upload to the demo server. If you are using an Android emulator, `http://10.0.2.2:8080` should be used instead.
154+
> Note: If you are using the iOS simulator then `http://localhost:8080` should be used to upload to the demo server. If you are using an Android emulator, `http://10.0.2.2:8080` should be used instead.
156155
157156
## License
158157

packages/brightness/README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Nativescript brightness
1+
# @nativescript/brightness
22

3-
```javascript
3+
```cli
44
ns plugin add @nativescript/brightness
55
```
66

@@ -12,7 +12,7 @@ This plugin requires `<uses-permission android:name="android.permission.WRITE_SE
1212

1313
To use the brightness module you must first `require()` and instantiate it:
1414

15-
```js
15+
```javascript
1616
// JavaScript
1717
var nativescriptBrightness = require('@nativescript/brightness');
1818
var brightness = new nativescriptBrightness.Brightness();

packages/camera/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# NativeScript Camera
1+
# @nativescript/camera
22

33
# Working with the camera plugin
44

@@ -9,7 +9,7 @@ The NativeScript camera plugin was designed for the first two parts of the job (
99

1010
## Installation
1111

12-
```
12+
```cli
1313
npm install @nativescript/camera --save
1414
```
1515

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/NativeScript/plugins/commit/d61a1d6a6e411ba6879f7058bbbb892523760567

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy