Skip to content

Commit

Permalink
fixed attach type preview
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Smith committed Dec 24, 2023
1 parent 4139846 commit e8739f4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Themes/default/scripts/jquery.sceditor.smf.js
Original file line number Diff line number Diff line change
Expand Up @@ -730,14 +730,14 @@ sceditor.formats.bbcode.set(
if (typeof attrs.height !== "undefined")
attribs += ' height="' + attrs.height + '"';

var contentUrl = smf_scripturl +'?action=dlattach;attach='+ id + ';type=preview;thumb';
var contentUrl = smf_scripturl +'?action=dlattach;attach='+ id + ';preview;image';
contentIMG = new Image();
contentIMG.src = contentUrl;
}

// If not an image, show a boring ol' link
if (typeof contentUrl === "undefined" || contentIMG.getAttribute('width') == 0)
return '<a href="' + smf_scripturl + '?action=dlattach;attach=' + id + ';type=preview;file"' + attribs + '>' + content + '</a>';
return '<a href="' + smf_scripturl + '?action=dlattach;attach=' + id + ';file"' + attribs + '>' + content + '</a>';
// Show our purdy li'l picture
else
return '<img' + attribs + ' src="' + contentUrl + '">';
Expand Down

0 comments on commit e8739f4

Please sign in to comment.