See #47. Update configuration to allow users to disable analytics.
This commit is contained in:
parent
7ce01efc8a
commit
8d90b30448
|
@ -58,11 +58,13 @@ For example:
|
|||
- `beautifyOnSave`
|
||||
You can also choose to beautify on every file save.
|
||||
|
||||
- `googleAnalytics`
|
||||
There is Google Analytics to track what languages
|
||||
- `analytics`
|
||||
There is [Segment.io](https://segment.io/),
|
||||
which forwards the data to [Google Analytics](http://www.google.com/analytics/),
|
||||
to track what languages
|
||||
are being used the most and other stats.
|
||||
Everything is anonymized and no personal information,
|
||||
such as source code, is sent to Google.
|
||||
such as source code, is sent.
|
||||
See https://github.com/Glavin001/atom-beautify/issues/47
|
||||
for more details.
|
||||
|
||||
|
|
|
@ -297,7 +297,7 @@ function handleSaveEvent() {
|
|||
}
|
||||
|
||||
plugin.configDefaults = _.merge({
|
||||
googleAnalytics: true,
|
||||
analytics: true,
|
||||
beautifyOnSave: false
|
||||
}, defaultLanguageOptions);
|
||||
|
||||
|
|
|
@ -20,12 +20,16 @@ var beautifyCoffeeScript = require('./langs/coffeescript-beautify');
|
|||
// Misc
|
||||
var Analytics = require('analytics-node');
|
||||
var pkg = require('../package.json');
|
||||
// Analytics
|
||||
var analyticsWriteKey = 'u3c26xkae8';
|
||||
|
||||
module.exports = {
|
||||
|
||||
// Supported unique configuration keys
|
||||
// Used for detecting nested configurations in .jsbeautifyrc
|
||||
languages: ['js', 'html', 'css', 'sql', 'php', 'python', 'ruby','coffeescript'],
|
||||
languages: ['js', 'html', 'css', 'sql', 'php', 'python', 'ruby',
|
||||
'coffeescript'
|
||||
],
|
||||
|
||||
// Default options per language
|
||||
defaultLanguageOptions: {
|
||||
|
@ -85,7 +89,8 @@ module.exports = {
|
|||
beautifyCompleted(text);
|
||||
break;
|
||||
case 'CoffeeScript':
|
||||
beautifyCoffeeScript(text, self.getOptions('js', allOptions), beautifyCompleted);
|
||||
beautifyCoffeeScript(text, self.getOptions('js', allOptions),
|
||||
beautifyCompleted);
|
||||
break;
|
||||
case 'Handlebars':
|
||||
// jshint ignore: start
|
||||
|
@ -127,8 +132,8 @@ module.exports = {
|
|||
unsupportedGrammar = true;
|
||||
}
|
||||
|
||||
// Analytics
|
||||
var analyticsWriteKey = 'u3c26xkae8';
|
||||
// Check if Analytics is enabled
|
||||
if (atom.config.get('atom-beautify.analytics')) {
|
||||
// Setup Analytics
|
||||
var analytics = new Analytics(analyticsWriteKey);
|
||||
if (!atom.config.get('atom-beautify._analyticsUserId')) {
|
||||
|
@ -152,6 +157,7 @@ module.exports = {
|
|||
category: version
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in New Issue