Template:jsOverrides

  • Revision slug: Template:jsOverrides
  • Revision title: Template:jsOverrides
  • Revision id: 70022
  • Created:
  • Creator: Sevenspade
  • Is current revision? No
  • Comment 1 words added, 1 words removed

Revision Content

var prototypes = {
  Array: {
    methods: [
      "pop",
      "push",
      "reverse",
      "shift",
      "sort",
      "splice",
      "unshift",
      "concat",
      "join",
      "slice",
      "toSource",
      "toString",
      "indexOf",
      "lastIndexOf",
      "filter",
      "forEach",
      "every",
      "map",
      "some",
      "reduce",
      "reduceRight"
    ],
    properties: [
      "constructor",
      "index",
      "input",
      "length"
    ]
  },
  Boolean: {
    methods: [
      "toSource",
      "toString",
      "valueOf"
    ],
    properties: [
      "constructor"
    ]
  },
  Date: {
    methods: [
      "getDate",
      "getDay",
      "getFullYear",
      "getHours",
      "getMilliseconds",
      "getMinutes",
      "getMonth",
      "getSeconds",
      "getTime",
      "getTimezoneOffset",
      "getUTCDate",
      "getUTCDay",
      "getUTCFullYear",
      "getUTCHours",
      "getUTCMilliseconds",
      "getUTCMinutes",
      "getUTCMonth",
      "getUTCSeconds",
      "getYear",
      "setDate",
      "setFullYear",
      "setHours",
      "setMilliseconds",
      "setMinutes",
      "setMonth",
      "setSeconds",
      "setTime",
      "setUTCDate",
      "setUTCFullYear",
      "setUTCHours",
      "setUTCMilliseconds",
      "setUTCMinutes",
      "setUTCMonth",
      "setUTCSeconds",
      "setYear",
      "toDateString",
      "toGMTString",
      "toLocaleDateString",
      "toLocaleFormat",
      "toLocaleString",
      "toLocaleTimeString",
      "toSource",
      "toString",
      "toTimeString",
      "toUTCString",
      "valueOf"
    ],
    properties: [
      "constructor"
    ]
  },
  Error: {
    methods: [
      "toSource",
      "toString"
    ],
    properties: [
      "constructor",
      "message",
      "name",
      "description",
      "number",
      "fileName",
      "lineNumber",
      "stack"
    ]
  },
  EvalError: {
    methods: [
      "toSource",
      "toString"
    ],
    properties: [
      "constructor",
      "name"
    ]
  },
  Function: {
    methods: [
      "apply",
      "call",
      "toSource",
      "toString"
    ],
    properties: [
      "arity",
      "caller",
      "constructor",
      "length",
      "name"
    ]
  },
  Number: {
    methods: [
      "toExponential",
      "toFixed",
      "toLocaleString",
      "toPrecision",
      "toSource",
      "toString",
      "valueOf"
    ],
    properties: [
      "constructor"
    ]
  },
  Object: {
    methods: [
      "__defineGetter__",
      "__defineSetter__",
      "eval",
      "hasOwnProperty",
      "isPrototypeOf",
      "__lookupGetter__",
      "__lookupSetter__",
      "__noSuchMethod__",
      "propertyIsEnumerable",
      "toSource",
      "toLocaleString",
      "toString",
      "unwatch",
      "valueOf",
      "watch"
    ],
    properties: [
      "constructor",
      "__count__",
      "__parent__",
      "__proto__"
    ]
  },
  RangeError: {
    methods: [
      "toSource",
      "toString"
    ],
    properties: [
      "constructor",
      "name"
    ]
  },
  ReferenceError: {
    methods: [
      "toSource",
      "toString"
    ],
    properties: [
      "constructor",
      "name"
    ]
  },
  RegExp: {
    methods: [
      "exec",
      "test",
      "toSource",
      "toString"
    ],
    properties: [
      "constructor",
      "global",
      "ignoreCase",
      "lastIndex",
      "multiline",
      "source"
    ]
  },
  String: {
    methods: [
      "charAt",
      "charCodeAt",
      "concat",
      "indexOf",
      "lastIndexOf",
      "localeCompare",
      "match",
      "quote",
      "replace",
      "search",
      "slice",
      "split",
      "substr",
      "substring",
      "toLocaleLowerCase",
      "toLocaleUpperCase",
      "toLowerCase",
      "toSource",
      "toString",
      "toUpperCase",
      "trim",
      "trimLeft",
      "trimRight",
      "valueOf",
      "anchor",
      "big",
      "blink",
      "bold",
      "fixed",
      "fontcolor",
      "fontsize",
      "italics",
      "link",
      "small",
      "strike",
      "sub",
      "sup"
    ],
    properties: [
      "constructor",
      "length"
    ]
  },
  SyntaxError: {
    methods: [
      "toSource",
      "toString"
    ],
    properties: [
      "constructor",
      "name"
    ]
  },
  TypeError: {
    methods: [
      "toSource",
      "toString"
    ],
    properties: [
      "constructor",
      "name"
    ]
  },
  URIError: {
    methods: [
      "toSource",
      "toString"
    ],
    properties: [
      "constructor",
      "name"
    ]
  }
};
/*
var prefix = '/en/Core_JavaScript_1.5_Reference/Global_Objects/';
var captiontext = string.toUpperFirst(string.toLower($1)) + ' inherited from ';
var pageuri = wiki.uri(prefix + $0);
var htmlstring;
htmlstring = '' + captiontext +
                 ' ' + $0 +
                 ':
'; web.text(htmlstring);*/ var desiredprototype = prototypes[$0][string.toLower($1)]; foreach (var override in $2) { var index = list.indexOf(desiredprototype, override); if (index != (-1)) { desiredprototype = list.splice(desiredprototype, index, 1); } } htmlstring = ''; var lastindex = #desiredprototype - 1; var i = 0; foreach (var p in desiredprototype) { var pimproper = string.toUpperFirst(string.replace(p, '__', '')); pageuri = wiki.uri(prefix + $0 + '/' + pimproper); htmlstring += '' + p + ''; if (i != lastindex) { htmlstring += ', '; } i = i + 1; } htmlstring += ''; web.html(htmlstring); */

Revision Source

<div style="border: 1px solid rgb(204, 204, 204); margin: 10px 0px; padding: 0px 10px; background: rgb(238, 238, 238) none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">
<pre class="script">
var prototypes = {
  Array: {
    methods: [
      "pop",
      "push",
      "reverse",
      "shift",
      "sort",
      "splice",
      "unshift",
      "concat",
      "join",
      "slice",
      "toSource",
      "toString",
      "indexOf",
      "lastIndexOf",
      "filter",
      "forEach",
      "every",
      "map",
      "some",
      "reduce",
      "reduceRight"
    ],
    properties: [
      "constructor",
      "index",
      "input",
      "length"
    ]
  },
  Boolean: {
    methods: [
      "toSource",
      "toString",
      "valueOf"
    ],
    properties: [
      "constructor"
    ]
  },
  Date: {
    methods: [
      "getDate",
      "getDay",
      "getFullYear",
      "getHours",
      "getMilliseconds",
      "getMinutes",
      "getMonth",
      "getSeconds",
      "getTime",
      "getTimezoneOffset",
      "getUTCDate",
      "getUTCDay",
      "getUTCFullYear",
      "getUTCHours",
      "getUTCMilliseconds",
      "getUTCMinutes",
      "getUTCMonth",
      "getUTCSeconds",
      "getYear",
      "setDate",
      "setFullYear",
      "setHours",
      "setMilliseconds",
      "setMinutes",
      "setMonth",
      "setSeconds",
      "setTime",
      "setUTCDate",
      "setUTCFullYear",
      "setUTCHours",
      "setUTCMilliseconds",
      "setUTCMinutes",
      "setUTCMonth",
      "setUTCSeconds",
      "setYear",
      "toDateString",
      "toGMTString",
      "toLocaleDateString",
      "toLocaleFormat",
      "toLocaleString",
      "toLocaleTimeString",
      "toSource",
      "toString",
      "toTimeString",
      "toUTCString",
      "valueOf"
    ],
    properties: [
      "constructor"
    ]
  },
  Error: {
    methods: [
      "toSource",
      "toString"
    ],
    properties: [
      "constructor",
      "message",
      "name",
      "description",
      "number",
      "fileName",
      "lineNumber",
      "stack"
    ]
  },
  EvalError: {
    methods: [
      "toSource",
      "toString"
    ],
    properties: [
      "constructor",
      "name"
    ]
  },
  Function: {
    methods: [
      "apply",
      "call",
      "toSource",
      "toString"
    ],
    properties: [
      "arity",
      "caller",
      "constructor",
      "length",
      "name"
    ]
  },
  Number: {
    methods: [
      "toExponential",
      "toFixed",
      "toLocaleString",
      "toPrecision",
      "toSource",
      "toString",
      "valueOf"
    ],
    properties: [
      "constructor"
    ]
  },
  Object: {
    methods: [
      "__defineGetter__",
      "__defineSetter__",
      "eval",
      "hasOwnProperty",
      "isPrototypeOf",
      "__lookupGetter__",
      "__lookupSetter__",
      "__noSuchMethod__",
      "propertyIsEnumerable",
      "toSource",
      "toLocaleString",
      "toString",
      "unwatch",
      "valueOf",
      "watch"
    ],
    properties: [
      "constructor",
      "__count__",
      "__parent__",
      "__proto__"
    ]
  },
  RangeError: {
    methods: [
      "toSource",
      "toString"
    ],
    properties: [
      "constructor",
      "name"
    ]
  },
  ReferenceError: {
    methods: [
      "toSource",
      "toString"
    ],
    properties: [
      "constructor",
      "name"
    ]
  },
  RegExp: {
    methods: [
      "exec",
      "test",
      "toSource",
      "toString"
    ],
    properties: [
      "constructor",
      "global",
      "ignoreCase",
      "lastIndex",
      "multiline",
      "source"
    ]
  },
  String: {
    methods: [
      "charAt",
      "charCodeAt",
      "concat",
      "indexOf",
      "lastIndexOf",
      "localeCompare",
      "match",
      "quote",
      "replace",
      "search",
      "slice",
      "split",
      "substr",
      "substring",
      "toLocaleLowerCase",
      "toLocaleUpperCase",
      "toLowerCase",
      "toSource",
      "toString",
      "toUpperCase",
      "trim",
      "trimLeft",
      "trimRight",
      "valueOf",
      "anchor",
      "big",
      "blink",
      "bold",
      "fixed",
      "fontcolor",
      "fontsize",
      "italics",
      "link",
      "small",
      "strike",
      "sub",
      "sup"
    ],
    properties: [
      "constructor",
      "length"
    ]
  },
  SyntaxError: {
    methods: [
      "toSource",
      "toString"
    ],
    properties: [
      "constructor",
      "name"
    ]
  },
  TypeError: {
    methods: [
      "toSource",
      "toString"
    ],
    properties: [
      "constructor",
      "name"
    ]
  },
  URIError: {
    methods: [
      "toSource",
      "toString"
    ],
    properties: [
      "constructor",
      "name"
    ]
  }
};
/*
var prefix = '/en/Core_JavaScript_1.5_Reference/Global_Objects/';
var captiontext = string.toUpperFirst(string.toLower($1)) + ' inherited from ';
var pageuri = wiki.uri(prefix + $0);
var htmlstring;
htmlstring = '<span style="font-weight:bold;">' + captiontext +
                 ' <a href="'; + pageuri; + '"><code>' + $0 +
                 '</code></a></span>:<br />';
web.text(htmlstring);*/
var desiredprototype = prototypes[$0][string.toLower($1)];
foreach (var override in $2) {
  var index = list.indexOf(desiredprototype, override);
  if (index != (-1)) {
    desiredprototype = list.splice(desiredprototype, index, 1);
  }
}
htmlstring = '<span style="font-size: smaller;">';
var lastindex = #desiredprototype - 1;
var i = 0;
foreach (var p in desiredprototype) {
  var pimproper = string.toUpperFirst(string.replace(p, '__', ''));
  pageuri = wiki.uri(prefix + $0 + '/' + pimproper);
  htmlstring += '<a href="' + pageuri + '"><code>' + p +
                     '</code></a>';
  if (i != lastindex) {
    htmlstring += ', ';
  }
  i = i + 1;
}
htmlstring += '</span>';
web.html(htmlstring);
*/
</pre>
</div>
Revert to this revision