Skip to content

Commit 98d1716

Browse files
committed
clean up linting nits
1 parent 6c8c225 commit 98d1716

File tree

6 files changed

+376
-369
lines changed

6 files changed

+376
-369
lines changed

Diff for: .eslintignore

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
2+
www/js/zepto.min.js
3+
www/js/nacl-fast.min.js
4+
www/js/nacl-util.min.js
5+
6+
tests/
7+
8+
resources/

Diff for: .eslintrc.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ rules:
1010
no-throw-literal: off
1111
linebreak-style:
1212
- error
13-
- unix
13+
- unix

Diff for: www/js/analytic.js

+22-19
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
(function () {
22

3+
/* global $, nacl, device */
4+
/* TODO: track down device ... */
5+
36
/*!
47
* Create export namespace.
58
*/
@@ -23,17 +26,17 @@
2326
* - `permissionVal` {boolean} optIn value
2427
*/
2528

26-
window.phonegap.app.analytic.setPermission = function(config, permissionVal) {
29+
window.phonegap.app.analytic.setPermission = function (config, permissionVal) {
2730
config.optIn = permissionVal;
28-
window.phonegap.app.config.save(config, function() {});
31+
window.phonegap.app.config.save(config, function () {});
2932
};
3033

3134
/**
3235
* Get the text status of the permission
3336
* - `config` {object} config object that holds the app's data
3437
*/
3538

36-
window.phonegap.app.analytic.getPermissionStatus = function(config) {
39+
window.phonegap.app.analytic.getPermissionStatus = function (config) {
3740
return config.optIn;
3841
};
3942

@@ -45,46 +48,46 @@
4548
*/
4649

4750
window.phonegap.app.analytic.logEvent = function (config, gelfObject) {
48-
if(config.optIn) {
51+
if (config.optIn) {
4952
var metricsURL = 'https://metrics.phonegap.com/gelf';
50-
$.ajax( { type: 'POST', url: metricsURL, data: JSON.stringify(gelfObject) } );
53+
$.ajax({ type: 'POST', url: metricsURL, data: JSON.stringify(gelfObject) });
5154
}
5255
};
5356

5457
/**
5558
* Helper function to help construct analytic object
5659
*/
5760

58-
window.phonegap.app.analytic.basicGELF = function() {
61+
window.phonegap.app.analytic.basicGELF = function () {
5962
return {
60-
"version": "1.1",
61-
"host": "dev app",
62-
"short_message": "",
63-
"_userID": nacl.util.encodeBase64(nacl.hash(nacl.util.decodeUTF8(device.uuid))),
64-
"_platform": device.platform,
65-
"_appVersion": getVersion(),
66-
"_env": getDebugFlag() ? 1 : 0
63+
'version': '1.1',
64+
'host': 'dev app',
65+
'short_message': '',
66+
'_userID': nacl.util.encodeBase64(nacl.hash(nacl.util.decodeUTF8(device.uuid))),
67+
'_platform': device.platform,
68+
'_appVersion': getVersion(),
69+
'_env': getDebugFlag() ? 1 : 0
6770
};
6871
};
6972

7073
/**
7174
* Returns if the app is production or development
7275
*/
7376

74-
function getDebugFlag() {
77+
function getDebugFlag () {
7578
return /adhoc/.test($('#version').html());
7679
}
7780

7881
/**
7982
* Returns the version of the app
8083
*/
8184

82-
function getVersion() {
85+
function getVersion () {
8386
var versionStringSplit = $('#version').html().split(':');
84-
if( versionStringSplit.length >= 1) {
85-
return '0.0.0'
87+
if (versionStringSplit.length >= 1) {
88+
return '0.0.0';
8689
} else {
8790
return versionStringSplit[1].trim().split('<')[0];
8891
}
89-
};
90-
})();
92+
}
93+
})();

0 commit comments

Comments
 (0)