phiggins42 (owner)

Fork Of

Revisions

gist: 200173 Download_button fork
public
Public Clone URL: git://gist.github.com/200173.git
Embed All Files: show embed
JavaScript #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// 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) {}
 
// ...