PageSourceSearch

https://oiopublisher.com/wp-content/plugins/edd-upload-file/assets/js/edd-upload-file.js?ver=2.1.5

js oiopublisher.com collected 2026-09-24 09:00:48 UTC 7,138 bytes, 161 lines download raw bytes

1/*global jQuery, document, console, qq, edd_upload_file_vars*/
2jQuery(document).ready(function ($) {
3    'use strict';
4
5    var EDD_Upload_File_Uploader;
6
7    /**
8     * Uploader JS
9     */
10    EDD_Upload_File_Uploader = {
11        init : function () {
12            this.general();
13        },
14
15        general : function () {
16            var debugging = false;
17
18            if( edd_upload_file_vars.debug === '1') {
19                debugging = true;
20            }
21
22            $('.edd-upload-file-uploader').each(function () {
23                var extensions = $(this).data('extensions');
24                var item_id = $(this).data('item-id');
25
26                if( extensions === false ) {
27                    extensions = [];
28                } else {
29                    extensions = extensions.split(',');
30                }
31
32                new qq.FineUploader({
33                    debug: debugging,
34                    element: document.getElementById($(this).prop('id')),
35                    request: {
36                        endpoint: edd_upload_file_vars.endpoint + 'process'
37                    },
38                    deleteFile: {
39                        enabled: true,
40                        endpoint: edd_upload_file_vars.endpoint + 'process'
41                    },
42                    chunking: {
43                        enabled: true,
44                        concurrent: {
45                            enabled: true
46                        },
47                        success: {
48                            endpoint: edd_upload_file_vars.endpoint + 'done'
49                        }
50                    },
51                    resume: {
52                        enabled: true
53                    },
54                    retry: {
55                        enableAuto: true,
56                        showButton: true
57                    },
58                    thumbnails: {
59                        placeholders: {
60                            notAvailablePath: edd_upload_file_vars.placeholder_url + '/not_available-generic.png',
61                            waitingPath: edd_upload_file_vars.placeholder_url + '/waiting-generic.png'
62                        }
63                    },
64                    validation: {
65                        itemLimit: $(this).data('limit'),
66                        allowedExtensions: extensions
67                    },
68                    callbacks: {
69                        onComplete: function (id, name, response, xhr) {
70                            if($('#edd_purchase_form_wrap').length) {
71                                $('#edd_purchase_form_wrap').after('<input type="hidden" name="edd-upload-file[]" value="{' + item_id + '}{' + response.data.uuid + '}{' + name + '}" class="edd-upload-file-' + id + '" />');
72                            } else {
73                                $('#edd-upload-file-form').append('<input type="hidden" name="edd-upload-file[]" value="{' + item_id + '}{' + response.data.uuid + '}{' + name + '}" class="edd-upload-file-' + id + '" />');
74                                $('#edd-upload-file-form').append('<input type="hidden" name="edd-upload-file-uuid[' + id + ']" value="' + response.data.uuid + '" />');
75
76                                var postData = {
77                                    action: 'edd_upload_file_process',
78                                    download_data: item_id,
79                                    uuid: response.data.uuid,
80                                    filename: name,
81                                    payment_id: $('#edd-upload-file-payment-id').val()
82                                };
83
84                                $.ajax({
85                                    type: 'POST',
86                                    data: postData,
87                                    dataType: 'json',
88                                    url: edd_upload_file_vars.ajaxurl,
89                                    xhrFields: {
90                                        withCredentials: true
91                                    },
92                                    success: function (response) {
93                                        console.log(response);
94                                    }
95                                }).fail(function (data) {
96                                    if ( window.console && window.console.log ) {
97                                        console.log( data );
98                                    }
99                                });
100                            }
101                        },
102                        onDeleteComplete: function (id, xhr, iserror) {
103                            if($('#edd_purchase_submit').length) {
104                                $('.edd-upload-file-' + id).remove();
105                            } else {
106                                var postData = {
107                                    action: 'edd_upload_file_delete',
108                                    download_data: $('.edd-upload-file-' + id).val(),
109                                    payment_id: $('#edd-upload-file-payment-id').val()
110                                };
111
112                                $.ajax({
113                                    type: 'POST',
114                                    data: postData,
115                                    dataType: 'json',
116                                    url: edd_upload_file_vars.ajaxurl,
117                                    xhrFields: {
118                                        withCredentials: true
119                                    },
120                                    success: function (response) {
121                                        console.log(response);
122                                    }
123                                }).fail(function (data) {
124                                    if ( window.console && window.console.log ) {
125                                        console.log( data );
126                                    }
127                                });
128                            }
129                        }
130                    }
131                });
132            });
133
134            $('.edd-upload-file-uploader-show').on('click', function (e) {
135                e.preventDefault();
136
137                $(this).parent().next('.edd-upload-file-uploader').fadeIn('fast').css('display', 'block');
138
139                $(this).fadeOut('fast', function () {
140                    $(this).css('display', 'none');
141                    $(this).next('.edd-upload-file-uploader-hide').fadeIn('fast').css('display', 'inline-block');
142                });
143            });
144
145            $('.edd-upload-file-uploader-hide').on('click', function (e) {
146                e.preventDefault();
147
148                $(this).parent().next('.edd-upload-file-uploader').fadeOut('fast', function () {
149                    $(this).css('display', 'none');
150                });
151
152                $(this).fadeOut('fast', function () {
153                    $(this).css('display', 'none');
154                    $(this).prev('.edd-upload-file-uploader-show').fadeIn('fast').css('display', 'inline-block');
155                });
156            });
157
158        }
159    };
160    EDD_Upload_File_Uploader.init();
161});

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.