MediaWiki:Common.js: razlika med redakcijama

Jump to navigation Jump to search
moving from monobook.js, update
(prenesen začetek w:MediaWiki:Common.js)
 
(moving from monobook.js, update)
/* Any JavaScript here will be loaded for all users on every page load. */
 
/* Scripts specific to Internet Explorer */
/* Preizkus, ali ima element določen razred **************************************
if ($.client.profile().name == 'msie') {
*
/* Preizkus, ali ima element/** določenInternet razredExplorer bug fix **************************************************
* Opis: Uses regular expressions and caching for better performance.
*
* Vzdrževalci: [[:en:User:Mike Dillon|Mike Dillon]], [[:en:User:R. Koot|R. Koot]], [[:en:User:SG|SG]]
* Description: Fixes IE horizontal scrollbar bug
*/
* VzdrževalciMaintainers: [[:en:User:Tom-|Tom-]]?
*/
var oldWidth;
var hasClass = (function () {
var reCachedocEl = {}document.documentElement;
return function (element, className) {
return (reCache[className] ? reCache[className] : (reCache[className] = new RegExp("(?:\\s|^)" + className + "(?:\\s|$)"))).test(element.className);
};
})();
 
/** Popravek hrošča za Internet Explorer **************************************************
*
* Opis: UNDOCUMENTED
* Vzdrževalci: [[:en:User:Tom-|Tom-]]?
*/
var hasClassfixIEScroll = (function () {
if (navigator.appName == "Microsoft Internet Explorer" && document.compatMode == "CSS1Compat")
if (!oldWidth || docEl.clientWidth > oldWidth) {
{
doFixIEScroll();
var oldWidth;
} else {
var docEl = document.documentElement;
setTimeout(doFixIEScroll, 1);
};
oldWidth = docEl.clientWidth;
function fixIEScroll()
{ };
if (!oldWidth || docEl.clientWidth > oldWidth)
doFixIEScroll();
else
setTimeout(doFixIEScroll, 1);
oldWidth = docEl.clientWidth;
}
function var doFixIEScroll = function () {
docEl.style.overflowX = (docEl.scrollWidth - docEl.clientWidth < 4) ? "hidden" : "";
};
document.attachEvent("onreadystatechange", fixIEScroll);
document.attachEvent("onresize", fixIEScroll);
}
// In print IE (7?) does not like line-height
mw.util.addCSS('@media print { sup, sub, p, .documentDescription { line-height: normal; } }');
{
// IE overflow bug
mw.util.addCSS('div.overflowbugx { overflow-x: scroll !important; overflow-y: hidden !important; } '
+ 'div.overflowbugy { overflow-y: scroll !important; overflow-x: hidden !important; }');
// IE zoomfix
// Use to fix right floating div/table inside tables
mw.util.addCSS('.iezoomfix div, .iezoomfix table { zoom: 1; }');
}
 
/** Skrčljive razpredelnice *********************************************************
for ( var i = 0; i < Tables.length; i++ ) {
if ( hasClass$( Tables[i], ).hasClass("collapsible" ) ) {
/* only add button and increment count if there is a header row to work with */
for ( var i = 0; i < tableIndex; i++ ) {
if ( hasClass$( NavigationBoxes[i], ).hasClass("collapsed" ) || ( tableIndex >= autoCollapse && hasClass$( NavigationBoxes[i], ).hasClass("autocollapse" ) ) ) {
collapseTable( i );
}
NavChild = NavChild.nextSibling
) {
if ( hasClass$( NavChild, ).hasClass('NavPic' ) ) {
NavChild.style.display = 'none';
}
if ( hasClass$( NavChild, ).hasClass('NavContent') ) {
NavChild.style.display = 'none';
}
NavChild = NavChild.nextSibling
) {
if (hasClass$(NavChild, ).hasClass('NavPic')) {
NavChild.style.display = 'block';
}
if (hasClass$(NavChild, ).hasClass('NavContent')) {
NavChild.style.display = 'block';
}
) {
// if found a navigation bar
if (hasClass$(NavFrame, ).hasClass("NavFrame")) {
indexNavigationBar++;
NavChild = NavChild.nextSibling
) {
if ( hasClass$( NavChild, ).hasClass('NavPic' ) || hasClass$( NavChild, ).hasClass('NavContent' ) ) {
if (NavChild.style.display == 'none') {
NavToggleText = document.createTextNode(NavigationBarShow);
j++
) {
if (hasClass$(NavFrame.childNodes[j], ).hasClass("NavHead")) {
NavFrame.childNodes[j].appendChild(NavToggle);
}
11

urejanj

Navigacijski meni