Skip to content

Commit

Permalink
Change deprecation strings to constants and reuse (close #791)
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul Boocock committed Feb 5, 2020
1 parent 1877f49 commit 9b18040
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/js/tracker.js
Original file line number Diff line number Diff line change
Expand Up @@ -1844,7 +1844,7 @@
* @return string The user fingerprint
*/
apiMethods.getUserFingerprint = function () {
helpers.warn('User Fingerprinting is no longer supported. This function will be removed in a future release.');
helpers.warn(userFingerprintingWarning);
return 0;
};

Expand All @@ -1854,7 +1854,7 @@
* @param int|string appId
*/
apiMethods.setAppId = function (appId) {
helpers.warn('setAppId is deprecated. Instead add an "appId" field to the argmap argument of newTracker.');
helpers.warn('setAppId' + argmapDeprecationWarning + 'appId');
core.setAppId(appId);
};

Expand Down Expand Up @@ -1912,7 +1912,7 @@
* @param string cookieNamePrefix
*/
apiMethods.setCookieNamePrefix = function (cookieNamePrefix) {
helpers.warn('setCookieNamePrefix is deprecated. Instead add a "cookieName" field to the argmap argument of newTracker.');
helpers.warn('setCookieNamePrefix' + argmapDeprecationWarning + 'cookieName');
configCookieNamePrefix = cookieNamePrefix;
};

Expand All @@ -1922,7 +1922,7 @@
* @param string domain
*/
apiMethods.setCookieDomain = function (domain) {
helpers.warn('setCookieDomain is deprecated. Instead add a "cookieDomain" field to the argmap argument of newTracker.');
helpers.warn('setCookieDomain' + argmapDeprecationWarning + 'cookieDomain');
configCookieDomain = helpers.fixupDomain(domain);
updateDomainHash();
};
Expand Down Expand Up @@ -1952,22 +1952,22 @@
* @param int timeout
*/
apiMethods.setSessionCookieTimeout = function (timeout) {
helpers.warn('setSessionCookieTimeout is deprecated. Instead add a "sessionCookieTimeout" field to the argmap argument of newTracker.')
helpers.warn('setSessionCookieTimeout' + argmapDeprecationWarning + 'sessionCookieTimeout');
configSessionCookieTimeout = timeout;
};

/**
* @param number seed The seed used for MurmurHash3
*/
apiMethods.setUserFingerprintSeed = function() {
helpers.warn('User Fingerprinting is no longer supported. This function will be removed in a future release.');
helpers.warn(userFingerprintingWarning);
};

/**
* Enable/disable user fingerprinting. User fingerprinting is enabled by default.
*/
apiMethods.enableUserFingerprint = function() {
helpers.warn('User Fingerprinting is no longer supported. This function will be removed in a future release.');
helpers.warn(userFingerprintingWarning);
};

/**
Expand All @@ -1978,7 +1978,7 @@
* @param bool enable If true and Do Not Track feature enabled, don't track.
*/
apiMethods.respectDoNotTrack = function (enable) {
helpers.warn('This usage of respectDoNotTrack is deprecated. Instead add a "respectDoNotTrack" field to the argmap argument of newTracker.');
helpers.warn('respectDoNotTrack' + argmapDeprecationWarning + 'respectDoNotTrack');
var dnt = navigatorAlias.doNotTrack || navigatorAlias.msDoNotTrack;

configDoNotTrack = enable && (dnt === 'yes' || dnt === '1');
Expand Down Expand Up @@ -2205,7 +2205,7 @@
* @param string platform Overrides the default tracking platform
*/
apiMethods.setPlatform = function(platform) {
helpers.warn('setPlatform is deprecated. Instead add a "platform" field to the argmap argument of newTracker.');
helpers.warn('setPlatform' + argmapDeprecationWarning + 'platform');
core.setPlatform(platform);
};

Expand All @@ -2216,7 +2216,7 @@
* @param bool enabled A boolean value indicating if the Base64 encoding for self-describing events should be enabled or not
*/
apiMethods.encodeBase64 = function (enabled) {
helpers.warn('This usage of encodeBase64 is deprecated. Instead add an "encodeBase64" field to the argmap argument of newTracker.');
helpers.warn('encodeBase64' + argmapDeprecationWarning + 'encodeBase64');
core.setBase64Encoding(enabled);
};

Expand Down

0 comments on commit 9b18040

Please sign in to comment.