소스 검색

Device Namespace removed

soyjavi 13 년 전
부모
커밋
fe07f37192

+ 0 - 55
src/device/Lungo.Device.Audio.js

@@ -1,55 +0,0 @@
- /**
- * Audio API (HTML5 Feature)
- * Pending to final SPEC, now it's a Phonegap Wrapper
- *
- *
- * @namespace LUNGO.Device
- * @class Audio
- *
- * @author Javier Jimenez Villar <javi@tapquo.com> || @soyjavi
- */
-
-LUNGO.Device.Audio = (function(lng, undefined) {
-    var _background = document.createElement('audio');
-    var _sound = document.createElement('audio');
-
-    /**
-    * Plays music in background with automatic rewind.
-    *
-    * @method background
-    *
-    * @param  {string} Source of sound file
-     */
-    var background = function(source) {
-        if (source) {
-            _setSourceAndPlay(_sound, source);
-            _background.addEventListener('ended', function(){
-                this.currentTime = 0;
-            }, false);
-        }
-        else {
-            _background.pause();
-        }
-    };
-
-    /**
-    * Play a given sound
-    *
-    * @method play
-    *
-    * @param  {string} Source of sound file
-     */
-    var play = function(source) {
-        _setSourceAndPlay(_sound, source);
-    };
-
-    _setSourceAndPlay = function(container, source) {
-        container.setAttribute('src', source);
-        container.play();
-    };
-
-    return {
-        background: background,
-        play: play
-    }
-})(LUNGO);

+ 0 - 17
src/device/Lungo.Device.Camera.js

@@ -1,17 +0,0 @@
-/**
- * Camera API (HTML5 Feature)
- * Pending to final SPEC, now it's a Phonegap Wrapper
- *
- * @namespace LUNGO.Device
- * @class Camera
- *
- * @author Javier Jimenez Villar <javi@tapquo.com> || @soyjavi
- */
-
-LUNGO.Device.Camera = (function(lng, undefined) {
-
-    return {
-
-    };
-
-})(LUNGO);

+ 0 - 16
src/device/Lungo.Device.Connection.js

@@ -1,16 +0,0 @@
-/**
- * Connection API (HTML5 Feature)
- *
- * @namespace LUNGO.Device
- * @class Connection
- *
- * @author Javier Jimenez Villar <javi@tapquo.com> || @soyjavi
- */
-
-LUNGO.Device.Connection = (function(lng, undefined) {
-
-    return {
-
-    };
-
-})(LUNGO);

+ 0 - 18
src/device/Lungo.Device.Contacts.js

@@ -1,18 +0,0 @@
-/**
- * Contacts API (HTML5 Feature)
- * Pending to final SPEC, now it's a Phonegap Wrapper
- * http://www.w3.org/TR/contacts-api/
- *
- * @namespace LUNGO.Device
- * @class Contacts
- *
- * @author Javier Jimenez Villar <javi@tapquo.com> || @soyjavi
- */
-
-LUNGO.Device.Contacts = (function(lng, undefined) {
-
-    return {
-
-    };
-
-})(LUNGO);

+ 0 - 130
src/device/Lungo.Device.Gps.js

@@ -1,130 +0,0 @@
-/**
- * Geolocation API (HTML5 Feature)
- * Pending to final SPEC, now it's a Phonegap Wrapper
- * http://www.w3.org/TR/geolocation-API/
- *
- * @namespace LUNGO.Device
- * @class Gps
- *
- * @author Javier Jimenez Villar <javi@tapquo.com> || @soyjavi
- */
-
-LUNGO.Device.Gps = (function(lng, undefined) {
-
-    var _position = null;
-    var _watcher = null;
-
-    var CALLBACK = {
-        success: null,
-        error: null
-    };
-
-    var GPS_OPTIONS = {
-        enableHighAccuracy: false,
-        timeout: 10000,
-        maximumAge: 60000
-    };
-
-    /**
-     * @ToDo
-     *
-     * @method get
-     *
-     * @param {Function} Callback
-     */
-    var get = function(callbacks, options) {
-        if (_isReady()) {
-            _bindCallbacks(callbacks);
-            navigator.geolocation.getCurrentPosition(_success, _error, options);
-        }
-    };
-
-    /**
-     * @ToDo
-     *
-     * @method get
-     *
-     * @param {Function} @ToDo
-     * @param {object} @ToDo
-     */
-    var watch = function(callbacks, options) {
-        if (_isReady()) {
-            _bindCallbacks(callbacks);
-            _watcher = navigator.geolocation.watchPosition(_success, _error, options);
-        }
-    };
-
-    /**
-     * @ToDo
-     *
-     * @method position
-     *
-     */
-    var position = function() {
-        return _position;
-    };
-
-    /**
-     * @ToDo
-     *
-     * @method clear
-     */
-    var stop = function() {
-        _clearPosition();
-    };
-
-    /**
-     * Console system to display messages when you are in debug mode.
-     *
-     * @method log
-     *
-     * @param {number} Severity based in (1)Log, (2)Warn, (>2)Error
-     * @param {string} Message to show in console
-     */
-    var address = function(latitude, longitude, callback) {
-        // @ToDo: Check Social Analytics RESTful
-    };
-
-    var _isReady = function() {
-        if (navigator.geolocation) {
-            _clearPosition();
-            return true;
-        } else {
-            lng.core.log(3, 'Lungo.Device.Gps [ERROR]: navigator.geolocation is innacesible.')
-            return false;
-        }
-    };
-
-    var _clearPosition = function() {
-        _position = null;
-
-        if (_watcher) {
-            navigator.geolocation.clearWatch(_watcher);
-            _watcher = null;
-        }
-    };
-
-    var _bindCallbacks = function(callbacks) {
-        CALLBACK.success = (callbacks.success || null);
-        CALLBACK.error = (callbacks.error || null);
-    };
-
-    var _success = function(position) {
-        _position = position.coords;
-        CALLBACK.success.call(CALLBACK.success, position);
-    };
-
-    var _error = function(error) {
-        _clearPosition();
-        CALLBACK.error.call(CALLBACK.error, error);
-    };
-
-    return {
-        get: get,
-        watch: watch,
-        position: position,
-        address: address,
-        stop: stop
-    }
-
-})(LUNGO);

+ 0 - 70
src/device/Lungo.Device.Notification.js

@@ -1,70 +0,0 @@
-/**
- * Notifacion API (HTML5 Feature)
- * Pending to final SPEC, now it's a Phonegap Wrapper
- *
- * @namespace LUNGO.Device
- * @class Notification
- *
- * @author Javier Jimenez Villar <javi@tapquo.com> || @soyjavi
- */
-
-LUNGO.Device.Notification = (function(lng, undefined) {
-
-    /**
-     * Shows a custom alert or dialog box.
-     *
-     * @method alert
-     *
-     * @param {string} Dialog message
-     * @param {Function} Callback to invoke when alert dialog is dismissed.
-     * @param {string} Dialog title (Optional, Default: "Alert")
-     * @param {string} Button name (Optional, Default: "OK")
-     */
-    var alert = function(message, callback, title, buttonName) {
-        navigator.notification.alert(message, callback, title, buttonName)
-    };
-
-    /**
-     * Shows a customizable confirmation dialog box.
-     *
-     * @method confirm
-     *
-     * @param {string} Dialog message @ToDo
-     * @param {function} Callback to invoke with index of button pressed (1, 2 or 3).
-     * @param {string} Dialog title (Optional, Default: "Confirm")
-     * @param {string} Comma separated string with button labels (Optional, Default: "OK,Cancel")
-     */
-    var confirm = function(message, callback, title, buttonLabels) {
-        navigator.notification.confirm(message, callback, title, buttonLabels)
-    };
-
-    /**
-     * The device will play a beep sound.
-     *
-     * @method beep
-     *
-     * @param {number} The number of times to repeat the beep
-     */
-    var beep = function(times) {
-        navigator.notification.beep(times)
-    };
-
-    /**
-     * Vibrates the device for the specified amount of time.
-     *
-     * @method vibrate
-     *
-     * @param {number} Milliseconds to vibrate the device. 1000 milliseconds equals 1 second
-     */
-    var vibrate = function(milliseconds) {
-        navigator.notification.vibrate(milliseconds)
-    };
-
-    return {
-        alert: alert,
-        confirm: confirm,
-        beep: beep,
-        vibrate: vibrate
-    };
-
-})(LUNGO);

+ 0 - 46
src/device/Lungo.Device.Orientation.js

@@ -1,46 +0,0 @@
-/**
- * Orientation Events API (HTML5 Feature)
- * DOM events that provide information about the physical orientation and
- * motion of a hosting device.
- * http://www.w3.org/TR/orientation-event/
- *
- * @namespace LUNGO.Device
- * @class Camera
- *
- * @author Javier Jimenez Villar <javi@tapquo.com> || @soyjavi
- */
-
-LUNGO.Device.Orientation = (function(lng, undefined) {
-
-    var EVENTS = {
-        ORIENTATION: 'deviceorientation',
-        MOTION: 'devicemotion',
-        COMPASS_CALIBRATION: 'compassneedscalibration'
-    };
-
-    var onChange = function(callback) {
-        _addEvent(EVENTS.ORIENTATION, callback);
-    };
-
-    var onMotion = function(callback) {
-        _addEvent(EVENTS.MOTION, callback);
-    };
-
-    var onNeedsCalibration = function(callback) {
-        _addEvent(EVENTS.COMPASS_CALIBRATION, callback);
-    };
-
-    var _addEvent = function(event, callback) {
-        //@todo: Cross-browser: IE fix
-        window.addEventListener(event, function(event) {
-            callback.apply(callback, event);
-        }, true);
-    };
-
-    return {
-        onChange: onChange,
-        onMotion: onMotion,
-        onNeedsCalibration: onNeedsCalibration
-    };
-
-})(LUNGO);