mirror of
https://github.com/Sarjuuk/aowow.git
synced 2025-12-01 21:15:20 +08:00
menu more and tools
- items: allow 'upg' to be an array - filter: fixed logic error in checks - Markup: prevent handling of [menu], as PageTemplate is nyi - Power: advanced features (hide reagents or sellprice; recoloring, renaming, iconizing of links) - search: side-icon for titles - smarty: added template-vars to cache (has to be fixed sooner or later) - identify as HTML5 (fixed a strange bug with displaced list-pegs) - removed several typos
This commit is contained in:
56
static/widgets/searchbox.js
Normal file
56
static/widgets/searchbox.js
Normal file
@@ -0,0 +1,56 @@
|
||||
(function () {
|
||||
function create(w, h) {
|
||||
var
|
||||
scripts = document.getElementsByTagName('SCRIPT'),
|
||||
body;
|
||||
|
||||
/* sarjuuk: workaround to avoid hardcoding the url of the body */
|
||||
if (scripts && scripts.length > 0) {
|
||||
for (var i in scripts) {
|
||||
if (!scripts[i].src) {
|
||||
continue;
|
||||
}
|
||||
|
||||
var m = scripts[i].src.match(/(.*)\/widgets\/searchbox\.js$/);
|
||||
if (!m) {
|
||||
continue;
|
||||
}
|
||||
|
||||
body = m[1] + '/widgets/searchbox/searchbox.html';
|
||||
break;
|
||||
}
|
||||
}
|
||||
/* end */
|
||||
|
||||
var buff = '<iframe src="' + body + '" width="' + w + '" height="' + h + '" frameborder="0" class="aowow-searchbox"';
|
||||
buff += "></iframe>";
|
||||
|
||||
document.write(buff);
|
||||
}
|
||||
|
||||
function init() {
|
||||
var formats = {
|
||||
"160x200": { width: 160, height: 200 },
|
||||
"160x120": { width: 160, height: 120 },
|
||||
"120x200": { width: 120, height: 200 },
|
||||
"120x120": { width: 120, height: 120 },
|
||||
"150x120": { width: 150, height: 120 }
|
||||
};
|
||||
|
||||
var dim;
|
||||
|
||||
if (typeof aowow_searchbox_format != "undefined") {
|
||||
if (formats[aowow_searchbox_format]) {
|
||||
dim = formats[aowow_searchbox_format];
|
||||
}
|
||||
}
|
||||
|
||||
if (!dim) {
|
||||
dim = formats["160x200"];
|
||||
}
|
||||
|
||||
create(dim.width, dim.height);
|
||||
}
|
||||
|
||||
init();
|
||||
})();
|
||||
Reference in New Issue
Block a user