CoreFiles by mySites.guru
widget.js50 lines, 1,973 bytes, from Joomla_5.1.0-beta1-Beta-Full_Package.zip
Raw History Compare with 5.0.0-beta3
md5
a0004f36d7a20f0d9af052acb15eeb0c
sha1
f82c2a6a5108e855e2573979ac4aac2d35afe926
sha256
5936652defb8397a1f95450be86dc94ff4e559d273ff3cbdcaf7c55d257410e1
(function($) {

    var csscls = PhpDebugBar.utils.makecsscls('phpdebugbar-widgets-');

    /**
     * Widget for the displaying mails data
     *
     * Options:
     *  - data
     */
    var MailsWidget = PhpDebugBar.Widgets.MailsWidget = PhpDebugBar.Widget.extend({

        className: csscls('mails'),

        render: function() {
            this.$list = new  PhpDebugBar.Widgets.ListWidget({ itemRenderer: function(li, mail) {
                $('<span />').addClass(csscls('subject')).text(mail.subject).appendTo(li);
                $('<span />').addClass(csscls('to')).text(mail.to).appendTo(li);
                if (mail.body) {
                    li.click(function() {
                        var popup = window.open('about:blank', 'Mail Preview', 'width=650,height=440,scrollbars=yes');
                        var documentToWriteTo = popup.document;
                        var headers = !mail.headers ? '' : $('<pre style="border: 1px solid #ddd; padding: 5px;" />')
                            .append($('<code />').text(mail.headers)).prop('outerHTML');
                        documentToWriteTo.open();
                        documentToWriteTo.write(headers + mail.body);
                        documentToWriteTo.close();
                    });
                } else if (mail.headers) {
                    var headers = $('<pre />').addClass(csscls('headers')).appendTo(li);
                    $('<code />').text(mail.headers).appendTo(headers);
                    li.click(function() {
                        if (headers.is(':visible')) {
                            headers.hide();
                        } else {
                            headers.show();
                        }
                    });
                }
            }});
            this.$list.$el.appendTo(this.$el);

            this.bindAttr('data', function(data) {
                this.$list.set('data', data);
            });
        }

    });

})(PhpDebugBar.$);

No other release has this exact content. See every version of this file.