mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-16 03:31:45 +08:00
Fix language tags in doc-snippets
The doc-snippets were inconsistent (no spaces before title, small-caps, JS instead of JavaScript, etc.)
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
To run tests please build using one of the *_Tests build configurations and call runAll() method of the Tests module. For example:
|
||||
|
||||
##iOS
|
||||
```js
|
||||
``` JavaScript
|
||||
var app = require("application");
|
||||
app.init(null);
|
||||
var tests = require("Tests");
|
||||
@ -9,7 +9,7 @@ tests.runAll();
|
||||
```
|
||||
|
||||
##Android
|
||||
```js
|
||||
``` JavaScript
|
||||
app.init({
|
||||
getActivity: function(intent) {
|
||||
return com.tns.NativeScriptActivity.extend({});
|
||||
@ -19,4 +19,4 @@ app.init({
|
||||
require("Tests").runAll();
|
||||
}
|
||||
});
|
||||
```
|
||||
```
|
||||
|
@ -107,7 +107,7 @@ export var test_fetch_response_status = function (done) {
|
||||
|
||||
// <snippet module="fetch" title="fetch">
|
||||
// ### Get Response status
|
||||
// ``` fetch
|
||||
// ``` JavaScript
|
||||
fetch("https://httpbin.org/get").then(function (response) {
|
||||
//// Argument (response) is Response!
|
||||
var statusCode = response.status;
|
||||
@ -228,4 +228,4 @@ export var test_fetch_post_json = function (done) {
|
||||
});
|
||||
// ```
|
||||
// </snippet>
|
||||
};
|
||||
};
|
||||
|
@ -14,7 +14,7 @@ import absoluteLayoutModule = require("ui/layouts/absolute-layout");
|
||||
// </snippet>
|
||||
|
||||
// ### Declaring a AbsoluteLayout.
|
||||
//```XML
|
||||
//``` XML
|
||||
// <Page>
|
||||
// <AbsoluteLayout>
|
||||
// <Label text="This is Label 1" left="30" top="70" />
|
||||
|
@ -14,7 +14,7 @@ import dockModule = require("ui/layouts/dock-layout");
|
||||
// ```
|
||||
|
||||
// ### Declaring a DockLayout.
|
||||
//```XML
|
||||
//``` XML
|
||||
//<Page>
|
||||
// <DockLayout stretchLastChild="true" >
|
||||
// <Button dock="left" text="left" style="background-color: red; margin: 5;"/ >/ >
|
||||
|
@ -171,7 +171,7 @@ export class StackLayoutTest extends testModule.UITest<StackLayout> {
|
||||
// ```
|
||||
|
||||
// ### Declaring a StackLayout.
|
||||
//```XML
|
||||
//``` XML
|
||||
// <Page>
|
||||
// <StackLayout orientation="horizontal">
|
||||
// <Label text="This is Label 1" />
|
||||
|
@ -28,7 +28,7 @@ export class WrapLayoutTest extends testModule.UITest<wrapLayoutModule.WrapLayou
|
||||
// </snippet>
|
||||
|
||||
// ### Declaring a WrapLayout.
|
||||
//```XML
|
||||
//``` XML
|
||||
// <Page>
|
||||
// <WrapLayout>
|
||||
// <Label text="This is Label 1" />
|
||||
|
@ -16,7 +16,7 @@ import actionBarModule = require("ui/action-bar");
|
||||
// ```
|
||||
//
|
||||
// ## Setting Title and Icon
|
||||
//```XML
|
||||
//``` XML
|
||||
// <Page>
|
||||
// <Page.actionBar>
|
||||
// {%raw%}<ActionBar title="{{ title }}" android.icon="res://is_custom_home_icon"/>{%endraw%}
|
||||
@ -28,7 +28,7 @@ import actionBarModule = require("ui/action-bar");
|
||||
//
|
||||
//
|
||||
// ## Setting Custom Title View
|
||||
//```XML
|
||||
//``` XML
|
||||
// <Page loaded="pageLoaded">
|
||||
// <Page.actionBar>
|
||||
// <ActionBar title="Title">
|
||||
@ -46,7 +46,7 @@ import actionBarModule = require("ui/action-bar");
|
||||
//```
|
||||
//
|
||||
// ## Setting Action Items
|
||||
//```XML
|
||||
//``` XML
|
||||
// <Page>
|
||||
// <Page.actionBar>
|
||||
// <ActionBar title="Title">
|
||||
@ -66,7 +66,7 @@ import actionBarModule = require("ui/action-bar");
|
||||
// * **iOS** - `left` and `right`. The default is `left`.
|
||||
//
|
||||
// ## Displaying Platform-Specific System Icons on Action Items
|
||||
//```XML
|
||||
//``` XML
|
||||
// <Page>
|
||||
// <Page.actionBar>
|
||||
// <ActionBar>
|
||||
@ -119,7 +119,7 @@ import actionBarModule = require("ui/action-bar");
|
||||
//For a full list of Android drawable names, please visit http://androiddrawables.com
|
||||
//
|
||||
// ## Displaying Custom View in Action Items
|
||||
//```XML
|
||||
//``` XML
|
||||
// <Page>
|
||||
// <Page.actionBar>
|
||||
// <ActionBar>
|
||||
@ -140,7 +140,7 @@ import actionBarModule = require("ui/action-bar");
|
||||
//```
|
||||
//
|
||||
// ## Setting Navigation Button
|
||||
//```XML
|
||||
//``` XML
|
||||
// <Page>
|
||||
// <Page.actionBar>
|
||||
// <ActionBar title="Title">
|
||||
@ -479,4 +479,4 @@ export function createPageAndNavigate() {
|
||||
helper.navigate(pageFactory);
|
||||
|
||||
return page;
|
||||
}
|
||||
}
|
||||
|
@ -12,7 +12,7 @@ import color = require("color");
|
||||
import activityIndicatorModule = require("ui/activity-indicator");
|
||||
// ```
|
||||
// ### Binding the activity indicator busy property to a view-model property.
|
||||
//```XML
|
||||
//``` XML
|
||||
// <Page>
|
||||
// {%raw%}<ActivityIndicator busy="{{ isLoading }}" />{%endraw%}
|
||||
// </Page>
|
||||
|
@ -6,7 +6,7 @@
|
||||
// ```
|
||||
|
||||
// ### Declaring a Border.
|
||||
//```XML
|
||||
//``` XML
|
||||
// <Page>
|
||||
// <Border borderRadius="10" borderWidth="1" borderColor="#FF0000">
|
||||
// <Button text="OK"/>
|
||||
|
@ -21,7 +21,7 @@ import observable = require("data/observable");
|
||||
// ```
|
||||
|
||||
// ### Attaching event handler for the button tap event.
|
||||
//```XML
|
||||
//``` XML
|
||||
// <Page>
|
||||
// <Button tap="buttonTap" />
|
||||
// </Page>
|
||||
|
@ -13,7 +13,7 @@ import htmlViewModule = require("ui/html-view");
|
||||
|
||||
// <snippet module="ui/html-view" title="HtmlView">
|
||||
// ### Declaring a HtmlView.
|
||||
//```XML
|
||||
//``` XML
|
||||
// <Page>
|
||||
// {%raw%}<HtmlView html="{{ htmlString }}" />{%endraw%}
|
||||
// </Page>
|
||||
@ -56,4 +56,4 @@ export var testLoadHTMLString = function () {
|
||||
} else if (htmlView.android) {
|
||||
TKUnit.assert(htmlView.android.getText(), "HTML string not loaded properly. Actual: " + htmlView.android.getText());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -7,7 +7,7 @@ import ImageModule = require("ui/image");
|
||||
// ```
|
||||
|
||||
// Binding the image source property to a view-model property.
|
||||
//```XML
|
||||
//``` XML
|
||||
// <Page>
|
||||
// <StackLayout>
|
||||
// <!--Bind the image source property to view-model property -->
|
||||
@ -276,4 +276,4 @@ export var test_SettingStretch_none = function () {
|
||||
}
|
||||
|
||||
helper.buildUIAndRunTest(image, testFunc);
|
||||
}
|
||||
}
|
||||
|
@ -10,7 +10,7 @@ import LabelModule = require("ui/label");
|
||||
// ```
|
||||
|
||||
// ### Binding the Label text property to a view-model property.
|
||||
//```XML
|
||||
//``` XML
|
||||
// <Page>
|
||||
// {%raw%}<Label text="{{ title }}" />{%endraw%}
|
||||
// </Page>
|
||||
|
@ -20,14 +20,14 @@ import labelModule = require("ui/label");
|
||||
// ```
|
||||
|
||||
// ### Binding the ListView items property to collection in the view-model.
|
||||
//```XML
|
||||
//``` XML
|
||||
// <Page>
|
||||
// {%raw%}<ListView items="{{ myItems }}" />{%endraw%}
|
||||
// </Page>
|
||||
//```
|
||||
|
||||
// ### Attaching event handler for the ListView itemTap event.
|
||||
//```XML
|
||||
//``` XML
|
||||
// <Page>
|
||||
// {%raw%}<ListView items="{{ myItems }}" itemTap="listViewItemTap" />{%endraw%}
|
||||
// </Page>
|
||||
@ -40,12 +40,12 @@ import labelModule = require("ui/label");
|
||||
//```
|
||||
|
||||
// ### Attaching event handler for the ListView loadMoreItems event.
|
||||
//```XML
|
||||
//``` XML
|
||||
// <Page>
|
||||
// {%raw%}<ListView items="{{ myItems }}" loadMoreItems="listViewLoadMoreItems" />{%endraw%}
|
||||
// </Page>
|
||||
//```
|
||||
//```JS
|
||||
//``` JavaScript
|
||||
// function listViewLoadMoreItems(args) {
|
||||
// // Expand your collection bound to the ListView with more items here!
|
||||
// }
|
||||
@ -53,7 +53,7 @@ import labelModule = require("ui/label");
|
||||
//```
|
||||
|
||||
// ### Define the ListView itemTemplate property.
|
||||
//```XML
|
||||
//``` XML
|
||||
// <Page>
|
||||
// {%raw%}<ListView items="{{ myItems }}">
|
||||
// <ListView.itemTemplate>
|
||||
|
@ -12,12 +12,12 @@ import placeholderModule = require("ui/placeholder");
|
||||
// ```
|
||||
|
||||
// Creating native view for the Placeholder using creatingView event.
|
||||
//```XML
|
||||
//``` XML
|
||||
// <Page>
|
||||
// {%raw%}<Placeholder creatingView="creatingView" />{%endraw%}
|
||||
// </Page>
|
||||
//```
|
||||
//```JS
|
||||
//``` JavaScript
|
||||
//var platform = require("platform");
|
||||
//var utils = require("utils/utils");
|
||||
//
|
||||
@ -75,4 +75,4 @@ export function test_placeholder_will_not_crash_wihout_creatingView() {
|
||||
};
|
||||
|
||||
helper.buildUIAndRunTest(p, testAction);
|
||||
}
|
||||
}
|
||||
|
@ -13,12 +13,12 @@ import progressModule = require("ui/progress");
|
||||
// ```
|
||||
|
||||
// Binding the Progress value property to a view-model property.
|
||||
//```XML
|
||||
//``` XML
|
||||
// <Page loaded="pageLoaded">
|
||||
// {%raw%}<Progress value="{{ someProperty }}" />{%endraw%}
|
||||
// </Page>
|
||||
//```
|
||||
//```JS
|
||||
//``` JavaScript
|
||||
// function pageLoaded(args) {
|
||||
// var page = args.object;
|
||||
// page.bindingContext = { someProperty : 42 };
|
||||
|
@ -23,14 +23,14 @@ import labelModule = require("ui/label");
|
||||
// ```
|
||||
|
||||
// ### Binding the Repeater items property to collection in the view-model.
|
||||
//```XML
|
||||
//``` XML
|
||||
// <Page>
|
||||
// {%raw%}<Repeater items="{{ myItems }}" />{%endraw%}
|
||||
// </Page>
|
||||
//```
|
||||
|
||||
// ### Define the Repeater itemTemplate property.
|
||||
//```XML
|
||||
//``` XML
|
||||
// <Page>
|
||||
// {%raw%}<Repeater items="{{ myItems }}">
|
||||
// <Repeater.itemTemplate>
|
||||
@ -41,7 +41,7 @@ import labelModule = require("ui/label");
|
||||
//```
|
||||
|
||||
// ### Define the Repeater itemsLayout property. Default is StackLayout with orientation="vertical".
|
||||
//```XML
|
||||
//``` XML
|
||||
// <Page>
|
||||
// {%raw%}<Repeater items="{{ myItems }}">
|
||||
// <Repeater.itemsLayout>
|
||||
@ -52,7 +52,7 @@ import labelModule = require("ui/label");
|
||||
//```
|
||||
|
||||
// ### Repeater with WrapLayout inside ScrollView.
|
||||
//```XML
|
||||
//``` XML
|
||||
// <Page>
|
||||
// {%raw%}<ScrollView>
|
||||
// <Repeater items="{{ myItems }}">
|
||||
|
@ -14,7 +14,7 @@ import scrollViewModule = require("ui/scroll-view");
|
||||
// ```
|
||||
|
||||
// ### Declaring the ScrollView.
|
||||
//```XML
|
||||
//``` XML
|
||||
// <Page>
|
||||
// <ScrollView>
|
||||
// {%raw%}<Image src="{{ someBigImageUrl }}" />{%endraw%}
|
||||
|
@ -13,7 +13,7 @@ import searchBarModule = require("ui/search-bar");
|
||||
// </snippet>
|
||||
|
||||
// ### Declaring a SearchBar.
|
||||
//```XML
|
||||
//``` XML
|
||||
// <Page>
|
||||
// <SearchBar text="{{ search }}" />
|
||||
// </Page>
|
||||
@ -87,4 +87,4 @@ export function test_DummyTestForSnippetOnly() {
|
||||
});
|
||||
// ```
|
||||
// </snippet>
|
||||
}
|
||||
}
|
||||
|
@ -21,7 +21,7 @@ function _createSegmentedBar(): segmentedBarModule.SegmentedBar {
|
||||
// ``` JavaScript
|
||||
var segmentedBar = new segmentedBarModule.SegmentedBar();
|
||||
// ```
|
||||
// ``` xml
|
||||
// ``` XML
|
||||
// <SegmentedBar>
|
||||
// <SegmentedBar.items>
|
||||
// <SegmentedBarItem title="Item 1" />
|
||||
|
@ -15,7 +15,7 @@ import sliderModule = require("ui/slider");
|
||||
// ```
|
||||
|
||||
// ### Binding the Progress and Slider value properties to a observable view-model property.
|
||||
//```XML
|
||||
//``` XML
|
||||
// <Page loaded="pageLoaded">
|
||||
// <StackLayout orientation="vertical">
|
||||
// {%raw%}<Progress value="{{ someProperty }}" />
|
||||
@ -23,7 +23,7 @@ import sliderModule = require("ui/slider");
|
||||
// </StackLayout>
|
||||
// </Page>
|
||||
//```
|
||||
//```JS
|
||||
//``` JavaScript
|
||||
// function pageLoaded(args) {
|
||||
// var page = args.object;
|
||||
// var obj = new observable.Observable();
|
||||
|
@ -13,7 +13,7 @@ import switchModule = require("ui/switch");
|
||||
// ```
|
||||
|
||||
// ### Binding the Switch checked property and Button isEanbled property to a observable view-model property.
|
||||
//```XML
|
||||
//``` XML
|
||||
// <Page loaded="pageLoaded">
|
||||
// <StackLayout orientation="vertical">
|
||||
// {%raw%}<Switch checked="{{ someProperty }}" />
|
||||
@ -21,7 +21,7 @@ import switchModule = require("ui/switch");
|
||||
// </StackLayout>
|
||||
// </Page>
|
||||
//```
|
||||
//```JS
|
||||
//``` JavaScript
|
||||
// function pageLoaded(args) {
|
||||
// var page = args.object;
|
||||
// var obj = new observable.Observable();
|
||||
|
@ -9,7 +9,7 @@ import tabViewTestsNative = require("./tab-view-tests-native");
|
||||
// # TabView
|
||||
|
||||
// ### Declaring the TabView in xml.
|
||||
//```XML
|
||||
//``` XML
|
||||
// <Page>
|
||||
// <TabView>
|
||||
// <TabView.items>
|
||||
|
@ -21,7 +21,7 @@ import observable = require("data/observable");
|
||||
// ```
|
||||
|
||||
// ### Binding two TextFields text property to observable view-model property.
|
||||
//```XML
|
||||
//``` XML
|
||||
// <Page loaded="pageLoaded">
|
||||
// <StackLayout orientation="vertical">
|
||||
// {%raw%}<TextField text="{{ someProperty }}" />
|
||||
@ -29,7 +29,7 @@ import observable = require("data/observable");
|
||||
// </StackLayout>
|
||||
// </Page>
|
||||
//```
|
||||
//```JS
|
||||
//``` JavaScript
|
||||
// function pageLoaded(args) {
|
||||
// var page = args.object;
|
||||
// var obj = new observable.Observable();
|
||||
|
@ -21,7 +21,7 @@ import observable = require("data/observable");
|
||||
// ```
|
||||
|
||||
// ### Binding two TextViews text property to observable view-model property.
|
||||
//```XML
|
||||
//``` XML
|
||||
// <Page loaded="pageLoaded">
|
||||
// <StackLayout orientation="vertical">
|
||||
// {%raw%}<TextView text="{{ someProperty }}" />
|
||||
@ -29,7 +29,7 @@ import observable = require("data/observable");
|
||||
// </StackLayout>
|
||||
// </Page>
|
||||
//```
|
||||
//```JS
|
||||
//``` JavaScript
|
||||
// function pageLoaded(args) {
|
||||
// var page = args.object;
|
||||
// var obj = new observable.Observable();
|
||||
|
@ -11,7 +11,7 @@ import webViewModule = require("ui/web-view");
|
||||
|
||||
// <snippet module="ui/web-view" title="WebView">
|
||||
// ### Declaring a WebView.
|
||||
//```XML
|
||||
//``` XML
|
||||
// <Page>
|
||||
// {%raw%}<WebView src="{{ someUrl | pathToLocalFile | htmlString }}" />{%endraw%}
|
||||
// </Page>
|
||||
|
Reference in New Issue
Block a user