HEX

Warning: set_time_limit() [function.set-time-limit]: Cannot set time limit - prohibited by configuration in /home/u547966/brikov.ru/www/wp-content/plugins/admin-menu-editor/menu-editor.php on line 745
Server: Apache
System: Linux 4.19.0-0.bpo.9-amd64 x86_64 at red40
User: u547966 (5490)
PHP: 5.3.29-mh2
Disabled: syslog, dl, popen, proc_open, proc_nice, proc_get_status, proc_close, proc_terminate, posix_mkfifo, chown, chgrp, accelerator_reset, opcache_reset, accelerator_get_status, opcache_get_status, pcntl_alarm, pcntl_fork, pcntl_waitpid, pcntl_wait, pcntl_wifexited, pcntl_wifstopped, pcntl_wifsignaled, pcntl_wifcontinued, pcntl_wexitstatus, pcntl_wtermsig, pcntl_wstopsig, pcntl_signal, pcntl_signal_dispatch, pcntl_get_last_error, pcntl_strerror, pcntl_sigprocmask, pcntl_sigwaitinfo, pcntl_sigtimedwait, pcntl_exec, pcntl_getpriority, pcntl_setpriority
Upload Files
File: /home/u547966/brikov.ru/www/wp-content/plugins/wp-media-folder/assets/js/replace-image.js
/** 
 * We developed this code with our hearts and passion.
 * @package wp-media-folder
 * @copyright Copyright (C) 2014 JoomUnited (http://www.joomunited.com). All rights reserved.
 * @license GNU General Public License version 2 or later; http://www.gnu.org/licenses/gpl-2.0.html
 */

(function($){
    
    $(document).ready(function(){
        if(typeof(wp.media)!=='undefined'){
            wp.media.view.AttachmentsBrowser.prototype.on('ready',function(){
                $.ajax({
                    type: 'POST',
                    url : ajaxurl,
                    data: {
                        'action': 'noreplace_image',
                        'wpmf_replace' : 0,
                        'att_selected' : true
                    }
                });
            });

            if(wpmf_pagenow == 'upload.php' && $('.media-frame').hasClass('mode-grid')){
            
                mMediaViewModal = wp.media.view.Modal;  
                wp.media.view.Modal = wp.media.view.Modal.extend({
                    close : function(){
                        mMediaViewModal.prototype.close.apply(this, arguments);
                        if($('body.wpmf-replace').length === 0){
                            $.ajax({
                                type: 'POST',
                                url : ajaxurl,
                                data: {
                                    'action': 'noreplace_image',
                                    'wpmf_replace' : 0,
                                    'att_selected' : true
                                }
                            });
                        }
                    },
                });
            
            }
        }
        
        bindselectchange = function(){
            $(document).on('click', '.add-new-h2,#plupload-browse-button', function(event) {
                $.ajax({
                    type: 'POST',
                    url : ajaxurl,
                    data: {
                        'action': 'noreplace_image',
                        'wpmf_replace' : 0,
                        'att_selected' : true
                    }
                });
            });
            
            $(document).on('click', '#wpmf_upload', function(event) {
                if(wpmf_pagenow == 'upload.php' && $('.media-frame').hasClass('mode-grid')){
                    $('body').addClass('wpmf-replace');
                    $('.media-modal-close').click();
                }
                
                $('.moxie-shim.moxie-shim-html5 input[type="file"]').click();   
            });
            
            $(document).on('click', '#wpmfreplace', function(event) {
                var att_selected = $('[id^="__wp-uploader-id-"]:visible .attachments-browser .attachments .attachment.selected.details').data('id');
                if(att_selected == undefined) {
                    att_selected = $('[id^="__wp-uploader-id-"]:visible .attachment-details').data('id');
                }
                var wpmf_caption = $('.attachment-details .setting[data-setting="caption"] textarea').val();
                var wpmf_desc = $('.attachment-details .setting[data-setting="description"] textarea').val();
                var wpmf_alt = $('.attachment-details .setting[data-setting="alt"] input[type="text"]').val();
                var wpmf_title = $('.attachment-details .setting[data-setting="title"] input[type="text"]').val();
                
                if($(this).hasClass('button-wpmfreplace')){
                    $(this).removeClass('button-wpmfreplace noreplace').addClass('replace button-wpmfcancel').data('replace',1).text('Cancel');
                    $('.replace_drag').show();
                    var wpmf_replace = 1;
                    var wpmf_action = 'replace_image';
                }else{
                    $(this).removeClass('replace button-wpmfcancel').addClass('button-wpmfreplace noreplace').data('replace',0).text('Replace');
                    $('.replace_drag').hide();
                    var wpmf_replace = 0;
                    var wpmf_action = 'noreplace_image';
                }

                $.ajax({
                    type: 'POST',
                    url : ajaxurl,
                    data: {
                        'action': wpmf_action,
                        'wpmf_replace' : wpmf_replace,
                        'att_selected' : att_selected,
                        'wpmf_caption' : wpmf_caption,
                        'wpmf_desc' : wpmf_desc,
                        'wpmf_alt' : wpmf_alt,
                        'wpmf_title' : wpmf_title
                    }
                });
            });
        }
        
        bindselectchange();
    });
}(jQuery));