Template:jsOverrides

  • Revision slug: Template:jsOverrides
  • Revision title: Template:jsOverrides
  • Revision id: 70005
  • Created:
  • Creator: Sevenspade
  • Is current revision? No
  • Comment 40 words removed

Revision Content

var prototypes = { Object: { methods: [ "__defineGetter__", "__defineSetter__", "toSource", "toLocaleString", "toString", "unwatch", "watch" ], properties: [ "constructor", "__count__", "__parent__", "__proto__" ] } }; var prefix = '/en/Core_JavaScript_1.5_Reference/Global_Objects/'; var captiontext = $1 + ' inherited from '; var pageuri = wiki.uri(prefix + $0); pageuri = string.remove(pageuri, string.length(pageuri) - 1, 1); var htmlstring = '' + captiontext + ' ' + $0 + ':
'; web.html(htmlstring); var desiredprototype = prototypes[$0][string.toLower($1)]; var index = 0; 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); pageuri = string.remove(pageuri, string.length(pageuri) - 1, 1); 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;">
<p><span class="script"> var prototypes = { Object: { methods: [ "__defineGetter__", "__defineSetter__", "toSource", "toLocaleString", "toString", "unwatch", "watch" ], properties: [ "constructor", "__count__", "__parent__", "__proto__" ] } }; var prefix = '/en/Core_JavaScript_1.5_Reference/Global_Objects/'; var captiontext = $1 + ' inherited from '; var pageuri = wiki.uri(prefix + $0); pageuri = string.remove(pageuri, string.length(pageuri) - 1, 1); var htmlstring = '<span style="font-weight: bold;">' + captiontext + ' <a href="'; htmlstring += pageuri; htmlstring += '"><code>' + $0 + '</code></a></span>:<br />'; web.html(htmlstring); var desiredprototype = prototypes[$0][string.toLower($1)]; var index = 0; 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); pageuri = string.remove(pageuri, string.length(pageuri) - 1, 1); htmlstring += '<a href="' + pageuri + '"><code>' + p + '</code></a>'; if (i != lastindex) { htmlstring += ', '; } i = i + 1; } htmlstring += '</span>'; web.html(htmlstring); </span></p>
</div>
Revert to this revision