You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
js-jquery/disable-insight-tracking.patch

61 lines
1.7 KiB

diff --git a/build/tasks/build.js b/build/tasks/build.js
index 69916bf..58e65ad 100644
--- a/build/tasks/build.js
+++ b/build/tasks/build.js
@@ -10,7 +10,6 @@ module.exports = function( grunt ) {
var fs = require( "fs" ),
requirejs = require( "requirejs" ),
- Insight = require( "insight" ),
pkg = require( "../../package.json" ),
srcFolder = __dirname + "/../../src/",
rdefineEnd = /\}\s*?\);[^}\w]*$/,
@@ -337,46 +336,16 @@ module.exports = function( grunt ) {
grunt.registerTask( "custom", function() {
var args = this.args,
modules = args.length ? args[ 0 ].replace( /,/g, ":" ) : "",
- done = this.async(),
- insight = new Insight( {
- trackingCode: "UA-1076265-4",
- pkg: pkg
- } );
+ done = this.async();
function exec( trackingAllowed ) {
- var tracks = args.length ? args[ 0 ].split( "," ) : [];
var defaultPath = [ "build", "custom" ];
- tracks = tracks.map( function( track ) {
- return track.replace( /\//g, "+" );
- } );
-
- if ( trackingAllowed ) {
-
- // Track individuals
- tracks.forEach( function( module ) {
- var path = defaultPath.concat( [ "individual" ], module );
-
- insight.track.apply( insight, path );
- } );
-
- // Track full command
- insight.track.apply( insight, defaultPath.concat( [ "full" ], tracks ) );
- }
-
grunt.task.run( [ "build:*:*" + ( modules ? ":" + modules : "" ), "uglify", "dist" ] );
done();
}
grunt.log.writeln( "Creating custom build...\n" );
- // Ask for permission the first time
- if ( insight.optOut === undefined ) {
- insight.askPermission( null, function( error, result ) {
- exec( result );
- } );
- } else {
- exec( !insight.optOut );
- }
} );
};