mirror of
https://github.com/Sarjuuk/aowow.git
synced 2025-11-29 15:58:16 +08:00
* split global.js into its components, so it can be reasonably processed by setup * make reputation requirements configurable * move Markup and Locale back into global.js (removed associated build scripts) * extend Icon to display iconId in lightbox popup
38 lines
967 B
JavaScript
38 lines
967 B
JavaScript
// TODO: Create a "Cookies" object
|
|
|
|
function g_cookiesEnabled()
|
|
{
|
|
document.cookie = 'enabledTest';
|
|
return (document.cookie.indexOf("enabledTest") != -1) ? true : false;
|
|
}
|
|
|
|
function g_getWowheadCookie(name)
|
|
{
|
|
if (g_user.id > 0)
|
|
{
|
|
return g_user.cookies[name]; // no point checking if it exists, as undefined tests as false anyways
|
|
}
|
|
else
|
|
{
|
|
return $WH.gc(name); // plus gc does the same thing..
|
|
}
|
|
}
|
|
|
|
function g_setWowheadCookie(name, data, browser)
|
|
{
|
|
var temp = name.substr(0, 5) == 'temp_';
|
|
if (!browser && g_user.id > 0 && !temp) {
|
|
new Ajax('?cookie=' + name + '&' + name + '=' + $WH.urlencode(data), {
|
|
method: 'get',
|
|
onSuccess: function(xhr) {
|
|
if (xhr.responseText == 0)
|
|
g_user.cookies[name] = data;
|
|
}
|
|
});
|
|
}
|
|
else if (browser || g_user.id == 0)
|
|
{
|
|
$WH.sc(name, 14, data, null, location.hostname);
|
|
}
|
|
}
|