ACC SHELL

Path : /srv/www/vhosts/rozzo/wp-content/themes/amplius/coffee-framework/scripts/
File Upload :
Current File : //srv/www/vhosts/rozzo/wp-content/themes/amplius/coffee-framework/scripts/upload-button.js

jQuery(document).ready(function($){
	
	$('.coffee-metabox-table .button').click(function() {
		var button = $(this),
		    tbURL = $('#content-add_media').attr('href');
		    
		if( typeof tbURL === 'undefined' ) {
		    tbURL = $('#add_image').attr('href');
		}

		if( $(this).attr('id') != 'coffee_images_upload' ) {
		    window.send_to_editor = function(html) {
    			var imgurl = $('img', html).attr('src');
    			var id = button.attr('id').replace('_button', '');
    			$('#'+ id).val(imgurl);
    			tb_remove();
    		}
    		
    		tb_show('', 'media-upload.php?post_id=0&type=image&TB_iframe=true');
    		
	    } else {
	        tb_show('', tbURL);
	    }
		
		return false;
	});

});

ACC SHELL 2018