MediaWiki:Common.js: Unterschied zwischen den Versionen
Aus Bergisches Wiki
Zeile 4: | Zeile 4: | ||
$(".tab-characters a").click(function() { | $(".tab-characters a").click(function() { | ||
− | sectionCharactersCreationListener(100 | + | sectionCharactersCreationListener(100); |
}); | }); | ||
− | sectionCharactersCreationListener = function(delay | + | sectionCharactersCreationListener = function(delay) { |
var sectionCharactersAll = $("#wikiEditor-section-characters .index div"); | var sectionCharactersAll = $("#wikiEditor-section-characters .index div"); | ||
Zeile 15: | Zeile 15: | ||
var sectionCharacters = sectionCharactersAll.filter("div[rel!='latin'][rel!='symbols']"); | var sectionCharacters = sectionCharactersAll.filter("div[rel!='latin'][rel!='symbols']"); | ||
sectionCharacters.remove(); | sectionCharacters.remove(); | ||
− | } else if ( | + | } else if (delay > 0) { |
− | setTimeout(sectionCharactersCreationListener, delay | + | setTimeout(sectionCharactersCreationListener, delay); |
} | } | ||
}; | }; | ||
− | + | sectionCharactersCreationListener(0); | |
− | + | ||
− | + | ||
− | + | ||
} | } | ||
}); | }); |
Version vom 3. Februar 2015, 15:30 Uhr
$(window).load(function() { if ($(".tab-characters a").length > 0) { // => Skript greift nur im Edit-Mode $(".tab-characters a").click(function() { sectionCharactersCreationListener(100); }); sectionCharactersCreationListener = function(delay) { var sectionCharactersAll = $("#wikiEditor-section-characters .index div"); console.log("sectionCharactersCreationListener: " + (new Date()).getMilliseconds() + "/" + sectionCharactersAll.length); if (sectionCharactersAll.length > 0) { var sectionCharacters = sectionCharactersAll.filter("div[rel!='latin'][rel!='symbols']"); sectionCharacters.remove(); } else if (delay > 0) { setTimeout(sectionCharactersCreationListener, delay); } }; sectionCharactersCreationListener(0); } });