", ' ' + $WH.sprintf(_LANG.achievementcomplete, currentParams.who, currentParams.when.getMonth() + 1, currentParams.when.getDate(), currentParams.when.getFullYear()) + "
");
html = html.replace(/class="q0"/g, 'class="r3"');
}
}
}
if (currentParams.map && map && map.getMap) {
html2 = map.getMap();
}
if (mode == 1) {
$WH.Tooltip.setIcon(null);
$WH.Tooltip.show(currentA, html, null, null, null, html2);
}
else {
$WH.Tooltip.setIcon(icon);
$WH.Tooltip.showAtXY(html, cursorX, cursorY, CURSOR_HSPACE, CURSOR_VSPACE, html2);
}
if (isRemote && $WH.Tooltip.logo) {
$WH.Tooltip.logo.style.display = (showLogo ? "block": "none");
}
}
function showLoading(type, id, locale) {
if (currentType == type && currentId == id && currentLocale == locale) {
showTooltip(_LANG.loading);
var arr = LOOKUPS[type][0];
arr[id].timer = setTimeout(function () {
notFound.apply(this, [type, id, locale]);
}, 3850);
}
}
function notFound(type, id, locale) {
var arr = LOOKUPS[type][0];
arr[id].status[locale] = STATUS_ERROR;
if (currentType == type && currentId == id && currentLocale == locale) {
showTooltip(_LANG.noresponse);
}
}
function getFullId(id, params) {
return id + (params.rand ? "r" + params.rand : "") + (params.ench ? "e" + params.ench : "") + (params.gems ? "g" + params.gems.join(",") : "") + (params.sock ? "s" : "");
}
this.loadScales = function (type, locale) {
var arr = LOOKUPS[type][0];
for (var i in LOCALES) {
if (locale == i || (!locale && !isNaN(i))) {
SCALES[type][i] = SCALES_LOADED;
for (var id in arr) {
if (arr[id].status[i] == STATUS_SCALES && arr[id].response[i]) {
arr[id].response[i]();
}
}
}
}
};
this.register = function (type, id, locale, json) {
var arr = LOOKUPS[type][0];
initElement(type, id, locale);
if (SCALES[type] && SCALES[type][locale] != SCALES_LOADED) {
arr[id].status[locale] = STATUS_SCALES;
arr[id].response[locale] = this.register.bind(this, type, id, locale, json);
return;
}
if (arr[id].timer) {
clearTimeout(arr[id].timer);
arr[id].timer = null;
}
if (!$WH.wowheadRemote && json.map) {
if (arr[id].map == null) {
arr[id].map = new Mapper({
parent: $WH.ce("div"),
zoom: 3,
zoomable: false,
buttons: false
});
}
arr[id].map.update(json.map);
delete json.map;
}
$WH.cO(arr[id], json);
if (arr[id].status[locale] == STATUS_QUERYING || arr[id].status[locale] == STATUS_SCALES) {
if (arr[id][getTooltipField(locale)]) {
arr[id].status[locale] = STATUS_OK;
}
else {
arr[id].status[locale] = STATUS_NOTFOUND;
}
}
if (currentType == type && id == currentId && currentLocale == locale) {
showTooltip(arr[id][getTooltipField(locale)], arr[id].icon, arr[id].map, arr[id][getSpellsField(locale)], arr[id][getTooltipField(locale, 2)]);
}
};
this.registerNpc = function (id, locale, json) {
this.register(TYPE_NPC, id, locale, json);
};
this.registerObject = function (id, locale, json) {
this.register(TYPE_OBJECT, id, locale, json);
};
this.registerItem = function (id, locale, json) {
this.register(TYPE_ITEM, id, locale, json);
};
this.registerQuest = function (id, locale, json) {
this.register(TYPE_QUEST, id, locale, json);
};
this.registerSpell = function (id, locale, json) {
this.register(TYPE_SPELL, id, locale, json);
};
this.registerAchievement = function (id, locale, json) {
this.register(TYPE_ACHIEVEMENT, id, locale, json);
};
this.registerProfile = function (id, locale, json) {
this.register(TYPE_PROFILE, id, locale, json);
};
this.displayTooltip = function (type, id, locale, params) {
display(type, id, locale, params);
};
this.request = function (type, id, locale, params) {
if (!params) {
params = {};
}
var fullId = getFullId(id, params);
initElement(type, fullId, locale);
request(type, id, locale, 1, params);
};
this.requestItem = function (id, params) {
this.request(TYPE_ITEM, id, Locale.id, params);
};
this.requestSpell = function (id) {
this.request(TYPE_SPELL, id, Locale.id);
};
this.getStatus = function (type, id, locale) {
var arr = LOOKUPS[type][0];
if (arr[id] != null) {
return arr[id].status[locale];
}
else {
return STATUS_NONE;
}
};
this.getItemStatus = function (id, locale) {
this.getStatus(TYPE_ITEM, id, locale);
};
this.getSpellStatus = function (id, locale) {
this.getStatus(TYPE_SPELL, id, locale);
};
this.refreshLinks = function () {
if (typeof aowow_tooltips != "undefined") {
for (var i = 0; i < document.links.length; i++) {
var link = document.links[i];
var node = link.parentNode;
var isTooltipChild = false;
while (node != null) {
if ((" " + node.className + " ").replace(/[\n\t]/g, " ").indexOf(" wowhead-tooltip ") > -1) {
isTooltipChild = true;
break;
}
node = node.parentNode
}
if (!isTooltipChild) {
scanElement(link);
}
}
}
this.hideTooltip();
};
this.setParent = function (newParent) {
$WH.Tooltip.reset();
$WH.Tooltip.prepare(newParent);
};
if (isRemote) {
this.set = function (foo) {
$WH.cO(opt, foo);
};
this.showTooltip = function (e, tooltip, icon) {
updateCursorPos(e);
showTooltip(tooltip, icon);
};
this.hideTooltip = function () {
$WH.Tooltip.hide();
};
this.moveTooltip = function (e) {
onMouseMove(e);
}
}
init();
}
}; |
|