public/plugins/wxeditor/ueditor/dialogs/video/video.js

(开头部分) 8KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

(function(){
    var isModifyUploadVideo = false;
    window.onload = function(){
        $focus($G("videoUrl"));
        initVideo();
    }
    function getParam(url, name) {
        return url.match(new RegExp('[?#&]' + name + '=([^?#&]+)', 'i')) ? RegExp.$1 : '';
    }
    function initVideo(){
        addUrlChangeListener($G("videoUrl"));
        addOkListener();
        var img = editor.selection.getRange().getClosedNode(),url;
        if(img && img.className){
            var hasFakedClass = (img.className == "edui-faked-video"),
                hasUploadClass = img.className.indexOf("edui-upload-video")!=-1;
            if(hasFakedClass || hasUploadClass) {
                $G("videoUrl").value = url = img.getAttribute("_url");
                $G("videoWidth").value = img.width;
                $G("videoHeight").value = img.height;
                var align = domUtils.getComputedStyle(img,"float"),
                    parentAlign = domUtils.getComputedStyle(img.parentNode,"text-align");
                updateAlignButton(parentAlign==="center"?"center":align);
            }
            if(hasUploadClass) {
                isModifyUploadVideo = true;
            }
        }else if(dialog.anchorEl){
            if($(dialog.anchorEl).hasClass('video_iframe')) {
                url = $(dialog.anchorEl).attr('src');
                url = decodeURIComponent(getParam(url, 'url'));
                $G("videoUrl").value = url;
                $G("videoWidth").value = $(dialog.anchorEl).attr('width');
                $G("videoHeight").value = $(dialog.anchorEl).attr('height');
            }
        }
        createPreviewVideo(url);

        $('#J_UpFile').click(function () {
            parent.window.FileStorage({
                type: 'video',
                callback: function (url, data) {
                    $('#videoUrl').val(url);
                    createPreviewVideo(url);
                }
            });
        });
    }
    function addUrlChangeListener(url){
        if (browser.ie) {
            url.onpropertychange = function () {
                createPreviewVideo(this.value);
            }
        } else {
            url.addEventListener( "input", function () {
                createPreviewVideo(this.value);
            }, false );
        }
    }
    function addOkListener(){
后面还有 118 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。