Hybrid mobile app (Androind / iOS) buit with the Ionic Framework and Angular JS.

ng-cordova-mocks.min.js 23KB

    /*! * ngCordova * v0.1.17-alpha * Copyright 2014 Drifty Co. http://drifty.com/ * See LICENSE in this repository for license information */ !function(){var r=angular.module("ngCordovaMocks",[]);r.factory("$cordovaAppVersion",["$q",function(r){var e=!1;return{throwsError:e,getAppVersion:function(){var e=r.defer();return e.resolve("mock v"),e.promise}}}]),r.factory("$cordovaBarcodeScanner",["$q",function(r){var e=!1,t="",o="",i=!1;return{throwsError:e,scannedText:t,scannedFormat:o,wasCancelled:i,scan:function(){var e=r.defer();return this.throwsError?e.reject("There was an error scanning."):e.resolve({text:this.scannedText,format:this.scannedFormat,cancelled:this.wasCancelled}),e.promise},encode:function(e,t){this.scannedFormat=e,this.scannedText=t;var o=r.defer();return this.throwsError?o.reject("There was an error encoding the data."):o.resolve(),o.promise}}}]),r.factory("$cordovaBLE",["$q","$timeout",function(r,e){var t={name:"Test Device",id:"AA:BB:CC:DD:EE:FF",advertising:[2,1,6,3,3,15,24,8,9,66,97,116,116,101,114,121],rssi:-55},o={name:"Test Device",id:"AA:BB:CC:DD:EE:FF",advertising:[2,1,6,3,3,15,24,8,9,66,97,116,116,101,114,121],rssi:-55,services:["1800","1801","180f"],characteristics:[{service:"1800",characteristic:"2a00",properties:["Read"]},{service:"1800",characteristic:"2a01",properties:["Read"]},{service:"1801",characteristic:"2a05",properties:["Read"]},{service:"180f",characteristic:"2a19",properties:["Read"],descriptors:[{uuid:"2901"},{uuid:"2904"}]}]},i=new ArrayBuffer(8);return{scan:function(o,i){var n=r.defer();return e(function(){n.resolve(t)},1e3*i),n.promise},connect:function(t){var i=r.defer();return e(function(){i.resolve(o)},1500),i.promise},disconnect:function(t){var o=r.defer();return e(function(){o.resolve(!0)},500),o.promise},read:function(t,o,n){var s=r.defer();return e(function(){s.resolve(i)},100),s.promise},write:function(t,o,i,n){var s=r.defer();return e(function(){s.resolve(!0)},100),s.promise},writeCommand:function(t,o,i,n){var s=r.defer();return e(function(){s.resolve(!0)},100),s.promise},notify:function(t,o,i){var n=r.defer();return e(function(){n.resolve(!0)},100),n.promise},indicate:function(t,o,i){var n=r.defer();return e(function(){n.resolve(!0)},100),n.promise},isConnected:function(e){var t=r.defer();return t.resolve(!0),t.promise},isEnabled:function(){var e=r.defer();return e.resolve(!0),e.promise}}}]),r.factory("$cordovaBrightness",["$q",function(r){var e=100;return{get:function(){var t=r.defer();return t.resolve(e),t.promise},set:function(t){var o=r.defer();return e=t,o.resolve("OK"),o.promise},setKeepScreenOn:function(e){var t=r.defer();return t.resolve("OK"),t.promise}}}]),r.factory("$cordovaCamera",["$q",function(r){var e=!1,t="";return{throwsError:e,imageData:t,getPicture:function(e){var t=r.defer();return this.throwsError?t.reject("There was an error getting the picture."):(e&&(e=e),t.resolve(this.imageData)),t.promise}}}]),r.factory("$cordovaCapture",["$q",function(r){var e=!1;return{throwsError:e,captureAudio:function(){var e=r.defer();return this.throwsError?e.reject("There was an error capturing the audio."):e.resolve(),e.promise},captureImage:function(){var e=r.defer();return this.throwsError?e.reject("There was an error capturing the image."):e.resolve(),e.promise},captureVideo:function(){var e=r.defer();return this.throwsError?e.reject("There was an error capturing the video."):e.resolve(),e.promise}}}]),r.factory("$cordovaContacts",["$q",function(r){var e=!1,t=[];return{throwsError:e,contacts:t,save:function(e){var t=r.defer();if(this.throwsError)t.reject("There was an error saving the contact.");else{for(var o=null,i=0;i<this.contacts.length;i++)if(this.contacts[i].id===e.id){o=i;break}null===o?(this.contacts.push(e),t.resolve()):t.reject("Contact already exists.")}return t.promise},remove:function(e){var t=r.defer();if(this.throwsError)t.reject("There was an error saving the contact.");else{for(var o=null,i=0;i<this.contacts.length;i++)if(this.contacts[i].id===e.id){o=i;break}null===o?t.reject("Unable to find contact."):(this.contacts.splice(o,1),t.resolve())}return t.promise},find:function(e){var t=r.defer();if(this.throwsError)t.reject("There was an error finding the contact.");else{var o=e.fields||["id","displayName"];if(delete e.fields,o)if("*"===o)t.resolve(this.contacts);else{for(var i=[],n=0;n<this.contacts.length;n++)for(var s in this.contacts[n])var a=this.contacts[n][s];t.resolve(i)}else t.reject("ContactError.INVALID_ARGUMENT_ERROR")}return t.promise}}}]),r.factory("$cordovaDatePicker",["$q",function(r){return{show:function(e){var t=r.defer();return e=e||{date:new Date,mode:"date"},t.resolve(e.date),t.promise}}}]),r.factory("$cordovaDevice",function(){var r="",e="",t="",o="",i="",n="";return{device:r,cordova:e,model:t,platform:o,uuid:i,version:n,getDevice:function(){return this.device},getCordova:function(){return this.cordova},getModel:function(){return this.model},getPlatform:function(){return this.platform},getUUID:function(){return this.uuid},getVersion:function(){return this.version}}}),r.factory("$cordovaDeviceMotion",["$interval","$q",function(r,e){var t=null,o=!1,i=[],n=[];return{currentAcceleration:t,throwsError:o,positions:i,watchIntervals:n,getCurrentAcceleration:function(){var r=e.defer();return this.throwsError?r.reject("There was an error getting the current acceleration."):r.resolve(this.currentAcceleration),r.promise},watchAcceleration:function(t){var o=e.defer(),i=Math.floor(1e6*Math.random()+1);if(this.positions=[],self=this,this.throwsError)o.reject("There was an error watching the current acceleration.");else{var n=1e4;t&&t.frequency&&(n=t.frequency),this.watchIntervals.push(r(function(){self.throwsError&&o.reject("There was an error watching the acceleration.");var r=Math.floor(100*Math.random()+1),e=Math.floor(100*Math.random()+1),t=Math.floor(100*Math.random()+1),i={x:r,y:e,z:t,timestamp:Date.now()};self.positions.push(i),o.notify(i)},n))}return{watchId:i,promise:o.promise}},clearWatch:function(t){var o=e.defer();if(t)if(this.throwsError)o.reject("Unable to clear watch.");else{for(var i=-1,s=0;s<this.watchIntervals.length;s++)if(this.watchIntervals[s].watchId===t){r.cancel(n[s].interval),i=s;break}-1!==i&&this.watchIntervals.splice(i,1)}else o.reject("Unable to clear watch. No watch ID provided.");return o.promise}}}]),r.factory("$cordovaDeviceOrientation",["$interval","$q",function(r,e){var t=null,o=!1,i=[],n=[];return{currentHeading:t,throwsError:o,readings:i,watchIntervals:n,getCurrentHeading:function(){var r=e.defer();return this.throwsError?r.reject("There was an error getting the current heading."):r.resolve(this.currentHeading),r.promise},watchHeading:function(t){var o=e.defer(),i=Math.floor(1e6*Math.random()+1),s=this;if(s.readings=[],s.throwsError)o.reject("There was an error getting the compass heading.");else{var a=100;t&&t.frequency&&(a=t.frequency),s.watchIntervals.push({watchID:i,interval:r(function(){s.throwsError&&o.reject("There was an error watching the acceleration.");var r=359.99*Math.random()+1,e=359.99*Math.random()+1,t=Math.floor(360*Math.random()+1),i={magneticHeading:r,trueHeading:e,headingAccuracy:t,timestamp:Date.now()};s.readings.push(i),o.notify(i)},a)})}var c=function(e){for(var t=-1,o=0;o<s.watchIntervals.length;o++)if(s.watchIntervals[o].watchID===e){r.cancel(n[o].interval),t=o;break}-1!==t&&s.watchIntervals.splice(t,1)};return o.promise.cancel=function(){c(i)},o.promise.clearWatch=function(r){c(r||i)},o.promise.watchID=i,o.promise},clearWatch:function(t){var o=e.defer();if(t)if(this.throwsError)o.reject("Unable to clear watch.");else{for(var i=-1,s=0;s<this.watchIntervals.length;s++)if(this.watchIntervals[s].watchId===t){r.cancel(n[s].interval),i=s;break}-1!==i&&this.watchIntervals.splice(i,1)}else o.reject("Unable to clear watch. No watch ID provided.");return o.promise}}}]),r.factory("$cordovaDialogs",["$q",function(r){var e=!1,t="",o="",i="",n=0,s=!0;return{dialogText:e,dialogTitle:t,defaultValue:o,promptResponse:i,buttonLabels:[],beepCount:n,useHostAbilities:s,alert:function(e,t,o){var i=r.defer();return this.useHostAbilities?(alert(e),i.resolve()):(this.dialogText=e,this.dialogTitle=t,this.buttonLabels.push(o),i.resolve()),i.promise},confirm:function(e,t,o){var i=r.defer();if(this.useHostAbilities){var n=confirm(e);i.resolve(n?2:1)}else this.dialogText=e,this.dialogTitle=t,this.buttonLabels.push(o),i.resolve(0);return i.promise},prompt:function(e,t,o,i){var n=r.defer();if(this.useHostAbilities){var s=prompt(e,i);n.resolve(s)}else{this.dialogText=e,this.dialogTitle=t,this.defaultValue=i;for(var a=0;a<o.length;a++)this.buttonLabels.push(o[a]);n.resolve(this.promptResponse)}return n.promise},beep:function(r){this.beepCount=r}}}]),r.factory("$cordovaFile",["$q",function(r){var e=!1,t={},o=!1,i={},n=function(e){var t=r.defer();return this.throwsError?t.reject(e):t.resolve(),t.promise};return{throwsError:e,fileSystem:t,shouldMockFiles:o,files:i,checkDir:function(e){if(this.shouldMockFiles){var t=r.defer();return this.files[e]&&!this.files[e].isFile?t.resolve():t.reject(),t.promise}return n.call(this,"There was an error checking the directory.")},createDir:function(e,t){if(this.shouldMockFiles){var o=r.defer();return this.files[e]={isFile:!1},o.resolve(),o.promise}return n.call(this,"There was an error creating the directory.")},listDir:function(r){return n.call(this,"There was an error listing the directory")},checkFile:function(e){if(this.shouldMockFiles){var t=r.defer();return this.files[e]&&this.files[e].isFile?t.resolve():t.reject(),t.promise}return n.call(this,"There was an error checking for the file.")},createFile:function(e,t){if(this.shouldMockFiles){var o=r.defer();return this.files[e]={isFile:!0,fileContent:""},o.resolve(),o.promise}return n.call(this,"There was an error creating the file.")},removeFile:function(r,e){return n.call(this,"There was an error removng the file.")},writeFile:function(r,e,t){return this.shouldMockFiles&&r&&e&&(this.files[r]={isFile:!0,fileContent:e}),n.call(this,"There was an error writing the file.")},readFile:function(r){return this.readAsText(r)},readAsText:function(e){if(this.shouldMockFiles){var t=r.defer();return i[e]&&i[e].isFile?t.resolve(i[e].fileContent):t.reject(),t.promise}return n.call(this,"There was an error reading the file as text.")},readAsDataURL:function(r){return n.call(this,"There was an error reading the file as a data url.")},readAsBinaryString:function(r){return n.call(this,"There was an error reading the file as a binary string.")},readAsArrayBuffer:function(r){return n.call(this,"There was an error reading the file as an array buffer.")},readFileMetadata:function(r){return n.call(this,"There was an error reading the file metadata")},readFileAbsolute:function(r){return n.call(this,"There was an error reading the file from the absolute path")},readFileMetadataAbsolute:function(r){return n.call(this,"There was an error reading the file metadta from the absolute path")},downloadFile:function(r,e,t,o){return n.call(this,"There was an error downloading the file.")},uploadFile:function(r,e,t){return n.call(this,"There was an error uploading the file.")}}}]),r.factory("$cordovaFileOpener2",["$q",function(r){var e=!1;return{throwsError:e,open:function(e,t){var o=r.defer();return this.throwError?o.reject({status:0,message:"There was an error capturing the file."}):o.resolve(),o.promise},uninstall:function(e){var t=r.defer();return this.throwError?t.reject({status:0,message:"There was an error capturing the packageId."}):t.resolve(),t.promise},appIsInstalled:function(e){var t=r.defer();return this.throwError?t.reject({status:0,message:"There was an error capturing the packageId."}):t.resolve(),t.promise}}}]),r.factory("$cordovaGeolocation",["$interval","$q",function(r,e){var t=!1,o=!0,i=[],n=[],s=null,a=null;return{throwsError:t,watchIntervals:i,locations:n,currentPosition:s,nextPosition:a,useHostAbilities:o,getCurrentPosition:function(r){var t=e.defer();return this.throwsError?t.reject("There was an error getting the location."):(r&&(r=r),this.useHostAbilities?navigator.geolocation?navigator.geolocation.getCurrentPosition(function(r){this.currentPosition=r,t.resolve(this.currentPosition)},function(r){t.reject(r)}):t.reject("Geolocation is not supported by this browser."):t.resolve(this.currentPosition)),t.promise},watchPosition:function(t){var o=e.defer(),n=Math.floor(1e6*Math.random()+1),s=this;if(s.locations=[],s.throwsError)o.reject("There was an error getting the geolocation.");else{var a=1e3;t&&t.timeout&&(a=t.timeout),s.watchIntervals.push({watchID:n,interval:r(function(){s.throwsError&&o.reject("There was an error watching the geolocation.");var r=s.nextPosition;null===r&&(s.useHostAbilities?navigator.geolocation?navigator.geolocation.getCurrentPosition(function(r){s.currentPosition=r,s.locations.push(r),o.resolve(r)},function(r){o.reject(r)}):o.reject("Geolocation is not supported by this browser."):(r={coords:{latitude:180*Math.random()+1-90,longitude:360*Math.random()+1-180,altitude:100*Math.random()+1,accuracy:10*Math.random()+1,altitudeAccuracy:10*Math.random()+1,heading:360*Math.random()+1,speed:100*Math.random()+1},timestamp:Date.now()},s.currentPosition=r,s.locations.push(r),o.notify(r)))},a)})}var c=function(e){for(var t=-1,o=0;o<s.watchIntervals.length;o++)if(s.watchIntervals[o].watchID===e){r.cancel(i[o].interval),t=o;break}-1!==t&&s.watchIntervals.splice(t,1)};return o.promise.cancel=function(){c(n)},o.promise.clearWatch=function(r){c(r||n)},o.promise.watchID=n,o.promise},clearWatch:function(t){var o=e.defer();if(t)if(this.throwsError)o.reject("Unable to clear watch.");else{for(var n=-1,s=0;s<this.watchIntervals.length;s++)if(this.watchIntervals[s].watchID===t){r.cancel(i[s].interval),n=s;break}-1!==n&&this.watchIntervals.splice(n,1)}else o.reject("Unable to clear watch. No watch ID provided.");return o.promise}}}]),r.factory("$cordovaGlobalization",["$q",function(r){var e=!1,t=navigator.language?navigator.language:"en-US",o={value:t},i="Sunday",n={value:t};return{throwsError:e,preferredLanguage:o,localeName:n,firstDayOfWeek:i,getPreferredLanguage:function(){var e=r.defer();return this.throwsError?e.reject("There was an error getting the preferred language."):e.resolve(this.preferredLanguage),e.promise},getLocaleName:function(){var e=r.defer();return this.throwsError?e.reject("There was an error getting the locale name."):e.resolve(this.localeName),e.promise},getFirstDayOfWeek:function(){var e=r.defer();return this.throwsError?e.reject("There was an error getting the first day of week."):e.resolve(this.firstDayOfWeek),e.promise},dateToString:function(e,t){var o=r.defer();if(this.throwsError)o.reject("There was an error getting the string from the date.");else{var i="";e=e,t=t,o.resolve(i)}return o.promise},stringToDate:function(e,t){var o=r.defer();if(this.throwsError)o.reject("There was an error getting the date from the string.");else{var i="";e=e,t=t,o.resolve(i)}return o.promise},getDatePattern:function(e){var t=r.defer();if(this.throwsError)t.reject("There was an error getting the date pattern.");else{var o="";e=e,t.resolve(o)}return t.promise},getDateNames:function(e){var t=r.defer();if(this.throwsError)t.reject("There was an error getting the date names.");else{var o="";e=e,t.resolve(o)}return t.promise},isDayLightSavingsTime:function(e){var t=r.defer();if(this.throwsError)t.reject("There was an error getting if this is in daylight savings time mode.");else{var o="";e=e,t.resolve(o)}return t.promise},numberToString:function(e,t){var o=r.defer();if(this.throwsError)o.reject("There was an error convertng the number to a string.");else{var i="";e=e,t=t,o.resolve(i)}return o.promise},stringToNumber:function(e,t){var o=r.defer();if(this.throwsError)o.reject("There was an error convertng the string to a number.");else{var i="";t=t,o.resolve(i)}return o.promise},getNumberPattern:function(e){var t=r.defer();if(this.throwsError)t.reject("There was an error convertng the string to a number.");else{var o="";e=e,t.resolve(o)}return t.promise},getCurrencyPattern:function(e){var t=r.defer();if(this.throwsError)t.reject("There was an error convertng the string to a number.");else{var o="";e=e,t.resolve(o)}return t.promise}}}]),r.factory("$cordovaGoogleAnalytics",["$q",function(r){var e=!1,t={};t.throwsError=e;var o=["startTrackerWithId","setUserId","debugMode","trackView","addCustomDimension","trackEvent","trackException","trackTiming","addTransaction","addTransactionItem"];return o.forEach(function(e){t[e]=function(){var e=r.defer();return this.throwsError?e.reject():e.resolve(),e.promise}}),t}]),r.factory("$cordovaGooglePlayGame",["$q",function(r){var e=!1,t=!1,o="";return{_throwsError:e,_isSignedIn:t,_displayName:o,auth:function(){var e=r.defer();return this._throwsError?e.reject("There was a auth error."):(this.isSignedIn=!0,e.resolve("SIGN IN SUCCESS")),e.promise},signout:function(){var e=r.defer();return this.throwsError?e.reject("There was a signout error."):e.resolve(),e.promise},isSignedIn:function(){var e=r.defer();return this._throwsError?e.reject("There was a isSignedIn error."):e.resolve({isSignedIn:this._isSignedIn}),e.promise},showPlayer:function(){var e=r.defer();return this.throwsError?e.reject("There was a showPlayer error."):e.resolve({displayName:this._displayName}),e.promise},submitScore:function(e){var t=r.defer();return this._throwsError?t.reject("There was a submitScore error."):t.resolve("OK"),t.promise},showAllLeaderboards:function(){var e=r.defer();return this.throwsError?e.reject("There was a showAllLeaderboards error."):e.resolve("OK"),e.promise},showLeaderboard:function(e){var t=r.defer();return this._throwsError?t.reject("There was a showLeaderboard error."):t.resolve("OK"),t.promise},unlockAchievement:function(e){var t=r.defer();return this.throwsError?t.reject("There was a unlockAchievement error."):t.resolve("OK"),t.promise},incrementAchievement:function(e){var t=r.defer();return this._throwsError?t.reject("There was a incrementAchievement error."):t.resolve("OK"),t.promise},showAchievements:function(){var e=r.defer();return this.throwsError?e.reject("There was a showAchievements error."):e.resolve("OK"),e.promise}}}]),r.factory("$cordovaKeyboard",function(){var r=!1;return{hideAccessoryBar:function(r){},close:function(){r=!1},show:function(){r=!0},disableScroll:function(r){},isVisible:function(){return r}}}),r.factory("$cordovaKeychain",["$q",function(r){var e={};return{keychains:e,getForKey:function(e,t){var o=r.defer();return this.keychains[t]?o.resolve(this.keychains[t][e]):o.reject(),o.promise},setForKey:function(e,t,o){var i=r.defer();return this.keychains[t]||(this.keychains[t]={}),this.keychains[t][e]=o,i.resolve(),i.promise},removeForKey:function(e,t){var o=r.defer();return this.keychains[t]&&delete this.keychains[t][e],o.resolve(),o.promise}}}]),r.factory("$cordovaNetwork",function(){var r="WiFi connection",e=!0;return{connectionType:r,isConnected:e,getNetwork:function(){return this.connectionType},isOnline:function(){return this.isConnected},isOffline:function(){return!this.isConnected}}}),r.factory("$cordovaPush",["$q","$timeout","$rootScope",function(r,e,t){var o=!1,i="";return{throwsError:o,deviceToken:i,onNotification:function(r){e(function(){t.$broadcast("$cordovaPush:notificationReceived",r)})},register:function(e){var t=this,o=r.defer();return void 0!==e&&void 0===e.ecb&&(e.ecb=this.onNotification),this.throwsError?o.reject("There was a register error."):(o.resolve(this.deviceToken),e&&e.ecb&&e.ecb({event:"registered",regid:t.deviceToken})),o.promise},unregister:function(e){var t=r.defer();return this.throwsError?t.reject("There was a register error."):t.resolve(),t.promise}}}]),r.factory("$cordovaSocialSharing",["$q",function(r){var e=!1,t="",o="",i="",n="",s="",a="",c=[],h=[],u=[];return{throwsError:e,message:t,image:o,link:i,number:n,subject:a,toAddresses:c,bccAddresses:h,socialService:s,attachments:u,shareViaTwitter:function(e,t,o){var i=r.defer();return this.throwsError?i.reject("There was an error sharing via Twitter."):(this.message=e,this.image=t,this.link=o,i.resolve()),i.promise},shareViaWhatsApp:function(e,t,o){var i=r.defer();return this.throwsError?i.reject("There was an error sharing via WhatsApp."):(this.message=e,this.image=t,this.link=o,i.resolve()),i.promise},shareViaFacebook:function(e,t,o){var i=r.defer();return this.throwsError?i.reject("There was an error sharing via Facebook."):(this.message=e,this.image=t,this.link=o,i.resolve()),i.promise},shareViaSMS:function(e,t){var o=r.defer();return this.throwsError?o.reject("There was an error sharing via SMS."):(this.message=e,this.number=t,o.resolve()),o.promise},shareViaEmail:function(e,t,o,i,n){var s=r.defer();return this.throwsError?s.reject("There was an error sharing via SMS."):(this.message=e,this.subject=t,this.toAddresses=o,this.bccAddressesc=i,this.attachments=n,s.resolve()),s.promise},canShareViaEmail:function(){var e=r.defer();return this.throwsError?e.reject(!1):e.resolve(!0),e.promise},canShareVia:function(e,t,o,i,n){var s=r.defer();return this.throwsError?s.reject("There was an error sharing via SMS."):(this.message=t,this.socialService=e,this.subject=o,this.attachments=i,this.link=n,s.resolve()),s.promise},shareVia:function(e,t,o,i,n){var s=r.defer();return this.throwsError?s.reject("There was an error sharing via SMS."):(this.socialService=e,this.message=t,this.subject=o,this.attachments=i,this.link=n,s.resolve()),s.promise},share:function(e,t,o,i){var n=r.defer();return this.throwsError?n.reject("There was an error sharing via SMS."):(this.message=e,this.subject=t,this.attachments=o,this.link=i,n.resolve()),n.promise}}}]),r.factory("$cordovaSplashscreen",function(){var r=!1;return{isVisible:r,hide:function(){return this.isVisible=!1,!0},show:function(){return this.isVisible=!0,!0}}}),r.factory("$cordovaStatusbar",function(){var r=!0,e=!0;return{isStatusBarVisible:r,canOverlayWebView:e,overlaysWebView:function(r){this.canOverlayWebView=r},style:function(r){return r},styleHex:function(r){return r},styleColor:function(r){return r},hide:function(){this.isStatusBarVisible=!1},show:function(){this.isStatusBarVisible=!0},isVisible:function(){return this.isStatusBarVisible}}}),r.factory("$cordovaToast",["$q",function(r){var e=!1;return{throwsError:e,showShortTop:function(e){var t=r.defer();return this.throwsError?t.reject("There was an error showing the toast."):t.resolve(),t.promise},showShortCenter:function(e){var t=r.defer();return this.throwsError?t.reject("There was an error showing the toast."):t.resolve(),t.promise},showShortBottom:function(e){var t=r.defer();return this.throwsError?t.reject("There was an error showing the toast."):t.resolve(),t.promise},showLongTop:function(e){var t=r.defer();return this.throwsError?t.reject("There was an error showing the toast."):t.resolve(),t.promise},showLongCenter:function(e){var t=r.defer();return this.throwsError?t.reject("There was an error showing the toast."):t.resolve(),t.promise},showLongBottom:function(e){var t=r.defer();return this.throwsError?t.reject("There was an error showing the toast."):t.resolve(),t.promise},show:function(e,t,o){var i=r.defer();return this.throwsError?i.reject("There was an error showing the toast."):i.resolve(),i.promise}}}]),r.factory("$cordovaVibration",["$timeout",function(r){var e=!1,t=null;return{vibrateTimer:t,isVibrating:e,vibrate:function(e){e>0&&(this.isVibrating=!0,self=this,e instanceof Array?this.vibrateTimer=r(function(){self.isVibrating=!1,self.vibrateTimer=null},e[0]):this.vibrateTimer=r(function(){self.isVibrating=!1,self.vibrateTimer=null},e))},vibrateWithPattern:function(r,e){},cancelVibration:function(){null!==this.vibrateTimer&&this.isVibrating===!0&&(r.cancel(this.vibrateTimer),this.isVibrating=!1)}}}])}();