Resolve todo in MediaManagerSelect
authorMatthias Schmidt <gravatronics@live.com>
Sun, 31 Jul 2016 11:30:44 +0000 (13:30 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Sun, 31 Jul 2016 11:30:58 +0000 (13:30 +0200)
wcfsetup/install/files/js/WoltLab/WCF/Media/Manager/Select.js

index 295479382680e2d20281f6a1db1bf4f8c95c2d08..e52b804810521f2598ca9067540acb0deedda798 100644 (file)
@@ -6,7 +6,8 @@
  * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
  * @module     WoltLab/WCF/Media/Manager/Select
  */
-define(['Core', 'Dom/Traverse', 'Dom/Util', 'Language', 'ObjectMap', 'Ui/Dialog', 'WoltLab/WCF/Media/Manager/Base'], function(Core, DomTraverse, DomUtil, Language, ObjectMap, UiDialog, MediaManagerBase) {
+define(['Core', 'Dom/Traverse', 'Dom/Util', 'Language', 'ObjectMap', 'Ui/Dialog', 'WoltLab/WCF/File/Util', 'WoltLab/WCF/Media/Manager/Base'],
+       function(Core, DomTraverse, DomUtil, Language, ObjectMap, UiDialog, FileUtil, MediaManagerBase) {
        "use strict";
        
        /**
@@ -91,7 +92,13 @@ define(['Core', 'Dom/Traverse', 'Dom/Util', 'Language', 'ObjectMap', 'Ui/Dialog'
                                                displayElement.innerHTML = '<img src="' + media.smallThumbnailLink + '" alt="' + media.altText + '" />';
                                        }
                                        else {
-                                               // TODO: add visual representation of the non-image media file
+                                               displayElement.innerHTML = '<div class="box48" style="margin-bottom: 10px;">'
+                                                       + '<span class="icon icon48 ' + FileUtil.getIconClassByMimeType(media.fileType) + '"></span>'
+                                                       + '<div class="containerHeadline">'
+                                                               + '<h3>' + media.filename + '</h3>'
+                                                               + '<p>' + media.formattedFilesize + '</p>'
+                                                       + '</div>'
+                                               + '</div>';
                                        }
                                }
                        }