MediaWiki:Vector.js
Z High School DxD Wiki
Uwaga: aby zobaczyć zmiany po zapisaniu, może zajść potrzeba wyczyszczenia pamięci podręcznej przeglądarki.
- Firefox / Safari: Przytrzymaj Shift podczas klikania Odśwież bieżącą stronę, lub naciśnij klawisze Ctrl+F5 lub Ctrl+R (⌘-R na komputerze Mac)
- Google Chrome: Naciśnij Ctrl-Shift-R (⌘-Shift-R na komputerze Mac)
- Internet Explorer: Przytrzymaj Ctrl, jednocześnie klikając Odśwież, lub naciśnij klawisze Ctrl+F5
- Opera: Wyczyść pamięć podręczną w Narzędzia → Preferencje
$(function(){ if ($.browser.mozilla) { $('#left-navigation, #right-navigation').css('top', '10.8em'); } }); window.wgSidebar = (window.wgSidebar||{}); importScript('MediaWiki:Vector.js/Sidebar.js'); Sidebar = { getItem: function(name) { return $(document.getElementById('n-' + encodeURIComponent(name.replace(/ /g, '-')).replace(/%/g, '.'))); }, init: function() { if (!window.wgSidebar) return; for (var menu in wgSidebar) { var item = Sidebar.getItem(menu); Sidebar.buildSubmenu(item, wgSidebar[menu]); var ul = item.parent('ul'); } ul.on('mouseenter', 'li', function() { var el = $(this); $(this).children('ul').css({display:'block', left: el.width(), top: 0}); }).on('mouseleave', 'li', function() { var submenu = $(this).children('ul'); if(submenu.is(':visible')) { submenu.css({display: 'none'}); } }); }, buildSubmenu: function(menu, items) { var ul = $('<ul>'); menu.addClass('submenu'); for (var i in items) { var item = items[i]; var li = $('<li>'); if (typeof item === 'string') { var link = this.getLink(item); li.append(link); ul.append(li); } else if(typeof item === 'object') { for (var j in item) { var link = this.getLink(j); li.append(link); ul.append(li); this.buildSubmenu(li, item[j]); } } else continue; } menu.append(ul); }, getLink: function(txt, has_submenu) { var pos = txt.indexOf('|'); var article = ''; var caption = ''; if (pos > 0) { article = txt.substr(0, pos); caption = txt.substr(pos + 1); } else { article = txt; caption = txt; } var href = ''; if (article.length > 7 && article.substr(0,7) == 'http://') { href = article; } else { article = encodeURIComponent(article.replace(/ /g, '_')); href = wgArticlePath.replace('$1',article); } return '<a href="' + href + '">' + caption + '</a>'; } } CookieBox = $('<div id="CookieInfo"></div>').css({top: ($(window).height() - CookieBox.height())/2, left: ($(window).width() - CookieBox.width())/2}); $('body').append(CookieBox); var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-42481301-1']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })();