Sha256: bea9cd1298714cf1157d5c20390cd66d19b1fa2cbcafa5d09c2bbcd1b0740e1a

Contents?: true

Size: 1.62 KB

Versions: 10

Compression:

Stored size: 1.62 KB

Contents

window.onload = init;

var langElements = new Array();

function init() {
	var els = document.getElementsByTagName( 'pre' );
	var elsLen = els.length;
	var pattern = new RegExp('(^|\\s)(cs|vb|mc|js)(\\s|$)');
	for (i = 0, j = 0; i < elsLen; i++) {
		if ( pattern.test(els[i].className) ) {
		   //els[i].style.background = "#fcc";
		   langElements[j] = els[i];
		   j++;
		}
	}
	
	var lang = getCookie( "lang" );
	if ( lang == null ) lang = "cs";
	showLang(lang);
}

function getCookie(name) {
 	var cname = name + "=";
	var dc = document.cookie;
	if ( dc.length > 0 ) {
	   begin = dc.indexOf(cname);
	   if ( begin != -1 ) {
	   	  begin += cname.length;
		  end = dc.indexOf(";",begin);
		  if (end == -1) end = dc.length;
		  return unescape(dc.substring(begin, end) );
	   }
	}
}

function setCookie(name,value,expires) {
	document.cookie = name + "=" + escape(value) + "; path=/" +
	((expires == null) ? "" : "; expires=" + expires.toGMTString());
}

function showLang(lang) {
	var pattern = new RegExp('(^|\\s)'+lang+'(\\s|$)');
	var elsLen = langElements.length;
	for (i = 0; i < elsLen; i++ )
	{
	 	var el = langElements[i];
		if ( pattern.test( el.className ) )
		   el.style.display = "";
		else
		   el.style.display = "none";
	}
	setCookie("lang",lang);
}

function Show( id ) {
	document.getElementById(id).style.display = "";
}

function Hide( id ) {
	document.getElementById(id).style.display = "none";
}

function ShowCS() {
	showLang('cs');
}

function ShowVB() {
	showLang('vb');
}

function ShowMC() {
	showLang('mc');
}

function ShowJS() {
	showLang('js');
}

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
nunit-2.5.7.10213.20100801 docs/codeFuncs.js
nunit-2.5.7.10213 docs/codeFuncs.js
nunit-2.5.6.10205 docs/codeFuncs.js
nunit-2.5.5.10112 docs/codeFuncs.js
nunit-2.5.4.10098 docs/codeFuncs.js
nunit-2.5.3.9345 docs/codeFuncs.js
nunit-2.5.2.9222 docs/codeFuncs.js
nunit-2.5.1.9189 docs/codeFuncs.js
nunit-2.5.0.9122 docs/codeFuncs.js
nunit-2.4.8.0 docs/codeFuncs.js