incubator-ooo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From robw...@apache.org
Subject svn commit: r1330388 - /incubator/ooo/ooo-site/trunk/content/scripts/entourage.js
Date Wed, 25 Apr 2012 16:22:54 GMT
Author: robweir
Date: Wed Apr 25 16:22:54 2012
New Revision: 1330388

URL: http://svn.apache.org/viewvc?rev=1330388&view=rev
Log:
remove trailing /download when tracking SF downloads

Modified:
    incubator/ooo/ooo-site/trunk/content/scripts/entourage.js

Modified: incubator/ooo/ooo-site/trunk/content/scripts/entourage.js
URL: http://svn.apache.org/viewvc/incubator/ooo/ooo-site/trunk/content/scripts/entourage.js?rev=1330388&r1=1330387&r2=1330388&view=diff
==============================================================================
--- incubator/ooo/ooo-site/trunk/content/scripts/entourage.js (original)
+++ incubator/ooo/ooo-site/trunk/content/scripts/entourage.js Wed Apr 25 16:22:54 2012
@@ -7,6 +7,7 @@
  * Learn More: http://techoctave.com/c7/posts/58-entourage-js-automatic-download-tracking-for-asynchronous-google-analytics
  * 
  * 2012-04-24 Mod by robweir to whitelist additional file extensions as used in AOO project
+ * 2012-04-25 Mod by robweir to remove trailing "/download" from SourceForge file names,
a hack we can hopefully remove someday
  */
 
 /*jshint strict:false */
@@ -23,6 +24,10 @@ var entourage = new (function() {
 
 		//Removes the query after the file pathname (if one exists)
 		pathname = pathname.substring(0, (pathname.indexOf("?") === -1) ? pathname.length : pathname.indexOf("?"));
+      
+        //Remove trailing /download
+		if (/\/download$/.test(pathname))
+			pathname = pathname.substring(0, pathname.length-"/download".length);
 
 		//Removes everything before the last slash in the path
 		pathname = pathname.substring(pathname.lastIndexOf("/") + 1, pathname.length);



Mime
View raw message