From d1099e61a3b867bc8fa3015a62e263c5426f37b8 Mon Sep 17 00:00:00 2001 From: Max Lynch Date: Tue, 5 Nov 2013 09:32:11 -0600 Subject: [PATCH] Moved platform service to services folder --- dist/js/ionic-angular.js | 136 +++++++++--------- .../{directive => service}/ionicPlatform.js | 0 2 files changed, 68 insertions(+), 68 deletions(-) rename js/ext/angular/src/{directive => service}/ionicPlatform.js (100%) diff --git a/dist/js/ionic-angular.js b/dist/js/ionic-angular.js index 1f25e54959..a4e3cb9b74 100644 --- a/dist/js/ionic-angular.js +++ b/dist/js/ionic-angular.js @@ -192,6 +192,74 @@ angular.module('ionic.service.modal', ['ionic.service.templateLoad']) }; }]); ; +(function() { +'use strict'; + +angular.module('ionic.platform', []) + +/** + * The platformProvider makes it easy to set and detect which platform + * the app is currently running on. It has some auto detection built in + * for PhoneGap and Cordova. This provider also takes care of + * initializing some defaults that depend on the platform, such as the + * height of header bars on iOS 7. + */ +.provider('platform', function() { + var platform = 'unknown'; + var isPlatformReady = false; + + if(window.cordova || window.PhoneGap || window.phonegap) { + platform = 'cordova'; + } + + console.log('Detected platform', platform); + + var isReady = function() { + if(platform == 'cordova') { + return window.device; + } + return true; + }; + + // We need to do some stuff as soon as we know the platform, + // like adjust header margins for iOS 7, etc. + setTimeout(function afterReadyWait() { + if(isReady()) { + ionic.Platform.detect(); + } else { + setTimeout(afterReadyWait, 50); + } + }, 10); + + return { + setPlatform: function(p) { + platform = p; + }, + $get: ['$q', '$timeout', function($q, $timeout) { + return { + ready: function(cb) { + var self = this; + var q = $q.defer(); + + $timeout(function readyWait() { + if(isReady()) { + isPlatformReady = true; + q.resolve(); + cb(); + } else { + $timeout(readyWait, 50); + } + }, 50); + + return q.promise; + } + }; + }] + }; +}); + +})(ionic); +; angular.module('ionic.service.popup', ['ionic.service.templateLoad']) @@ -763,74 +831,6 @@ angular.module('ionic.ui.nav', ['ionic.service.templateLoad', 'ionic.service.ges })(); ; -(function() { -'use strict'; - -angular.module('ionic.platform', []) - -/** - * The platformProvider makes it easy to set and detect which platform - * the app is currently running on. It has some auto detection built in - * for PhoneGap and Cordova. This provider also takes care of - * initializing some defaults that depend on the platform, such as the - * height of header bars on iOS 7. - */ -.provider('platform', function() { - var platform = 'unknown'; - var isPlatformReady = false; - - if(window.cordova || window.PhoneGap || window.phonegap) { - platform = 'cordova'; - } - - console.log('Detected platform', platform); - - var isReady = function() { - if(platform == 'cordova') { - return window.device; - } - return true; - }; - - // We need to do some stuff as soon as we know the platform, - // like adjust header margins for iOS 7, etc. - setTimeout(function afterReadyWait() { - if(isReady()) { - ionic.Platform.detect(); - } else { - setTimeout(afterReadyWait, 50); - } - }, 10); - - return { - setPlatform: function(p) { - platform = p; - }, - $get: ['$q', '$timeout', function($q, $timeout) { - return { - ready: function(cb) { - var self = this; - var q = $q.defer(); - - $timeout(function readyWait() { - if(isReady()) { - isPlatformReady = true; - q.resolve(); - cb(); - } else { - $timeout(readyWait, 50); - } - }, 50); - - return q.promise; - } - }; - }] - }; -}); - -})(ionic); -; ; (function() { 'use strict'; diff --git a/js/ext/angular/src/directive/ionicPlatform.js b/js/ext/angular/src/service/ionicPlatform.js similarity index 100% rename from js/ext/angular/src/directive/ionicPlatform.js rename to js/ext/angular/src/service/ionicPlatform.js