diff options
author | Yorhel <git@yorhel.nl> | 2009-10-07 18:49:31 +0200 |
---|---|---|
committer | Yorhel <git@yorhel.nl> | 2009-10-07 18:49:31 +0200 |
commit | bbc03376d61e2e557d473368611dbba5eead6338 (patch) | |
tree | b22400cf38f1d18c130647f0236ccdf4dd84257e /data | |
parent | 46a046e88c0059770fcffcf64d43ddbdbeb4fcc6 (diff) |
Changed language selector into a Javascript dropdown
Diffstat (limited to 'data')
-rw-r--r-- | data/script.js | 16 | ||||
-rw-r--r-- | data/style.css | 7 |
2 files changed, 20 insertions, 3 deletions
diff --git a/data/script.js b/data/script.js index 27139c69..bd56f12e 100644 --- a/data/script.js +++ b/data/script.js @@ -344,6 +344,8 @@ function ddRefresh() { ddx -= box.offsetWidth; if(lnk.dd_align == 'tagmod') ddx += lnk.offsetWidth-35; + if(lnk.dd_align == 'bottom') + ddy += lnk.offsetHeight; box.style.left = ddx+'px'; box.style.top = ddy+'px'; return true; @@ -1749,6 +1751,20 @@ if(byId('advselect') && byId('ti')) { dsInit(byId('te'), '/xml/tags.xml?q=', trfunc, serfunc, retfunc, parfunc); } +// Language selector +if(byId('lang_select')) + ddInit(byId('lang_select'), 'bottom', function(lnk) { + var lst = tag('ul', null); + for(var i=0; i<L10N_LANG.length; i++) { + var ln = L10N_LANG[i]; + var icon = tag('acronym', {'class':'icons lang '+ln}, ' '); + lst.appendChild(tag('li', {'class':'lang_selector'}, mt_curlang == ln + ? tag('i', icon, mt('_lang_'+ln)) + : tag('a', {href:'?l10n='+ln}, icon, L10N_STR['_lang_'+ln][ln]) + )); + } + return lst; + }); // spam protection on all forms setTimeout(function() { diff --git a/data/style.css b/data/style.css index 192f909d..af9370e3 100644 --- a/data/style.css +++ b/data/style.css @@ -272,7 +272,7 @@ b.future, b.standout { font-size: 11px; color: $maintext$; } -#menulist h2 span { +#menulist h2 #lang_select { float: right; padding-top: 1px; } @@ -306,6 +306,7 @@ b.future, b.standout { #menulist #search input.submit { display: none; } +#dd_box acronym { margin: 2px 5px 2px 0!important; } @@ -697,8 +698,8 @@ a.addnew { #dd_box { position: absolute; left: -500px; border: 1px solid $border$; background-color: $secbg$; } #dd_box ul { list-style-type: none; margin: 0; padding: 0 } #dd_box li b { display: block; font-weight: normal; padding-left: 5px; } -#dd_box li i { display: block; font-style: normal; padding-left: 10px; } -#dd_box li a { display: block; padding-left: 10px; color: $link$; border: 0; } +#dd_box li i { display: block; font-style: normal; padding-left: 10px; padding-right: 5px } +#dd_box li a { display: block; padding-left: 10px; color: $link$; border: 0; padding-right: 5px } #dd_box li a:hover { background: url($_boxbg$) repeat } #dd_box .vrdd { width: 180px; } #dd_box .vrdd ul { float: left; width: 90px; } |