')
.css({'float':e.css('float')});
e.wrap(caption).parent()
.append($('
')
.append($('
')
.attr('download', info.filename)
.attr('title', __('Download'))
.tooltip()
)
);
e.data('wrapped', true);
}
});
},
prepImages: function() {
// TODO: Check config options
this.externalImages();
this.inlineImages();
},
onLoad: function (container, options) {
// See if thread container is valid
$container = $('#'+container);
if (!$container || !$container.length)
return;
// set options
this.options.container = $container;
$.extend(this.options, options);
// Prep images
this.prepImages();
// Auto scroll to the last entry if autoScroll is enabled.
if (this.options.autoScroll === true) {
// Find the last entry to scroll to.
var e = $('.thread-entry', $container).filter(':visible').last();
if (e.length)
this.scrollTo(e);
}
// Open thread body links in a new tab/window
// unless referring to thread entry on current page
$('div.thread-body a', $container).each(function() {
var str = this.toString();
if (str.indexOf('#entry-') == -1)
$(this).attr('target', '_blank');
});
// Open first response option tab if not already active
if (!document.location.hash)
$('.actions .tabs li:visible:first:not(.active) a', $container.parent()).trigger('click');
}
};
// Set thread as JQuery object
$.thread = thread;