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

Screen Size Plugin Support #1353

Open
wants to merge 31 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
c604150
added method to src,mocks, and respective tests (#1218)
bpietravalle Apr 12, 2016
82e60c8
update localNotification.ctrl.js (#1213)
mrscholty Apr 12, 2016
2afc147
$cordovaAppRate sets callbacks correctly (onButtonClicked, onRateDial…
pmccloghrylaing Apr 12, 2016
3ce1f61
Wrapper for 3d touch plugin (#1155)
nickplesha Apr 14, 2016
b4356c0
added iosOptions to $cordovaSpinnerDialog.show() (#1224)
AllenConquest Apr 17, 2016
de9e36a
Updated appVersion mocks and added tests (#1231)
sjaakieb Apr 21, 2016
7d1c506
Issue #1228 - google analytics (#1247)
vitaliy-bobrov May 19, 2016
2605cfe
Added shareWithOptions, which was introduced in 5.1.0 (#1263)
Grayda Jun 6, 2016
876ef68
added tts plugin wrapper (#1265)
YaAvi Jun 27, 2016
89b5f76
Add serial plugin wrapper (#1274)
makearl Jun 27, 2016
807db3e
added recents control plugin wrapper (#1264)
YaAvi Jul 6, 2016
17c7152
Merging v0.1.27-alpha release from 'master' into dev-next
gortok Jul 8, 2016
5cd6110
Update google-analytics-plugin (#1309)
gazaret Aug 22, 2016
eb6600a
ev args added to $cordovaKeyboard events (#1324)
nklhtv Aug 22, 2016
43fff1a
Add sqlite functions (#1314)
NiklasMerz Aug 22, 2016
be147c2
New wrapper for webIntent plugin (#1306)
matthieuxyz Aug 22, 2016
f39878b
Add advertising id collection support (to $cordovaGoogleAnalytics) (#…
CodingCarlos Aug 22, 2016
7a7dc84
attach promise with media instance (#1288)
evaletolab Aug 22, 2016
1f74299
Removed duplicate function (#1329)
NiklasMerz Aug 25, 2016
4218730
Changed license field in package.json and added keywords + Readme tit…
NiklasMerz Aug 26, 2016
db29fba
Make executesql more efficient (#1337)
NiklasMerz Sep 13, 2016
04b6c5a
Add instagram mock (#1262)
nicocrm Sep 13, 2016
b041f80
chore(npm): remove fs npm package (#1330)
fh1ch Sep 13, 2016
a38470e
added hasPermission method to cordovaPushV5 and created initial spec …
moskeyombus Sep 13, 2016
82be9be
return after promises are rejected (#1074)
fantapop Sep 13, 2016
fe850f8
[] Using db.sqlBatch within insertCollection (#1344)
shinrox Sep 13, 2016
75688e8
Add fingerprint aio plugin (#1347)
NiklasMerz Sep 21, 2016
ca3225e
the 'OR' operator ignores all zero values when checking if a preferen…
Sep 21, 2016
76ec28a
Merge branch 'driftyco/dev-next' into dev-next
nazrdogan Sep 22, 2016
e69b0dc
Screen Size
nazrdogan Sep 22, 2016
ba01def
update
nazrdogan Sep 22, 2016
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

[ngCordova](http://ngcordova.com/)

==========

[![Travis](https://img.shields.io/travis/driftyco/ng-cordova.svg?style=flat)](https://travis-ci.org/driftyco/ng-cordova) [![Bower](https://img.shields.io/badge/bower-ngCordova-FFCC2F.svg?style=flat)](http://bower.io/search/?q=ngCordova)
Expand Down Expand Up @@ -61,6 +62,7 @@ $ bower install ngCordova
- [Facebook AudienceNetwork Ads](https://github.com/floatinghotpot/cordova-plugin-facebookads) (:warning: share % Ad revenue)
- [File](https://github.com/apache/cordova-plugin-file) *
- [File Transfer](https://github.com/apache/cordova-plugin-file-transfer) *
- [Fingerprint](https://github.com/NiklasMerz/cordova-plugin-fingerprint-aio) *
- [Flashlight](https://github.com/EddyVerbruggen/Flashlight-PhoneGap-Plugin)
- [Flurry Ads](https://github.com/floatinghotpot/cordova-plugin-flurry) (:warning: share % Ad revenue)
- [Geolocation](https://github.com/apache/cordova-plugin-geolocation) *
Expand Down Expand Up @@ -103,6 +105,7 @@ $ bower install ngCordova
- [Touchid](https://github.com/leecrossley/cordova-plugin-touchid)
- [Vibration](https://github.com/apache/cordova-plugin-vibration) *
- [Video Capture Plus](https://github.com/EddyVerbruggen/VideoCapturePlus-PhoneGap-Plugin) *
- [Web Intent](https://github.com/Initsogar/cordova-webintent)
- [Zip](https://github.com/MobileChromeApps/cordova-plugin-zip)

`* official Apache Cordova Plugin`
Expand Down
3 changes: 2 additions & 1 deletion dist/ng-cordova.js
Original file line number Diff line number Diff line change
Expand Up @@ -5732,6 +5732,7 @@ angular.module('ngCordova.plugins', [
'ngCordova.plugins.progressIndicator',
'ngCordova.plugins.push',
'ngCordova.plugins.push_v5',
'ngCordova.plugins.recentsControl',
'ngCordova.plugins.sms',
'ngCordova.plugins.socialSharing',
'ngCordova.plugins.spinnerDialog',
Expand Down Expand Up @@ -7358,4 +7359,4 @@ angular.module('ngCordova.plugins.zip', [])
};
}]);

})();
})();
17 changes: 12 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,24 @@
"minimist": "^0.1.0",
"phantomjs-prebuilt": "^2.1.4"
},
"licenses": [
{
"type": "MIT"
}

"keywords": [
"ngCordova",
"ng-cordova",
"ngcordova",
"ng cordova",
"cordova",
"phonegap",
"angular",
"angularjs",
"ionic",
"cordova plugin"
],
"scripts": {
"test": "gulp lint && gulp karma --browsers=PhantomJS --reporters=progress"
},
"dependencies": {
"conventional-changelog": "0.0.11",
"fs": "0.0.2",
"gulp-git": "^1.2.4",
"q": "^1.1.2"
}
Expand Down
10 changes: 8 additions & 2 deletions src/mocks/googleAnalytics.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ ngCordovaMocks.factory('$cordovaGoogleAnalytics', ['$q', function ($q) {
/**
* @ngdoc property
* @name throwsError
* @propertyOf ngCordovaMocks.cordovaGeolocation
* @propertyOf ngCordovaMocks.cordovaGoogleAnalytics
*
* @description
* A flag that signals whether a promise should be rejected or not.
Expand All @@ -24,14 +24,20 @@ ngCordovaMocks.factory('$cordovaGoogleAnalytics', ['$q', function ($q) {
var methodsName = [
'startTrackerWithId',
'setUserId',
'setAppVersion',
'debugMode',
'setAllowIDFACollection',
'trackView',
'addCustomDimension',
'trackEvent',
'trackMetric',
'trackException',
'trackTiming',
'addTransaction',
'addTransactionItem'
'addTransactionItem',
'setAnonymizeIp',
'setAllowIDFACollection',
'enableUncaughtExceptionReporting'
];

methodsName.forEach(function (funcName) {
Expand Down
53 changes: 53 additions & 0 deletions src/mocks/instagram.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/**
* @ngdoc service
* @name ngCordovaMocks.cordovaInstagram
*
* @description
* A service for testing instagram features
* in an app build with ngCordova.
**/
ngCordovaMocks.factory('$cordovaInstagram', ['$q', function ($q) {
var throwsError = false;
var returnIsInstalled = true;

return {

/**
* @ngdoc property
* @name throwsError
* @propertyOf ngCordovaMocks.cordovaInstagram
*
* @description
* A flag that signals whether a promise should be rejected or not.
* This property should only be used in automated tests.
**/
throwsError: throwsError,

/**
* @ngdoc property
* @name returnIsInstalled
* @propertyOf ngCordovaMocks.cordovaInstagram
*
* @description
* A flag that signals whether the mock should simulate that the instagram app
* is installed or not.
* This property should only be used in automated tests.
**/
returnIsInstalled: returnIsInstalled,

share: function (options) {
if(this.throwsError) {
return $q.reject('an error occurred');
}
return $q.when(true);
},


isInstalled: function () {
if(this.throwsError) {
return $q.reject('an error occurred');
}
return $q.when(this.returnIsInstalled);
}
}
}]);
75 changes: 75 additions & 0 deletions src/mocks/webIntent.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
ngCordovaMocks.factory('$webIntent', ['$q', '$rootScope', function($q, $rootScope) {
var scope = $rootScope.$new();
var has = true;
var url = "http://url.mock/ressource";
var throwsError = false;

return{
has: has,
url: url,
throwsError: throwsError,

startActivity: function (params) {
var q = $q.defer();
if(this.throwsError) {
q.reject(new Error());
} else {
q.resolve();
}
return q.promise;
},
hasExtra: function (params) {
var q = $q.defer();
if(this.throwsError) {
q.reject(new Error());
} else {
q.resolve(has);
}
return q.promise;
},
getUri: function () {
var q = $q.defer();
if(this.throwsError) {
q.reject(new Error());
} else {
q.resolve(url);
}
return q.promise;
},
getExtra: function (params) {
var q = $q.defer();
if(this.throwsError) {
q.reject(new Error());
} else {
q.resolve(url);
}
return q.promise;
},
onNewIntent: function (callback) {
scope.$on('newIntent', function() {
callback(url);
});
},
newIntent: function() {
scope.$broadcast('newIntent')
},
sendBroadcast: function (params) {
var q = $q.defer();
if(this.throwsError) {
q.reject(new Error());
} else {
q.resolve();
}
return q.promise;
},
actionSend: function() {return "actionSend"},
actionView: function() {return "actionView"},
actionCall: function() {return "actionCall"},
actionSendTo: function() {return "actionSendTo"},
extraText: function() {return "extraText"},
extraSubject: function() {return "extraSubject"},
extraStream: function() {return "extraStream"},
extraEmail: function() {return "extraEmail"}
}

}]);
28 changes: 14 additions & 14 deletions src/plugins/3dtouch.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@

angular.module('ngCordova.plugins.3dtouch', [])

.factory('$cordova3DTouch', ['$q', function($q) {
.factory('$cordova3DTouch', ['$q', function ($q) {
var quickActions = [];
var quickActionHandler = {};

var createQuickActionHandler = function(quickActionHandler) {
var createQuickActionHandler = function (quickActionHandler) {
return function (payload) {
for (var key in quickActionHandler) {
if (payload.type === key) {
Expand Down Expand Up @@ -52,7 +52,7 @@ angular.module('ngCordova.plugins.3dtouch', [])
* @param function callback (optional)
* @return promise
*/
addQuickAction: function(type, title, iconType, iconTemplate, subtitle, callback) {
addQuickAction: function (type, title, iconType, iconTemplate, subtitle, callback) {
var deferred = $q.defer();

var quickAction = {
Expand All @@ -69,14 +69,14 @@ angular.module('ngCordova.plugins.3dtouch', [])
quickAction.iconTemplate = iconTemplate;
}

this.isAvailable().then(function() {
this.isAvailable().then(function () {
quickActions.push(quickAction);
quickActionHandler[type] = callback;
window.ThreeDeeTouch.configureQuickActions(quickActions);
window.ThreeDeeTouch.onHomeIconPressed = createQuickActionHandler(quickActionHandler);
deferred.resolve(quickActions);
},
function(err) {
function (err) {
deferred.reject(err);
});

Expand All @@ -90,15 +90,15 @@ angular.module('ngCordova.plugins.3dtouch', [])
* @param function callback
* @return promise
*/
addQuickActionHandler: function(type, callback) {
addQuickActionHandler: function (type, callback) {
var deferred = $q.defer();

this.isAvailable().then(function() {
this.isAvailable().then(function () {
quickActionHandler[type] = callback;
window.ThreeDeeTouch.onHomeIconPressed = createQuickActionHandler(quickActionHandler);
deferred.resolve(true);
},
function(err) {
function (err) {
deferred.reject(err);
});

Expand All @@ -110,14 +110,14 @@ angular.module('ngCordova.plugins.3dtouch', [])
*
* @return bool
*/
enableLinkPreview: function() {
enableLinkPreview: function () {
var deferred = $q.defer();

this.isAvailable().then(function() {
this.isAvailable().then(function () {
window.ThreeDeeTouch.enableLinkPreview();
deferred.resolve(true);
},
function(err) {
function (err) {
deferred.reject(err);
});

Expand All @@ -130,14 +130,14 @@ angular.module('ngCordova.plugins.3dtouch', [])
* @param function callback
* @return promise
*/
addForceTouchHandler: function(callback) {
addForceTouchHandler: function (callback) {
var deferred = $q.defer();

this.isAvailable().then(function() {
this.isAvailable().then(function () {
window.ThreeDeeTouch.watchForceTouches(callback);
deferred.resolve(true);
},
function(err) {
function (err) {
deferred.reject(err);
});

Expand Down
2 changes: 1 addition & 1 deletion src/plugins/appRate.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ angular.module('ngCordova.plugins.appRate', [])
AppRate.preferences.displayAppName = defaults.appName || '';
AppRate.preferences.promptAgainForEachNewVersion = defaults.promptForNewVersion || true;
AppRate.preferences.openStoreInApp = defaults.openStoreInApp || false;
AppRate.preferences.usesUntilPrompt = defaults.usesUntilPrompt || 3;
AppRate.preferences.usesUntilPrompt = (typeof defaults.usesUntilPrompt === 'undefined'|| defaults.usesUntilPrompt===null)?3:defaults.usesUntilPrompt;
AppRate.preferences.useCustomRateDialog = defaults.useCustomRateDialog || false;
AppRate.preferences.storeAppURL.ios = defaults.iosURL || null;
AppRate.preferences.storeAppURL.android = defaults.androidURL || null;
Expand Down
41 changes: 41 additions & 0 deletions src/plugins/fingerprint.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// install : cordova plugin add https://github.com/NiklasMerz/cordova-plugin-fingerprint-aio
// link : https://github.com/NiklasMerz/cordova-plugin-fingerprint-aio

/* globals Fingerprint: true */
angular.module('ngCordova.plugins.fingerprint', [])

.factory('$cordovaFingerprint', ['$q', function ($q) {

return {
isAvailable: function () {
var defer = $q.defer();
if (!window.cordova) {
defer.reject('Not supported without cordova.js');
} else {
Fingerprint.isAvailable(function (value) {
defer.resolve(value);
}, function (err) {
defer.reject(err);
});
}

return defer.promise;
},

show: function (options) {
var defer = $q.defer();
if (!window.cordova) {
defer.reject('Not supported without cordova.js');
} else {
Fingerprint.show(options,
function (value) {
defer.resolve(value);
}, function (err) {
defer.reject(err);
});
}

return defer.promise;
}
};
}]);
Loading