CoreFiles by mySites.guru
caption-uncompressed.js49 lines, 1,342 bytes, from Joomla_3.9.21-Stable-Full_Package.zip
Raw History Compare with 3.9.20
md5
7b19751bc9ed2e15ba6d62f657e1da5e
sha1
22ea8f4b0c312af2c3b860f6af50329480a8bcdd
sha256
1e49263e672a209450abe8e95564fb3d051344f51eb67b8e8bdf7c76ee2f15ff
/**
 * @copyright   Copyright (C) 2005 - 2020 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

/**
 * JCaption javascript behavior
 *
 * Used for displaying image captions
 *
 * @package     Joomla
 * @since       1.5
 * @version  1.0
 */
var JCaption = function(_selector) {
    var $, selector,
    
    initialize = function(_selector) {
        $ = jQuery.noConflict();
        selector = _selector;
        $(selector).each(function(index, el) {
            createCaption(el);
        })
    },
    
    createCaption = function(element) {
        var $el = $(element), 
        caption = $el.attr('title'),
        width = $el.attr("width") || element.width,
        align = $el.attr("align") || $el.css("float") || element.style.styleFloat || "none",
        $p = $('<p/>', {
            "text" : caption,
            "class" : selector.replace('.', '_')
        }),
        $container = $('<div/>', {
            "class" : selector.replace('.', '_') + " " + align,
            "css" : {
                "float" : align,
                "width" : width
            }
        });
        $el.before($container);
        $container.append($el);
        if (caption !== "") {
            $container.append($p);
        }
    }
    initialize(_selector);
}

The same content is in 30 releases, Joomla 3.9.15-rc to 3.10.0-alpha1. See them all, or every version of this file.