Do not offer 'insert thumbnail' for small images
authorAlexander Ebert <ebert@woltlab.com>
Wed, 31 Aug 2016 09:21:50 +0000 (11:21 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Wed, 31 Aug 2016 09:21:56 +0000 (11:21 +0200)
com.woltlab.wcf/templates/messageFormAttachments.tpl
wcfsetup/install/files/js/WCF.Attachment.js

index 071e936cc176d1e5e2a198a407520ae8f4c4e4ec..7fa1737662f3a8247498aaf86e9898063749cd66 100644 (file)
@@ -17,7 +17,7 @@
                                        <ul class="buttonGroup">
                                                <li><span class="button small jsDeleteButton" data-object-id="{@$attachment->attachmentID}" data-confirm-message="{lang}wcf.attachment.delete.sure{/lang}">{lang}wcf.global.button.delete{/lang}</span></li>
                                                {if $attachment->isImage}
-                                                       <li><span class="button small jsButtonAttachmentInsertThumbnail" data-object-id="{@$attachment->attachmentID}" data-url="{link controller='Attachment' object=$attachment}thumbnail=1{/link}">{lang}wcf.attachment.insertThumbnail{/lang}</span></li>
+                                                       {if $attachment->thumbnailType}<li><span class="button small jsButtonAttachmentInsertThumbnail" data-object-id="{@$attachment->attachmentID}" data-url="{link controller='Attachment' object=$attachment}thumbnail=1{/link}">{lang}wcf.attachment.insertThumbnail{/lang}</span></li>{/if}
                                                        <li><span class="button small jsButtonAttachmentInsertFull" data-object-id="{@$attachment->attachmentID}" data-url="{link controller='Attachment' object=$attachment}{/link}">{lang}wcf.attachment.insertFull{/lang}</span></li>
                                                {else}
                                                        <li><span class="button small jsButtonInsertAttachment" data-object-id="{@$attachment->attachmentID}">{lang}wcf.attachment.insert{/lang}</span></li>
index 9a95ff90a960ba46c0240209f98a70f9bb04fdc1..976398d32fa59d2f4ba93fe73af9397e3841fd12 100644 (file)
@@ -354,10 +354,12 @@ WCF.Attachment.Upload = WCF.Upload.extend({
                                
                                if (this._editorId) {
                                        if (attachmentData.tinyURL) {
-                                               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);
-                                               var $insertOriginal = $('<li><span class="button small jsButtonAttachmentInsertFull" data-object-id="' + attachmentData.attachmentID + '" data-url="' + WCF.String.escapeHTML(attachmentData.url) + '">' + WCF.Language.get('wcf.attachment.insertFull') + '</span></li>').appendTo($buttonList);
+                                               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));
+                                               }
                                                
-                                               $insertThumbnail.children('span.button').click($.proxy(this._insert, this));
+                                               var $insertOriginal = $('<li><span class="button small jsButtonAttachmentInsertFull" data-object-id="' + attachmentData.attachmentID + '" data-url="' + WCF.String.escapeHTML(attachmentData.url) + '">' + WCF.Language.get('wcf.attachment.insertFull') + '</span></li>').appendTo($buttonList);
                                                $insertOriginal.children('span.button').click($.proxy(this._insert, this));
                                        }
                                        else {