Conteúdo apagado Conteúdo adicionado
novo |
m - emitindo alerta |
||
Linha 2:
"use strict";
var NavigationBarHide = "ocultar
var NavigationBarShow = "exibir
function checkAndSetToggleified(element) {
Linha 28:
var text = jQuery(heading).text()
.toLowerCase()
.replace(/^\s+|\s+$/g, "").replace(/\s+/g, " ")
.replace(/^[1-9][0-9.]+ ?/, "");
if (/^[a-zA-Z0-9\s_-]+$/.test(text))
Linha 61 ⟶ 59:
if (!(navHead && navContent))
return;
$(navHead).find("a").on("click", function (e) {
e.stopPropagation();
});
var $navToggle = $("<a>").attr("role", "button").attr("tabindex", "0");
Linha 90 ⟶ 86:
}
function setupHiddenQuotes(li) {
if (checkAndSetToggleified(li)) {
return;
}
var HQToggle, liComp, dl;
var HQShow = "citações";
var HQHide = "citações";
function show() {
HQToggle.html(HQHide);
$(li).children("ul").show();
}▼
function hide() {
HQToggle.html(HQShow);
$(li).children("ul").hide();
}▼
for (var k = 0; k < li.childNodes.length; k++) {
// Look at each component of the definition.
liComp = li.childNodes[k];
if (liComp.nodeName.toLowerCase() === "dl" && !dl) {
dl = liComp;
if (/^(ul|UL)$/.test(liComp.nodeName)) {
HQToggle = $("<a>").attr("role", "button").attr("tabindex", "0");
$(dl || liComp).before($("<span>").addClass("HQToggle").append(HQToggle));
HQToggle.on("click", window.VisibilityToggles.register("quotations", show, hide));
break;
}
}▼
}
function viewSwitching(rootElement) {
Linha 98 ⟶ 125:
var $rootElement = $(rootElement);
var showButtonText = $rootElement.data("vs-showtext") || "mais
var hideButtonText = $rootElement.data("vs-hidetext") || "menos
var toSkip = $rootElement.find(".vsSwitcher").find("*");
Linha 113 ⟶ 140:
e.stopPropagation();
});
var toggleButton = $("<a>").attr("role", "button").attr("tabindex", "0");
$("<span>").addClass("NavToggle").append(toggleButton).prependTo(toggleElement);
var toggleCategory = $rootElement.data("toggle-category");
if (!toggleCategory) {
Linha 135 ⟶ 160:
if (!toggleCategory)
toggleCategory = "others";
toggleElement.css("cursor", "pointer");
toggleElement.on("click", window.VisibilityToggles.register(toggleCategory,
Linha 151 ⟶ 175:
}
window.listSwitcherRowCount = window.listSwitcherRowCount || 3;
Linha 177 ⟶ 200:
var $rootElement = $(rootElement);
var $termList = $rootElement.find(".term-list");
var $toggleElement = $rootElement.find(".list-switcher-element");
var columnCount = parseInt($termList.data("column-count"), 10);
if (!(columnCount && columnCount > 0)) {
Linha 189 ⟶ 209:
var $listItems = $rootElement.find("ul").first().find("li");
var $toHide = getListItemsToHide($listItems, columnCount, rowsInShowState);
if ($toHide.length === 0) {
$toggleElement.hide();
Linha 197 ⟶ 216:
$toggleElement.css("cursor", "pointer");
var $toggleButton = $("<a>").attr("role", "button").attr("tabindex", "0");
Linha 207 ⟶ 224:
$navToggle.css(rootBackgroundColor ? "background-color" : "background",
rootBackgroundColor || rootBackground);
$toggleElement.children("a").on("click", function (e) {
e.stopPropagation();
});
var toggleCategory = $rootElement.data("toggle-category")
|| getToggleCategory($rootElement[0], "other lists");
▲ var showButtonText = $toggleElement.data("showtext") || "mais ᐯ";
▲ var hideButtonText = $toggleElement.data("hidetext") || "menos ᐱ";
$toggleElement.on("click", window.VisibilityToggles.register(toggleCategory,
function show() {
Linha 231 ⟶ 243:
$toHide.hide();
}));
$navToggle.append($toggleButton).prependTo($toggleElement);
$toggleElement.show();
Linha 242 ⟶ 253:
window.getToggleCategory = getToggleCategory;
mw.hook('wikipage.content').add(function($content) {
// NavToggles
Linha 248 ⟶ 258:
createNavToggle(this);
});
if (mw.config.get('wgNamespaceNumber') === 0) {
$('ol > li', $content).each(function(){
setupHiddenQuotes(this);
Linha 257 ⟶ 265:
}
$('.vsSwitcher', $content).each(function(){
viewSwitching(this);
});
$(".list-switcher", $content).each(function () {
enableListSwitch(this, window.listSwitcherRowCount);
|