refractor(): use es6 features

tor-es6'
This commit is contained in:
Ibrahim Hadeed 2016-08-27 14:56:34 -04:00
commit 13de69080a
No known key found for this signature in database
GPG Key ID: 0431793F665481A4

View File

@ -218,107 +218,107 @@ export * from './plugins/plugin';
// Window export to use outside of a module loading system // Window export to use outside of a module loading system
window['IonicNative'] = { window['IonicNative'] = {
ActionSheet: ActionSheet, ActionSheet,
AdMob: AdMob, AdMob,
AndroidFingerprintAuth: AndroidFingerprintAuth, AndroidFingerprintAuth,
AppAvailability: AppAvailability, AppAvailability,
AppRate: AppRate, AppRate,
AppVersion: AppVersion, AppVersion,
Badge: Badge, Badge,
BackgroundGeolocation: BackgroundGeolocation, BackgroundGeolocation,
BackgroundMode: BackgroundMode, BackgroundMode,
BarcodeScanner: BarcodeScanner, BarcodeScanner,
Base64ToGallery: Base64ToGallery, Base64ToGallery,
BatteryStatus: BatteryStatus, BatteryStatus,
Brightness: Brightness, Brightness,
BLE: BLE, BLE,
BluetoothSerial: BluetoothSerial, BluetoothSerial,
Calendar: Calendar, Calendar,
CallNumber: CallNumber, CallNumber,
CanvasCamera: CanvasCamera, CanvasCamera,
Camera: Camera, Camera,
CameraPreview: CameraPreview, CameraPreview,
CardIO: CardIO, CardIO,
Clipboard: Clipboard, Clipboard,
CodePush: CodePush, CodePush,
Contacts: Contacts, Contacts,
Crop: Crop, Crop,
DatePicker: DatePicker, DatePicker,
DBMeter: DBMeter, DBMeter,
Deeplinks: Deeplinks, Deeplinks,
Device: Device, Device,
DeviceAccounts: DeviceAccounts, DeviceAccounts,
DeviceMotion: DeviceMotion, DeviceMotion,
DeviceOrientation: DeviceOrientation, DeviceOrientation,
Dialogs: Dialogs, Dialogs,
Diagnostic: Diagnostic, Diagnostic,
EmailComposer: EmailComposer, EmailComposer,
EstimoteBeacons: EstimoteBeacons, EstimoteBeacons,
Facebook: Facebook, Facebook,
File: File, File,
FileChooser: FileChooser, FileChooser,
FileOpener: FileOpener, FileOpener,
Flashlight: Flashlight, Flashlight,
Geofence: Geofence, Geofence,
Geolocation: Geolocation, Geolocation,
Globalization: Globalization, Globalization,
GooglePlus: GooglePlus, GooglePlus,
GoogleMap: GoogleMap, GoogleMap,
GoogleAnalytics: GoogleAnalytics, GoogleAnalytics,
Hotspot: Hotspot, Hotspot,
Httpd: Httpd, Httpd,
IBeacon: IBeacon, IBeacon,
ImagePicker: ImagePicker, ImagePicker,
ImageResizer: ImageResizer, ImageResizer,
InAppBrowser: InAppBrowser, InAppBrowser,
InAppPurchase: InAppPurchase, InAppPurchase,
Instagram: Instagram, Instagram,
IsDebug: IsDebug, IsDebug,
Keyboard: Keyboard, Keyboard,
LaunchNavigator: LaunchNavigator, LaunchNavigator,
LocalNotifications: LocalNotifications, LocalNotifications,
Market: Market, Market,
MediaCapture: MediaCapture, MediaCapture,
MediaPlugin: MediaPlugin, MediaPlugin,
Mixpanel: Mixpanel, Mixpanel,
MusicControls: MusicControls, MusicControls,
NativeAudio: NativeAudio, NativeAudio,
NativePageTransitions: NativePageTransitions, NativePageTransitions,
NativeStorage: NativeStorage, NativeStorage,
Network: Network, Network,
PayPal: PayPal, PayPal,
NFC: NFC, NFC,
Printer: Printer, Printer,
Push: Push, Push,
OneSignal: OneSignal, OneSignal,
PhotoViewer: PhotoViewer, PhotoViewer,
ScreenOrientation: ScreenOrientation, ScreenOrientation,
PinDialog: PinDialog, PinDialog,
PowerManagement: PowerManagement, PowerManagement,
SafariViewController: SafariViewController, SafariViewController,
Screenshot: Screenshot, Screenshot,
SecureStorage: SecureStorage, SecureStorage,
Shake: Shake, Shake,
Sim: Sim, Sim,
SMS: SMS, SMS,
SocialSharing: SocialSharing, SocialSharing,
SpinnerDialog: SpinnerDialog, SpinnerDialog,
Splashscreen: Splashscreen, Splashscreen,
SQLite: SQLite, SQLite,
StatusBar: StatusBar, StatusBar,
StreamingMedia: StreamingMedia, StreamingMedia,
ThreeDeeTouch: ThreeDeeTouch, ThreeDeeTouch,
Toast: Toast, Toast,
TouchID: TouchID, TouchID,
Transfer: Transfer, Transfer,
TextToSpeech: TextToSpeech, TextToSpeech,
TwitterConnect: TwitterConnect, TwitterConnect,
VideoEditor: VideoEditor, VideoEditor,
VideoPlayer: VideoPlayer, VideoPlayer,
Vibration: Vibration, Vibration,
WebIntent: WebIntent, WebIntent,
YoutubeVideoPlayer: YoutubeVideoPlayer, YoutubeVideoPlayer,
Zip: Zip Zip
}; };
initAngular1(window['IonicNative']); initAngular1(window['IonicNative']);
@ -327,16 +327,16 @@ initAngular1(window['IonicNative']);
// log an error if it didn't fire in a reasonable amount of time. Generally, // log an error if it didn't fire in a reasonable amount of time. Generally,
// when this happens, developers should remove and reinstall plugins, since // when this happens, developers should remove and reinstall plugins, since
// an inconsistent plugin is often the culprit. // an inconsistent plugin is often the culprit.
let before = +new Date; const before = Date.now();
let didFireReady = false; let didFireReady = false;
document.addEventListener('deviceready', function() { document.addEventListener('deviceready', () => {
console.log('DEVICE READY FIRED AFTER', (+new Date - before), 'ms'); console.log('DEVICE READY FIRED AFTER', (Date.now() - before), 'ms');
didFireReady = true; didFireReady = true;
}); });
setTimeout(function() { setTimeout(() => {
if (!didFireReady && window.cordova) { if (!didFireReady && window.cordova) {
console.warn('Native: deviceready did not fire within ' + DEVICE_READY_TIMEOUT + 'ms. This can happen when plugins are in an inconsistent state. Try removing plugins from plugins/ and reinstalling them.'); console.warn(`Native: deviceready did not fire within ${DEVICE_READY_TIMEOUT}ms. This can happen when plugins are in an inconsistent state. Try removing plugins from plugins/ and reinstalling them.`);
} }
}, DEVICE_READY_TIMEOUT); }, DEVICE_READY_TIMEOUT);