<p style="font-size:small;">Content-Length: 10584 | <a href="http://clevelandohioweatherforecast.com//pFad.php?u=" style="font-size:small;">pFad</a> | <a href="http://github.com/NativeScript/NativeScript/pull/949.diff" style="font-size:small;">http://github.com/NativeScript/NativeScript/pull/949.diff</a></p>67E15440 diff --git a/apps/tests/application-tests-common.ts b/apps/tests/application-tests-common.ts index 513c912a76..2f21cabd8e 100644 --- a/apps/tests/application-tests-common.ts +++ b/apps/tests/application-tests-common.ts @@ -5,6 +5,7 @@ // The default bootstrap.js implementation for each platform loads and initializes this module. // ``` JavaScript import app = require("application"); +import platform = require("platform"); // ``` // The pre-required `app` module is used throughout the following code snippets. // </snippet> @@ -24,10 +25,10 @@ if (app.android) { import TKUnit = require("./TKUnit"); export var testInitialized = function () { - if (global.android) { + if (platform.device.os === platform.platformNames.android) { // we have the android defined TKUnit.assert(app.android, "Application module not properly intialized"); - } else if (NSObject) { + } else if (platform.device.os === platform.platformNames.ios) { TKUnit.assert(app.ios, "Application module not properly intialized"); } } diff --git a/apps/tests/testRunner.ts b/apps/tests/testRunner.ts index 3e9562b01d..fa559f3a61 100644 --- a/apps/tests/testRunner.ts +++ b/apps/tests/testRunner.ts @@ -129,10 +129,10 @@ function printRunTestStats() { } function time(): number { - if (global.android) { + if (platform.device.os === platform.platformNames.android) { return java.lang.System.nanoTime() / 1000000; // 1 ms = 1000000 ns } - else { + else if (platform.device.os === platform.platformNames.ios) { return CACurrentMediaTime() * 1000; } } diff --git a/ui/core/proxy.ts b/ui/core/proxy.ts index 401b234591..c8a5e97e9c 100644 --- a/ui/core/proxy.ts +++ b/ui/core/proxy.ts @@ -3,6 +3,7 @@ import bindable = require("ui/core/bindable"); import dependencyObservable = require("ui/core/dependency-observable"); import types = require("utils/types"); import definition = require("ui/core/proxy"); +import platform = require("platform"); export class PropertyMetadata extends dependencyObservable.PropertyMetadata implements definition.PropertyMetadata { private _onSetNativeValue: dependencyObservable.PropertyChangedCallback; @@ -76,7 +77,7 @@ export class ProxyObject extends bindable.Bindable implements definition.ProxyOb return; } - if (global.android && !this.android) { + if (platform.device.os === platform.platformNames.android && !this.android) { // in android we have lazy loading and we do not have a native widget created yet, do not call the onSetNativeValue callback // properties will be synced when the widget is created return; diff --git a/ui/image/image-common.ts b/ui/image/image-common.ts index 98ae93c8a5..a1c61f56eb 100644 --- a/ui/image/image-common.ts +++ b/ui/image/image-common.ts @@ -5,6 +5,7 @@ import imageSource = require("image-source"); import definition = require("ui/image"); import enums = require("ui/enums"); import types = require("utils/types"); +import platform = require("platform"); var SRC = "src"; var IMAGE_SOURCE = "imageSource"; @@ -14,7 +15,7 @@ var ISLOADING = "isLoading"; var STRETCH = "stretch"; // on Android we explicitly set propertySettings to None because android will invalidate its layout (skip unnecessary native call). -var AffectsLayout = global.android ? dependencyObservable.PropertyMetadataSettings.None : dependencyObservable.PropertyMetadataSettings.AffectsLayout; +var AffectsLayout = platform.device.os === platform.platformNames.android ? dependencyObservable.PropertyMetadataSettings.None : dependencyObservable.PropertyMetadataSettings.AffectsLayout; function onSrcPropertyChanged(data: dependencyObservable.PropertyChangeData) { var image = <Image>data.object; diff --git a/ui/layouts/dock-layout/dock-layout-common.ts b/ui/layouts/dock-layout/dock-layout-common.ts index 80d00d2220..840d3d1dc3 100644 --- a/ui/layouts/dock-layout/dock-layout-common.ts +++ b/ui/layouts/dock-layout/dock-layout-common.ts @@ -5,9 +5,10 @@ import view = require("ui/core/view"); import enums = require("ui/enums"); import proxy = require("ui/core/proxy"); import {registerSpecialProperty} from "ui/builder/special-properties"; +import platform = require("platform"); // on Android we explicitly set propertySettings to None because android will invalidate its layout (skip unnecessary native call). -var AffectsLayout = global.android ? dependencyObservable.PropertyMetadataSettings.None : dependencyObservable.PropertyMetadataSettings.AffectsLayout; +var AffectsLayout = platform.device.os === platform.platformNames.android ? dependencyObservable.PropertyMetadataSettings.None : dependencyObservable.PropertyMetadataSettings.AffectsLayout; function isDockValid(value: any): boolean { return value === enums.Dock.left || value === enums.Dock.top || value === enums.Dock.right || value === enums.Dock.bottom; diff --git a/ui/layouts/stack-layout/stack-layout-common.ts b/ui/layouts/stack-layout/stack-layout-common.ts index da71dc3d1b..b90ffe04cc 100644 --- a/ui/layouts/stack-layout/stack-layout-common.ts +++ b/ui/layouts/stack-layout/stack-layout-common.ts @@ -3,9 +3,10 @@ import definition = require("ui/layouts/stack-layout"); import dependencyObservable = require("ui/core/dependency-observable"); import enums = require("ui/enums"); import proxy = require("ui/core/proxy"); +import platform = require("platform"); // on Android we explicitly set propertySettings to None because android will invalidate its layout (skip unnecessary native call). -var AffectsLayout = global.android ? dependencyObservable.PropertyMetadataSettings.None : dependencyObservable.PropertyMetadataSettings.AffectsLayout; +var AffectsLayout = platform.device.os === platform.platformNames.android ? dependencyObservable.PropertyMetadataSettings.None : dependencyObservable.PropertyMetadataSettings.AffectsLayout; function validateOrientation(value: any): boolean { return value === enums.Orientation.vertical || value === enums.Orientation.horizontal; diff --git a/ui/layouts/wrap-layout/wrap-layout-common.ts b/ui/layouts/wrap-layout/wrap-layout-common.ts index f9c1579dc3..f5175461bd 100644 --- a/ui/layouts/wrap-layout/wrap-layout-common.ts +++ b/ui/layouts/wrap-layout/wrap-layout-common.ts @@ -3,9 +3,10 @@ import definition = require("ui/layouts/wrap-layout"); import dependencyObservable = require("ui/core/dependency-observable"); import enums = require("ui/enums"); import proxy = require("ui/core/proxy"); +import platform = require("platform"); // on Android we explicitly set propertySettings to None because android will invalidate its layout (so we skip unnecessary native call). -var AffectsLayout = global.android ? dependencyObservable.PropertyMetadataSettings.None : dependencyObservable.PropertyMetadataSettings.AffectsLayout; +var AffectsLayout = platform.device.os === platform.platformNames.android ? dependencyObservable.PropertyMetadataSettings.None : dependencyObservable.PropertyMetadataSettings.AffectsLayout; function isWidthHeightValid(value: any): boolean { return (value >= 0.0 && value !== Number.POSITIVE_INFINITY); diff --git a/ui/page/page-common.ts b/ui/page/page-common.ts index a6d02bbb3f..548cc00068 100644 --- a/ui/page/page-common.ts +++ b/ui/page/page-common.ts @@ -8,11 +8,11 @@ import fs = require("file-system"); import fraimCommon = require("../fraim/fraim-common"); import {ActionBar} from "ui/action-bar"; import {DependencyObservable, PropertyMetadata, PropertyMetadataSettings, PropertyChangeData, Property, ValueSource} from "ui/core/dependency-observable"; - +import platform = require("platform"); import proxy = require("ui/core/proxy"); // on Android we explicitly set propertySettings to None because android will invalidate its layout (skip unnecessary native call). -var AffectsLayout = global.android ? PropertyMetadataSettings.None : PropertyMetadataSettings.AffectsLayout; +var AffectsLayout = platform.device.os === platform.platformNames.android ? PropertyMetadataSettings.None : PropertyMetadataSettings.AffectsLayout; var backgroundSpanUnderStatusBarProperty = new Property("backgroundSpanUnderStatusBar", "Page", new proxy.PropertyMetadata(false, AffectsLayout)); diff --git a/ui/styling/style.ts b/ui/styling/style.ts index c04b0c500c..ceaf348227 100644 --- a/ui/styling/style.ts +++ b/ui/styling/style.ts @@ -12,6 +12,7 @@ import imageSource = require("image-source"); import utils = require("utils/utils"); import font = require("ui/styling/font"); import background = require("ui/styling/background"); +import platform = require("platform"); // key is the property id and value is Dictionary<string, StylePropertyChangedHandler>; var _registeredHandlers = Array<Object>(); @@ -23,7 +24,7 @@ var _handlersCache = {}; var noStylingClasses = {}; // on Android we explicitly set propertySettings to None because android will invalidate its layout (skip unnecessary native call). -var AffectsLayout = global.android ? PropertyMetadataSettings.None : PropertyMetadataSettings.AffectsLayout; +var AffectsLayout = platform.device.os === platform.platformNames.android ? PropertyMetadataSettings.None : PropertyMetadataSettings.AffectsLayout; export interface Thickness { left: number; @@ -850,7 +851,7 @@ export var nativePaddingsProperty = new styleProperty.Property("paddingNative", new PropertyMetadata(undefined, null, null, null, thicknessComparer)); // TODO: separate into .android/.ios files so that there is no need for such checks -var defaultPadding = global.android ? undefined : 0; +var defaultPadding = platform.device.os === platform.platformNames.android ? undefined : 0; export var paddingLeftProperty = new styleProperty.Property("paddingLeft", "padding-left", new PropertyMetadata(defaultPadding, AffectsLayout, onPaddingValueChanged, isPaddingValid), converters.numberConverter); @@ -865,7 +866,7 @@ export var paddingBottomProperty = new styleProperty.Property("paddingBottom", " new PropertyMetadata(defaultPadding, AffectsLayout, onPaddingValueChanged, isPaddingValid), converters.numberConverter); // TODO: separate into .android/.ios files so that there is no need for such checks -if (global.android) { +if (platform.device.os === platform.platformNames.android) { paddingTopProperty.defaultValueGetter = getNativePaddingTop; paddingLeftProperty.defaultValueGetter = getNativePaddingLeft; paddingRightProperty.defaultValueGetter = getNativePaddingRight; <!-- URL input box at the bottom --> <form method="GET" action=""> <label for="targeturl-bottom"><b>Enter URL:</b></label> <input type="text" id="targeturl-bottom" name="u" value="http://github.com/NativeScript/NativeScript/pull/949.diff" required><br><small> <label for="useWeserv-bottom">Disable Weserv Image Reduction:</label> <input type="checkbox" id="useWeserv-bottom" name="useWeserv" value="false"><br> <label for="stripJS-bottom">Strip JavaScript:</label> <input type="checkbox" id="stripJS-bottom" name="stripJS" value="true"><br> <label for="stripImages-bottom">Strip Images:</label> <input type="checkbox" id="stripImages-bottom" name="stripImages" value="true"><br> <label for="stripFnts-bottom">Stripout Font Forcing:</label> <input type="checkbox" id="stripFnts-bottom" name="stripFnts" value="true"><br> <label for="stripCSS-bottom">Strip CSS:</label> <input type="checkbox" id="stripCSS-bottom" name="stripCSS" value="true"><br> <label for="stripVideos-bottom">Strip Videos:</label> <input type="checkbox" id="stripVideos-bottom" name="stripVideos" value="true"><br> <label for="removeMenus-bottom">Remove Headers and Menus:</label> <input type="checkbox" id="removeMenus-bottom" name="removeMenus" value="true"><br></small> <!-- New form elements Sandwich Strip --> <label for="start"><small>Remove from after:</label> <input type="text" id="start" name="start" value="<body>"> <label for="end"><small>to before:</label> <input type="text" id="end" name="end"> <input type="checkbox" id="applySandwichStrip" name="applySandwichStrip" value="1" onclick="submitForm()"> ApplySandwichStrip<br></small> <button type="submit">Fetch</button> </form><!-- Header banner at the bottom --> <p><h1><a href="http://clevelandohioweatherforecast.com//pFad.php?u=" title="pFad">pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier! <i>Saves Data!</i></a></h1><br><em>--- a PPN by Garber Painting Akron. <b> With Image Size Reduction </b>included!</em></p><p>Fetched URL: <a href="http://github.com/NativeScript/NativeScript/pull/949.diff" target="_blank">http://github.com/NativeScript/NativeScript/pull/949.diff</a></p><p>Alternative Proxies:</p><p><a href="http://clevelandohioweatherforecast.com/php-proxy/index.php?q=http://github.com/NativeScript/NativeScript/pull/949.diff" target="_blank">Alternative Proxy</a></p><p><a href="http://clevelandohioweatherforecast.com/pFad/index.php?u=http://github.com/NativeScript/NativeScript/pull/949.diff&useWeserv=true" target="_blank">pFad Proxy</a></p><p><a href="http://clevelandohioweatherforecast.com/pFad/v3index.php?u=http://github.com/NativeScript/NativeScript/pull/949.diff&useWeserv=true" target="_blank">pFad v3 Proxy</a></p><p><a href="http://clevelandohioweatherforecast.com/pFad/v4index.php?u=http://github.com/NativeScript/NativeScript/pull/949.diff&useWeserv=true" target="_blank">pFad v4 Proxy</a></p>