PageSourceSearch

https://zaemit.kr/weven_service/asset/js/bm2/com/toolbtn/ToolBtnDomBackgroundVideo.js

js zaemit.kr collected 2026-10-10 00:42:37 UTC 25,440 bytes, 538 lines download raw bytes

1/**
2 * created by WEVEN on 2020-03-02
3 * 아래의 소스는 WEVEN에 저작권이 있으므로 무단 사용 및 재 배포를 금합니다.
4 */
5var ToolBtnDomBackgroundVideo = function (btnType) {
6
7    this.type = btnType;
8
9    this.element = $("[data-wv-toolset=ToolDomBackgroundVideo]");
10    this.colorPicker = ToolOpColorPicker.get(this, btnType);
11    this.addOption(this.colorPicker, "videoDimColorExpand");
12
13    this.playerTmplt;
14    this.dimColor;
15
16    this.blockJsTmplt;
17
18    this.onOptionChange = function (type, value) {
19        var targetElementList = [];
20
21        if(!this['target']) {
22            bm.toast(systemLangPack.getMessage("SLSAT0222")); //선택된 블록이 없습니다.
23            return false;
24        }
25        targetElementList.push(this.target);
26        if (bm.toolManager.isMultiSelectMode) {
27            targetElementList = bm.toolManager.targetElementList.concat();
28        }
29
30        if (type === "apply") {
31            for (var i = 0; i < targetElementList.length; i++) {
32                if ($(targetElementList[i]).attr('data-wv-layout-element-type') === 'video') {
33                    bm.toast(systemLangPack.getMessage("SLSATTB0005")); //영상 블록에 배경동영상을 설정할 수 없습니다.
34                    return false;
35                } else if ($(targetElementList[i]).closest('[data-wv-inc="header"]').length > 0) {
36                    bm.toast(systemLangPack.getMessage("SLSATTB0006")); //헤더 영역에 배경동영상을 설정할 수 없습니다.
37                    return false;
38                } else if ($(targetElementList[i]).attr('data-wv-layout-element-type') === 'map') {
39                    bm.toast(systemLangPack.getMessage("SLSATTB0007")); //지도 블록에 배경동영상을 설정할 수 없습니다.
40                    return false;
41                } else if ($(targetElementList[i]).attr('data-wv-layout-element-type') === 'bbs') {
42                    bm.toast(systemLangPack.getMessage("SLSATTB0008")); //게시판 블록에 배경동영상을 설정할 수 없습니다.
43                    return false;
44                } else if ( $(targetElementList[i]).find('.video-bg-wrap').length === 0 && wvAdminIFrameBridge._WVContentArea.$contentBody.find("script[data-block-js='" + $(targetElementList[i]).attr('data-wv-res-id') + "']").length > 0) {
45                    //특수 기능을 가진 블록에 배경동영상을 설정할 수 없습니다.
46                    bm.toast(systemLangPack.getMessage("SLSATTB0009"));   // 기존에 js를 가진 블록에 설정하면 js가 겹치므로 막음
47                    return false;
48                }
49
50            }
51
52            if (!this.validVideo()) return false;
53            this.addPlayer(targetElementList);
54
55        } else if(type === "ToolOpColorPicker"){
56            if(typeof(value) === 'string' && value.indexOf('#') > -1) {
57                value = bm.number.hexToRgb(value);
58            }
59            this.dimColor = 'background-color: rgba(' + value.r + ',' + value.g + ',' + value.b + ',' + value.a/100 + ')';
60            $(this.target).find(".dim").css("background-color", 'rgba(' + value.r + ',' + value.g + ',' + value.b + ',' + value.a/100 + ')');
61            $(this.element).find('input[name="videoDim"]').val((bm.number.rgbToHex('rgb(' + value.r + ',' + value.g + ',' + value.b + ',)')).toUpperCase());
62            $(this.element).find("#videoDimColorPicker").val(bm.number.rgbToHex('rgb(' + value.r + ',' + value.g + ',' + value.b + ',)'));
63            $(this.btnList.videoDimOpacity).val(value.a + '%');
64        }else {
65            // delete
66            this.removeVideo(targetElementList);
67        }
68
69        // 버튼 클릭 시 옵션 닫음
70        $(this.btnList[0]).trigger('click');
71
72    }
73
74    this.removeVideo = function (targetElementList) {
75        var iframeContents = wvAdminIFrameBridge._WVContentArea.$content;
76        var css = {backgroundImage : '', backgroundRepeat: '', backgroundSize: '', backgroundPosition: ''};
77
78        bm.toolManager.toolBtnEditBefore(this, targetElementList, HistoryType.EDITOR_DOM_BACKGROUND_VIDEO);
79
80        for (var i = 0; i < targetElementList.length; i++) {
81            var target = targetElementList[i];
82
83            if ($(target).find('.video-bg-wrap').length > 0) {
84                $(target).find('.video-bg-wrap').remove();
85            }
86
87            if (bm.getStyle(target, "backgroundImage") === 'none') {
88                $(target).css('background-image', '');
89            } else {
90                var styleObj = WVAdminResourceManager.getEmbededStyleObject(null, target);
91                css = {
92                    backgroundImage : bm.getStyle(target, "backgroundImage"),
93                    backgroundRepeat : bm.getStyle(target, "backgroundRepeat"),
94                    backgroundSize : bm.getStyle(target, "backgroundSize"),
95                    backgroundPosition : bm.getStyle(target, "backgroundPosition")
96                }
97                styleObj.applyResourceStyle(target, css, false, true, false, false );
98                styleObj.refreshStyleElementText();
99            }
100
101            if ($(target).attr('data-wv-layout-element-param')) {
102                var param = JSON.parse($(target).attr('data-wv-layout-element-param').replace(/\'/g, '"'));
103
104                if (param.videoType) delete param.videoType;
105                if (param.videoId) delete param.videoId;
106                if (param.videoSrc) delete param.videoSrc;
107                if (param.videoLoop) delete param.videoLoop;
108                if (param.videoAutoplay) delete param.videoAutoplay;
109
110                if (Object.keys(param).length === 0) {
111                    param = "";
112                } else {
113                    param = JSON.stringify(param).replace(/\"/g, "'");
114                }
115
116                $(target).attr('data-wv-layout-element-param', param);
117            }
118
119            var resId = $(target).attr('data-wv-res-id');
120
121            if (iframeContents.find("script[data-block-js='" + resId + "']").length === 1) {
122                iframeContents.find("script[data-block-js='" + resId + "']").remove();
123                delete wvAdminIFrameBridge.iframeWindow.wevenBlock[resId];
124            }
125        }
126
127        bm.toolManager.toolBtnEditAfter(this, targetElementList, HistoryType.EDITOR_DOM_BACKGROUND_VIDEO);
128    }
129
130    this.validVideo = function () {
131        // 영상주소 입력 확인
132        if(isExpertMode) {
133            var url = $(this['btnList']['url']);
134        }else {
135            var url = $(this.bgVideoOpt.element).find('[data-wv-tool-option-value="url"]');
136        }
137
138        if (!url.val()) {
139            bm.toast(systemLangPack.getMessage('SLSATTB0045')); //영상주소를 입력해주세요.
140            url.focus();
141            return false;
142        }
143
144        // url 정보 확인
145        var videoInfo = this.getVideoInfo(null, url.val());
146
147        if (!videoInfo.videoType) {
148            bm.toast(systemLangPack.getMessage('SLSATTB0100')); //영상매체는 Youtube와 Vimeo만 가능합니다.
149            url.focus();
150            return false;
151        }
152
153        // 영상주소 유효성 확인
154        if (!videoInfo.videoId) {
155            bm.toast(systemLangPack.getMessage('SLSATTB0048')); //영상주소가 올바르지 않습니다.
156            url.focus();
157            return false;
158        }
159
160        return true;
161    }
162
163    this.getUrlType = function (url) {
164
165        url.match(/(http:|https:|)\/\/(player.|www.)?(vimeo\.com|youtu(be\.com|\.be|be\.googleapis\.com))\/(video\/|embed\/|watch\?v=|v\/)?([A-Za-z0-9._%-]*)(\&\S+)?/);
166        var videoType;
167        if (RegExp.$3.indexOf('youtu') > -1) {
168            videoType = "youtube";
169        } else if (RegExp.$3.indexOf('vimeo') > -1) {
170            videoType = "vimeo";
171        }
172
173        return {videoType: videoType, videoId: RegExp.$6};
174    }
175
176    this.getVideoInfo = function (target, url) {
177        var info = {};
178
179        if (target && $(target).attr('data-wv-layout-element-param')) {
180            info = bm.object.deepCopy(JSON.parse($(target).attr('data-wv-layout-element-param').replace(/\'/g, '"')));
181        }
182
183        if (url) {
184            var urlInfo = this.getUrlType(url);
185
186            info['videoType'] = urlInfo['videoType'];
187            info['videoId'] = urlInfo['videoId'];
188        }
189
190        return info;
191    }
192
193    this.getVideoParam = function (target) {
194
195  
196        if(isExpertMode) {
197            var videoParam = this.getVideoInfo(target, $(this['btnList']['url']).val());
198        }else {
199            var videoParam = this.getVideoInfo(target, $(this.bgVideoOpt.element).find('[data-wv-tool-option-value="url"]').val());
200        }
201
202        videoParam.videoLoop = true;
203        videoParam.videoAutoplay = true;
204
205        var webRoot = WEB_ROOT;
206        if (webRoot.indexOf('/webadm') > -1) webRoot.replaceAll('/webadm', '/web');
207
208        if (videoParam.videoType === "youtube") {
209            videoParam.videoSrc = "https://www.youtube.com/embed/" + videoParam.videoId + "?autoplay=1&mute=1&controls=0&disablekb=1&enablejsapi=1&modestbranding=1&iv_load_policy=3&loop=1&playlist=" + videoParam.videoId + "&origin=" + encodeURIComponent(webRoot);
210        } else if (videoParam.videoType === "vimeo") {
211            videoParam.videoSrc = "https://player.vimeo.com/video/" + videoParam.videoId + "?autoplay=1&muted=1&autopause=0&loop=1&controls=0&background=1";
212        }
213
214        return videoParam;
215
216    }
217
218    this.addVideoBg = function (videoParam, target, responsiveSize) { //비디오 초기배경 설정 *cys
219        let css = {backgroundRepeat: 'no-repeat', backgroundSize: 'cover', backgroundPosition: 'center'};
220        let styleObj = WVAdminResourceManager.getEmbededStyleObject(null, target);
221
222        responsiveSize = responsiveSize ? responsiveSize : wvAdminIFrameBridge._WVAdminTopBar.getResponsiveCheckSizeList(
222);
223
224        if (videoParam.videoType === 'vimeo') {
225            let ajaxUrl = 'http://vimeo.com/api/v2/video/' + videoParam.videoId + '.json';
226            $.ajax({
227                url: ajaxUrl,
228                dataType: "json"
229            }).done((data) => {
230                let url = data[0]['thumbnail_large'];
231                css['backgroundImage'] = 'url("' + url + '")';
232                styleObj.applyResourceStyle(target, css, false, true, false, false, responsiveSize );
233                styleObj.refreshStyleElementText();
234            }).fail(() => {
235                console.log('썸네일 추출 실패');
236            });
237        } else if (videoParam.videoType === 'youtube') {
238            var url = 'https://img.youtube.com/vi/' + videoParam.videoId + '/maxresdefault.jpg';
239
240            // 썸네일 못가져오는 경우 width로 임의 체크
241            var thumb = new Image();
242            thumb.src = url;
243            css['backgroundImage'] = 'url("' + url + '")';
244            styleObj.applyResourceStyle(target, css, false, true, false, false, responsiveSize );
245            styleObj.refreshStyleElementText();
246        }
247    }
248
249    this.setVideo = function () { //비디오프레임 세팅
250
251        this.playerTmplt = '<div class="video-bg-wrap">'
252            + '<div class="dim" style="position: absolute;top: 0;left: 0;height: 100%;width: 100%;z-index: 1;"></div>'
253            + '<div class="video-bg">'
254            + '<iframe id="'+ $(this.target).attr('data-wv-res-id') +'" src="{{videoSrc}}" frameborder="0" allowfullscreen="1" allow="autoplay; fullscreen" style="position:absolute; top:0; left:0;"></iframe>'
255            + '</div>'
256            + '</div>';
257
258        this.blockJsTmplt = "{ videoInfo: null, videoWidth : 0, videoHeight : 0 ,init : function(){ this.registEvent(); this.onLoadHandler(); } ,registEvent : function() { } ,onLoadHandler : function(){ var _this = this; if(_this.block && $(_this.block).attr('data-wv-layout-element-param')) { _this.videoInfo = JSON.parse($(_this.block).attr('data-wv-layout-element-param').replace(/\'/g, '\"')); if($(_this.block).find('.video-bg-wrap').length > 0) { $(_this.block).find('.video-bg-wrap').remove(); } $(_this.block).prepend(_this.getPlayer());  _this.observer  = new ResizeObserver(function (entries, observer) { var width = entries[0].borderBoxSize[0].inlineSize; var height = entries[0].borderBoxSize[0].blockSize; if(width !== _this.videoWidth || height !== _this.videoHeight) { _this.setVideoFullSize(width, height); } _this.videoWidth = width; _this.videoHeight = height; }); _this.observer.observe(_this.block); } }  , setVideoFullSize : function ( w, h ) { var iframe = $(this.block).find('iframe'); var ratio = 1.778; var extraValue = 200;  iframe.height(Math.round(w / ratio)); iframe.width(Math.round(iframe.height() * ratio)); if (w > iframe.width()) { iframe.width(w + extraValue); iframe.height(iframe.width() / ratio ); } if (h > iframe.height()) { iframe.height(h + extraValue); iframe.width(iframe.height() * ratio); }  iframe.parent().css('left', '-' + (iframe.width() - w) / 2 + 'px' ); iframe.parent().css('top', '-' + (iframe.height() - h) / 2 + 'px' ); } ,getPlayer : function() { return '" + this.playerTmplt + "'; } ,removeEvent : function(){ if(this.observer) this.observer.disconnect(); }  ,destroy : function(){ this.videoWidth = 0; this.videoHeight = 0; this.removeEvent(); } }"
259    }
260
261    this.addPlayer = function (targetElementList) {
262
263        bm.toolManager.toolBtnEditBefore(this, targetElementList, HistoryType.EDITOR_DOM_BACKGROUND_VIDEO);
264
265        for (var i = 0; i < targetElementList.length; i++) {
266            var target = targetElementList[i];
267
268            var videoParam = this.getVideoParam(target);
269
270            if ($(target).find('.video-bg-wrap').length > 0) {
271                $(target).find('.video-bg-wrap').remove();
272            }
273
274            if ($(target).attr('data-wv-layout-element-param')) {
275                var param = JSON.parse($(target).attr('data-wv-layout-element-param').replace(/\'/g, '"'));
276
277                param['videoType'] = videoParam.videoType;
278                param['videoId'] = videoParam.videoId;
279                param['videoSrc'] = videoParam.videoSrc;
280                param['videoLoop'] = videoParam.videoLoop;
281                param['videoAutoplay'] = videoParam.videoAutoplay;
282
283                $(target).attr('data-wv-layout-element-param', JSON.stringify(param).replace(/\"/g, "'"));
284            } else {
285                $(target).attr('data-wv-layout-element-param', JSON.stringify(videoParam).replace(/\"/g, "'"));
286            }
287
288            // res-id나 block-id가 없으면 block js가 적용되지 않아 추가해줌
289            if (!$(target).attr('data-wv-res-id')) {
290                var blockId = $(target).attr('data-wv-block-id');
291                $(target).attr('data-wv-res-id', WVAdminResourceManager.createResourceId(blockId))
292            }
293
294            if (!$(target).attr('data-wv-block-id')) {
295                $(target).attr('data-wv-block-id', "___block" + $(target).attr('data-wv-res-id'));
296            }
297
298            this.addVideoBg(videoParam, $(target));
299
300            this.setVideo();
301            this.addBlockJs($(target).attr('data-wv-res-id'), videoParam.videoSrc);
302        }
303
304        bm.toolManager.toolBtnEditAfter(this, targetElementList, HistoryType.EDITOR_DOM_BACKGROUND_VIDEO);
305
306        this.setStyleBtn();
307    }
308
309    this.addBlockJs = function (resId, videoSrc) {
310
311        var contentArea = wvAdminIFrameBridge._WVContentArea;
312        var jsContent = "wevenBlock['" + resId + "'] = " + this.blockJsTmplt;
313        var scriptElement = contentArea.innerWindow.document.createElement('script');
314
315        scriptElement.setAttribute('type', 'text/javascript');
316        scriptElement.setAttribute('data-block-js', resId);
317
318        if($(this.target).closest('data-wv-inc').length > 0) {
319            scriptElement.setAttribute('data-inc-js', resId);
320        } else if ($(this.target).closest('[data-wv-layout-element="layout"]').length > 0) {
321            scriptElement.setAttribute('data-layout-js', '');
322        }
323
324        if (jsContent.indexOf('{{videoSrc}}') > -1) jsContent = jsContent.replace(/{{videoSrc}}/g, videoSrc);
325
326        scriptElement.text = jsContent;
327
328        if (contentArea.$contentBody.find("script[data-block-js='" + resId + "']").length > 0) {
329            var prevScript = contentArea.$contentBody.find("script[data-block-js='" + resId + "']");
330            prevScript.each(function () {
331                if(this.innerHTML.indexOf("video-bg-wrap")) {  // 해당 res-id의 js 중 배경동영상 script가 있으면 중복방지 위해 지움
332                    $(this).remove();
333                    delete wvAdminIFrameBridge.iframeWindow.wevenBlock[resId];
334                }
335            });
336        }
337
338        contentArea.$contentBody.append(scriptElement);
339
340        app.childApp.wvLayoutTargetCrawling(resId, true);
341    }
342
343}
344
345bm.extend(ToolBtnBase, ToolBtnDomBackgroundVideo);
346
347ToolBtnDomBackgroundVideo.prototype.setStyleBtn = function () {
348    if (!this.target || this.target.length) {
349        this.resetStyleBtn();
350        return false;
351    }
352
353    // 영상, 지도, 헤더, 게시판 블록에 배경동영상 설정 불가
354    if ($(this.target).attr('data-wv-layout-element-type') === "video" || $(this.target).attr('data-wv-layout-element-type') === "map"
355        || $(this.target).closest('[data-wv-inc="header"]').length > 0 || $(this.target).attr('data-wv-layout-element-type') === "bbs"
356        || $(this.target).attr('data-wv-layout-element-type') === "line" || $(this.target).closest('[data-wv-layout-element-type="shop_list"]').length > 0
357        || $(this.target).closest('[data-wv-layout-element-type="shop_review"]').length > 0 || $(this.target).closest('[data-wv-layout-element-type="shop_BBS_recent"]').length > 0
358        || $(this.target).closest('[data-wv-layout-element-type="insta"]').length > 0) {
359        this.resetStyleBtn();
360        return false;
361    }
362
363    if(!isExpertMode) {
364        this.bgVideoOpt = this.optionList["backgroundVideo"];
365        var optionBtnList = this.bgVideoOpt.optionBtnList;
366    }else {
367        this.bgVideoOpt = {'element' : this.element};
368    }
369
370    const videoDimNode = $(this.target).find('.dim')[0];
371    let videoDimStyle;
372    if(videoDimNode) {
373        videoDimStyle = bm.getStyle(videoDimNode, 'backgroundColor');
374    }else {
375        videoDimStyle = 'rgba(0,0,0,0)';
376    }
377
378    var param = $(this.target).attr('data-wv-layout-element-param');
379
380    if (param && !param.includes('vertical') && !param.includes('horizon')) {
381        try{
382            var param = JSON.parse($(this.target).attr('data-wv-layout-element-param').replace(/\'/g, '"'));
383        }catch(e){
384            var param = bm.parsing.parseStrToObj($(this.target).attr('data-wv-layout-element-param').replace(/\'/g, '"'));
385        }
386
387        if (param.videoType && param.videoId) {
388            var url = "";
389
390            if (param.videoType === "youtube") {
391                url = "https://youtu.be/" + param.videoId;
392            } else if (param.videoType === "vimeo") {
393                url = "https://vimeo.com/" + param.videoId;
394            }
395
396            if(isExpertMode) {
397                $(this.element).find('input[name=url]').val(url);
398                $(this.element).find('input[name=videoDim]').val(bm['number'].rgbToHex(videoDimStyle));
399                $('#videoDimColorPicker').val(bm['number'].rgbToHex(videoDimStyle));
400                $(this.element).find('input[name=videoDimOpacity]').val((bm['number'].rgbaToObj(videoDimStyle)['a'] * 100) + '%');
401
402                bm.toolManager.toolList['ToolDomBackgroundVideo'].openControl(null, true);
403            } else{
404                $(this.bgVideoOpt.element).find('[data-wv-tool-option-value="url"]').val(url);
405
406                $(optionBtnList['delete']).show();
407            }
408        }
409    } else {
410        //무상태
411        if(isExpertMode) {
412            $(this.element).find('input[name=url]').val('');
413            $(this.element).find('input[name=videoDim]').val('#000000');
414            $('#videoDimColorPicker').val('#000000');
415            $(this.element).find('input[name=videoDimOpacity]').val('0%');
416            bm.toolManager.toolList['ToolDomBackgroundVideo'].openControl(null, false);    
417        } else {
418            $(this.bgVideoOpt.element).find('[data-wv-tool-option-value="url"]').val('');
419            $(optionBtnList['delete']).hide();
420        }
421    }
422}
423
424ToolBtnDomBackgroundVideo.prototype.resetStyleBtn = function () {
425    var _this = this;
426    if(isExpertMode) {
427        $(this.element).find('input[name=url]').val('');
428        $(this.element).find('input[name=videoDim]').val('#000000');
429        $('#videoDimColorPicker').val('#000000');
430        $(this.element).find('input[name=videoDimOpacity]').val('0%');
431    }
432}
433
434ToolBtnDomBackgroundVideo.prototype.showOption = function(option, btn){
435    ToolBtnBase.prototype.showOption.call(this, option, btn);
436
437    if(option.type === "ToolOpColorPicker") {
438        $(option.element).closest('.tool_form_style_0_content').append(option.element);
439    }
440}
441
442ToolBtnDomBackgroundVideo.prototype.addEvent = function () {
443    var _this = this;
444
445    if(isExpertMode) {
446        this.onOptionHide = function( btn, option ) {
447            if( option.status == 1) {
448                option.deactive();
449            }
450        }
451    
452        this.onOptionShow = function (btn, option) {
453            var rgb = bm.number.hexToRgb($(this.element).find('input[name="videoDim"]').val());
454            rgb.a = parseFloat($(this.element).find('input[name="videoDimOpacity"]').val()) / 100;
455            option.setStyleValue(rgb.r, rgb.g, rgb.b, rgb.a);
456        }
457
458        $(this.element).find('input[name="url"]').on('keydown', function(e) {
459            if( e.keyCode == 13 ){
460                _this.onOptionChange('apply');
461            }
462        });
463
464        $(this.element).find('input[name="videoDim"]').on('keydown', function(e) {
465            if( e.keyCode == 13 ){
466                var val = this.value;
467
468                if( bm.number.isHex(val) == false ){
469                    bm.toast(systemLangPack.getMessage('SLSATTB0038'), systemLangPack.getMessage('SLSATTB0101')); //올바른 색상코드를 입력해주세요., 영상 딤 색상
470                    return false;
471                }
472
473                _this.onOptionChange('apply');
474            }
475        });
476
477        $('#videoDimColorPicker').on('change', function(e) {
478            $(_this.element).find('input[name="videoDim"]').val(this.value);
479            _this.onOptionChange('apply');
480        });
481
482        $(this.element).find('input[name="videoDimOpacity"]').on('keydown', function(e) {
483            if( e.keyCode == 13 ){
484                var opacity = parseInt(this.value);
485
486                if( opacity < 0 || opacity > 100 ){
487                    bm.toast(systemLangPack.getMessage('SLSATTB0102'), systemLangPack.getMessage('SLSATTB0103')); //0부터 100 사이 값만 적용할 수 있습니다., 영상 딤 투명도
488                    return false;
489                }
490
491                _this.onOptionChange('apply');
492            }
493        });
494
495        //유효성검사
496        $(this.element).find('input[name="videoDimOpacity"]').on('keyup', function() {
497            var value = $(this).val();
498            // % 1개 포함 시 통과
499            if ( value.indexOf('%') === -1 && !bm.valid.isOnlyNum(value) || !/^\d+(%{0,1})$/.test(value) ) {
500                $(this).val(0);
501                bm.toast(systemLangPack.getMessage('SLSATTB0058'), systemLangPack.getMessage('SLSATTB0103')); //숫자를 입력해주세요., 영상 딤 투명도
502                return false;
503            }
504        });
505    } else {
506        $(this.element).find('input[name="videoDim"]').on("keyup", function (e) { //dim 조절 *cys
507            var dim = $(this).val();
508            if (bm.valid.isOnlyNumDot(dim)) {
509                if (dim < 0 || dim > 1) {
510                    $(this).val(0.2);
511                    bm.toast(systemLangPack.getMessage('SLSATTB0104'), systemLangPack.getMessage('SLSATTB0105')); //0 ~ 1사이의 수치를 입력해주세요., 영상투명도
512                    return;
513                }
514            } else {
515                $(this).focus();
516                $(this).val(0.2);
517                bm.toast(systemLangPack.getMessage('SLSATTB0058'), systemLangPack.getMessage('SLSATTB0105')); //숫자를 입력해주세요., 영상투명도
518                return;
519            }
520        });
521    }
522}
523
524ToolBtnDomBackgroundVideo.prototype.removeEvent = function () {
525    var _this = this;
526    if(isExpertMode) {
527        $(this.element).find('input[name="videoDim"]').off("keydown");
528        $('#videoDimColorPicker').off("change");
529        $(this.element).find('input[name="videoDimOpactiy"]').off("keydown");
530        $(this.element).find('input[name="videoDimOpactiy"]').off("keyup");
531    } else {
532        $(this.element).find('input[name="videoDim"]').off("keyup");
533    }
534}
535
536ToolBtnDomBackgroundVideo.prototype.resetProperty = function() {
537    this.onOptionChange('delete');
538}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.