Created
October 2, 2009 20:16
-
-
Save kangax/200075 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Excerpt from http://www.mtv.com/sitewide/scripts/reporting/mtvi_reporting.js | |
/*Build Date: Fri May 15, 2009 14:20:51*/ | |
try { | |
var com = typeof com === 'object' ? com : {}; | |
com.mtvi = typeof com.mtvi === 'object' ? com.mtvi : {}; | |
com.mtvi.util = typeof com.mtvi.util === 'object' ? com.mtvi.util : {}; | |
com.mtvi.logger = typeof com.mtvi.logger === 'object' ? com.mtvi.logger : {}; | |
com.mtvi.config = typeof com.mtvi.config === 'object' ? com.mtvi.config : {}; | |
com.mtvi.ads = typeof com.mtvi.ads === 'object' ? com.mtvi.ads : {}; | |
com.mtvi.reporting = typeof com.mtvi.reporting === 'object' ? com.mtvi.reporting : {}; | |
} catch(e) {} | |
try { | |
String.prototype.trim = function () { | |
try { | |
return this.replace(/^\\s+|\\s+$/g, ''); | |
} catch(e) {} | |
}; | |
} catch(e) {} | |
try { | |
String.prototype.trimAfterStrings = function (strings) { | |
try { | |
if (typeof strings == "string") strings = [strings]; | |
for (i = 0; i < strings.length; i++) { | |
if (this.indexOf(strings[i]) > -1) { | |
return this.substring(0, this.indexOf(strings[i]) + strings[i].length); | |
} | |
} | |
return this; | |
} catch(e) { | |
return this; | |
} | |
} | |
} catch(e) {} | |
try { | |
String.prototype.chop = function (n) { | |
try { | |
if (isNaN(n)) n = this.length - 1; | |
return this.substring(0, n); | |
} catch(e) {} | |
}; | |
} catch(e) {} | |
// ... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment