web/static-dist/libs/es-ckeditor/plugins/uploadpictures/dialogs/uploadpictures.js

(开头部分) 2KB

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

CKEDITOR.dialog.add('uploadpictures', function(editor) {
    
    var imageHtml = '', uploader;
    var lang = editor.lang.uploadpictures;
    var onLoadDialog = function() {

        var uploadUrl = editor.config.filebrowserImageUploadUrl;
        uploadUrl += uploadUrl.indexOf('?') == -1 ? '?' : '&';
        uploadUrl += 'CKEditorFuncNum=0&isWebuploader=1';

        var fileSingleSizeLimit = editor.config.fileSingleSizeLimit;

        uploader = WebUploader.create({
            swf: CKEDITOR.getUrl('plugins/uploadpictures/webuploader/Uploader.swf'),
            server: uploadUrl,
            pick: '.' + editor.id + ' .ckeditor-uploadpictures-pick-btn',
            compress: {
                width: 1200,
                height: 8000,
                quality: 90,
                allowMagnify: false,
                crop: false,
                preserveHeaders: true
            },
            resize: false,
            fileNumLimit: 10,
            threads: 1,
            fileSingleSizeLimit: fileSingleSizeLimit*1024*1024,
            accept: {
                title: 'Images',
                extensions: 'gif,jpg,jpeg,bmp,png,ico',
                mimeTypes: 'image/*'
            }
        });

        $('.js-start-upload-btn').on('click', function() {
            uploader.upload();
        });

        uploader.on('error', function(errorCode) {
            if (errorCode == 'Q_TYPE_DENIED') {
                alert(lang.file_type_tip + uploader.options.accept[0].extensions.join(','));
            } else if (errorCode == 'F_EXCEED_SIZE') {
                alert(lang.single_file_max_size_tip + filesize(uploader.options.fileSingleSizeLimit));
            }
        });

        uploader.on('fileQueued', function(file) {
            $('.' + editor.id + ' .balloon-nofile').remove();
            var $list = $('.' + editor.id + ' .balloon-filelist ul');
            $list.append(
                '<li id="' + file.id + '">' +
                '  <div class="file-name">' + file.name + '</div>' +
                '  <div class="file-size">' + filesize(file.size) + '</div>' +
                '  <div class="file-status">' + lang.waiting_upload_text + '</div>' +
                '  <div class="file-remove">' + lang.delete_text + '</div>' +
                '  <div class="file-progress"><div class="file-progress-bar" style="width: 0%;"></div></div>' +
                '</li>'
            );
        });

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

AI 解读 AI

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

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