├── AndroidStudioProjects
└── HelloWorld
│ ├── .gitignore
│ ├── .idea
│ ├── .name
│ ├── compiler.xml
│ ├── copyright
│ │ └── profiles_settings.xml
│ ├── encodings.xml
│ ├── gradle.xml
│ ├── misc.xml
│ ├── modules.xml
│ ├── runConfigurations.xml
│ └── vcs.xml
│ ├── HelloWorld.iml
│ ├── app
│ ├── .gitignore
│ ├── app.iml
│ ├── build.gradle
│ ├── libs
│ │ ├── nativescript.jar
│ │ └── widgets.jar
│ ├── proguard-rules.pro
│ └── src
│ │ ├── androidTest
│ │ └── java
│ │ │ └── com
│ │ │ └── example
│ │ │ └── root
│ │ │ └── helloworld
│ │ │ └── ApplicationTest.java
│ │ ├── main
│ │ ├── AndroidManifest.xml
│ │ ├── assets
│ │ │ ├── app
│ │ │ │ └── bootstrap.js
│ │ │ ├── internal
│ │ │ │ └── prepareExtend.js
│ │ │ └── metadata
│ │ │ │ ├── treeNodeStream.dat
│ │ │ │ ├── treeStringsStream.dat
│ │ │ │ └── treeValueStream.dat
│ │ ├── java
│ │ │ └── com
│ │ │ │ └── example
│ │ │ │ └── root
│ │ │ │ └── helloworld
│ │ │ │ └── MainActivity.java
│ │ ├── jniLibs
│ │ │ ├── armeabi-v7a
│ │ │ │ ├── libAssetExtractor.so
│ │ │ │ └── libNativeScript.so
│ │ │ └── x86
│ │ │ │ ├── libAssetExtractor.so
│ │ │ │ └── libNativeScript.so
│ │ └── res
│ │ │ ├── layout
│ │ │ ├── activity_main.xml
│ │ │ └── content_main.xml
│ │ │ ├── menu
│ │ │ └── menu_main.xml
│ │ │ ├── mipmap-hdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-mdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xhdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xxhdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xxxhdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── values-v21
│ │ │ └── styles.xml
│ │ │ ├── values-w820dp
│ │ │ └── dimens.xml
│ │ │ └── values
│ │ │ ├── colors.xml
│ │ │ ├── dimens.xml
│ │ │ ├── strings.xml
│ │ │ └── styles.xml
│ │ └── test
│ │ └── java
│ │ └── com
│ │ └── example
│ │ └── root
│ │ └── helloworld
│ │ └── ExampleUnitTest.java
│ ├── build.gradle
│ ├── gradle.properties
│ ├── gradle
│ └── wrapper
│ │ ├── gradle-wrapper.jar
│ │ └── gradle-wrapper.properties
│ ├── gradlew
│ ├── gradlew.bat
│ ├── local.properties
│ └── settings.gradle
├── LICENSE
├── Readme.md
├── circle.yml
├── hello
├── app
│ ├── App.hs
│ ├── App_Resources
│ │ ├── Android
│ │ │ ├── drawable-hdpi
│ │ │ │ └── icon.png
│ │ │ ├── drawable-ldpi
│ │ │ │ └── icon.png
│ │ │ ├── drawable-mdpi
│ │ │ │ └── icon.png
│ │ │ └── drawable-nodpi
│ │ │ │ └── splashscreen.9.png
│ │ └── iOS
│ │ │ ├── Default-568h@2x.png
│ │ │ ├── Default-Landscape.png
│ │ │ ├── Default-Landscape@2x.png
│ │ │ ├── Default-Portrait.png
│ │ │ ├── Default-Portrait@2x.png
│ │ │ ├── Default.png
│ │ │ ├── Default@2x.png
│ │ │ ├── Icon-Small-50.png
│ │ │ ├── Icon-Small-50@2x.png
│ │ │ ├── Icon-Small.png
│ │ │ ├── Icon-Small@2x.png
│ │ │ ├── icon-40.png
│ │ │ ├── icon-40@2x.png
│ │ │ ├── icon-60.png
│ │ │ ├── icon-60@2x.png
│ │ │ ├── icon-72.png
│ │ │ ├── icon-72@2x.png
│ │ │ ├── icon-76.png
│ │ │ ├── icon-76@2x.png
│ │ │ ├── icon.png
│ │ │ └── icon@2x.png
│ ├── LICENSE
│ ├── app.css
│ ├── app.js
│ ├── main-page.js
│ ├── main-page.xml
│ ├── main-view-model.js
│ └── package.json
├── node_modules
│ └── tns-core-modules
│ │ ├── LICENSE
│ │ ├── application-settings
│ │ ├── application-settings-common.js
│ │ ├── application-settings.android.js
│ │ ├── application-settings.ios.js
│ │ └── package.json
│ │ ├── application
│ │ ├── application-common.js
│ │ ├── application.android.js
│ │ ├── application.ios.js
│ │ └── package.json
│ │ ├── camera
│ │ ├── camera-common.js
│ │ ├── camera.android.js
│ │ ├── camera.ios.js
│ │ └── package.json
│ │ ├── color
│ │ ├── color-common.js
│ │ ├── color.android.js
│ │ ├── color.ios.js
│ │ ├── known-colors.js
│ │ └── package.json
│ │ ├── connectivity
│ │ ├── connectivity-common.js
│ │ ├── connectivity.android.js
│ │ ├── connectivity.ios.js
│ │ └── package.json
│ │ ├── console
│ │ ├── console.js
│ │ └── package.json
│ │ ├── css-value
│ │ ├── package.json
│ │ └── reworkcss-value.js
│ │ ├── css
│ │ ├── package.json
│ │ └── reworkcss.js
│ │ ├── data
│ │ ├── observable-array
│ │ │ ├── observable-array.js
│ │ │ └── package.json
│ │ ├── observable
│ │ │ ├── observable.js
│ │ │ └── package.json
│ │ └── virtual-array
│ │ │ ├── package.json
│ │ │ └── virtual-array.js
│ │ ├── fetch
│ │ ├── fetch.js
│ │ └── package.json
│ │ ├── file-system
│ │ ├── file-name-resolver.js
│ │ ├── file-system-access.android.js
│ │ ├── file-system-access.ios.js
│ │ ├── file-system.js
│ │ └── package.json
│ │ ├── fps-meter
│ │ ├── fps-meter.js
│ │ ├── fps-native.android.js
│ │ ├── fps-native.ios.js
│ │ └── package.json
│ │ ├── globals
│ │ ├── globals.js
│ │ └── package.json
│ │ ├── http
│ │ ├── http-request.android.js
│ │ ├── http-request.ios.js
│ │ ├── http.js
│ │ └── package.json
│ │ ├── image-source
│ │ ├── image-source-common.js
│ │ ├── image-source.android.js
│ │ ├── image-source.ios.js
│ │ └── package.json
│ │ ├── js-libs
│ │ ├── easysax
│ │ │ ├── easysax.js
│ │ │ └── package.json
│ │ ├── esprima
│ │ │ ├── esprima.js
│ │ │ └── package.json
│ │ └── polymer-expressions
│ │ │ ├── package.json
│ │ │ ├── path-parser.js
│ │ │ └── polymer-expressions.js
│ │ ├── location
│ │ ├── location-common.js
│ │ ├── location.android.js
│ │ ├── location.ios.js
│ │ └── package.json
│ │ ├── package.json
│ │ ├── platform
│ │ ├── package.json
│ │ ├── platform.android.js
│ │ └── platform.ios.js
│ │ ├── text
│ │ ├── formatted-string-common.js
│ │ ├── formatted-string.android.js
│ │ ├── formatted-string.ios.js
│ │ ├── package.json
│ │ ├── span-common.js
│ │ ├── span.android.js
│ │ ├── span.ios.js
│ │ ├── text.android.js
│ │ └── text.ios.js
│ │ ├── timer
│ │ ├── package.json
│ │ ├── timer.android.js
│ │ └── timer.ios.js
│ │ ├── trace
│ │ ├── package.json
│ │ └── trace.js
│ │ ├── ui
│ │ ├── action-bar
│ │ │ ├── action-bar-common.js
│ │ │ ├── action-bar.android.js
│ │ │ ├── action-bar.ios.js
│ │ │ └── package.json
│ │ ├── activity-indicator
│ │ │ ├── activity-indicator-common.js
│ │ │ ├── activity-indicator.android.js
│ │ │ ├── activity-indicator.ios.js
│ │ │ └── package.json
│ │ ├── animation
│ │ │ ├── animation-common.js
│ │ │ ├── animation.android.js
│ │ │ ├── animation.ios.js
│ │ │ └── package.json
│ │ ├── border
│ │ │ ├── border.js
│ │ │ └── package.json
│ │ ├── builder
│ │ │ ├── binding-builder.js
│ │ │ ├── builder.js
│ │ │ ├── component-builder.js
│ │ │ ├── package.json
│ │ │ ├── special-properties.js
│ │ │ └── template-builder.js
│ │ ├── button
│ │ │ ├── button-common.js
│ │ │ ├── button.android.js
│ │ │ ├── button.ios.js
│ │ │ └── package.json
│ │ ├── content-view
│ │ │ ├── content-view.js
│ │ │ └── package.json
│ │ ├── core
│ │ │ ├── bindable.js
│ │ │ ├── control-state-change.ios.js
│ │ │ ├── dependency-observable.js
│ │ │ ├── proxy.js
│ │ │ ├── view-common.js
│ │ │ ├── view.android.js
│ │ │ ├── view.ios.js
│ │ │ └── weak-event-listener.js
│ │ ├── date-picker
│ │ │ ├── date-picker-common.js
│ │ │ ├── date-picker.android.js
│ │ │ ├── date-picker.ios.js
│ │ │ └── package.json
│ │ ├── dialogs
│ │ │ ├── dialogs-common.js
│ │ │ ├── dialogs.android.js
│ │ │ ├── dialogs.ios.js
│ │ │ └── package.json
│ │ ├── editable-text-base
│ │ │ ├── editable-text-base-common.js
│ │ │ ├── editable-text-base.android.js
│ │ │ ├── editable-text-base.ios.js
│ │ │ └── package.json
│ │ ├── enums
│ │ │ ├── enums.js
│ │ │ └── package.json
│ │ ├── frame
│ │ │ ├── frame-common.js
│ │ │ ├── frame.android.js
│ │ │ ├── frame.ios.js
│ │ │ └── package.json
│ │ ├── gestures
│ │ │ ├── gestures-common.js
│ │ │ ├── gestures.android.js
│ │ │ ├── gestures.ios.js
│ │ │ └── package.json
│ │ ├── html-view
│ │ │ ├── html-view-common.js
│ │ │ ├── html-view.android.js
│ │ │ ├── html-view.ios.js
│ │ │ └── package.json
│ │ ├── image-cache
│ │ │ ├── image-cache-common.js
│ │ │ ├── image-cache.android.js
│ │ │ ├── image-cache.ios.js
│ │ │ └── package.json
│ │ ├── image
│ │ │ ├── image-common.js
│ │ │ ├── image.android.js
│ │ │ ├── image.ios.js
│ │ │ └── package.json
│ │ ├── label
│ │ │ ├── label-common.js
│ │ │ ├── label.android.js
│ │ │ ├── label.ios.js
│ │ │ └── package.json
│ │ ├── layouts
│ │ │ ├── absolute-layout
│ │ │ │ ├── absolute-layout-common.js
│ │ │ │ ├── absolute-layout.android.js
│ │ │ │ ├── absolute-layout.ios.js
│ │ │ │ └── package.json
│ │ │ ├── dock-layout
│ │ │ │ ├── dock-layout-common.js
│ │ │ │ ├── dock-layout.android.js
│ │ │ │ ├── dock-layout.ios.js
│ │ │ │ └── package.json
│ │ │ ├── grid-layout
│ │ │ │ ├── grid-layout-common.js
│ │ │ │ ├── grid-layout.android.js
│ │ │ │ ├── grid-layout.ios.js
│ │ │ │ └── package.json
│ │ │ ├── layout-base.js
│ │ │ ├── layout.android.js
│ │ │ ├── layout.ios.js
│ │ │ ├── stack-layout
│ │ │ │ ├── package.json
│ │ │ │ ├── stack-layout-common.js
│ │ │ │ ├── stack-layout.android.js
│ │ │ │ └── stack-layout.ios.js
│ │ │ └── wrap-layout
│ │ │ │ ├── package.json
│ │ │ │ ├── wrap-layout-common.js
│ │ │ │ ├── wrap-layout.android.js
│ │ │ │ └── wrap-layout.ios.js
│ │ ├── list-picker
│ │ │ ├── list-picker-common.js
│ │ │ ├── list-picker.android.js
│ │ │ ├── list-picker.ios.js
│ │ │ └── package.json
│ │ ├── list-view
│ │ │ ├── list-view-common.js
│ │ │ ├── list-view.android.js
│ │ │ ├── list-view.ios.js
│ │ │ └── package.json
│ │ ├── package.json
│ │ ├── page
│ │ │ ├── package.json
│ │ │ ├── page-common.js
│ │ │ ├── page.android.js
│ │ │ └── page.ios.js
│ │ ├── placeholder
│ │ │ ├── package.json
│ │ │ ├── placeholder-common.js
│ │ │ ├── placeholder.android.js
│ │ │ └── placeholder.ios.js
│ │ ├── progress
│ │ │ ├── package.json
│ │ │ ├── progress-common.js
│ │ │ ├── progress.android.js
│ │ │ └── progress.ios.js
│ │ ├── repeater
│ │ │ ├── package.json
│ │ │ └── repeater.js
│ │ ├── scroll-view
│ │ │ ├── package.json
│ │ │ ├── scroll-view-common.js
│ │ │ ├── scroll-view.android.js
│ │ │ └── scroll-view.ios.js
│ │ ├── search-bar
│ │ │ ├── package.json
│ │ │ ├── search-bar-common.js
│ │ │ ├── search-bar.android.js
│ │ │ └── search-bar.ios.js
│ │ ├── segmented-bar
│ │ │ ├── package.json
│ │ │ ├── segmented-bar-common.js
│ │ │ ├── segmented-bar.android.js
│ │ │ └── segmented-bar.ios.js
│ │ ├── slider
│ │ │ ├── package.json
│ │ │ ├── slider-common.js
│ │ │ ├── slider.android.js
│ │ │ └── slider.ios.js
│ │ ├── styling
│ │ │ ├── background-common.js
│ │ │ ├── background.android.js
│ │ │ ├── background.ios.js
│ │ │ ├── converters.js
│ │ │ ├── css-selector.js
│ │ │ ├── font-common.js
│ │ │ ├── font.android.js
│ │ │ ├── font.ios.js
│ │ │ ├── package.json
│ │ │ ├── style-property.js
│ │ │ ├── style-scope.js
│ │ │ ├── style.js
│ │ │ ├── stylers-common.js
│ │ │ ├── stylers.android.js
│ │ │ ├── stylers.ios.js
│ │ │ ├── styling.js
│ │ │ ├── visual-state-constants.js
│ │ │ └── visual-state.js
│ │ ├── switch
│ │ │ ├── package.json
│ │ │ ├── switch-common.js
│ │ │ ├── switch.android.js
│ │ │ └── switch.ios.js
│ │ ├── tab-view
│ │ │ ├── package.json
│ │ │ ├── tab-view-common.js
│ │ │ ├── tab-view.android.js
│ │ │ └── tab-view.ios.js
│ │ ├── text-base
│ │ │ ├── package.json
│ │ │ └── text-base.js
│ │ ├── text-field
│ │ │ ├── package.json
│ │ │ ├── text-field-common.js
│ │ │ ├── text-field.android.js
│ │ │ └── text-field.ios.js
│ │ ├── text-view
│ │ │ ├── package.json
│ │ │ ├── text-view-common.js
│ │ │ ├── text-view.android.js
│ │ │ └── text-view.ios.js
│ │ ├── time-picker
│ │ │ ├── package.json
│ │ │ ├── time-picker-common.js
│ │ │ ├── time-picker.android.js
│ │ │ └── time-picker.ios.js
│ │ ├── ui.js
│ │ ├── utils.ios.js
│ │ └── web-view
│ │ │ ├── package.json
│ │ │ ├── web-view-common.js
│ │ │ ├── web-view.android.js
│ │ │ └── web-view.ios.js
│ │ ├── utils
│ │ ├── module-merge.js
│ │ ├── number-utils.js
│ │ ├── types.js
│ │ ├── utils-common.js
│ │ ├── utils.android.js
│ │ └── utils.ios.js
│ │ ├── xhr
│ │ ├── package.json
│ │ └── xhr.js
│ │ └── xml
│ │ ├── package.json
│ │ └── xml.js
└── package.json
├── initialize-project-files.sh
├── new-project.diff
└── tests
└── hello.sh
/AndroidStudioProjects/HelloWorld/.gitignore:
--------------------------------------------------------------------------------
1 | .gradle
2 | /.idea/workspace.xml
3 | /.idea/libraries
4 | .DS_Store
5 | /build
6 | /captures
7 |
--------------------------------------------------------------------------------
/AndroidStudioProjects/HelloWorld/.idea/.name:
--------------------------------------------------------------------------------
1 | HelloWorld
--------------------------------------------------------------------------------
/AndroidStudioProjects/HelloWorld/.idea/compiler.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/AndroidStudioProjects/HelloWorld/.idea/copyright/profiles_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/AndroidStudioProjects/HelloWorld/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/AndroidStudioProjects/HelloWorld/.idea/gradle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
18 |
19 |
--------------------------------------------------------------------------------
/AndroidStudioProjects/HelloWorld/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/AndroidStudioProjects/HelloWorld/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/AndroidStudioProjects/HelloWorld/.idea/runConfigurations.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/AndroidStudioProjects/HelloWorld/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/AndroidStudioProjects/HelloWorld/HelloWorld.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/AndroidStudioProjects/HelloWorld/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/AndroidStudioProjects/HelloWorld/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 22
5 | buildToolsVersion "23.0.1"
6 |
7 | defaultConfig {
8 | applicationId "com.example.root.helloworld"
9 | minSdkVersion 17
10 | targetSdkVersion 22
11 | versionCode 1
12 | versionName "1.0"
13 | }
14 | buildTypes {
15 | release {
16 | minifyEnabled false
17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
18 | }
19 | }
20 | }
21 |
22 | dependencies {
23 | compile fileTree(dir: 'libs', include: ['*.jar'])
24 | testCompile 'junit:junit:4.12'
25 | compile 'com.android.support:appcompat-v7:22.2.1'
26 | compile 'com.android.support:design:22.2.1'
27 | compile files('libs/nativescript.jar')
28 | }
29 |
--------------------------------------------------------------------------------
/AndroidStudioProjects/HelloWorld/app/libs/nativescript.jar:
--------------------------------------------------------------------------------
1 | ../../nativescript-android/app/libs/nativescript.jar
--------------------------------------------------------------------------------
/AndroidStudioProjects/HelloWorld/app/libs/widgets.jar:
--------------------------------------------------------------------------------
1 | ../../nativescript-android/app/libs/widgets.jar
--------------------------------------------------------------------------------
/AndroidStudioProjects/HelloWorld/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in /usr/local/android-sdk-linux/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/AndroidStudioProjects/HelloWorld/app/src/androidTest/java/com/example/root/helloworld/ApplicationTest.java:
--------------------------------------------------------------------------------
1 | package com.example.root.helloworld;
2 |
3 | import android.app.Application;
4 | import android.test.ApplicationTestCase;
5 |
6 | /**
7 | * Testing Fundamentals
8 | */
9 | public class ApplicationTest extends ApplicationTestCase {
10 | public ApplicationTest() {
11 | super(Application.class);
12 | }
13 | }
--------------------------------------------------------------------------------
/AndroidStudioProjects/HelloWorld/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
12 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/AndroidStudioProjects/HelloWorld/app/src/main/assets/app/bootstrap.js:
--------------------------------------------------------------------------------
1 | /*
2 | // declare the extended NativeScriptActivity functionality
3 | var extendsObject = {
4 | onCreate: function(savedState){
5 | // call the base NativeScriptActivity.onCreate method
6 | // the "this" variable points to a NativeScriptActivity instance
7 | this.super.onCreate(savedState);
8 |
9 | // create a button and set it as the main content
10 | var button = new android.widget.Button(this);
11 | button.setText("Hello World");
12 |
13 | this.setContentView(button);
14 | }
15 | }
16 |
17 | // pass the extends object to create a new NativeScriptActivity instance
18 | var mainActivity = com.tns.NativeScriptActivity.extends(extendsObject);
19 | */
20 |
21 | function log(message) {
22 | var arrayToLog = [];
23 | if (message.length > 4000) {
24 | var i;
25 | for (i = 0; i * 4000 < message.length; i++) {
26 | arrayToLog.push(message.substr((i * 4000), 4000));
27 | }
28 | }
29 | else {
30 | arrayToLog.push(message);
31 | }
32 | for (i = 0; i < arrayToLog.length; i++) {
33 | android.util.Log.w("TNS.JS", arrayToLog[i]);
34 | }
35 | }
36 |
37 | /*
38 | // pass the extends object to create a new NativeScriptActivity instance
39 | var mainActivity = (function(_super) {
40 | log("Go!");
41 | __extends(mainActivity, _super);
42 | function mainActivity() { log("Created!!!"); _super.call(this); }
43 | mainActivity.prototype.onCreate = function(savedState){
44 | log("Oncreate");
45 | // call the base NativeScriptActivity.onCreate method
46 | // the "this" variable points to a NativeScriptActivity instance
47 | this.super.onCreate(savedState);
48 |
49 | // create a button and set it as the main content
50 | var button = new android.widget.Button(this);
51 | button.setText("Hello World");
52 |
53 | this.setContentView(button);
54 | };
55 | log("Return");
56 | return mainActivity;
57 | })(com.tns.NativeScriptActivity);
58 | */
59 |
60 | var mainActivity = new com.tns.NativeScriptActivity();
61 | mainActivity.onCreate = function(savedState){
62 | log("Oncreate");
63 | // call the base NativeScriptActivity.onCreate method
64 | // the "this" variable points to a NativeScriptActivity instance
65 | this.super.onCreate(savedState);
66 |
67 | // create a button and set it as the main content
68 | var button = new android.widget.Button(this);
69 | button.setText("Hello World");
70 |
71 | this.setContentView(button);
72 | };
73 |
74 | log("HEllo")
75 |
76 | var applicationInitObject = {
77 | getActivity: function(intent) {
78 | // this method is called whenever a new instance of NativeScriptActivity is about to be created
79 | log("Activity");
80 | return mainActivity;
81 | },
82 | onCreate: function() {
83 | log("First method called");
84 | // This is the first method called. Called from the android.app.Application.onCreate method.
85 | }
86 | }
87 |
88 | // The NativeScriptRuntime exposes the app object within the global context
89 | app.init(applicationInitObject);
--------------------------------------------------------------------------------
/AndroidStudioProjects/HelloWorld/app/src/main/assets/metadata/treeNodeStream.dat:
--------------------------------------------------------------------------------
1 | ../../nativescript-android/app/src/main/assets/metadata/treeNodeStream.dat
--------------------------------------------------------------------------------
/AndroidStudioProjects/HelloWorld/app/src/main/assets/metadata/treeStringsStream.dat:
--------------------------------------------------------------------------------
1 | ../../nativescript-android/app/src/main/assets/metadata/treeStringsStream.dat
--------------------------------------------------------------------------------
/AndroidStudioProjects/HelloWorld/app/src/main/assets/metadata/treeValueStream.dat:
--------------------------------------------------------------------------------
1 | ../../nativescript-android/app/src/main/assets/metadata/treeValueStream.dat
--------------------------------------------------------------------------------
/AndroidStudioProjects/HelloWorld/app/src/main/java/com/example/root/helloworld/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.example.root.helloworld;
2 |
3 | import android.os.Bundle;
4 | import android.support.design.widget.FloatingActionButton;
5 | import android.support.design.widget.Snackbar;
6 | import android.support.v7.app.AppCompatActivity;
7 | import android.support.v7.widget.Toolbar;
8 | import android.view.View;
9 | import android.view.Menu;
10 | import android.view.MenuItem;
11 |
12 | public class MainActivity extends AppCompatActivity {
13 |
14 | @Override
15 | protected void onCreate(Bundle savedInstanceState) {
16 | super.onCreate(savedInstanceState);
17 | setContentView(R.layout.activity_main);
18 | Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
19 | setSupportActionBar(toolbar);
20 |
21 | FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
22 | fab.setOnClickListener(new View.OnClickListener() {
23 | @Override
24 | public void onClick(View view) {
25 | Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
26 | .setAction("Action", null).show();
27 | }
28 | });
29 | }
30 |
31 | @Override
32 | public boolean onCreateOptionsMenu(Menu menu) {
33 | // Inflate the menu; this adds items to the action bar if it is present.
34 | getMenuInflater().inflate(R.menu.menu_main, menu);
35 | return true;
36 | }
37 |
38 | @Override
39 | public boolean onOptionsItemSelected(MenuItem item) {
40 | // Handle action bar item clicks here. The action bar will
41 | // automatically handle clicks on the Home/Up button, so long
42 | // as you specify a parent activity in AndroidManifest.xml.
43 | int id = item.getItemId();
44 |
45 | //noinspection SimplifiableIfStatement
46 | if (id == R.id.action_settings) {
47 | return true;
48 | }
49 |
50 | return super.onOptionsItemSelected(item);
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/AndroidStudioProjects/HelloWorld/app/src/main/jniLibs/armeabi-v7a/libAssetExtractor.so:
--------------------------------------------------------------------------------
1 | ../../nativescript-android/app/src/main/jniLibs/armeabi-v7a/libAssetExtractor.so
--------------------------------------------------------------------------------
/AndroidStudioProjects/HelloWorld/app/src/main/jniLibs/armeabi-v7a/libNativeScript.so:
--------------------------------------------------------------------------------
1 | ../../nativescript-android/app/src/main/jniLibs/armeabi-v7a/libNativeScript.so
--------------------------------------------------------------------------------
/AndroidStudioProjects/HelloWorld/app/src/main/jniLibs/x86/libAssetExtractor.so:
--------------------------------------------------------------------------------
1 | ../../nativescript-android/app/src/main/jniLibs/x86/libAssetExtractor.so
--------------------------------------------------------------------------------
/AndroidStudioProjects/HelloWorld/app/src/main/jniLibs/x86/libNativeScript.so:
--------------------------------------------------------------------------------
1 | ../../nativescript-android/app/src/main/jniLibs/x86/libNativeScript.so
--------------------------------------------------------------------------------
/AndroidStudioProjects/HelloWorld/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
11 |
12 |
15 |
16 |
17 |
18 |
19 |
20 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/AndroidStudioProjects/HelloWorld/app/src/main/res/layout/content_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
14 |
15 |
--------------------------------------------------------------------------------
/AndroidStudioProjects/HelloWorld/app/src/main/res/menu/menu_main.xml:
--------------------------------------------------------------------------------
1 |
7 |
--------------------------------------------------------------------------------
/AndroidStudioProjects/HelloWorld/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abarbu/haskell-mobile/1719e2846b072da3eb4995788c24edf974e47bef/AndroidStudioProjects/HelloWorld/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/AndroidStudioProjects/HelloWorld/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abarbu/haskell-mobile/1719e2846b072da3eb4995788c24edf974e47bef/AndroidStudioProjects/HelloWorld/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/AndroidStudioProjects/HelloWorld/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abarbu/haskell-mobile/1719e2846b072da3eb4995788c24edf974e47bef/AndroidStudioProjects/HelloWorld/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/AndroidStudioProjects/HelloWorld/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abarbu/haskell-mobile/1719e2846b072da3eb4995788c24edf974e47bef/AndroidStudioProjects/HelloWorld/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/AndroidStudioProjects/HelloWorld/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abarbu/haskell-mobile/1719e2846b072da3eb4995788c24edf974e47bef/AndroidStudioProjects/HelloWorld/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/AndroidStudioProjects/HelloWorld/app/src/main/res/values-v21/styles.xml:
--------------------------------------------------------------------------------
1 | >
2 |
8 |
9 |
--------------------------------------------------------------------------------
/AndroidStudioProjects/HelloWorld/app/src/main/res/values-w820dp/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 64dp
6 |
7 |
--------------------------------------------------------------------------------
/AndroidStudioProjects/HelloWorld/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3F51B5
4 | #303F9F
5 | #FF4081
6 |
7 |
--------------------------------------------------------------------------------
/AndroidStudioProjects/HelloWorld/app/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 16dp
4 | 16dp
5 | 16dp
6 |
7 |
--------------------------------------------------------------------------------
/AndroidStudioProjects/HelloWorld/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | HelloWorld
3 | Settings
4 |
5 |
--------------------------------------------------------------------------------
/AndroidStudioProjects/HelloWorld/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/AndroidStudioProjects/HelloWorld/app/src/test/java/com/example/root/helloworld/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.example.root.helloworld;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * To work on unit tests, switch the Test Artifact in the Build Variants view.
9 | */
10 | public class ExampleUnitTest {
11 | @Test
12 | public void addition_isCorrect() throws Exception {
13 | assertEquals(4, 2 + 2);
14 | }
15 | }
--------------------------------------------------------------------------------
/AndroidStudioProjects/HelloWorld/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | repositories {
5 | jcenter()
6 | }
7 | dependencies {
8 | classpath 'com.android.tools.build:gradle:1.3.0'
9 |
10 | // NOTE: Do not place your application dependencies here; they belong
11 | // in the individual module build.gradle files
12 | }
13 | }
14 |
15 | allprojects {
16 | repositories {
17 | jcenter()
18 | }
19 | }
20 |
21 | task clean(type: Delete) {
22 | delete rootProject.buildDir
23 | }
24 |
--------------------------------------------------------------------------------
/AndroidStudioProjects/HelloWorld/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 |
3 | # IDE (e.g. Android Studio) users:
4 | # Gradle settings configured through the IDE *will override*
5 | # any settings specified in this file.
6 |
7 | # For more details on how to configure your build environment visit
8 | # http://www.gradle.org/docs/current/userguide/build_environment.html
9 |
10 | # Specifies the JVM arguments used for the daemon process.
11 | # The setting is particularly useful for tweaking memory settings.
12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m
13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
14 |
15 | # When configured, Gradle will run in incubating parallel mode.
16 | # This option should only be used with decoupled projects. More details, visit
17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
18 | # org.gradle.parallel=true
19 | android.useDeprecatedNdk=true
20 |
--------------------------------------------------------------------------------
/AndroidStudioProjects/HelloWorld/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abarbu/haskell-mobile/1719e2846b072da3eb4995788c24edf974e47bef/AndroidStudioProjects/HelloWorld/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/AndroidStudioProjects/HelloWorld/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Wed Oct 28 14:00:56 UTC 2015
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.4-all.zip
7 |
--------------------------------------------------------------------------------
/AndroidStudioProjects/HelloWorld/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/AndroidStudioProjects/HelloWorld/local.properties:
--------------------------------------------------------------------------------
1 | ## This file is automatically generated by Android Studio.
2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED!
3 | #
4 | # This file must *NOT* be checked into Version Control Systems,
5 | # as it contains information specific to your local configuration.
6 | #
7 | # Location of the SDK. This is only used by Gradle.
8 | # For customization when using a Version Control System, please read the
9 | # header note.
10 | #Wed Oct 28 14:00:56 UTC 2015
11 | sdk.dir=/usr/local/android-sdk-linux
12 | ndk.dir=/usr/local/android-ndk-r10e
13 |
--------------------------------------------------------------------------------
/AndroidStudioProjects/HelloWorld/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Distributed under the MIT License
2 | Copyright (c) 2015 Andrei Barbu
3 |
4 | Permission is hereby granted, free of charge, to any person obtaining
5 | a copy of this software and associated documentation files (the
6 | "Software"), to deal in the Software without restriction, including
7 | without limitation the rights to use, copy, modify, merge, publish,
8 | distribute, sublicense, and/or sell copies of the Software, and to
9 | permit persons to whom the Software is furnished to do so, subject to
10 | the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be
13 | included in all copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
19 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
20 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22 |
--------------------------------------------------------------------------------
/circle.yml:
--------------------------------------------------------------------------------
1 | machine:
2 | services:
3 | - docker
4 |
5 | dependencies:
6 | cache_directories:
7 | - "~/docker"
8 | override:
9 | - docker info
10 | - docker pull abarbu/nativescript
11 | - docker pull abarbu/stack-ghcjs-nativescript:lts-3.0
12 |
13 | test:
14 | override:
15 | - bash tests/hello.sh
16 |
--------------------------------------------------------------------------------
/hello/app/App_Resources/Android/drawable-hdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abarbu/haskell-mobile/1719e2846b072da3eb4995788c24edf974e47bef/hello/app/App_Resources/Android/drawable-hdpi/icon.png
--------------------------------------------------------------------------------
/hello/app/App_Resources/Android/drawable-ldpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abarbu/haskell-mobile/1719e2846b072da3eb4995788c24edf974e47bef/hello/app/App_Resources/Android/drawable-ldpi/icon.png
--------------------------------------------------------------------------------
/hello/app/App_Resources/Android/drawable-mdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abarbu/haskell-mobile/1719e2846b072da3eb4995788c24edf974e47bef/hello/app/App_Resources/Android/drawable-mdpi/icon.png
--------------------------------------------------------------------------------
/hello/app/App_Resources/Android/drawable-nodpi/splashscreen.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abarbu/haskell-mobile/1719e2846b072da3eb4995788c24edf974e47bef/hello/app/App_Resources/Android/drawable-nodpi/splashscreen.9.png
--------------------------------------------------------------------------------
/hello/app/App_Resources/iOS/Default-568h@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abarbu/haskell-mobile/1719e2846b072da3eb4995788c24edf974e47bef/hello/app/App_Resources/iOS/Default-568h@2x.png
--------------------------------------------------------------------------------
/hello/app/App_Resources/iOS/Default-Landscape.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abarbu/haskell-mobile/1719e2846b072da3eb4995788c24edf974e47bef/hello/app/App_Resources/iOS/Default-Landscape.png
--------------------------------------------------------------------------------
/hello/app/App_Resources/iOS/Default-Landscape@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abarbu/haskell-mobile/1719e2846b072da3eb4995788c24edf974e47bef/hello/app/App_Resources/iOS/Default-Landscape@2x.png
--------------------------------------------------------------------------------
/hello/app/App_Resources/iOS/Default-Portrait.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abarbu/haskell-mobile/1719e2846b072da3eb4995788c24edf974e47bef/hello/app/App_Resources/iOS/Default-Portrait.png
--------------------------------------------------------------------------------
/hello/app/App_Resources/iOS/Default-Portrait@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abarbu/haskell-mobile/1719e2846b072da3eb4995788c24edf974e47bef/hello/app/App_Resources/iOS/Default-Portrait@2x.png
--------------------------------------------------------------------------------
/hello/app/App_Resources/iOS/Default.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abarbu/haskell-mobile/1719e2846b072da3eb4995788c24edf974e47bef/hello/app/App_Resources/iOS/Default.png
--------------------------------------------------------------------------------
/hello/app/App_Resources/iOS/Default@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abarbu/haskell-mobile/1719e2846b072da3eb4995788c24edf974e47bef/hello/app/App_Resources/iOS/Default@2x.png
--------------------------------------------------------------------------------
/hello/app/App_Resources/iOS/Icon-Small-50.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abarbu/haskell-mobile/1719e2846b072da3eb4995788c24edf974e47bef/hello/app/App_Resources/iOS/Icon-Small-50.png
--------------------------------------------------------------------------------
/hello/app/App_Resources/iOS/Icon-Small-50@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abarbu/haskell-mobile/1719e2846b072da3eb4995788c24edf974e47bef/hello/app/App_Resources/iOS/Icon-Small-50@2x.png
--------------------------------------------------------------------------------
/hello/app/App_Resources/iOS/Icon-Small.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abarbu/haskell-mobile/1719e2846b072da3eb4995788c24edf974e47bef/hello/app/App_Resources/iOS/Icon-Small.png
--------------------------------------------------------------------------------
/hello/app/App_Resources/iOS/Icon-Small@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abarbu/haskell-mobile/1719e2846b072da3eb4995788c24edf974e47bef/hello/app/App_Resources/iOS/Icon-Small@2x.png
--------------------------------------------------------------------------------
/hello/app/App_Resources/iOS/icon-40.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abarbu/haskell-mobile/1719e2846b072da3eb4995788c24edf974e47bef/hello/app/App_Resources/iOS/icon-40.png
--------------------------------------------------------------------------------
/hello/app/App_Resources/iOS/icon-40@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abarbu/haskell-mobile/1719e2846b072da3eb4995788c24edf974e47bef/hello/app/App_Resources/iOS/icon-40@2x.png
--------------------------------------------------------------------------------
/hello/app/App_Resources/iOS/icon-60.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abarbu/haskell-mobile/1719e2846b072da3eb4995788c24edf974e47bef/hello/app/App_Resources/iOS/icon-60.png
--------------------------------------------------------------------------------
/hello/app/App_Resources/iOS/icon-60@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abarbu/haskell-mobile/1719e2846b072da3eb4995788c24edf974e47bef/hello/app/App_Resources/iOS/icon-60@2x.png
--------------------------------------------------------------------------------
/hello/app/App_Resources/iOS/icon-72.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abarbu/haskell-mobile/1719e2846b072da3eb4995788c24edf974e47bef/hello/app/App_Resources/iOS/icon-72.png
--------------------------------------------------------------------------------
/hello/app/App_Resources/iOS/icon-72@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abarbu/haskell-mobile/1719e2846b072da3eb4995788c24edf974e47bef/hello/app/App_Resources/iOS/icon-72@2x.png
--------------------------------------------------------------------------------
/hello/app/App_Resources/iOS/icon-76.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abarbu/haskell-mobile/1719e2846b072da3eb4995788c24edf974e47bef/hello/app/App_Resources/iOS/icon-76.png
--------------------------------------------------------------------------------
/hello/app/App_Resources/iOS/icon-76@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abarbu/haskell-mobile/1719e2846b072da3eb4995788c24edf974e47bef/hello/app/App_Resources/iOS/icon-76@2x.png
--------------------------------------------------------------------------------
/hello/app/App_Resources/iOS/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abarbu/haskell-mobile/1719e2846b072da3eb4995788c24edf974e47bef/hello/app/App_Resources/iOS/icon.png
--------------------------------------------------------------------------------
/hello/app/App_Resources/iOS/icon@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abarbu/haskell-mobile/1719e2846b072da3eb4995788c24edf974e47bef/hello/app/App_Resources/iOS/icon@2x.png
--------------------------------------------------------------------------------
/hello/app/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2015, Telerik AD
2 | All rights reserved.
3 |
4 | Redistribution and use in source and binary forms, with or without
5 | modification, are permitted provided that the following conditions are met:
6 |
7 | 1. Redistributions of source code must retain the above copyright notice, this
8 | list of conditions and the following disclaimer.
9 |
10 | 2. Redistributions in binary form must reproduce the above copyright notice,
11 | this list of conditions and the following disclaimer in the documentation
12 | and/or other materials provided with the distribution.
13 |
14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
15 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
16 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
18 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
20 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
21 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
22 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 |
--------------------------------------------------------------------------------
/hello/app/app.css:
--------------------------------------------------------------------------------
1 | .title {
2 | font-size: 30;
3 | horizontal-align: center;
4 | margin:20;
5 | }
6 |
7 | button {
8 | font-size: 42;
9 | horizontal-align: center;
10 | }
11 |
12 | .message {
13 | font-size: 20;
14 | color: #284848;
15 | horizontal-align: center;
16 | }
17 |
--------------------------------------------------------------------------------
/hello/app/app.js:
--------------------------------------------------------------------------------
1 | App.jsexe/all.js
--------------------------------------------------------------------------------
/hello/app/main-page.js:
--------------------------------------------------------------------------------
1 | require("./app.js")["main-page"](module.exports);
2 |
--------------------------------------------------------------------------------
/hello/app/main-page.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/hello/app/main-view-model.js:
--------------------------------------------------------------------------------
1 | require("./app.js")["main-view-model"](module.exports);
2 |
--------------------------------------------------------------------------------
/hello/app/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "tns-template-hello-world",
3 | "main": "app.js",
4 | "jsoptions": "--expose_gc",
5 | "version": "1.4.0",
6 | "author": "Telerik ",
7 | "description": "Nativescript hello-world project template",
8 | "license": "BSD",
9 | "keywords": [
10 | "telerik",
11 | "mobile",
12 | "nativescript",
13 | "{N}",
14 | "tns",
15 | "appbuilder",
16 | "template"
17 | ],
18 | "repository": {
19 | "type": "git",
20 | "url": "git://github.com/NativeScript/template-hello-world.git"
21 | },
22 | "bugs": {
23 | "url": "https://github.com/NativeScript/template-hello-world/issues"
24 | },
25 | "homepage": "https://github.com/NativeScript/template-hello-world"
26 | }
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2015 Telerik AD
2 |
3 | Licensed under the Apache License, Version 2.0 (the "License");
4 | you may not use this file except in compliance with the License.
5 | You may obtain a copy of the License at
6 |
7 | http://www.apache.org/licenses/LICENSE-2.0
8 |
9 | Unless required by applicable law or agreed to in writing, software
10 | distributed under the License is distributed on an "AS IS" BASIS,
11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | See the License for the specific language governing permissions and
13 | limitations under the License.
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/application-settings/application-settings-common.js:
--------------------------------------------------------------------------------
1 | exports.checkKey = function (key) {
2 | if ("string" !== typeof key) {
3 | throw new Error("key: '" + key + "' must be a string");
4 | }
5 | };
6 | exports.ensureValidValue = function (value, valueType) {
7 | if (valueType !== typeof value) {
8 | throw new Error("value: '" + value + "' must be a " + valueType);
9 | }
10 | };
11 |
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/application-settings/application-settings.android.js:
--------------------------------------------------------------------------------
1 | var Common = require("./application-settings-common");
2 | var utils = require("utils/utils");
3 | var sharedPreferences = utils.ad.getApplicationContext().getSharedPreferences("prefs.db", 0);
4 | exports.hasKey = function (key) {
5 | Common.checkKey(key);
6 | return sharedPreferences.contains(key);
7 | };
8 | exports.getBoolean = function (key, defaultValue) {
9 | Common.checkKey(key);
10 | if (exports.hasKey(key)) {
11 | return sharedPreferences.getBoolean(key, false);
12 | }
13 | return defaultValue;
14 | };
15 | exports.getString = function (key, defaultValue) {
16 | Common.checkKey(key);
17 | if (exports.hasKey(key)) {
18 | return sharedPreferences.getString(key, "");
19 | }
20 | return defaultValue;
21 | };
22 | exports.getNumber = function (key, defaultValue) {
23 | Common.checkKey(key);
24 | if (exports.hasKey(key)) {
25 | return sharedPreferences.getFloat(key, float(0.0));
26 | }
27 | return defaultValue;
28 | };
29 | exports.setBoolean = function (key, value) {
30 | Common.checkKey(key);
31 | Common.ensureValidValue(value, "boolean");
32 | var editor = sharedPreferences.edit();
33 | editor.putBoolean(key, value);
34 | editor.commit();
35 | };
36 | exports.setString = function (key, value) {
37 | Common.checkKey(key);
38 | Common.ensureValidValue(value, "string");
39 | var editor = sharedPreferences.edit();
40 | editor.putString(key, value);
41 | editor.commit();
42 | };
43 | exports.setNumber = function (key, value) {
44 | Common.checkKey(key);
45 | Common.ensureValidValue(value, "number");
46 | var editor = sharedPreferences.edit();
47 | editor.putFloat(key, float(value));
48 | editor.commit();
49 | };
50 | exports.remove = function (key) {
51 | Common.checkKey(key);
52 | var editor = sharedPreferences.edit();
53 | editor.remove(key);
54 | editor.commit();
55 | };
56 |
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/application-settings/application-settings.ios.js:
--------------------------------------------------------------------------------
1 | var Common = require("./application-settings-common");
2 | var userDefaults = NSUserDefaults.standardUserDefaults();
3 | exports.hasKey = function (key) {
4 | Common.checkKey(key);
5 | return userDefaults.objectForKey(key) !== null;
6 | };
7 | exports.getBoolean = function (key, defaultValue) {
8 | Common.checkKey(key);
9 | if (exports.hasKey(key)) {
10 | return userDefaults.boolForKey(key);
11 | }
12 | return defaultValue;
13 | };
14 | exports.getString = function (key, defaultValue) {
15 | Common.checkKey(key);
16 | if (exports.hasKey(key)) {
17 | return userDefaults.stringForKey(key);
18 | }
19 | return defaultValue;
20 | };
21 | exports.getNumber = function (key, defaultValue) {
22 | Common.checkKey(key);
23 | if (exports.hasKey(key)) {
24 | return userDefaults.doubleForKey(key);
25 | }
26 | return defaultValue;
27 | };
28 | exports.setBoolean = function (key, value) {
29 | Common.checkKey(key);
30 | Common.ensureValidValue(value, "boolean");
31 | userDefaults.setBoolForKey(value, key);
32 | userDefaults.synchronize();
33 | };
34 | exports.setString = function (key, value) {
35 | Common.checkKey(key);
36 | Common.ensureValidValue(value, "string");
37 | userDefaults.setObjectForKey(value, key);
38 | userDefaults.synchronize();
39 | };
40 | exports.setNumber = function (key, value) {
41 | Common.checkKey(key);
42 | Common.ensureValidValue(value, "number");
43 | userDefaults.setDoubleForKey(value, key);
44 | userDefaults.synchronize();
45 | };
46 | exports.remove = function (key) {
47 | Common.checkKey(key);
48 | userDefaults.removeObjectForKey(key);
49 | userDefaults.synchronize();
50 | };
51 |
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/application-settings/package.json:
--------------------------------------------------------------------------------
1 | { "name" : "application-settings",
2 | "main" : "application-settings.js" }
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/application/application-common.js:
--------------------------------------------------------------------------------
1 | require("globals");
2 | var definition = require("application");
3 | var fs = require("file-system");
4 | var styleScope = require("ui/styling/style-scope");
5 | var observable = require("data/observable");
6 | var events = new observable.Observable();
7 | global.moduleMerge(events, exports);
8 | exports.launchEvent = "launch";
9 | exports.suspendEvent = "suspend";
10 | exports.resumeEvent = "resume";
11 | exports.exitEvent = "exit";
12 | exports.lowMemoryEvent = "lowMemory";
13 | exports.uncaughtErrorEvent = "uncaughtError";
14 | exports.orientationChangedEvent = "orientationChanged";
15 | exports.cssFile = "app.css";
16 | exports.resources = {};
17 | exports.onUncaughtError = undefined;
18 | exports.onLaunch = undefined;
19 | exports.onSuspend = undefined;
20 | exports.onResume = undefined;
21 | exports.onExit = undefined;
22 | exports.onLowMemory = undefined;
23 | exports.android = undefined;
24 | exports.ios = undefined;
25 | function loadCss() {
26 | if (definition.cssFile) {
27 | var cssFileName = fs.path.join(fs.knownFolders.currentApp().path, definition.cssFile);
28 | if (fs.File.exists(cssFileName)) {
29 | var file = fs.File.fromPath(cssFileName);
30 | var applicationCss = file.readTextSync();
31 | if (applicationCss) {
32 | definition.cssSelectorsCache = styleScope.StyleScope.createSelectorsFromCss(applicationCss, cssFileName);
33 | }
34 | }
35 | }
36 | }
37 | exports.loadCss = loadCss;
38 |
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/application/package.json:
--------------------------------------------------------------------------------
1 | { "name" : "application",
2 | "main" : "application.js" }
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/camera/camera-common.js:
--------------------------------------------------------------------------------
1 | function getAspectSafeDimensions(sourceWidth, sourceHeight, reqWidth, reqHeight) {
2 | var widthCoef = sourceWidth / reqWidth;
3 | var heightCoef = sourceHeight / reqHeight;
4 | var aspectCoef = widthCoef > heightCoef ? widthCoef : heightCoef;
5 | return {
6 | width: Math.floor(sourceWidth / aspectCoef),
7 | height: Math.floor(sourceHeight / aspectCoef)
8 | };
9 | }
10 | exports.getAspectSafeDimensions = getAspectSafeDimensions;
11 |
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/camera/package.json:
--------------------------------------------------------------------------------
1 | { "name" : "camera",
2 | "main" : "camera.js" }
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/color/color.android.js:
--------------------------------------------------------------------------------
1 | var common = require("./color-common");
2 | var Color = (function (_super) {
3 | __extends(Color, _super);
4 | function Color() {
5 | _super.apply(this, arguments);
6 | }
7 | Object.defineProperty(Color.prototype, "android", {
8 | get: function () {
9 | return this.argb;
10 | },
11 | enumerable: true,
12 | configurable: true
13 | });
14 | Color.prototype._argbFromString = function (hex) {
15 | return android.graphics.Color.parseColor(hex);
16 | };
17 | return Color;
18 | })(common.Color);
19 | exports.Color = Color;
20 |
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/color/color.ios.js:
--------------------------------------------------------------------------------
1 | var common = require("./color-common");
2 | var AMP = "#";
3 | var Color = (function (_super) {
4 | __extends(Color, _super);
5 | function Color() {
6 | _super.apply(this, arguments);
7 | }
8 | Object.defineProperty(Color.prototype, "ios", {
9 | get: function () {
10 | if (!this._ios) {
11 | this._ios = UIColor.alloc().initWithRedGreenBlueAlpha(this.r / 255, this.g / 255, this.b / 255, this.a / 255);
12 | }
13 | return this._ios;
14 | },
15 | enumerable: true,
16 | configurable: true
17 | });
18 | Color.prototype._argbFromString = function (hex) {
19 | if (hex.charAt(0) === AMP) {
20 | hex = hex.substr(1);
21 | }
22 | var intVal = parseInt(hex, 16);
23 | if (hex.length === 6) {
24 | intVal |= 255 << 24;
25 | }
26 | return intVal;
27 | };
28 | return Color;
29 | })(common.Color);
30 | exports.Color = Color;
31 |
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/color/package.json:
--------------------------------------------------------------------------------
1 | { "name" : "color",
2 | "main" : "color.js" }
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/connectivity/connectivity-common.js:
--------------------------------------------------------------------------------
1 | var connectionType;
2 | (function (connectionType) {
3 | connectionType.none = 0;
4 | connectionType.wifi = 1;
5 | connectionType.mobile = 2;
6 | })(connectionType = exports.connectionType || (exports.connectionType = {}));
7 |
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/connectivity/connectivity.android.js:
--------------------------------------------------------------------------------
1 | var appModule = require("application");
2 | var common = require("./connectivity-common");
3 | var utils = require("utils/utils");
4 | global.moduleMerge(common, exports);
5 | var WIFI = "WIFI";
6 | var MOBILE = "MOBILE";
7 | function getConnectivityManager() {
8 | return utils.ad.getApplicationContext().getSystemService(android.content.Context.CONNECTIVITY_SERVICE);
9 | }
10 | function getActiveNetworkInfo() {
11 | var connectivityManager = getConnectivityManager();
12 | if (!connectivityManager) {
13 | return null;
14 | }
15 | return connectivityManager.getActiveNetworkInfo();
16 | }
17 | function getConnectionType() {
18 | var activeNetworkInfo = getActiveNetworkInfo();
19 | if (!activeNetworkInfo || !activeNetworkInfo.isConnected()) {
20 | return common.connectionType.none;
21 | }
22 | var connectionType = activeNetworkInfo.getTypeName();
23 | switch (connectionType) {
24 | case WIFI:
25 | return common.connectionType.wifi;
26 | case MOBILE:
27 | return common.connectionType.mobile;
28 | }
29 | }
30 | exports.getConnectionType = getConnectionType;
31 | function startMonitoring(connectionTypeChangedCallback) {
32 | var onReceiveCallback = function onReceiveCallback(context, intent) {
33 | var newConnectionType = getConnectionType();
34 | connectionTypeChangedCallback(newConnectionType);
35 | };
36 | appModule.android.registerBroadcastReceiver(android.net.ConnectivityManager.CONNECTIVITY_ACTION, onReceiveCallback);
37 | }
38 | exports.startMonitoring = startMonitoring;
39 | function stopMonitoring() {
40 | appModule.android.unregisterBroadcastReceiver(android.net.ConnectivityManager.CONNECTIVITY_ACTION);
41 | }
42 | exports.stopMonitoring = stopMonitoring;
43 |
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/connectivity/connectivity.ios.js:
--------------------------------------------------------------------------------
1 | var common = require("./connectivity-common");
2 | global.moduleMerge(common, exports);
3 | function _createReachability(host) {
4 | if (host) {
5 | return SCNetworkReachabilityCreateWithName(null, host);
6 | }
7 | else {
8 | var zeroAddress = new interop.Reference(sockaddr, {
9 | sa_len: 16,
10 | sa_family: 2
11 | });
12 | return SCNetworkReachabilityCreateWithAddress(null, zeroAddress);
13 | }
14 | }
15 | function _getReachabilityFlags(host) {
16 | var reachability = _createReachability(host);
17 | var flagsRef = new interop.Reference();
18 | var gotFlags = SCNetworkReachabilityGetFlags(reachability, flagsRef);
19 | CFRelease(reachability);
20 | if (!gotFlags) {
21 | return null;
22 | }
23 | return flagsRef.value;
24 | }
25 | function _getConnectionType(host) {
26 | var flags = _getReachabilityFlags(host);
27 | return _getConnectionTypeFromFlags(flags);
28 | }
29 | function _getConnectionTypeFromFlags(flags) {
30 | if (!flags) {
31 | return common.connectionType.none;
32 | }
33 | var isReachable = flags & kSCNetworkReachabilityFlagsReachable;
34 | var connectionRequired = flags & kSCNetworkReachabilityFlagsConnectionRequired;
35 | if (!isReachable || connectionRequired) {
36 | return common.connectionType.none;
37 | }
38 | var isWWAN = flags & kSCNetworkReachabilityFlagsIsWWAN;
39 | if (isWWAN) {
40 | return common.connectionType.mobile;
41 | }
42 | return common.connectionType.wifi;
43 | }
44 | function getConnectionType() {
45 | return _getConnectionType();
46 | }
47 | exports.getConnectionType = getConnectionType;
48 | function _reachabilityCallback(target, flags, info) {
49 | if (_connectionTypeChangedCallback) {
50 | var newConnectionType = _getConnectionTypeFromFlags(flags);
51 | _connectionTypeChangedCallback(newConnectionType);
52 | }
53 | }
54 | var _reachabilityCallbackFunctionRef = new interop.FunctionReference(_reachabilityCallback);
55 | var _monitorReachabilityRef;
56 | var _connectionTypeChangedCallback;
57 | function startMonitoring(connectionTypeChangedCallback) {
58 | if (!_monitorReachabilityRef) {
59 | _monitorReachabilityRef = _createReachability();
60 | _connectionTypeChangedCallback = connectionTypeChangedCallback;
61 | SCNetworkReachabilitySetCallback(_monitorReachabilityRef, _reachabilityCallbackFunctionRef, null);
62 | SCNetworkReachabilityScheduleWithRunLoop(_monitorReachabilityRef, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode);
63 | }
64 | }
65 | exports.startMonitoring = startMonitoring;
66 | function stopMonitoring() {
67 | if (_monitorReachabilityRef) {
68 | SCNetworkReachabilityUnscheduleFromRunLoop(_monitorReachabilityRef, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode);
69 | CFRelease(_monitorReachabilityRef);
70 | _monitorReachabilityRef = undefined;
71 | _connectionTypeChangedCallback = undefined;
72 | ;
73 | }
74 | }
75 | exports.stopMonitoring = stopMonitoring;
76 |
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/connectivity/package.json:
--------------------------------------------------------------------------------
1 | { "name" : "connectivity",
2 | "main" : "connectivity.js" }
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/console/package.json:
--------------------------------------------------------------------------------
1 | { "name" : "console",
2 | "main" : "console.js" }
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/css-value/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "css-value",
3 | "version": "0.0.1",
4 | "description": "CSS value parser",
5 | "keywords": ["css", "parser", "value"],
6 | "author": "TJ Holowaychuk ",
7 | "repository": {
8 | "type": "git",
9 | "url": "git://github.com/visionmedia/css-value.git"
10 | },
11 | "main": "reworkcss-value.js"
12 | }
13 |
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/css-value/reworkcss-value.js:
--------------------------------------------------------------------------------
1 |
2 | module.exports.parse = parse;
3 |
4 | function parse(str) {
5 | return new Parser(str).parse();
6 | }
7 |
8 | function Parser(str) {
9 | this.str = str;
10 | }
11 |
12 | Parser.prototype.skip = function(m){
13 | this.str = this.str.slice(m[0].length);
14 | };
15 |
16 | Parser.prototype.comma = function(){
17 | var m = /^, */.exec(this.str);
18 | if (!m) return;
19 | this.skip(m);
20 | return { type: 'comma', string: ',' };
21 | };
22 |
23 | Parser.prototype.ident = function(){
24 | var m = /^([\w-]+) */.exec(this.str);
25 | if (!m) return;
26 | this.skip(m);
27 | return {
28 | type: 'ident',
29 | string: m[1]
30 | }
31 | };
32 |
33 | Parser.prototype.int = function(){
34 | var m = /^((\d+)(\S+)?) */.exec(this.str);
35 | if (!m) return;
36 | this.skip(m);
37 | var n = ~~m[2];
38 | var u = m[3];
39 |
40 | return {
41 | type: 'number',
42 | string: m[1],
43 | unit: u || '',
44 | value: n
45 | }
46 | };
47 |
48 | Parser.prototype.float = function(){
49 | var m = /^(((?:\d+)?\.\d+)(\S+)?) */.exec(this.str);
50 | if (!m) return;
51 | this.skip(m);
52 | var n = parseFloat(m[2]);
53 | var u = m[3];
54 |
55 | return {
56 | type: 'number',
57 | string: m[1],
58 | unit: u || '',
59 | value: n
60 | }
61 | };
62 |
63 | Parser.prototype.number = function(){
64 | return this.float() || this.int();
65 | };
66 |
67 | Parser.prototype.double = function(){
68 | var m = /^"([^"]*)" */.exec(this.str);
69 | if (!m) return m;
70 | this.skip(m);
71 | return {
72 | type: 'string',
73 | quote: '"',
74 | string: '"' + m[1] + '"',
75 | value: m[1]
76 | }
77 | };
78 |
79 | Parser.prototype.single = function(){
80 | var m = /^'([^']*)' */.exec(this.str);
81 | if (!m) return m;
82 | this.skip(m);
83 | return {
84 | type: 'string',
85 | quote: "'",
86 | string: "'" + m[1] + "'",
87 | value: m[1]
88 | }
89 | };
90 |
91 | Parser.prototype.string = function(){
92 | return this.single() || this.double();
93 | };
94 |
95 |
96 | Parser.prototype.value = function(){
97 | return this.number()
98 | || this.ident()
99 | || this.string()
100 | || this.comma();
101 | };
102 |
103 | Parser.prototype.parse = function(){
104 | var vals = [];
105 |
106 | while (this.str.length) {
107 | var obj = this.value();
108 | if (!obj) throw new Error('failed to parse near `' + this.str.slice(0, 10) + '...`');
109 | vals.push(obj);
110 | }
111 |
112 | return vals;
113 | };
114 |
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/css/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "css",
3 | "version": "2.1.0",
4 | "description": "CSS parser",
5 | "main": "reworkcss.js",
6 | "author": "TJ Holowaychuk ",
7 | "license": "MIT",
8 | "repository": {
9 | "type": "git",
10 | "url": "https://github.com/reworkcss/css.git"
11 | },
12 | "keywords": [
13 | "css",
14 | "parser",
15 | "stringifier",
16 | "stylesheet"
17 | ]
18 | }
19 |
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/data/observable-array/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name" : "observable-array",
3 | "main" : "observable-array.js"
4 | }
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/data/observable/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name" : "observable",
3 | "main" : "observable.js"
4 | }
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/data/virtual-array/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name" : "virtual-array",
3 | "main" : "virtual-array.js"
4 | }
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/fetch/package.json:
--------------------------------------------------------------------------------
1 | { "name" : "fetch",
2 | "main" : "fetch.js" }
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/file-system/package.json:
--------------------------------------------------------------------------------
1 | { "name" : "file-system",
2 | "main" : "file-system.js" }
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/fps-meter/fps-meter.js:
--------------------------------------------------------------------------------
1 | var fpsNative = require("fps-meter/fps-native");
2 | var callbacks = {}, idCounter = 0, _minFps = 1000, framesRendered = 0, frameStartTime = 0;
3 | function doFrame(currentTimeMillis) {
4 | var fps = 0;
5 | if (frameStartTime > 0) {
6 | var timeSpan = (currentTimeMillis - frameStartTime);
7 | framesRendered++;
8 | if (timeSpan > 1000) {
9 | fps = framesRendered * 1000 / timeSpan;
10 | if (fps < _minFps) {
11 | _minFps = fps;
12 | }
13 | notify(fps);
14 | frameStartTime = currentTimeMillis;
15 | framesRendered = 0;
16 | }
17 | }
18 | else {
19 | frameStartTime = currentTimeMillis;
20 | }
21 | }
22 | var native = new fpsNative.FPSCallback(doFrame);
23 | function reset() {
24 | _minFps = 1000;
25 | frameStartTime = 0;
26 | framesRendered = 0;
27 | }
28 | exports.reset = reset;
29 | function running() {
30 | return native.running;
31 | }
32 | exports.running = running;
33 | function minFps() {
34 | return _minFps;
35 | }
36 | exports.minFps = minFps;
37 | function start() {
38 | native.start();
39 | }
40 | exports.start = start;
41 | function stop() {
42 | native.stop();
43 | reset();
44 | }
45 | exports.stop = stop;
46 | function addCallback(callback) {
47 | var id = idCounter;
48 | callbacks[id] = callback;
49 | idCounter++;
50 | return id;
51 | }
52 | exports.addCallback = addCallback;
53 | function removeCallback(id) {
54 | if (id in callbacks) {
55 | delete callbacks[id];
56 | }
57 | }
58 | exports.removeCallback = removeCallback;
59 | function notify(fps) {
60 | var callback;
61 | for (var id in callbacks) {
62 | callback = callbacks[id];
63 | callback(fps, _minFps);
64 | }
65 | }
66 |
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/fps-meter/fps-native.android.js:
--------------------------------------------------------------------------------
1 | var FPSCallback = (function () {
2 | function FPSCallback(onFrame) {
3 | var _this = this;
4 | this.running = false;
5 | this.onFrame = onFrame;
6 | this.impl = new android.view.Choreographer.FrameCallback({
7 | doFrame: function (nanos) {
8 | _this.handleFrame(nanos);
9 | }
10 | });
11 | }
12 | FPSCallback.prototype.start = function () {
13 | if (this.running) {
14 | return;
15 | }
16 | android.view.Choreographer.getInstance().postFrameCallback(this.impl);
17 | this.running = true;
18 | };
19 | FPSCallback.prototype.stop = function () {
20 | if (!this.running) {
21 | return;
22 | }
23 | android.view.Choreographer.getInstance().removeFrameCallback(this.impl);
24 | this.running = false;
25 | };
26 | FPSCallback.prototype.handleFrame = function (nanos) {
27 | if (!this.running) {
28 | return;
29 | }
30 | this.onFrame(nanos / 1000000);
31 | android.view.Choreographer.getInstance().postFrameCallback(this.impl);
32 | };
33 | return FPSCallback;
34 | })();
35 | exports.FPSCallback = FPSCallback;
36 |
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/fps-meter/fps-native.ios.js:
--------------------------------------------------------------------------------
1 | var FrameHandlerImpl = (function (_super) {
2 | __extends(FrameHandlerImpl, _super);
3 | function FrameHandlerImpl() {
4 | _super.apply(this, arguments);
5 | }
6 | FrameHandlerImpl.new = function () {
7 | return _super.new.call(this);
8 | };
9 | FrameHandlerImpl.prototype.initWithOwner = function (owner) {
10 | this._owner = owner;
11 | return this;
12 | };
13 | FrameHandlerImpl.prototype.handleFrame = function (sender) {
14 | this._owner._handleFrame(sender);
15 | };
16 | FrameHandlerImpl.ObjCExposedMethods = {
17 | "handleFrame": { returns: interop.types.void, params: [CADisplayLink] }
18 | };
19 | return FrameHandlerImpl;
20 | })(NSObject);
21 | var FPSCallback = (function () {
22 | function FPSCallback(onFrame) {
23 | this.onFrame = onFrame;
24 | this.impl = FrameHandlerImpl.new().initWithOwner(this);
25 | this.displayLink = CADisplayLink.displayLinkWithTargetSelector(this.impl, "handleFrame");
26 | this.displayLink.paused = true;
27 | this.displayLink.addToRunLoopForMode(NSRunLoop.currentRunLoop(), NSDefaultRunLoopMode);
28 | this.displayLink.addToRunLoopForMode(NSRunLoop.currentRunLoop(), UITrackingRunLoopMode);
29 | }
30 | FPSCallback.prototype.start = function () {
31 | if (this.running) {
32 | return;
33 | }
34 | this.running = true;
35 | this.displayLink.paused = false;
36 | };
37 | FPSCallback.prototype.stop = function () {
38 | if (!this.running) {
39 | return;
40 | }
41 | this.displayLink.paused = true;
42 | this.running = false;
43 | };
44 | FPSCallback.prototype._handleFrame = function (sender) {
45 | if (!this.running) {
46 | return;
47 | }
48 | this.onFrame(sender.timestamp * 1000);
49 | };
50 | return FPSCallback;
51 | })();
52 | exports.FPSCallback = FPSCallback;
53 |
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/fps-meter/package.json:
--------------------------------------------------------------------------------
1 | { "name" : "fps-meter",
2 | "main" : "fps-meter.js" }
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/globals/globals.js:
--------------------------------------------------------------------------------
1 | global.moduleMerge = function (sourceExports, destExports) {
2 | for (var key in sourceExports) {
3 | destExports[key] = sourceExports[key];
4 | }
5 | };
6 | var platform = require("platform");
7 | var timer = require("timer");
8 | var consoleModule = require("console");
9 | var xhr = require("../xhr/xhr");
10 | var dialogs = require("ui/dialogs");
11 | global.setTimeout = timer.setTimeout;
12 | global.clearTimeout = timer.clearTimeout;
13 | global.setInterval = timer.setInterval;
14 | global.clearInterval = timer.clearInterval;
15 | if (typeof global.__decorate !== "function") {
16 | global.__decorate = function (decorators, target, key, desc) {
17 | if (typeof global.Reflect === "object" && typeof global.Reflect.decorate === "function") {
18 | return global.Reflect.decorate(decorators, target, key, desc);
19 | }
20 | switch (arguments.length) {
21 | case 2: return decorators.reduceRight(function (o, d) { return (d && d(o)) || o; }, target);
22 | case 3: return decorators.reduceRight(function (o, d) { return (d && d(target, key)), void 0; }, void 0);
23 | case 4: return decorators.reduceRight(function (o, d) { return (d && d(target, key, o)) || o; }, desc);
24 | }
25 | };
26 | }
27 | ;
28 | var c = new consoleModule.Console();
29 | if (platform.device.os === platform.platformNames.android) {
30 | global.console = c;
31 | }
32 | else if (platform.device.os === platform.platformNames.ios) {
33 | global.console.dump = function (args) { c.dump(args); };
34 | }
35 | global.XMLHttpRequest = xhr.XMLHttpRequest;
36 | global.FormData = xhr.FormData;
37 | global.alert = dialogs.alert;
38 | var fetchModule = require("fetch");
39 | global.moduleMerge(fetchModule, global);
40 | function Deprecated(target, key, descriptor) {
41 | if (descriptor) {
42 | var originalMethod = descriptor.value;
43 | descriptor.value = function () {
44 | var args = [];
45 | for (var _i = 0; _i < arguments.length; _i++) {
46 | args[_i - 0] = arguments[_i];
47 | }
48 | console.log(key + " is deprecated");
49 | return originalMethod.apply(this, args);
50 | };
51 | return descriptor;
52 | }
53 | else {
54 | console.log((target && target.name || target) + " is deprecated");
55 | return target;
56 | }
57 | }
58 | exports.Deprecated = Deprecated;
59 | global.Deprecated = Deprecated;
60 |
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/globals/package.json:
--------------------------------------------------------------------------------
1 | { "name" : "globals",
2 | "main" : "globals.js" }
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/http/http.js:
--------------------------------------------------------------------------------
1 | var httpRequest = require("http/http-request");
2 | global.moduleMerge(httpRequest, exports);
3 | function getString(arg) {
4 | return new Promise(function (resolve, reject) {
5 | httpRequest.request(typeof arg === "string" ? { url: arg, method: "GET" } : arg)
6 | .then(function (r) {
7 | try {
8 | var str = r.content.toString();
9 | resolve(str);
10 | }
11 | catch (e) {
12 | reject(e);
13 | }
14 | }, function (e) { return reject(e); });
15 | });
16 | }
17 | exports.getString = getString;
18 | function getJSON(arg) {
19 | return new Promise(function (resolve, reject) {
20 | httpRequest.request(typeof arg === "string" ? { url: arg, method: "GET" } : arg)
21 | .then(function (r) {
22 | try {
23 | var json = r.content.toJSON();
24 | resolve(json);
25 | }
26 | catch (e) {
27 | reject(e);
28 | }
29 | }, function (e) { return reject(e); });
30 | });
31 | }
32 | exports.getJSON = getJSON;
33 | function getImage(arg) {
34 | return new Promise(function (resolve, reject) {
35 | httpRequest.request(typeof arg === "string" ? { url: arg, method: "GET" } : arg)
36 | .then(function (r) {
37 | r.content.toImage().then(function (source) { return resolve(source); }, function (e) { return reject(e); });
38 | }, function (e) { return reject(e); });
39 | });
40 | }
41 | exports.getImage = getImage;
42 |
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/http/package.json:
--------------------------------------------------------------------------------
1 | { "name" : "http",
2 | "main" : "http.js" }
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/image-source/image-source-common.js:
--------------------------------------------------------------------------------
1 | var http = require("http");
2 | var utils = require("utils/utils");
3 | var definition = require("image-source");
4 | function fromResource(name) {
5 | var image = new definition.ImageSource();
6 | return image.loadFromResource(name) ? image : null;
7 | }
8 | exports.fromResource = fromResource;
9 | function fromFile(path) {
10 | var image = new definition.ImageSource();
11 | return image.loadFromFile(path) ? image : null;
12 | }
13 | exports.fromFile = fromFile;
14 | function fromData(data) {
15 | var image = new definition.ImageSource();
16 | return image.loadFromData(data) ? image : null;
17 | }
18 | exports.fromData = fromData;
19 | function fromBase64(source) {
20 | var image = new definition.ImageSource();
21 | return image.loadFromBase64(source) ? image : null;
22 | }
23 | exports.fromBase64 = fromBase64;
24 | function fromNativeSource(source) {
25 | var image = new definition.ImageSource();
26 | return image.setNativeSource(source) ? image : null;
27 | }
28 | exports.fromNativeSource = fromNativeSource;
29 | function fromUrl(url) {
30 | return http.getImage(url);
31 | }
32 | exports.fromUrl = fromUrl;
33 | function fromFileOrResource(path) {
34 | if (!isFileOrResourcePath(path)) {
35 | throw new Error("Path \"" + "\" is not a valid file or resource.");
36 | }
37 | if (path.indexOf(utils.RESOURCE_PREFIX) === 0) {
38 | return fromResource(path.substr(utils.RESOURCE_PREFIX.length));
39 | }
40 | return fromFile(path);
41 | }
42 | exports.fromFileOrResource = fromFileOrResource;
43 | function isFileOrResourcePath(path) {
44 | return utils.isFileOrResourcePath(path);
45 | }
46 | exports.isFileOrResourcePath = isFileOrResourcePath;
47 |
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/image-source/package.json:
--------------------------------------------------------------------------------
1 | { "name" : "image-source",
2 | "main" : "image-source.js" }
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/js-libs/easysax/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "easysax",
3 | "description": "pure javascript xml parser",
4 | "keywords": [
5 | "xml",
6 | "sax",
7 | "parser",
8 | "pure"
9 | ],
10 | "version": "0.1.14",
11 | "main": "easysax.js",
12 | "bugs": {
13 | "url": "https://github.com/vflash/easysax/issues"
14 | },
15 | "author": {
16 | "name": "Vopilovskiy Konstantin",
17 | "email": "flash.vkv@gmail.com",
18 | "url": "http://vflash.ru"
19 | },
20 | "files": [
21 | "easysax.js",
22 | "LICENSE",
23 | "README.md"
24 | ],
25 | "repository": {
26 | "type": "git",
27 | "url": "https://github.com/vflash/easysax"
28 | },
29 | "readme": "EASYSAX - pure javascript sax-style parser for xml\r\n==================================================\r\nПростой и быстрый SAX парсер XML файлов.\r\nРеализован по принципу парсить только то что нужно и как можно быстрее.\r\nПарсер не потоковый, и не расчитан на гиганские файлы. Весь XML должен быть в памяти.\r\nВстроенный уникальный механизм работы с пространсвами имен.\r\n\r\n\r\nПарсер был написан для RSS ридера http://zzreader.com\r\nНа конец 2012 года остается самым быстрым SAX парсером под NODE.JS\r\n\r\n\r\n\r\nBENCHMARK\r\n---------------------------------------------------\r\n\r\n**benchmark/test.js, parse file #1**\r\n```\r\nsax-js: 12671ms\r\nlibxmljs: 11311ms\r\nexpat: 6118ms\r\nexpat buffer: 5278ms\r\neasysax : 1739ms // namespace--on, attr()--on , entity_decode--on\r\neasysax: 1035ms // namespace--off, attr()--on , entity_decode--on\r\neasysax: 740ms // namespace--off, attr()--off , entity_decode--off\r\n```\r\n\r\n\r\n**benchmark/test.js, parse file #2 (много атрибутов)**\r\n```\r\nsax-js: 84060ms\r\nlibxmljs: 48919ms\r\nexpat: 39444ms\r\nexpat buffer: 35375ms\r\neasysax: 14655ms // namespace--on, attr()--on , entity_decode--on\r\neasysax: 9874ms // namespace--off, attr()--on , entity_decode--on\r\neasysax: 3531ms // namespace--off, attr()--off , entity_decode--on\r\neasysax: 2954ms // namespace--off, attr()--off , entity_decode--off\r\n```\r\n\r\n\r\n**demo/example.js, parse file #2**\r\n```\r\n1,000 pages for: 13335ms - attr()--all\r\n1,000 pages for: 7300ms - attr()--on_request\r\n```\n",
30 | "readmeFilename": "README.md",
31 | "homepage": "https://github.com/vflash/easysax",
32 | "_id": "easysax@0.1.14",
33 | "dist": {
34 | "shasum": "ef7f6f92dfbbf68306ec3bfa1c707a9d8d959d1e"
35 | },
36 | "_from": "easysax@",
37 | "_resolved": "https://registry.npmjs.org/easysax/-/easysax-0.1.14.tgz"
38 | }
39 |
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/js-libs/esprima/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "esprima",
3 | "description": "ECMAScript parsing infrastructure for multipurpose analysis",
4 | "homepage": "http://esprima.org",
5 | "main": "esprima.js",
6 | "bin": {
7 | "esparse": "./bin/esparse.js",
8 | "esvalidate": "./bin/esvalidate.js"
9 | },
10 | "version": "2.0.0-dev",
11 | "files": [
12 | "bin",
13 | "test/run.js",
14 | "test/runner.js",
15 | "test/test.js",
16 | "test/compat.js",
17 | "test/reflect.js",
18 | "esprima.js"
19 | ],
20 | "engines": {
21 | "node": ">=0.4.0"
22 | },
23 | "author": {
24 | "name": "Ariya Hidayat",
25 | "email": "ariya.hidayat@gmail.com"
26 | },
27 | "maintainers": [{
28 | "name": "Ariya Hidayat",
29 | "email": "ariya.hidayat@gmail.com",
30 | "web": "http://ariya.ofilabs.com"
31 | }],
32 | "repository": {
33 | "type": "git",
34 | "url": "https://github.com/ariya/esprima.git"
35 | },
36 | "bugs": {
37 | "url": "http://issues.esprima.org"
38 | },
39 | "licenses": [{
40 | "type": "BSD",
41 | "url": "https://github.com/ariya/esprima/raw/master/LICENSE.BSD"
42 | }],
43 | "devDependencies": {
44 | "jslint": "~0.1.9",
45 | "eslint": "~0.6.2",
46 | "jscs": "~1.2.4",
47 | "istanbul": "~0.2.6",
48 | "complexity-report": "~0.6.1",
49 | "regenerate": "~0.6.2",
50 | "unicode-7.0.0": "~0.1.5",
51 | "json-diff": "~0.3.1",
52 | "optimist": "~0.6.0"
53 | },
54 | "keywords": [
55 | "ast",
56 | "ecmascript",
57 | "javascript",
58 | "parser",
59 | "syntax"
60 | ],
61 | "scripts": {
62 | "generate-regex": "node tools/generate-identifier-regex.js",
63 |
64 | "test": "npm run-script lint && node test/run.js && npm run-script coverage && npm run-script complexity",
65 |
66 | "lint": "npm run-script check-version && npm run-script eslint && npm run-script jscs && npm run-script jslint",
67 | "check-version": "node tools/check-version.js",
68 | "eslint": "node node_modules/eslint/bin/eslint.js esprima.js",
69 | "jscs": "node node_modules/jscs/bin/jscs esprima.js",
70 | "jslint": "node node_modules/jslint/bin/jslint.js esprima.js",
71 |
72 | "coverage": "npm run-script analyze-coverage && npm run-script check-coverage",
73 | "analyze-coverage": "node node_modules/istanbul/lib/cli.js cover test/runner.js",
74 | "check-coverage": "node node_modules/istanbul/lib/cli.js check-coverage --statement 100 --branch 100 --function 100",
75 |
76 | "complexity": "npm run-script analyze-complexity && npm run-script check-complexity",
77 | "analyze-complexity": "node tools/list-complexity.js",
78 | "check-complexity": "node node_modules/complexity-report/src/cli.js --maxcc 15 --silent -l -w esprima.js",
79 |
80 | "benchmark": "node test/benchmarks.js",
81 | "benchmark-quick": "node test/benchmarks.js quick"
82 | }
83 | }
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/js-libs/polymer-expressions/package.json:
--------------------------------------------------------------------------------
1 | { "name" : "polymer-expressions",
2 | "main" : "polymer-expressions.js" }
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/location/location-common.js:
--------------------------------------------------------------------------------
1 | var timer = require("timer");
2 | var defModule = require("location");
3 | var defaultGetLocationTimeout = 20000;
4 | var Location = (function () {
5 | function Location() {
6 | }
7 | return Location;
8 | })();
9 | exports.Location = Location;
10 | exports.getLocation = function (options) {
11 | var timerId;
12 | var locationManager = new defModule.LocationManager();
13 | if (options && (0 === options.timeout)) {
14 | return new Promise(function (resolve, reject) {
15 | var location = locationManager.lastKnownLocation;
16 | if (location) {
17 | if (options && ("number" === typeof options.maximumAge)) {
18 | if (location.timestamp.valueOf() + options.maximumAge > new Date().valueOf()) {
19 | resolve(location);
20 | }
21 | else {
22 | reject(new Error("timeout is 0 and last known location is older than maximumAge"));
23 | }
24 | }
25 | else {
26 | resolve(location);
27 | }
28 | }
29 | else {
30 | reject(new Error("timeout is 0 and no known location found"));
31 | }
32 | });
33 | }
34 | return new Promise(function (resolve, reject) {
35 | if (!defModule.LocationManager.isEnabled()) {
36 | return reject(new Error("Location service is disabled"));
37 | }
38 | locationManager.startLocationMonitoring(function (location) {
39 | if (options && ("number" === typeof options.maximumAge)) {
40 | if (location.timestamp.valueOf() + options.maximumAge > new Date().valueOf()) {
41 | locationManager.stopLocationMonitoring();
42 | if ("undefined" !== typeof timerId) {
43 | timer.clearTimeout(timerId);
44 | }
45 | resolve(location);
46 | }
47 | }
48 | else {
49 | locationManager.stopLocationMonitoring();
50 | if ("undefined" !== typeof timerId) {
51 | timer.clearTimeout(timerId);
52 | }
53 | resolve(location);
54 | }
55 | }, function (error) {
56 | console.error('Location error received: ' + error);
57 | locationManager.stopLocationMonitoring();
58 | if ("undefined" !== typeof timerId) {
59 | timer.clearTimeout(timerId);
60 | }
61 | reject(error);
62 | }, options);
63 | if (options && ("number" === typeof options.timeout)) {
64 | timerId = timer.setTimeout(function () {
65 | locationManager.stopLocationMonitoring();
66 | reject(new Error("timeout searching for location"));
67 | }, options.timeout || defaultGetLocationTimeout);
68 | }
69 | });
70 | };
71 |
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/location/package.json:
--------------------------------------------------------------------------------
1 | { "name" : "location",
2 | "main" : "location.js" }
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "tns-core-modules",
3 | "description": "Telerik NativeScript Core Modules",
4 | "version": "1.4.0",
5 | "repository": {
6 | "type": "git",
7 | "url": "https://github.com/NativeScript/NativeScript/commit/2647ee894483aed4f8d1e2dfdb1784f66d70f4f9"
8 | },
9 | "files": [
10 | "**/*.*",
11 | "**/*",
12 | "!node-tests/"
13 | ],
14 | "license": "Apache-2.0",
15 | "devDependencies": {
16 | "grunt": "0.4.5",
17 | "grunt-contrib-clean": "0.6.0",
18 | "grunt-contrib-copy": "git+https://github.com/ErjanGavalji/grunt-contrib-copy.git#1c976a133210be4ce8c96313f5daf14833f7f8f9",
19 | "grunt-exec": "0.4.6",
20 | "grunt-multi-dest": "1.0.0",
21 | "grunt-shell": "1.1.2",
22 | "grunt-ts": "5.0.0-beta.5",
23 | "grunt-tslint": "2.5.0",
24 | "mocha": "2.2.5",
25 | "grunt-simple-mocha": "0.4.0",
26 | "grunt-env": "0.4.4",
27 | "chai": "3.2.0",
28 | "typescript": "1.6.2"
29 | },
30 | "_id": "tns-core-modules@1.4.0",
31 | "_shasum": "90bcb20087993faa1310658803cf3ef7fe5970d5",
32 | "_resolved": "https://registry.npmjs.org/tns-core-modules/-/tns-core-modules-1.4.0.tgz",
33 | "_from": "tns-core-modules@*",
34 | "scripts": {},
35 | "_npmVersion": "2.5.1",
36 | "_nodeVersion": "0.12.0",
37 | "_npmUser": {
38 | "name": "enchev",
39 | "email": "vladimir.enchev@gmail.com"
40 | },
41 | "dist": {
42 | "shasum": "90bcb20087993faa1310658803cf3ef7fe5970d5",
43 | "tarball": "http://registry.npmjs.org/tns-core-modules/-/tns-core-modules-1.4.0.tgz"
44 | },
45 | "maintainers": [
46 | {
47 | "name": "enchev",
48 | "email": "vladimir.enchev@gmail.com"
49 | },
50 | {
51 | "name": "erjangavalji",
52 | "email": "erjan.gavalji@gmail.com"
53 | },
54 | {
55 | "name": "fatme",
56 | "email": "hfatme@gmail.com"
57 | },
58 | {
59 | "name": "hdeshev",
60 | "email": "hristo@deshev.com"
61 | },
62 | {
63 | "name": "ligaz",
64 | "email": "stefan.dobrev@gmail.com"
65 | },
66 | {
67 | "name": "sdobrev",
68 | "email": "stefan.dobrev@gmail.com"
69 | },
70 | {
71 | "name": "valio.stoychev",
72 | "email": "valio.stoychev@gmail.com"
73 | }
74 | ],
75 | "directories": {}
76 | }
77 |
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/platform/package.json:
--------------------------------------------------------------------------------
1 | { "name" : "platform",
2 | "main" : "platform.js" }
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/text/formatted-string.android.js:
--------------------------------------------------------------------------------
1 | var formattedStringCommon = require("./formatted-string-common");
2 | global.moduleMerge(formattedStringCommon, exports);
3 | var FormattedString = (function (_super) {
4 | __extends(FormattedString, _super);
5 | function FormattedString() {
6 | _super.apply(this, arguments);
7 | }
8 | FormattedString.prototype.createFormattedStringCore = function () {
9 | var ssb = new android.text.SpannableStringBuilder();
10 | var i;
11 | var spanStart = 0;
12 | var spanLength = 0;
13 | var spanText = "";
14 | for (i = 0; i < this.spans.length; i++) {
15 | var span = this.spans.getItem(i);
16 | spanText = span.text || "";
17 | spanLength = spanText.length;
18 | if (spanLength !== 0) {
19 | ssb.insert(spanStart, spanText);
20 | span.updateSpanModifiers(this);
21 | var p;
22 | for (p = 0; p < span.spanModifiers.length; p++) {
23 | ssb.setSpan(span.spanModifiers[p], spanStart, spanStart + spanLength, android.text.Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
24 | }
25 | spanStart += spanLength;
26 | }
27 | }
28 | this._formattedText = ssb;
29 | };
30 | return FormattedString;
31 | })(formattedStringCommon.FormattedString);
32 | exports.FormattedString = FormattedString;
33 |
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/text/formatted-string.ios.js:
--------------------------------------------------------------------------------
1 | var formattedStringCommon = require("./formatted-string-common");
2 | global.moduleMerge(formattedStringCommon, exports);
3 | var FormattedString = (function (_super) {
4 | __extends(FormattedString, _super);
5 | function FormattedString() {
6 | _super.apply(this, arguments);
7 | }
8 | FormattedString.prototype.createFormattedStringCore = function () {
9 | var mas = NSMutableAttributedString.alloc().init();
10 | var i;
11 | var spanStart = 0;
12 | var spanLength = 0;
13 | var spanText = "";
14 | for (i = 0; i < this.spans.length; i++) {
15 | var span = this.spans.getItem(i);
16 | spanText = span.text || "";
17 | spanLength = spanText.length;
18 | span.updateSpanModifiers(this);
19 | var attrDict = NSMutableDictionary.alloc().init();
20 | var p;
21 | for (p = 0; p < span.spanModifiers.length; p++) {
22 | attrDict.setObjectForKey(span.spanModifiers[p].value, span.spanModifiers[p].key);
23 | }
24 | var nsAttributedString = NSMutableAttributedString.alloc().initWithStringAttributes(String(spanText), attrDict);
25 | mas.insertAttributedStringAtIndex(nsAttributedString, spanStart);
26 | spanStart += spanLength;
27 | }
28 | this._formattedText = mas;
29 | };
30 | return FormattedString;
31 | })(formattedStringCommon.FormattedString);
32 | exports.FormattedString = FormattedString;
33 |
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/text/package.json:
--------------------------------------------------------------------------------
1 | { "name" : "text",
2 | "main" : "text.js" }
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/text/text.android.js:
--------------------------------------------------------------------------------
1 | var encoding;
2 | (function (encoding) {
3 | encoding.ISO_8859_1 = "ISO-8859-1";
4 | encoding.US_ASCII = "US-ASCII";
5 | encoding.UTF_16 = "UTF-16";
6 | encoding.UTF_16BE = "UTF-16BE";
7 | encoding.UTF_16LE = "UTF-16LE";
8 | encoding.UTF_8 = "UTF-8";
9 | })(encoding = exports.encoding || (exports.encoding = {}));
10 |
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/text/text.ios.js:
--------------------------------------------------------------------------------
1 | var encoding;
2 | (function (encoding) {
3 | encoding.ISO_8859_1 = 5;
4 | encoding.US_ASCII = 1;
5 | encoding.UTF_16 = 10;
6 | encoding.UTF_16BE = 0x90000100;
7 | encoding.UTF_16LE = 0x94000100;
8 | encoding.UTF_8 = 4;
9 | })(encoding = exports.encoding || (exports.encoding = {}));
10 |
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/timer/package.json:
--------------------------------------------------------------------------------
1 | { "name" : "timer",
2 | "main" : "timer.js" }
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/timer/timer.android.js:
--------------------------------------------------------------------------------
1 | var timeoutHandler;
2 | var timeoutCallbacks = {};
3 | var timerId = 0;
4 | function createHandlerAndGetId() {
5 | if (!timeoutHandler) {
6 | timeoutHandler = new android.os.Handler(android.os.Looper.getMainLooper());
7 | }
8 | timerId++;
9 | return timerId;
10 | }
11 | function setTimeout(callback, milliseconds) {
12 | if (milliseconds === void 0) { milliseconds = 0; }
13 | var id = createHandlerAndGetId();
14 | var runnable = new java.lang.Runnable({
15 | run: function () {
16 | callback();
17 | if (timeoutCallbacks[id]) {
18 | delete timeoutCallbacks[id];
19 | }
20 | }
21 | });
22 | if (!timeoutCallbacks[id]) {
23 | timeoutCallbacks[id] = runnable;
24 | }
25 | timeoutHandler.postDelayed(runnable, long(milliseconds));
26 | return id;
27 | }
28 | exports.setTimeout = setTimeout;
29 | function clearTimeout(id) {
30 | if (timeoutCallbacks[id]) {
31 | timeoutHandler.removeCallbacks(timeoutCallbacks[id]);
32 | delete timeoutCallbacks[id];
33 | }
34 | }
35 | exports.clearTimeout = clearTimeout;
36 | function setInterval(callback, milliseconds) {
37 | if (milliseconds === void 0) { milliseconds = 0; }
38 | var id = createHandlerAndGetId();
39 | var handler = timeoutHandler;
40 | var runnable = new java.lang.Runnable({
41 | run: function () {
42 | callback();
43 | if (timeoutCallbacks[id]) {
44 | handler.postDelayed(runnable, long(milliseconds));
45 | }
46 | }
47 | });
48 | if (!timeoutCallbacks[id]) {
49 | timeoutCallbacks[id] = runnable;
50 | }
51 | timeoutHandler.postDelayed(runnable, long(milliseconds));
52 | return id;
53 | }
54 | exports.setInterval = setInterval;
55 | exports.clearInterval = clearTimeout;
56 |
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/timer/timer.ios.js:
--------------------------------------------------------------------------------
1 | var timeoutCallbacks = {};
2 | var timerId = 0;
3 | var TimerTargetImpl = (function (_super) {
4 | __extends(TimerTargetImpl, _super);
5 | function TimerTargetImpl() {
6 | _super.apply(this, arguments);
7 | }
8 | TimerTargetImpl.new = function () {
9 | return _super.new.call(this);
10 | };
11 | TimerTargetImpl.prototype.initWithCallback = function (callback) {
12 | this._callback = callback;
13 | return this;
14 | };
15 | TimerTargetImpl.prototype.tick = function (timer) {
16 | this._callback();
17 | };
18 | TimerTargetImpl.ObjCExposedMethods = {
19 | "tick": { returns: interop.types.void, params: [NSTimer] }
20 | };
21 | return TimerTargetImpl;
22 | })(NSObject);
23 | function createTimerAndGetId(callback, milliseconds, shouldRepeat) {
24 | timerId++;
25 | var id = timerId;
26 | var timerTarget = TimerTargetImpl.new().initWithCallback(callback);
27 | var timer = NSTimer.scheduledTimerWithTimeIntervalTargetSelectorUserInfoRepeats(milliseconds / 1000, timerTarget, "tick", null, shouldRepeat);
28 | if (!timeoutCallbacks[id]) {
29 | timeoutCallbacks[id] = timer;
30 | }
31 | return id;
32 | }
33 | function setTimeout(callback, milliseconds) {
34 | if (milliseconds === void 0) { milliseconds = 0; }
35 | return createTimerAndGetId(callback, milliseconds, false);
36 | }
37 | exports.setTimeout = setTimeout;
38 | function clearTimeout(id) {
39 | if (timeoutCallbacks[id]) {
40 | timeoutCallbacks[id].invalidate();
41 | delete timeoutCallbacks[id];
42 | }
43 | }
44 | exports.clearTimeout = clearTimeout;
45 | function setInterval(callback, milliseconds) {
46 | if (milliseconds === void 0) { milliseconds = 0; }
47 | return createTimerAndGetId(callback, milliseconds, true);
48 | }
49 | exports.setInterval = setInterval;
50 | exports.clearInterval = clearTimeout;
51 |
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/trace/package.json:
--------------------------------------------------------------------------------
1 | { "name" : "trace",
2 | "main" : "trace.js" }
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/ui/action-bar/package.json:
--------------------------------------------------------------------------------
1 | { "name" : "action-bar",
2 | "main" : "action-bar.js" }
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/ui/activity-indicator/activity-indicator-common.js:
--------------------------------------------------------------------------------
1 | var view = require("ui/core/view");
2 | var dependencyObservable = require("ui/core/dependency-observable");
3 | var proxy = require("ui/core/proxy");
4 | var busyProperty = new dependencyObservable.Property("busy", "ActivityIndicator", new proxy.PropertyMetadata(false, dependencyObservable.PropertyMetadataSettings.AffectsLayout));
5 | var ActivityIndicator = (function (_super) {
6 | __extends(ActivityIndicator, _super);
7 | function ActivityIndicator() {
8 | _super.apply(this, arguments);
9 | }
10 | Object.defineProperty(ActivityIndicator.prototype, "busy", {
11 | get: function () {
12 | return this._getValue(ActivityIndicator.busyProperty);
13 | },
14 | set: function (value) {
15 | this._setValue(ActivityIndicator.busyProperty, value);
16 | },
17 | enumerable: true,
18 | configurable: true
19 | });
20 | ActivityIndicator.busyProperty = busyProperty;
21 | return ActivityIndicator;
22 | })(view.View);
23 | exports.ActivityIndicator = ActivityIndicator;
24 |
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/ui/activity-indicator/activity-indicator.android.js:
--------------------------------------------------------------------------------
1 | var aiCommon = require("./activity-indicator-common");
2 | var enums = require("ui/enums");
3 | function onBusyPropertyChanged(data) {
4 | var indicator = data.object;
5 | if (!indicator.android) {
6 | return;
7 | }
8 | if (indicator.visibility === enums.Visibility.visible) {
9 | indicator.android.setVisibility(data.newValue ? android.view.View.VISIBLE : android.view.View.INVISIBLE);
10 | }
11 | }
12 | aiCommon.ActivityIndicator.busyProperty.metadata.onSetNativeValue = onBusyPropertyChanged;
13 | global.moduleMerge(aiCommon, exports);
14 | var ActivityIndicator = (function (_super) {
15 | __extends(ActivityIndicator, _super);
16 | function ActivityIndicator() {
17 | _super.apply(this, arguments);
18 | }
19 | ActivityIndicator.prototype._createUI = function () {
20 | this._android = new android.widget.ProgressBar(this._context);
21 | this._android.setVisibility(android.view.View.INVISIBLE);
22 | this._android.setIndeterminate(true);
23 | };
24 | Object.defineProperty(ActivityIndicator.prototype, "android", {
25 | get: function () {
26 | return this._android;
27 | },
28 | enumerable: true,
29 | configurable: true
30 | });
31 | return ActivityIndicator;
32 | })(aiCommon.ActivityIndicator);
33 | exports.ActivityIndicator = ActivityIndicator;
34 |
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/ui/activity-indicator/activity-indicator.ios.js:
--------------------------------------------------------------------------------
1 | var aiCommon = require("./activity-indicator-common");
2 | function onBusyPropertyChanged(data) {
3 | var indicator = data.object;
4 | if (!indicator.ios) {
5 | return;
6 | }
7 | if (data.newValue) {
8 | indicator.ios.startAnimating();
9 | }
10 | else {
11 | indicator.ios.stopAnimating();
12 | }
13 | }
14 | aiCommon.ActivityIndicator.busyProperty.metadata.onSetNativeValue = onBusyPropertyChanged;
15 | global.moduleMerge(aiCommon, exports);
16 | var ActivityIndicator = (function (_super) {
17 | __extends(ActivityIndicator, _super);
18 | function ActivityIndicator() {
19 | _super.call(this);
20 | this._ios = UIActivityIndicatorView.alloc().initWithActivityIndicatorStyle(UIActivityIndicatorViewStyle.UIActivityIndicatorViewStyleGray);
21 | }
22 | Object.defineProperty(ActivityIndicator.prototype, "ios", {
23 | get: function () {
24 | return this._ios;
25 | },
26 | enumerable: true,
27 | configurable: true
28 | });
29 | return ActivityIndicator;
30 | })(aiCommon.ActivityIndicator);
31 | exports.ActivityIndicator = ActivityIndicator;
32 |
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/ui/activity-indicator/package.json:
--------------------------------------------------------------------------------
1 | { "name" : "activity-indicator",
2 | "main" : "activity-indicator.js" }
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/ui/animation/package.json:
--------------------------------------------------------------------------------
1 | { "name" : "animation",
2 | "main" : "animation.js" }
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/ui/border/border.js:
--------------------------------------------------------------------------------
1 | var contentView = require("ui/content-view");
2 | var viewModule = require("ui/core/view");
3 | var utils = require("utils/utils");
4 | var Border = (function (_super) {
5 | __extends(Border, _super);
6 | function Border() {
7 | _super.apply(this, arguments);
8 | }
9 | Object.defineProperty(Border.prototype, "cornerRadius", {
10 | get: function () {
11 | return this.borderRadius;
12 | },
13 | set: function (value) {
14 | this.borderRadius = value;
15 | },
16 | enumerable: true,
17 | configurable: true
18 | });
19 | Border.prototype.onMeasure = function (widthMeasureSpec, heightMeasureSpec) {
20 | var width = utils.layout.getMeasureSpecSize(widthMeasureSpec);
21 | var widthMode = utils.layout.getMeasureSpecMode(widthMeasureSpec);
22 | var height = utils.layout.getMeasureSpecSize(heightMeasureSpec);
23 | var heightMode = utils.layout.getMeasureSpecMode(heightMeasureSpec);
24 | var density = utils.layout.getDisplayDensity();
25 | var borderSize = (2 * this.borderWidth) * density;
26 | var result = viewModule.View.measureChild(this, this.content, utils.layout.makeMeasureSpec(width - borderSize, widthMode), utils.layout.makeMeasureSpec(height - borderSize, heightMode));
27 | var widthAndState = viewModule.View.resolveSizeAndState(result.measuredWidth + borderSize, width, widthMode, 0);
28 | var heightAndState = viewModule.View.resolveSizeAndState(result.measuredHeight + borderSize, height, heightMode, 0);
29 | this.setMeasuredDimension(widthAndState, heightAndState);
30 | };
31 | Border.prototype.onLayout = function (left, top, right, bottom) {
32 | var density = utils.layout.getDisplayDensity();
33 | var borderSize = this.borderWidth * density;
34 | viewModule.View.layoutChild(this, this.content, borderSize, borderSize, right - left - borderSize, bottom - top - borderSize);
35 | };
36 | Border = __decorate([
37 | Deprecated
38 | ], Border);
39 | return Border;
40 | })(contentView.ContentView);
41 | exports.Border = Border;
42 |
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/ui/border/package.json:
--------------------------------------------------------------------------------
1 | { "name" : "border",
2 | "main" : "border.js" }
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/ui/builder/package.json:
--------------------------------------------------------------------------------
1 | { "name" : "builder",
2 | "main" : "builder.js" }
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/ui/builder/special-properties.js:
--------------------------------------------------------------------------------
1 | var specialProperties = new Map();
2 | function specialPropertyKey(name) {
3 | return name.toLowerCase();
4 | }
5 | function registerSpecialProperty(name, setter) {
6 | var propertyKey = specialPropertyKey(name);
7 | if (specialProperties.has(propertyKey)) {
8 | throw new Error("Property for " + propertyKey + " already registered");
9 | }
10 | else {
11 | specialProperties.set(propertyKey, setter);
12 | }
13 | }
14 | exports.registerSpecialProperty = registerSpecialProperty;
15 | function getSpecialPropertySetter(name) {
16 | var propertyKey = specialPropertyKey(name);
17 | return specialProperties.get(propertyKey);
18 | }
19 | exports.getSpecialPropertySetter = getSpecialPropertySetter;
20 |
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/ui/builder/template-builder.js:
--------------------------------------------------------------------------------
1 | var xml = require("xml");
2 | var KNOWNTEMPLATES = "knownTemplates";
3 | var TemplateBuilder = (function () {
4 | function TemplateBuilder(templateProperty) {
5 | this._items = new Array();
6 | this._templateProperty = templateProperty;
7 | this._nestingLevel = 0;
8 | }
9 | Object.defineProperty(TemplateBuilder.prototype, "elementName", {
10 | get: function () {
11 | return this._templateProperty.elementName;
12 | },
13 | enumerable: true,
14 | configurable: true
15 | });
16 | TemplateBuilder.prototype.handleElement = function (args) {
17 | if (args.eventType === xml.ParserEventType.StartElement) {
18 | this.addStartElement(args.prefix, args.namespace, args.elementName, args.attributes);
19 | }
20 | else if (args.eventType === xml.ParserEventType.EndElement) {
21 | this.addEndElement(args.prefix, args.elementName);
22 | }
23 | if (this.hasFinished()) {
24 | this.build();
25 | return true;
26 | }
27 | else {
28 | return false;
29 | }
30 | };
31 | TemplateBuilder.prototype.addStartElement = function (prefix, namespace, elementName, attributes) {
32 | this._nestingLevel++;
33 | this._items.push("<" +
34 | getElementNameWithPrefix(prefix, elementName) +
35 | (namespace ? " " + getNamespace(prefix, namespace) : "") +
36 | (attributes ? " " + getAttributesAsString(attributes) : "") +
37 | ">");
38 | };
39 | TemplateBuilder.prototype.addEndElement = function (prefix, elementName) {
40 | this._nestingLevel--;
41 | if (!this.hasFinished()) {
42 | this._items.push("" + getElementNameWithPrefix(prefix, elementName) + ">");
43 | }
44 | };
45 | TemplateBuilder.prototype.hasFinished = function () {
46 | return this._nestingLevel < 0;
47 | };
48 | TemplateBuilder.prototype.build = function () {
49 | if (this._templateProperty.name in this._templateProperty.parent.component) {
50 | this._templateProperty.parent.component[this._templateProperty.name] = this._items.join("");
51 | }
52 | };
53 | return TemplateBuilder;
54 | })();
55 | exports.TemplateBuilder = TemplateBuilder;
56 | function isKnownTemplate(name, exports) {
57 | return KNOWNTEMPLATES in exports && exports[KNOWNTEMPLATES] && name in exports[KNOWNTEMPLATES];
58 | }
59 | exports.isKnownTemplate = isKnownTemplate;
60 | function getAttributesAsString(attributes) {
61 | var result = [];
62 | for (var item in attributes) {
63 | result.push(item + '="' + attributes[item] + '"');
64 | }
65 | return result.join(" ");
66 | }
67 | function getElementNameWithPrefix(prefix, elementName) {
68 | return (prefix ? prefix + ":" : "") + elementName;
69 | }
70 | function getNamespace(prefix, namespace) {
71 | return 'xmlns:' + prefix + '="' + namespace + '"';
72 | }
73 |
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/ui/button/button.android.js:
--------------------------------------------------------------------------------
1 | var common = require("./button-common");
2 | global.moduleMerge(common, exports);
3 | var Button = (function (_super) {
4 | __extends(Button, _super);
5 | function Button() {
6 | _super.call(this);
7 | this._isPressed = false;
8 | }
9 | Object.defineProperty(Button.prototype, "android", {
10 | get: function () {
11 | return this._android;
12 | },
13 | enumerable: true,
14 | configurable: true
15 | });
16 | Button.prototype._createUI = function () {
17 | var that = new WeakRef(this);
18 | this._android = new android.widget.Button(this._context);
19 | this._android.setOnClickListener(new android.view.View.OnClickListener({
20 | get owner() {
21 | return that.get();
22 | },
23 | onClick: function (v) {
24 | if (this.owner) {
25 | this.owner._emit(common.Button.tapEvent);
26 | }
27 | }
28 | }));
29 | };
30 | return Button;
31 | })(common.Button);
32 | exports.Button = Button;
33 |
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/ui/button/button.ios.js:
--------------------------------------------------------------------------------
1 | var common = require("./button-common");
2 | var stateChanged = require("ui/core/control-state-change");
3 | var TapHandlerImpl = (function (_super) {
4 | __extends(TapHandlerImpl, _super);
5 | function TapHandlerImpl() {
6 | _super.apply(this, arguments);
7 | }
8 | TapHandlerImpl.new = function () {
9 | return _super.new.call(this);
10 | };
11 | TapHandlerImpl.prototype.initWithOwner = function (owner) {
12 | this._owner = owner;
13 | return this;
14 | };
15 | TapHandlerImpl.prototype.tap = function (args) {
16 | this._owner._emit(common.Button.tapEvent);
17 | };
18 | TapHandlerImpl.ObjCExposedMethods = {
19 | "tap": { returns: interop.types.void, params: [interop.types.id] }
20 | };
21 | return TapHandlerImpl;
22 | })(NSObject);
23 | global.moduleMerge(common, exports);
24 | var Button = (function (_super) {
25 | __extends(Button, _super);
26 | function Button() {
27 | var _this = this;
28 | _super.call(this);
29 | this._ios = UIButton.buttonWithType(UIButtonType.UIButtonTypeSystem);
30 | this._tapHandler = TapHandlerImpl.new().initWithOwner(this);
31 | this._ios.addTargetActionForControlEvents(this._tapHandler, "tap", UIControlEvents.UIControlEventTouchUpInside);
32 | this._stateChangedHandler = new stateChanged.ControlStateChangeListener(this._ios, function (s) {
33 | _this._goToVisualState(s);
34 | });
35 | }
36 | Object.defineProperty(Button.prototype, "ios", {
37 | get: function () {
38 | return this._ios;
39 | },
40 | enumerable: true,
41 | configurable: true
42 | });
43 | return Button;
44 | })(common.Button);
45 | exports.Button = Button;
46 |
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/ui/button/package.json:
--------------------------------------------------------------------------------
1 | { "name" : "button",
2 | "main" : "button.js" }
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/ui/content-view/content-view.js:
--------------------------------------------------------------------------------
1 | var view = require("ui/core/view");
2 | var utils = require("utils/utils");
3 | var ContentView = (function (_super) {
4 | __extends(ContentView, _super);
5 | function ContentView() {
6 | _super.apply(this, arguments);
7 | }
8 | Object.defineProperty(ContentView.prototype, "content", {
9 | get: function () {
10 | return this._content;
11 | },
12 | set: function (value) {
13 | var oldView = this._content;
14 | if (this._content) {
15 | this._removeView(this._content);
16 | }
17 | this._content = value;
18 | if (this._content) {
19 | this._addView(this._content);
20 | }
21 | this._onContentChanged(oldView, value);
22 | },
23 | enumerable: true,
24 | configurable: true
25 | });
26 | Object.defineProperty(ContentView.prototype, "_childrenCount", {
27 | get: function () {
28 | if (this._content) {
29 | return 1;
30 | }
31 | return 0;
32 | },
33 | enumerable: true,
34 | configurable: true
35 | });
36 | ContentView.prototype._onContentChanged = function (oldView, newView) {
37 | };
38 | ContentView.prototype._addChildFromBuilder = function (name, value) {
39 | if (value instanceof view.View) {
40 | this.content = value;
41 | }
42 | };
43 | ContentView.prototype._eachChildView = function (callback) {
44 | if (this._content) {
45 | callback(this._content);
46 | }
47 | };
48 | ContentView.prototype.onMeasure = function (widthMeasureSpec, heightMeasureSpec) {
49 | var result = view.View.measureChild(this, this.content, widthMeasureSpec, heightMeasureSpec);
50 | var width = utils.layout.getMeasureSpecSize(widthMeasureSpec);
51 | var widthMode = utils.layout.getMeasureSpecMode(widthMeasureSpec);
52 | var height = utils.layout.getMeasureSpecSize(heightMeasureSpec);
53 | var heightMode = utils.layout.getMeasureSpecMode(heightMeasureSpec);
54 | var density = utils.layout.getDisplayDensity();
55 | var measureWidth = Math.max(result.measuredWidth, this.minWidth * density);
56 | var measureHeight = Math.max(result.measuredHeight, this.minHeight * density);
57 | var widthAndState = view.View.resolveSizeAndState(measureWidth, width, widthMode, 0);
58 | var heightAndState = view.View.resolveSizeAndState(measureHeight, height, heightMode, 0);
59 | this.setMeasuredDimension(widthAndState, heightAndState);
60 | };
61 | ContentView.prototype.onLayout = function (left, top, right, bottom) {
62 | view.View.layoutChild(this, this.content, 0, 0, right - left, bottom - top);
63 | };
64 | return ContentView;
65 | })(view.CustomLayoutView);
66 | exports.ContentView = ContentView;
67 |
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/ui/content-view/package.json:
--------------------------------------------------------------------------------
1 | { "name" : "content-view",
2 | "main" : "content-view.js" }
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/ui/core/control-state-change.ios.js:
--------------------------------------------------------------------------------
1 | var visualStateConstants = require("ui/styling/visual-state-constants");
2 | var ObserverClass = NSObject.extend({
3 | observeValueForKeyPathOfObjectChangeContext: function (path, obj, change, context) {
4 | if (path === "selected") {
5 | this["_owner"]._onSelectedChanged();
6 | }
7 | else if (path === "enabled") {
8 | this["_owner"]._onEnabledChanged();
9 | }
10 | else if (path === "highlighted") {
11 | this["_owner"]._onHighlightedChanged();
12 | }
13 | }
14 | }, {});
15 | var ControlStateChangeListener = (function () {
16 | function ControlStateChangeListener(control, callback) {
17 | this._observer = ObserverClass.alloc();
18 | this._observer["_owner"] = this;
19 | this._control = control;
20 | this._callback = callback;
21 | }
22 | ControlStateChangeListener.prototype._onEnabledChanged = function () {
23 | this._updateState();
24 | };
25 | ControlStateChangeListener.prototype._onSelectedChanged = function () {
26 | this._updateState();
27 | };
28 | ControlStateChangeListener.prototype._onHighlightedChanged = function () {
29 | this._updateState();
30 | };
31 | ControlStateChangeListener.prototype._updateState = function () {
32 | var state = visualStateConstants.Normal;
33 | if (this._control.highlighted) {
34 | state = visualStateConstants.Pressed;
35 | }
36 | else if (this._control.highlighted) {
37 | }
38 | this._callback(state);
39 | };
40 | return ControlStateChangeListener;
41 | })();
42 | exports.ControlStateChangeListener = ControlStateChangeListener;
43 |
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/ui/date-picker/date-picker-common.js:
--------------------------------------------------------------------------------
1 | var dependencyObservable = require("ui/core/dependency-observable");
2 | var proxy = require("ui/core/proxy");
3 | var view = require("ui/core/view");
4 | var DatePicker = (function (_super) {
5 | __extends(DatePicker, _super);
6 | function DatePicker() {
7 | _super.call(this);
8 | }
9 | Object.defineProperty(DatePicker.prototype, "year", {
10 | get: function () {
11 | return this._getValue(DatePicker.yearProperty);
12 | },
13 | set: function (value) {
14 | this._setValue(DatePicker.yearProperty, value);
15 | },
16 | enumerable: true,
17 | configurable: true
18 | });
19 | Object.defineProperty(DatePicker.prototype, "month", {
20 | get: function () {
21 | return this._getValue(DatePicker.monthProperty);
22 | },
23 | set: function (value) {
24 | this._setValue(DatePicker.monthProperty, value);
25 | },
26 | enumerable: true,
27 | configurable: true
28 | });
29 | Object.defineProperty(DatePicker.prototype, "day", {
30 | get: function () {
31 | return this._getValue(DatePicker.dayProperty);
32 | },
33 | set: function (value) {
34 | this._setValue(DatePicker.dayProperty, value);
35 | },
36 | enumerable: true,
37 | configurable: true
38 | });
39 | Object.defineProperty(DatePicker.prototype, "maxDate", {
40 | get: function () {
41 | return this._getValue(DatePicker.maxDateProperty);
42 | },
43 | set: function (value) {
44 | this._setValue(DatePicker.maxDateProperty, value);
45 | },
46 | enumerable: true,
47 | configurable: true
48 | });
49 | Object.defineProperty(DatePicker.prototype, "minDate", {
50 | get: function () {
51 | return this._getValue(DatePicker.minDateProperty);
52 | },
53 | set: function (value) {
54 | this._setValue(DatePicker.minDateProperty, value);
55 | },
56 | enumerable: true,
57 | configurable: true
58 | });
59 | DatePicker.yearProperty = new dependencyObservable.Property("year", "DatePicker", new proxy.PropertyMetadata(undefined));
60 | DatePicker.monthProperty = new dependencyObservable.Property("month", "DatePicker", new proxy.PropertyMetadata(undefined));
61 | DatePicker.dayProperty = new dependencyObservable.Property("day", "DatePicker", new proxy.PropertyMetadata(undefined));
62 | DatePicker.maxDateProperty = new dependencyObservable.Property("maxDate", "DatePicker", new proxy.PropertyMetadata(undefined));
63 | DatePicker.minDateProperty = new dependencyObservable.Property("minDate", "DatePicker", new proxy.PropertyMetadata(undefined));
64 | return DatePicker;
65 | })(view.View);
66 | exports.DatePicker = DatePicker;
67 |
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/ui/date-picker/package.json:
--------------------------------------------------------------------------------
1 | { "name" : "date-picker",
2 | "main" : "date-picker.js" }
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/ui/dialogs/dialogs-common.js:
--------------------------------------------------------------------------------
1 | exports.STRING = "string", exports.PROMPT = "Prompt", exports.CONFIRM = "Confirm", exports.ALERT = "Alert", exports.LOGIN = "Login", exports.OK = "OK", exports.CANCEL = "Cancel";
2 | var inputType;
3 | (function (inputType) {
4 | inputType.text = "text";
5 | inputType.password = "password";
6 | })(inputType = exports.inputType || (exports.inputType = {}));
7 |
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/ui/dialogs/package.json:
--------------------------------------------------------------------------------
1 | { "name" : "dialogs",
2 | "main" : "dialogs.js" }
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/ui/editable-text-base/package.json:
--------------------------------------------------------------------------------
1 | { "name" : "editable-text-base",
2 | "main" : "editable-text-base.js" }
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/ui/enums/package.json:
--------------------------------------------------------------------------------
1 | { "name" : "enums",
2 | "main" : "enums.js" }
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/ui/frame/package.json:
--------------------------------------------------------------------------------
1 | { "name" : "frame",
2 | "main" : "frame.js" }
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/ui/gestures/package.json:
--------------------------------------------------------------------------------
1 | { "name" : "gestures",
2 | "main" : "gestures.js" }
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/ui/html-view/html-view-common.js:
--------------------------------------------------------------------------------
1 | var dependencyObservable = require("ui/core/dependency-observable");
2 | var proxy = require("ui/core/proxy");
3 | var view = require("ui/core/view");
4 | var HtmlView = (function (_super) {
5 | __extends(HtmlView, _super);
6 | function HtmlView(options) {
7 | _super.call(this, options);
8 | }
9 | Object.defineProperty(HtmlView.prototype, "html", {
10 | get: function () {
11 | return this._getValue(HtmlView.htmlProperty);
12 | },
13 | set: function (value) {
14 | this._setValue(HtmlView.htmlProperty, value);
15 | },
16 | enumerable: true,
17 | configurable: true
18 | });
19 | HtmlView.htmlProperty = new dependencyObservable.Property("html", "HtmlView", new proxy.PropertyMetadata(false, dependencyObservable.PropertyMetadataSettings.AffectsLayout));
20 | return HtmlView;
21 | })(view.View);
22 | exports.HtmlView = HtmlView;
23 |
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/ui/html-view/html-view.android.js:
--------------------------------------------------------------------------------
1 | var common = require("./html-view-common");
2 | var types = require("utils/types");
3 | function onHtmlPropertyChanged(data) {
4 | var view = data.object;
5 | if (!view.android) {
6 | return;
7 | }
8 | if (types.isString(data.newValue)) {
9 | var mask = 15;
10 | if (data.newValue.search(/= 0) {
11 | mask = 0;
12 | }
13 | view.android.setAutoLinkMask(mask);
14 | view.android.setText(android.text.Html.fromHtml(data.newValue));
15 | }
16 | else {
17 | view.android.setText("");
18 | }
19 | }
20 | common.HtmlView.htmlProperty.metadata.onSetNativeValue = onHtmlPropertyChanged;
21 | global.moduleMerge(common, exports);
22 | var HtmlView = (function (_super) {
23 | __extends(HtmlView, _super);
24 | function HtmlView() {
25 | _super.apply(this, arguments);
26 | }
27 | Object.defineProperty(HtmlView.prototype, "android", {
28 | get: function () {
29 | return this._android;
30 | },
31 | enumerable: true,
32 | configurable: true
33 | });
34 | HtmlView.prototype._createUI = function () {
35 | this._android = new android.widget.TextView(this._context);
36 | this._android.setLinksClickable(true);
37 | this._android.setMovementMethod(android.text.method.LinkMovementMethod.getInstance());
38 | };
39 | return HtmlView;
40 | })(common.HtmlView);
41 | exports.HtmlView = HtmlView;
42 |
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/ui/html-view/package.json:
--------------------------------------------------------------------------------
1 | { "name" : "html-view",
2 | "main" : "html-view.js" }
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/ui/image-cache/image-cache.android.js:
--------------------------------------------------------------------------------
1 | var common = require("./image-cache-common");
2 | var LruBitmapCache = (function (_super) {
3 | __extends(LruBitmapCache, _super);
4 | function LruBitmapCache(cacheSize) {
5 | _super.call(this, cacheSize);
6 | return global.__native(this);
7 | }
8 | LruBitmapCache.prototype.sizeOf = function (key, bitmap) {
9 | var result = Math.round(bitmap.getByteCount() / 1024);
10 | return result;
11 | };
12 | return LruBitmapCache;
13 | })(android.util.LruCache);
14 | ;
15 | var Cache = (function (_super) {
16 | __extends(Cache, _super);
17 | function Cache() {
18 | _super.call(this);
19 | var maxMemory = java.lang.Runtime.getRuntime().maxMemory() / 1024;
20 | var cacheSize = maxMemory / 8;
21 | this._cache = new LruBitmapCache(cacheSize);
22 | var that = new WeakRef(this);
23 | this._callback = new com.tns.Async.CompleteCallback({
24 | onComplete: function (result, context) {
25 | var instance = that.get();
26 | if (instance) {
27 | instance._onDownloadCompleted(context, result);
28 | }
29 | }
30 | });
31 | }
32 | Cache.prototype._downloadCore = function (request) {
33 | com.tns.Async.DownloadImage(request.url, this._callback, request.key);
34 | };
35 | Cache.prototype.get = function (key) {
36 | var result = this._cache.get(key);
37 | return result;
38 | };
39 | Cache.prototype.set = function (key, image) {
40 | this._cache.put(key, image);
41 | };
42 | Cache.prototype.remove = function (key) {
43 | this._cache.remove(key);
44 | };
45 | Cache.prototype.clear = function () {
46 | this._cache.evictAll();
47 | };
48 | return Cache;
49 | })(common.Cache);
50 | exports.Cache = Cache;
51 |
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/ui/image-cache/image-cache.ios.js:
--------------------------------------------------------------------------------
1 | var common = require("./image-cache-common");
2 | var httpRequest = require("http/http-request");
3 | var utils = require("utils/utils");
4 | var trace = require("trace");
5 | var MemmoryWarningHandler = (function (_super) {
6 | __extends(MemmoryWarningHandler, _super);
7 | function MemmoryWarningHandler() {
8 | _super.apply(this, arguments);
9 | }
10 | MemmoryWarningHandler.new = function () {
11 | return _super.new.call(this);
12 | };
13 | MemmoryWarningHandler.prototype.initWithCache = function (cache) {
14 | this._cache = cache;
15 | NSNotificationCenter.defaultCenter().addObserverSelectorNameObject(this, "clearCache", "UIApplicationDidReceiveMemoryWarningNotification", null);
16 | trace.write("[MemmoryWarningHandler] Added low memory observer.", trace.categories.Debug);
17 | return this;
18 | };
19 | MemmoryWarningHandler.prototype.dealloc = function () {
20 | NSNotificationCenter.defaultCenter().removeObserverNameObject(this, "UIApplicationDidReceiveMemoryWarningNotification", null);
21 | trace.write("[MemmoryWarningHandler] Removed low memory observer.", trace.categories.Debug);
22 | _super.prototype.dealloc.call(this);
23 | };
24 | MemmoryWarningHandler.prototype.clearCache = function () {
25 | trace.write("[MemmoryWarningHandler] Clearing Image Cache.", trace.categories.Debug);
26 | this._cache.removeAllObjects();
27 | utils.GC();
28 | };
29 | MemmoryWarningHandler.ObjCExposedMethods = {
30 | "clearCache": { returns: interop.types.void, params: [] }
31 | };
32 | return MemmoryWarningHandler;
33 | })(NSObject);
34 | var Cache = (function (_super) {
35 | __extends(Cache, _super);
36 | function Cache() {
37 | _super.call(this);
38 | this._cache = new NSCache();
39 | this._memoryWarningHandler = MemmoryWarningHandler.new().initWithCache(this._cache);
40 | }
41 | Cache.prototype._downloadCore = function (request) {
42 | var that = this;
43 | httpRequest.request({ url: request.url, method: "GET" })
44 | .then(function (response) {
45 | var image = UIImage.alloc().initWithData(response.content.raw);
46 | that._onDownloadCompleted(request.key, image);
47 | });
48 | };
49 | Cache.prototype.get = function (key) {
50 | return this._cache.objectForKey(key);
51 | };
52 | Cache.prototype.set = function (key, image) {
53 | this._cache.setObjectForKey(image, key);
54 | };
55 | Cache.prototype.remove = function (key) {
56 | this._cache.removeObjectForKey(key);
57 | };
58 | Cache.prototype.clear = function () {
59 | this._cache.removeAllObjects();
60 | utils.GC();
61 | };
62 | return Cache;
63 | })(common.Cache);
64 | exports.Cache = Cache;
65 |
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/ui/image-cache/package.json:
--------------------------------------------------------------------------------
1 | { "name" : "image-cache",
2 | "main" : "image-cache.js" }
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/ui/image/image.android.js:
--------------------------------------------------------------------------------
1 | var imageCommon = require("./image-common");
2 | var enums = require("ui/enums");
3 | global.moduleMerge(imageCommon, exports);
4 | function onStretchPropertyChanged(data) {
5 | var image = data.object;
6 | if (!image.android) {
7 | return;
8 | }
9 | switch (data.newValue) {
10 | case enums.Stretch.aspectFit:
11 | image.android.setScaleType(android.widget.ImageView.ScaleType.FIT_CENTER);
12 | break;
13 | case enums.Stretch.aspectFill:
14 | image.android.setScaleType(android.widget.ImageView.ScaleType.CENTER_CROP);
15 | break;
16 | case enums.Stretch.fill:
17 | image.android.setScaleType(android.widget.ImageView.ScaleType.FIT_XY);
18 | break;
19 | case enums.Stretch.none:
20 | default:
21 | image.android.setScaleType(android.widget.ImageView.ScaleType.MATRIX);
22 | break;
23 | }
24 | }
25 | function onImageSourcePropertyChanged(data) {
26 | var image = data.object;
27 | if (!image.android) {
28 | return;
29 | }
30 | image._setNativeImage(data.newValue ? data.newValue.android : null);
31 | }
32 | imageCommon.Image.imageSourceProperty.metadata.onSetNativeValue = onImageSourcePropertyChanged;
33 | imageCommon.Image.stretchProperty.metadata.onSetNativeValue = onStretchPropertyChanged;
34 | var Image = (function (_super) {
35 | __extends(Image, _super);
36 | function Image() {
37 | _super.apply(this, arguments);
38 | }
39 | Object.defineProperty(Image.prototype, "android", {
40 | get: function () {
41 | return this._android;
42 | },
43 | enumerable: true,
44 | configurable: true
45 | });
46 | Image.prototype._createUI = function () {
47 | this._android = new org.nativescript.widgets.ImageView(this._context);
48 | };
49 | Image.prototype._setNativeImage = function (nativeImage) {
50 | this.android.setImageBitmap(nativeImage);
51 | };
52 | return Image;
53 | })(imageCommon.Image);
54 | exports.Image = Image;
55 |
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/ui/image/package.json:
--------------------------------------------------------------------------------
1 | { "name" : "image",
2 | "main" : "image.js" }
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/ui/label/label-common.js:
--------------------------------------------------------------------------------
1 | var dependencyObservable = require("ui/core/dependency-observable");
2 | var proxy = require("ui/core/proxy");
3 | var textBase = require("ui/text-base");
4 | var Label = (function (_super) {
5 | __extends(Label, _super);
6 | function Label(options) {
7 | _super.call(this, options);
8 | }
9 | Object.defineProperty(Label.prototype, "textWrap", {
10 | get: function () {
11 | return this._getValue(Label.textWrapProperty);
12 | },
13 | set: function (value) {
14 | this._setValue(Label.textWrapProperty, value);
15 | },
16 | enumerable: true,
17 | configurable: true
18 | });
19 | Label.textWrapProperty = new dependencyObservable.Property("textWrap", "Label", new proxy.PropertyMetadata(false, dependencyObservable.PropertyMetadataSettings.AffectsLayout));
20 | return Label;
21 | })(textBase.TextBase);
22 | exports.Label = Label;
23 |
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/ui/label/label.android.js:
--------------------------------------------------------------------------------
1 | var common = require("./label-common");
2 | function onTextWrapPropertyChanged(data) {
3 | var label = data.object;
4 | if (!label.android) {
5 | return;
6 | }
7 | if (data.newValue) {
8 | label.android.setSingleLine(false);
9 | label.android.setEllipsize(null);
10 | }
11 | else {
12 | label.android.setSingleLine(true);
13 | label.android.setEllipsize(android.text.TextUtils.TruncateAt.END);
14 | }
15 | }
16 | common.Label.textWrapProperty.metadata.onSetNativeValue = onTextWrapPropertyChanged;
17 | global.moduleMerge(common, exports);
18 | var Label = (function (_super) {
19 | __extends(Label, _super);
20 | function Label() {
21 | _super.apply(this, arguments);
22 | }
23 | Object.defineProperty(Label.prototype, "android", {
24 | get: function () {
25 | return this._android;
26 | },
27 | enumerable: true,
28 | configurable: true
29 | });
30 | Label.prototype._createUI = function () {
31 | this._android = new android.widget.TextView(this._context);
32 | this._android.setSingleLine(true);
33 | this._android.setEllipsize(android.text.TextUtils.TruncateAt.END);
34 | };
35 | return Label;
36 | })(common.Label);
37 | exports.Label = Label;
38 |
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/ui/label/package.json:
--------------------------------------------------------------------------------
1 | { "name" : "label",
2 | "main" : "label.js" }
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/ui/layouts/absolute-layout/absolute-layout-common.js:
--------------------------------------------------------------------------------
1 | var layouts = require("ui/layouts/layout-base");
2 | var dependencyObservable = require("ui/core/dependency-observable");
3 | var view = require("ui/core/view");
4 | var proxy = require("ui/core/proxy");
5 | var special_properties_1 = require("ui/builder/special-properties");
6 | function validateArgs(element) {
7 | if (!element) {
8 | throw new Error("element cannot be null or undefinied.");
9 | }
10 | return element;
11 | }
12 | special_properties_1.registerSpecialProperty("left", function (instance, propertyValue) {
13 | AbsoluteLayout.setLeft(instance, !isNaN(+propertyValue) && +propertyValue);
14 | });
15 | special_properties_1.registerSpecialProperty("top", function (instance, propertyValue) {
16 | AbsoluteLayout.setTop(instance, !isNaN(+propertyValue) && +propertyValue);
17 | });
18 | var AbsoluteLayout = (function (_super) {
19 | __extends(AbsoluteLayout, _super);
20 | function AbsoluteLayout() {
21 | _super.apply(this, arguments);
22 | }
23 | AbsoluteLayout.isValid = function (value) {
24 | return isFinite(value);
25 | };
26 | AbsoluteLayout.onLeftPropertyChanged = function (data) {
27 | var uiView = data.object;
28 | if (uiView instanceof view.View) {
29 | var layout = uiView.parent;
30 | if (layout instanceof AbsoluteLayout) {
31 | layout.onLeftChanged(uiView, data.oldValue, data.newValue);
32 | }
33 | }
34 | };
35 | AbsoluteLayout.onTopPropertyChanged = function (data) {
36 | var uiView = data.object;
37 | if (uiView instanceof view.View) {
38 | var layout = uiView.parent;
39 | if (layout instanceof AbsoluteLayout) {
40 | layout.onTopChanged(uiView, data.oldValue, data.newValue);
41 | }
42 | }
43 | };
44 | AbsoluteLayout.getLeft = function (element) {
45 | return validateArgs(element)._getValue(AbsoluteLayout.leftProperty);
46 | };
47 | AbsoluteLayout.setLeft = function (element, value) {
48 | validateArgs(element)._setValue(AbsoluteLayout.leftProperty, value);
49 | };
50 | AbsoluteLayout.getTop = function (element) {
51 | return validateArgs(element)._getValue(AbsoluteLayout.topProperty);
52 | };
53 | AbsoluteLayout.setTop = function (element, value) {
54 | validateArgs(element)._setValue(AbsoluteLayout.topProperty, value);
55 | };
56 | AbsoluteLayout.prototype.onLeftChanged = function (view, oldValue, newValue) {
57 | };
58 | AbsoluteLayout.prototype.onTopChanged = function (view, oldValue, newValue) {
59 | };
60 | AbsoluteLayout.leftProperty = new dependencyObservable.Property("left", "AbsoluteLayout", new proxy.PropertyMetadata(0, undefined, AbsoluteLayout.onLeftPropertyChanged, AbsoluteLayout.isValid));
61 | AbsoluteLayout.topProperty = new dependencyObservable.Property("top", "AbsoluteLayout", new proxy.PropertyMetadata(0, undefined, AbsoluteLayout.onTopPropertyChanged, AbsoluteLayout.isValid));
62 | return AbsoluteLayout;
63 | })(layouts.LayoutBase);
64 | exports.AbsoluteLayout = AbsoluteLayout;
65 |
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/ui/layouts/absolute-layout/absolute-layout.android.js:
--------------------------------------------------------------------------------
1 | var utils = require("utils/utils");
2 | var view = require("ui/core/view");
3 | var common = require("./absolute-layout-common");
4 | global.moduleMerge(common, exports);
5 | function setNativeProperty(data, setter) {
6 | var uiView = data.object;
7 | if (uiView instanceof view.View) {
8 | var nativeView = uiView._nativeView;
9 | var lp = nativeView.getLayoutParams();
10 | if (!(lp instanceof org.nativescript.widgets.CommonLayoutParams)) {
11 | lp = new org.nativescript.widgets.CommonLayoutParams();
12 | }
13 | setter(lp);
14 | nativeView.setLayoutParams(lp);
15 | }
16 | }
17 | function setNativeLeftProperty(data) {
18 | setNativeProperty(data, function (lp) { lp.left = data.newValue * utils.layout.getDisplayDensity(); });
19 | }
20 | function setNativeTopProperty(data) {
21 | setNativeProperty(data, function (lp) { lp.top = data.newValue * utils.layout.getDisplayDensity(); });
22 | }
23 | common.AbsoluteLayout.leftProperty.metadata.onSetNativeValue = setNativeLeftProperty;
24 | common.AbsoluteLayout.topProperty.metadata.onSetNativeValue = setNativeTopProperty;
25 | var AbsoluteLayout = (function (_super) {
26 | __extends(AbsoluteLayout, _super);
27 | function AbsoluteLayout() {
28 | _super.apply(this, arguments);
29 | }
30 | Object.defineProperty(AbsoluteLayout.prototype, "android", {
31 | get: function () {
32 | return this._layout;
33 | },
34 | enumerable: true,
35 | configurable: true
36 | });
37 | Object.defineProperty(AbsoluteLayout.prototype, "_nativeView", {
38 | get: function () {
39 | return this._layout;
40 | },
41 | enumerable: true,
42 | configurable: true
43 | });
44 | AbsoluteLayout.prototype._createUI = function () {
45 | this._layout = new org.nativescript.widgets.AbsoluteLayout(this._context);
46 | };
47 | return AbsoluteLayout;
48 | })(common.AbsoluteLayout);
49 | exports.AbsoluteLayout = AbsoluteLayout;
50 |
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/ui/layouts/absolute-layout/package.json:
--------------------------------------------------------------------------------
1 | { "name" : "absolute-layout",
2 | "main" : "absolute-layout.js" }
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/ui/layouts/dock-layout/dock-layout-common.js:
--------------------------------------------------------------------------------
1 | var layouts = require("ui/layouts/layout-base");
2 | var dependencyObservable = require("ui/core/dependency-observable");
3 | var view = require("ui/core/view");
4 | var enums = require("ui/enums");
5 | var proxy = require("ui/core/proxy");
6 | var special_properties_1 = require("ui/builder/special-properties");
7 | var AffectsLayout = global.android ? dependencyObservable.PropertyMetadataSettings.None : dependencyObservable.PropertyMetadataSettings.AffectsLayout;
8 | function isDockValid(value) {
9 | return value === enums.Dock.left || value === enums.Dock.top || value === enums.Dock.right || value === enums.Dock.bottom;
10 | }
11 | function validateArgs(element) {
12 | if (!element) {
13 | throw new Error("element cannot be null or undefinied.");
14 | }
15 | return element;
16 | }
17 | special_properties_1.registerSpecialProperty("dock", function (instance, propertyValue) {
18 | DockLayout.setDock(instance, propertyValue);
19 | });
20 | var DockLayout = (function (_super) {
21 | __extends(DockLayout, _super);
22 | function DockLayout() {
23 | _super.apply(this, arguments);
24 | }
25 | DockLayout.onDockPropertyChanged = function (data) {
26 | var uiView = data.object;
27 | if (uiView instanceof view.View) {
28 | var layout = uiView.parent;
29 | if (layout instanceof DockLayout) {
30 | layout.onDockChanged(uiView, data.oldValue, data.newValue);
31 | }
32 | }
33 | };
34 | DockLayout.getDock = function (element) {
35 | return validateArgs(element)._getValue(DockLayout.dockProperty);
36 | };
37 | DockLayout.setDock = function (element, value) {
38 | validateArgs(element)._setValue(DockLayout.dockProperty, value);
39 | };
40 | Object.defineProperty(DockLayout.prototype, "stretchLastChild", {
41 | get: function () {
42 | return this._getValue(DockLayout.stretchLastChildProperty);
43 | },
44 | set: function (value) {
45 | this._setValue(DockLayout.stretchLastChildProperty, value);
46 | },
47 | enumerable: true,
48 | configurable: true
49 | });
50 | DockLayout.prototype.onDockChanged = function (view, oldValue, newValue) {
51 | };
52 | DockLayout.dockProperty = new dependencyObservable.Property("dock", "DockLayout", new proxy.PropertyMetadata(enums.Dock.left, undefined, DockLayout.onDockPropertyChanged, isDockValid));
53 | DockLayout.stretchLastChildProperty = new dependencyObservable.Property("stretchLastChild", "DockLayout", new proxy.PropertyMetadata(true, AffectsLayout));
54 | return DockLayout;
55 | })(layouts.LayoutBase);
56 | exports.DockLayout = DockLayout;
57 |
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/ui/layouts/dock-layout/dock-layout.android.js:
--------------------------------------------------------------------------------
1 | var view = require("ui/core/view");
2 | var enums = require("ui/enums");
3 | var common = require("./dock-layout-common");
4 | global.moduleMerge(common, exports);
5 | function setNativeDockProperty(data) {
6 | var uiView = data.object;
7 | if (uiView instanceof view.View) {
8 | var nativeView = uiView._nativeView;
9 | var lp = nativeView.getLayoutParams();
10 | if (!(lp instanceof org.nativescript.widgets.CommonLayoutParams)) {
11 | lp = new org.nativescript.widgets.CommonLayoutParams();
12 | }
13 | switch (data.newValue) {
14 | case enums.Dock.left:
15 | lp.dock = org.nativescript.widgets.Dock.left;
16 | break;
17 | case enums.Dock.top:
18 | lp.dock = org.nativescript.widgets.Dock.top;
19 | break;
20 | case enums.Dock.right:
21 | lp.dock = org.nativescript.widgets.Dock.right;
22 | break;
23 | case enums.Dock.bottom:
24 | lp.dock = org.nativescript.widgets.Dock.bottom;
25 | break;
26 | default:
27 | throw new Error("Invalid dock value: " + data.newValue + " on element: " + uiView);
28 | }
29 | nativeView.setLayoutParams(lp);
30 | }
31 | }
32 | common.DockLayout.dockProperty.metadata.onSetNativeValue = setNativeDockProperty;
33 | var DockLayout = (function (_super) {
34 | __extends(DockLayout, _super);
35 | function DockLayout() {
36 | _super.apply(this, arguments);
37 | }
38 | DockLayout.setNativeStretchLastChildProperty = function (data) {
39 | var dockLayout = data.object;
40 | var nativeView = dockLayout._nativeView;
41 | nativeView.setStretchLastChild(data.newValue);
42 | };
43 | Object.defineProperty(DockLayout.prototype, "android", {
44 | get: function () {
45 | return this._layout;
46 | },
47 | enumerable: true,
48 | configurable: true
49 | });
50 | Object.defineProperty(DockLayout.prototype, "_nativeView", {
51 | get: function () {
52 | return this._layout;
53 | },
54 | enumerable: true,
55 | configurable: true
56 | });
57 | DockLayout.prototype._createUI = function () {
58 | this._layout = new org.nativescript.widgets.DockLayout(this._context);
59 | };
60 | return DockLayout;
61 | })(common.DockLayout);
62 | exports.DockLayout = DockLayout;
63 | common.DockLayout.stretchLastChildProperty.metadata.onSetNativeValue = DockLayout.setNativeStretchLastChildProperty;
64 |
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/ui/layouts/dock-layout/package.json:
--------------------------------------------------------------------------------
1 | { "name" : "dock-layout",
2 | "main" : "dock-layout.js" }
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/ui/layouts/grid-layout/package.json:
--------------------------------------------------------------------------------
1 | { "name" : "grid-layout",
2 | "main" : "grid-layout.js" }
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/ui/layouts/layout.android.js:
--------------------------------------------------------------------------------
1 | var view = require("ui/core/view");
2 | var layoutBase = require("ui/layouts/layout-base");
3 | var trace = require("trace");
4 | var utils = require("utils/utils");
5 | var OWNER = "_owner";
6 | var Layout = (function (_super) {
7 | __extends(Layout, _super);
8 | function Layout() {
9 | _super.apply(this, arguments);
10 | }
11 | Object.defineProperty(Layout.prototype, "android", {
12 | get: function () {
13 | return this._viewGroup;
14 | },
15 | enumerable: true,
16 | configurable: true
17 | });
18 | Object.defineProperty(Layout.prototype, "_nativeView", {
19 | get: function () {
20 | return this._viewGroup;
21 | },
22 | enumerable: true,
23 | configurable: true
24 | });
25 | Layout.prototype._createUI = function () {
26 | this._viewGroup = new view.NativeViewGroup(this._context);
27 | this._viewGroup[OWNER] = this;
28 | };
29 | Layout.prototype._onDetached = function (force) {
30 | delete this._viewGroup[OWNER];
31 | _super.prototype._onDetached.call(this, force);
32 | };
33 | Layout.prototype.measure = function (widthMeasureSpec, heightMeasureSpec) {
34 | this._setCurrentMeasureSpecs(widthMeasureSpec, heightMeasureSpec);
35 | var view = this._nativeView;
36 | if (view) {
37 | var width = utils.layout.getMeasureSpecSize(widthMeasureSpec);
38 | var widthMode = utils.layout.getMeasureSpecMode(widthMeasureSpec);
39 | var height = utils.layout.getMeasureSpecSize(heightMeasureSpec);
40 | var heightMode = utils.layout.getMeasureSpecMode(heightMeasureSpec);
41 | trace.write(this + " :measure: " + utils.layout.getMode(widthMode) + " " + width + ", " + utils.layout.getMode(heightMode) + " " + height, trace.categories.Layout);
42 | view.measure(widthMeasureSpec, heightMeasureSpec);
43 | }
44 | };
45 | Layout.prototype.layout = function (left, top, right, bottom) {
46 | this._setCurrentLayoutBounds(left, top, right, bottom);
47 | var view = this._nativeView;
48 | if (view) {
49 | this.layoutNativeView(left, top, right, bottom);
50 | trace.write(this + " :layout: " + left + ", " + top + ", " + (right - left) + ", " + (bottom - top), trace.categories.Layout);
51 | }
52 | };
53 | Layout.prototype.onMeasure = function (widthMeasureSpec, heightMeasureSpec) {
54 | };
55 | Layout.prototype.onLayout = function (left, top, right, bottom) {
56 | };
57 | return Layout;
58 | })(layoutBase.LayoutBase);
59 | exports.Layout = Layout;
60 |
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/ui/layouts/layout.ios.js:
--------------------------------------------------------------------------------
1 | var layoutBase = require("ui/layouts/layout-base");
2 | var Layout = (function (_super) {
3 | __extends(Layout, _super);
4 | function Layout() {
5 | _super.call(this);
6 | this._view = new UIView();
7 | }
8 | Object.defineProperty(Layout.prototype, "ios", {
9 | get: function () {
10 | return this._view;
11 | },
12 | enumerable: true,
13 | configurable: true
14 | });
15 | Object.defineProperty(Layout.prototype, "_nativeView", {
16 | get: function () {
17 | return this._view;
18 | },
19 | enumerable: true,
20 | configurable: true
21 | });
22 | Layout.prototype.onMeasure = function (widthMeasureSpec, heightMeasureSpec) {
23 | };
24 | return Layout;
25 | })(layoutBase.LayoutBase);
26 | exports.Layout = Layout;
27 |
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/ui/layouts/stack-layout/package.json:
--------------------------------------------------------------------------------
1 | { "name" : "stack-layout",
2 | "main" : "stack-layout.js" }
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/ui/layouts/stack-layout/stack-layout-common.js:
--------------------------------------------------------------------------------
1 | var layouts = require("ui/layouts/layout-base");
2 | var dependencyObservable = require("ui/core/dependency-observable");
3 | var enums = require("ui/enums");
4 | var proxy = require("ui/core/proxy");
5 | var AffectsLayout = global.android ? dependencyObservable.PropertyMetadataSettings.None : dependencyObservable.PropertyMetadataSettings.AffectsLayout;
6 | function validateOrientation(value) {
7 | return value === enums.Orientation.vertical || value === enums.Orientation.horizontal;
8 | }
9 | var StackLayout = (function (_super) {
10 | __extends(StackLayout, _super);
11 | function StackLayout() {
12 | _super.apply(this, arguments);
13 | }
14 | Object.defineProperty(StackLayout.prototype, "orientation", {
15 | get: function () {
16 | return this._getValue(StackLayout.orientationProperty);
17 | },
18 | set: function (value) {
19 | this._setValue(StackLayout.orientationProperty, value);
20 | },
21 | enumerable: true,
22 | configurable: true
23 | });
24 | StackLayout.orientationProperty = new dependencyObservable.Property("orientation", "StackLayout", new proxy.PropertyMetadata(enums.Orientation.vertical, AffectsLayout, undefined, validateOrientation));
25 | return StackLayout;
26 | })(layouts.LayoutBase);
27 | exports.StackLayout = StackLayout;
28 |
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/ui/layouts/stack-layout/stack-layout.android.js:
--------------------------------------------------------------------------------
1 | var common = require("./stack-layout-common");
2 | var enums = require("ui/enums");
3 | global.moduleMerge(common, exports);
4 | var StackLayout = (function (_super) {
5 | __extends(StackLayout, _super);
6 | function StackLayout() {
7 | _super.apply(this, arguments);
8 | }
9 | StackLayout.setNativeOrientationProperty = function (data) {
10 | var stackLayout = data.object;
11 | var nativeView = stackLayout._nativeView;
12 | nativeView.setOrientation(data.newValue === enums.Orientation.vertical ? org.nativescript.widgets.Orientation.vertical : org.nativescript.widgets.Orientation.horzontal);
13 | };
14 | Object.defineProperty(StackLayout.prototype, "android", {
15 | get: function () {
16 | return this._layout;
17 | },
18 | enumerable: true,
19 | configurable: true
20 | });
21 | Object.defineProperty(StackLayout.prototype, "_nativeView", {
22 | get: function () {
23 | return this._layout;
24 | },
25 | enumerable: true,
26 | configurable: true
27 | });
28 | StackLayout.prototype._createUI = function () {
29 | this._layout = new org.nativescript.widgets.StackLayout(this._context);
30 | };
31 | return StackLayout;
32 | })(common.StackLayout);
33 | exports.StackLayout = StackLayout;
34 | common.StackLayout.orientationProperty.metadata.onSetNativeValue = StackLayout.setNativeOrientationProperty;
35 |
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/ui/layouts/wrap-layout/package.json:
--------------------------------------------------------------------------------
1 | { "name" : "wrap-layout",
2 | "main" : "wrap-layout.js" }
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/ui/layouts/wrap-layout/wrap-layout-common.js:
--------------------------------------------------------------------------------
1 | var layouts = require("ui/layouts/layout-base");
2 | var dependencyObservable = require("ui/core/dependency-observable");
3 | var enums = require("ui/enums");
4 | var proxy = require("ui/core/proxy");
5 | var AffectsLayout = global.android ? dependencyObservable.PropertyMetadataSettings.None : dependencyObservable.PropertyMetadataSettings.AffectsLayout;
6 | function isWidthHeightValid(value) {
7 | return (value >= 0.0 && value !== Number.POSITIVE_INFINITY);
8 | }
9 | function isValidOrientation(value) {
10 | return value === enums.Orientation.vertical || value === enums.Orientation.horizontal;
11 | }
12 | var WrapLayout = (function (_super) {
13 | __extends(WrapLayout, _super);
14 | function WrapLayout() {
15 | _super.apply(this, arguments);
16 | }
17 | Object.defineProperty(WrapLayout.prototype, "orientation", {
18 | get: function () {
19 | return this._getValue(WrapLayout.orientationProperty);
20 | },
21 | set: function (value) {
22 | this._setValue(WrapLayout.orientationProperty, value);
23 | },
24 | enumerable: true,
25 | configurable: true
26 | });
27 | Object.defineProperty(WrapLayout.prototype, "itemWidth", {
28 | get: function () {
29 | return this._getValue(WrapLayout.itemWidthProperty);
30 | },
31 | set: function (value) {
32 | this._setValue(WrapLayout.itemWidthProperty, value);
33 | },
34 | enumerable: true,
35 | configurable: true
36 | });
37 | Object.defineProperty(WrapLayout.prototype, "itemHeight", {
38 | get: function () {
39 | return this._getValue(WrapLayout.itemHeightProperty);
40 | },
41 | set: function (value) {
42 | this._setValue(WrapLayout.itemHeightProperty, value);
43 | },
44 | enumerable: true,
45 | configurable: true
46 | });
47 | WrapLayout.orientationProperty = new dependencyObservable.Property("orientation", "WrapLayout", new proxy.PropertyMetadata(enums.Orientation.horizontal, AffectsLayout, undefined, isValidOrientation));
48 | WrapLayout.itemWidthProperty = new dependencyObservable.Property("itemWidth", "WrapLayout", new proxy.PropertyMetadata(0, AffectsLayout, undefined, isWidthHeightValid));
49 | WrapLayout.itemHeightProperty = new dependencyObservable.Property("itemHeight", "WrapLayout", new proxy.PropertyMetadata(0, AffectsLayout, undefined, isWidthHeightValid));
50 | return WrapLayout;
51 | })(layouts.LayoutBase);
52 | exports.WrapLayout = WrapLayout;
53 |
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/ui/layouts/wrap-layout/wrap-layout.android.js:
--------------------------------------------------------------------------------
1 | var common = require("./wrap-layout-common");
2 | var enums = require("ui/enums");
3 | var utils = require("utils/utils");
4 | global.moduleMerge(common, exports);
5 | var WrapLayout = (function (_super) {
6 | __extends(WrapLayout, _super);
7 | function WrapLayout() {
8 | _super.apply(this, arguments);
9 | }
10 | WrapLayout.setNativeOrientationProperty = function (data) {
11 | var wrapLayout = data.object;
12 | var nativeView = wrapLayout._nativeView;
13 | nativeView.setOrientation(data.newValue === enums.Orientation.vertical ? org.nativescript.widgets.Orientation.vertical : org.nativescript.widgets.Orientation.horzontal);
14 | };
15 | WrapLayout.setNativeItemWidthProperty = function (data) {
16 | var wrapLayout = data.object;
17 | var nativeView = wrapLayout._nativeView;
18 | nativeView.setItemWidth(data.newValue * utils.layout.getDisplayDensity());
19 | };
20 | WrapLayout.setNativeItemHeightProperty = function (data) {
21 | var wrapLayout = data.object;
22 | var nativeView = wrapLayout._nativeView;
23 | nativeView.setItemHeight(data.newValue * utils.layout.getDisplayDensity());
24 | };
25 | Object.defineProperty(WrapLayout.prototype, "android", {
26 | get: function () {
27 | return this._layout;
28 | },
29 | enumerable: true,
30 | configurable: true
31 | });
32 | Object.defineProperty(WrapLayout.prototype, "_nativeView", {
33 | get: function () {
34 | return this._layout;
35 | },
36 | enumerable: true,
37 | configurable: true
38 | });
39 | WrapLayout.prototype._createUI = function () {
40 | this._layout = new org.nativescript.widgets.WrapLayout(this._context);
41 | };
42 | return WrapLayout;
43 | })(common.WrapLayout);
44 | exports.WrapLayout = WrapLayout;
45 | common.WrapLayout.orientationProperty.metadata.onSetNativeValue = WrapLayout.setNativeOrientationProperty;
46 | common.WrapLayout.itemWidthProperty.metadata.onSetNativeValue = WrapLayout.setNativeItemWidthProperty;
47 | common.WrapLayout.itemHeightProperty.metadata.onSetNativeValue = WrapLayout.setNativeItemHeightProperty;
48 |
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/ui/list-picker/package.json:
--------------------------------------------------------------------------------
1 | { "name" : "list-picker",
2 | "main" : "list-picker.js" }
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/ui/list-view/package.json:
--------------------------------------------------------------------------------
1 | { "name" : "list-view",
2 | "main" : "list-view.js" }
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/ui/package.json:
--------------------------------------------------------------------------------
1 | { "name" : "ui",
2 | "main" : "ui.js" }
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/ui/page/package.json:
--------------------------------------------------------------------------------
1 | { "name" : "page",
2 | "main" : "page.js" }
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/ui/placeholder/package.json:
--------------------------------------------------------------------------------
1 | { "name" : "placeholder",
2 | "main" : "placeholder.js" }
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/ui/placeholder/placeholder-common.js:
--------------------------------------------------------------------------------
1 | var view = require("ui/core/view");
2 | var Placeholder = (function (_super) {
3 | __extends(Placeholder, _super);
4 | function Placeholder() {
5 | _super.apply(this, arguments);
6 | }
7 | Placeholder.creatingViewEvent = "creatingView";
8 | return Placeholder;
9 | })(view.View);
10 | exports.Placeholder = Placeholder;
11 |
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/ui/placeholder/placeholder.android.js:
--------------------------------------------------------------------------------
1 | var common = require("./placeholder-common");
2 | global.moduleMerge(common, exports);
3 | var Placeholder = (function (_super) {
4 | __extends(Placeholder, _super);
5 | function Placeholder() {
6 | _super.apply(this, arguments);
7 | }
8 | Placeholder.prototype._createUI = function () {
9 | var args = { eventName: common.Placeholder.creatingViewEvent, object: this, view: undefined, context: this._context };
10 | this.notify(args);
11 | this._android = args.view;
12 | };
13 | Object.defineProperty(Placeholder.prototype, "android", {
14 | get: function () {
15 | return this._android;
16 | },
17 | enumerable: true,
18 | configurable: true
19 | });
20 | Object.defineProperty(Placeholder.prototype, "_nativeView", {
21 | get: function () {
22 | return this._android;
23 | },
24 | enumerable: true,
25 | configurable: true
26 | });
27 | return Placeholder;
28 | })(common.Placeholder);
29 | exports.Placeholder = Placeholder;
30 |
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/ui/placeholder/placeholder.ios.js:
--------------------------------------------------------------------------------
1 | var common = require("./placeholder-common");
2 | global.moduleMerge(common, exports);
3 | var Placeholder = (function (_super) {
4 | __extends(Placeholder, _super);
5 | function Placeholder() {
6 | _super.apply(this, arguments);
7 | }
8 | Object.defineProperty(Placeholder.prototype, "ios", {
9 | get: function () {
10 | if (!this._ios) {
11 | var args = { eventName: common.Placeholder.creatingViewEvent, object: this, view: undefined, context: undefined };
12 | _super.prototype.notify.call(this, args);
13 | this._ios = args.view;
14 | }
15 | return this._ios;
16 | },
17 | enumerable: true,
18 | configurable: true
19 | });
20 | Object.defineProperty(Placeholder.prototype, "_nativeView", {
21 | get: function () {
22 | return this.ios;
23 | },
24 | enumerable: true,
25 | configurable: true
26 | });
27 | return Placeholder;
28 | })(common.Placeholder);
29 | exports.Placeholder = Placeholder;
30 |
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/ui/progress/package.json:
--------------------------------------------------------------------------------
1 | { "name" : "progress",
2 | "main" : "progress.js" }
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/ui/progress/progress-common.js:
--------------------------------------------------------------------------------
1 | var view = require("ui/core/view");
2 | var dependencyObservable = require("ui/core/dependency-observable");
3 | var proxy = require("ui/core/proxy");
4 | var Progress = (function (_super) {
5 | __extends(Progress, _super);
6 | function Progress() {
7 | _super.call(this);
8 | this.maxValue = 100;
9 | this.value = 0;
10 | }
11 | Object.defineProperty(Progress.prototype, "maxValue", {
12 | get: function () {
13 | return this._getValue(Progress.maxValueProperty);
14 | },
15 | set: function (newMaxValue) {
16 | this._setValue(Progress.maxValueProperty, newMaxValue);
17 | if (this.value > newMaxValue) {
18 | this.value = newMaxValue;
19 | }
20 | },
21 | enumerable: true,
22 | configurable: true
23 | });
24 | Object.defineProperty(Progress.prototype, "value", {
25 | get: function () {
26 | return this._getValue(Progress.valueProperty);
27 | },
28 | set: function (value) {
29 | value = Math.min(value, this.maxValue);
30 | this._setValue(Progress.valueProperty, value);
31 | },
32 | enumerable: true,
33 | configurable: true
34 | });
35 | Progress.valueProperty = new dependencyObservable.Property("value", "Progress", new proxy.PropertyMetadata(0, dependencyObservable.PropertyMetadataSettings.AffectsLayout));
36 | Progress.maxValueProperty = new dependencyObservable.Property("maxValue", "Progress", new proxy.PropertyMetadata(100, dependencyObservable.PropertyMetadataSettings.AffectsLayout));
37 | return Progress;
38 | })(view.View);
39 | exports.Progress = Progress;
40 |
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/ui/progress/progress.android.js:
--------------------------------------------------------------------------------
1 | var common = require("./progress-common");
2 | function onValuePropertyChanged(data) {
3 | var progress = data.object;
4 | if (!progress.android) {
5 | return;
6 | }
7 | progress.android.setProgress(data.newValue);
8 | }
9 | function onMaxValuePropertyChanged(data) {
10 | var progress = data.object;
11 | if (!progress.android) {
12 | return;
13 | }
14 | progress.android.setMax(data.newValue);
15 | }
16 | common.Progress.valueProperty.metadata.onSetNativeValue = onValuePropertyChanged;
17 | common.Progress.maxValueProperty.metadata.onSetNativeValue = onMaxValuePropertyChanged;
18 | global.moduleMerge(common, exports);
19 | var Progress = (function (_super) {
20 | __extends(Progress, _super);
21 | function Progress() {
22 | _super.apply(this, arguments);
23 | }
24 | Progress.prototype._createUI = function () {
25 | this._android = new android.widget.ProgressBar(this._context, null, android.R.attr.progressBarStyleHorizontal);
26 | };
27 | Object.defineProperty(Progress.prototype, "android", {
28 | get: function () {
29 | return this._android;
30 | },
31 | enumerable: true,
32 | configurable: true
33 | });
34 | return Progress;
35 | })(common.Progress);
36 | exports.Progress = Progress;
37 |
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/ui/progress/progress.ios.js:
--------------------------------------------------------------------------------
1 | var common = require("./progress-common");
2 | function onValuePropertyChanged(data) {
3 | var progress = data.object;
4 | progress.ios.progress = data.newValue / progress.maxValue;
5 | }
6 | function onMaxValuePropertyChanged(data) {
7 | var progress = data.object;
8 | progress.ios.progress = progress.value / data.newValue;
9 | }
10 | common.Progress.valueProperty.metadata.onSetNativeValue = onValuePropertyChanged;
11 | common.Progress.maxValueProperty.metadata.onSetNativeValue = onMaxValuePropertyChanged;
12 | global.moduleMerge(common, exports);
13 | var Progress = (function (_super) {
14 | __extends(Progress, _super);
15 | function Progress() {
16 | _super.call(this);
17 | this._ios = new UIProgressView();
18 | }
19 | Object.defineProperty(Progress.prototype, "ios", {
20 | get: function () {
21 | return this._ios;
22 | },
23 | enumerable: true,
24 | configurable: true
25 | });
26 | return Progress;
27 | })(common.Progress);
28 | exports.Progress = Progress;
29 |
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/ui/repeater/package.json:
--------------------------------------------------------------------------------
1 | { "name" : "repeater",
2 | "main" : "repeater.js" }
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/ui/scroll-view/package.json:
--------------------------------------------------------------------------------
1 | { "name" : "scroll-view",
2 | "main" : "scroll-view.js" }
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/ui/scroll-view/scroll-view-common.js:
--------------------------------------------------------------------------------
1 | var dependencyObservable = require("ui/core/dependency-observable");
2 | var proxy = require("ui/core/proxy");
3 | var enums = require("ui/enums");
4 | function isValidOrientation(value) {
5 | return value === enums.Orientation.vertical || value === enums.Orientation.horizontal;
6 | }
7 | exports.orientationProperty = new dependencyObservable.Property("orientation", "ScrollView", new proxy.PropertyMetadata(enums.Orientation.vertical, dependencyObservable.PropertyMetadataSettings.AffectsLayout, undefined, isValidOrientation));
8 |
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/ui/search-bar/package.json:
--------------------------------------------------------------------------------
1 | { "name" : "search-bar",
2 | "main" : "search-bar.js" }
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/ui/search-bar/search-bar-common.js:
--------------------------------------------------------------------------------
1 | var view = require("ui/core/view");
2 | var dependencyObservable = require("ui/core/dependency-observable");
3 | var proxy = require("ui/core/proxy");
4 | var color = require("color");
5 | var SearchBar = (function (_super) {
6 | __extends(SearchBar, _super);
7 | function SearchBar() {
8 | _super.apply(this, arguments);
9 | }
10 | Object.defineProperty(SearchBar.prototype, "text", {
11 | get: function () {
12 | return this._getValue(SearchBar.textProperty);
13 | },
14 | set: function (value) {
15 | this._setValue(SearchBar.textProperty, value);
16 | },
17 | enumerable: true,
18 | configurable: true
19 | });
20 | Object.defineProperty(SearchBar.prototype, "hint", {
21 | get: function () {
22 | return this._getValue(SearchBar.hintProperty);
23 | },
24 | set: function (value) {
25 | this._setValue(SearchBar.hintProperty, value);
26 | },
27 | enumerable: true,
28 | configurable: true
29 | });
30 | Object.defineProperty(SearchBar.prototype, "textFieldBackgroundColor", {
31 | get: function () {
32 | return this._getValue(SearchBar.textFieldBackgroundColorProperty);
33 | },
34 | set: function (value) {
35 | this._setValue(SearchBar.textFieldBackgroundColorProperty, value instanceof color.Color ? value : new color.Color(value));
36 | },
37 | enumerable: true,
38 | configurable: true
39 | });
40 | Object.defineProperty(SearchBar.prototype, "textFieldHintColor", {
41 | get: function () {
42 | return this._getValue(SearchBar.textFieldHintColorProperty);
43 | },
44 | set: function (value) {
45 | this._setValue(SearchBar.textFieldHintColorProperty, value instanceof color.Color ? value : new color.Color(value));
46 | },
47 | enumerable: true,
48 | configurable: true
49 | });
50 | SearchBar.submitEvent = "submit";
51 | SearchBar.clearEvent = "clear";
52 | SearchBar.textFieldBackgroundColorProperty = new dependencyObservable.Property("textFieldBackgroundColor", "SearchBar", new proxy.PropertyMetadata(undefined));
53 | SearchBar.textFieldHintColorProperty = new dependencyObservable.Property("textFieldHintColor", "SearchBar", new proxy.PropertyMetadata(undefined));
54 | SearchBar.hintProperty = new dependencyObservable.Property("hint", "SearchBar", new proxy.PropertyMetadata(""));
55 | SearchBar.textProperty = new dependencyObservable.Property("text", "SearchBar", new proxy.PropertyMetadata("", dependencyObservable.PropertyMetadataSettings.AffectsLayout));
56 | return SearchBar;
57 | })(view.View);
58 | exports.SearchBar = SearchBar;
59 |
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/ui/segmented-bar/package.json:
--------------------------------------------------------------------------------
1 | { "name" : "segmented-bar",
2 | "main" : "segmented-bar.js" }
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/ui/slider/package.json:
--------------------------------------------------------------------------------
1 | { "name" : "slider",
2 | "main" : "slider.js" }
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/ui/slider/slider-common.js:
--------------------------------------------------------------------------------
1 | var view = require("ui/core/view");
2 | var dependencyObservable = require("ui/core/dependency-observable");
3 | var proxy = require("ui/core/proxy");
4 | var Slider = (function (_super) {
5 | __extends(Slider, _super);
6 | function Slider() {
7 | _super.call(this);
8 | }
9 | Object.defineProperty(Slider.prototype, "value", {
10 | get: function () {
11 | return this._getValue(Slider.valueProperty);
12 | },
13 | set: function (value) {
14 | var newValue = value;
15 | newValue = Math.max(newValue, this.minValue);
16 | newValue = Math.min(newValue, this.maxValue);
17 | this._setValue(Slider.valueProperty, newValue);
18 | },
19 | enumerable: true,
20 | configurable: true
21 | });
22 | Object.defineProperty(Slider.prototype, "minValue", {
23 | get: function () {
24 | return this._getValue(Slider.minValueProperty);
25 | },
26 | set: function (newValue) {
27 | this._setValue(Slider.minValueProperty, newValue);
28 | if (newValue > this.maxValue) {
29 | this._setValue(Slider.maxValueProperty, newValue);
30 | }
31 | if (newValue > this.value) {
32 | this._setValue(Slider.valueProperty, newValue);
33 | }
34 | },
35 | enumerable: true,
36 | configurable: true
37 | });
38 | Object.defineProperty(Slider.prototype, "maxValue", {
39 | get: function () {
40 | return this._getValue(Slider.maxValueProperty);
41 | },
42 | set: function (newValue) {
43 | this._setValue(Slider.maxValueProperty, newValue);
44 | if (newValue < this.minValue) {
45 | this._setValue(Slider.minValueProperty, newValue);
46 | }
47 | if (newValue < this.value) {
48 | this._setValue(Slider.valueProperty, newValue);
49 | }
50 | },
51 | enumerable: true,
52 | configurable: true
53 | });
54 | Slider.valueProperty = new dependencyObservable.Property("value", "Slider", new proxy.PropertyMetadata(0));
55 | Slider.minValueProperty = new dependencyObservable.Property("minValue", "Slider", new proxy.PropertyMetadata(0));
56 | Slider.maxValueProperty = new dependencyObservable.Property("maxValue", "Slider", new proxy.PropertyMetadata(100));
57 | return Slider;
58 | })(view.View);
59 | exports.Slider = Slider;
60 |
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/ui/slider/slider.android.js:
--------------------------------------------------------------------------------
1 | var common = require("./slider-common");
2 | function onValuePropertyChanged(data) {
3 | var slider = data.object;
4 | if (!slider.android) {
5 | return;
6 | }
7 | slider._setNativeValuesSilently(data.newValue - slider.minValue, slider.maxValue - slider.minValue);
8 | }
9 | function onMinValuePropertyChanged(data) {
10 | var slider = data.object;
11 | if (!slider.android) {
12 | return;
13 | }
14 | slider._setNativeValuesSilently(slider.value - data.newValue, slider.maxValue - data.newValue);
15 | }
16 | function onMaxValuePropertyChanged(data) {
17 | var slider = data.object;
18 | if (!slider.android) {
19 | return;
20 | }
21 | slider.android.setMax(data.newValue - slider.minValue);
22 | }
23 | common.Slider.valueProperty.metadata.onSetNativeValue = onValuePropertyChanged;
24 | common.Slider.minValueProperty.metadata.onSetNativeValue = onMinValuePropertyChanged;
25 | common.Slider.maxValueProperty.metadata.onSetNativeValue = onMaxValuePropertyChanged;
26 | global.moduleMerge(common, exports);
27 | var Slider = (function (_super) {
28 | __extends(Slider, _super);
29 | function Slider() {
30 | _super.apply(this, arguments);
31 | }
32 | Slider.prototype._createUI = function () {
33 | this._android = new android.widget.SeekBar(this._context);
34 | var that = new WeakRef(this);
35 | this._changeListener = new android.widget.SeekBar.OnSeekBarChangeListener({
36 | onProgressChanged: function (seekBar, progress, fromUser) {
37 | var owner = that.get();
38 | if (owner) {
39 | if (!owner._supressNativeValue) {
40 | var newValue = seekBar.getProgress() + owner.minValue;
41 | owner._onPropertyChangedFromNative(common.Slider.valueProperty, newValue);
42 | }
43 | }
44 | },
45 | onStartTrackingTouch: function (seekBar) {
46 | },
47 | onStopTrackingTouch: function (seekBar) {
48 | }
49 | });
50 | this._android.setOnSeekBarChangeListener(this._changeListener);
51 | };
52 | Object.defineProperty(Slider.prototype, "android", {
53 | get: function () {
54 | return this._android;
55 | },
56 | enumerable: true,
57 | configurable: true
58 | });
59 | Slider.prototype._setNativeValuesSilently = function (newValue, newMaxValue) {
60 | if (!this.android) {
61 | return;
62 | }
63 | this._supressNativeValue = true;
64 | try {
65 | this.android.setMax(newMaxValue);
66 | this.android.setProgress(newValue);
67 | }
68 | finally {
69 | this._supressNativeValue = false;
70 | }
71 | };
72 | return Slider;
73 | })(common.Slider);
74 | exports.Slider = Slider;
75 |
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/ui/slider/slider.ios.js:
--------------------------------------------------------------------------------
1 | var common = require("./slider-common");
2 | function onValuePropertyChanged(data) {
3 | var slider = data.object;
4 | slider.ios.value = data.newValue;
5 | }
6 | function onMinValuePropertyChanged(data) {
7 | var slider = data.object;
8 | slider.ios.minimumValue = data.newValue;
9 | }
10 | function onMaxValuePropertyChanged(data) {
11 | var slider = data.object;
12 | slider.ios.maximumValue = data.newValue;
13 | }
14 | common.Slider.valueProperty.metadata.onSetNativeValue = onValuePropertyChanged;
15 | common.Slider.minValueProperty.metadata.onSetNativeValue = onMinValuePropertyChanged;
16 | common.Slider.maxValueProperty.metadata.onSetNativeValue = onMaxValuePropertyChanged;
17 | global.moduleMerge(common, exports);
18 | var SliderChangeHandlerImpl = (function (_super) {
19 | __extends(SliderChangeHandlerImpl, _super);
20 | function SliderChangeHandlerImpl() {
21 | _super.apply(this, arguments);
22 | }
23 | SliderChangeHandlerImpl.new = function () {
24 | return _super.new.call(this);
25 | };
26 | SliderChangeHandlerImpl.prototype.initWithOwner = function (owner) {
27 | this._owner = owner;
28 | return this;
29 | };
30 | SliderChangeHandlerImpl.prototype.sliderValueChanged = function (sender) {
31 | this._owner._onPropertyChangedFromNative(common.Slider.valueProperty, sender.value);
32 | };
33 | SliderChangeHandlerImpl.ObjCExposedMethods = {
34 | 'sliderValueChanged': { returns: interop.types.void, params: [UISlider] }
35 | };
36 | return SliderChangeHandlerImpl;
37 | })(NSObject);
38 | var Slider = (function (_super) {
39 | __extends(Slider, _super);
40 | function Slider() {
41 | _super.call(this);
42 | this._ios = new UISlider();
43 | this._ios.minimumValue = 0;
44 | this._ios.maximumValue = this.maxValue;
45 | this._changeHandler = SliderChangeHandlerImpl.new().initWithOwner(this);
46 | this._ios.addTargetActionForControlEvents(this._changeHandler, "sliderValueChanged", UIControlEvents.UIControlEventValueChanged);
47 | }
48 | Object.defineProperty(Slider.prototype, "ios", {
49 | get: function () {
50 | return this._ios;
51 | },
52 | enumerable: true,
53 | configurable: true
54 | });
55 | return Slider;
56 | })(common.Slider);
57 | exports.Slider = Slider;
58 |
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/ui/styling/background.ios.js:
--------------------------------------------------------------------------------
1 | var style = require("./style");
2 | var common = require("./background-common");
3 | global.moduleMerge(common, exports);
4 | var ios;
5 | (function (ios) {
6 | function createBackgroundUIColor(view) {
7 | if (!view._nativeView) {
8 | return null;
9 | }
10 | var background = view.style._getValue(style.backgroundInternalProperty);
11 | var frame = view._nativeView.frame;
12 | var boundsWidth = frame.size.width;
13 | var boundsHeight = frame.size.height;
14 | var result;
15 | if (background && !background.isEmpty() && boundsWidth > 0 && boundsHeight) {
16 | if (!background.image) {
17 | result = background.color.ios;
18 | }
19 | else {
20 | var img = background.image.ios;
21 | var params = background.getDrawParams(boundsWidth, boundsHeight);
22 | if (params.sizeX > 0 && params.sizeY > 0) {
23 | var resizeRect = CGRectMake(0, 0, params.sizeX, params.sizeY);
24 | UIGraphicsBeginImageContext(resizeRect.size);
25 | img.drawInRect(resizeRect);
26 | img = UIGraphicsGetImageFromCurrentImageContext();
27 | UIGraphicsEndImageContext();
28 | }
29 | UIGraphicsBeginImageContextWithOptions(frame.size, false, 0.0);
30 | var context = UIGraphicsGetCurrentContext();
31 | if (background.color && background.color.ios) {
32 | CGContextSetFillColorWithColor(context, background.color.ios.CGColor);
33 | CGContextFillRect(context, CGRectMake(0, 0, boundsWidth, boundsHeight));
34 | }
35 | if (!params.repeatX && !params.repeatY) {
36 | img.drawAtPoint(CGPointMake(params.posX, params.posY));
37 | }
38 | else {
39 | var w = params.repeatX ? boundsWidth : img.size.width;
40 | var h = params.repeatY ? boundsHeight : img.size.height;
41 | CGContextSetPatternPhase(context, CGSizeMake(params.posX, params.posY));
42 | params.posX = params.repeatX ? 0 : params.posX;
43 | params.posY = params.repeatY ? 0 : params.posY;
44 | var patternRect = CGRectMake(params.posX, params.posY, w, h);
45 | img.drawAsPatternInRect(patternRect);
46 | }
47 | var bkgImage = UIGraphicsGetImageFromCurrentImageContext();
48 | UIGraphicsEndImageContext();
49 | result = UIColor.alloc().initWithPatternImage(bkgImage);
50 | }
51 | return result;
52 | }
53 | }
54 | ios.createBackgroundUIColor = createBackgroundUIColor;
55 | })(ios = exports.ios || (exports.ios = {}));
56 |
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/ui/styling/converters.js:
--------------------------------------------------------------------------------
1 | var color = require("color");
2 | var enums = require("ui/enums");
3 | function colorConverter(value) {
4 | return new color.Color(value);
5 | }
6 | exports.colorConverter = colorConverter;
7 | function fontSizeConverter(value) {
8 | var result = parseFloat(value);
9 | return result;
10 | }
11 | exports.fontSizeConverter = fontSizeConverter;
12 | function textAlignConverter(value) {
13 | switch (value) {
14 | case enums.TextAlignment.left:
15 | case enums.TextAlignment.center:
16 | case enums.TextAlignment.right:
17 | return value;
18 | break;
19 | default:
20 | throw new Error("CSS text-align \"" + value + "\" is not supported.");
21 | break;
22 | }
23 | }
24 | exports.textAlignConverter = textAlignConverter;
25 | exports.numberConverter = parseFloat;
26 | function visibilityConverter(value) {
27 | if (value.toLowerCase() === enums.Visibility.collapsed) {
28 | return enums.Visibility.collapsed;
29 | }
30 | else if (value.toLowerCase() === enums.Visibility.collapse) {
31 | return enums.Visibility.collapse;
32 | }
33 | return enums.Visibility.visible;
34 | }
35 | exports.visibilityConverter = visibilityConverter;
36 | function opacityConverter(value) {
37 | var result = parseFloat(value);
38 | result = Math.max(0.0, result);
39 | result = Math.min(1.0, result);
40 | return result;
41 | }
42 | exports.opacityConverter = opacityConverter;
43 |
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/ui/styling/package.json:
--------------------------------------------------------------------------------
1 | { "name" : "styling",
2 | "main" : "styling.js" }
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/ui/styling/stylers-common.js:
--------------------------------------------------------------------------------
1 | var application = require("application");
2 | var types = require("utils/types");
3 | var _defaultNativeValuesCache = {};
4 | var StylePropertyChangedHandler = (function () {
5 | function StylePropertyChangedHandler(applyCallback, resetCallback, getNativeValue) {
6 | this._applyProperty = applyCallback;
7 | this._resetProperty = resetCallback;
8 | this._getNativeValue = getNativeValue;
9 | }
10 | StylePropertyChangedHandler.prototype.applyProperty = function (property, view, newValue) {
11 | var className = types.getClass(view);
12 | if (!_defaultNativeValuesCache.hasOwnProperty(className + property.id) && this._getNativeValue) {
13 | _defaultNativeValuesCache[className + property.id] = this._getNativeValue(view);
14 | }
15 | if (application.android) {
16 | newValue = newValue.android ? newValue.android : newValue;
17 | }
18 | else if (application.ios) {
19 | newValue = newValue.ios ? newValue.ios : newValue;
20 | }
21 | this._applyProperty(view, newValue, _defaultNativeValuesCache[className + property.id]);
22 | };
23 | StylePropertyChangedHandler.prototype.resetProperty = function (property, view) {
24 | var className = types.getClass(view);
25 | this._resetProperty(view, _defaultNativeValuesCache[className + property.id]);
26 | };
27 | return StylePropertyChangedHandler;
28 | })();
29 | exports.StylePropertyChangedHandler = StylePropertyChangedHandler;
30 |
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/ui/styling/styling.js:
--------------------------------------------------------------------------------
1 | var styleModule = require("./style");
2 | var stylePropertyModule = require("./style-property");
3 | var stylersCommonModule = require("./stylers-common");
4 | var visualStateConstatnsModule = require("./visual-state-constants");
5 | var convertersModule = require("./converters");
6 | exports.Property = stylePropertyModule.Property;
7 | exports.Style = styleModule.Style;
8 | var properties;
9 | (function (properties) {
10 | properties.fontSizeProperty = styleModule.fontSizeProperty;
11 | properties.colorProperty = styleModule.colorProperty;
12 | properties.backgroundColorProperty = styleModule.backgroundColorProperty;
13 | properties.textAlignmentProperty = styleModule.textAlignmentProperty;
14 | properties.getPropertyByName = stylePropertyModule.getPropertyByName;
15 | properties.getPropertyByCssName = stylePropertyModule.getPropertyByCssName;
16 | properties.eachProperty = stylePropertyModule.eachProperty;
17 | properties.eachInheritableProperty = stylePropertyModule.eachInheritableProperty;
18 | })(properties = exports.properties || (exports.properties = {}));
19 | ;
20 | var converters;
21 | (function (converters) {
22 | converters.colorConverter = convertersModule.colorConverter;
23 | converters.fontSizeConverter = convertersModule.fontSizeConverter;
24 | converters.textAlignConverter = convertersModule.textAlignConverter;
25 | converters.numberConverter = convertersModule.numberConverter;
26 | converters.visibilityConverter = convertersModule.visibilityConverter;
27 | })(converters = exports.converters || (exports.converters = {}));
28 | ;
29 | var visualStates;
30 | (function (visualStates) {
31 | visualStates.Normal = visualStateConstatnsModule.Normal;
32 | visualStates.Hovered = visualStateConstatnsModule.Hovered;
33 | visualStates.Pressed = visualStateConstatnsModule.Pressed;
34 | })(visualStates = exports.visualStates || (exports.visualStates = {}));
35 | ;
36 | var stylers;
37 | (function (stylers) {
38 | stylers.StylePropertyChangedHandler = stylersCommonModule.StylePropertyChangedHandler;
39 | stylers.registerHandler = styleModule.registerHandler;
40 | })(stylers = exports.stylers || (exports.stylers = {}));
41 |
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/ui/styling/visual-state-constants.js:
--------------------------------------------------------------------------------
1 | exports.Normal = "normal";
2 | exports.Hovered = "hovered";
3 | exports.Pressed = "pressed";
4 |
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/ui/styling/visual-state.js:
--------------------------------------------------------------------------------
1 | var constants = require("ui/styling/visual-state-constants");
2 | var observable = require("ui/core/dependency-observable");
3 | var styleProperty = require("ui/styling/style-property");
4 | var VisualState = (function () {
5 | function VisualState() {
6 | this._setters = {};
7 | }
8 | Object.defineProperty(VisualState.prototype, "setters", {
9 | get: function () {
10 | return this._setters;
11 | },
12 | enumerable: true,
13 | configurable: true
14 | });
15 | return VisualState;
16 | })();
17 | exports.VisualState = VisualState;
18 | function goToState(view, state) {
19 | var root = view.page;
20 | if (!root) {
21 | return undefined;
22 | }
23 | var allStates = root._getStyleScope().getVisualStates(view);
24 | if (!allStates) {
25 | return undefined;
26 | }
27 | if (!(state in allStates)) {
28 | state = constants.Normal;
29 | }
30 | if (state !== view.visualState) {
31 | var newState = allStates[state];
32 | var oldState = allStates[view.visualState];
33 | resetProperties(view, oldState, newState);
34 | applyProperties(view, newState);
35 | }
36 | return state;
37 | }
38 | exports.goToState = goToState;
39 | function resetProperties(view, oldState, newState) {
40 | if (!oldState) {
41 | return;
42 | }
43 | var property;
44 | for (var name in oldState.setters) {
45 | if (newState && (name in newState.setters)) {
46 | continue;
47 | }
48 | property = styleProperty.getPropertyByName(name);
49 | if (property) {
50 | view.style._resetValue(property, observable.ValueSource.VisualState);
51 | }
52 | }
53 | }
54 | function applyProperties(view, state) {
55 | if (!state) {
56 | return;
57 | }
58 | var property;
59 | for (var name in state.setters) {
60 | property = styleProperty.getPropertyByName(name);
61 | if (property) {
62 | view.style._setValue(property, state.setters[name], observable.ValueSource.VisualState);
63 | }
64 | }
65 | }
66 |
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/ui/switch/package.json:
--------------------------------------------------------------------------------
1 | { "name" : "switch",
2 | "main" : "switch.js" }
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/ui/switch/switch-common.js:
--------------------------------------------------------------------------------
1 | var view = require("ui/core/view");
2 | var dependencyObservable = require("ui/core/dependency-observable");
3 | var proxy = require("ui/core/proxy");
4 | var Switch = (function (_super) {
5 | __extends(Switch, _super);
6 | function Switch() {
7 | _super.apply(this, arguments);
8 | }
9 | Object.defineProperty(Switch.prototype, "checked", {
10 | get: function () {
11 | return this._getValue(Switch.checkedProperty);
12 | },
13 | set: function (value) {
14 | this._setValue(Switch.checkedProperty, value);
15 | },
16 | enumerable: true,
17 | configurable: true
18 | });
19 | Switch.checkedProperty = new dependencyObservable.Property("checked", "Switch", new proxy.PropertyMetadata(false));
20 | return Switch;
21 | })(view.View);
22 | exports.Switch = Switch;
23 |
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/ui/switch/switch.android.js:
--------------------------------------------------------------------------------
1 | var common = require("./switch-common");
2 | function onCheckedPropertyChanged(data) {
3 | var swtch = data.object;
4 | if (!swtch.android) {
5 | return;
6 | }
7 | swtch.android.setChecked(data.newValue);
8 | }
9 | common.Switch.checkedProperty.metadata.onSetNativeValue = onCheckedPropertyChanged;
10 | global.moduleMerge(common, exports);
11 | var Switch = (function (_super) {
12 | __extends(Switch, _super);
13 | function Switch() {
14 | _super.apply(this, arguments);
15 | }
16 | Object.defineProperty(Switch.prototype, "android", {
17 | get: function () {
18 | return this._android;
19 | },
20 | enumerable: true,
21 | configurable: true
22 | });
23 | Switch.prototype._createUI = function () {
24 | this._android = new android.widget.Switch(this._context);
25 | var that = new WeakRef(this);
26 | this._android.setOnCheckedChangeListener(new android.widget.CompoundButton.OnCheckedChangeListener({
27 | get owner() {
28 | return that.get();
29 | },
30 | onCheckedChanged: function (sender, isChecked) {
31 | if (this.owner) {
32 | this.owner._onPropertyChangedFromNative(common.Switch.checkedProperty, isChecked);
33 | }
34 | }
35 | }));
36 | };
37 | return Switch;
38 | })(common.Switch);
39 | exports.Switch = Switch;
40 |
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/ui/switch/switch.ios.js:
--------------------------------------------------------------------------------
1 | var common = require("./switch-common");
2 | function onCheckedPropertyChanged(data) {
3 | var swtch = data.object;
4 | swtch.ios.on = data.newValue;
5 | }
6 | common.Switch.checkedProperty.metadata.onSetNativeValue = onCheckedPropertyChanged;
7 | global.moduleMerge(common, exports);
8 | var SwitchChangeHandlerImpl = (function (_super) {
9 | __extends(SwitchChangeHandlerImpl, _super);
10 | function SwitchChangeHandlerImpl() {
11 | _super.apply(this, arguments);
12 | }
13 | SwitchChangeHandlerImpl.new = function () {
14 | return _super.new.call(this);
15 | };
16 | SwitchChangeHandlerImpl.prototype.initWithOwner = function (owner) {
17 | this._owner = owner;
18 | return this;
19 | };
20 | SwitchChangeHandlerImpl.prototype.valueChanged = function (sender) {
21 | this._owner._onPropertyChangedFromNative(common.Switch.checkedProperty, sender.on);
22 | };
23 | SwitchChangeHandlerImpl.ObjCExposedMethods = {
24 | 'valueChanged': { returns: interop.types.void, params: [UISwitch] }
25 | };
26 | return SwitchChangeHandlerImpl;
27 | })(NSObject);
28 | var Switch = (function (_super) {
29 | __extends(Switch, _super);
30 | function Switch() {
31 | _super.call(this);
32 | this._ios = new UISwitch();
33 | this._handler = SwitchChangeHandlerImpl.new().initWithOwner(this);
34 | this._ios.addTargetActionForControlEvents(this._handler, "valueChanged", UIControlEvents.UIControlEventValueChanged);
35 | }
36 | Object.defineProperty(Switch.prototype, "ios", {
37 | get: function () {
38 | return this._ios;
39 | },
40 | enumerable: true,
41 | configurable: true
42 | });
43 | return Switch;
44 | })(common.Switch);
45 | exports.Switch = Switch;
46 |
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/ui/tab-view/package.json:
--------------------------------------------------------------------------------
1 | { "name" : "ui/tab-view",
2 | "main" : "tab-view.js" }
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/ui/text-base/package.json:
--------------------------------------------------------------------------------
1 | { "name" : "text-base",
2 | "main" : "text-base.js" }
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/ui/text-field/package.json:
--------------------------------------------------------------------------------
1 | { "name" : "text-field",
2 | "main" : "text-field.js" }
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/ui/text-field/text-field-common.js:
--------------------------------------------------------------------------------
1 | var dependencyObservable = require("ui/core/dependency-observable");
2 | var proxy = require("ui/core/proxy");
3 | var textBase = require("ui/text-base");
4 | var editableTextBase = require("ui/editable-text-base");
5 | exports.secureProperty = new dependencyObservable.Property("secure", "TextField", new proxy.PropertyMetadata(false));
6 | global.moduleMerge(textBase, exports);
7 | var TextField = (function (_super) {
8 | __extends(TextField, _super);
9 | function TextField(options) {
10 | _super.call(this, options);
11 | }
12 | Object.defineProperty(TextField.prototype, "secure", {
13 | get: function () {
14 | return this._getValue(exports.secureProperty);
15 | },
16 | set: function (value) {
17 | this._setValue(exports.secureProperty, value);
18 | },
19 | enumerable: true,
20 | configurable: true
21 | });
22 | TextField.returnPressEvent = "returnPress";
23 | return TextField;
24 | })(editableTextBase.EditableTextBase);
25 | exports.TextField = TextField;
26 |
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/ui/text-field/text-field.android.js:
--------------------------------------------------------------------------------
1 | var common = require("./text-field-common");
2 | function onSecurePropertyChanged(data) {
3 | var textField = data.object;
4 | if (!textField.android) {
5 | return;
6 | }
7 | var currentInputType = textField.android.getInputType();
8 | var currentClass = currentInputType & android.text.InputType.TYPE_MASK_CLASS;
9 | var currentFlags = currentInputType & android.text.InputType.TYPE_MASK_FLAGS;
10 | var newInputType = currentInputType;
11 | if (data.newValue) {
12 | if (currentClass === android.text.InputType.TYPE_CLASS_TEXT) {
13 | newInputType = currentClass | currentFlags | android.text.InputType.TYPE_TEXT_VARIATION_PASSWORD;
14 | }
15 | else if (currentClass === android.text.InputType.TYPE_CLASS_NUMBER) {
16 | newInputType = currentClass | currentFlags | android.text.InputType.TYPE_NUMBER_VARIATION_PASSWORD;
17 | }
18 | newInputType = newInputType & ~28672;
19 | }
20 | else {
21 | if (currentClass === android.text.InputType.TYPE_CLASS_TEXT) {
22 | newInputType = currentClass | currentFlags | android.text.InputType.TYPE_TEXT_VARIATION_NORMAL;
23 | }
24 | else if (currentClass === android.text.InputType.TYPE_CLASS_NUMBER) {
25 | newInputType = currentClass | currentFlags | android.text.InputType.TYPE_NUMBER_VARIATION_NORMAL;
26 | }
27 | }
28 | textField.android.setInputType(newInputType);
29 | }
30 | common.secureProperty.metadata.onSetNativeValue = onSecurePropertyChanged;
31 | global.moduleMerge(common, exports);
32 | var TextField = (function (_super) {
33 | __extends(TextField, _super);
34 | function TextField() {
35 | _super.apply(this, arguments);
36 | }
37 | TextField.prototype._configureEditText = function () {
38 | this.android.setInputType(android.text.InputType.TYPE_CLASS_TEXT | android.text.InputType.TYPE_TEXT_VARIATION_NORMAL | android.text.InputType.TYPE_TEXT_FLAG_CAP_SENTENCES);
39 | this.android.setLines(1);
40 | this.android.setMaxLines(1);
41 | this.android.setHorizontallyScrolling(true);
42 | };
43 | TextField.prototype._onReturnPress = function () {
44 | this.notify({ eventName: TextField.returnPressEvent, object: this });
45 | };
46 | return TextField;
47 | })(common.TextField);
48 | exports.TextField = TextField;
49 |
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/ui/text-view/package.json:
--------------------------------------------------------------------------------
1 | { "name" : "text-view",
2 | "main" : "text-view.js" }
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/ui/text-view/text-view-common.js:
--------------------------------------------------------------------------------
1 | var textBase = require("ui/text-base");
2 | var editableTextBase = require("ui/editable-text-base");
3 | global.moduleMerge(textBase, exports);
4 | var TextView = (function (_super) {
5 | __extends(TextView, _super);
6 | function TextView(options) {
7 | _super.call(this, options);
8 | }
9 | return TextView;
10 | })(editableTextBase.EditableTextBase);
11 | exports.TextView = TextView;
12 |
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/ui/text-view/text-view.android.js:
--------------------------------------------------------------------------------
1 | var common = require("./text-view-common");
2 | global.moduleMerge(common, exports);
3 | var TextView = (function (_super) {
4 | __extends(TextView, _super);
5 | function TextView() {
6 | _super.apply(this, arguments);
7 | }
8 | TextView.prototype._configureEditText = function () {
9 | this.android.setInputType(android.text.InputType.TYPE_CLASS_TEXT | android.text.InputType.TYPE_TEXT_VARIATION_NORMAL | android.text.InputType.TYPE_TEXT_FLAG_CAP_SENTENCES | android.text.InputType.TYPE_TEXT_FLAG_MULTI_LINE);
10 | this.android.setGravity(android.view.Gravity.TOP | android.view.Gravity.LEFT);
11 | };
12 | return TextView;
13 | })(common.TextView);
14 | exports.TextView = TextView;
15 |
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/ui/time-picker/package.json:
--------------------------------------------------------------------------------
1 | { "name" : "time-picker",
2 | "main" : "time-picker.js" }
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/ui/time-picker/time-picker-common.js:
--------------------------------------------------------------------------------
1 | var dependencyObservable = require("ui/core/dependency-observable");
2 | var proxy = require("ui/core/proxy");
3 | var view = require("ui/core/view");
4 | var TimePicker = (function (_super) {
5 | __extends(TimePicker, _super);
6 | function TimePicker() {
7 | _super.call(this);
8 | }
9 | Object.defineProperty(TimePicker.prototype, "hour", {
10 | get: function () {
11 | return this._getValue(TimePicker.hourProperty);
12 | },
13 | set: function (value) {
14 | this._setValue(TimePicker.hourProperty, value);
15 | },
16 | enumerable: true,
17 | configurable: true
18 | });
19 | Object.defineProperty(TimePicker.prototype, "minute", {
20 | get: function () {
21 | return this._getValue(TimePicker.minuteProperty);
22 | },
23 | set: function (value) {
24 | this._setValue(TimePicker.minuteProperty, value);
25 | },
26 | enumerable: true,
27 | configurable: true
28 | });
29 | TimePicker.hourProperty = new dependencyObservable.Property("hour", "TimePicker", new proxy.PropertyMetadata(undefined));
30 | TimePicker.minuteProperty = new dependencyObservable.Property("minute", "TimePicker", new proxy.PropertyMetadata(undefined));
31 | return TimePicker;
32 | })(view.View);
33 | exports.TimePicker = TimePicker;
34 |
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/ui/time-picker/time-picker.android.js:
--------------------------------------------------------------------------------
1 | var common = require("./time-picker-common");
2 | function onHourPropertyChanged(data) {
3 | var picker = data.object;
4 | picker._setNativeHourSilently(data.newValue);
5 | }
6 | common.TimePicker.hourProperty.metadata.onSetNativeValue = onHourPropertyChanged;
7 | function onMinutePropertyChanged(data) {
8 | var picker = data.object;
9 | picker._setNativeMinuteSilently(data.newValue);
10 | }
11 | common.TimePicker.minuteProperty.metadata.onSetNativeValue = onMinutePropertyChanged;
12 | global.moduleMerge(common, exports);
13 | var TimePicker = (function (_super) {
14 | __extends(TimePicker, _super);
15 | function TimePicker() {
16 | _super.apply(this, arguments);
17 | this._isSettingTime = false;
18 | }
19 | Object.defineProperty(TimePicker.prototype, "android", {
20 | get: function () {
21 | return this._android;
22 | },
23 | enumerable: true,
24 | configurable: true
25 | });
26 | TimePicker.prototype._createUI = function () {
27 | this._android = new android.widget.TimePicker(this._context);
28 | var that = new WeakRef(this);
29 | this._listener = new android.widget.TimePicker.OnTimeChangedListener({
30 | get owner() {
31 | return that.get();
32 | },
33 | onTimeChanged: function (picker, hour, minute) {
34 | if (this.owner && !this.owner._isSettingTime) {
35 | if (hour !== this.owner.hour) {
36 | this.owner._onPropertyChangedFromNative(common.TimePicker.hourProperty, hour);
37 | }
38 | if (minute !== this.owner.minute) {
39 | this.owner._onPropertyChangedFromNative(common.TimePicker.minuteProperty, minute);
40 | }
41 | }
42 | }
43 | });
44 | this._android.setOnTimeChangedListener(this._listener);
45 | };
46 | TimePicker.prototype._setNativeHourSilently = function (newValue) {
47 | if (!this.android) {
48 | return;
49 | }
50 | this._isSettingTime = true;
51 | try {
52 | this.android.setCurrentHour(new java.lang.Integer(newValue));
53 | }
54 | finally {
55 | this._isSettingTime = false;
56 | }
57 | };
58 | TimePicker.prototype._setNativeMinuteSilently = function (newValue) {
59 | if (!this.android) {
60 | return;
61 | }
62 | this._isSettingTime = true;
63 | try {
64 | this.android.setCurrentMinute(new java.lang.Integer(newValue));
65 | }
66 | finally {
67 | this._isSettingTime = false;
68 | }
69 | };
70 | return TimePicker;
71 | })(common.TimePicker);
72 | exports.TimePicker = TimePicker;
73 |
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/ui/ui.js:
--------------------------------------------------------------------------------
1 | function __export(m) {
2 | for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
3 | }
4 | __export(require("ui/action-bar"));
5 | __export(require("ui/activity-indicator"));
6 | __export(require("ui/builder"));
7 | __export(require("ui/button"));
8 | __export(require("ui/content-view"));
9 | __export(require("ui/core/bindable"));
10 | __export(require("ui/core/dependency-observable"));
11 | __export(require("ui/core/proxy"));
12 | __export(require("ui/core/view"));
13 | __export(require("ui/core/weak-event-listener"));
14 | __export(require("ui/dialogs"));
15 | __export(require("ui/date-picker"));
16 | __export(require("ui/editable-text-base"));
17 | __export(require("ui/enums"));
18 | __export(require("ui/frame"));
19 | __export(require("ui/gestures"));
20 | __export(require("ui/html-view"));
21 | __export(require("ui/image"));
22 | __export(require("ui/image-cache"));
23 | __export(require("ui/label"));
24 | __export(require("ui/layouts/layout"));
25 | __export(require("ui/layouts/absolute-layout"));
26 | __export(require("ui/layouts/dock-layout"));
27 | __export(require("ui/layouts/grid-layout"));
28 | __export(require("ui/layouts/stack-layout"));
29 | __export(require("ui/layouts/wrap-layout"));
30 | __export(require("ui/list-picker"));
31 | __export(require("ui/list-view"));
32 | __export(require("ui/page"));
33 | __export(require("ui/placeholder"));
34 | __export(require("ui/progress"));
35 | __export(require("ui/repeater"));
36 | __export(require("ui/scroll-view"));
37 | __export(require("ui/search-bar"));
38 | __export(require("ui/segmented-bar"));
39 | __export(require("ui/slider"));
40 | __export(require("ui/styling"));
41 | __export(require("ui/styling/background"));
42 | __export(require("ui/styling/css-selector"));
43 | __export(require("ui/styling/font"));
44 | __export(require("ui/styling/style-property"));
45 | __export(require("ui/styling/stylers"));
46 | __export(require("ui/styling/visual-state-constants"));
47 | __export(require("ui/switch"));
48 | __export(require("ui/tab-view"));
49 | __export(require("ui/text-base"));
50 | __export(require("ui/text-field"));
51 | __export(require("ui/text-view"));
52 | __export(require("ui/time-picker"));
53 | __export(require("ui/web-view"));
54 |
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/ui/utils.ios.js:
--------------------------------------------------------------------------------
1 | var utils = require("utils/utils");
2 | var ios;
3 | (function (ios) {
4 | function getActualHeight(view) {
5 | if (view.window && !view.hidden) {
6 | return view.frame.size.height;
7 | }
8 | return 0;
9 | }
10 | ios.getActualHeight = getActualHeight;
11 | function getStatusBarHeight() {
12 | var app = UIApplication.sharedApplication();
13 | if (!app || app.statusBarHidden) {
14 | return 0;
15 | }
16 | var statusFrame = app.statusBarFrame;
17 | return Math.min(statusFrame.size.width, statusFrame.size.height);
18 | }
19 | ios.getStatusBarHeight = getStatusBarHeight;
20 | function _layoutRootView(rootView, parentBounds) {
21 | if (!rootView || !parentBounds) {
22 | return;
23 | }
24 | var size = parentBounds.size;
25 | var width = size.width;
26 | var height = size.height;
27 | var superview = rootView._nativeView.superview;
28 | var superViewRotationRadians;
29 | if (superview) {
30 | superViewRotationRadians = atan2f(superview.transform.b, superview.transform.a);
31 | }
32 | if (utils.ios.MajorVersion < 8 && utils.ios.isLandscape() && !superViewRotationRadians) {
33 | width = size.height;
34 | height = size.width;
35 | }
36 | var origin = parentBounds.origin;
37 | var left = origin.x;
38 | var top = origin.y;
39 | var widthSpec = utils.layout.makeMeasureSpec(width, utils.layout.EXACTLY);
40 | var heightSpec = utils.layout.makeMeasureSpec(height, utils.layout.EXACTLY);
41 | rootView.measure(widthSpec, heightSpec);
42 | rootView.layout(left, top, width, height);
43 | }
44 | ios._layoutRootView = _layoutRootView;
45 | })(ios = exports.ios || (exports.ios = {}));
46 |
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/ui/web-view/package.json:
--------------------------------------------------------------------------------
1 | { "name" : "web-view",
2 | "main" : "web-view.js" }
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/utils/module-merge.js:
--------------------------------------------------------------------------------
1 | exports.merge = function (sourceExports, destExports) {
2 | for (var key in sourceExports) {
3 | destExports[key] = sourceExports[key];
4 | }
5 | };
6 |
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/utils/number-utils.js:
--------------------------------------------------------------------------------
1 | var epsilon = 1E-05;
2 | function areClose(value1, value2) {
3 | return (Math.abs(value1 - value2) < epsilon);
4 | }
5 | exports.areClose = areClose;
6 | function greaterThanOrClose(value1, value2) {
7 | return (value1 > value2) || areClose(value1, value2);
8 | }
9 | exports.greaterThanOrClose = greaterThanOrClose;
10 | function greaterThan(value1, value2) {
11 | return (value1 > value2) && !areClose(value1, value2);
12 | }
13 | exports.greaterThan = greaterThan;
14 | function lessThan(value1, value2) {
15 | return (value1 < value2) && !areClose(value1, value2);
16 | }
17 | exports.lessThan = lessThan;
18 | function isZero(value) {
19 | return (Math.abs(value) < epsilon);
20 | }
21 | exports.isZero = isZero;
22 | function greaterThanZero(value) {
23 | return value > 0;
24 | }
25 | exports.greaterThanZero = greaterThanZero;
26 | function notNegative(value) {
27 | return value >= 0;
28 | }
29 | exports.notNegative = notNegative;
30 |
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/utils/utils-common.js:
--------------------------------------------------------------------------------
1 | var types = require("utils/types");
2 | exports.RESOURCE_PREFIX = "res://";
3 | function copyFrom(source, target) {
4 | if (types.isDefined(source) && types.isDefined(target)) {
5 | var i;
6 | var key;
7 | var value;
8 | var keys = Object.keys(source);
9 | for (i = 0; i < keys.length; i++) {
10 | key = keys[i];
11 | value = source[key];
12 | if (types.isDefined(value)) {
13 | target[key] = value;
14 | }
15 | }
16 | }
17 | }
18 | exports.copyFrom = copyFrom;
19 | function parseJSON(source) {
20 | var src = source.trim();
21 | if (src.lastIndexOf(")") === src.length - 1) {
22 | return JSON.parse(src.substring(src.indexOf("(") + 1, src.lastIndexOf(")")));
23 | }
24 | return JSON.parse(src);
25 | }
26 | exports.parseJSON = parseJSON;
27 | var layout;
28 | (function (layout) {
29 | var MODE_SHIFT = 30;
30 | var MODE_MASK = 0x3 << MODE_SHIFT;
31 | layout.UNSPECIFIED = 0 << MODE_SHIFT;
32 | layout.EXACTLY = 1 << MODE_SHIFT;
33 | layout.AT_MOST = 2 << MODE_SHIFT;
34 | layout.MEASURED_STATE_TOO_SMALL = 0x01000000;
35 | layout.MEASURED_STATE_MASK = 0xff000000;
36 | layout.MEASURED_SIZE_MASK = 0x00ffffff;
37 | function getMode(mode) {
38 | switch (mode) {
39 | case layout.EXACTLY:
40 | return "Exact";
41 | case layout.AT_MOST:
42 | return "AtMost";
43 | default:
44 | return "Unspecified";
45 | }
46 | }
47 | layout.getMode = getMode;
48 | function getMeasureSpecMode(spec) {
49 | return (spec & MODE_MASK);
50 | }
51 | layout.getMeasureSpecMode = getMeasureSpecMode;
52 | function getMeasureSpecSize(spec) {
53 | return (spec & ~MODE_MASK);
54 | }
55 | layout.getMeasureSpecSize = getMeasureSpecSize;
56 | })(layout = exports.layout || (exports.layout = {}));
57 | function isFileOrResourcePath(path) {
58 | if (!types.isString(path)) {
59 | return false;
60 | }
61 | return path.indexOf("~/") === 0 ||
62 | path.indexOf("/") === 0 ||
63 | path.indexOf(exports.RESOURCE_PREFIX) === 0;
64 | }
65 | exports.isFileOrResourcePath = isFileOrResourcePath;
66 | function isDataURI(uri) {
67 | if (!types.isString(uri)) {
68 | return false;
69 | }
70 | var firstSegment = uri.trim().split(',')[0];
71 | return firstSegment && firstSegment.indexOf("data:") === 0 && firstSegment.indexOf('base64') >= 0;
72 | }
73 | exports.isDataURI = isDataURI;
74 |
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/xhr/package.json:
--------------------------------------------------------------------------------
1 | { "name" : "xhr",
2 | "main" : "xhr.js" }
--------------------------------------------------------------------------------
/hello/node_modules/tns-core-modules/xml/package.json:
--------------------------------------------------------------------------------
1 | { "name" : "xml",
2 | "main" : "xml.js" }
3 |
--------------------------------------------------------------------------------
/hello/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "nativescript": {
3 | "id": "org.nativescript.hello",
4 | "tns-android": {
5 | "version": "1.4.0"
6 | }
7 | },
8 | "dependencies": {
9 | "tns-core-modules": "1.4.0"
10 | }
11 | }
--------------------------------------------------------------------------------
/initialize-project-files.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | if [ ! -d "app/src/" ]; then
4 | echo "Run in the top-level directory of your project (the one that contains the app directory.)"
5 | exit 1
6 | fi
7 |
8 | mkdir -p app/src/main/assets/metadata
9 | ln -s {../../nativescript-android/,}app/src/main/assets/metadata/treeValueStream.dat
10 | ln -s {../../nativescript-android/,}app/src/main/assets/metadata/treeNodeStream.dat
11 | ln -s {../../nativescript-android/,}app/src/main/assets/metadata/treeStringsStream.dat
12 |
13 | mkdir -p app/src/main/jniLibs/x86
14 | ln -s {../../nativescript-android/,}app/src/main/jniLibs/x86/libNativeScript.so
15 | ln -s {../../nativescript-android/,}app/src/main/jniLibs/x86/libAssetExtractor.so
16 |
17 | mkdir -p app/src/main/jniLibs/armeabi-v7a
18 | ln -s {../../nativescript-android/,}app/src/main/jniLibs/armeabi-v7a/libNativeScript.so
19 | ln -s {../../nativescript-android/,}app/src/main/jniLibs/armeabi-v7a/libAssetExtractor.so
20 |
21 | mkdir -p app/libs
22 | ln -s {../../nativescript-android/,}app/libs/nativescript.jar
23 | ln -s {../../nativescript-android/,}app/libs/widgets.jar
24 |
--------------------------------------------------------------------------------
/new-project.diff:
--------------------------------------------------------------------------------
1 | --- ./app/app.iml 2015-10-28 14:15:38.129958088 -0400
2 | +++ ./app/app.iml 2015-10-28 11:56:19.399479621 -0400
3 | @@ -92,7 +92,9 @@
4 |
5 |
6 |
7 | +
8 |
9 | +
10 |
11 |
12 |
13 | --- ./app/build.gradle 2015-10-28 14:15:38.129958088 -0400
14 | +++ ./app/build.gradle 2015-10-28 11:56:19.399479621 -0400
15 | @@ -24,4 +24,5 @@
16 | testCompile 'junit:junit:4.12'
17 | compile 'com.android.support:appcompat-v7:22.2.1'
18 | compile 'com.android.support:design:22.2.1'
19 | + compile files('libs/nativescript.jar')
20 | }
21 | --- ./app/src/main/AndroidManifest.xml 2015-10-28 14:15:38.129958088 -0400
22 | +++ ./app/src/main/AndroidManifest.xml 2015-10-28 11:56:19.399479621 -0400
23 | @@ -3,13 +3,14 @@
24 | package="com.example.root.helloworld" >
25 |
26 |
33 |
38 |
39 | --- ./gradle.properties 2015-10-28 14:15:38.119958088 -0400
40 | +++ ./gradle.properties 2015-10-28 11:56:19.399479621 -0400
41 | @@ -15,4 +15,5 @@
42 | # When configured, Gradle will run in incubating parallel mode.
43 | # This option should only be used with decoupled projects. More details, visit
44 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
45 | -# org.gradle.parallel=true
46 | \ No newline at end of file
47 | +# org.gradle.parallel=true
48 | +android.useDeprecatedNdk=true
49 | --- ./local.properties 2015-10-28 14:15:38.119958088 -0400
50 | +++ ./local.properties 2015-10-28 11:56:19.399479621 -0400
51 | @@ -9,3 +9,4 @@
52 | # header note.
53 | #Wed Oct 28 14:00:56 UTC 2015
54 | sdk.dir=/usr/local/android-sdk-linux
55 | +ndk.dir=/usr/local/android-ndk-r10e
56 |
--------------------------------------------------------------------------------
/tests/hello.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | set -euf -o pipefail
4 |
5 | export DIR=$(pwd)
6 |
7 | cd $DIR/hello
8 | docker run -it --privileged --net=host -v $PWD:/src abarbu/nativescript tns platform add android
9 | cd $DIR/hello/app
10 | docker run -it -v $PWD:/src abarbu/stack-ghcjs-nativescript:lts-3.0 ghcjs App.hs
11 |
--------------------------------------------------------------------------------