mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-15 19:26:42 +08:00
Add web-view test page.
This commit is contained in:
@ -241,6 +241,9 @@
|
|||||||
<TypeScriptCompile Include="apps\ui-tests-app\pages\text\text-view.ts" />
|
<TypeScriptCompile Include="apps\ui-tests-app\pages\text\text-view.ts" />
|
||||||
<TypeScriptCompile Include="apps\ui-tests-app\pages\text\label.ts" />
|
<TypeScriptCompile Include="apps\ui-tests-app\pages\text\label.ts" />
|
||||||
<TypeScriptCompile Include="apps\ui-tests-app\pages\text\button.ts" />
|
<TypeScriptCompile Include="apps\ui-tests-app\pages\text\button.ts" />
|
||||||
|
<TypeScriptCompile Include="apps\ui-tests-app\web-view\webview.ts">
|
||||||
|
<DependentUpon>webview.xml</DependentUpon>
|
||||||
|
</TypeScriptCompile>
|
||||||
<TypeScriptCompile Include="es-collections.d.ts" />
|
<TypeScriptCompile Include="es-collections.d.ts" />
|
||||||
<TypeScriptCompile Include="es6-promise.d.ts" />
|
<TypeScriptCompile Include="es6-promise.d.ts" />
|
||||||
<TypeScriptCompile Include="file-system\file-name-resolver.d.ts" />
|
<TypeScriptCompile Include="file-system\file-name-resolver.d.ts" />
|
||||||
@ -736,6 +739,7 @@
|
|||||||
<Content Include="apps\ui-tests-app\pages\text\text-view.xml" />
|
<Content Include="apps\ui-tests-app\pages\text\text-view.xml" />
|
||||||
<Content Include="apps\ui-tests-app\pages\text\label.xml" />
|
<Content Include="apps\ui-tests-app\pages\text\label.xml" />
|
||||||
<Content Include="apps\ui-tests-app\pages\text\button.xml" />
|
<Content Include="apps\ui-tests-app\pages\text\button.xml" />
|
||||||
|
<Content Include="apps\ui-tests-app\web-view\webview.xml" />
|
||||||
<Content Include="js-libs\reworkcss-value\reworkcss-value.js" />
|
<Content Include="js-libs\reworkcss-value\reworkcss-value.js" />
|
||||||
<Content Include="ui\layouts\stack-layout\package.json">
|
<Content Include="ui\layouts\stack-layout\package.json">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
@ -10,8 +10,8 @@ export function stack0Loaded(args: observable.EventData) {
|
|||||||
var button = stack0.getViewById<textFieldModule.TextField>("btn");
|
var button = stack0.getViewById<textFieldModule.TextField>("btn");
|
||||||
var bindingOptions = {
|
var bindingOptions = {
|
||||||
sourceProperty: "textSource",
|
sourceProperty: "textSource",
|
||||||
targetProperty: "text",
|
targetProperty: "text"// ,
|
||||||
twoWay: true
|
// twoWay: true
|
||||||
};
|
};
|
||||||
target.bind(bindingOptions, source);
|
target.bind(bindingOptions, source);
|
||||||
source.set("textSource", "Text");
|
source.set("textSource", "Text");
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<Page loaded="pageLoaded">
|
<Page loaded="pageLoaded">
|
||||||
<StackLayout>
|
<StackLayout>
|
||||||
<Label text="{{ name }}" style="text-align:center;" />
|
<Label text="{{ name }}" id="label" style="text-align:center;" />
|
||||||
<Button text="action" tap="{{ actionName }}" />
|
<Button text="action" tap="{{ actionName }}" />
|
||||||
<Button text="alert" tap="{{ alertName }}" />
|
<Button text="alert" tap="{{ alertName }}" />
|
||||||
<Button text="confirm" tap="{{ confirmName }}" />
|
<Button text="confirm" tap="{{ confirmName }}" />
|
||||||
|
@ -10,7 +10,7 @@ import trace = require("trace");
|
|||||||
trace.enable();
|
trace.enable();
|
||||||
trace.setCategories(trace.categories.Test);
|
trace.setCategories(trace.categories.Test);
|
||||||
|
|
||||||
var list: string[] = ["pages", "layouts", "modal-view", "bindings", "dialogs"];
|
var list: string[] = ["pages", "layouts", "modal-view", "bindings", "dialogs", "web-view"];
|
||||||
|
|
||||||
// basePath is auto-changed when building multiple apps
|
// basePath is auto-changed when building multiple apps
|
||||||
var basePath = "";
|
var basePath = "";
|
||||||
|
19
apps/ui-tests-app/web-view/webview.ts
Normal file
19
apps/ui-tests-app/web-view/webview.ts
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
export function loaded(args) {
|
||||||
|
args.object.items = [1];
|
||||||
|
}
|
||||||
|
|
||||||
|
export function onLoaded(args) {
|
||||||
|
console.log("### onLoaded");
|
||||||
|
}
|
||||||
|
|
||||||
|
export function onLoadStarted(args) {
|
||||||
|
console.log("### onLoadStarted: " + args.url);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function onLoadFinished(args) {
|
||||||
|
console.log("### onLoadFinished: " + args.url);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function onUnloaded(args) {
|
||||||
|
console.log("### onUnloaded");
|
||||||
|
}
|
8
apps/ui-tests-app/web-view/webview.xml
Normal file
8
apps/ui-tests-app/web-view/webview.xml
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
<Page>
|
||||||
|
<ListView loaded="loaded">
|
||||||
|
<ListView.itemTemplate>
|
||||||
|
<WebView loaded="onLoaded" loadStarted="onLoadStarted" loadFinished="onLoadFinished" unloaded="onUnloaded"
|
||||||
|
url="http://www.bbc.com/" minHeight="250" />
|
||||||
|
</ListView.itemTemplate>
|
||||||
|
</ListView>
|
||||||
|
</Page>
|
Reference in New Issue
Block a user