ImageManager/assets/popup.js
Summary
No overview generated for 'ImageManager/assets/popup.js'
function getAbsolutePos(el) {
var r = { x: el.offsetLeft, y: el.offsetTop };
if (el.offsetParent) {
var tmp = getAbsolutePos(el.offsetParent);
r.x += tmp.x;
r.y += tmp.y;
}
return r;
};
function comboSelectValue(c, val) {
var ops = c.getElementsByTagName("option");
for (var i = ops.length; --i >= 0;) {
var op = ops[i];
op.selected = (op.value == val);
}
c.value = val;
};
function __dlg_onclose() {
if(opener.Dialog._return)
opener.Dialog._return(null);
};
function __dlg_init(bottom) {
var body = document.body;
var body_height = 0;
var pos = null;
var x = null;
var y = null;
if (typeof bottom == "undefined") {
var div = document.createElement("div");
body.appendChild(div);
pos = getAbsolutePos(div);
body_height = pos.y;
} else {
pos = getAbsolutePos(bottom);
body_height = pos.y + bottom.offsetHeight;
}
if(opener && opener.Dialog && opener.Dialog._arguments)
window.dialogArguments = opener.Dialog._arguments;
if (!document.all) {
window.addEventListener("unload", __dlg_onclose, true);
x = opener.screenX + (opener.outerWidth - window.outerWidth) / 2;
y = opener.screenY + (opener.outerHeight - window.outerHeight) / 2;
window.moveTo(x, y);
} else {
var ch = body.clientHeight;
var cw = body.clientWidth;
var W = body.offsetWidth;
var H = 2 * body_height - ch;
if(ch <= 0) H = body_height;
x = (screen.availWidth - W) / 2;
y = (screen.availHeight - H) / 2;
window.moveTo(x, y);
}
document.body.onkeypress = __dlg_close_on_esc;
};
function __dlg_translate(context) {
var types = ["span", "option", "td", "button", "div", "label", "a","img", "legend"];
var txt = null;
for (var type = 0; type < types.length; ++type) {
var spans = document.getElementsByTagName(types[type]);
for (var i = spans.length; --i >= 0;) {
var span = spans[i];
if (span.firstChild && span.firstChild.data) {
txt = HTMLArea._lc(span.firstChild.data, context);
if (txt)
span.firstChild.data = txt;
}
if (span.title) {
txt = HTMLArea._lc(span.title, context);
if (txt)
span.title = txt;
}
if (span.alt) {
txt = HTMLArea._lc(span.alt, context);
if (txt)
span.alt = txt;
}
}
}
document.title = HTMLArea._lc(document.title, context);
};
function __dlg_close(val) {
opener.Dialog._return(val);
window.close();
};
function __dlg_close_on_esc(ev) {
ev || (ev = window.event);
if (ev.keyCode == 27) {
window.close();
return false;
}
return true;
};
Documentation generated by
JSDoc on Sat Dec 31 14:56:56 2005