先日、Blogger Slippy Mapウィジェットを作成した際にちらちらと見ていたので、こっちに貼っておこうと思います。
ウィキトラベルはMediaWikiを使っていますので、MediaWikiで動くように書いたつもりですが、動作確認はローカル (自分のPCのブラウザ) でしか行っておらず、サーバーに置いての確認はしていません。(サーバー持ってないし、ウィキトラベルではユーザーのCSSやJavaScriptを使うことできないので...)
JavaScript
CSS
JavaScript
/* User JavaScript */ /** Icons for sidebar links *************************************** * * Description: Mark sidebar links with icons (star, dotm, otbp) by changing the bullet * into other list marker designated by Template:Sidebar-icons. * Author: [[User:Tatata]] */ function SidebarIcons() { var markers, pLangLinks; // find marking template info markers = document.getElementsByTagName("span"); for ( var i=0; i < markers.length; i++ ) { switch ( markers[i].className ) { case "sidebaricon-star": case "sidebaricon-dotm": case "sidebaricon-otbp": // links in p-lang ( "In other languages" box ) if ( document.getElementById( "p-lang" ) ) { pLangLinks = document.getElementById( "p-lang" ).getElementsByTagName( "li" ); // find language code and replace class name with if matched for ( var j=0; j < pLangLinks.length; j++) { var a, b; a = markers[i].id; b = markers[i].className + "-lang-" + pLangLinks[j].getElementsByTagName("a")[0].getAttribute("hreflang"); if ( a == b ) { switch ( markers[i].className ) { case "sidebaricon-star": pLangLinks[j].className = markers[i].className; pLangLinks[j].title = "This is a Star article in another language."; break; case "sidebaricon-dotm": pLangLinks[j].className = markers[i].className; pLangLinks[j].title = "This is a previous Destinations of the month article in another language."; break; case "sidebaricon-otbp": pLangLinks[j].className = markers[i].className; pLangLinks[j].title = "This is a previous Off the beaten path article in another language."; break; default: break; } } } } break; default: break; } } } addOnloadHook( SidebarIcons );
CSS
/* User CSS (Cascading Style Sheets) */ /* Sidebar Icons */ li.sidebaricon-star { list-style-image: url("http://wikitravel.org/upload/ja/0/07/Listmarker-star.png"); } li.sidebaricon-dotm { list-style-image: url("http://wikitravel.org/upload/ja/0/08/Listmarker-dotm.png"); } li.sidebaricon-otbp { list-style-image: url("http://wikitravel.org/upload/ja/e/e6/Listmarker-otbp.png"); }
|