MediaWiki:Common.js: Unterschied zwischen den Versionen
Aus Bergisches Wiki
(Eine dazwischenliegende Version des gleichen Benutzers werden nicht angezeigt) | |||
Zeile 1: | Zeile 1: | ||
$(window).load(function() { | $(window).load(function() { | ||
+ | var getSectionCharacters = function() { | ||
+ | return $("#wikiEditor-section-characters .index div"); | ||
+ | } | ||
− | + | var filterDelete = function(sectionCharacters) { | |
+ | return sectionCharacters.filter("div[rel!='latin'][rel!='symbols']"); | ||
+ | } | ||
− | + | $(".tab-characters a").click(function() { | |
− | + | sectionCharactersCreationListener(100); | |
− | + | }); | |
− | + | sectionCharactersCreationListener = function(delay) { | |
− | + | var sectionCharactersAll = getSectionCharacters(); | |
− | + | console.log("sectionCharactersCreationListener: " + (new Date()).getMilliseconds() + "/" + sectionCharactersAll.length); | |
− | + | if (sectionCharactersAll.length > 0) { | |
− | + | var sectionCharacters = filterDelete(sectionCharactersAll); | |
− | + | sectionCharacters.remove(); | |
− | + | } else { | |
− | + | setTimeout(sectionCharactersCreationListener, delay); | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
} | } | ||
− | } | + | }; |
+ | |||
+ | var sectionCharactersAll = getSectionCharacters(); | ||
+ | var sectionCharacters = filterDelete(sectionCharactersAll); | ||
+ | sectionCharacters.remove(); | ||
}); | }); |
Aktuelle Version vom 3. Februar 2015, 15:32 Uhr
$(window).load(function() { var getSectionCharacters = function() { return $("#wikiEditor-section-characters .index div"); } var filterDelete = function(sectionCharacters) { return sectionCharacters.filter("div[rel!='latin'][rel!='symbols']"); } $(".tab-characters a").click(function() { sectionCharactersCreationListener(100); }); sectionCharactersCreationListener = function(delay) { var sectionCharactersAll = getSectionCharacters(); console.log("sectionCharactersCreationListener: " + (new Date()).getMilliseconds() + "/" + sectionCharactersAll.length); if (sectionCharactersAll.length > 0) { var sectionCharacters = filterDelete(sectionCharactersAll); sectionCharacters.remove(); } else { setTimeout(sectionCharactersCreationListener, delay); } }; var sectionCharactersAll = getSectionCharacters(); var sectionCharacters = filterDelete(sectionCharactersAll); sectionCharacters.remove(); });