﻿<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="es">
		<id>https://www.va-de-retro.com/vadewiki/index.php?action=history&amp;feed=atom&amp;title=MediaWiki%3ACommon.js</id>
		<title>MediaWiki:Common.js - Historial de revisiones</title>
		<link rel="self" type="application/atom+xml" href="https://www.va-de-retro.com/vadewiki/index.php?action=history&amp;feed=atom&amp;title=MediaWiki%3ACommon.js"/>
		<link rel="alternate" type="text/html" href="https://www.va-de-retro.com/vadewiki/index.php?title=MediaWiki:Common.js&amp;action=history"/>
		<updated>2026-04-19T05:16:43Z</updated>
		<subtitle>Historial de revisiones para esta página en el wiki</subtitle>
		<generator>MediaWiki 1.26.2</generator>

	<entry>
		<id>https://www.va-de-retro.com/vadewiki/index.php?title=MediaWiki:Common.js&amp;diff=8985&amp;oldid=prev</id>
		<title>Tactica: Anulado el cambio, se supone que la versión actual ya incorpora esta función sin necesitar añadidos.</title>
		<link rel="alternate" type="text/html" href="https://www.va-de-retro.com/vadewiki/index.php?title=MediaWiki:Common.js&amp;diff=8985&amp;oldid=prev"/>
				<updated>2016-04-04T21:03:34Z</updated>
		
		<summary type="html">&lt;p&gt;Anulado el cambio, se supone que la versión actual ya incorpora esta función sin necesitar añadidos.&lt;/p&gt;
&lt;a href=&quot;https://www.va-de-retro.com/vadewiki/index.php?title=MediaWiki:Common.js&amp;amp;diff=8985&amp;amp;oldid=8981&quot;&gt;Mostrar los cambios&lt;/a&gt;</summary>
		<author><name>Tactica</name></author>	</entry>

	<entry>
		<id>https://www.va-de-retro.com/vadewiki/index.php?title=MediaWiki:Common.js&amp;diff=8981&amp;oldid=prev</id>
		<title>Tactica: Añadido código para usar elementos colapsables.</title>
		<link rel="alternate" type="text/html" href="https://www.va-de-retro.com/vadewiki/index.php?title=MediaWiki:Common.js&amp;diff=8981&amp;oldid=prev"/>
				<updated>2016-04-04T20:11:54Z</updated>
		
		<summary type="html">&lt;p&gt;Añadido código para usar elementos colapsables.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Página nueva&lt;/b&gt;&lt;/p&gt;&lt;div&gt;/**&lt;br /&gt;
 * jQuery makeCollapsible&lt;br /&gt;
 *&lt;br /&gt;
 * Dual licensed:&lt;br /&gt;
 * - CC BY 3.0 &amp;lt;http://creativecommons.org/licenses/by/3.0&amp;gt;&lt;br /&gt;
 * - GPL2 &amp;lt;http://www.gnu.org/licenses/old-licenses/gpl-2.0.html&amp;gt;&lt;br /&gt;
 *&lt;br /&gt;
 * @class jQuery.plugin.makeCollapsible&lt;br /&gt;
 */&lt;br /&gt;
( function ( $, mw ) {&lt;br /&gt;
&lt;br /&gt;
  /**&lt;br /&gt;
   * Handler for a click on a collapsible toggler.&lt;br /&gt;
   *&lt;br /&gt;
   * @private&lt;br /&gt;
   * @param {jQuery} $collapsible&lt;br /&gt;
   * @param {string} action The action this function will take (&amp;#039;expand&amp;#039; or &amp;#039;collapse&amp;#039;).&lt;br /&gt;
   * @param {jQuery|null} [$defaultToggle]&lt;br /&gt;
   * @param {Object|undefined} [options]&lt;br /&gt;
   */&lt;br /&gt;
  function toggleElement( $collapsible, action, $defaultToggle, options ) {&lt;br /&gt;
    var $collapsibleContent, $containers, hookCallback;&lt;br /&gt;
    options = options || {};&lt;br /&gt;
&lt;br /&gt;
    // Validate parameters&lt;br /&gt;
&lt;br /&gt;
    // $collapsible must be an instance of jQuery&lt;br /&gt;
    if ( !$collapsible.jquery ) {&lt;br /&gt;
      return;&lt;br /&gt;
    }&lt;br /&gt;
    if ( action !== &amp;#039;expand&amp;#039; &amp;amp;&amp;amp; action !== &amp;#039;collapse&amp;#039; ) {&lt;br /&gt;
      // action must be string with &amp;#039;expand&amp;#039; or &amp;#039;collapse&amp;#039;&lt;br /&gt;
      return;&lt;br /&gt;
    }&lt;br /&gt;
    if ( $defaultToggle === undefined ) {&lt;br /&gt;
      $defaultToggle = null;&lt;br /&gt;
    }&lt;br /&gt;
    if ( $defaultToggle !== null &amp;amp;&amp;amp; !$defaultToggle.jquery ) {&lt;br /&gt;
      // is optional (may be undefined), but if defined it must be an instance of jQuery.&lt;br /&gt;
      // If it&amp;#039;s not, abort right away.&lt;br /&gt;
      // After this $defaultToggle is either null or a valid jQuery instance.&lt;br /&gt;
      return;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // Trigger a custom event to allow callers to hook to the collapsing/expanding,&lt;br /&gt;
    // allowing the module to be testable, and making it possible to&lt;br /&gt;
    // e.g. implement persistence via cookies&lt;br /&gt;
    $collapsible.trigger( action === &amp;#039;expand&amp;#039; ? &amp;#039;beforeExpand.mw-collapsible&amp;#039; : &amp;#039;beforeCollapse.mw-collapsible&amp;#039; );&lt;br /&gt;
    hookCallback = function () {&lt;br /&gt;
      $collapsible.trigger( action === &amp;#039;expand&amp;#039; ? &amp;#039;afterExpand.mw-collapsible&amp;#039; : &amp;#039;afterCollapse.mw-collapsible&amp;#039; );&lt;br /&gt;
    };&lt;br /&gt;
&lt;br /&gt;
    // Handle different kinds of elements&lt;br /&gt;
&lt;br /&gt;
    if ( !options.plainMode &amp;amp;&amp;amp; $collapsible.is( &amp;#039;table&amp;#039; ) ) {&lt;br /&gt;
      // Tables&lt;br /&gt;
      // If there is a caption, hide all rows; otherwise, only hide body rows&lt;br /&gt;
      if ( $collapsible.find( &amp;#039;&amp;gt; caption&amp;#039; ).length ) {&lt;br /&gt;
        $containers = $collapsible.find( &amp;#039;&amp;gt; * &amp;gt; tr&amp;#039; );&lt;br /&gt;
      } else {&lt;br /&gt;
        $containers = $collapsible.find( &amp;#039;&amp;gt; tbody &amp;gt; tr&amp;#039; );&lt;br /&gt;
      }&lt;br /&gt;
      if ( $defaultToggle ) {&lt;br /&gt;
        // Exclude table row containing togglelink&lt;br /&gt;
        $containers = $containers.not( $defaultToggle.closest( &amp;#039;tr&amp;#039; ) );&lt;br /&gt;
      }&lt;br /&gt;
&lt;br /&gt;
      if ( action === &amp;#039;collapse&amp;#039; ) {&lt;br /&gt;
        // Hide all table rows of this table&lt;br /&gt;
        // Slide doesn&amp;#039;t work with tables, but fade does as of jQuery 1.1.3&lt;br /&gt;
        // http://stackoverflow.com/questions/467336#920480&lt;br /&gt;
        if ( options.instantHide ) {&lt;br /&gt;
          $containers.hide();&lt;br /&gt;
          hookCallback();&lt;br /&gt;
        } else {&lt;br /&gt;
          $containers.stop( true, true ).fadeOut().promise().done( hookCallback );&lt;br /&gt;
        }&lt;br /&gt;
      } else {&lt;br /&gt;
        $containers.stop( true, true ).fadeIn().promise().done( hookCallback );&lt;br /&gt;
      }&lt;br /&gt;
&lt;br /&gt;
    } else if ( !options.plainMode &amp;amp;&amp;amp; ( $collapsible.is( &amp;#039;ul&amp;#039; ) || $collapsible.is( &amp;#039;ol&amp;#039; ) ) ) {&lt;br /&gt;
      // Lists&lt;br /&gt;
      $containers = $collapsible.find( &amp;#039;&amp;gt; li&amp;#039; );&lt;br /&gt;
      if ( $defaultToggle ) {&lt;br /&gt;
        // Exclude list-item containing togglelink&lt;br /&gt;
        $containers = $containers.not( $defaultToggle.parent() );&lt;br /&gt;
      }&lt;br /&gt;
&lt;br /&gt;
      if ( action === &amp;#039;collapse&amp;#039; ) {&lt;br /&gt;
        if ( options.instantHide ) {&lt;br /&gt;
          $containers.hide();&lt;br /&gt;
          hookCallback();&lt;br /&gt;
        } else {&lt;br /&gt;
          $containers.stop( true, true ).slideUp().promise().done( hookCallback );&lt;br /&gt;
        }&lt;br /&gt;
      } else {&lt;br /&gt;
        $containers.stop( true, true ).slideDown().promise().done( hookCallback );&lt;br /&gt;
      }&lt;br /&gt;
&lt;br /&gt;
    } else {&lt;br /&gt;
      // Everything else: &amp;lt;div&amp;gt;, &amp;lt;p&amp;gt; etc.&lt;br /&gt;
      $collapsibleContent = $collapsible.find( &amp;#039;&amp;gt; .mw-collapsible-content&amp;#039; );&lt;br /&gt;
&lt;br /&gt;
      // If a collapsible-content is defined, act on it&lt;br /&gt;
      if ( !options.plainMode &amp;amp;&amp;amp; $collapsibleContent.length ) {&lt;br /&gt;
        if ( action === &amp;#039;collapse&amp;#039; ) {&lt;br /&gt;
          if ( options.instantHide ) {&lt;br /&gt;
            $collapsibleContent.hide();&lt;br /&gt;
            hookCallback();&lt;br /&gt;
          } else {&lt;br /&gt;
            $collapsibleContent.slideUp().promise().done( hookCallback );&lt;br /&gt;
          }&lt;br /&gt;
        } else {&lt;br /&gt;
          $collapsibleContent.slideDown().promise().done( hookCallback );&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
      // Otherwise assume this is a customcollapse with a remote toggle&lt;br /&gt;
      // .. and there is no collapsible-content because the entire element should be toggled&lt;br /&gt;
      } else {&lt;br /&gt;
        if ( action === &amp;#039;collapse&amp;#039; ) {&lt;br /&gt;
          if ( options.instantHide ) {&lt;br /&gt;
            $collapsible.hide();&lt;br /&gt;
            hookCallback();&lt;br /&gt;
          } else {&lt;br /&gt;
            if ( $collapsible.is( &amp;#039;tr&amp;#039; ) || $collapsible.is( &amp;#039;td&amp;#039; ) || $collapsible.is( &amp;#039;th&amp;#039; ) ) {&lt;br /&gt;
              $collapsible.fadeOut().promise().done( hookCallback );&lt;br /&gt;
            } else {&lt;br /&gt;
              $collapsible.slideUp().promise().done( hookCallback );&lt;br /&gt;
            }&lt;br /&gt;
          }&lt;br /&gt;
        } else {&lt;br /&gt;
          if ( $collapsible.is( &amp;#039;tr&amp;#039; ) || $collapsible.is( &amp;#039;td&amp;#039; ) || $collapsible.is( &amp;#039;th&amp;#039; ) ) {&lt;br /&gt;
            $collapsible.fadeIn().promise().done( hookCallback );&lt;br /&gt;
          } else {&lt;br /&gt;
            $collapsible.slideDown().promise().done( hookCallback );&lt;br /&gt;
          }&lt;br /&gt;
        }&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  /**&lt;br /&gt;
   * Handle clicking/keypressing on the collapsible element toggle and other&lt;br /&gt;
   * situations where a collapsible element is toggled (e.g. the initial&lt;br /&gt;
   * toggle for collapsed ones).&lt;br /&gt;
   *&lt;br /&gt;
   * @private&lt;br /&gt;
   * @param {jQuery} $toggle the clickable toggle itself&lt;br /&gt;
   * @param {jQuery} $collapsible the collapsible element&lt;br /&gt;
   * @param {jQuery.Event|null} e either the event or null if unavailable&lt;br /&gt;
   * @param {Object|undefined} options&lt;br /&gt;
   */&lt;br /&gt;
  function togglingHandler( $toggle, $collapsible, e, options ) {&lt;br /&gt;
    var wasCollapsed, $textContainer, collapseText, expandText;&lt;br /&gt;
&lt;br /&gt;
    if ( options === undefined ) {&lt;br /&gt;
      options = {};&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    if ( e ) {&lt;br /&gt;
      if (&lt;br /&gt;
        e.type === &amp;#039;click&amp;#039; &amp;amp;&amp;amp;&lt;br /&gt;
        options.linksPassthru &amp;amp;&amp;amp;&lt;br /&gt;
        $.nodeName( e.target, &amp;#039;a&amp;#039; ) &amp;amp;&amp;amp;&lt;br /&gt;
        $( e.target ).attr( &amp;#039;href&amp;#039; ) !== &amp;#039;#&amp;#039;&lt;br /&gt;
      ) {&lt;br /&gt;
        // Don&amp;#039;t fire if a link with href !== &amp;#039;#&amp;#039; was clicked, if requested  (for premade togglers by default)&lt;br /&gt;
        return;&lt;br /&gt;
      } else if ( e.type === &amp;#039;keypress&amp;#039; &amp;amp;&amp;amp; e.which !== 13 &amp;amp;&amp;amp; e.which !== 32 ) {&lt;br /&gt;
        // Only handle keypresses on the &amp;quot;Enter&amp;quot; or &amp;quot;Space&amp;quot; keys&lt;br /&gt;
        return;&lt;br /&gt;
      } else {&lt;br /&gt;
        e.preventDefault();&lt;br /&gt;
        e.stopPropagation();&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // This allows the element to be hidden on initial toggle without fiddling with the class&lt;br /&gt;
    if ( options.wasCollapsed !== undefined ) {&lt;br /&gt;
      wasCollapsed = options.wasCollapsed;&lt;br /&gt;
    } else {&lt;br /&gt;
      wasCollapsed = $collapsible.hasClass( &amp;#039;mw-collapsed&amp;#039; );&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // Toggle the state of the collapsible element (that is, expand or collapse)&lt;br /&gt;
    $collapsible.toggleClass( &amp;#039;mw-collapsed&amp;#039;, !wasCollapsed );&lt;br /&gt;
&lt;br /&gt;
    // Toggle the mw-collapsible-toggle classes, if requested (for default and premade togglers by default)&lt;br /&gt;
    if ( options.toggleClasses ) {&lt;br /&gt;
      $toggle&lt;br /&gt;
        .toggleClass( &amp;#039;mw-collapsible-toggle-collapsed&amp;#039;, !wasCollapsed )&lt;br /&gt;
        .toggleClass( &amp;#039;mw-collapsible-toggle-expanded&amp;#039;, wasCollapsed );&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // Toggle the text (&amp;quot;Show&amp;quot;/&amp;quot;Hide&amp;quot;), if requested (for default togglers by default)&lt;br /&gt;
    if ( options.toggleText ) {&lt;br /&gt;
      collapseText = options.toggleText.collapseText;&lt;br /&gt;
      expandText = options.toggleText.expandText;&lt;br /&gt;
&lt;br /&gt;
      $textContainer = $toggle.find( &amp;#039;&amp;gt; a&amp;#039; );&lt;br /&gt;
      if ( !$textContainer.length ) {&lt;br /&gt;
        $textContainer = $toggle;&lt;br /&gt;
      }&lt;br /&gt;
      $textContainer.text( wasCollapsed ? collapseText : expandText );&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // And finally toggle the element state itself&lt;br /&gt;
    toggleElement( $collapsible, wasCollapsed ? &amp;#039;expand&amp;#039; : &amp;#039;collapse&amp;#039;, $toggle, options );&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  /**&lt;br /&gt;
   * Enable collapsible-functionality on all elements in the collection.&lt;br /&gt;
   *&lt;br /&gt;
   * - Will prevent binding twice to the same element.&lt;br /&gt;
   * - Initial state is expanded by default, this can be overridden by adding class&lt;br /&gt;
   *   &amp;quot;mw-collapsed&amp;quot; to the &amp;quot;mw-collapsible&amp;quot; element.&lt;br /&gt;
   * - Elements made collapsible have jQuery data &amp;quot;mw-made-collapsible&amp;quot; set to true.&lt;br /&gt;
   * - The inner content is wrapped in a &amp;quot;div.mw-collapsible-content&amp;quot; (except for tables and lists).&lt;br /&gt;
   *&lt;br /&gt;
   * @param {Object} [options]&lt;br /&gt;
   * @param {string} [options.collapseText] Text used for the toggler, when clicking it would&lt;br /&gt;
   *   collapse the element. Default: the &amp;#039;data-collapsetext&amp;#039; attribute of the&lt;br /&gt;
   *   collapsible element or the content of &amp;#039;collapsible-collapse&amp;#039; message.&lt;br /&gt;
   * @param {string} [options.expandText] Text used for the toggler, when clicking it would&lt;br /&gt;
   *   expand the element. Default: the &amp;#039;data-expandtext&amp;#039; attribute of the&lt;br /&gt;
   *   collapsible element or the content of &amp;#039;collapsible-expand&amp;#039; message.&lt;br /&gt;
   * @param {boolean} [options.collapsed] Whether to collapse immediately. By default&lt;br /&gt;
   *   collapse only if the elements has the &amp;#039;mw-collapsible&amp;#039; class.&lt;br /&gt;
   * @param {jQuery} [options.$customTogglers] Elements to be used as togglers&lt;br /&gt;
   *   for this collapsible element. By default, if the collapsible element&lt;br /&gt;
   *   has an id attribute like &amp;#039;mw-customcollapsible-XXX&amp;#039;, elements with a&lt;br /&gt;
   *   *class* of &amp;#039;mw-customtoggle-XXX&amp;#039; are made togglers for it.&lt;br /&gt;
   * @param {boolean} [options.plainMode=false] Whether to use a &amp;quot;plain mode&amp;quot; when making the&lt;br /&gt;
   *   element collapsible - that is, hide entire tables and lists (instead&lt;br /&gt;
   *   of hiding only all rows but first of tables, and hiding each list&lt;br /&gt;
   *   item separately for lists) and don&amp;#039;t wrap other elements in&lt;br /&gt;
   *   div.mw-collapsible-content. May only be used with custom togglers.&lt;br /&gt;
   * @return {jQuery}&lt;br /&gt;
   * @chainable&lt;br /&gt;
   */&lt;br /&gt;
  $.fn.makeCollapsible = function ( options ) {&lt;br /&gt;
    if ( options === undefined ) {&lt;br /&gt;
      options = {};&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    return this.each( function () {&lt;br /&gt;
      var $collapsible, collapseText, expandText, $caption, $toggle, actionHandler, buildDefaultToggleLink,&lt;br /&gt;
        premadeToggleHandler, $toggleLink, $firstItem, collapsibleId, $customTogglers, firstval;&lt;br /&gt;
&lt;br /&gt;
      // Ensure class &amp;quot;mw-collapsible&amp;quot; is present in case .makeCollapsible()&lt;br /&gt;
      // is called on element(s) that don&amp;#039;t have it yet.&lt;br /&gt;
      $collapsible = $( this ).addClass( &amp;#039;mw-collapsible&amp;#039; );&lt;br /&gt;
&lt;br /&gt;
      // Return if it has been enabled already.&lt;br /&gt;
      if ( $collapsible.data( &amp;#039;mw-made-collapsible&amp;#039; ) ) {&lt;br /&gt;
        return;&lt;br /&gt;
      } else {&lt;br /&gt;
        $collapsible.data( &amp;#039;mw-made-collapsible&amp;#039;, true );&lt;br /&gt;
      }&lt;br /&gt;
&lt;br /&gt;
      // Use custom text or default?&lt;br /&gt;
      collapseText = options.collapseText || $collapsible.attr( &amp;#039;data-collapsetext&amp;#039; ) || mw.msg( &amp;#039;collapsible-collapse&amp;#039; );&lt;br /&gt;
      expandText = options.expandText || $collapsible.attr( &amp;#039;data-expandtext&amp;#039; ) || mw.msg( &amp;#039;collapsible-expand&amp;#039; );&lt;br /&gt;
&lt;br /&gt;
      // Default click/keypress handler and toggle link to use when none is present&lt;br /&gt;
      actionHandler = function ( e, opts ) {&lt;br /&gt;
        var defaultOpts = {&lt;br /&gt;
          toggleClasses: true,&lt;br /&gt;
          toggleText: { collapseText: collapseText, expandText: expandText }&lt;br /&gt;
        };&lt;br /&gt;
        opts = $.extend( defaultOpts, options, opts );&lt;br /&gt;
        togglingHandler( $( this ), $collapsible, e, opts );&lt;br /&gt;
      };&lt;br /&gt;
      // Default toggle link. Only build it when needed to avoid jQuery memory leaks (event data).&lt;br /&gt;
      buildDefaultToggleLink = function () {&lt;br /&gt;
        return $( &amp;#039;&amp;lt;a href=&amp;quot;#&amp;quot;&amp;gt;&amp;lt;/a&amp;gt;&amp;#039; )&lt;br /&gt;
          .text( collapseText )&lt;br /&gt;
          .wrap( &amp;#039;&amp;lt;span class=&amp;quot;mw-collapsible-toggle&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;#039; )&lt;br /&gt;
            .parent()&lt;br /&gt;
            .prepend( &amp;#039;&amp;lt;span class=&amp;quot;mw-collapsible-bracket&amp;quot;&amp;gt;[&amp;lt;/span&amp;gt;&amp;#039; )&lt;br /&gt;
            .append( &amp;#039;&amp;lt;span class=&amp;quot;mw-collapsible-bracket&amp;quot;&amp;gt;]&amp;lt;/span&amp;gt;&amp;#039; )&lt;br /&gt;
            .on( &amp;#039;click.mw-collapsible keypress.mw-collapsible&amp;#039;, actionHandler );&lt;br /&gt;
      };&lt;br /&gt;
&lt;br /&gt;
      // Default handler for clicking on premade toggles&lt;br /&gt;
      premadeToggleHandler = function ( e, opts ) {&lt;br /&gt;
        var defaultOpts = { toggleClasses: true, linksPassthru: true };&lt;br /&gt;
        opts = $.extend( defaultOpts, options, opts );&lt;br /&gt;
        togglingHandler( $( this ), $collapsible, e, opts );&lt;br /&gt;
      };&lt;br /&gt;
&lt;br /&gt;
      // Check if this element has a custom position for the toggle link&lt;br /&gt;
      // (ie. outside the container or deeper inside the tree)&lt;br /&gt;
      if ( options.$customTogglers ) {&lt;br /&gt;
        $customTogglers = $( options.$customTogglers );&lt;br /&gt;
      } else {&lt;br /&gt;
        collapsibleId = $collapsible.attr( &amp;#039;id&amp;#039; ) || &amp;#039;&amp;#039;;&lt;br /&gt;
        if ( collapsibleId.indexOf( &amp;#039;mw-customcollapsible-&amp;#039; ) === 0 ) {&lt;br /&gt;
          $customTogglers = $( &amp;#039;.&amp;#039; + collapsibleId.replace( &amp;#039;mw-customcollapsible&amp;#039;, &amp;#039;mw-customtoggle&amp;#039; ) )&lt;br /&gt;
            .addClass( &amp;#039;mw-customtoggle&amp;#039; );&lt;br /&gt;
        }&lt;br /&gt;
      }&lt;br /&gt;
&lt;br /&gt;
      // Add event handlers to custom togglers or create our own ones&lt;br /&gt;
      if ( $customTogglers &amp;amp;&amp;amp; $customTogglers.length ) {&lt;br /&gt;
        actionHandler = function ( e, opts ) {&lt;br /&gt;
          var defaultOpts = {};&lt;br /&gt;
          opts = $.extend( defaultOpts, options, opts );&lt;br /&gt;
          togglingHandler( $( this ), $collapsible, e, opts );&lt;br /&gt;
        };&lt;br /&gt;
&lt;br /&gt;
        $toggleLink = $customTogglers&lt;br /&gt;
          .on( &amp;#039;click.mw-collapsible keypress.mw-collapsible&amp;#039;, actionHandler )&lt;br /&gt;
          .prop( &amp;#039;tabIndex&amp;#039;, 0 );&lt;br /&gt;
&lt;br /&gt;
      } else {&lt;br /&gt;
        // If this is not a custom case, do the default: wrap the&lt;br /&gt;
        // contents and add the toggle link. Different elements are&lt;br /&gt;
        // treated differently.&lt;br /&gt;
        if ( $collapsible.is( &amp;#039;table&amp;#039; ) ) {&lt;br /&gt;
&lt;br /&gt;
          // If the table has a caption, collapse to the caption&lt;br /&gt;
          // as opposed to the first row&lt;br /&gt;
          $caption = $collapsible.find( &amp;#039;&amp;gt; caption&amp;#039; );&lt;br /&gt;
          if ( $caption.length ) {&lt;br /&gt;
            $toggle = $caption.find( &amp;#039;&amp;gt; .mw-collapsible-toggle&amp;#039; );&lt;br /&gt;
&lt;br /&gt;
            // If there is no toggle link, add it to the end of the caption&lt;br /&gt;
            if ( !$toggle.length ) {&lt;br /&gt;
              $toggleLink = buildDefaultToggleLink().appendTo( $caption );&lt;br /&gt;
            } else {&lt;br /&gt;
              actionHandler = premadeToggleHandler;&lt;br /&gt;
              $toggleLink = $toggle.on( &amp;#039;click.mw-collapsible keypress.mw-collapsible&amp;#039;, actionHandler )&lt;br /&gt;
                .prop( &amp;#039;tabIndex&amp;#039;, 0 );&lt;br /&gt;
            }&lt;br /&gt;
          } else {&lt;br /&gt;
            // The toggle-link will be in one of the cells (td or th) of the first row&lt;br /&gt;
            $firstItem = $collapsible.find( &amp;#039;tr:first th, tr:first td&amp;#039; );&lt;br /&gt;
            $toggle = $firstItem.find( &amp;#039;&amp;gt; .mw-collapsible-toggle&amp;#039; );&lt;br /&gt;
&lt;br /&gt;
            // If theres no toggle link, add it to the last cell&lt;br /&gt;
            if ( !$toggle.length ) {&lt;br /&gt;
              $toggleLink = buildDefaultToggleLink().prependTo( $firstItem.eq( -1 ) );&lt;br /&gt;
            } else {&lt;br /&gt;
              actionHandler = premadeToggleHandler;&lt;br /&gt;
              $toggleLink = $toggle.on( &amp;#039;click.mw-collapsible keypress.mw-collapsible&amp;#039;, actionHandler )&lt;br /&gt;
                .prop( &amp;#039;tabIndex&amp;#039;, 0 );&lt;br /&gt;
            }&lt;br /&gt;
          }&lt;br /&gt;
&lt;br /&gt;
        } else if ( $collapsible.is( &amp;#039;ul&amp;#039; ) || $collapsible.is( &amp;#039;ol&amp;#039; ) ) {&lt;br /&gt;
          // The toggle-link will be in the first list-item&lt;br /&gt;
          $firstItem = $collapsible.find( &amp;#039;li:first&amp;#039; );&lt;br /&gt;
          $toggle = $firstItem.find( &amp;#039;&amp;gt; .mw-collapsible-toggle&amp;#039; );&lt;br /&gt;
&lt;br /&gt;
          // If theres no toggle link, add it&lt;br /&gt;
          if ( !$toggle.length ) {&lt;br /&gt;
            // Make sure the numeral order doesn&amp;#039;t get messed up, force the first (soon to be second) item&lt;br /&gt;
            // to be &amp;quot;1&amp;quot;. Except if the value-attribute is already used.&lt;br /&gt;
            // If no value was set WebKit returns &amp;quot;&amp;quot;, Mozilla returns &amp;#039;-1&amp;#039;, others return 0, null or undefined.&lt;br /&gt;
            firstval = $firstItem.prop( &amp;#039;value&amp;#039; );&lt;br /&gt;
            if ( firstval === undefined || !firstval || firstval === &amp;#039;-1&amp;#039; || firstval === -1 ) {&lt;br /&gt;
              $firstItem.prop( &amp;#039;value&amp;#039;, &amp;#039;1&amp;#039; );&lt;br /&gt;
            }&lt;br /&gt;
            $toggleLink = buildDefaultToggleLink();&lt;br /&gt;
            $toggleLink.wrap( &amp;#039;&amp;lt;li class=&amp;quot;mw-collapsible-toggle-li&amp;quot;&amp;gt;&amp;lt;/li&amp;gt;&amp;#039; ).parent().prependTo( $collapsible );&lt;br /&gt;
          } else {&lt;br /&gt;
            actionHandler = premadeToggleHandler;&lt;br /&gt;
            $toggleLink = $toggle.on( &amp;#039;click.mw-collapsible keypress.mw-collapsible&amp;#039;, actionHandler )&lt;br /&gt;
              .prop( &amp;#039;tabIndex&amp;#039;, 0 );&lt;br /&gt;
          }&lt;br /&gt;
&lt;br /&gt;
        } else { // &amp;lt;div&amp;gt;, &amp;lt;p&amp;gt; etc.&lt;br /&gt;
&lt;br /&gt;
          // The toggle-link will be the first child of the element&lt;br /&gt;
          $toggle = $collapsible.find( &amp;#039;&amp;gt; .mw-collapsible-toggle&amp;#039; );&lt;br /&gt;
&lt;br /&gt;
          // If a direct child .content-wrapper does not exists, create it&lt;br /&gt;
          if ( !$collapsible.find( &amp;#039;&amp;gt; .mw-collapsible-content&amp;#039; ).length ) {&lt;br /&gt;
            $collapsible.wrapInner( &amp;#039;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&amp;#039; );&lt;br /&gt;
          }&lt;br /&gt;
&lt;br /&gt;
          // If theres no toggle link, add it&lt;br /&gt;
          if ( !$toggle.length ) {&lt;br /&gt;
            $toggleLink = buildDefaultToggleLink().prependTo( $collapsible );&lt;br /&gt;
          } else {&lt;br /&gt;
            actionHandler = premadeToggleHandler;&lt;br /&gt;
            $toggleLink = $toggle.on( &amp;#039;click.mw-collapsible keypress.mw-collapsible&amp;#039;, actionHandler )&lt;br /&gt;
              .prop( &amp;#039;tabIndex&amp;#039;, 0 );&lt;br /&gt;
          }&lt;br /&gt;
        }&lt;br /&gt;
      }&lt;br /&gt;
&lt;br /&gt;
      // Initial state&lt;br /&gt;
      if ( options.collapsed || $collapsible.hasClass( &amp;#039;mw-collapsed&amp;#039; ) ) {&lt;br /&gt;
        // One toggler can hook to multiple elements, and one element can have&lt;br /&gt;
        // multiple togglers. This is the sanest way to handle that.&lt;br /&gt;
        actionHandler.call( $toggleLink.get( 0 ), null, { instantHide: true, wasCollapsed: false } );&lt;br /&gt;
      }&lt;br /&gt;
    } );&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
  /**&lt;br /&gt;
   * @class jQuery&lt;br /&gt;
   * @mixins jQuery.plugin.makeCollapsible&lt;br /&gt;
   */&lt;br /&gt;
&lt;br /&gt;
}( jQuery, mediaWiki ) );&lt;/div&gt;</summary>
		<author><name>Tactica</name></author>	</entry>

	</feed>