OWL ITS + 탐지시스템(인터넷 진흥원)
jhjang
2021-10-14 3052936fed9166521b0557a36df83eb11a5e51ee
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/**
 * Created by wisestone on 2018-04-02.
 */
'use strict';
 
define(['app'],
    function (app) {
        app.directive('owlAttachedFileType', ["$rootScope",
            function ($rootScope) {
                return {
                    restrict : 'A',
                    link : function (scope, element, attrs) {
                        scope.file = scope[attrs["owlAttachedFileType"]];
 
                        if ($rootScope.isDefined(scope.file)) {
                            if (scope.file.contentType.indexOf("image") > -1) {
                                element.append('<span class="attached-media-w"><img src="' + scope.file.path + '"></span>');
                            }
                            else if (scope.file.contentType.indexOf("text") > -1 || scope.file.contentType.indexOf("application") > -1) {
                                element.append('<i class="os-icon os-icon-file-text"></i>');
                            }
                            else if (scope.file.contentType.indexOf("video") > -1) {
                                element.append('<i class="os-icon os-icon-film"></i>');
                            }
                            else {
                                element.append('<i class="os-icon os-icon-ui-51"></i>');
                            }
                        }
 
 
                    }
                };
            }])
    });