МедияУики:Common.js/Core.js

От БГ-Фантастика
Направо към: навигация, търсене
/** Namespace constants */
var
NS_MEDIA          = -2,
NS_SPECIAL        = -1,
NS_MAIN           = 0,
NS_TALK           = 1,
NS_USER           = 2,
NS_USER_TALK      = 3,
NS_PROJECT        = 4,
NS_PROJECT_TALK   = 5,
NS_IMAGE          = 6,
NS_IMAGE_TALK     = 7,
NS_MEDIAWIKI      = 8,
NS_MEDIAWIKI_TALK = 9,
NS_TEMPLATE       = 10,
NS_TEMPLATE_TALK  = 11,
NS_HELP           = 12,
NS_HELP_TALK      = 13,
NS_CATEGORY       = 14,
NS_CATEGORY_TALK  = 15;

var
DEFAULT_USER_LANGUAGE = "bg",
FALLBACK_USER_LANGUAGE = "en";

/** Checks if a value exists in an array */
function inArray(val, arr) {
	var len = arr.length;
	for (var i = 0 ; i < len ; i++) {
		if (arr[i] === val) {
			return true;
		}
	}
	return false;
}