Ativa o menu
Toggle preferences menu
Alternar menu pessoal
Não autenticado(a)
Your IP address will be publicly visible if you make any edits.

MediaWiki:Common.js: mudanças entre as edições

Página de Interface do MediaWiki
Sem resumo de edição
Sem resumo de edição
 
(5 revisões intermediárias pelo mesmo usuário não estão sendo mostradas)
Linha 1: Linha 1:
/*global jQuery */
/* Any JavaScript here will be loaded for all users on every page load. */
/*!
* Lettering.JS 0.7.0
*
* Copyright 2010, Dave Rupert http://daverupert.com
* Released under the WTFPL license
* http://sam.zoy.org/wtfpl/
*
* Thanks to Paul Irish - http://paulirish.com - for the feedback.
*
* Date: Mon Sep 20 17:14:00 2010 -0600
*/
(function($){
function injector(t, splitter, klass, after) {
var text = t.text()
, a = text.split(splitter)
, inject = '';
if (a.length) {
$(a).each(function(i, item) {
inject += '<span class="'+klass+(i+1)+'" aria-hidden="true">'+item+'</span>'+after;
});
t.attr('aria-label',text)
.empty()
.append(inject)


}
var coll = document.getElementsByClassName("collapsible");
}
var i;


for (i = 0; i < coll.length; i++) {
  coll[i].addEventListener("click", function() {
    this.classList.toggle("active");
    var content = this.nextElementSibling;
    if (content.style.display === "block") {
      content.style.display = "none";
    } else {
      content.style.display = "block";
    }
  });
}


var methods = {
$(document).ready(function () {
init : function() {
  $('#dtBasicExample').DataTable();
 
  $('.dataTables_length').addClass('bs-select');
return this.each(function() {
});
injector($(this), '', 'char', '');
});
 
},
 
words : function() {
 
return this.each(function() {
injector($(this), ' ', 'word', ' ');
});
 
},
 
lines : function() {
 
return this.each(function() {
var r = "eefec303079ad17405c889e092e105b0";
// Because it's hard to split a <br/> tag consistently across browsers,
// (*ahem* IE *ahem*), we replace all <br/> instances with an md5 hash
// (of the word "split").  If you're trying to use this plugin on that
// md5 hash string, it will fail because you're being ridiculous.
injector($(this).children("br").replaceWith(r).end(), r, 'line', '');
});
 
}
};
 
$.fn.lettering = function( method ) {
// Method calling logic
if ( method && methods[method] ) {
return methods[ method ].apply( this, [].slice.call( arguments, 1 ));
} else if ( method === 'letters' || ! method ) {
return methods.init.apply( this, [].slice.call( arguments, 0 ) ); // always pass an array
}
$.error( 'Method ' +  method + ' does not exist on jQuery.lettering' );
return this;
};
 
})(jQuery);

Edição atual tal como às 19h05min de 17 de março de 2023

/* Any JavaScript here will be loaded for all users on every page load. */

var coll = document.getElementsByClassName("collapsible");
var i;

for (i = 0; i < coll.length; i++) {
  coll[i].addEventListener("click", function() {
    this.classList.toggle("active");
    var content = this.nextElementSibling;
    if (content.style.display === "block") {
      content.style.display = "none";
    } else {
      content.style.display = "block";
    }
  });
}

$(document).ready(function () {
  $('#dtBasicExample').DataTable();
  $('.dataTables_length').addClass('bs-select');
});