Sha256: b415ce86d5a47685e6d4dfb82942bfe9ffa328e50ba71b0d87150c4ccfa27821

Contents?: true

Size: 1.63 KB

Versions: 11

Compression:

Stored size: 1.63 KB

Contents

// ==========================================================================
// Project:   SproutCore - JavaScript Application Framework
// Copyright: ©2006-2011 Strobe Inc. and contributors.
//            Portions ©2008-2011 Apple Inc. All rights reserved.
// License:   Licensed under MIT license (see license.js)
// ==========================================================================

SC.mixin(SC.platform,
/** @scope SC.platform */ {

  /**
    YES if the ondeviceorientation event on window is supported.

    @type Boolean
    @default NO
  */
  supportsGyroscope: ('ondeviceorientation' in window),

  /**
    YES if the ondeviceorientation event on window has actually been
    fired. Some platforms have the event but will never fire it.

    @type Boolean
    @default NO
  */
  hasGyroscope: NO,

  /**
    YES if the ondevicemotion event on window is supported.

    @type Boolean
    @default NO
  */
  supportsAccelerometer: ('ondevicemotion' in window),

  /**
    YES if the ondevicemotion event on window has actually been
    fired. Some platforms have the event but will never fire it.

    @type Boolean
    @default NO
  */
  hasAccelerometer: NO,

  /*
    TODO [CC] Find out the actual values on a multitude of devices.
              We would want this to be a 'normal' use value...
  */
  /**
    @type Number
    @default -10
  */
  accelerationMinimum: function() {
    // we may want finer grained control of this by platform later
    return -10;
  }(),

  /**
    @type Number
    @default 10
  */
  accelerationMaximum: function() {
    // we may want finer grained control of this by platform later
    return 10;
  }()

});

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
sproutcore-1.11.0 lib/frameworks/sproutcore/frameworks/experimental/frameworks/device_motion/platform.js
sproutcore-1.11.0.rc3 lib/frameworks/sproutcore/frameworks/experimental/frameworks/device_motion/platform.js
sproutcore-1.11.0.rc2 lib/frameworks/sproutcore/frameworks/experimental/frameworks/device_motion/platform.js
sproutcore-1.11.0.rc1 lib/frameworks/sproutcore/frameworks/experimental/frameworks/device_motion/platform.js
sproutcore-1.10.3.1 lib/frameworks/sproutcore/frameworks/experimental/frameworks/device_motion/platform.js
sproutcore-1.10.2 lib/frameworks/sproutcore/frameworks/experimental/frameworks/device_motion/platform.js
sproutcore-1.10.1 lib/frameworks/sproutcore/frameworks/experimental/frameworks/device_motion/platform.js
sproutcore-1.10.0 lib/frameworks/sproutcore/frameworks/experimental/frameworks/device_motion/platform.js
sproutcore-1.10.0.rc.3 lib/frameworks/sproutcore/frameworks/experimental/frameworks/device_motion/platform.js
sproutcore-1.10.0.rc.2 lib/frameworks/sproutcore/frameworks/experimental/frameworks/device_motion/platform.js
sproutcore-1.10.0.rc.1 lib/frameworks/sproutcore/frameworks/experimental/frameworks/device_motion/platform.js