Skip to content
This repository has been archived by the owner on Sep 15, 2021. It is now read-only.

Commit

Permalink
building v0.1.24-alpha
Browse files Browse the repository at this point in the history
  • Loading branch information
gortok committed Jan 15, 2016
1 parent d1f3bc6 commit ce58c66
Show file tree
Hide file tree
Showing 8 changed files with 151 additions and 20 deletions.
2 changes: 1 addition & 1 deletion bower.json
@@ -1,6 +1,6 @@
{
"name": "ngCordova",
"version": "0.1.23-alpha",
"version": "0.1.24-alpha",
"homepage": "http://ngCordova.com/",
"authors": [
"Max Lynch <max@drifty.com>",
Expand Down
41 changes: 36 additions & 5 deletions demo/www/lib/ngCordova/dist/ng-cordova.js
Expand Up @@ -229,6 +229,24 @@ angular.module('ngCordova.plugins.appVersion', [])
.factory('$cordovaAppVersion', ['$q', function ($q) {

return {
getAppName: function () {
var q = $q.defer();
cordova.getAppVersion.getAppName(function (name) {
q.resolve(name);
});

return q.promise;
},

getPackageName: function () {
var q = $q.defer();
cordova.getAppVersion.getPackageName(function (package) {
q.resolve(package);
});

return q.promise;
},

getVersionNumber: function () {
var q = $q.defer();
cordova.getAppVersion.getVersionNumber(function (version) {
Expand Down Expand Up @@ -1572,11 +1590,11 @@ angular.module('ngCordova.plugins.cardIO', [])
* Configuring defaultRespFields using $cordovaNgCardIOProvider
*
*/
this.setCardIOResponseFields = function (filelds) {
if (!filelds || !angular.isArray(filelds)) {
this.setCardIOResponseFields = function (fields) {
if (!fields || !angular.isArray(fields)) {
return;
}
defaultRespFields = filelds;
defaultRespFields = fields;
};

/**
Expand Down Expand Up @@ -1766,12 +1784,13 @@ angular.module('ngCordova.plugins.datePicker', [])
options = options || {date: new Date(), mode: 'date'};
$window.datePicker.show(options, function (date) {
q.resolve(date);
}, function(error){
q.reject(error);
});
return q.promise;
}
};
}]);

// install : cordova plugin add cordova-plugin-device
// link : https://github.com/apache/cordova-plugin-device

Expand Down Expand Up @@ -6386,6 +6405,8 @@ angular.module('ngCordova.plugins.socialSharing', [])
q.reject();
}
});

return q.promise;
}
};
}]);
Expand Down Expand Up @@ -6665,7 +6686,6 @@ angular.module('ngCordova.plugins.toast', [])
return q.promise;
},


show: function (message, duration, position) {
var q = $q.defer();
$window.plugins.toast.show(message, duration, position, function (response) {
Expand All @@ -6674,6 +6694,17 @@ angular.module('ngCordova.plugins.toast', [])
q.reject(error);
});
return q.promise;
},

hide: function () {
var q = $q.defer();
try {
$window.plugins.toast.hide();
q.resolve();
} catch (error) {
q.reject(error && error.message);
}
return q.promise;
}
};

Expand Down
6 changes: 3 additions & 3 deletions demo/www/lib/ngCordova/dist/ng-cordova.min.js

Large diffs are not rendered by default.

71 changes: 70 additions & 1 deletion dist/ng-cordova-mocks.js
Expand Up @@ -1512,7 +1512,7 @@ ngCordovaMocks.factory('$cordovaFileTransfer', ['$q', function ($q) {
**/
throwsError: throwsError,

download: function (source, filePath, trust, options) {
download: function (source, filePath, options, trust) {
return mockIt.call(this, 'There was an error downloading the file.');
},

Expand All @@ -1521,6 +1521,7 @@ ngCordovaMocks.factory('$cordovaFileTransfer', ['$q', function ($q) {
}
};
}]);

/**
* @ngdoc service
* @name ngCordovaMocks.cordovaGeolocation
Expand Down Expand Up @@ -2931,6 +2932,65 @@ ngCordovaMocks.factory('$cordovaSplashscreen', function () {
};
});

/**
* @ngdoc service
* @name ngCordovaMocks.cordovaSQLite
*
* @description
* A service for testing SQLite
* in an app build with ngCordova.
*/

ngCordovaMocks.factory('$cordovaSQLite', ['$q', function ($q) {

return {
/**
* These properties are here for the purpose of automated testing only.
**/
openDBShouldSucceedWith: null,
executeShouldSucceedWith: null,
insertCollectionShouldSucceedWith: null,
nestedExecuteShouldSucceedWith: null,
deleteDBShouldSucceedWith : null,

openDB: function (options, background) {
if (this.openDBShouldSucceedWith !== null) {
$q.when(this.openDBShouldSucceedWith)
} else {
$q.reject()
}
},
execute: function (db, query, binding) {
if (this.executeShouldSucceedWith !== null) {
$q.when(this.executeShouldSucceedWith)
} else {
$q.reject()
}
},
insertCollection: function (db, query, bindings) {
if (this.insertCollectionShouldSucceedWith !== null) {
$q.when(this.insertCollectionShouldSucceedWith)
} else {
$q.reject()
}
},
nestedExecute: function (db, query1, query2, binding1, binding2) {
if (this.nestedExecuteShouldSucceedWith !== null) {
$q.when(this.nestedExecuteShouldSucceedWith)
} else {
$q.reject()
}
},
deleteDB: function (dbName) {
if (this.deleteDBShouldSucceedWith !== null) {
$q.when(this.deleteDBShouldSucceedWith)
} else {
$q.reject()
}
}
}
}]);

/**
* @ngdoc service
* @name ngCordovaMocks.cordovaStatusbar
Expand Down Expand Up @@ -3086,6 +3146,15 @@ ngCordovaMocks.factory('$cordovaToast', ['$q', function ($q) {
defer.resolve();
}
return defer.promise;
},
hide: function () {
var defer = $q.defer();
if (this.throwsError) {
defer.reject('There was an error hiding the toast.');
} else {
defer.resolve();
}
return defer.promise;
}
};
}]);
Expand Down
2 changes: 1 addition & 1 deletion dist/ng-cordova-mocks.min.js

Large diffs are not rendered by default.

41 changes: 36 additions & 5 deletions dist/ng-cordova.js
Expand Up @@ -229,6 +229,24 @@ angular.module('ngCordova.plugins.appVersion', [])
.factory('$cordovaAppVersion', ['$q', function ($q) {

return {
getAppName: function () {
var q = $q.defer();
cordova.getAppVersion.getAppName(function (name) {
q.resolve(name);
});

return q.promise;
},

getPackageName: function () {
var q = $q.defer();
cordova.getAppVersion.getPackageName(function (package) {
q.resolve(package);
});

return q.promise;
},

getVersionNumber: function () {
var q = $q.defer();
cordova.getAppVersion.getVersionNumber(function (version) {
Expand Down Expand Up @@ -1572,11 +1590,11 @@ angular.module('ngCordova.plugins.cardIO', [])
* Configuring defaultRespFields using $cordovaNgCardIOProvider
*
*/
this.setCardIOResponseFields = function (filelds) {
if (!filelds || !angular.isArray(filelds)) {
this.setCardIOResponseFields = function (fields) {
if (!fields || !angular.isArray(fields)) {
return;
}
defaultRespFields = filelds;
defaultRespFields = fields;
};

/**
Expand Down Expand Up @@ -1766,12 +1784,13 @@ angular.module('ngCordova.plugins.datePicker', [])
options = options || {date: new Date(), mode: 'date'};
$window.datePicker.show(options, function (date) {
q.resolve(date);
}, function(error){
q.reject(error);
});
return q.promise;
}
};
}]);

// install : cordova plugin add cordova-plugin-device
// link : https://github.com/apache/cordova-plugin-device

Expand Down Expand Up @@ -6386,6 +6405,8 @@ angular.module('ngCordova.plugins.socialSharing', [])
q.reject();
}
});

return q.promise;
}
};
}]);
Expand Down Expand Up @@ -6665,7 +6686,6 @@ angular.module('ngCordova.plugins.toast', [])
return q.promise;
},


show: function (message, duration, position) {
var q = $q.defer();
$window.plugins.toast.show(message, duration, position, function (response) {
Expand All @@ -6674,6 +6694,17 @@ angular.module('ngCordova.plugins.toast', [])
q.reject(error);
});
return q.promise;
},

hide: function () {
var q = $q.defer();
try {
$window.plugins.toast.hide();
q.resolve();
} catch (error) {
q.reject(error && error.message);
}
return q.promise;
}
};

Expand Down
6 changes: 3 additions & 3 deletions dist/ng-cordova.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -2,7 +2,7 @@
"name": "ng-cordova",
"private": false,
"main": "dist/ng-cordova",
"version": "0.1.23-alpha",
"version": "0.1.24-alpha",
"repository": {
"url": "git://github.com/driftyco/ng-cordova.git"
},
Expand Down

0 comments on commit ce58c66

Please sign in to comment.