Compare commits

...

12 Commits

Author SHA1 Message Date
Ibby
4aec187e8c 2.2.11 2016-12-06 07:35:04 -05:00
Ibby
d9188446a0 fix(device): fixes device plugin
Breaking change: device property no longer exists
2016-12-06 07:33:40 -05:00
Ibby
7ae6e10375 fix(cordova-property): fixes static properties of classes 2016-12-06 07:33:40 -05:00
Perry Govier
ea53a1923a chore(CI): reverting benign testing change 2016-12-05 17:00:05 -06:00
Perry Govier
f45f34442a ignore failed pushes 2016-12-05 16:50:31 -06:00
Perry Govier
49de11e761 chore(CI): script typo 2016-12-05 16:45:47 -06:00
Perry Govier
c29aaca857 chore(ci): test 2016-12-05 16:43:40 -06:00
Perry Govier
9241339b2c chore(CI): testing something 2016-12-05 16:32:05 -06:00
Perry Govier
9c8b0ceda6 chore(CI): testing a change 2016-12-05 16:26:00 -06:00
Perry Govier
78c226e83d chore(CI): testing something 2016-12-05 16:00:54 -06:00
Perry Govier
ef148d2a68 chore(CI): doh! silly logical mistake 2016-12-05 15:58:13 -06:00
Perry Govier
7fa2f7f364 chore(ci): benign docs change to make sure it goes through CI 2016-12-05 14:36:44 -06:00
4 changed files with 46 additions and 48 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "ionic-native",
"version": "2.2.10",
"version": "2.2.11",
"description": "Native plugin wrappers for Cordova and Ionic with TypeScript, ES6+, Promise and Observable support",
"main": "dist/es5/index.js",
"module": "dist/esm/index.js",

View File

@@ -24,7 +24,8 @@ function run {
cd $SITE_DIR
# if no changes, don't commit
if [[ `git status --porcelain` ]]; then
if ! git diff-index --quiet HEAD --
then
echo "-- No changes detected for the following commit, docs not updated."
echo "https://github.com/driftyco/$CIRCLE_PROJECT_REPONAME/commit/$CIRCLE_SHA1"
else
@@ -37,7 +38,7 @@ function run {
git fetch
git rebase
git push origin master
git push origin master || :
echo "-- Updated docs for $VERSION_NAME succesfully!"
fi

View File

@@ -1,33 +1,7 @@
import { CordovaProperty, Plugin } from './plugin';
declare var window: any;
/**
* @private
*/
export interface IDevice {
/** Get the version of Cordova running on the device. */
cordova: string;
/**
* The device.model returns the name of the device's model or product. The value is set
* by the device manufacturer and may be different across versions of the same product.
*/
model: string;
/** Get the device's operating system name. */
platform: string;
/** Get the device's Universally Unique Identifier (UUID). */
uuid: string;
/** Get the operating system version. */
version: string;
/** Get the device's manufacturer. */
manufacturer: string;
/** Whether the device is running on a simulator. */
isVirtual: boolean;
/** Get the device hardware serial number. */
serial: string;
}
/**
* @name Device
* @description
@@ -38,7 +12,7 @@ export interface IDevice {
* import { Device } from 'ionic-native';
*
*
* console.log('Device UUID is: ' + Device.device.uuid);
* console.log('Device UUID is: ' + Device.uuid);
* ```
*/
@Plugin({
@@ -49,12 +23,39 @@ export interface IDevice {
})
export class Device {
/** Get the version of Cordova running on the device. */
@CordovaProperty
static cordova: string;
/**
* Returns the whole device object.
*
* @returns {Device} The device object.
* The device.model returns the name of the device's model or product. The value is set
* by the device manufacturer and may be different across versions of the same product.
*/
@CordovaProperty
static device: IDevice;
static model: string;
/** Get the device's operating system name. */
@CordovaProperty
static platform: string;
/** Get the device's Universally Unique Identifier (UUID). */
@CordovaProperty
static uuid: string;
/** Get the operating system version. */
@CordovaProperty
static version: string;
/** Get the device's manufacturer. */
@CordovaProperty
static manufacturer: string;
/** Whether the device is running on a simulator. */
@CordovaProperty
static isVirtual: boolean;
/** Get the device hardware serial number. */
@CordovaProperty
static serial: string;
}

View File

@@ -407,31 +407,27 @@ export function CordovaInstance(opts: any = {}) {
*
* Before calling the original method, ensure Cordova and the plugin are installed.
*/
export function CordovaProperty(target: Function, key: string) {
let exists: Function = function(): boolean {
if (!window.cordova) {
cordovaWarn(this.name, null);
return false;
}
let pluginInstance = getPlugin(this.pluginRef);
export function CordovaProperty(target: any, key: string) {
const exists = () => {
let pluginInstance = getPlugin(target.pluginRef);
if (!pluginInstance) {
pluginWarn(this, key);
pluginWarn(target, key);
return false;
}
return true;
};
Object.defineProperty(target, key, {
get: function() {
if (exists) {
return this.pluginRef[key];
get: () => {
if (exists()) {
return getPlugin(target.pluginRef)[key];
} else {
return {};
}
},
set: function(value) {
if (exists) {
this.pluginRef[key] = value;
set: (value) => {
if (exists()) {
getPlugin(target.pluginRef)[key] = value;
}
}
});