<commit_before>
Vps.onContentReady(function() {
    var lightbox = new Vpc.Basic.ImageEnlarge();
    var els = document.getElementsByTagName('a');
    for (var i=0; i<els.length; i++) {
        if (els[i].rel.match(/enlarge_[0-9]+_[0-9]+/)) {
            Ext.EventManager.addListener(els[i], 'click', function(e) {
                lightbox.show(Ext.get(this), e);
                e.stopEvent();
            }, els[i], { stopEvent: true });
        }
    }
});


Ext.namespace("Vpc.Basic");

Vpc.Basic.ImageEnlarge = function()
{
    this.lightbox = Ext.get(
        Ext.DomHelper.append(Ext.getBody(),
            { tag: 'div', cls: 'lightbox webLightbox webStandard' }
        )
    );
};

Vpc.Basic.ImageEnlarge.tpl = new Ext.XTemplate(
    '<div class="lightboxHeader">{header}</div>',
    '<div class="lightboxBody">{body}</div',
    '<div Class="clear"></div>',
    '<div class="lightboxFooter">{footer}</div'
);

Vpc.Basic.ImageEnlarge.tplHeader = new Ext.XTemplate(
    '<a class="closeButton" href="#">',
        ''+trlVps('close')+' X',
    '</a>',
    '{fullSizeLink}'
);

Vpc.Basic.ImageEnlarge.tplBody = new Ext.XTemplate(
    '<img src="{values.image.src}" width="{values.image.width}" height="{values.image.height}" class="centerImage" />',
    '{nextImageBig}',
    '{previousImageBig}'
);
Vpc.Basic.ImageEnlarge.tplFooter = new Ext.XTemplate(
    '<div class="prevBtn">{previousImageButton}</div>',
    '<div class="title"><p class="title">{title}</p></div>',
    '<div class="nextBtn">{nextImageButton}</div>'
);

Vpc.Basic.ImageEnlarge.tplSwitchBig = new Ext.XTemplate(
    '<div class="switchBig {type}SwitchBig">',
        '<div class="lightboxContent">',
            '<p><tpl if="type==\'previous\'">« </tpl>{text}<tpl if="type==\'next\'"> »</tpl></p>',
            '<img width="185px" src="{src}" />',
        '</div>',
    '</div>'
);

Vpc.Basic.ImageEnlarge.tplSwitchButton = new Ext.XTemplate(
    '<a class="switchButton {type}SwitchButton" href="#">',
        '<tpl if="type==\'previous\'">« </tpl>{text}<tpl if="type==\'next\'"> »</tpl>',
    '</a>'
);

Vpc.Basic.ImageEnlarge.prototype =
{

    hide: function(e)
    {
        if (e) e.stopEvent();
        this.lightbox.applyStyles('display: none;');
        this.unmask();
    },

    show: function(linkEl)
    {
        this.mask();

        this.lightbox.applyStyles('display: block;');
        this.lightbox.center();

        var m = linkEl.dom.rel.match(/enlarge_([0-9]+)_([0-9]+)/);

        var data = {};

        data.title = linkEl.dom.title ? linkEl.dom.title : false;

        linkEl.query('> .vpsEnlargeTagData').each(function(i) {
            var name = i.className.replace('vpsEnlargeTagData', '').trim();
            data[name] = i.innerHTML;
        }, this);
        var dataEl = linkEl.prev('.vpsEnlargeTagData');
        if (dataEl) {
            dataEl.query('> *').each(function(i) {
                if (i.className) {
                    var name = i.className.trim();
                    data[name] = i.innerHTML;
                }
            }, this);
        }

        var options = linkEl.down(".options", true);
        if (options && options.value) {
            options = Ext.decode(options.value);
        } else {
            options = {};
        }
        if (options.title && !data.title) {
        	data.title = options.title;
        }
        if (options.fullSizeUrl) {
            data.fullSizeLink = '<a href="'+options.fullSizeUrl+'" class="fullSizeLink" title="'+trlVps('image in originalsize')+'" target="_blank"></a> ';
        } else {
            data.fullSizeLink = '';
        }
        data.image = {
            src: linkEl.dom.href,
            width: parseInt(m[1]),
            height: parseInt(m[2])
        };
        if (linkEl.nextImage) {
            data.nextImage = {
                src: linkEl.nextImage.child('img').dom.src,
                title: linkEl.nextImage.dom.title,
                type: 'next',
                text: trlVps('next')
            };
        }
        if (linkEl.previousImage) {
            data.previousImage = {
                src: linkEl.previousImage.child('img').dom.src,<commit_msg>Image EnlargeTag-Javascript: wenn kein Bildtitle wurde 'false' als Titel angezeigt<commit_after>
Vps.onContentReady(function() {
    var lightbox = new Vpc.Basic.ImageEnlarge();
    var els = document.getElementsByTagName('a');
    for (var i=0; i<els.length; i++) {
        if (els[i].rel.match(/enlarge_[0-9]+_[0-9]+/)) {
            Ext.EventManager.addListener(els[i], 'click', function(e) {
                lightbox.show(Ext.get(this), e);
                e.stopEvent();
            }, els[i], { stopEvent: true });
        }
    }
});


Ext.namespace("Vpc.Basic");

Vpc.Basic.ImageEnlarge = function()
{
    this.lightbox = Ext.get(
        Ext.DomHelper.append(Ext.getBody(),
            { tag: 'div', cls: 'lightbox webLightbox webStandard' }
        )
    );
};

Vpc.Basic.ImageEnlarge.tpl = new Ext.XTemplate(
    '<div class="lightboxHeader">{header}</div>',
    '<div class="lightboxBody">{body}</div',
    '<div Class="clear"></div>',
    '<div class="lightboxFooter">{footer}</div'
);

Vpc.Basic.ImageEnlarge.tplHeader = new Ext.XTemplate(
    '<a class="closeButton" href="#">',
        ''+trlVps('close')+' X',
    '</a>',
    '{fullSizeLink}'
);

Vpc.Basic.ImageEnlarge.tplBody = new Ext.XTemplate(
    '<img src="{values.image.src}" width="{values.image.width}" height="{values.image.height}" class="centerImage" />',
    '{nextImageBig}',
    '{previousImageBig}'
);
Vpc.Basic.ImageEnlarge.tplFooter = new Ext.XTemplate(
    '<div class="prevBtn">{previousImageButton}</div>',
    '<div class="title"><p class="title">{title}</p></div>',
    '<div class="nextBtn">{nextImageButton}</div>'
);

Vpc.Basic.ImageEnlarge.tplSwitchBig = new Ext.XTemplate(
    '<div class="switchBig {type}SwitchBig">',
        '<div class="lightboxContent">',
            '<p><tpl if="type==\'previous\'">« </tpl>{text}<tpl if="type==\'next\'"> »</tpl></p>',
            '<img width="185px" src="{src}" />',
        '</div>',
    '</div>'
);

Vpc.Basic.ImageEnlarge.tplSwitchButton = new Ext.XTemplate(
    '<a class="switchButton {type}SwitchButton" href="#">',
        '<tpl if="type==\'previous\'">« </tpl>{text}<tpl if="type==\'next\'"> »</tpl>',
    '</a>'
);

Vpc.Basic.ImageEnlarge.prototype =
{

    hide: function(e)
    {
        if (e) e.stopEvent();
        this.lightbox.applyStyles('display: none;');
        this.unmask();
    },

    show: function(linkEl)
    {
        this.mask();

        this.lightbox.applyStyles('display: block;');
        this.lightbox.center();

        var m = linkEl.dom.rel.match(/enlarge_([0-9]+)_([0-9]+)/);

        var data = {};

        data.title = linkEl.dom.title ? linkEl.dom.title : false;

        linkEl.query('> .vpsEnlargeTagData').each(function(i) {
            var name = i.className.replace('vpsEnlargeTagData', '').trim();
            data[name] = i.innerHTML;
        }, this);
        var dataEl = linkEl.prev('.vpsEnlargeTagData');
        if (dataEl) {
            dataEl.query('> *').each(function(i) {
                if (i.className) {
                    var name = i.className.trim();
                    data[name] = i.innerHTML;
                }
            }, this);
        }

        var options = linkEl.down(".options", true);
        if (options && options.value) {
            options = Ext.decode(options.value);
        } else {
            options = {};
        }
        if (options.title && !data.title) {
        	data.title = options.title;
        }
        if (data.title == '') data.title = ' ';
        if (options.fullSizeUrl) {
            data.fullSizeLink = '<a href="'+options.fullSizeUrl+'" class="fullSizeLink" title="'+trlVps('image in originalsize')+'" target="_blank"></a> ';
        } else {
            data.fullSizeLink = '';
        }
        data.image = {
            src: linkEl.dom.href,
            width: parseInt(m[1]),
            height: parseInt(m[2])
        };
        if (linkEl.nextImage) {
            data.nextImage = {
                src: linkEl.nextImage.child('img').dom.src,
                title: linkEl.nextImage.dom.title,
                type: 'next',
                text: trlVps('next')
            };
        }
        if (linkEl.previousImage) {
            data.previousImage = {
                src: linkEl.previousImage.child('img').dom.src,
{'fraction_non_alphanumeric': 0.19172887782912668, 'fraction_numerical': 0.0033179286645337127, 'mean_word_length': 2.2399232245681384, 'pattern_counts': {'":': 0, '<': 81, '<?xml version=': 0, '>': 79, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4546372', 'n_tokens_mistral': 2741, 'n_tokens_neox': 2788, 'n_words': 435}