<div class="jsOnly formAttachmentContent messageTabMenuContent" id="attachments_{if $wysiwygSelector|isset}{$wysiwygSelector}{else}text{/if}">
- <ul class="formAttachmentList clearfix"{if !$attachmentHandler->getAttachmentList()|count} style="display: none"{/if}>
+ <ul class="formAttachmentList clearfix"{if !$attachmentHandler->getAttachmentList()|count} style="display: none"{/if} data-enable-thumbnails="{if ATTACHMENT_ENABLE_THUMBNAILS}true{else}false{/if}">
{foreach from=$attachmentHandler->getAttachmentList() item=$attachment}
<li class="box64" data-object-id="{@$attachment->attachmentID}" data-height="{@$attachment->height}" data-width="{@$attachment->width}" data-is-image="{@$attachment->isImage}">
{if $attachment->tinyThumbnailType}
return $li;
},
+ /**
+ * Returns true if thumbnails are enabled and should be
+ * used instead of the original images.
+ *
+ * @return {boolean}
+ * @protected
+ */
+ _useThumbnail: function() {
+ return elDataBool(this._fileListSelector[0], 'enable-thumbnails');
+ },
+
/**
* @see WCF.Upload._success()
*/
$li.data('objectID', attachmentData.attachmentID);
if (this._editorId) {
- if (attachmentData.tinyURL) {
+ if (attachmentData.tinyURL || (!this._useThumbnail() && attachmentData.isImage)) {
if (attachmentData.thumbnailURL) {
var $insertThumbnail = $('<li><span class="button small jsButtonAttachmentInsertThumbnail" data-object-id="' + attachmentData.attachmentID + '" data-url="' + WCF.String.escapeHTML(attachmentData.thumbnailURL) + '">' + WCF.Language.get('wcf.attachment.insertThumbnail') + '</span></li>').appendTo($buttonList);
$insertThumbnail.children('span.button').click($.proxy(this._insert, this));
* Inserts all attachments at once.
*/
_insertAll: function() {
- this._fileListSelector.children('li:not(.uploadFailed)').find('.jsButtonAttachmentInsertThumbnail, .jsButtonAttachmentInsertPlain').trigger('click');
+ var selector = (this._useThumbnail()) ? '.jsButtonAttachmentInsertThumbnail, .jsButtonAttachmentInsertPlain' : '.jsButtonAttachmentInsertFull, .jsButtonAttachmentInsertPlain';
+ this._fileListSelector.children('li:not(.uploadFailed)').find(selector).trigger('click');
},
/**
*/
public function showAsImage() {
if ($this->isImage) {
- if (!$this->hasThumbnail() && ($this->width > ATTACHMENT_THUMBNAIL_WIDTH || $this->height > ATTACHMENT_THUMBNAIL_HEIGHT)) return false;
+ if (ATTACHMENT_ENABLE_THUMBNAILS && !$this->hasThumbnail() && ($this->width > ATTACHMENT_THUMBNAIL_WIDTH || $this->height > ATTACHMENT_THUMBNAIL_HEIGHT)) return false;
if ($this->canDownload()) return true;